FRED
Vaccine.h
00001 /*
00002  Copyright 2009 by the University of Pittsburgh
00003  Licensed under the Academic Free License version 3.0
00004  See the file "LICENSE" for more information
00005  */
00006 
00007 //
00008 //
00009 // File: VaccineDose.h
00010 //
00011 
00012 #ifndef _FRED_VACCINE_H
00013 #define _FRED_VACCINE_H
00014 
00015 #include "Global.h"
00016 #include <stdlib.h>
00017 #include <stdio.h>
00018 #include <string>
00019 #include <vector>
00020 
00021 using namespace std;
00022 
00023 class Vaccine_Dose;
00024 
00025 class Vaccine{
00026 public:
00027   // Creation
00028   Vaccine(string _name, int _id, int _disease, 
00029           int _total_avail, int _additional_per_day, int _start_day);
00030   ~Vaccine();
00031   
00032   void add_dose(Vaccine_Dose* dose);
00033   
00034   int get_disease()                 const { return disease; }
00035   int get_ID()                     const { return id; }
00036   int get_number_doses()           const { return doses.size(); }
00037   Vaccine_Dose* get_dose(int i)    const { return doses[i]; }
00038   
00039   // Logistics Functions
00040   int get_initial_stock()          const { return initial_stock; }
00041   int get_total_avail()            const { return total_avail; }
00042   int get_current_reserve()        const { return reserve; }
00043   int get_current_stock()          const { return stock; }
00044   int get_additional_per_day()     const { return additional_per_day; }
00045   void add_stock( int add ){ 
00046     if(add <= reserve){
00047       stock   += add;
00048       reserve -= add;
00049     }
00050     else{
00051       stock   += reserve;
00052       reserve  = 0;
00053     }
00054   }
00055   
00056   void remove_stock( int remove ) {
00057     stock-=remove;
00058     if(stock < 0) stock = 0;
00059   }
00060   
00061   //Utility Functions
00062   void print() const;
00063   void update(int day);
00064   void reset();
00065   
00066 private:
00067   string name;
00068   int id;                              // Which in the number of vaccines is it
00069   int disease;                          // Which Disease is this vaccine for
00070   int number_doses;                    // How many doses does the vaccine need.
00071   //int ages[2];                         // Applicable Ages
00072   vector < Vaccine_Dose* > doses;       // Data structure to hold the efficacy of each dose.
00073   
00074   int initial_stock;                   // How much available at the beginning
00075   int total_avail;                     // How much total in reserve
00076   int stock;                           // How much do you currently have
00077   int reserve;                         // How much is still left to system
00078   int additional_per_day;              // How much can be introduced into the system on a given day
00079   
00080   int start_day;                       // When to start production
00081   
00082   // for statistics
00083   int number_delivered;
00084   int number_effective;
00085         
00086 protected:
00087         Vaccine() { }
00088 };
00089 
00090 #endif
 All Classes Functions