FRED
|
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: Antiviral.h 00010 // 00011 #ifndef _FRED_ANTIVIRAL_H 00012 #define _FRED_ANTIVIRAL_H 00013 00014 #include "Global.h" 00015 #include <vector> 00016 #include <stdio.h> 00017 #include <iostream> 00018 00019 using namespace std; 00020 00021 class Disease; 00022 class Health; 00023 class Policy; 00024 class AV_Health; 00025 00030 class Antiviral { 00031 00032 public: 00033 //Creation 00037 Antiviral(int _disease, int _course_length, double _reduce_infectivity, 00038 double _reduce_susceptibility, double _reduce_asymp_period, 00039 double _reduce_sympt_period, double _prob_symptoms, 00040 int _initial_stock, int _total_avail, int _additional_per_day, 00041 double _efficacy, double* _av_cousre_start_day, 00042 int _max_av_course_start_day, int _start_day, bool _prophylaxis, 00043 double _percent_symptomatics); 00044 00045 ~Antiviral() { 00046 if (av_course_start_day) delete[] av_course_start_day; 00047 } 00048 00049 //Parameter Access Members 00053 int get_disease() const { return disease;} 00054 00058 double get_reduce_infectivity() const { return reduce_infectivity;} 00059 00063 double get_reduce_susceptibility() const { return reduce_susceptibility;} 00064 00068 double get_reduce_asymp_period() const { return reduce_asymp_period;} 00069 00073 double get_reduce_symp_period() const { return reduce_symp_period;} 00074 00078 double get_prob_symptoms() const { return prob_symptoms;} 00079 00083 int get_course_length() const { return course_length;} 00084 00088 double get_percent_symptomatics() const { return percent_symptomatics;} 00089 00093 double get_efficacy() const { return efficacy;} 00094 00098 int get_start_day() const { return start_day;} 00099 00103 bool is_prophylaxis() const { return prophylaxis;} 00104 00105 // Roll operators 00111 int roll_will_have_symp() const; 00112 00118 int roll_efficacy() const; 00119 00125 int roll_course_start_day() const; 00126 00127 // Logistics Functions 00131 int get_initial_stock() const { return initial_stock;} 00132 00136 int get_total_avail() const { return total_avail;} 00137 00141 int get_current_reserve() const { return reserve;} 00142 00146 int get_current_stock() const { return stock;} 00147 00151 int get_additional_per_day() const { return additional_per_day;} 00152 00156 void add_stock( int amount ) { 00157 if(amount < reserve) { 00158 stock += amount; 00159 reserve -= amount; 00160 } 00161 else { 00162 stock += reserve; 00163 reserve = 0; 00164 } 00165 } 00166 00170 void remove_stock(int remove) { 00171 stock -= remove; 00172 00173 if(stock < 0) stock = 0; 00174 } 00175 00176 // Utility Functions 00182 void update(int day); 00183 00187 void print() const; 00188 00192 void reset(); 00193 00199 void report(int day) const; 00200 00208 int quality_control(int ndiseases) const; 00209 00213 void print_stocks() const; 00214 00215 //Effect the Health of Person 00223 void effect(Health *h, int cur_day, AV_Health* av_health); 00224 00231 void modify_susceptiblilty(Health *health, int disease); 00232 00239 void modify_infectivity(Health *health, int disease); 00240 00248 void modify_infectivity_strain(Health *health, int disease, int strain); 00249 00257 void modify_symptomaticity(Health *health, int disease, int cur_day); 00258 00259 // Policies members 00260 // Antivirals need a policy associated with them to determine who gets them. 00266 void set_policy(Policy* p) {policy = p;} 00267 00271 Policy* get_policy() const {return policy;} 00272 00273 // To Be depricated 00274 void add_given_out(int amount) {given_out+=amount;} 00275 void add_ineff_given_out(int amount) {ineff_given_out+=amount;} 00276 00277 private: 00278 int disease; 00279 int course_length; // How many days mush one take the AV 00280 double reduce_infectivity; // What percentage does it reduce infectivity 00281 double reduce_susceptibility; // What percentage does it reduce susceptability 00282 double reduce_infectious_period; // What percentage does AV reduce infectious period 00283 double percent_symptomatics; // Percentage of symptomatics receiving this drug 00284 double reduce_asymp_period; // What percentage does it reduce the asymptomatic period 00285 double reduce_symp_period; // What percentage does it reduce the symptomatic period 00286 double prob_symptoms; // What is the probability of being symptomatic 00287 double efficacy; // The effectiveness of the AV (resistance) 00288 int max_av_course_start_day; // Maximum start day 00289 double* av_course_start_day; // Probabilistic AV start 00290 00291 private: 00292 //Logistics 00293 int initial_stock; // Amount of AV at day 0 00294 int stock; // Amount of AV currently available 00295 int additional_per_day; // Amount of AV added to the system per day 00296 int total_avail; // The total amount available to the simulation 00297 int reserve; // Amount of AV left unused 00298 int start_day; // Day that AV is available to the system 00299 00300 00301 //Policy variables 00302 bool prophylaxis; // Is this AV allowed for prophylaxis 00303 int percent_of_symptomatics; // Percent of symptomatics that get this AV as treatment 00304 00305 // For Statistics 00306 int given_out; 00307 int ineff_given_out; 00308 00309 //Policy 00310 Policy* policy; 00311 00312 //To Do... Hospitalization based policy 00313 protected: 00314 Antiviral() { } 00315 }; 00316 #endif // _FRED_ANTIVIRAL_H