FRED
Global.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 // File: Global.h
00009 //
00010 #ifndef _FRED_GLOBAL_H
00011 #define _FRED_GLOBAL_H
00012 
00013 #include <stdio.h>
00014 #include <err.h>
00015 #include <errno.h>
00016 #include <sys/stat.h>
00017 #include <assert.h>
00018 
00019 // for unit testing, use the line in Makefile: gcc -DUNITTEST ...
00020 #ifdef UNITTEST
00021 #define UNIT_TEST_VIRTUAL virtual
00022 #else
00023 #define UNIT_TEST_VIRTUAL
00024 #endif
00025 
00026 class Population;
00027 class Place_List;
00028 class Grid;
00029 class Large_Grid;
00030 class Small_Grid;
00031 class Date;
00032 class Evolution;
00033 class Seasonality;
00034 
00044 class Global {
00045   public:
00046     // global constants
00047     static const int DAYS_PER_WEEK = 7;
00048     static const int ADULT_AGE = 18;
00049     static const int SCHOOL_AGE = 5;
00050     static const int RETIREMENT_AGE = 67;
00051 
00052     // household relationship codes
00053     static const int HOUSEHOLDER = 1;
00054     static const int SPOUSE = 2;
00055     static const int NATURAL_CHILD = 3;
00056     static const int ADOPTED_CHILD = 4;
00057     static const int STEP_CHILD = 5;
00058     static const int SIBLING = 6;
00059     static const int PARENT = 7;
00060     static const int GRANDCHILD = 8;
00061     static const int PARENT_IN_LAW = 9;
00062     static const int SON_DAUGHTER_IN_LAW = 10;
00063     static const int OTHER_RELATIVE = 11;
00064     static const int BROTHER_SISTER_IN_LAW = 12;
00065     static const int NEPHEW_NIECE = 13;
00066     static const int GRANDPARENT = 14;
00067     static const int UNCLE_AUNT = 15;
00068     static const int COUSIN = 16;
00069     static const int BOARDER = 17;
00070     static const int HOUSEHMATE = 18;
00071     static const int PARTNER = 19;
00072     static const int FOSTER_CHILD = 20;
00073     static const int NON_RELATIVE = 21;
00074 
00075     // global runtime parameters
00076     static char Population_directory[];
00077     static char Output_directory[];
00078     static char Tracefilebase[];
00079     static char VaccineTracefilebase[];
00080     static int Incremental_Trace;
00081     static int Trace_Headers;
00082     static int Random_start_day;
00083     static int Quality_control;
00084     static int RR_delay;
00085     static int Diseases;
00086     static int StrainEvolution;
00087     static char Prevfilebase[];
00088     static char Incfilebase[];
00089     static char ErrorLogbase[];
00090     static int Enable_Behaviors;
00091     static int Track_infection_events;
00092     static int Track_age_distribution;
00093     static int Track_household_distribution;
00094     static int Track_network_stats;
00095     static int Verbose;
00096     static int Debug;
00097     static int Test;
00098     static int Days;
00099     static int Reseed_day;
00100     static unsigned long Seed;
00101     static char Start_date[];
00102     static int Epidemic_offset;
00103     static int Vaccine_offset;
00104     static char Seasonality_Timestep[];
00105     static double Work_absenteeism;
00106     static double School_absenteeism;
00107 
00108     //Boolean flags
00109     static bool Enable_Large_Grid;
00110     static bool Enable_Small_Grid;
00111     static bool Enable_Aging;
00112     static bool Enable_Births;
00113     static bool Enable_Deaths;
00114     static bool Enable_Migration;
00115     static bool Enable_Mobility;
00116     static bool Enable_Travel;
00117     static bool Enable_Local_Workplace_Assignment;
00118     static bool Enable_Seasonality;
00119     static bool Enable_Climate;
00120 
00121     // global singleton objects
00122     static Population Pop;
00123     static Place_List Places;
00124     static Grid *Cells;
00125     static Large_Grid *Large_Cells;
00126     static Small_Grid *Small_Cells;
00127     static Date *Sim_Date;
00128     static Evolution *Evol;
00129     static Seasonality *Clim;
00130 
00131     // global file pointers
00132     static FILE *Statusfp;
00133     static FILE *Outfp;
00134     static FILE *Tracefp;
00135     static FILE *Infectionfp;
00136     static FILE *VaccineTracefp;
00137     static FILE *Birthfp;
00138     static FILE *Deathfp;
00139     static FILE *Prevfp;
00140     static FILE *Incfp;
00141     static FILE *ErrorLogfp;
00142 
00143 
00147     static void get_global_parameters();
00148 };
00149 
00150 #endif // _FRED_GLOBAL_H
 All Classes Functions