diff --git a/src/CLI.cpp b/src/CLI.cpp index b205a01b4..7f390df0a 100644 --- a/src/CLI.cpp +++ b/src/CLI.cpp @@ -10,6 +10,11 @@ #include "Error.h" #include "Param.h" +void parse_string(std::string const& input, std::string& output) +{ + output = input; +} + void parse_read_file(std::string const& input, std::string& output) { // check to see if the file exists and error out if it doesn't @@ -173,11 +178,26 @@ Optional arguments: void CmdLineArgs::print_help() { + // Wes: Temporary hack to reduce the number of /CLP: on the help text. + int clp_flag = 0; + const std::string CLP = "CLP"; std::stringstream ss; + ss << "CovidSim"; for (auto const& it : option_map_) { - ss << " [/" << it.first << ']'; + std::string option = it.first; + std::string option_first_3 = option.substr(0, 3); + + if (option_first_3.compare(CLP) == 0) { + if (clp_flag == 0) { + ss << " [/CLP:00] .. [/CLP:99]"; + clp_flag = 1; + } + } + else { + ss << " [/" << option << ']'; + } } std::cerr << ss.str() << ' ' << USAGE << std::endl; } diff --git a/src/CLI.h b/src/CLI.h index 2d896e376..3cf868ef6 100644 --- a/src/CLI.h +++ b/src/CLI.h @@ -22,6 +22,11 @@ void parse_read_file(std::string const& input, std::string& output); */ void parse_write_dir(std::string const& input, std::string& output); +/** + * handles general string. + */ +void parse_string(std::string const& input, std::string& output); + /** * Parses and checks if the input string is an integer. */ diff --git a/src/CalcInfSusc.cpp b/src/CalcInfSusc.cpp index 5bcee58bf..3a8468d35 100644 --- a/src/CalcInfSusc.cpp +++ b/src/CalcInfSusc.cpp @@ -14,25 +14,33 @@ double CalcHouseInf(int j, unsigned short int ts) return ((HOST_ISOLATED(j) && (Hosts[j].digitalContactTraced != 1)) ? P.CaseIsolationHouseEffectiveness : 1.0) * ((Hosts[j].digitalContactTraced==1) ? P.DCTCaseIsolationHouseEffectiveness : 1.0) * ((HOST_QUARANTINED(j) && (Hosts[j].digitalContactTraced != 1) && (!(HOST_ISOLATED(j))))? P.HQuarantineHouseEffect : 1.0) - * P.HouseholdDenomLookup[Households[Hosts[j].hh].nhr - 1] * CalcPersonInf(j, ts); + * P.HouseholdDenomLookup[Households[Hosts[j].hh].nhr - 1] + * ((Hosts[j].care_home_resident) ? P.CareHomeResidentHouseholdScaling : 1.0) + * (HOST_TREATED(j) ? P.TreatInfDrop : 1.0) + * (HOST_VACCED(j) ? P.VaccInfDrop : 1.0) + * ((P.NoInfectiousnessSDinHH)? ((Hosts[j].infectiousness < 0) ? P.SymptInfectiousness : P.AsymptInfectiousness):fabs(Hosts[j].infectiousness)) // removed call to CalcPersonInf to allow infectiousness to be const in hh + * P.infectiousness[ts - Hosts[j].latent_time - 1]; } + double CalcPlaceInf(int j, int k, unsigned short int ts) { return ((HOST_ISOLATED(j) && (Hosts[j].digitalContactTraced != 1)) ? P.CaseIsolationEffectiveness : 1.0) * ((Hosts[j].digitalContactTraced==1) ? P.DCTCaseIsolationEffectiveness : 1.0) - * ((HOST_QUARANTINED(j) && (Hosts[j].digitalContactTraced != 1) && (!(HOST_ISOLATED(j)))) ? P.HQuarantinePlaceEffect[k] : 1.0) - * ((Hosts[j].inf == InfStat_Case) ? P.SymptPlaceTypeContactRate[k] : 1.0) + * ((HOST_QUARANTINED(j) && (!Hosts[j].care_home_resident) && (Hosts[j].digitalContactTraced != 1) && (!(HOST_ISOLATED(j)))) ? P.HQuarantinePlaceEffect[k] : 1.0) + * (((Hosts[j].inf == InfStat_Case) && (!Hosts[j].care_home_resident)) ? P.SymptPlaceTypeContactRate[k] : 1.0) * P.PlaceTypeTrans[k] / P.PlaceTypeGroupSizeParam1[k] * CalcPersonInf(j, ts); } + double CalcSpatialInf(int j, unsigned short int ts) { return ((HOST_ISOLATED(j) && (Hosts[j].digitalContactTraced != 1)) ? P.CaseIsolationEffectiveness : 1.0) * ((Hosts[j].digitalContactTraced==1) ? P.DCTCaseIsolationEffectiveness : 1.0) - * ((HOST_QUARANTINED(j) && (Hosts[j].digitalContactTraced != 1) && (!(HOST_ISOLATED(j)))) ? P.HQuarantineSpatialEffect : 1.0) + * ((HOST_QUARANTINED(j) && (!Hosts[j].care_home_resident) && (Hosts[j].digitalContactTraced != 1) && (!(HOST_ISOLATED(j)))) ? P.HQuarantineSpatialEffect : 1.0) * ((Hosts[j].inf == InfStat_Case) ? P.SymptSpatialContactRate : 1.0) * P.RelativeSpatialContact[HOST_AGE_GROUP(j)] * CalcPersonInf(j, ts); /* *Hosts[j].spatial_norm */ } + double CalcPersonInf(int j, unsigned short int ts) { return (HOST_TREATED(j) ? P.TreatInfDrop : 1.0) @@ -47,19 +55,20 @@ double CalcHouseSusc(int ai, unsigned short int ts, int infector, int tn) { return CalcPersonSusc(ai, ts, infector, tn) * ((Mcells[Hosts[ai].mcell].socdist == 2) ? ((Hosts[ai].esocdist_comply) ? P.EnhancedSocDistHouseholdEffectCurrent : P.SocDistHouseholdEffectCurrent) : 1.0) - * (Hosts[ai].digitalContactTraced==1 ? P.DCTCaseIsolationHouseEffectiveness : 1.0); + * ((Hosts[ai].digitalContactTraced==1) ? P.DCTCaseIsolationHouseEffectiveness : 1.0) + * ((Hosts[ai].care_home_resident) ? P.CareHomeResidentHouseholdScaling : 1.0); } double CalcPlaceSusc(int ai, int k, unsigned short int ts, int infector, int tn) { - return ((HOST_QUARANTINED(ai) && (Hosts[ai].digitalContactTraced != 1)) ? P.HQuarantinePlaceEffect[k] : 1.0) + return ((HOST_QUARANTINED(ai) && (!Hosts[ai].care_home_resident) && (Hosts[ai].digitalContactTraced != 1)) ? P.HQuarantinePlaceEffect[k] : 1.0) * ((Mcells[Hosts[ai].mcell].socdist == 2) ? ((Hosts[ai].esocdist_comply) ? P.EnhancedSocDistPlaceEffectCurrent[k] : P.SocDistPlaceEffectCurrent[k]) : 1.0) - * (Hosts[ai].digitalContactTraced==1 ? P.DCTCaseIsolationEffectiveness : 1.0); + * ((Hosts[ai].digitalContactTraced==1) ? P.DCTCaseIsolationEffectiveness : 1.0); } double CalcSpatialSusc(int ai, unsigned short int ts, int infector, int tn) { - return ((HOST_QUARANTINED(ai) && (Hosts[ai].digitalContactTraced != 1)) ? P.HQuarantineSpatialEffect : 1.0) + return ((HOST_QUARANTINED(ai) && (!Hosts[ai].care_home_resident) && (Hosts[ai].digitalContactTraced != 1)) ? P.HQuarantineSpatialEffect : 1.0) * ((Mcells[Hosts[ai].mcell].socdist == 2) ? ((Hosts[ai].esocdist_comply) ? P.EnhancedSocDistSpatialEffectCurrent : P.SocDistSpatialEffectCurrent) : 1.0) - * (Hosts[ai].digitalContactTraced==1 ? P.DCTCaseIsolationEffectiveness : 1.0); + * ((Hosts[ai].digitalContactTraced == 1) ? P.DCTCaseIsolationEffectiveness : 1.0); } double CalcPersonSusc(int ai, unsigned short int ts, int infector, int tn) { diff --git a/src/Constants.h b/src/Constants.h index 678ea161e..17a40fbb8 100644 --- a/src/Constants.h +++ b/src/Constants.h @@ -67,6 +67,8 @@ const int OUTPUT_DIST_SCALE = 1000; const int MAX_PLACE_SIZE = 20000; const int MAX_NUM_SEED_LOCATIONS = 10000; +const int MAX_CLP_COPIES = 50; + const int CDF_RES = 20; const int INFPROF_RES = 56; diff --git a/src/Country.h b/src/Country.h index e3ff6ac70..aadd0c32e 100644 --- a/src/Country.h +++ b/src/Country.h @@ -8,7 +8,7 @@ const int MAX_INTERVENTIONS_PER_ADUNIT = 10; const int ADUNIT_LOOKUP_SIZE = 1000000; const int MAX_COUNTRIES = 100; -const int NUM_PLACE_TYPES = 4; +const int NUM_PLACE_TYPES = 5; const int MAX_ADUNITS = 3200; // Maximal absent time - used for array sizing diff --git a/src/CovidSim.cpp b/src/CovidSim.cpp index 11f2cc9f3..1906a4719 100644 --- a/src/CovidSim.cpp +++ b/src/CovidSim.cpp @@ -54,7 +54,7 @@ void InitModel(int); //adding run number as a parameter for event log: ggilani - void SeedInfection(double, int*, int, int); //adding run number as a parameter for event log: ggilani - 15/10/2014 int RunModel(int, std::string const&, std::string const&, std::string const&); -void SaveDistribs(void); +void SaveDistribs(std::string const&); void SaveOriginDestMatrix(std::string const&); //added function to save origin destination matrix so it can be done separately to the main results: ggilani - 13/02/15 void SaveResults(std::string const&); void SaveSummaryResults(std::string const&); @@ -63,8 +63,10 @@ void SaveEvents(std::string const&); //added this function to save infection eve void LoadSnapshot(std::string const&); void SaveSnapshot(std::string const&); void RecordInfTypes(void); -void RecordSample(double, int, std::string const&); +void RecordSample(double, int, std::string const&); +void CalibrationThresholdCheck(double, int); +void CalcLikelihood(int, std::string const&, std::string const&); void CalcOriginDestMatrix_adunit(void); //added function to calculate origin destination matrix: ggilani 28/01/15 int GetInputParameter(FILE*, FILE*, const char*, const char*, void*, int, int, int); @@ -122,16 +124,23 @@ std::vector InterventionFiles; // default start value for icdf double arrays (was hardcoded as 100) const double ICDF_START = 100.0; -void GetInverseCdf(FILE* param_file_dat, FILE* preparam_file_dat, const char* icdf_name, InverseCdf* inverseCdf, - double start_value = ICDF_START); +void GetInverseCdf(FILE* param_file_dat, FILE* preparam_file_dat, const char* icdf_name, InverseCdf* inverseCdf, double start_value = ICDF_START); int main(int argc, char* argv[]) { - std::string ad_unit_file, air_travel_file, density_file, load_network_file, out_density_file; - std::string output_file_base, param_file, pre_param_file, reg_demog_file, save_network_file, school_file; + ///// Flags to ensure various parameters have been read; set to false as default. + std::string pre_param_file, param_file, density_file, load_network_file, save_network_file, air_travel_file, school_file; + std::string reg_demog_file, fit_file, data_file; + std::string ad_unit_file, out_density_file, output_file_base; + std::string snapshot_load_file, snapshot_save_file; + + int StopFit = 0; + ///// Flags to ensure various parameters have been read; set to false as default. int GotNR = 0; + int GotFI = 0; - std::string snapshot_load_file, snapshot_save_file; + ///// Read in command line arguments - lots of things, e.g. random number seeds; (pre)parameter files; binary files; population data; output directory? etc. + P.FitIter = 0; auto parse_snapshot_save_option = [&snapshot_save_file](std::string const& input) { auto sep = input.find_first_of(','); if (sep == std::string::npos) { @@ -154,11 +163,12 @@ int main(int argc, char* argv[]) // Set parameter defaults - read them in after P.PlaceCloseIndepThresh = P.MaxNumThreads = 0; - P.CaseOrDeathThresholdBeforeAlert = 0; + P.CaseOrDeathThresholdBeforeAlert_CommandLine = 0; P.R0scale = 1.0; // added this so that kernel parameters are only changed if input from // the command line: ggilani - 15/10/2014 P.KernelOffsetScale = P.KernelPowerScale = 1.0; + P.DoLoadSnapshot = 0; CmdLineArgs args; args.add_string_option("A", parse_read_file, ad_unit_file, "Administrative Division"); @@ -166,14 +176,28 @@ int main(int argc, char* argv[]) args.add_custom_option("BM", parse_bmp_option, "Bitmap format to use [PNG,BMP]"); args.add_integer_option("c", P.MaxNumThreads, "Number of threads to use"); args.add_integer_option("C", P.PlaceCloseIndepThresh, "Sets the P.PlaceCloseIndepThresh parameter"); - args.add_double_option("CLP1", P.clP[0], "Overwrites #1 wildcard in parameter file"); - args.add_double_option("CLP2", P.clP[1], "Overwrites #2 wildcard in parameter file"); - args.add_double_option("CLP3", P.clP[2], "Overwrites #3 wildcard in parameter file"); - args.add_double_option("CLP4", P.clP[3], "Overwrites #4 wildcard in parameter file"); - args.add_double_option("CLP5", P.clP[4], "Overwrites #5 wildcard in parameter file"); - args.add_double_option("CLP6", P.clP[5], "Overwrites #6 wildcard in parameter file"); + + /* Wes: Need to allow /CLPxx up to 99. I'll do this naively for now and prevent the help text from + looking overly verybose. To satisfiy all behaviour, /CLP0: to /CLP9: should do the + same as /CLP00: to /CLP09: - both valid, as are /CLP10: to /CLP99: + I am not going to address here what happens if you specify both /CLP05: and /CLP5: + */ + + for (int i = 0; i <= 99; i++) { + std::string param = "CLP" + std::to_string(i); + std::string description = "Overwrites #" + std::to_string(i) + " wildcard in parameter file"; + args.add_double_option(param, P.clP[i], description); + if (i < 10) { + param = "CLP0" + std::to_string(i); + args.add_double_option(param, P.clP[i], description); + } + } + args.add_string_option("d", parse_read_file, reg_demog_file, "Regional demography file"); args.add_string_option("D", parse_read_file, density_file, "Population density file"); + args.add_string_option("DT", parse_read_file, data_file, "Likelihood data file"); + args.add_string_option("F", parse_string, fit_file, "Fitting file"); + args.add_integer_option("FI", GotFI, "Initial MCMC iteration"); args.add_custom_option("I", parse_intervention_file_option, "Intervention file"); // added Kernel Power and Offset scaling so that it can easily // be altered from the command line in order to vary the kernel @@ -184,14 +208,14 @@ int main(int argc, char* argv[]) args.add_string_option("LS", parse_read_file, snapshot_load_file, "Snapshot file to load"); args.add_string_option("M", parse_write_dir, out_density_file, "Output density file"); args.add_integer_option("NR", GotNR, "Number of realisations"); - args.add_string_option("O", parse_write_dir, output_file_base, "Output file path prefix"); + args.add_string_option("O", parse_string, output_file_base, "Output file path prefix"); args.add_string_option("P", parse_read_file, param_file, "Parameter file"); args.add_string_option("PP", parse_read_file, pre_param_file, "Pre-Parameter file"); args.add_double_option("R", P.R0scale, "R0 scaling"); args.add_string_option("s", parse_read_file, school_file, "School file"); args.add_string_option("S", parse_write_dir, save_network_file, "Network file to save"); args.add_custom_option("SS", parse_snapshot_save_option, "Interval and file to save snapshots [double,string]"); - args.add_integer_option("T", P.CaseOrDeathThresholdBeforeAlert, "Sets the P.CaseOrDeathThresholdBeforeAlert parameter"); + args.add_integer_option("T", P.CaseOrDeathThresholdBeforeAlert_CommandLine, "Sets the P.CaseOrDeathThresholdBeforeAlert parameter"); args.parse(argc, argv, P); // Check if S and L options were both specified (can only be one) @@ -244,7 +268,6 @@ int main(int argc, char* argv[]) //// **** READ IN PARAMETERS, DATA ETC. //// **** //// **** //// **** //// **** //// **** //// **** //// **** //// **** //// **** //// **** //// **** //// **** //// **** //// **** - P.NumRealisations = GotNR; ReadParams(param_file, pre_param_file, ad_unit_file); if (P.DoAirports) @@ -261,111 +284,138 @@ int main(int argc, char* argv[]) ///// initialize model (for all realisations). SetupModel(density_file, out_density_file, load_network_file, save_network_file, school_file, reg_demog_file, output_file_base); - + InitTransmissionCoeffs(); for (int i = 0; i < MAX_ADUNITS; i++) AdUnits[i].NI = 0; for (auto const& int_file : InterventionFiles) ReadInterventions(int_file); fprintf(stderr, "Model setup in %lf seconds\n", ((double)(clock() - cl)) / CLOCKS_PER_SEC); - //print out number of calls to random number generator + //// **** //// **** //// **** //// **** //// **** //// **** //// **** //// **** //// **** //// **** //// **** //// **** //// **** //// **** //// **** RUN MODEL //// **** //// **** //// **** //// **** //// **** //// **** //// **** //// **** //// **** //// **** //// **** //// **** //// **** //// **** - P.NRactE = P.NRactNE = 0; - auto run_output_file_base = output_file_base; - for (int i = 0; (i < P.NumRealisations) && (P.NRactNE < P.NumNonExtinctRealisations); i++) + + std::string output_file_base_f = output_file_base; // output_file_base_f remembers the original, as output_file_base changes with fitting. + std::string output_file; // Historically, this was global, and was used for all save...(void) type functions. + + do { - if (P.NumRealisations > 1) - { - run_output_file_base = output_file_base + "." + std::to_string(i); - fprintf(stderr, "Realisation %i of %i (time=%lf nr_ne=%i)\n", i + 1, P.NumRealisations, ((double)(clock() - cl)) / CLOCKS_PER_SEC, P.NRactNE); - } - P.StopCalibration = P.ModelCalibIteration = 0; // needed for calibration to work for multiple realisations - P.HolidaysStartDay_SimTime = 0; // needed for calibration to work for multiple realisations - P.CaseOrDeathThresholdBeforeAlert = P.CaseOrDeathThresholdBeforeAlert_Fixed; // needed for calibration to work for multiple realisations - P.SeedingScaling = 1.0; // needed for calibration to work for multiple realisations - ///// Set and save seeds - if (i == 0 || (P.ResetSeeds && P.KeepSameSeeds)) + P.FitIter++; + if (!fit_file.empty()) { - P.nextRunSeed1 = P.runSeed1; - P.nextRunSeed2 = P.runSeed2; - } - if (P.ResetSeeds) { - //save these seeds to file - SaveRandomSeeds(run_output_file_base); - } - // Now that we have set P.nextRunSeed* ready for the run, we need to save the values in case - // we need to reinitialise the RNG after the run is interrupted. - int32_t thisRunSeed1 = P.nextRunSeed1; - int32_t thisRunSeed2 = P.nextRunSeed2; -// if (i == 0 || P.ResetSeeds) - setall(&P.nextRunSeed1, &P.nextRunSeed2); - - ///// initialize model (for this realisation). - InitModel(i); //passing run number into RunModel so we can save run number in the infection event log: ggilani - 15/10/2014 - if (!snapshot_load_file.empty()) LoadSnapshot(snapshot_load_file); - int ModelCalibLoop = 0; - while (RunModel(i, snapshot_save_file, snapshot_load_file, run_output_file_base)) - { // has been interrupted to reset holiday time. Note that this currently only happens in the first run, regardless of how many realisations are being run. - if ((P.ModelCalibIteration == 10) && (ModelCalibLoop < 3)) + if (GotFI) { - thisRunSeed1 = P.nextRunSeed1; - thisRunSeed2 = P.nextRunSeed2; - setall(&P.nextRunSeed1, &P.nextRunSeed2); - P.ModelCalibIteration = 0; // needed for calibration to work for multiple realisations - P.HolidaysStartDay_SimTime = 0; // needed for calibration to work for multiple realisations - P.CaseOrDeathThresholdBeforeAlert = P.CaseOrDeathThresholdBeforeAlert_Fixed; // needed for calibration to work for multiple realisations - P.SeedingScaling = 1.0; // needed for calibration to work for multiple realisations - ModelCalibLoop++; + P.FitIter = GotFI; + GotFI = 0; + P.nextRunSeed1 = P.runSeed1; + P.nextRunSeed2 = P.runSeed2; } - else + StopFit = ReadFitIter(fit_file); + if (!StopFit) { - int32_t tmp1 = thisRunSeed1; - int32_t tmp2 = thisRunSeed2; - setall(&tmp1, &tmp2); // reset random number seeds to generate same run again after calibration. + ReadParams(param_file, pre_param_file, ad_unit_file); + if (!P.FixLocalBeta) InitTransmissionCoeffs(); + output_file_base = output_file_base_f + ".f" + std::to_string(P.FitIter); } - InitModel(i); } - if (P.OutputNonSummaryResults) + else + StopFit = 1; + if ((fit_file.empty()) || (!StopFit)) { - if (((!TimeSeries[P.NumSamples - 1].extinct) || (!P.OutputOnlyNonExtinct)) && (P.OutputEveryRealisation)) + P.NRactE = P.NRactNE = 0; + ResetTimeSeries(); + for (int i = 0; (i < P.NumRealisations) && (P.NRactNE < P.NumNonExtinctRealisations); i++) { - SaveResults(run_output_file_base); + if (P.NumRealisations > 1) + { + output_file = output_file_base + "." + std::to_string(i); + fprintf(stderr, "Realisation %i of %i (time=%lf nr_ne=%i)\n", i + 1, P.NumRealisations, ((double)(clock() - cl)) / CLOCKS_PER_SEC, P.NRactNE); + } + ///// Set and save seeds + if (((i == 0) && (P.FitIter == 1)) || (P.ResetSeeds && P.KeepSameSeeds)) + { + P.nextRunSeed1 = P.runSeed1; + P.nextRunSeed2 = P.runSeed2; + } + if (P.ResetSeeds) { + //save these seeds to file + SaveRandomSeeds(output_file); + } + int32_t thisRunSeed1, thisRunSeed2; + int ContCalib, ModelCalibLoop = 0; + P.StopCalibration = P.ModelCalibIteration = ModelCalibLoop = 0; + do + { // has been interrupted to reset holiday time. Note that this currently only happens in the first run, regardless of how many realisations are being run. + if ((P.ModelCalibIteration%14 == 0) && (ModelCalibLoop < 4)) + { + thisRunSeed1 = P.nextRunSeed1; + thisRunSeed2 = P.nextRunSeed2; + setall(&P.nextRunSeed1, &P.nextRunSeed2); + P.HolidaysStartDay_SimTime = 0; // needed for calibration to work for multiple realisations + P.CaseOrDeathThresholdBeforeAlert = P.CaseOrDeathThresholdBeforeAlert_Fixed; // needed for calibration to work for multiple realisations + if (!P.DoNoCalibration) P.SeedingScaling = 1.0; // needed for calibration to work for multiple realisations + P.ModelCalibIteration = 0; // needed for calibration to work for multiple realisations + ModelCalibLoop++; + } + else + { + int32_t tmp1 = thisRunSeed1; + int32_t tmp2 = thisRunSeed2; + setall(&tmp1, &tmp2); // reset random number seeds to generate same run again after calibration. + } + InitModel(i); + if (!snapshot_load_file.empty()) LoadSnapshot(snapshot_load_file); + ContCalib = RunModel(i, snapshot_save_file, snapshot_load_file, output_file_base); + } + while (ContCalib); + if (!data_file.empty()) CalcLikelihood(i, data_file, output_file_base); + if (P.OutputNonSummaryResults) + { + if (((!TimeSeries[P.NumSamples - 1].extinct) || (!P.OutputOnlyNonExtinct)) && (P.OutputEveryRealisation)) + { + SaveResults(output_file); + } + } + if ((P.DoRecordInfEvents) && (P.RecordInfEventsPerRun == 1)) + { + SaveEvents(output_file); + } } - } - if ((P.DoRecordInfEvents) && (P.RecordInfEventsPerRun == 1)) - { - SaveEvents(run_output_file_base); - } - } + output_file = output_file_base + ".avNE"; + SaveSummaryResults(output_file); - //Calculate origin destination matrix if needed - if ((P.DoAdUnits) && (P.DoOriginDestinationMatrix)) - { - CalcOriginDestMatrix_adunit(); - SaveOriginDestMatrix(output_file_base); - } + //Calculate origin destination matrix if needed + if ((P.DoAdUnits) && (P.DoOriginDestinationMatrix)) + { + CalcOriginDestMatrix_adunit(); + SaveOriginDestMatrix(output_file); + } - P.NRactual = P.NRactNE; - TSMean = TSMeanNE; TSVar = TSVarNE; - if ((P.DoRecordInfEvents) && (P.RecordInfEventsPerRun == 0)) - { - SaveEvents(output_file_base); - } - SaveSummaryResults(output_file_base + ".avNE"); - P.NRactual = P.NRactE; - TSMean = TSMeanE; TSVar = TSVarE; - //SaveSummaryResults(output_file_base + ".avE"); + P.NRactual = P.NRactNE; + TSMean = TSMeanNE; TSVar = TSVarNE; + if ((P.DoRecordInfEvents) && (P.RecordInfEventsPerRun == 0)) + { + SaveEvents(output_file); + } - Bitmap_Finalise(); + SaveSummaryResults(output_file); + P.NRactual = P.NRactE; + //TSMean = TSMeanE; TSVar = TSVarE; + //sprintf(OutFile, "%s.avE", OutFileBase); + //SaveSummaryResults(); - fprintf(stderr, "Extinction in %i out of %i runs\n", P.NRactE, P.NRactNE + P.NRactE); - fprintf(stderr, "Model ran in %lf seconds\n", ((double)(clock() - cl)) / CLOCKS_PER_SEC); - fprintf(stderr, "Model finished\n"); + Bitmap_Finalise(); + + fprintf(stderr, "Extinction in %i out of %i runs\n", P.NRactE, P.NRactNE + P.NRactE); + fprintf(stderr, "Model ran in %lf seconds\n", ((double)(clock() - cl)) / CLOCKS_PER_SEC); + fprintf(stderr, "Model finished\n"); + } + } + while (!StopFit); } void parse_bmp_option(std::string const& input) { @@ -394,88 +444,100 @@ void parse_intervention_file_option(std::string const& input) { InterventionFiles.emplace_back(output); } -void ReadParams(std::string const& ParamFile, std::string const& PreParamFile, std::string const& ad_unit_file) +void ReadParams(std::string const& ParamFile, std::string const& PreParamFile, std::string const& AdUnitFile) { FILE* ParamFile_dat, * PreParamFile_dat, * AdminFile_dat; double s, t, AgeSuscScale; int i, j, j1, j2, k, f, nc, na; char CountryNameBuf[128 * MAX_COUNTRIES], AdunitListNamesBuf[128 * MAX_ADUNITS]; + char* CountryNames[MAX_COUNTRIES], * AdunitListNames[MAX_ADUNITS]; - char* CountryNames[MAX_COUNTRIES]; - for (i = 0; i < MAX_COUNTRIES; i++) { CountryNames[i] = CountryNameBuf + 128 * i; CountryNames[i][0] = 0; } - char* AdunitListNames[MAX_ADUNITS]; - for (i = 0; i < MAX_ADUNITS; i++) { AdunitListNames[i] = AdunitListNamesBuf + 128 * i; AdunitListNames[i][0] = 0; } + AgeSuscScale = 1.0; if (!(ParamFile_dat = fopen(ParamFile.c_str(), "rb"))) ERR_CRITICAL("Unable to open parameter file\n"); PreParamFile_dat = fopen(PreParamFile.c_str(), "rb"); - if (!(AdminFile_dat = fopen(ad_unit_file.c_str(), "rb"))) AdminFile_dat = ParamFile_dat; - if (!GetInputParameter2(ParamFile_dat, AdminFile_dat, "Longitude cut line", "%lf", (void*)&(P.LongitudeCutLine), 1, 1, 0)) { - P.LongitudeCutLine = -360.0; - } - AgeSuscScale = 1.0; - GetInputParameter(ParamFile_dat, PreParamFile_dat, "Update timestep", "%lf", (void*)&(P.TimeStep), 1, 1, 0); - GetInputParameter(ParamFile_dat, PreParamFile_dat, "Sampling timestep", "%lf", (void*)&(P.SampleStep), 1, 1, 0); - if (P.TimeStep > P.SampleStep) ERR_CRITICAL("Update step must be smaller than sampling step\n"); - t = ceil(P.SampleStep / P.TimeStep - 1e-6); - P.UpdatesPerSample = (int)t; - P.TimeStep = P.SampleStep / t; - P.TimeStepsPerDay = ceil(1.0 / P.TimeStep - 1e-6); - fprintf(stderr, "Update step = %lf\nSampling step = %lf\nUpdates per sample=%i\nTimeStepsPerDay=%lf\n", P.TimeStep, P.SampleStep, P.UpdatesPerSample, P.TimeStepsPerDay); - GetInputParameter(ParamFile_dat, PreParamFile_dat, "Sampling time", "%lf", (void*)&(P.SampleTime), 1, 1, 0); - P.NumSamples = 1 + (int)ceil(P.SampleTime / P.SampleStep); - GetInputParameter(PreParamFile_dat, AdminFile_dat, "Population size", "%i", (void*)&(P.PopSize), 1, 1, 0); - if (P.NumRealisations == 0) - { - GetInputParameter(ParamFile_dat, PreParamFile_dat, "Number of realisations", "%i", (void*)&(P.NumRealisations), 1, 1, 0); - if (!GetInputParameter2(ParamFile_dat, PreParamFile_dat, "Number of non-extinct realisations", "%i", (void*)&(P.NumNonExtinctRealisations), 1, 1, 0)) P.NumNonExtinctRealisations = P.NumRealisations; + if (!(AdminFile_dat = fopen(AdUnitFile.c_str(), "rb"))) AdminFile_dat = ParamFile_dat; + + if (P.FitIter == 0) + { + for (i = 0; i < MAX_COUNTRIES; i++) { + CountryNames[i] = CountryNameBuf + 128 * i; + CountryNames[i][0] = 0; + } + for (i = 0; i < MAX_ADUNITS; i++) { + AdunitListNames[i] = AdunitListNamesBuf + 128 * i; + AdunitListNames[i][0] = 0; + } + for (i = 0; i < 100; i++) P.clP_copies[i] = 0; + if (!GetInputParameter2(ParamFile_dat, AdminFile_dat, "Longitude cut line", "%lf", (void*)&(P.LongitudeCutLine), 1, 1, 0)) { + P.LongitudeCutLine = -360.0; + } + GetInputParameter(ParamFile_dat, PreParamFile_dat, "Update timestep", "%lf", (void*)&(P.TimeStep), 1, 1, 0); + GetInputParameter(ParamFile_dat, PreParamFile_dat, "Sampling timestep", "%lf", (void*)&(P.SampleStep), 1, 1, 0); + if (P.TimeStep > P.SampleStep) ERR_CRITICAL("Update step must be smaller than sampling step\n"); + t = ceil(P.SampleStep / P.TimeStep - 1e-6); + P.UpdatesPerSample = (int)t; + P.TimeStep = P.SampleStep / t; + P.TimeStepsPerDay = ceil(1.0 / P.TimeStep - 1e-6); + fprintf(stderr, "Update step = %lf\nSampling step = %lf\nUpdates per sample=%i\nTimeStepsPerDay=%lf\n", P.TimeStep, P.SampleStep, P.UpdatesPerSample, P.TimeStepsPerDay); + GetInputParameter(ParamFile_dat, PreParamFile_dat, "Sampling time", "%lf", (void*)&(P.SampleTime), 1, 1, 0); + P.NumSamples = 1 + (int)ceil(P.SampleTime / P.SampleStep); + GetInputParameter(PreParamFile_dat, AdminFile_dat, "Population size", "%i", (void*)&(P.PopSize), 1, 1, 0); + if (P.NumRealisations == 0) + { + GetInputParameter(ParamFile_dat, PreParamFile_dat, "Number of realisations", "%i", (void*)&(P.NumRealisations), 1, 1, 0); + if (!GetInputParameter2(ParamFile_dat, PreParamFile_dat, "Number of non-extinct realisations", "%i", (void*)&(P.NumNonExtinctRealisations), 1, 1, 0)) P.NumNonExtinctRealisations = P.NumRealisations; } - else - P.NumNonExtinctRealisations = P.NumRealisations; - if (!GetInputParameter2(ParamFile_dat, PreParamFile_dat, "Maximum number of cases defining small outbreak", "%i", (void*) & (P.SmallEpidemicCases), 1, 1, 0)) P.SmallEpidemicCases = -1; - - P.NC = -1; - GetInputParameter(ParamFile_dat, PreParamFile_dat, "Number of micro-cells per spatial cell width", "%i", (void*) & (P.NMCL), 1, 1, 0); - //added parameter to reset seeds after every run - if (!GetInputParameter2(ParamFile_dat, PreParamFile_dat, "Reset seeds for every run", "%i", (void*) & (P.ResetSeeds), 1, 1, 0)) P.ResetSeeds = 0; - if (P.ResetSeeds) - { - if (!GetInputParameter2(ParamFile_dat, PreParamFile_dat, "Keep same seeds for every run", "%i", (void*) & (P.KeepSameSeeds), 1, 1, 0)) P.KeepSameSeeds = 0; //added this to control which seeds are used: ggilani 27/11/19 - } - if (!GetInputParameter2(ParamFile_dat, PreParamFile_dat, "Reset seeds after intervention", "%i", (void*) & (P.ResetSeedsPostIntervention), 1, 1, 0)) P.ResetSeedsPostIntervention = 0; - if (P.ResetSeedsPostIntervention) - { - if (!GetInputParameter2(ParamFile_dat, PreParamFile_dat, "Time to reset seeds after intervention", "%i", (void*) & (P.TimeToResetSeeds), 1, 1, 0)) P.TimeToResetSeeds = 1000000; - } - if (!GetInputParameter2(PreParamFile_dat, AdminFile_dat, "Include households", "%i", (void*) & (P.DoHouseholds), 1, 1, 0)) P.DoHouseholds = 1; + else + { + P.NumNonExtinctRealisations = P.NumRealisations; + } + if (!GetInputParameter2(ParamFile_dat, PreParamFile_dat, "Maximum number of cases defining small outbreak", "%i", (void*) & (P.SmallEpidemicCases), 1, 1, 0)) P.SmallEpidemicCases = -1; - if (!GetInputParameter2(ParamFile_dat, PreParamFile_dat, "OutputAge" , "%i", (void*) & (P.OutputAge) , 1, 1, 0)) P.OutputAge = 1; //// ON by default. - if (!GetInputParameter2(ParamFile_dat, PreParamFile_dat, "OutputSeverityAdminUnit" , "%i", (void*) & (P.OutputSeverityAdminUnit) , 1, 1, 0)) P.OutputSeverityAdminUnit = 1; //// ON by default. - if (!GetInputParameter2(ParamFile_dat, PreParamFile_dat, "OutputSeverityAge" , "%i", (void*) & (P.OutputSeverityAge) , 1, 1, 0)) P.OutputSeverityAge = 1; //// ON by default. - if (!GetInputParameter2(ParamFile_dat, PreParamFile_dat, "OutputAdUnitAge" , "%i", (void*) & (P.OutputAdUnitAge) , 1, 1, 0)) P.OutputAdUnitAge = 0; //// OFF by default. - if (!GetInputParameter2(ParamFile_dat, PreParamFile_dat, "OutputR0" , "%i", (void*) & (P.OutputR0) , 1, 1, 0)) P.OutputR0 = 0; //// OFF by default. - if (!GetInputParameter2(ParamFile_dat, PreParamFile_dat, "OutputControls" , "%i", (void*) & (P.OutputControls) , 1, 1, 0)) P.OutputControls = 0; //// OFF by default. - if (!GetInputParameter2(ParamFile_dat, PreParamFile_dat, "OutputCountry" , "%i", (void*) & (P.OutputCountry) , 1, 1, 0)) P.OutputCountry = 0; //// OFF by default. - if (!GetInputParameter2(ParamFile_dat, PreParamFile_dat, "OutputAdUnitVar" , "%i", (void*) & (P.OutputAdUnitVar) , 1, 1, 0)) P.OutputAdUnitVar = 0; //// OFF by default. - if (!GetInputParameter2(ParamFile_dat, PreParamFile_dat, "OutputHousehold" , "%i", (void*) & (P.OutputHousehold) , 1, 1, 0)) P.OutputHousehold = 0; //// OFF by default. - if (!GetInputParameter2(ParamFile_dat, PreParamFile_dat, "OutputInfType" , "%i", (void*) & (P.OutputInfType) , 1, 1, 0)) P.OutputInfType = 0; //// OFF by default. - if (!GetInputParameter2(ParamFile_dat, PreParamFile_dat, "OutputNonSeverity" , "%i", (void*) & (P.OutputNonSeverity) , 1, 1, 0)) P.OutputNonSeverity = 0; //// OFF by default. - if (!GetInputParameter2(ParamFile_dat, PreParamFile_dat, "OutputNonSummaryResults" , "%i", (void*) & (P.OutputNonSummaryResults) , 1, 1, 0)) P.OutputNonSummaryResults = 0; //// OFF by default. + P.NC = -1; + GetInputParameter(ParamFile_dat, PreParamFile_dat, "Number of micro-cells per spatial cell width", "%i", (void*)&(P.NMCL), 1, 1, 0); + //added parameter to reset seeds after every run + if (!GetInputParameter2(ParamFile_dat, PreParamFile_dat, "Reset seeds for every run", "%i", (void*)&(P.ResetSeeds), 1, 1, 0)) P.ResetSeeds = 0; + if (P.ResetSeeds) + { + if (!GetInputParameter2(ParamFile_dat, PreParamFile_dat, "Keep same seeds for every run", "%i", (void*)&(P.KeepSameSeeds), 1, 1, 0)) P.KeepSameSeeds = 0; //added this to control which seeds are used: ggilani 27/11/19 + } + if (!GetInputParameter2(ParamFile_dat, PreParamFile_dat, "Reset seeds after intervention", "%i", (void*)&(P.ResetSeedsPostIntervention), 1, 1, 0)) P.ResetSeedsPostIntervention = 0; + if (P.ResetSeedsPostIntervention) + { + if (!GetInputParameter2(ParamFile_dat, PreParamFile_dat, "Time to reset seeds after intervention", "%i", (void*)&(P.TimeToResetSeeds), 1, 1, 0)) P.TimeToResetSeeds = 1000000; + } + if (!GetInputParameter2(PreParamFile_dat, AdminFile_dat, "Include households", "%i", (void*)&(P.DoHouseholds), 1, 1, 0)) P.DoHouseholds = 1; - if (!GetInputParameter2(PreParamFile_dat, AdminFile_dat, "Kernel resolution", "%i", (void*)&P.KernelLookup.size_, 1, 1, 0)) P.KernelLookup.size_ = 4000000; - if (P.KernelLookup.size_ < 2000000) - { - ERR_CRITICAL_FMT("[Kernel resolution] needs to be at least 2000000 - not %d", P.KernelLookup.size_); - } - if (!GetInputParameter2(PreParamFile_dat, AdminFile_dat, "Kernel higher resolution factor", "%i", (void*)&P.KernelLookup.expansion_factor_, 1, 1, 0)) P.KernelLookup.expansion_factor_ = P.KernelLookup.size_ / 1600; - if (P.KernelLookup.expansion_factor_ < 1 || P.KernelLookup.expansion_factor_ >= P.KernelLookup.size_) - { - ERR_CRITICAL_FMT("[Kernel higher resolution factor] needs to be in range [1, P.NKR = %d) - not %d", P.KernelLookup.size_, P.KernelLookup.expansion_factor_); + if (!GetInputParameter2(PreParamFile_dat, AdminFile_dat, "Kernel resolution", "%i", (void*)&P.KernelLookup.size_, 1, 1, 0)) P.KernelLookup.size_ = 4000000; + if (P.KernelLookup.size_ < 2000000) + { + ERR_CRITICAL_FMT("[Kernel resolution] needs to be at least 2000000 - not %d", P.KernelLookup.size_); + } + if (!GetInputParameter2(PreParamFile_dat, AdminFile_dat, "Kernel higher resolution factor", "%i", (void*)&P.KernelLookup.expansion_factor_, 1, 1, 0)) P.KernelLookup.expansion_factor_ = P.KernelLookup.size_ / 1600; + if (P.KernelLookup.expansion_factor_ < 1 || P.KernelLookup.expansion_factor_ >= P.KernelLookup.size_) + { + ERR_CRITICAL_FMT("[Kernel higher resolution factor] needs to be in range [1, P.NKR = %d) - not %d", P.KernelLookup.size_, P.KernelLookup.expansion_factor_); + } } + if (!GetInputParameter2(ParamFile_dat, PreParamFile_dat, "OutputAge", "%i", (void*)&(P.OutputAge), 1, 1, 0)) P.OutputAge = 1; //// ON by default. + if (!GetInputParameter2(ParamFile_dat, PreParamFile_dat, "OutputSeverity", "%i", (void*)&(P.OutputSeverity), 1, 1, 0)) P.OutputSeverity = 1; //// ON by default. + if (!GetInputParameter2(ParamFile_dat, PreParamFile_dat, "OutputSeverityAdminUnit", "%i", (void*)&(P.OutputSeverityAdminUnit), 1, 1, 0)) P.OutputSeverityAdminUnit = 1; //// ON by default. + if (!GetInputParameter2(ParamFile_dat, PreParamFile_dat, "OutputSeverityAge", "%i", (void*)&(P.OutputSeverityAge), 1, 1, 0)) P.OutputSeverityAge = 1; //// ON by default. + if (!GetInputParameter2(ParamFile_dat, PreParamFile_dat, "OutputAdUnitAge", "%i", (void*)&(P.OutputAdUnitAge), 1, 1, 0)) P.OutputAdUnitAge = 0; //// OFF by default. + if (!GetInputParameter2(ParamFile_dat, PreParamFile_dat, "OutputR0", "%i", (void*)&(P.OutputR0), 1, 1, 0)) P.OutputR0 = 0; //// OFF by default. + if (!GetInputParameter2(ParamFile_dat, PreParamFile_dat, "OutputControls", "%i", (void*)&(P.OutputControls), 1, 1, 0)) P.OutputControls = 0; //// OFF by default. + if (!GetInputParameter2(ParamFile_dat, PreParamFile_dat, "OutputCountry", "%i", (void*)&(P.OutputCountry), 1, 1, 0)) P.OutputCountry = 0; //// OFF by default. + if (!GetInputParameter2(ParamFile_dat, PreParamFile_dat, "OutputAdUnitVar", "%i", (void*)&(P.OutputAdUnitVar), 1, 1, 0)) P.OutputAdUnitVar = 0; //// OFF by default. + if (!GetInputParameter2(ParamFile_dat, PreParamFile_dat, "OutputHousehold", "%i", (void*)&(P.OutputHousehold), 1, 1, 0)) P.OutputHousehold = 0; //// OFF by default. + if (!GetInputParameter2(ParamFile_dat, PreParamFile_dat, "OutputInfType", "%i", (void*)&(P.OutputInfType), 1, 1, 0)) P.OutputInfType = 0; //// OFF by default. + if (!GetInputParameter2(ParamFile_dat, PreParamFile_dat, "OutputNonSeverity", "%i", (void*)&(P.OutputNonSeverity), 1, 1, 0)) P.OutputNonSeverity = 0; //// OFF by default. + if (!GetInputParameter2(ParamFile_dat, PreParamFile_dat, "OutputNonSummaryResults", "%i", (void*)&(P.OutputNonSummaryResults), 1, 1, 0)) P.OutputNonSummaryResults = 0; //// OFF by default. if (P.DoHouseholds) { GetInputParameter(PreParamFile_dat, AdminFile_dat, "Household size distribution", "%lf", (void*)P.HouseholdSizeDistrib[0], MAX_HOUSEHOLD_SIZE, 1, 0); - GetInputParameter(ParamFile_dat, PreParamFile_dat, "Household attack rate", "%lf", (void*) & (P.HouseholdTrans), 1, 1, 0); - GetInputParameter(ParamFile_dat, PreParamFile_dat, "Household transmission denominator power", "%lf", (void*) & (P.HouseholdTransPow), 1, 1, 0); + GetInputParameter(ParamFile_dat, PreParamFile_dat, "Household attack rate", "%lf", (void*)&(P.HouseholdTrans), 1, 1, 0); + GetInputParameter(ParamFile_dat, PreParamFile_dat, "Household transmission denominator power", "%lf", (void*)&(P.HouseholdTransPow), 1, 1, 0); if (!GetInputParameter2(PreParamFile_dat, AdminFile_dat, "Correct age distribution after household allocation to exactly match specified demography", "%i", (void*)&(P.DoCorrectAgeDist), 1, 1, 0)) P.DoCorrectAgeDist = 0; } else @@ -486,102 +548,107 @@ void ReadParams(std::string const& ParamFile, std::string const& PreParamFile, s for (i = 1; i < MAX_HOUSEHOLD_SIZE; i++) P.HouseholdSizeDistrib[0][i] = 0; } - for (i = 1; i < MAX_HOUSEHOLD_SIZE; i++) - P.HouseholdSizeDistrib[0][i] = P.HouseholdSizeDistrib[0][i] + P.HouseholdSizeDistrib[0][i - 1]; - for (i = 0; i < MAX_HOUSEHOLD_SIZE; i++) - P.HouseholdDenomLookup[i] = 1 / pow(((double)(i + 1)), P.HouseholdTransPow); - if (!GetInputParameter2(PreParamFile_dat, AdminFile_dat, "Include administrative units within countries", "%i", (void*) & (P.DoAdUnits), 1, 1, 0)) P.DoAdUnits = 1; - if (!GetInputParameter2(PreParamFile_dat, AdminFile_dat, "Divisor for countries", "%i", (void*) & (P.CountryDivisor), 1, 1, 0)) P.CountryDivisor = 1; - if (P.DoAdUnits) + if (P.FitIter == 0) { - char** AdunitNames, * AdunitNamesBuf; - AdunitNames = (char**)Memory::xcalloc(3 * ADUNIT_LOOKUP_SIZE, sizeof(char*)); - AdunitNamesBuf = (char*)Memory::xcalloc(3 * ADUNIT_LOOKUP_SIZE * 360, sizeof(char)); - - for (i = 0; i < ADUNIT_LOOKUP_SIZE; i++) - { - P.AdunitLevel1Lookup[i] = -1; - AdunitNames[3 * i] = AdunitNamesBuf + 3 * i * 360; - AdunitNames[3 * i + 1] = AdunitNamesBuf + 3 * i * 360 + 60; - AdunitNames[3 * i + 2] = AdunitNamesBuf + 3 * i * 360 + 160; - } - if (!GetInputParameter2(PreParamFile_dat, AdminFile_dat, "Divisor for level 1 administrative units", "%i", (void*)&(P.AdunitLevel1Divisor), 1, 1, 0)) P.AdunitLevel1Divisor = 1; - if (!GetInputParameter2(PreParamFile_dat, AdminFile_dat, "Mask for level 1 administrative units", "%i", (void*)&(P.AdunitLevel1Mask), 1, 1, 0)) P.AdunitLevel1Mask = 1000000000; - na = (GetInputParameter2(PreParamFile_dat, AdminFile_dat, "Codes and country/province names for admin units", "%s", (void*)AdunitNames, 3 * ADUNIT_LOOKUP_SIZE, 1, 0)) / 3; - if (!GetInputParameter2(PreParamFile_dat, AdminFile_dat, "Number of countries to include", "%i", (void*)&nc, 1, 1, 0)) nc = 0; - if ((na > 0) && (nc>0)) - { - P.DoAdunitBoundaries = (nc > 0); - nc = abs(nc); - GetInputParameter(PreParamFile_dat, AdminFile_dat, "List of names of countries to include", "%s", (nc > 1) ? ((void*)CountryNames) : ((void*)CountryNames[0]), nc, 1, 0); - P.NumAdunits = 0; - for (i = 0; i < na; i++) - for (j = 0; j < nc; j++) - if ((AdunitNames[3 * i + 1][0]) && (!strcmp(AdunitNames[3 * i + 1], CountryNames[j])) && (atoi(AdunitNames[3 * i]) != 0)) - { - AdUnits[P.NumAdunits].id = atoi(AdunitNames[3 * i]); - P.AdunitLevel1Lookup[(AdUnits[P.NumAdunits].id % P.AdunitLevel1Mask) / P.AdunitLevel1Divisor] = P.NumAdunits; - if (strlen(AdunitNames[3 * i + 1]) < 100) strcpy(AdUnits[P.NumAdunits].cnt_name, AdunitNames[3 * i + 1]); - if (strlen(AdunitNames[3 * i + 2]) < 200) strcpy(AdUnits[P.NumAdunits].ad_name, AdunitNames[3 * i + 2]); - // fprintf(stderr,"%i %s %s ## ",AdUnits[P.NumAdunits].id,AdUnits[P.NumAdunits].cnt_name,AdUnits[P.NumAdunits].ad_name); - P.NumAdunits++; - } - } - else + for (i = 1; i < MAX_HOUSEHOLD_SIZE; i++) + P.HouseholdSizeDistrib[0][i] = P.HouseholdSizeDistrib[0][i] + P.HouseholdSizeDistrib[0][i - 1]; + P.HouseholdDenomLookup[0] = 1.0; + for (i = 1; i < MAX_HOUSEHOLD_SIZE; i++) + P.HouseholdDenomLookup[i] = 1 / pow(((double)(i + 1)), P.HouseholdTransPow); + if (!GetInputParameter2(PreParamFile_dat, AdminFile_dat, "Include administrative units within countries", "%i", (void*)&(P.DoAdUnits), 1, 1, 0)) P.DoAdUnits = 1; + if (!GetInputParameter2(PreParamFile_dat, AdminFile_dat, "Divisor for countries", "%i", (void*)&(P.CountryDivisor), 1, 1, 0)) P.CountryDivisor = 1; + if (P.DoAdUnits) { - if (!GetInputParameter2(PreParamFile_dat, AdminFile_dat, "Number of level 1 administrative units to include", "%i", (void*) & (P.NumAdunits), 1, 1, 0)) P.NumAdunits = 0; - if (P.NumAdunits > 0) + char** AdunitNames, * AdunitNamesBuf; + if (!(AdunitNames = (char**)malloc(3 * ADUNIT_LOOKUP_SIZE * sizeof(char*)))) ERR_CRITICAL("Unable to allocate temp storage\n"); + if (!(AdunitNamesBuf = (char*)malloc(3 * ADUNIT_LOOKUP_SIZE * 360 * sizeof(char)))) ERR_CRITICAL("Unable to allocate temp storage\n"); + + for (i = 0; i < ADUNIT_LOOKUP_SIZE; i++) { - P.DoAdunitBoundaries = 1; - if (P.NumAdunits > MAX_ADUNITS) ERR_CRITICAL("MAX_ADUNITS too small.\n"); - GetInputParameter(PreParamFile_dat, AdminFile_dat, "List of level 1 administrative units to include", "%s", (P.NumAdunits > 1) ? ((void*)AdunitListNames) : ((void*)AdunitListNames[0]), P.NumAdunits, 1, 0); - na = P.NumAdunits; - for (i = 0; i < P.NumAdunits; i++) + P.AdunitLevel1Lookup[i] = -1; + AdunitNames[3 * i] = AdunitNamesBuf + 3 * i * 360; + AdunitNames[3 * i + 1] = AdunitNamesBuf + 3 * i * 360 + 60; + AdunitNames[3 * i + 2] = AdunitNamesBuf + 3 * i * 360 + 160; + } + if (!GetInputParameter2(PreParamFile_dat, AdminFile_dat, "Divisor for level 1 administrative units", "%i", (void*)&(P.AdunitLevel1Divisor), 1, 1, 0)) P.AdunitLevel1Divisor = 1; + if (!GetInputParameter2(PreParamFile_dat, AdminFile_dat, "Mask for level 1 administrative units", "%i", (void*)&(P.AdunitLevel1Mask), 1, 1, 0)) P.AdunitLevel1Mask = 1000000000; + na = (GetInputParameter2(PreParamFile_dat, AdminFile_dat, "Codes and country/province names for admin units", "%s", (void*)AdunitNames, 3 * ADUNIT_LOOKUP_SIZE, 1, 0)) / 3; + if (!GetInputParameter2(PreParamFile_dat, AdminFile_dat, "Number of countries to include", "%i", (void*)&nc, 1, 1, 0)) nc = 0; + if ((na > 0) && (nc > 0)) + { + P.DoAdunitBoundaries = (nc > 0); + nc = abs(nc); + GetInputParameter(PreParamFile_dat, AdminFile_dat, "List of names of countries to include", "%s", (nc > 1) ? ((void*)CountryNames) : ((void*)CountryNames[0]), nc, 1, 0); + P.NumAdunits = 0; + for (i = 0; i < na; i++) + for (j = 0; j < nc; j++) + if ((AdunitNames[3 * i + 1][0]) && (!strcmp(AdunitNames[3 * i + 1], CountryNames[j])) && (atoi(AdunitNames[3 * i]) != 0)) + { + AdUnits[P.NumAdunits].id = atoi(AdunitNames[3 * i]); + P.AdunitLevel1Lookup[(AdUnits[P.NumAdunits].id % P.AdunitLevel1Mask) / P.AdunitLevel1Divisor] = P.NumAdunits; + if (strlen(AdunitNames[3 * i + 1]) < 100) strcpy(AdUnits[P.NumAdunits].cnt_name, AdunitNames[3 * i + 1]); + if (strlen(AdunitNames[3 * i + 2]) < 200) strcpy(AdUnits[P.NumAdunits].ad_name, AdunitNames[3 * i + 2]); + // fprintf(stderr,"%i %s %s ## ",AdUnits[P.NumAdunits].id,AdUnits[P.NumAdunits].cnt_name,AdUnits[P.NumAdunits].ad_name); + P.NumAdunits++; + } + } + else + { + if (!GetInputParameter2(PreParamFile_dat, AdminFile_dat, "Number of level 1 administrative units to include", "%i", (void*)&(P.NumAdunits), 1, 1, 0)) P.NumAdunits = 0; + if (P.NumAdunits > 0) { - f = 0; - if (na > 0) + P.DoAdunitBoundaries = 1; + if (P.NumAdunits > MAX_ADUNITS) ERR_CRITICAL("MAX_ADUNITS too small.\n"); + GetInputParameter(PreParamFile_dat, AdminFile_dat, "List of level 1 administrative units to include", "%s", (P.NumAdunits > 1) ? ((void*)AdunitListNames) : ((void*)AdunitListNames[0]), P.NumAdunits, 1, 0); + na = P.NumAdunits; + for (i = 0; i < P.NumAdunits; i++) { - for (j = 0; (j < na) && (!f); j++) f = (!strcmp(AdunitNames[3 * j + 2], AdunitListNames[i])); - if(f) k = atoi(AdunitNames[3 * (j-1)]); - } - if ((na == 0) || (!f)) k = atoi(AdunitListNames[i]); - AdUnits[i].id = k; - P.AdunitLevel1Lookup[(k % P.AdunitLevel1Mask) / P.AdunitLevel1Divisor] = i; - for (j = 0; j < na; j++) - if (atoi(AdunitNames[3 * j]) == k) + f = 0; + if (na > 0) { - if (strlen(AdunitNames[3 * j + 1]) < 100) strcpy(AdUnits[i].cnt_name, AdunitNames[3 * j + 1]); - if (strlen(AdunitNames[3 * j + 2]) < 200) strcpy(AdUnits[i].ad_name, AdunitNames[3 * j + 2]); - j = na; + for (j = 0; (j < na) && (!f); j++) f = (!strcmp(AdunitNames[3 * j + 2], AdunitListNames[i])); + if (f) k = atoi(AdunitNames[3 * (j - 1)]); } + if ((na == 0) || (!f)) k = atoi(AdunitListNames[i]); + AdUnits[i].id = k; + P.AdunitLevel1Lookup[(k % P.AdunitLevel1Mask) / P.AdunitLevel1Divisor] = i; + for (j = 0; j < na; j++) + if (atoi(AdunitNames[3 * j]) == k) + { + if (strlen(AdunitNames[3 * j + 1]) < 100) strcpy(AdUnits[i].cnt_name, AdunitNames[3 * j + 1]); + if (strlen(AdunitNames[3 * j + 2]) < 200) strcpy(AdUnits[i].ad_name, AdunitNames[3 * j + 2]); + j = na; + } + } } + else + P.DoAdunitBoundaries = 0; + } + Memory::xfree(AdunitNames); + Memory::xfree(AdunitNamesBuf); + + if (!GetInputParameter2(ParamFile_dat, PreParamFile_dat, "Output incidence by administrative unit", "%i", (void*)&(P.DoAdunitOutput), 1, 1, 0)) P.DoAdunitOutput = 0; + if (!GetInputParameter2(PreParamFile_dat, AdminFile_dat, "Draw administrative unit boundaries on maps", "%i", (void*)&(P.DoAdunitBoundaryOutput), 1, 1, 0)) P.DoAdunitBoundaryOutput = 0; + if (!GetInputParameter2(PreParamFile_dat, AdminFile_dat, "Correct administrative unit populations", "%i", (void*)&(P.DoCorrectAdunitPop), 1, 1, 0)) P.DoCorrectAdunitPop = 0; + if (!GetInputParameter2(PreParamFile_dat, AdminFile_dat, "Fix population size at specified value", "%i", (void*)&(P.DoSpecifyPop), 1, 1, 0)) P.DoSpecifyPop = 0; + fprintf(stderr, "Using %i administrative units\n", P.NumAdunits); + if (!GetInputParameter2(PreParamFile_dat, AdminFile_dat, "Divisor for administrative unit codes for boundary plotting on bitmaps", "%i", (void*)&(P.AdunitBitmapDivisor), 1, 1, 0)) P.AdunitBitmapDivisor = 1; + if (!GetInputParameter2(ParamFile_dat, PreParamFile_dat, "Only output household to place distance distribution for one administrative unit", "%i", (void*)&(P.DoOutputPlaceDistForOneAdunit), 1, 1, 0)) P.DoOutputPlaceDistForOneAdunit = 0; + if (P.DoOutputPlaceDistForOneAdunit) + { + if (!GetInputParameter2(ParamFile_dat, PreParamFile_dat, "Administrative unit for which household to place distance distribution to be output", "%i", (void*)&(P.OutputPlaceDistAdunit), 1, 1, 0)) P.DoOutputPlaceDistForOneAdunit = 0; } - else - P.DoAdunitBoundaries = 0; } - Memory::xfree(AdunitNames); - Memory::xfree(AdunitNamesBuf); + else - if (!GetInputParameter2(ParamFile_dat, PreParamFile_dat, "Output incidence by administrative unit", "%i", (void*) & (P.DoAdunitOutput), 1, 1, 0)) P.DoAdunitOutput = 0; - if (!GetInputParameter2(PreParamFile_dat, AdminFile_dat, "Draw administrative unit boundaries on maps", "%i", (void*) & (P.DoAdunitBoundaryOutput), 1, 1, 0)) P.DoAdunitBoundaryOutput = 0; - if (!GetInputParameter2(PreParamFile_dat, AdminFile_dat, "Correct administrative unit populations", "%i", (void*) & (P.DoCorrectAdunitPop), 1, 1, 0)) P.DoCorrectAdunitPop = 0; - if (!GetInputParameter2(PreParamFile_dat, AdminFile_dat, "Fix population size at specified value", "%i", (void*) & (P.DoSpecifyPop), 1, 1, 0)) P.DoSpecifyPop = 0; - fprintf(stderr, "Using %i administrative units\n", P.NumAdunits); - if (!GetInputParameter2(PreParamFile_dat, AdminFile_dat, "Divisor for administrative unit codes for boundary plotting on bitmaps", "%i", (void*) & (P.AdunitBitmapDivisor), 1, 1, 0)) P.AdunitBitmapDivisor = 1; - if (!GetInputParameter2(ParamFile_dat, PreParamFile_dat, "Only output household to place distance distribution for one administrative unit", "%i", (void*) & (P.DoOutputPlaceDistForOneAdunit), 1, 1, 0)) P.DoOutputPlaceDistForOneAdunit = 0; - if (P.DoOutputPlaceDistForOneAdunit) { - if (!GetInputParameter2(ParamFile_dat, PreParamFile_dat, "Administrative unit for which household to place distance distribution to be output", "%i", (void*) & (P.OutputPlaceDistAdunit), 1, 1, 0)) P.DoOutputPlaceDistForOneAdunit = 0; + P.DoAdunitBoundaries = P.DoAdunitBoundaryOutput = P.DoAdunitOutput = P.DoCorrectAdunitPop = P.DoSpecifyPop = 0; + P.AdunitLevel1Divisor = 1; P.AdunitLevel1Mask = 1000000000; + P.AdunitBitmapDivisor = P.AdunitLevel1Divisor; } } - else - { - P.DoAdunitBoundaries = P.DoAdunitBoundaryOutput = P.DoAdunitOutput = P.DoCorrectAdunitPop = P.DoSpecifyPop = 0; - P.AdunitLevel1Divisor = 1; P.AdunitLevel1Mask = 1000000000; - P.AdunitBitmapDivisor = P.AdunitLevel1Divisor; - } - if (!GetInputParameter2(PreParamFile_dat, AdminFile_dat, "Include age", "%i", (void*) & (P.DoAge), 1, 1, 0)) P.DoAge = 1; + if (!GetInputParameter2(PreParamFile_dat, AdminFile_dat, "Include age", "%i", (void*)&(P.DoAge), 1, 1, 0)) P.DoAge = 1; if (!P.DoAge) { for (i = 0; i < NUM_AGE_GROUPS; i++) { @@ -595,9 +662,9 @@ void ReadParams(std::string const& ParamFile, std::string const& PreParamFile, s { if (!GetInputParameter2(ParamFile_dat, PreParamFile_dat, "Initial immunity acts as partial immunity", "%i", (void*)&(P.DoPartialImmunity), 1, 1, 0)) P.DoPartialImmunity = 1; - if ((P.DoHouseholds)&&(!P.DoPartialImmunity)) + if ((P.DoHouseholds) && (!P.DoPartialImmunity)) { - if (!GetInputParameter2(ParamFile_dat, PreParamFile_dat, "Initial immunity applied to all household members", "%i", (void*) & (P.DoWholeHouseholdImmunity), 1, 1, 0)) P.DoWholeHouseholdImmunity = 0; + if (!GetInputParameter2(ParamFile_dat, PreParamFile_dat, "Initial immunity applied to all household members", "%i", (void*)&(P.DoWholeHouseholdImmunity), 1, 1, 0)) P.DoWholeHouseholdImmunity = 0; } else P.DoWholeHouseholdImmunity = 0; @@ -663,174 +730,199 @@ void ReadParams(std::string const& ParamFile, std::string const& PreParamFile, s for (i = 0; i < NUM_AGE_GROUPS; i++) t += P.AgeInfectiousness[i] * P.PropAgeGroup[0][i]; for (i = 0; i < NUM_AGE_GROUPS; i++) P.AgeInfectiousness[i] /= t; } - if (!GetInputParameter2(PreParamFile_dat, AdminFile_dat, "Include spatial transmission", "%i", (void*) & (P.DoSpatial), 1, 1, 0)) P.DoSpatial = 1; - GetInputParameter(PreParamFile_dat, AdminFile_dat, "Kernel type", "%i", (void*) & (P.MoveKernel.type_), 1, 1, 0); - GetInputParameter(PreParamFile_dat, AdminFile_dat, "Kernel scale", "%lf", (void*) & (P.MoveKernel.scale_), 1, 1, 0); - if (P.KernelOffsetScale != 1) - { - P.MoveKernel.scale_ *= P.KernelOffsetScale; - } - if (!GetInputParameter2(PreParamFile_dat, AdminFile_dat, "Kernel 3rd param", "%lf", (void*) & (P.MoveKernel.p3_), 1, 1, 0)) P.MoveKernel.p3_ = 0; - if (!GetInputParameter2(PreParamFile_dat, AdminFile_dat, "Kernel 4th param", "%lf", (void*) & (P.MoveKernel.p4_), 1, 1, 0)) P.MoveKernel.p4_ = 0; - if (!GetInputParameter2(PreParamFile_dat, AdminFile_dat, "Kernel Shape", "%lf", (void*) & (P.MoveKernel.shape_), 1, 1, 0)) P.MoveKernel.shape_ = 1.0; - if (P.KernelPowerScale != 1) - { - P.MoveKernel.shape_ *= P.KernelPowerScale; - } - if (!GetInputParameter2(PreParamFile_dat, AdminFile_dat, "Airport Kernel Type", "%i", (void*) & (P.AirportKernel.type_), 1, 1, 0)) P.AirportKernel.type_ = P.MoveKernel.type_; - if (!GetInputParameter2(PreParamFile_dat, AdminFile_dat, "Airport Kernel Scale", "%lf", (void*) & (P.AirportKernel.scale_), 1, 1, 0)) P.AirportKernel.scale_ = P.MoveKernel.scale_; - if (!GetInputParameter2(PreParamFile_dat, AdminFile_dat, "Airport Kernel Shape", "%lf", (void*) & (P.AirportKernel.shape_), 1, 1, 0)) P.AirportKernel.shape_ = P.MoveKernel.shape_; - if (!GetInputParameter2(PreParamFile_dat, AdminFile_dat, "Airport Kernel 3rd param", "%lf", (void*) & (P.AirportKernel.p3_), 1, 1, 0)) P.AirportKernel.p3_ = P.MoveKernel.p3_; - if (!GetInputParameter2(PreParamFile_dat, AdminFile_dat, "Airport Kernel 4th param", "%lf", (void*) & (P.AirportKernel.p4_), 1, 1, 0)) P.AirportKernel.p4_ = P.MoveKernel.p4_; - if (!GetInputParameter2(PreParamFile_dat, AdminFile_dat, "Include places", "%i", (void*)&(P.DoPlaces), 1, 1, 0)) P.DoPlaces = 1; - if (P.DoPlaces) + if (P.FitIter == 0) { - if (!GetInputParameter2(PreParamFile_dat, AdminFile_dat, "Number of types of places", "%i", (void*)&(P.PlaceTypeNum), 1, 1, 0)) P.PlaceTypeNum = 0; - if (P.PlaceTypeNum == 0) P.DoPlaces = P.DoAirports = 0; - } - else - P.PlaceTypeNum = P.DoAirports = 0; - if (P.DoPlaces) - { - if (P.PlaceTypeNum > NUM_PLACE_TYPES) ERR_CRITICAL("Too many place types\n"); - GetInputParameter(PreParamFile_dat, AdminFile_dat, "Minimum age for age group 1 in place types", "%i", (void*)P.PlaceTypeAgeMin, P.PlaceTypeNum, 1, 0); - GetInputParameter(PreParamFile_dat, AdminFile_dat, "Maximum age for age group 1 in place types", "%i", (void*)P.PlaceTypeAgeMax, P.PlaceTypeNum, 1, 0); - GetInputParameter(PreParamFile_dat, AdminFile_dat, "Proportion of age group 1 in place types", "%lf", (void*) & (P.PlaceTypePropAgeGroup), P.PlaceTypeNum, 1, 0); - if (!GetInputParameter2(PreParamFile_dat, AdminFile_dat, "Proportion of age group 2 in place types", "%lf", (void*) & (P.PlaceTypePropAgeGroup2), P.PlaceTypeNum, 1, 0)) + if (!GetInputParameter2(PreParamFile_dat, AdminFile_dat, "Include spatial transmission", "%i", (void*)&(P.DoSpatial), 1, 1, 0)) P.DoSpatial = 1; + GetInputParameter(PreParamFile_dat, AdminFile_dat, "Kernel type", "%i", (void*)&(P.MoveKernel.type_), 1, 1, 0); + GetInputParameter(PreParamFile_dat, AdminFile_dat, "Kernel scale", "%lf", (void*)&(P.MoveKernel.scale_), 1, 1, 0); + if (P.KernelOffsetScale != 1) { - for (i = 0; i < NUM_PLACE_TYPES; i++) - { - P.PlaceTypePropAgeGroup2[i] = 0; - P.PlaceTypeAgeMin2[i] = 0; - P.PlaceTypeAgeMax2[i] = 1000; - } + P.MoveKernel.scale_ *= P.KernelOffsetScale; } - else + if (!GetInputParameter2(PreParamFile_dat, AdminFile_dat, "Kernel 3rd param", "%lf", (void*)&(P.MoveKernel.p3_), 1, 1, 0)) P.MoveKernel.p3_ = 0; + if (!GetInputParameter2(PreParamFile_dat, AdminFile_dat, "Kernel 4th param", "%lf", (void*)&(P.MoveKernel.p4_), 1, 1, 0)) P.MoveKernel.p4_ = 0; + if (!GetInputParameter2(PreParamFile_dat, AdminFile_dat, "Kernel Shape", "%lf", (void*)&(P.MoveKernel.shape_), 1, 1, 0)) P.MoveKernel.shape_ = 1.0; + if (P.KernelPowerScale != 1) { - GetInputParameter(PreParamFile_dat, AdminFile_dat, "Minimum age for age group 2 in place types", "%i", (void*)P.PlaceTypeAgeMin2, P.PlaceTypeNum, 1, 0); - GetInputParameter(PreParamFile_dat, AdminFile_dat, "Maximum age for age group 2 in place types", "%i", (void*)P.PlaceTypeAgeMax2, P.PlaceTypeNum, 1, 0); + P.MoveKernel.shape_ *= P.KernelPowerScale; } - if (!GetInputParameter2(PreParamFile_dat, AdminFile_dat, "Proportion of age group 3 in place types", "%lf", (void*) & (P.PlaceTypePropAgeGroup3), P.PlaceTypeNum, 1, 0)) + if (!GetInputParameter2(PreParamFile_dat, AdminFile_dat, "Airport Kernel Type", "%i", (void*)&(P.AirportKernel.type_), 1, 1, 0)) P.AirportKernel.type_ = P.MoveKernel.type_; + if (!GetInputParameter2(PreParamFile_dat, AdminFile_dat, "Airport Kernel Scale", "%lf", (void*)&(P.AirportKernel.scale_), 1, 1, 0)) P.AirportKernel.scale_ = P.MoveKernel.scale_; + if (!GetInputParameter2(PreParamFile_dat, AdminFile_dat, "Airport Kernel Shape", "%lf", (void*)&(P.AirportKernel.shape_), 1, 1, 0)) P.AirportKernel.shape_ = P.MoveKernel.shape_; + if (!GetInputParameter2(PreParamFile_dat, AdminFile_dat, "Airport Kernel 3rd param", "%lf", (void*)&(P.AirportKernel.p3_), 1, 1, 0)) P.AirportKernel.p3_ = P.MoveKernel.p3_; + if (!GetInputParameter2(PreParamFile_dat, AdminFile_dat, "Airport Kernel 4th param", "%lf", (void*)&(P.AirportKernel.p4_), 1, 1, 0)) P.AirportKernel.p4_ = P.MoveKernel.p4_; + + if (!GetInputParameter2(PreParamFile_dat, AdminFile_dat, "Include places", "%i", (void*)&(P.DoPlaces), 1, 1, 0)) P.DoPlaces = 1; + if (P.DoPlaces) { - for (i = 0; i < NUM_PLACE_TYPES; i++) - { - P.PlaceTypePropAgeGroup3[i] = 0; - P.PlaceTypeAgeMin3[i] = 0; - P.PlaceTypeAgeMax3[i] = 1000; - } + if (!GetInputParameter2(PreParamFile_dat, AdminFile_dat, "Number of types of places", "%i", (void*)&(P.PlaceTypeNum), 1, 1, 0)) P.PlaceTypeNum = 0; + if (P.PlaceTypeNum == 0) P.DoPlaces = P.DoAirports = 0; } else + P.PlaceTypeNum = P.DoAirports = 0; + } + if (P.DoPlaces) + { + if (!GetInputParameter2(PreParamFile_dat, AdminFile_dat, "Scaling of household contacts for care home residents", "%lf", (void*)&(P.CareHomeResidentHouseholdScaling), 1, 1, 0)) P.CareHomeResidentHouseholdScaling = 1.0; + if (!GetInputParameter2(PreParamFile_dat, AdminFile_dat, "Scaling of spatial contacts for care home residents", "%lf", (void*)&(P.CareHomeResidentSpatialScaling), 1, 1, 0)) P.CareHomeResidentSpatialScaling = 1.0; + if (!GetInputParameter2(PreParamFile_dat, AdminFile_dat, "Scaling of between group (home) contacts for care home residents", "%lf", (void*)&(P.CareHomeResidentPlaceScaling), 1, 1, 0)) P.CareHomeResidentPlaceScaling = 1.0; + if (!GetInputParameter2(PreParamFile_dat, AdminFile_dat, "Scaling of within group (home) contacts for care home workers", "%lf", (void*)&(P.CareHomeWorkerGroupScaling), 1, 1, 0)) P.CareHomeWorkerGroupScaling = 1.0; + if (!GetInputParameter2(PreParamFile_dat, AdminFile_dat, "Relative probability that care home residents are hospitalised", "%lf", (void*)&(P.CareHomeRelProbHosp), 1, 1, 0)) P.CareHomeRelProbHosp = 1.0; + + if (P.FitIter == 0) { - GetInputParameter(PreParamFile_dat, AdminFile_dat, "Minimum age for age group 3 in place types", "%i", (void*)P.PlaceTypeAgeMin3, P.PlaceTypeNum, 1, 0); - GetInputParameter(PreParamFile_dat, AdminFile_dat, "Maximum age for age group 3 in place types", "%i", (void*)P.PlaceTypeAgeMax3, P.PlaceTypeNum, 1, 0); - } - if (!GetInputParameter2(PreParamFile_dat, AdminFile_dat, "Kernel shape params for place types", "%lf", (void*) & (P.PlaceTypeKernelShape), P.PlaceTypeNum, 1, 0)) - { - for (i = 0; i < NUM_PLACE_TYPES; i++) + if (P.PlaceTypeNum > NUM_PLACE_TYPES) ERR_CRITICAL("Too many place types\n"); + if (!GetInputParameter2(PreParamFile_dat, AdminFile_dat, "Place type number for care homes", "%i", (void*)&(P.CareHomePlaceType), 1, 1, 0)) P.CareHomePlaceType = -1; + if (!GetInputParameter2(PreParamFile_dat, AdminFile_dat, "Allow initial infections to be in care homes", "%i", (void*)&(P.CareHomeAllowInitialInfections), 1, 1, 0)) P.CareHomeAllowInitialInfections = 0; + if (!GetInputParameter2(PreParamFile_dat, AdminFile_dat, "Minimum age of care home residents", "%i", (void*)&(P.CareHomeResidentMinimumAge), 1, 1, 0)) P.CareHomeResidentMinimumAge = 1000; + + GetInputParameter(PreParamFile_dat, AdminFile_dat, "Minimum age for age group 1 in place types", "%i", (void*)P.PlaceTypeAgeMin, P.PlaceTypeNum, 1, 0); + GetInputParameter(PreParamFile_dat, AdminFile_dat, "Maximum age for age group 1 in place types", "%i", (void*)P.PlaceTypeAgeMax, P.PlaceTypeNum, 1, 0); + GetInputParameter(PreParamFile_dat, AdminFile_dat, "Proportion of age group 1 in place types", "%lf", (void*)&(P.PlaceTypePropAgeGroup), P.PlaceTypeNum, 1, 0); + if (!GetInputParameter2(PreParamFile_dat, AdminFile_dat, "Proportion of age group 2 in place types", "%lf", (void*)&(P.PlaceTypePropAgeGroup2), P.PlaceTypeNum, 1, 0)) { - P.PlaceTypeKernelShape[i] = P.MoveKernel.shape_; - P.PlaceTypeKernelScale[i] = P.MoveKernel.scale_; + for (i = 0; i < NUM_PLACE_TYPES; i++) + { + P.PlaceTypePropAgeGroup2[i] = 0; + P.PlaceTypeAgeMin2[i] = 0; + P.PlaceTypeAgeMax2[i] = 1000; + } } - } - else - GetInputParameter(PreParamFile_dat, AdminFile_dat, "Kernel scale params for place types", "%lf", (void*) & (P.PlaceTypeKernelScale), P.PlaceTypeNum, 1, 0); - if (!GetInputParameter2(PreParamFile_dat, AdminFile_dat, "Kernel 3rd param for place types", "%lf", (void*) & (P.PlaceTypeKernelP3), P.PlaceTypeNum, 1, 0)) - { - for (i = 0; i < NUM_PLACE_TYPES; i++) + else { - P.PlaceTypeKernelP3[i] = P.MoveKernel.p3_; - P.PlaceTypeKernelP4[i] = P.MoveKernel.p4_; + GetInputParameter(PreParamFile_dat, AdminFile_dat, "Minimum age for age group 2 in place types", "%i", (void*)P.PlaceTypeAgeMin2, P.PlaceTypeNum, 1, 0); + GetInputParameter(PreParamFile_dat, AdminFile_dat, "Maximum age for age group 2 in place types", "%i", (void*)P.PlaceTypeAgeMax2, P.PlaceTypeNum, 1, 0); } - } - else - GetInputParameter(PreParamFile_dat, AdminFile_dat, "Kernel 4th param for place types", "%lf", (void*) & (P.PlaceTypeKernelP4), P.PlaceTypeNum, 1, 0); - if (!GetInputParameter2(PreParamFile_dat, AdminFile_dat, "Number of closest places people pick from (0=all) for place types", "%i", (void*) & (P.PlaceTypeNearestNeighb), P.PlaceTypeNum, 1, 0)) - for (i = 0; i < NUM_PLACE_TYPES; i++) - P.PlaceTypeNearestNeighb[i] = 0; - if (P.DoAdUnits) - { - if (!GetInputParameter2(ParamFile_dat, PreParamFile_dat, "Degree to which crossing administrative unit boundaries to go to places is inhibited", "%lf", (void*) & (P.InhibitInterAdunitPlaceAssignment), P.PlaceTypeNum, 1, 0)) + if (!GetInputParameter2(PreParamFile_dat, AdminFile_dat, "Proportion of age group 3 in place types", "%lf", (void*)&(P.PlaceTypePropAgeGroup3), P.PlaceTypeNum, 1, 0)) + { for (i = 0; i < NUM_PLACE_TYPES; i++) - P.InhibitInterAdunitPlaceAssignment[i] = 0; - } - - if (!GetInputParameter2(ParamFile_dat, PreParamFile_dat, "Include air travel", "%i", (void*)&(P.DoAirports), 1, 1, 0)) P.DoAirports = 0; - if (!P.DoAirports) - { - // Airports disabled => all places are not to do with airports, and we - // have no hotels. - P.PlaceTypeNoAirNum = P.PlaceTypeNum; - P.HotelPlaceType = P.PlaceTypeNum; - } - else - { - // When airports are activated we must have at least one airport place - // // and a hotel type. - GetInputParameter(PreParamFile_dat, AdminFile_dat, "Number of non-airport places", "%i", (void*)&(P.PlaceTypeNoAirNum), 1, 1, 0); - GetInputParameter(PreParamFile_dat, AdminFile_dat, "Hotel place type", "%i", (void*)&(P.HotelPlaceType), 1, 1, 0); - if (P.PlaceTypeNoAirNum >= P.PlaceTypeNum) { - ERR_CRITICAL_FMT("[Number of non-airport places] parameter (%d) is greater than number of places (%d).\n", P.PlaceTypeNoAirNum, P.PlaceTypeNum); + { + P.PlaceTypePropAgeGroup3[i] = 0; + P.PlaceTypeAgeMin3[i] = 0; + P.PlaceTypeAgeMax3[i] = 1000; + } } - if (P.HotelPlaceType < P.PlaceTypeNoAirNum || P.HotelPlaceType >= P.PlaceTypeNum) { - ERR_CRITICAL_FMT("[Hotel place type] parameter (%d) not in the range [%d, %d)\n", P.HotelPlaceType, P.PlaceTypeNoAirNum, P.PlaceTypeNum); + else + { + GetInputParameter(PreParamFile_dat, AdminFile_dat, "Minimum age for age group 3 in place types", "%i", (void*)P.PlaceTypeAgeMin3, P.PlaceTypeNum, 1, 0); + GetInputParameter(PreParamFile_dat, AdminFile_dat, "Maximum age for age group 3 in place types", "%i", (void*)P.PlaceTypeAgeMax3, P.PlaceTypeNum, 1, 0); } - - if (!GetInputParameter2(ParamFile_dat, PreParamFile_dat, "Scaling factor for input file to convert to daily traffic", "%lf", (void*) & (P.AirportTrafficScale), 1, 1, 0)) P.AirportTrafficScale = 1.0; - if (!GetInputParameter2(ParamFile_dat, PreParamFile_dat, "Proportion of hotel attendees who are local", "%lf", (void*) & (P.HotelPropLocal), 1, 1, 0)) P.HotelPropLocal = 0; - if (!GetInputParameter2(ParamFile_dat, PreParamFile_dat, "Distribution of duration of air journeys", "%lf", (void*) & (P.JourneyDurationDistrib), MAX_TRAVEL_TIME, 1, 0)) + if (!GetInputParameter2(PreParamFile_dat, AdminFile_dat, "Kernel shape params for place types", "%lf", (void*)&(P.PlaceTypeKernelShape), P.PlaceTypeNum, 1, 0)) { - P.JourneyDurationDistrib[0] = 1; - for (i = 0; i < MAX_TRAVEL_TIME; i++) - P.JourneyDurationDistrib[i] = 0; + for (i = 0; i < NUM_PLACE_TYPES; i++) + { + P.PlaceTypeKernelShape[i] = P.MoveKernel.shape_; + P.PlaceTypeKernelScale[i] = P.MoveKernel.scale_; + } } - if (!GetInputParameter2(ParamFile_dat, PreParamFile_dat, "Distribution of duration of local journeys", "%lf", (void*) & (P.LocalJourneyDurationDistrib), MAX_TRAVEL_TIME, 1, 0)) + else + GetInputParameter(PreParamFile_dat, AdminFile_dat, "Kernel scale params for place types", "%lf", (void*)&(P.PlaceTypeKernelScale), P.PlaceTypeNum, 1, 0); + if (!GetInputParameter2(PreParamFile_dat, AdminFile_dat, "Kernel 3rd param for place types", "%lf", (void*)&(P.PlaceTypeKernelP3), P.PlaceTypeNum, 1, 0)) { - P.LocalJourneyDurationDistrib[0] = 1; - for (i = 0; i < MAX_TRAVEL_TIME; i++) - P.LocalJourneyDurationDistrib[i] = 0; + for (i = 0; i < NUM_PLACE_TYPES; i++) + { + P.PlaceTypeKernelP3[i] = P.MoveKernel.p3_; + P.PlaceTypeKernelP4[i] = P.MoveKernel.p4_; + } } - P.MeanJourneyTime = P.MeanLocalJourneyTime = 0; - for (i = 0; i < MAX_TRAVEL_TIME; i++) + else + GetInputParameter(PreParamFile_dat, AdminFile_dat, "Kernel 4th param for place types", "%lf", (void*)&(P.PlaceTypeKernelP4), P.PlaceTypeNum, 1, 0); + if (!GetInputParameter2(PreParamFile_dat, AdminFile_dat, "Number of closest places people pick from (0=all) for place types", "%i", (void*)&(P.PlaceTypeNearestNeighb), P.PlaceTypeNum, 1, 0)) + for (i = 0; i < NUM_PLACE_TYPES; i++) + P.PlaceTypeNearestNeighb[i] = 0; + if (P.DoAdUnits) { - P.MeanJourneyTime += ((double)(i)) * P.JourneyDurationDistrib[i]; - P.MeanLocalJourneyTime += ((double)(i)) * P.LocalJourneyDurationDistrib[i]; + if (!GetInputParameter2(ParamFile_dat, PreParamFile_dat, "Degree to which crossing administrative unit boundaries to go to places is inhibited", "%lf", (void*)&(P.InhibitInterAdunitPlaceAssignment), P.PlaceTypeNum, 1, 0)) + for (i = 0; i < NUM_PLACE_TYPES; i++) + P.InhibitInterAdunitPlaceAssignment[i] = 0; } - fprintf(stderr, "Mean duration of local journeys = %lf days\n", P.MeanLocalJourneyTime); - for (i = 1; i < MAX_TRAVEL_TIME; i++) + + if (!GetInputParameter2(ParamFile_dat, PreParamFile_dat, "Include air travel", "%i", (void*)&(P.DoAirports), 1, 1, 0)) P.DoAirports = 0; + if (!P.DoAirports) { - P.JourneyDurationDistrib[i] += P.JourneyDurationDistrib[i - 1]; - P.LocalJourneyDurationDistrib[i] += P.LocalJourneyDurationDistrib[i - 1]; + // Airports disabled => all places are not to do with airports, and we + // have no hotels. + P.PlaceTypeNoAirNum = P.PlaceTypeNum; + P.HotelPlaceType = P.PlaceTypeNum; } - for (i = j1 = j2 = 0; i <= 1024; i++) + else { - s = ((double)i) / 1024; - while (P.JourneyDurationDistrib[j1] < s) j1++; - P.InvJourneyDurationDistrib[i] = j1; - while (P.LocalJourneyDurationDistrib[j2] < s) j2++; - P.InvLocalJourneyDurationDistrib[i] = j2; + // When airports are activated we must have at least one airport place + // // and a hotel type. + GetInputParameter(PreParamFile_dat, AdminFile_dat, "Number of non-airport places", "%i", (void*)&(P.PlaceTypeNoAirNum), 1, 1, 0); + GetInputParameter(PreParamFile_dat, AdminFile_dat, "Hotel place type", "%i", (void*)&(P.HotelPlaceType), 1, 1, 0); + if (P.PlaceTypeNoAirNum >= P.PlaceTypeNum) { + ERR_CRITICAL_FMT("[Number of non-airport places] parameter (%d) is greater than number of places (%d).\n", P.PlaceTypeNoAirNum, P.PlaceTypeNum); + } + if (P.HotelPlaceType < P.PlaceTypeNoAirNum || P.HotelPlaceType >= P.PlaceTypeNum) { + ERR_CRITICAL_FMT("[Hotel place type] parameter (%d) not in the range [%d, %d)\n", P.HotelPlaceType, P.PlaceTypeNoAirNum, P.PlaceTypeNum); + } + + if (!GetInputParameter2(ParamFile_dat, PreParamFile_dat, "Scaling factor for input file to convert to daily traffic", "%lf", (void*)&(P.AirportTrafficScale), 1, 1, 0)) P.AirportTrafficScale = 1.0; + if (!GetInputParameter2(ParamFile_dat, PreParamFile_dat, "Proportion of hotel attendees who are local", "%lf", (void*)&(P.HotelPropLocal), 1, 1, 0)) P.HotelPropLocal = 0; + if (!GetInputParameter2(ParamFile_dat, PreParamFile_dat, "Distribution of duration of air journeys", "%lf", (void*)&(P.JourneyDurationDistrib), MAX_TRAVEL_TIME, 1, 0)) + { + P.JourneyDurationDistrib[0] = 1; + for (i = 0; i < MAX_TRAVEL_TIME; i++) + P.JourneyDurationDistrib[i] = 0; + } + if (!GetInputParameter2(ParamFile_dat, PreParamFile_dat, "Distribution of duration of local journeys", "%lf", (void*)&(P.LocalJourneyDurationDistrib), MAX_TRAVEL_TIME, 1, 0)) + { + P.LocalJourneyDurationDistrib[0] = 1; + for (i = 0; i < MAX_TRAVEL_TIME; i++) + P.LocalJourneyDurationDistrib[i] = 0; + } + P.MeanJourneyTime = P.MeanLocalJourneyTime = 0; + for (i = 0; i < MAX_TRAVEL_TIME; i++) + { + P.MeanJourneyTime += ((double)(i)) * P.JourneyDurationDistrib[i]; + P.MeanLocalJourneyTime += ((double)(i)) * P.LocalJourneyDurationDistrib[i]; + } + fprintf(stderr, "Mean duration of local journeys = %lf days\n", P.MeanLocalJourneyTime); + for (i = 1; i < MAX_TRAVEL_TIME; i++) + { + P.JourneyDurationDistrib[i] += P.JourneyDurationDistrib[i - 1]; + P.LocalJourneyDurationDistrib[i] += P.LocalJourneyDurationDistrib[i - 1]; + } + for (i = j1 = j2 = 0; i <= 1024; i++) + { + s = ((double)i) / 1024; + while (P.JourneyDurationDistrib[j1] < s) j1++; + P.InvJourneyDurationDistrib[i] = j1; + while (P.LocalJourneyDurationDistrib[j2] < s) j2++; + P.InvLocalJourneyDurationDistrib[i] = j2; + } + } + GetInputParameter(PreParamFile_dat, AdminFile_dat, "Mean size of place types", "%lf", (void*)P.PlaceTypeMeanSize, P.PlaceTypeNum, 1, 0); + GetInputParameter(PreParamFile_dat, AdminFile_dat, "Param 1 of place group size distribution", "%lf", (void*)P.PlaceTypeGroupSizeParam1, P.PlaceTypeNum, 1, 0); + if (!GetInputParameter2(PreParamFile_dat, AdminFile_dat, "Power of place size distribution", "%lf", (void*)P.PlaceTypeSizePower, P.PlaceTypeNum, 1, 0)) + for (i = 0; i < NUM_PLACE_TYPES; i++) + P.PlaceTypeSizePower[i] = 0; + //added to enable lognormal distribution - ggilani 09/02/17 + if (!GetInputParameter2(PreParamFile_dat, AdminFile_dat, "Standard deviation of place size distribution", "%lf", (void*)P.PlaceTypeSizeSD, P.PlaceTypeNum, 1, 0)) + for (i = 0; i < NUM_PLACE_TYPES; i++) + P.PlaceTypeSizeSD[i] = 0; + if (!GetInputParameter2(PreParamFile_dat, AdminFile_dat, "Offset of place size distribution", "%lf", (void*)P.PlaceTypeSizeOffset, P.PlaceTypeNum, 1, 0)) + for (i = 0; i < NUM_PLACE_TYPES; i++) + P.PlaceTypeSizeOffset[i] = 0; + if (!GetInputParameter2(PreParamFile_dat, AdminFile_dat, "Maximum of place size distribution", "%lf", (void*)P.PlaceTypeSizeMax, P.PlaceTypeNum, 1, 0)) + for (i = 0; i < NUM_PLACE_TYPES; i++) + P.PlaceTypeSizeMax[i] = 1e20; + if (!GetInputParameter2(PreParamFile_dat, AdminFile_dat, "Minimum of place size distribution", "%lf", (void*)P.PlaceTypeSizeMin, P.PlaceTypeNum, 1, 0)) + for (i = 0; i < NUM_PLACE_TYPES; i++) + P.PlaceTypeSizeMin[i] = 1.0; + if (!GetInputParameter2(PreParamFile_dat, AdminFile_dat, "Kernel type for place types", "%i", (void*)P.PlaceTypeKernelType, P.PlaceTypeNum, 1, 0)) + for (i = 0; i < NUM_PLACE_TYPES; i++) + P.PlaceTypeKernelType[i] = P.MoveKernel.type_; + if (!GetInputParameter2(PreParamFile_dat, AdminFile_dat, "Place overlap matrix", "%lf", (void*)P.PlaceExclusivityMatrix, P.PlaceTypeNum * P.PlaceTypeNum, 1, 0)) + { + for (i = 0; i < NUM_PLACE_TYPES; i++) + for (j = 0; j < NUM_PLACE_TYPES; j++) + P.PlaceExclusivityMatrix[i * NUM_PLACE_TYPES + j] = (i == j) ? 1 : 0; } } - GetInputParameter(PreParamFile_dat, AdminFile_dat, "Mean size of place types", "%lf", (void*)P.PlaceTypeMeanSize, P.PlaceTypeNum, 1, 0); - GetInputParameter(PreParamFile_dat, AdminFile_dat, "Param 1 of place group size distribution", "%lf", (void*)P.PlaceTypeGroupSizeParam1, P.PlaceTypeNum, 1, 0); - if (!GetInputParameter2(PreParamFile_dat, AdminFile_dat, "Power of place size distribution", "%lf", (void*)P.PlaceTypeSizePower, P.PlaceTypeNum, 1, 0)) - for (i = 0; i < NUM_PLACE_TYPES; i++) - P.PlaceTypeSizePower[i] = 0; - //added to enable lognormal distribution - ggilani 09/02/17 - if (!GetInputParameter2(PreParamFile_dat, AdminFile_dat, "Standard deviation of place size distribution", "%lf", (void*)P.PlaceTypeSizeSD, P.PlaceTypeNum, 1, 0)) - for (i = 0; i < NUM_PLACE_TYPES; i++) - P.PlaceTypeSizeSD[i] = 0; - if (!GetInputParameter2(PreParamFile_dat, AdminFile_dat, "Offset of place size distribution", "%lf", (void*)P.PlaceTypeSizeOffset, P.PlaceTypeNum, 1, 0)) - for (i = 0; i < NUM_PLACE_TYPES; i++) - P.PlaceTypeSizeOffset[i] = 0; - if (!GetInputParameter2(PreParamFile_dat, AdminFile_dat, "Maximum of place size distribution", "%lf", (void*)P.PlaceTypeSizeMax, P.PlaceTypeNum, 1, 0)) - for (i = 0; i < NUM_PLACE_TYPES; i++) - P.PlaceTypeSizeMax[i] = 1e20; - if (!GetInputParameter2(PreParamFile_dat, AdminFile_dat, "Kernel type for place types", "%i", (void*)P.PlaceTypeKernelType, P.PlaceTypeNum, 1, 0)) - for (i = 0; i < NUM_PLACE_TYPES; i++) - P.PlaceTypeKernelType[i] = P.MoveKernel.type_; - GetInputParameter(PreParamFile_dat, AdminFile_dat, "Place overlap matrix", "%lf", (void*)P.PlaceExclusivityMatrix, P.PlaceTypeNum * P.PlaceTypeNum, 1, 0); //changed from P.PlaceTypeNum,P.PlaceTypeNum,0); -/* Note P.PlaceExclusivityMatrix not used at present - places assumed exclusive (each person belongs to 0 or 1 place) */ + /* Note P.PlaceExclusivityMatrix not used at present - places assumed exclusive (each person belongs to 0 or 1 place) */ GetInputParameter(ParamFile_dat, PreParamFile_dat, "Proportion of between group place links", "%lf", (void*)P.PlaceTypePropBetweenGroupLinks, P.PlaceTypeNum, 1, 0); GetInputParameter(ParamFile_dat, PreParamFile_dat, "Relative transmission rates for place types", "%lf", (void*)P.PlaceTypeTrans, P.PlaceTypeNum, 1, 0); @@ -853,7 +945,7 @@ void ReadParams(std::string const& ParamFile, std::string const& PreParamFile, s for (i = 0; i < DAYS_PER_YEAR; i++) P.Seasonality[i] /= s; } - if (!GetInputParameter2(PreParamFile_dat, AdminFile_dat, "Number of seed locations", "%i", (void*) & (P.NumSeedLocations), 1, 1, 0)) P.NumSeedLocations = 1; + if (!GetInputParameter2(PreParamFile_dat, AdminFile_dat, "Number of seed locations", "%i", (void*)&(P.NumSeedLocations), 1, 1, 0)) P.NumSeedLocations = 1; if (P.NumSeedLocations > MAX_NUM_SEED_LOCATIONS) { fprintf(stderr, "Too many seed locations\n"); @@ -861,37 +953,56 @@ void ReadParams(std::string const& ParamFile, std::string const& PreParamFile, s } GetInputParameter(PreParamFile_dat, AdminFile_dat, "Initial number of infecteds", "%i", (void*)P.NumInitialInfections, P.NumSeedLocations, 1, 0); if (!GetInputParameter2(PreParamFile_dat, AdminFile_dat, "Location of initial infecteds", "%lf", (void*)&(P.LocationInitialInfection[0][0]), P.NumSeedLocations * 2, 1, 0)) P.LocationInitialInfection[0][0] = P.LocationInitialInfection[0][1] = 0.0; - if (!GetInputParameter2(PreParamFile_dat, AdminFile_dat, "Minimum population in microcell of initial infection", "%i", (void*) & (P.MinPopDensForInitialInfection), 1, 1, 0)) P.MinPopDensForInitialInfection = 0; + if (!GetInputParameter2(PreParamFile_dat, AdminFile_dat, "Minimum population in microcell of initial infection", "%i", (void*)&(P.MinPopDensForInitialInfection), 1, 1, 0)) P.MinPopDensForInitialInfection = 0; if (!GetInputParameter2(PreParamFile_dat, AdminFile_dat, "Maximum population in microcell of initial infection", "%i", (void*)&(P.MaxPopDensForInitialInfection), 1, 1, 0)) P.MaxPopDensForInitialInfection = 10000000; - if (!GetInputParameter2(PreParamFile_dat, AdminFile_dat, "Randomise initial infection location", "%i", (void*) & (P.DoRandomInitialInfectionLoc), 1, 1, 0)) P.DoRandomInitialInfectionLoc=1; - if (!GetInputParameter2(PreParamFile_dat, AdminFile_dat, "All initial infections located in same microcell", "%i", (void*) & (P.DoAllInitialInfectioninSameLoc), 1, 1, 0)) P.DoAllInitialInfectioninSameLoc=0; - if (P.DoAdUnits) + if (!GetInputParameter2(PreParamFile_dat, AdminFile_dat, "Maximum age of initial infections", "%i", (void*)&(P.MaxAgeForInitialInfection), 1, 1, 0)) P.MaxAgeForInitialInfection = 1000; + if (!GetInputParameter2(PreParamFile_dat, AdminFile_dat, "Randomise initial infection location", "%i", (void*)&(P.DoRandomInitialInfectionLoc), 1, 1, 0)) P.DoRandomInitialInfectionLoc = 1; + if (!GetInputParameter2(PreParamFile_dat, AdminFile_dat, "All initial infections located in same microcell", "%i", (void*)&(P.DoAllInitialInfectioninSameLoc), 1, 1, 0)) P.DoAllInitialInfectioninSameLoc = 0; + if (GetInputParameter2(PreParamFile_dat, AdminFile_dat, "Day of year of start of seeding", "%lf", (void*)&(P.InitialInfectionCalTime), 1, 1, 0)) { - if (!GetInputParameter2(PreParamFile_dat, AdminFile_dat, "Administrative unit to seed initial infection into", "%s", (P.NumSeedLocations > 1) ? ((void*)AdunitListNames) : ((void*)AdunitListNames[0]), P.NumSeedLocations, 1, 0)) - for (i = 0; i < P.NumSeedLocations; i++) P.InitialInfectionsAdminUnit[i] = 0; + if (GetInputParameter2(ParamFile_dat, PreParamFile_dat, "Scaling of infection seeding", "%lf", (void*)&(P.SeedingScaling), 1, 1, 0)) + P.DoNoCalibration = 1; else - for (i = 0; i < P.NumSeedLocations; i++) - { - f = 0; - if (P.NumAdunits > 0) - { - for (j = 0; (j < P.NumAdunits) && (!f); j++) f = (!strcmp(AdUnits[j].ad_name, AdunitListNames[i])); - if (f) k = AdUnits[j-1].id; - } - if (!f) k = atoi(AdunitListNames[i]); - P.InitialInfectionsAdminUnit[i] = k; - P.InitialInfectionsAdminUnitId[i]=P.AdunitLevel1Lookup[(k % P.AdunitLevel1Mask) / P.AdunitLevel1Divisor]; - } - if(!GetInputParameter2(PreParamFile_dat, AdminFile_dat, "Administrative unit seeding weights", "%lf", (void*) & (P.InitialInfectionsAdminUnitWeight[0]), P.NumSeedLocations, 1, 0)) - for(i = 0; i < P.NumSeedLocations; i++) P.InitialInfectionsAdminUnitWeight[i] = 1.0; - s=0; - for(i = 0; i < P.NumSeedLocations; i++) s+=P.InitialInfectionsAdminUnitWeight[i]; - for(i = 0; i < P.NumSeedLocations; i++) P.InitialInfectionsAdminUnitWeight[i]/=s; - // for (i = 0; i < P.NumSeedLocations; i++) fprintf(stderr, "## %i %s %i %i %lf\n",i, AdUnits[P.InitialInfectionsAdminUnitId[i]].ad_name, P.InitialInfectionsAdminUnitId[i], P.InitialInfectionsAdminUnit[i], P.InitialInfectionsAdminUnitWeight[i]); + { + P.SeedingScaling = 1.0; + P.DoNoCalibration = 0; + } } else { - for (i = 0; i < P.NumSeedLocations; i++) P.InitialInfectionsAdminUnit[i] = 0; + P.SeedingScaling = 1.0; + P.DoNoCalibration = 0; + P.InitialInfectionCalTime = -1; + } + if (P.FitIter == 0) + { + if (P.DoAdUnits) + { + if (!GetInputParameter2(PreParamFile_dat, AdminFile_dat, "Administrative unit to seed initial infection into", "%s", (P.NumSeedLocations > 1) ? ((void*)AdunitListNames) : ((void*)AdunitListNames[0]), P.NumSeedLocations, 1, 0)) + for (i = 0; i < P.NumSeedLocations; i++) P.InitialInfectionsAdminUnit[i] = 0; + else + for (i = 0; i < P.NumSeedLocations; i++) + { + f = 0; + if (P.NumAdunits > 0) + { + for (j = 0; (j < P.NumAdunits) && (!f); j++) f = (!strcmp(AdUnits[j].ad_name, AdunitListNames[i])); + if (f) k = AdUnits[j - 1].id; + } + if (!f) k = atoi(AdunitListNames[i]); + P.InitialInfectionsAdminUnit[i] = k; + P.InitialInfectionsAdminUnitId[i] = P.AdunitLevel1Lookup[(k % P.AdunitLevel1Mask) / P.AdunitLevel1Divisor]; + } + if (!GetInputParameter2(PreParamFile_dat, AdminFile_dat, "Administrative unit seeding weights", "%lf", (void*)&(P.InitialInfectionsAdminUnitWeight[0]), P.NumSeedLocations, 1, 0)) + for (i = 0; i < P.NumSeedLocations; i++) P.InitialInfectionsAdminUnitWeight[i] = 1.0; + s = 0; + for (i = 0; i < P.NumSeedLocations; i++) s += P.InitialInfectionsAdminUnitWeight[i]; + for (i = 0; i < P.NumSeedLocations; i++) P.InitialInfectionsAdminUnitWeight[i] /= s; + } + else + { + for (i = 0; i < P.NumSeedLocations; i++) P.InitialInfectionsAdminUnit[i] = 0; + } } if (!GetInputParameter2(ParamFile_dat, PreParamFile_dat, "Initial rate of importation of infections", "%lf", (void*)&(P.InfectionImportRate1), 1, 1, 0)) P.InfectionImportRate1 = 0; if (!GetInputParameter2(ParamFile_dat, PreParamFile_dat, "Changed rate of importation of infections", "%lf", (void*)&(P.InfectionImportRate2), 1, 1, 0)) P.InfectionImportRate2 = 0; @@ -903,13 +1014,21 @@ void ReadParams(std::string const& ParamFile, std::string const& PreParamFile, s if (P.DurImportTimeProfile >= MAX_DUR_IMPORT_PROFILE) ERR_CRITICAL("MAX_DUR_IMPORT_PROFILE too small\n"); GetInputParameter(ParamFile_dat, PreParamFile_dat, "Daily importation time profile", "%lf", (void*)P.ImportInfectionTimeProfile, P.DurImportTimeProfile, 1, 0); } - GetInputParameter(ParamFile_dat, PreParamFile_dat, "Reproduction number", "%lf", (void*) & (P.R0), 1, 1, 0); - GetInputParameter(ParamFile_dat, PreParamFile_dat, "Infectious period", "%lf", (void*) & (P.InfectiousPeriod), 1, 1, 0); + GetInputParameter(ParamFile_dat, PreParamFile_dat, "Reproduction number", "%lf", (void*)&(P.R0), 1, 1, 0); + if (GetInputParameter2(ParamFile_dat, PreParamFile_dat, "Beta for spatial transmission", "%lf", (void*)&(P.LocalBeta), 1, 1, 0)) + P.FixLocalBeta = 1; + else + { + P.LocalBeta = -1.0; + P.FixLocalBeta = 0; + } + GetInputParameter(ParamFile_dat, PreParamFile_dat, "Infectious period", "%lf", (void*)&(P.InfectiousPeriod), 1, 1, 0); if (!GetInputParameter2(ParamFile_dat, PreParamFile_dat, "SD of individual variation in susceptibility", "%lf", (void*)&(P.SusceptibilitySD), 1, 1, 0)) P.SusceptibilitySD = 0; - if (!GetInputParameter2(ParamFile_dat, PreParamFile_dat, "SD of individual variation in infectiousness", "%lf", (void*) & (P.InfectiousnessSD), 1, 1, 0)) P.InfectiousnessSD = 0; - if (GetInputParameter2(ParamFile_dat, PreParamFile_dat, "k of individual variation in infectiousness", "%lf", (void*)& s, 1, 1, 0)) P.InfectiousnessSD = 1.0 / sqrt(s); - if (!GetInputParameter2(ParamFile_dat, PreParamFile_dat, "Model time varying infectiousness", "%i", (void*) & (P.DoInfectiousnessProfile), 1, 1, 0)) P.DoInfectiousnessProfile = 0; - if (!GetInputParameter2(ParamFile_dat, PreParamFile_dat, "Power of scaling of spatial R0 with density", "%lf", (void*) & (P.R0DensityScalePower), 1, 1, 0)) P.R0DensityScalePower = 0; + if (!GetInputParameter2(ParamFile_dat, PreParamFile_dat, "SD of individual variation in infectiousness", "%lf", (void*)&(P.InfectiousnessSD), 1, 1, 0)) P.InfectiousnessSD = 0; + if (GetInputParameter2(ParamFile_dat, PreParamFile_dat, "k of individual variation in infectiousness", "%lf", (void*)&s, 1, 1, 0)) P.InfectiousnessSD = 1.0 / sqrt(s); + if (!GetInputParameter2(ParamFile_dat, PreParamFile_dat, "k does not apply in households", "%i", (void*)&P.NoInfectiousnessSDinHH, 1, 1, 0)) P.NoInfectiousnessSDinHH = 0; + if (!GetInputParameter2(ParamFile_dat, PreParamFile_dat, "Model time varying infectiousness", "%i", (void*)&(P.DoInfectiousnessProfile), 1, 1, 0)) P.DoInfectiousnessProfile = 0; + if (!GetInputParameter2(ParamFile_dat, PreParamFile_dat, "Power of scaling of spatial R0 with density", "%lf", (void*)&(P.R0DensityScalePower), 1, 1, 0)) P.R0DensityScalePower = 0; if (P.DoInfectiousnessProfile) { if (!GetInputParameter2(ParamFile_dat, PreParamFile_dat, "Infectiousness profile", "%lf", (void*)P.infectious_prof, INFPROF_RES, 1, 0)) @@ -948,20 +1067,20 @@ void ReadParams(std::string const& ParamFile, std::string const& PreParamFile, s P.infectiousness[k] = 0; P.infectious_icdf.assign_exponent(); } - if (!GetInputParameter2(ParamFile_dat, PreParamFile_dat, "Include latent period", "%i", (void*) & (P.DoLatent), 1, 1, 0)) P.DoLatent = 0; + if (!GetInputParameter2(ParamFile_dat, PreParamFile_dat, "Include latent period", "%i", (void*)&(P.DoLatent), 1, 1, 0)) P.DoLatent = 0; if (P.DoLatent) { - GetInputParameter(ParamFile_dat, PreParamFile_dat, "Latent period", "%lf", (void*) & (P.LatentPeriod), 1, 1, 0); + GetInputParameter(ParamFile_dat, PreParamFile_dat, "Latent period", "%lf", (void*) &(P.LatentPeriod), 1, 1, 0); GetInverseCdf(ParamFile_dat, PreParamFile_dat, "Latent period inverse CDF", &P.latent_icdf, 1e10); } - if (!GetInputParameter2(ParamFile_dat, PreParamFile_dat, "Include symptoms", "%i", (void*) & (P.DoSymptoms), 1, 1, 0)) P.DoSymptoms = 0; + if (!GetInputParameter2(ParamFile_dat, PreParamFile_dat, "Include symptoms", "%i", (void*)&(P.DoSymptoms), 1, 1, 0)) P.DoSymptoms = 0; if (!P.DoSymptoms) { for (i = 0; i < NUM_AGE_GROUPS; i++) P.ProportionSymptomatic[i] = 0; P.FalsePositiveRate = 0; - P.SymptInfectiousness = 1.0; + P.SymptInfectiousness = P.AsymptInfectiousness = 1.0; P.LatentToSymptDelay = 0; } else @@ -974,10 +1093,11 @@ void ReadParams(std::string const& ParamFile, std::string const& PreParamFile, s for (i = 1; i < NUM_AGE_GROUPS; i++) P.ProportionSymptomatic[i] = P.ProportionSymptomatic[0]; } - GetInputParameter(ParamFile_dat, PreParamFile_dat, "Delay from end of latent period to start of symptoms", "%lf", (void*) & (P.LatentToSymptDelay), 1, 1, 0); - GetInputParameter(ParamFile_dat, PreParamFile_dat, "Relative rate of random contacts if symptomatic", "%lf", (void*) & (P.SymptSpatialContactRate), 1, 1, 0); - GetInputParameter(ParamFile_dat, PreParamFile_dat, "Symptomatic infectiousness relative to asymptomatic", "%lf", (void*) & (P.SymptInfectiousness), 1, 1, 0); - if (!GetInputParameter2(ParamFile_dat, PreParamFile_dat, "Model symptomatic withdrawal to home as true absenteeism", "%i", (void*)& P.DoRealSymptWithdrawal, 1, 1, 0)) P.DoRealSymptWithdrawal = 0; + GetInputParameter(ParamFile_dat, PreParamFile_dat, "Delay from end of latent period to start of symptoms", "%lf", (void*)&(P.LatentToSymptDelay), 1, 1, 0); + GetInputParameter(ParamFile_dat, PreParamFile_dat, "Relative rate of random contacts if symptomatic", "%lf", (void*)&(P.SymptSpatialContactRate), 1, 1, 0); + if (!GetInputParameter2(ParamFile_dat, PreParamFile_dat, "Symptomatic infectiousness relative to asymptomatic", "%lf", (void*)&(P.SymptInfectiousness), 1, 1, 0)) P.SymptInfectiousness = 1.0; + if (!GetInputParameter2(ParamFile_dat, PreParamFile_dat, "Asymptomatic infectiousness relative to symptomatic", "%lf", (void*)&(P.AsymptInfectiousness), 1, 1, 0)) P.AsymptInfectiousness = 1.0; + if (!GetInputParameter2(ParamFile_dat, PreParamFile_dat, "Model symptomatic withdrawal to home as true absenteeism", "%i", (void*)&P.DoRealSymptWithdrawal, 1, 1, 0)) P.DoRealSymptWithdrawal = 0; if (P.DoPlaces) { GetInputParameter(ParamFile_dat, PreParamFile_dat, "Relative level of place attendance if symptomatic", "%lf", (void*)P.SymptPlaceTypeContactRate, P.PlaceTypeNum, 1, 0); @@ -992,8 +1112,8 @@ void ReadParams(std::string const& ParamFile, std::string const& PreParamFile, s else for (j = 0; j < NUM_PLACE_TYPES; j++) P.SymptPlaceTypeWithdrawalProp[j] = 0.0; } - if (!GetInputParameter2(ParamFile_dat, PreParamFile_dat, "Maximum age of child at home for whom one adult also stays at home", "%i", (void*)& P.CaseAbsentChildAgeCutoff, 1, 1, 0)) P.CaseAbsentChildAgeCutoff = 0; - if (!GetInputParameter2(ParamFile_dat, PreParamFile_dat, "Proportion of children at home for whom one adult also stays at home", "%lf", (void*)& P.CaseAbsentChildPropAdultCarers, 1, 1, 0)) P.CaseAbsentChildPropAdultCarers = 0; + if (!GetInputParameter2(ParamFile_dat, PreParamFile_dat, "Maximum age of child at home for whom one adult also stays at home", "%i", (void*)&P.CaseAbsentChildAgeCutoff, 1, 1, 0)) P.CaseAbsentChildAgeCutoff = 0; + if (!GetInputParameter2(ParamFile_dat, PreParamFile_dat, "Proportion of children at home for whom one adult also stays at home", "%lf", (void*)&P.CaseAbsentChildPropAdultCarers, 1, 1, 0)) P.CaseAbsentChildPropAdultCarers = 0; if (!GetInputParameter2(ParamFile_dat, PreParamFile_dat, "Place close round household", "%i", (void*)&P.PlaceCloseRoundHousehold, 1, 1, 0)) P.PlaceCloseRoundHousehold = 1; if (!GetInputParameter2(ParamFile_dat, PreParamFile_dat, "Absenteeism place closure", "%i", (void*)&P.AbsenteeismPlaceClosure, 1, 1, 0)) P.AbsenteeismPlaceClosure = 0; if (P.AbsenteeismPlaceClosure) @@ -1007,20 +1127,27 @@ void ReadParams(std::string const& ParamFile, std::string const& PreParamFile, s } else { - if (!GetInputParameter2(ParamFile_dat, PreParamFile_dat, "Delay in starting place absenteeism for cases who withdraw", "%lf", (void*)& P.CaseAbsenteeismDelay, 1, 1, 0)) P.CaseAbsenteeismDelay = 0; + if (!GetInputParameter2(ParamFile_dat, PreParamFile_dat, "Delay in starting place absenteeism for cases who withdraw", "%lf", (void*)&P.CaseAbsenteeismDelay, 1, 1, 0)) P.CaseAbsenteeismDelay = 0; P.MaxAbsentTime = 0; // Not used when !P.AbsenteeismPlaceClosure } - if (!GetInputParameter2(ParamFile_dat, PreParamFile_dat, "Duration of place absenteeism for cases who withdraw", "%lf", (void*)& P.CaseAbsenteeismDuration, 1, 1, 0)) P.CaseAbsenteeismDuration = 7; + if (!GetInputParameter2(ParamFile_dat, PreParamFile_dat, "Duration of place absenteeism for cases who withdraw", "%lf", (void*)&P.CaseAbsenteeismDuration, 1, 1, 0)) P.CaseAbsenteeismDuration = 7; - if (!GetInputParameter2(ParamFile_dat, PreParamFile_dat, "False positive rate", "%lf", (void*) & (P.FalsePositiveRate), 1, 1, 0)) P.FalsePositiveRate = 0.0; - if (!GetInputParameter2(ParamFile_dat, PreParamFile_dat, "False positive per capita incidence", "%lf", (void*) & (P.FalsePositivePerCapitaIncidence), 1, 1, 0)) P.FalsePositivePerCapitaIncidence = 0.0; + if (!GetInputParameter2(ParamFile_dat, PreParamFile_dat, "False positive rate", "%lf", (void*)&(P.FalsePositiveRate), 1, 1, 0)) P.FalsePositiveRate = 0.0; + if (!GetInputParameter2(ParamFile_dat, PreParamFile_dat, "False positive per capita incidence", "%lf", (void*)&(P.FalsePositivePerCapitaIncidence), 1, 1, 0)) P.FalsePositivePerCapitaIncidence = 0.0; if (!GetInputParameter2(ParamFile_dat, PreParamFile_dat, "False positive relative incidence by age", "%lf", (void*)P.FalsePositiveAgeRate, NUM_AGE_GROUPS, 1, 0)) for (j = 0; j < NUM_AGE_GROUPS; j++) P.FalsePositiveAgeRate[j] = 1.0; } - if(!GetInputParameter2(ParamFile_dat, PreParamFile_dat, "Do Severity Analysis", "%i", (void*) & (P.DoSeverity), 1, 1, 0)) P.DoSeverity = 0; - if(P.DoSeverity == 1) + if (!GetInputParameter2(ParamFile_dat, PreParamFile_dat, "Maximum sensitivity of serology assay", "%lf", (void*)&(P.SeroConvMaxSens), 1, 1, 0)) P.SeroConvMaxSens = 1.0; + if (!GetInputParameter2(ParamFile_dat, PreParamFile_dat, "Seroconversion model parameter 1", "%lf", (void*)&(P.SeroConvP1), 1, 1, 0)) P.SeroConvP1 = 14.0; + if (!GetInputParameter2(ParamFile_dat, PreParamFile_dat, "Seroconversion model parameter 2", "%lf", (void*)&(P.SeroConvP2), 1, 1, 0)) P.SeroConvP2 = 3.0; + if (!GetInputParameter2(ParamFile_dat, PreParamFile_dat, "Specificity of serology assay", "%lf", (void*)&(P.SeroConvSpec), 1, 1, 0)) P.SeroConvSpec = 1.0; + if (!GetInputParameter2(ParamFile_dat, PreParamFile_dat, "Scaling of modelled infection prevalence to match surveys", "%lf", (void*)&(P.InfPrevSurveyScale), 1, 1, 0)) P.InfPrevSurveyScale = 1.0; + + if (!GetInputParameter2(ParamFile_dat, PreParamFile_dat, "Do Severity Analysis", "%i", (void*)&(P.DoSeverity), 1, 1, 0)) P.DoSeverity = 0; + if (P.DoSeverity) { + if (!GetInputParameter2(ParamFile_dat, PreParamFile_dat, "Factor to scale IFR", "%lf", (void*)&(P.ScaleIFR), 1, 1, 0)) P.ScaleIFR = 1.0; //// Means for icdf's. if (!GetInputParameter2(ParamFile_dat, PreParamFile_dat, "MeanTimeToTest", "%lf", (void*)&(P.Mean_TimeToTest), 1, 1, 0)) P.Mean_TimeToTest = 0.0; if (!GetInputParameter2(ParamFile_dat, PreParamFile_dat, "MeanTimeToTestOffset", "%lf", (void*)&(P.Mean_TimeToTestOffset), 1, 1, 0)) P.Mean_TimeToTestOffset = 1.0; @@ -1080,77 +1207,93 @@ void ReadParams(std::string const& ParamFile, std::string const& PreParamFile, s GetInverseCdf(ParamFile_dat, PreParamFile_dat, "SARIToDeath_icdf", &P.SARIToDeath_icdf); GetInverseCdf(ParamFile_dat, PreParamFile_dat, "CriticalToDeath_icdf", &P.CriticalToDeath_icdf); - if(!GetInputParameter2(ParamFile_dat, PreParamFile_dat, "Prop_Mild_ByAge", "%lf", (void*)P.Prop_Mild_ByAge, NUM_AGE_GROUPS, 1, 0)) - for(i = 0; i < NUM_AGE_GROUPS; i++) + if (!GetInputParameter2(ParamFile_dat, PreParamFile_dat, "Prop_Mild_ByAge", "%lf", (void*)P.Prop_Mild_ByAge, NUM_AGE_GROUPS, 1, 0)) + for (i = 0; i < NUM_AGE_GROUPS; i++) P.Prop_Mild_ByAge[i] = 0.5; - if(!GetInputParameter2(ParamFile_dat, PreParamFile_dat, "Prop_ILI_ByAge", "%lf", (void*)P.Prop_ILI_ByAge, NUM_AGE_GROUPS, 1, 0)) - for(i = 0; i < NUM_AGE_GROUPS; i++) + + if (!GetInputParameter2(ParamFile_dat, PreParamFile_dat, "Prop_ILI_ByAge", "%lf", (void*)P.Prop_ILI_ByAge, NUM_AGE_GROUPS, 1, 0)) + for (i = 0; i < NUM_AGE_GROUPS; i++) P.Prop_ILI_ByAge[i] = 0.3; - if(!GetInputParameter2(ParamFile_dat, PreParamFile_dat, "Prop_SARI_ByAge", "%lf", (void*)P.Prop_SARI_ByAge, NUM_AGE_GROUPS, 1, 0)) - for(i = 0; i < NUM_AGE_GROUPS; i++) + + if (!GetInputParameter2(ParamFile_dat, PreParamFile_dat, "Prop_SARI_ByAge", "%lf", (void*)P.Prop_SARI_ByAge, NUM_AGE_GROUPS, 1, 0)) + for (i = 0; i < NUM_AGE_GROUPS; i++) P.Prop_SARI_ByAge[i] = 0.15; - if(!GetInputParameter2(ParamFile_dat, PreParamFile_dat, "Prop_Critical_ByAge", "%lf", (void*)P.Prop_Critical_ByAge, NUM_AGE_GROUPS, 1, 0)) - for(i = 0; i < NUM_AGE_GROUPS; i++) + + if (!GetInputParameter2(ParamFile_dat, PreParamFile_dat, "Prop_Critical_ByAge", "%lf", (void*)P.Prop_Critical_ByAge, NUM_AGE_GROUPS, 1, 0)) + for (i = 0; i < NUM_AGE_GROUPS; i++) P.Prop_Critical_ByAge[i] = 0.05; - if(!GetInputParameter2(ParamFile_dat, PreParamFile_dat, "CFR_SARI_ByAge", "%lf", (void*)P.CFR_SARI_ByAge, NUM_AGE_GROUPS, 1, 0)) - for(i = 0; i < NUM_AGE_GROUPS; i++) + + if (!GetInputParameter2(ParamFile_dat, PreParamFile_dat, "CFR_SARI_ByAge", "%lf", (void*)P.CFR_SARI_ByAge, NUM_AGE_GROUPS, 1, 0)) + for (i = 0; i < NUM_AGE_GROUPS; i++) P.CFR_SARI_ByAge[i] = 0.50; - if(!GetInputParameter2(ParamFile_dat, PreParamFile_dat, "CFR_Critical_ByAge", "%lf", (void*)P.CFR_Critical_ByAge, NUM_AGE_GROUPS, 1, 0)) - for(i = 0; i < NUM_AGE_GROUPS; i++) + + if (!GetInputParameter2(ParamFile_dat, PreParamFile_dat, "CFR_Critical_ByAge", "%lf", (void*)P.CFR_Critical_ByAge, NUM_AGE_GROUPS, 1, 0)) + for (i = 0; i < NUM_AGE_GROUPS; i++) P.CFR_Critical_ByAge[i] = 0.50; + if (!GetInputParameter2(ParamFile_dat, PreParamFile_dat, "CFR_ILI_ByAge", "%lf", (void*)P.CFR_ILI_ByAge, NUM_AGE_GROUPS, 1, 0)) for (i = 0; i < NUM_AGE_GROUPS; i++) P.CFR_ILI_ByAge[i] = 0.00; + + //Add param to allow severity to be uniformly scaled up or down. + for (i = 0; i < NUM_AGE_GROUPS; i++) + { + P.Prop_SARI_ByAge[i] *= P.ScaleIFR; + P.Prop_Critical_ByAge[i] *= P.ScaleIFR; + P.Prop_ILI_ByAge[i] = 1.0 - P.Prop_Mild_ByAge[i] - P.Prop_SARI_ByAge[i] - P.Prop_Critical_ByAge[i]; + } } + if (P.FitIter == 0) + { + if (!GetInputParameter2(ParamFile_dat, PreParamFile_dat, "Bounding box for bitmap", "%lf", (void*) &(P.BoundingBox[0]), 4, 1, 0)) + { + P.BoundingBox[0] = P.BoundingBox[1] = 0.0; + P.BoundingBox[2] = P.BoundingBox[3] = 1.0; + } + if (!GetInputParameter2(ParamFile_dat, PreParamFile_dat, "Spatial domain for simulation", "%lf", (void*) &(P.SpatialBoundingBox[0]), 4, 1, 0)) + { + P.SpatialBoundingBox[0] = P.SpatialBoundingBox[1] = 0.0; + P.SpatialBoundingBox[2] = P.SpatialBoundingBox[3] = 1.0; + } + if (!GetInputParameter2(ParamFile_dat, PreParamFile_dat, "Grid size", "%lf", (void*)&(P.in_cells_.width), 1, 1, 0)) P.in_cells_.width = 1.0 / 120.0; + if (!GetInputParameter2(ParamFile_dat, PreParamFile_dat, "Use long/lat coord system", "%i", (void*)&(P.DoUTM_coords), 1, 1, 0)) P.DoUTM_coords = 1; + if (!GetInputParameter2(ParamFile_dat, PreParamFile_dat, "Bitmap scale", "%lf", (void*)&(P.BitmapScale), 1, 1, 0)) P.BitmapScale = 1.0; + if (!GetInputParameter2(ParamFile_dat, PreParamFile_dat, "Bitmap y:x aspect scaling", "%lf", (void*)&(P.BitmapAspectScale), 1, 1, 0)) P.BitmapAspectScale = 1.0; + if (!GetInputParameter2(ParamFile_dat, PreParamFile_dat, "Bitmap movie frame interval", "%i", (void*)&(P.BitmapMovieFrame), 1, 1, 0)) P.BitmapMovieFrame = 250; + if (!GetInputParameter2(ParamFile_dat, PreParamFile_dat, "Output bitmap", "%i", (void*)&(P.OutputBitmap), 1, 1, 0)) P.OutputBitmap = 0; + if (!GetInputParameter2(ParamFile_dat, PreParamFile_dat, "Output bitmap detected", "%i", (void*)&(P.OutputBitmapDetected), 1, 1, 0)) P.OutputBitmapDetected = 0; + if (!GetInputParameter2(ParamFile_dat, PreParamFile_dat, "Output immunity on bitmap", "%i", (void*)&(P.DoImmuneBitmap), 1, 1, 0)) P.DoImmuneBitmap = 0; + if (!GetInputParameter2(ParamFile_dat, PreParamFile_dat, "Output infection tree", "%i", (void*)&(P.DoInfectionTree), 1, 1, 0)) P.DoInfectionTree = 0; + if (!GetInputParameter2(ParamFile_dat, PreParamFile_dat, "Do one generation", "%i", (void*)&(P.DoOneGen), 1, 1, 0)) P.DoOneGen = 0; + if (!GetInputParameter2(ParamFile_dat, PreParamFile_dat, "Output every realisation", "%i", (void*)&(P.OutputEveryRealisation), 1, 1, 0)) P.OutputEveryRealisation = 0; + if (!GetInputParameter2(ParamFile_dat, PreParamFile_dat, "Maximum number to sample for correlations", "%i", (void*)&(P.MaxCorrSample), 1, 1, 0)) P.MaxCorrSample = 1000000000; + if (!GetInputParameter2(ParamFile_dat, PreParamFile_dat, "Assume SI model", "%i", (void*)&(P.DoSI), 1, 1, 0)) P.DoSI = 0; + if (!GetInputParameter2(ParamFile_dat, PreParamFile_dat, "Assume periodic boundary conditions", "%i", (void*)&(P.DoPeriodicBoundaries), 1, 1, 0)) P.DoPeriodicBoundaries = 0; + if (!GetInputParameter2(ParamFile_dat, PreParamFile_dat, "Only output non-extinct realisations", "%i", (void*)&(P.OutputOnlyNonExtinct), 1, 1, 0)) P.OutputOnlyNonExtinct = 0; - if (!GetInputParameter2(ParamFile_dat, PreParamFile_dat, "Bounding box for bitmap", "%lf", (void*) & (P.BoundingBox[0]), 4, 1, 0)) - { - P.BoundingBox[0] = P.BoundingBox[1] = 0.0; - P.BoundingBox[2] = P.BoundingBox[3] = 1.0; - } - if (!GetInputParameter2(ParamFile_dat, PreParamFile_dat, "Spatial domain for simulation", "%lf", (void*) & (P.SpatialBoundingBox[0]), 4, 1, 0)) - { - P.SpatialBoundingBox[0] = P.SpatialBoundingBox[1] = 0.0; - P.SpatialBoundingBox[2] = P.SpatialBoundingBox[3] = 1.0; - } - if (!GetInputParameter2(ParamFile_dat, PreParamFile_dat, "Grid size", "%lf", (void*) & (P.in_cells_.width), 1, 1, 0)) P.in_cells_.width = 1.0 / 120.0; - if (!GetInputParameter2(ParamFile_dat, PreParamFile_dat, "Use long/lat coord system", "%i", (void*) & (P.DoUTM_coords), 1, 1, 0)) P.DoUTM_coords = 1; - if (!GetInputParameter2(ParamFile_dat, PreParamFile_dat, "Bitmap scale", "%lf", (void*) & (P.BitmapScale), 1, 1, 0)) P.BitmapScale = 1.0; - if (!GetInputParameter2(ParamFile_dat, PreParamFile_dat, "Bitmap y:x aspect scaling", "%lf", (void*) & (P.BitmapAspectScale), 1, 1, 0)) P.BitmapAspectScale = 1.0; - if (!GetInputParameter2(ParamFile_dat, PreParamFile_dat, "Bitmap movie frame interval", "%i", (void*) & (P.BitmapMovieFrame), 1, 1, 0)) P.BitmapMovieFrame = 250; - if (!GetInputParameter2(ParamFile_dat, PreParamFile_dat, "Output bitmap", "%i", (void*) & (P.OutputBitmap), 1, 1, 0)) P.OutputBitmap = 0; - if (!GetInputParameter2(ParamFile_dat, PreParamFile_dat, "Output bitmap detected", "%i", (void*) & (P.OutputBitmapDetected), 1, 1, 0)) P.OutputBitmapDetected = 0; - if (!GetInputParameter2(ParamFile_dat, PreParamFile_dat, "Output immunity on bitmap", "%i", (void*) & (P.DoImmuneBitmap), 1, 1, 0)) P.DoImmuneBitmap = 0; - if (!GetInputParameter2(ParamFile_dat, PreParamFile_dat, "Output infection tree", "%i", (void*) & (P.DoInfectionTree), 1, 1, 0)) P.DoInfectionTree = 0; - if (!GetInputParameter2(ParamFile_dat, PreParamFile_dat, "Do one generation", "%i", (void*) & (P.DoOneGen), 1, 1, 0)) P.DoOneGen = 0; - if (!GetInputParameter2(ParamFile_dat, PreParamFile_dat, "Output every realisation", "%i", (void*) & (P.OutputEveryRealisation), 1, 1, 0)) P.OutputEveryRealisation = 0; - if (!GetInputParameter2(ParamFile_dat, PreParamFile_dat, "Maximum number to sample for correlations", "%i", (void*) & (P.MaxCorrSample), 1, 1, 0)) P.MaxCorrSample = 1000000000; - if (!GetInputParameter2(ParamFile_dat, PreParamFile_dat, "Assume SI model", "%i", (void*) & (P.DoSI), 1, 1, 0)) P.DoSI = 0; - if (!GetInputParameter2(ParamFile_dat, PreParamFile_dat, "Assume periodic boundary conditions", "%i", (void*) & (P.DoPeriodicBoundaries), 1, 1, 0)) P.DoPeriodicBoundaries = 0; - if (!GetInputParameter2(ParamFile_dat, PreParamFile_dat, "Only output non-extinct realisations", "%i", (void*) & (P.OutputOnlyNonExtinct), 1, 1, 0)) P.OutputOnlyNonExtinct = 0; - - if (!GetInputParameter2(ParamFile_dat, PreParamFile_dat, "Use cases per thousand threshold for area controls", "%i", (void*) & (P.DoPerCapitaTriggers), 1, 1, 0)) P.DoPerCapitaTriggers = 0; - if (!GetInputParameter2(ParamFile_dat, PreParamFile_dat, "Use global triggers for interventions", "%i", (void*) & (P.DoGlobalTriggers), 1, 1, 0)) P.DoGlobalTriggers = 0; - if (!GetInputParameter2(ParamFile_dat, PreParamFile_dat, "Use admin unit triggers for interventions", "%i", (void*) & (P.DoAdminTriggers), 1, 1, 0)) P.DoAdminTriggers = 0; - if(!GetInputParameter2(ParamFile_dat, PreParamFile_dat, "Use ICU case triggers for interventions", "%i", (void*) & (P.DoICUTriggers), 1, 1, 0)) P.DoICUTriggers = 0; - if (P.DoGlobalTriggers) P.DoAdminTriggers = 0; - if (!GetInputParameter2(ParamFile_dat, PreParamFile_dat, "Divisor for per-capita area threshold (default 1000)", "%i", (void*) & (P.IncThreshPop), 1, 1, 0)) P.IncThreshPop = 1000; - if (!GetInputParameter2(ParamFile_dat, PreParamFile_dat, "Divisor for per-capita global threshold (default 1000)", "%i", (void*) & (P.GlobalIncThreshPop), 1, 1, 0)) P.GlobalIncThreshPop = 1000; - - - if (!GetInputParameter2(ParamFile_dat, PreParamFile_dat, "Number of sampling intervals over which cumulative incidence measured for global trigger", "%i", (void*) & (P.TriggersSamplingInterval), 1, 1, 0)) P.TriggersSamplingInterval = 10000000; - if (!GetInputParameter2(ParamFile_dat, PreParamFile_dat, "Proportion of cases detected for treatment", "%lf", (void*) & (P.PostAlertControlPropCasesId), 1, 1, 0)) P.PostAlertControlPropCasesId = 1; - if (!GetInputParameter2(ParamFile_dat, PreParamFile_dat, "Proportion of cases detected before outbreak alert", "%lf", (void*) & (P.PreAlertControlPropCasesId), 1, 1, 0)) P.PreAlertControlPropCasesId = 1.0; - if (!GetInputParameter2(ParamFile_dat, PreParamFile_dat, "Trigger alert on deaths", "%i", (void*)&(P.TriggerAlertOnDeaths), 1, 1, 0)) P.TriggerAlertOnDeaths = 0; + if (!GetInputParameter2(ParamFile_dat, PreParamFile_dat, "Use cases per thousand threshold for area controls", "%i", (void*)&(P.DoPerCapitaTriggers), 1, 1, 0)) P.DoPerCapitaTriggers = 0; + if (!GetInputParameter2(ParamFile_dat, PreParamFile_dat, "Use global triggers for interventions", "%i", (void*)&(P.DoGlobalTriggers), 1, 1, 0)) P.DoGlobalTriggers = 0; + if (!GetInputParameter2(ParamFile_dat, PreParamFile_dat, "Use admin unit triggers for interventions", "%i", (void*)&(P.DoAdminTriggers), 1, 1, 0)) P.DoAdminTriggers = 0; + if (!GetInputParameter2(ParamFile_dat, PreParamFile_dat, "Use ICU case triggers for interventions", "%i", (void*)&(P.DoICUTriggers), 1, 1, 0)) P.DoICUTriggers = 0; + if (P.DoGlobalTriggers) P.DoAdminTriggers = 0; + if (!GetInputParameter2(ParamFile_dat, PreParamFile_dat, "Divisor for per-capita area threshold (default 1000)", "%i", (void*)&(P.IncThreshPop), 1, 1, 0)) P.IncThreshPop = 1000; + if (!GetInputParameter2(ParamFile_dat, PreParamFile_dat, "Divisor for per-capita global threshold (default 1000)", "%i", (void*)&(P.GlobalIncThreshPop), 1, 1, 0)) P.GlobalIncThreshPop = 1000; + + if (!GetInputParameter2(ParamFile_dat, PreParamFile_dat, "Number of sampling intervals over which cumulative incidence measured for global trigger", "%i", (void*)&(P.TriggersSamplingInterval), 1, 1, 0)) P.TriggersSamplingInterval = 10000000; + if (!GetInputParameter2(ParamFile_dat, PreParamFile_dat, "Proportion of cases detected for treatment", "%lf", (void*)&(P.PostAlertControlPropCasesId), 1, 1, 0)) P.PostAlertControlPropCasesId = 1; + if (!GetInputParameter2(ParamFile_dat, PreParamFile_dat, "Proportion of cases detected before outbreak alert", "%lf", (void*)&(P.PreAlertControlPropCasesId), 1, 1, 0)) P.PreAlertControlPropCasesId = 1.0; + if (!GetInputParameter2(ParamFile_dat, PreParamFile_dat, "Trigger alert on deaths", "%i", (void*)&(P.TriggerAlertOnDeaths), 1, 1, 0)) P.TriggerAlertOnDeaths = 0; + } if (P.TriggerAlertOnDeaths) { - if (P.CaseOrDeathThresholdBeforeAlert == 0) - if (!GetInputParameter2(ParamFile_dat, PreParamFile_dat, "Number of deaths accummulated before alert", "%i", (void*)&(P.CaseOrDeathThresholdBeforeAlert), 1, 1, 0)) P.CaseOrDeathThresholdBeforeAlert = 0; + if (!GetInputParameter2(ParamFile_dat, PreParamFile_dat, "Number of deaths accummulated before alert", "%i", (void*)&(P.CaseOrDeathThresholdBeforeAlert), 1, 1, 0)) P.CaseOrDeathThresholdBeforeAlert = 0; } - else if (P.CaseOrDeathThresholdBeforeAlert == 0) + else { - if (!GetInputParameter2(ParamFile_dat, PreParamFile_dat, "Number of detected cases needed before outbreak alert triggered", "%i", (void*) & (P.CaseOrDeathThresholdBeforeAlert), 1, 1, 0)) P.CaseOrDeathThresholdBeforeAlert = 0; + if (!GetInputParameter2(ParamFile_dat, PreParamFile_dat, "Number of detected cases needed before outbreak alert triggered", "%i", (void*)&(P.CaseOrDeathThresholdBeforeAlert), 1, 1, 0)) P.CaseOrDeathThresholdBeforeAlert = 0; } + + if (P.CaseOrDeathThresholdBeforeAlert_CommandLine > 0) P.CaseOrDeathThresholdBeforeAlert = P.CaseOrDeathThresholdBeforeAlert_CommandLine; if (!GetInputParameter2(ParamFile_dat, PreParamFile_dat, "Alert trigger starts after interventions", "%i", (void*)&(P.DoAlertTriggerAfterInterv), 1, 1, 0)) P.DoAlertTriggerAfterInterv = 0; if (!GetInputParameter2(ParamFile_dat, PreParamFile_dat, "Day of year trigger is reached", "%lf", (void*)&(P.DateTriggerReached_CalTime), 1, 1, 0)) P.DateTriggerReached_CalTime = -1; if (P.DoAlertTriggerAfterInterv) @@ -1162,15 +1305,20 @@ void ReadParams(std::string const& ParamFile, std::string const& PreParamFile, s { P.AlertTriggerAfterIntervThreshold = P.CaseOrDeathThresholdBeforeAlert; P.CaseOrDeathThresholdBeforeAlert = 1000; + fprintf(stderr, "Threshold of %i deaths by day %lg\n", P.AlertTriggerAfterIntervThreshold, P.DateTriggerReached_CalTime); } } else + { P.Interventions_StartDate_CalTime = P.DateTriggerReached_CalTime; - P.CaseOrDeathThresholdBeforeAlert_Fixed = P.CaseOrDeathThresholdBeforeAlert; - //if (P.DoAlertTriggerAfterInterv) P.ResetSeeds =P.KeepSameSeeds = 1; + } + if (P.FitIter == 0) + { + P.CaseOrDeathThresholdBeforeAlert_Fixed = P.CaseOrDeathThresholdBeforeAlert; + } + if (!GetInputParameter2(ParamFile_dat, PreParamFile_dat, "Number of days to accummulate cases/deaths before alert", "%i", (void*)&(P.WindowToEvaluateTriggerAlert), 1, 1, 0)) P.WindowToEvaluateTriggerAlert = 1000; - if (!GetInputParameter2(ParamFile_dat, PreParamFile_dat, "Only use confirmed cases to trigger alert", "%i", (void*) & (P.DoEarlyCaseDiagnosis), 1, 1, 0)) P.DoEarlyCaseDiagnosis = 0; if (!GetInputParameter2(ParamFile_dat, PreParamFile_dat, "Only treat mixing groups within places", "%i", (void*) & (P.DoPlaceGroupTreat), 1, 1, 0)) P.DoPlaceGroupTreat = 0; if (!GetInputParameter2(ParamFile_dat, PreParamFile_dat, "Treatment trigger incidence per cell" , "%lf", (void*) & (P.TreatCellIncThresh) , 1, 1, 0)) P.TreatCellIncThresh = 1000000000; @@ -1361,10 +1509,6 @@ void ReadParams(std::string const& ParamFile, std::string const& PreParamFile, s if (!GetInputParameter2(ParamFile_dat, PreParamFile_dat, "Output digital contact tracing", "%i", (void*) & (P.OutputDigitalContactTracing), 1, 1, 0)) P.OutputDigitalContactTracing = 0; if (!GetInputParameter2(ParamFile_dat, PreParamFile_dat, "Output digital contact distribution", "%i", (void*)&(P.OutputDigitalContactDist), 1, 1, 0)) P.OutputDigitalContactDist = 0; - //if (!GetInputParameter2(ParamFile_dat, PreParamFile_dat, "Include household contacts in digital contact tracing", "%i", (void*) & (P.IncludeHouseholdDigitalContactTracing), 1, 1, 0)) P.IncludeHouseholdDigitalContactTracing = 1; - //if (!GetInputParameter2(ParamFile_dat, PreParamFile_dat, "Include place group contacts in digital contact tracing", "%i", (void*) & (P.IncludePlaceGroupDigitalContactTracing), 1, 1, 0)) P.IncludePlaceGroupDigitalContactTracing = 1; - - //added admin unit specific delays by admin unit if (P.DoInterventionDelaysByAdUnit) { double AdunitDelayToDCT[MAX_ADUNITS]; @@ -1823,79 +1967,80 @@ void ReadParams(std::string const& ParamFile, std::string const& PreParamFile, s P.DCT_MaxToTrace_OverTime [DCT_ChangeTime] = P.DCT_MaxToTrace_OverTime [P.Num_DCT_ChangeTimes - 1]; } } - - if (P.DoPlaces) + if(P.FitIter==0) { - if (!GetInputParameter2(ParamFile_dat, PreParamFile_dat, "Number of key workers randomly distributed in the population", "%i", (void*) & (P.KeyWorkerPopNum), 1, 1, 0)) P.KeyWorkerPopNum = 0; - if (!GetInputParameter2(ParamFile_dat, PreParamFile_dat, "Number of key workers in different places by place type", "%i", (void*)P.KeyWorkerPlaceNum, P.PlaceTypeNum, 1, 0)) - for (i = 0; i < NUM_PLACE_TYPES; i++) P.KeyWorkerPlaceNum[i] = 0; - if (!GetInputParameter2(ParamFile_dat, PreParamFile_dat, "Proportion of staff who are key workers per chosen place by place type", "%lf", (void*)P.KeyWorkerPropInKeyPlaces, P.PlaceTypeNum, 1, 0)) - for (i = 0; i < NUM_PLACE_TYPES; i++) P.KeyWorkerPropInKeyPlaces[i] = 1.0; - if (!GetInputParameter2(ParamFile_dat, PreParamFile_dat, "Trigger incidence per cell for key worker prophylaxis", "%i", (void*) & (P.KeyWorkerProphCellIncThresh), 1, 1, 0)) P.KeyWorkerProphCellIncThresh = 1000000000; - if (!GetInputParameter2(ParamFile_dat, PreParamFile_dat, "Key worker prophylaxis start time", "%lf", (void*) & (P.KeyWorkerProphTimeStartBase), 1, 1, 0)) P.KeyWorkerProphTimeStartBase = USHRT_MAX / P.TimeStepsPerDay; - if (!GetInputParameter2(ParamFile_dat, PreParamFile_dat, "Duration of key worker prophylaxis", "%lf", (void*) & (P.KeyWorkerProphDuration), 1, 1, 0)) P.KeyWorkerProphDuration = 0; - if (!GetInputParameter2(ParamFile_dat, PreParamFile_dat, "Time interval from start of key worker prophylaxis before policy restarted", "%lf", (void*) & (P.KeyWorkerProphRenewalDuration), 1, 1, 0)) P.KeyWorkerProphRenewalDuration = P.KeyWorkerProphDuration; - if (P.DoHouseholds) + if (P.DoPlaces) { - if (!GetInputParameter2(ParamFile_dat, PreParamFile_dat, "Proportion of key workers whose households are also treated as key workers", "%lf", (void*) & (P.KeyWorkerHouseProp), 1, 1, 0)) P.KeyWorkerHouseProp = 0; + if (!GetInputParameter2(ParamFile_dat, PreParamFile_dat, "Number of key workers randomly distributed in the population", "%i", (void*) & (P.KeyWorkerPopNum), 1, 1, 0)) P.KeyWorkerPopNum = 0; + if (!GetInputParameter2(ParamFile_dat, PreParamFile_dat, "Number of key workers in different places by place type", "%i", (void*)P.KeyWorkerPlaceNum, P.PlaceTypeNum, 1, 0)) + for (i = 0; i < NUM_PLACE_TYPES; i++) P.KeyWorkerPlaceNum[i] = 0; + if (!GetInputParameter2(ParamFile_dat, PreParamFile_dat, "Proportion of staff who are key workers per chosen place by place type", "%lf", (void*)P.KeyWorkerPropInKeyPlaces, P.PlaceTypeNum, 1, 0)) + for (i = 0; i < NUM_PLACE_TYPES; i++) P.KeyWorkerPropInKeyPlaces[i] = 1.0; + if (!GetInputParameter2(ParamFile_dat, PreParamFile_dat, "Trigger incidence per cell for key worker prophylaxis", "%i", (void*) & (P.KeyWorkerProphCellIncThresh), 1, 1, 0)) P.KeyWorkerProphCellIncThresh = 1000000000; + if (!GetInputParameter2(ParamFile_dat, PreParamFile_dat, "Key worker prophylaxis start time", "%lf", (void*) & (P.KeyWorkerProphTimeStartBase), 1, 1, 0)) P.KeyWorkerProphTimeStartBase = USHRT_MAX / P.TimeStepsPerDay; + if (!GetInputParameter2(ParamFile_dat, PreParamFile_dat, "Duration of key worker prophylaxis", "%lf", (void*) & (P.KeyWorkerProphDuration), 1, 1, 0)) P.KeyWorkerProphDuration = 0; + if (!GetInputParameter2(ParamFile_dat, PreParamFile_dat, "Time interval from start of key worker prophylaxis before policy restarted", "%lf", (void*) & (P.KeyWorkerProphRenewalDuration), 1, 1, 0)) P.KeyWorkerProphRenewalDuration = P.KeyWorkerProphDuration; + if (P.DoHouseholds) + { + if (!GetInputParameter2(ParamFile_dat, PreParamFile_dat, "Proportion of key workers whose households are also treated as key workers", "%lf", (void*) & (P.KeyWorkerHouseProp), 1, 1, 0)) P.KeyWorkerHouseProp = 0; + } + if (!GetInputParameter2(ParamFile_dat, PreParamFile_dat, "Minimum radius for key worker prophylaxis", "%lf", (void*) & (P.KeyWorkerProphRadius), 1, 1, 0)) P.KeyWorkerProphRadius = 0; + } + else + { + P.KeyWorkerPopNum = 0; + P.KeyWorkerProphTimeStartBase = 1e10; } - if (!GetInputParameter2(ParamFile_dat, PreParamFile_dat, "Minimum radius for key worker prophylaxis", "%lf", (void*) & (P.KeyWorkerProphRadius), 1, 1, 0)) P.KeyWorkerProphRadius = 0; - } - else - { - P.KeyWorkerPopNum = 0; - P.KeyWorkerProphTimeStartBase = 1e10; - } - //Added this to parameter list so that recording infection events (and the number to record) can easily be turned off and on: ggilani - 10/10/2014 - if (!GetInputParameter2(ParamFile_dat, PreParamFile_dat, "Record infection events", "%i", (void*) & (P.DoRecordInfEvents), 1, 1, 0)) P.DoRecordInfEvents = 0; - if (P.DoRecordInfEvents) - { - if (!GetInputParameter2(ParamFile_dat, PreParamFile_dat, "Max number of infection events to record", "%i", (void*) & (P.MaxInfEvents), 1, 1, 0)) P.MaxInfEvents = 1000; - if (!GetInputParameter2(ParamFile_dat, PreParamFile_dat, "Record infection events per run", "%i", (void*) & (P.RecordInfEventsPerRun), 1, 1, 0)) P.RecordInfEventsPerRun = 0; + //Added this to parameter list so that recording infection events (and the number to record) can easily be turned off and on: ggilani - 10/10/2014 + if (!GetInputParameter2(ParamFile_dat, PreParamFile_dat, "Record infection events", "%i", (void*) & (P.DoRecordInfEvents), 1, 1, 0)) P.DoRecordInfEvents = 0; + if (P.DoRecordInfEvents) + { + if (!GetInputParameter2(ParamFile_dat, PreParamFile_dat, "Max number of infection events to record", "%i", (void*) & (P.MaxInfEvents), 1, 1, 0)) P.MaxInfEvents = 1000; + if (!GetInputParameter2(ParamFile_dat, PreParamFile_dat, "Record infection events per run", "%i", (void*) & (P.RecordInfEventsPerRun), 1, 1, 0)) P.RecordInfEventsPerRun = 0; + } + else + { + P.MaxInfEvents = 0; + } + //Include a limit to the number of infections to simulate, if this happens before time runs out + if (!GetInputParameter2(ParamFile_dat, PreParamFile_dat, "Limit number of infections", "%i", (void*) & (P.LimitNumInfections), 1, 1, 0)) P.LimitNumInfections = 0; + if (P.LimitNumInfections) + { + if (!GetInputParameter2(ParamFile_dat, PreParamFile_dat, "Max number of infections", "%i", (void*) & (P.MaxNumInfections), 1, 1, 0)) P.MaxNumInfections = 60000; + } + //Add origin-destination matrix parameter + if (!GetInputParameter2(ParamFile_dat, PreParamFile_dat, "Output origin destination matrix", "%i", (void*) & (P.DoOriginDestinationMatrix), 1, 1, 0)) P.DoOriginDestinationMatrix = 0; + + if (!GetInputParameter2all(ParamFile_dat, PreParamFile_dat,AdminFile_dat, "Mean child age gap", "%i", (void*) & (P.MeanChildAgeGap), 1, 1, 0)) P.MeanChildAgeGap=2; + if (!GetInputParameter2all(ParamFile_dat, PreParamFile_dat,AdminFile_dat, "Min adult age", "%i", (void*)&(P.MinAdultAge), 1, 1, 0)) P.MinAdultAge = 19; + if (!GetInputParameter2all(ParamFile_dat, PreParamFile_dat,AdminFile_dat, "Max MF partner age gap", "%i", (void*) & (P.MaxMFPartnerAgeGap), 1, 1, 0)) P.MaxMFPartnerAgeGap = 5; + if (!GetInputParameter2all(ParamFile_dat, PreParamFile_dat,AdminFile_dat, "Max FM partner age gap", "%i", (void*) & (P.MaxFMPartnerAgeGap), 1, 1, 0)) P.MaxFMPartnerAgeGap = 5; + if (!GetInputParameter2all(ParamFile_dat, PreParamFile_dat,AdminFile_dat, "Min parent age gap", "%i", (void*) & (P.MinParentAgeGap), 1, 1, 0)) P.MinParentAgeGap = 19; + if (!GetInputParameter2all(ParamFile_dat, PreParamFile_dat,AdminFile_dat, "Max parent age gap", "%i", (void*) & (P.MaxParentAgeGap), 1, 1, 0)) P.MaxParentAgeGap = 44; + if (!GetInputParameter2all(ParamFile_dat, PreParamFile_dat,AdminFile_dat, "Max child age", "%i", (void*) & (P.MaxChildAge), 1, 1, 0)) P.MaxChildAge = 20; + if (!GetInputParameter2all(ParamFile_dat, PreParamFile_dat,AdminFile_dat, "One Child Two Pers Prob", "%lf", (void*) & (P.OneChildTwoPersProb), 1, 1, 0)) P.OneChildTwoPersProb = 0.08; + if (!GetInputParameter2all(ParamFile_dat, PreParamFile_dat,AdminFile_dat, "Two Child Three Pers Prob", "%lf", (void*) & (P.TwoChildThreePersProb), 1, 1, 0)) P.TwoChildThreePersProb = 0.11; + if (!GetInputParameter2all(ParamFile_dat, PreParamFile_dat,AdminFile_dat, "One Pers House Prob Old", "%lf", (void*) & (P.OnePersHouseProbOld), 1, 1, 0)) P.OnePersHouseProbOld = 0.5; + if (!GetInputParameter2all(ParamFile_dat, PreParamFile_dat,AdminFile_dat, "Two Pers House Prob Old", "%lf", (void*) & (P.TwoPersHouseProbOld), 1, 1, 0)) P.TwoPersHouseProbOld = 0.5; + if (!GetInputParameter2all(ParamFile_dat, PreParamFile_dat,AdminFile_dat, "One Pers House Prob Young", "%lf", (void*) & (P.OnePersHouseProbYoung), 1, 1, 0)) P.OnePersHouseProbYoung = 0.23; + if (!GetInputParameter2all(ParamFile_dat, PreParamFile_dat,AdminFile_dat, "Two Pers House Prob Young", "%lf", (void*) & (P.TwoPersHouseProbYoung), 1, 1, 0)) P.TwoPersHouseProbYoung = 0.23; + if (!GetInputParameter2all(ParamFile_dat, PreParamFile_dat,AdminFile_dat, "One Child Prob Youngest Child Under Five", "%lf", (void*) & (P.OneChildProbYoungestChildUnderFive), 1, 1, 0)) P.OneChildProbYoungestChildUnderFive = 0.5; + if (!GetInputParameter2all(ParamFile_dat, PreParamFile_dat,AdminFile_dat, "Two Children Prob Youngest Under Five", "%lf", (void*) & (P.TwoChildrenProbYoungestUnderFive), 1, 1, 0)) P.TwoChildrenProbYoungestUnderFive = 0.0; + if (!GetInputParameter2all(ParamFile_dat, PreParamFile_dat,AdminFile_dat, "Prob Youngest Child Under Five", "%lf", (void*) & (P.ProbYoungestChildUnderFive), 1, 1, 0)) P.ProbYoungestChildUnderFive = 0; + if (!GetInputParameter2all(ParamFile_dat, PreParamFile_dat,AdminFile_dat, "Zero Child Three Pers Prob", "%lf", (void*) & (P.ZeroChildThreePersProb), 1, 1, 0)) P.ZeroChildThreePersProb = 0.25; + if (!GetInputParameter2all(ParamFile_dat, PreParamFile_dat,AdminFile_dat, "One Child Four Pers Prob", "%lf", (void*) & (P.OneChildFourPersProb), 1, 1, 0)) P.OneChildFourPersProb = 0.2; + if (!GetInputParameter2all(ParamFile_dat, PreParamFile_dat,AdminFile_dat, "Young And Single Slope", "%lf", (void*) & (P.YoungAndSingleSlope), 1, 1, 0)) P.YoungAndSingleSlope = 0.7; + if (!GetInputParameter2all(ParamFile_dat, PreParamFile_dat,AdminFile_dat, "Young And Single", "%i", (void*) & (P.YoungAndSingle), 1, 1, 0)) P.YoungAndSingle = 36; + if (!GetInputParameter2all(ParamFile_dat, PreParamFile_dat,AdminFile_dat, "No Child Pers Age", "%i", (void*) & (P.NoChildPersAge), 1, 1, 0)) P.NoChildPersAge = 44; + if (!GetInputParameter2all(ParamFile_dat, PreParamFile_dat,AdminFile_dat, "Old Pers Age", "%i", (void*) & (P.OldPersAge), 1, 1, 0)) P.OldPersAge = 60; + if (!GetInputParameter2all(ParamFile_dat, PreParamFile_dat,AdminFile_dat, "Three Child Five Pers Prob", "%lf", (void*) & (P.ThreeChildFivePersProb), 1, 1, 0)) P.ThreeChildFivePersProb = 0.5; + if (!GetInputParameter2all(ParamFile_dat, PreParamFile_dat,AdminFile_dat, "Older Gen Gap", "%i", (void*) & (P.OlderGenGap), 1, 1, 0)) P.OlderGenGap = 19; } - else - { - P.MaxInfEvents = 0; - } - //Include a limit to the number of infections to simulate, if this happens before time runs out - if (!GetInputParameter2(ParamFile_dat, PreParamFile_dat, "Limit number of infections", "%i", (void*) & (P.LimitNumInfections), 1, 1, 0)) P.LimitNumInfections = 0; - if (P.LimitNumInfections) - { - if (!GetInputParameter2(ParamFile_dat, PreParamFile_dat, "Max number of infections", "%i", (void*) & (P.MaxNumInfections), 1, 1, 0)) P.MaxNumInfections = 60000; - } - //Add origin-destination matrix parameter - if (!GetInputParameter2(ParamFile_dat, PreParamFile_dat, "Output origin destination matrix", "%i", (void*) & (P.DoOriginDestinationMatrix), 1, 1, 0)) P.DoOriginDestinationMatrix = 0; - - if (!GetInputParameter2all(ParamFile_dat, PreParamFile_dat,AdminFile_dat, "Mean child age gap", "%i", (void*) & (P.MeanChildAgeGap), 1, 1, 0)) P.MeanChildAgeGap=2; - if (!GetInputParameter2all(ParamFile_dat, PreParamFile_dat,AdminFile_dat, "Min adult age", "%i", (void*)&(P.MinAdultAge), 1, 1, 0)) P.MinAdultAge = 19; - if (!GetInputParameter2all(ParamFile_dat, PreParamFile_dat,AdminFile_dat, "Max MF partner age gap", "%i", (void*) & (P.MaxMFPartnerAgeGap), 1, 1, 0)) P.MaxMFPartnerAgeGap = 5; - if (!GetInputParameter2all(ParamFile_dat, PreParamFile_dat,AdminFile_dat, "Max FM partner age gap", "%i", (void*) & (P.MaxFMPartnerAgeGap), 1, 1, 0)) P.MaxFMPartnerAgeGap = 5; - if (!GetInputParameter2all(ParamFile_dat, PreParamFile_dat,AdminFile_dat, "Min parent age gap", "%i", (void*) & (P.MinParentAgeGap), 1, 1, 0)) P.MinParentAgeGap = 19; - if (!GetInputParameter2all(ParamFile_dat, PreParamFile_dat,AdminFile_dat, "Max parent age gap", "%i", (void*) & (P.MaxParentAgeGap), 1, 1, 0)) P.MaxParentAgeGap = 44; - if (!GetInputParameter2all(ParamFile_dat, PreParamFile_dat,AdminFile_dat, "Max child age", "%i", (void*) & (P.MaxChildAge), 1, 1, 0)) P.MaxChildAge = 20; - if (!GetInputParameter2all(ParamFile_dat, PreParamFile_dat,AdminFile_dat, "One Child Two Pers Prob", "%lf", (void*) & (P.OneChildTwoPersProb), 1, 1, 0)) P.OneChildTwoPersProb = 0.08; - if (!GetInputParameter2all(ParamFile_dat, PreParamFile_dat,AdminFile_dat, "Two Child Three Pers Prob", "%lf", (void*) & (P.TwoChildThreePersProb), 1, 1, 0)) P.TwoChildThreePersProb = 0.11; - if (!GetInputParameter2all(ParamFile_dat, PreParamFile_dat,AdminFile_dat, "One Pers House Prob Old", "%lf", (void*) & (P.OnePersHouseProbOld), 1, 1, 0)) P.OnePersHouseProbOld = 0.5; - if (!GetInputParameter2all(ParamFile_dat, PreParamFile_dat,AdminFile_dat, "Two Pers House Prob Old", "%lf", (void*) & (P.TwoPersHouseProbOld), 1, 1, 0)) P.TwoPersHouseProbOld = 0.5; - if (!GetInputParameter2all(ParamFile_dat, PreParamFile_dat,AdminFile_dat, "One Pers House Prob Young", "%lf", (void*) & (P.OnePersHouseProbYoung), 1, 1, 0)) P.OnePersHouseProbYoung = 0.23; - if (!GetInputParameter2all(ParamFile_dat, PreParamFile_dat,AdminFile_dat, "Two Pers House Prob Young", "%lf", (void*) & (P.TwoPersHouseProbYoung), 1, 1, 0)) P.TwoPersHouseProbYoung = 0.23; - if (!GetInputParameter2all(ParamFile_dat, PreParamFile_dat,AdminFile_dat, "One Child Prob Youngest Child Under Five", "%lf", (void*) & (P.OneChildProbYoungestChildUnderFive), 1, 1, 0)) P.OneChildProbYoungestChildUnderFive = 0.5; - if (!GetInputParameter2all(ParamFile_dat, PreParamFile_dat,AdminFile_dat, "Two Children Prob Youngest Under Five", "%lf", (void*) & (P.TwoChildrenProbYoungestUnderFive), 1, 1, 0)) P.TwoChildrenProbYoungestUnderFive = 0.0; - if (!GetInputParameter2all(ParamFile_dat, PreParamFile_dat,AdminFile_dat, "Prob Youngest Child Under Five", "%lf", (void*) & (P.ProbYoungestChildUnderFive), 1, 1, 0)) P.ProbYoungestChildUnderFive = 0; - if (!GetInputParameter2all(ParamFile_dat, PreParamFile_dat,AdminFile_dat, "Zero Child Three Pers Prob", "%lf", (void*) & (P.ZeroChildThreePersProb), 1, 1, 0)) P.ZeroChildThreePersProb = 0.25; - if (!GetInputParameter2all(ParamFile_dat, PreParamFile_dat,AdminFile_dat, "One Child Four Pers Prob", "%lf", (void*) & (P.OneChildFourPersProb), 1, 1, 0)) P.OneChildFourPersProb = 0.2; - if (!GetInputParameter2all(ParamFile_dat, PreParamFile_dat,AdminFile_dat, "Young And Single Slope", "%lf", (void*) & (P.YoungAndSingleSlope), 1, 1, 0)) P.YoungAndSingleSlope = 0.7; - if (!GetInputParameter2all(ParamFile_dat, PreParamFile_dat,AdminFile_dat, "Young And Single", "%i", (void*) & (P.YoungAndSingle), 1, 1, 0)) P.YoungAndSingle = 36; - if (!GetInputParameter2all(ParamFile_dat, PreParamFile_dat,AdminFile_dat, "No Child Pers Age", "%i", (void*) & (P.NoChildPersAge), 1, 1, 0)) P.NoChildPersAge = 44; - if (!GetInputParameter2all(ParamFile_dat, PreParamFile_dat,AdminFile_dat, "Old Pers Age", "%i", (void*) & (P.OldPersAge), 1, 1, 0)) P.OldPersAge = 60; - if (!GetInputParameter2all(ParamFile_dat, PreParamFile_dat,AdminFile_dat, "Three Child Five Pers Prob", "%lf", (void*) & (P.ThreeChildFivePersProb), 1, 1, 0)) P.ThreeChildFivePersProb = 0.5; - if (!GetInputParameter2all(ParamFile_dat, PreParamFile_dat,AdminFile_dat, "Older Gen Gap", "%i", (void*) & (P.OlderGenGap), 1, 1, 0)) P.OlderGenGap = 19; - // Close input files. fclose(ParamFile_dat); - if (PreParamFile_dat != NULL) fclose(PreParamFile_dat); - if (ParamFile_dat != AdminFile_dat && AdminFile_dat != NULL) fclose(AdminFile_dat); + fclose(PreParamFile_dat); + fclose(AdminFile_dat); if (P.DoOneGen != 0) P.DoOneGen = 1; P.ColourPeriod = 2000; @@ -1943,6 +2088,14 @@ void ReadParams(std::string const& ParamFile, std::string const& PreParamFile, s cosx[i] = cos(t); } } + if (P.R0scale != 1.0) + { + P.HouseholdTrans *= P.R0scale; + if (P.FixLocalBeta) P.LocalBeta *= P.R0scale; + P.R0 *= P.R0scale; + for (int j = 0; j < P.PlaceTypeNum; j++) P.PlaceTypeTrans[j] *= P.R0scale; + fprintf(stderr, "Rescaled transmission coefficients by factor of %lg\n", P.R0scale); + } fprintf(stderr, "Parameters read\n"); } void ReadInterventions(std::string const& IntFile) @@ -2696,7 +2849,11 @@ void InitModel(int run) // passing run number so we can save run number in the i P.PlaceCloseCellIncThresh = P.PlaceCloseCellIncThresh1; P.ResetSeedsFlag = 0; //added this to allow resetting seeds part way through run: ggilani 27/11/2019 if (!P.StopCalibration) P.DateTriggerReached_SimTime = 0; - + if (P.InitialInfectionCalTime > 0) + { + P.HolidaysStartDay_SimTime = -P.InitialInfectionCalTime; + P.DateTriggerReached_SimTime = P.Epidemic_StartDate_CalTime = P.Interventions_StartDate_CalTime - P.InitialInfectionCalTime; + } fprintf(stderr, "Finished InitModel.\n"); } @@ -2726,7 +2883,7 @@ void SeedInfection(double t, int* NumSeedingInfections_byLocation, int rf, int r l = Mcells[j].members[(int)(ranf() * ((double)Mcells[j].n))]; //// randomly choose member of microcell j. Name this member l if (Hosts[l].inf == InfStat_Susceptible) //// If Host l is uninfected. { - if (CalcPersonSusc(l, 0, 0, 0) > 0) + if ((CalcPersonSusc(l, 0, 0, 0) > 0) && (Hosts[l].age <= P.MaxAgeForInitialInfection) && (P.CareHomeAllowInitialInfections || P.CareHomePlaceType<0 || Hosts[l].PlaceLinks[P.CareHomePlaceType]<0)) { //only reset the initial location if rf==0, i.e. when initial seeds are being set, not when imported cases are being set if (rf == 0) @@ -2762,7 +2919,7 @@ void SeedInfection(double t, int* NumSeedingInfections_byLocation, int rf, int r l = Mcells[j].members[(int)(ranf() * ((double)Mcells[j].n))]; if (Hosts[l].inf == InfStat_Susceptible) { - if (CalcPersonSusc(l, 0, 0, 0) > 0) + if ((CalcPersonSusc(l, 0, 0, 0) > 0) && (Hosts[l].age <= P.MaxAgeForInitialInfection) && (P.CareHomeAllowInitialInfections || P.CareHomePlaceType < 0 || Hosts[l].PlaceLinks[P.CareHomePlaceType] < 0)) { P.LocationInitialInfection[i][0] = Households[Hosts[l].hh].loc.x; P.LocationInitialInfection[i][1] = Households[Hosts[l].hh].loc.y; @@ -2798,7 +2955,7 @@ void SeedInfection(double t, int* NumSeedingInfections_byLocation, int rf, int r l = Mcells[j].members[(int)(ranf() * ((double)Mcells[j].n))]; if (Hosts[l].inf == InfStat_Susceptible) { - if (CalcPersonSusc(l, 0, 0, 0) > 0) + if ((CalcPersonSusc(l, 0, 0, 0) > 0) && (Hosts[l].age<=P.MaxAgeForInitialInfection) && (P.CareHomeAllowInitialInfections || P.CareHomePlaceType < 0 || Hosts[l].PlaceLinks[P.CareHomePlaceType] < 0)) { P.LocationInitialInfection[i][0] = Households[Hosts[l].hh].loc.x; P.LocationInitialInfection[i][1] = Households[Hosts[l].hh].loc.y; @@ -2878,7 +3035,10 @@ int RunModel(int run, std::string const& snapshot_save_file, std::string const& for (ns = 1; ((ns < P.NumSamples) && (!InterruptRun)); ns++) //&&(continueEvents) <-removed this { + RecordSample(t, ns - 1, output_file_base); + CalibrationThresholdCheck(t, ns - 1); + fprintf(stderr, "\r t=%lg %i %i|%i %i %i [=%i] %i (%lg %lg %lg) %lg ", t, State.S, State.L, State.I, State.R, State.D, State.S + State.L + State.I + State.R + State.D, State.cumD, State.cumT, State.cumV, State.cumVG, sqrt(State.maxRad2) / 1000); //added State.cumVG if (!InterruptRun) @@ -3308,7 +3468,7 @@ void SaveResults(std::string const& output_file_base) #endif - if(P.DoSeverity) + if((P.DoSeverity)&&(P.OutputSeverity)) { outname = output_file_base + ".severity.xls"; if(!(dat = fopen(outname.c_str(), "wb"))) ERR_CRITICAL("Unable to open severity output file\n"); @@ -3440,6 +3600,7 @@ void SaveResults(std::string const& output_file_base) fprintf(dat, "\t%.10f", TimeSeries[Time].cumInf_age_adunit[AgeGroup][AdUnit]); // cumulative incidence fprintf(dat, "\n"); } + fclose(dat); } } @@ -3557,7 +3718,7 @@ void SaveSummaryResults(std::string const& output_file_base) //// calculates and for(i = 0; i < P.NumAdunits; i++) fprintf(dat, "\tC_%s", AdUnits[i].ad_name); for(i = 0; i < P.NumAdunits; i++) fprintf(dat, "\tDC_%s", AdUnits[i].ad_name); //added detected cases: ggilani 03/02/15 for(i = 0; i < P.NumAdunits; i++) fprintf(dat, "\tT_%s", AdUnits[i].ad_name); - for(i = 0; i < P.NumAdunits; i++) fprintf(dat, "\t%.10f", P.PopByAdunit[i][0]); + for(i = 0; i < P.NumAdunits; i++) fprintf(dat, "\t%i", AdUnits[i].n); for(i = 0; i < P.NumAdunits; i++) fprintf(dat, "\t%.10f", P.PopByAdunit[i][1]); fprintf(dat, "\n"); for(i = 0; i < P.NumSamples; i++) @@ -3752,7 +3913,7 @@ void SaveSummaryResults(std::string const& output_file_base) //// calculates and fclose(dat); } - if (P.DoSeverity) + if ((P.DoSeverity)&&(P.OutputSeverity)) { //// output separate severity file (can integrate with main if need be) outname = output_file_base + ".severity.xls"; @@ -4108,6 +4269,7 @@ void SaveSummaryResults(std::string const& output_file_base) //// calculates and fprintf(dat, "\t%.10f", c * TSMean[Time].cumInf_age_adunit[AgeGroup][AdUnit]); // cumulative incidence fprintf(dat, "\n"); } + fclose(dat); } } @@ -4519,7 +4681,7 @@ void RecordSample(double t, int n, std::string const& output_file_base) int cumCT; //added cumulative number of contact traced: ggilani 15/06/17 int cumCC; //added cumulative number of cases who are contacts: ggilani 28/05/2019 int cumDCT; //added cumulative number of cases who are digitally contact traced: ggilani 11/03/20 - int cumHQ, cumAC, cumAH, cumAA, cumACS, cumAPC, cumAPA, cumAPCS, numPC, trigDetectedCases, trigAlert, trigAlertCases; + int cumHQ, cumAC, cumAH, cumAA, cumACS, cumAPC, cumAPA, cumAPCS, numPC, trigDetectedCases; int cumC_country[MAX_COUNTRIES]; //add cumulative cases per country unsigned short int ts; @@ -4581,21 +4743,21 @@ void RecordSample(double t, int n, std::string const& output_file_base) if (P.DoSeverity) { ///// severity states by thread - Mild += StateT[j].Mild ; - ILI += StateT[j].ILI ; - SARI += StateT[j].SARI ; - Critical += StateT[j].Critical ; - CritRecov += StateT[j].CritRecov ; + Mild += StateT[j].Mild; + ILI += StateT[j].ILI; + SARI += StateT[j].SARI; + Critical += StateT[j].Critical; + CritRecov += StateT[j].CritRecov; ///// cumulative severity states by thread - cumMild += StateT[j].cumMild ; - cumILI += StateT[j].cumILI ; - cumSARI += StateT[j].cumSARI ; - cumCritical += StateT[j].cumCritical ; - cumCritRecov += StateT[j].cumCritRecov ; - cumDeath_ILI += StateT[j].cumDeath_ILI ; - cumDeath_SARI += StateT[j].cumDeath_SARI ; - cumDeath_Critical += StateT[j].cumDeath_Critical ; + cumMild += StateT[j].cumMild; + cumILI += StateT[j].cumILI; + cumSARI += StateT[j].cumSARI; + cumCritical += StateT[j].cumCritical; + cumCritRecov += StateT[j].cumCritRecov; + cumDeath_ILI += StateT[j].cumDeath_ILI; + cumDeath_SARI += StateT[j].cumDeath_SARI; + cumDeath_Critical += StateT[j].cumDeath_Critical; } //add up cumulative country counts: ggilani - 12/11/14 @@ -4690,44 +4852,44 @@ void RecordSample(double t, int n, std::string const& output_file_base) { //// Record incidence. (Must be done with old State totals) - TimeSeries[n].incMild = (double)(cumMild - State.cumMild ); - TimeSeries[n].incILI = (double)(cumILI - State.cumILI ); - TimeSeries[n].incSARI = (double)(cumSARI - State.cumSARI ); - TimeSeries[n].incCritical = (double)(cumCritical - State.cumCritical ); - TimeSeries[n].incCritRecov = (double)(cumCritRecov - State.cumCritRecov ); - TimeSeries[n].incDeath_ILI = (double)(cumDeath_ILI - State.cumDeath_ILI ); - TimeSeries[n].incDeath_SARI = (double)(cumDeath_SARI - State.cumDeath_SARI ); - TimeSeries[n].incDeath_Critical = (double)(cumDeath_Critical - State.cumDeath_Critical ); + TimeSeries[n].incMild = (double)(cumMild - State.cumMild); + TimeSeries[n].incILI = (double)(cumILI - State.cumILI); + TimeSeries[n].incSARI = (double)(cumSARI - State.cumSARI); + TimeSeries[n].incCritical = (double)(cumCritical - State.cumCritical); + TimeSeries[n].incCritRecov = (double)(cumCritRecov - State.cumCritRecov); + TimeSeries[n].incDeath_ILI = (double)(cumDeath_ILI - State.cumDeath_ILI); + TimeSeries[n].incDeath_SARI = (double)(cumDeath_SARI - State.cumDeath_SARI); + TimeSeries[n].incDeath_Critical = (double)(cumDeath_Critical - State.cumDeath_Critical); /////// update state with totals - State.Mild = Mild ; - State.ILI = ILI ; - State.SARI = SARI ; - State.Critical = Critical ; - State.CritRecov = CritRecov ; - State.cumMild = cumMild ; - State.cumILI = cumILI ; - State.cumSARI = cumSARI ; - State.cumCritical = cumCritical ; - State.cumCritRecov = cumCritRecov ; - State.cumDeath_ILI = cumDeath_ILI ; - State.cumDeath_SARI = cumDeath_SARI ; - State.cumDeath_Critical = cumDeath_Critical ; + State.Mild = Mild; + State.ILI = ILI; + State.SARI = SARI; + State.Critical = Critical; + State.CritRecov = CritRecov; + State.cumMild = cumMild; + State.cumILI = cumILI; + State.cumSARI = cumSARI; + State.cumCritical = cumCritical; + State.cumCritRecov = cumCritRecov; + State.cumDeath_ILI = cumDeath_ILI; + State.cumDeath_SARI = cumDeath_SARI; + State.cumDeath_Critical = cumDeath_Critical; //// Record new totals for time series. (Must be done with old State totals) - TimeSeries[n].Mild = Mild ; - TimeSeries[n].ILI = ILI ; - TimeSeries[n].SARI = SARI ; - TimeSeries[n].Critical = Critical ; - TimeSeries[n].CritRecov = CritRecov ; - TimeSeries[n].cumMild = cumMild ; - TimeSeries[n].cumILI = cumILI ; - TimeSeries[n].cumSARI = cumSARI ; - TimeSeries[n].cumCritical = cumCritical ; - TimeSeries[n].cumCritRecov = cumCritRecov ; - TimeSeries[n].cumDeath_ILI = cumDeath_ILI ; - TimeSeries[n].cumDeath_SARI = cumDeath_SARI ; - TimeSeries[n].cumDeath_Critical = cumDeath_Critical ; + TimeSeries[n].Mild = Mild; + TimeSeries[n].ILI = ILI; + TimeSeries[n].SARI = SARI; + TimeSeries[n].Critical = Critical; + TimeSeries[n].CritRecov = CritRecov; + TimeSeries[n].cumMild = cumMild; + TimeSeries[n].cumILI = cumILI; + TimeSeries[n].cumSARI = cumSARI; + TimeSeries[n].cumCritical = cumCritical; + TimeSeries[n].cumCritRecov = cumCritRecov; + TimeSeries[n].cumDeath_ILI = cumDeath_ILI; + TimeSeries[n].cumDeath_SARI = cumDeath_SARI; + TimeSeries[n].cumDeath_Critical = cumDeath_Critical; for (int i = 0; i < NUM_AGE_GROUPS; i++) { @@ -4804,77 +4966,77 @@ void RecordSample(double t, int n, std::string const& output_file_base) { //// Record incidence. Need new total minus old total (same as minus old total plus new total). //// First subtract old total while unchanged. - TimeSeries[n].incMild_adunit [i] = (double)(-State.cumMild_adunit [i]); - TimeSeries[n].incILI_adunit [i] = (double)(-State.cumILI_adunit [i]); - TimeSeries[n].incSARI_adunit [i] = (double)(-State.cumSARI_adunit [i]); - TimeSeries[n].incCritical_adunit [i] = (double)(-State.cumCritical_adunit [i]); - TimeSeries[n].incCritRecov_adunit [i] = (double)(-State.cumCritRecov_adunit [i]); - TimeSeries[n].incD_adunit [i] = (double)(-State.cumD_adunit [i]); - TimeSeries[n].incDeath_ILI_adunit [i] = (double)(-State.cumDeath_ILI_adunit [i]); - TimeSeries[n].incDeath_SARI_adunit [i] = (double)(-State.cumDeath_SARI_adunit [i]); - TimeSeries[n].incDeath_Critical_adunit [i] = (double)(-State.cumDeath_Critical_adunit [i]); + TimeSeries[n].incMild_adunit[i] = (double)(-State.cumMild_adunit[i]); + TimeSeries[n].incILI_adunit[i] = (double)(-State.cumILI_adunit[i]); + TimeSeries[n].incSARI_adunit[i] = (double)(-State.cumSARI_adunit[i]); + TimeSeries[n].incCritical_adunit[i] = (double)(-State.cumCritical_adunit[i]); + TimeSeries[n].incCritRecov_adunit[i] = (double)(-State.cumCritRecov_adunit[i]); + TimeSeries[n].incD_adunit[i] = (double)(-State.cumD_adunit[i]); + TimeSeries[n].incDeath_ILI_adunit[i] = (double)(-State.cumDeath_ILI_adunit[i]); + TimeSeries[n].incDeath_SARI_adunit[i] = (double)(-State.cumDeath_SARI_adunit[i]); + TimeSeries[n].incDeath_Critical_adunit[i] = (double)(-State.cumDeath_Critical_adunit[i]); //// reset State (not StateT) to zero. Don't need to do this with non-admin unit as local variables Mild, cumSARI etc. initialized to zero at beginning of function. Check with Gemma - State.Mild_adunit [i] = 0; - State.ILI_adunit [i] = 0; - State.SARI_adunit [i] = 0; - State.Critical_adunit [i] = 0; - State.CritRecov_adunit [i] = 0; - State.cumMild_adunit [i] = 0; - State.cumILI_adunit [i] = 0; - State.cumSARI_adunit [i] = 0; - State.cumCritical_adunit [i] = 0; - State.cumCritRecov_adunit [i] = 0; - State.cumD_adunit [i] = 0; - State.cumDeath_ILI_adunit [i] = 0; - State.cumDeath_SARI_adunit [i] = 0; - State.cumDeath_Critical_adunit [i] = 0; + State.Mild_adunit[i] = 0; + State.ILI_adunit[i] = 0; + State.SARI_adunit[i] = 0; + State.Critical_adunit[i] = 0; + State.CritRecov_adunit[i] = 0; + State.cumMild_adunit[i] = 0; + State.cumILI_adunit[i] = 0; + State.cumSARI_adunit[i] = 0; + State.cumCritical_adunit[i] = 0; + State.cumCritRecov_adunit[i] = 0; + State.cumD_adunit[i] = 0; + State.cumDeath_ILI_adunit[i] = 0; + State.cumDeath_SARI_adunit[i] = 0; + State.cumDeath_Critical_adunit[i] = 0; for (j = 0; j < P.NumThreads; j++) { //// collate from threads - State.Mild_adunit [i] += StateT[j].Mild_adunit [i]; - State.ILI_adunit [i] += StateT[j].ILI_adunit [i]; - State.SARI_adunit [i] += StateT[j].SARI_adunit [i]; - State.Critical_adunit [i] += StateT[j].Critical_adunit [i]; - State.CritRecov_adunit [i] += StateT[j].CritRecov_adunit [i]; - State.cumMild_adunit [i] += StateT[j].cumMild_adunit [i]; - State.cumILI_adunit [i] += StateT[j].cumILI_adunit [i]; - State.cumSARI_adunit [i] += StateT[j].cumSARI_adunit [i]; - State.cumCritical_adunit [i] += StateT[j].cumCritical_adunit [i]; - State.cumCritRecov_adunit [i] += StateT[j].cumCritRecov_adunit [i]; - State.cumD_adunit [i] += StateT[j].cumD_adunit [i]; - State.cumDeath_ILI_adunit [i] += StateT[j].cumDeath_ILI_adunit [i]; - State.cumDeath_SARI_adunit [i] += StateT[j].cumDeath_SARI_adunit [i]; - State.cumDeath_Critical_adunit [i] += StateT[j].cumDeath_Critical_adunit [i]; + State.Mild_adunit[i] += StateT[j].Mild_adunit[i]; + State.ILI_adunit[i] += StateT[j].ILI_adunit[i]; + State.SARI_adunit[i] += StateT[j].SARI_adunit[i]; + State.Critical_adunit[i] += StateT[j].Critical_adunit[i]; + State.CritRecov_adunit[i] += StateT[j].CritRecov_adunit[i]; + State.cumMild_adunit[i] += StateT[j].cumMild_adunit[i]; + State.cumILI_adunit[i] += StateT[j].cumILI_adunit[i]; + State.cumSARI_adunit[i] += StateT[j].cumSARI_adunit[i]; + State.cumCritical_adunit[i] += StateT[j].cumCritical_adunit[i]; + State.cumCritRecov_adunit[i] += StateT[j].cumCritRecov_adunit[i]; + State.cumD_adunit[i] += StateT[j].cumD_adunit[i]; + State.cumDeath_ILI_adunit[i] += StateT[j].cumDeath_ILI_adunit[i]; + State.cumDeath_SARI_adunit[i] += StateT[j].cumDeath_SARI_adunit[i]; + State.cumDeath_Critical_adunit[i] += StateT[j].cumDeath_Critical_adunit[i]; } //// Record incidence. Need new total minus old total. Add new total - TimeSeries[n].incMild_adunit [i] += (double)(State.cumMild_adunit [i]); - TimeSeries[n].incILI_adunit [i] += (double)(State.cumILI_adunit [i]); - TimeSeries[n].incSARI_adunit [i] += (double)(State.cumSARI_adunit [i]); - TimeSeries[n].incCritical_adunit [i] += (double)(State.cumCritical_adunit [i]); - TimeSeries[n].incCritRecov_adunit [i] += (double)(State.cumCritRecov_adunit [i]); - TimeSeries[n].incD_adunit [i] += (double)(State.cumD_adunit [i]); - TimeSeries[n].incDeath_ILI_adunit [i] += (double)(State.cumDeath_ILI_adunit [i]); - TimeSeries[n].incDeath_SARI_adunit [i] += (double)(State.cumDeath_SARI_adunit [i]); - TimeSeries[n].incDeath_Critical_adunit [i] += (double)(State.cumDeath_Critical_adunit [i]); + TimeSeries[n].incMild_adunit[i] += (double)(State.cumMild_adunit[i]); + TimeSeries[n].incILI_adunit[i] += (double)(State.cumILI_adunit[i]); + TimeSeries[n].incSARI_adunit[i] += (double)(State.cumSARI_adunit[i]); + TimeSeries[n].incCritical_adunit[i] += (double)(State.cumCritical_adunit[i]); + TimeSeries[n].incCritRecov_adunit[i] += (double)(State.cumCritRecov_adunit[i]); + TimeSeries[n].incD_adunit[i] += (double)(State.cumD_adunit[i]); + TimeSeries[n].incDeath_ILI_adunit[i] += (double)(State.cumDeath_ILI_adunit[i]); + TimeSeries[n].incDeath_SARI_adunit[i] += (double)(State.cumDeath_SARI_adunit[i]); + TimeSeries[n].incDeath_Critical_adunit[i] += (double)(State.cumDeath_Critical_adunit[i]); //// Record new totals for time series. (Must be done with old State totals) - TimeSeries[n].Mild_adunit [i] = State.Mild_adunit [i]; - TimeSeries[n].ILI_adunit [i] = State.ILI_adunit [i]; - TimeSeries[n].SARI_adunit [i] = State.SARI_adunit [i]; - TimeSeries[n].Critical_adunit [i] = State.Critical_adunit [i]; - TimeSeries[n].CritRecov_adunit [i] = State.CritRecov_adunit [i]; - TimeSeries[n].cumMild_adunit [i] = State.cumMild_adunit [i]; - TimeSeries[n].cumILI_adunit [i] = State.cumILI_adunit [i]; - TimeSeries[n].cumSARI_adunit [i] = State.cumSARI_adunit [i]; - TimeSeries[n].cumCritical_adunit [i] = State.cumCritical_adunit [i]; - TimeSeries[n].cumCritRecov_adunit [i] = State.cumCritRecov_adunit [i]; - TimeSeries[n].cumD_adunit [i] = State.cumD_adunit [i]; - TimeSeries[n].cumDeath_ILI_adunit [i] = State.cumDeath_ILI_adunit [i]; - TimeSeries[n].cumDeath_SARI_adunit [i] = State.cumDeath_SARI_adunit [i]; - TimeSeries[n].cumDeath_Critical_adunit [i] = State.cumDeath_Critical_adunit [i]; + TimeSeries[n].Mild_adunit[i] = State.Mild_adunit[i]; + TimeSeries[n].ILI_adunit[i] = State.ILI_adunit[i]; + TimeSeries[n].SARI_adunit[i] = State.SARI_adunit[i]; + TimeSeries[n].Critical_adunit[i] = State.Critical_adunit[i]; + TimeSeries[n].CritRecov_adunit[i] = State.CritRecov_adunit[i]; + TimeSeries[n].cumMild_adunit[i] = State.cumMild_adunit[i]; + TimeSeries[n].cumILI_adunit[i] = State.cumILI_adunit[i]; + TimeSeries[n].cumSARI_adunit[i] = State.cumSARI_adunit[i]; + TimeSeries[n].cumCritical_adunit[i] = State.cumCritical_adunit[i]; + TimeSeries[n].cumCritRecov_adunit[i] = State.cumCritRecov_adunit[i]; + TimeSeries[n].cumD_adunit[i] = State.cumD_adunit[i]; + TimeSeries[n].cumDeath_ILI_adunit[i] = State.cumDeath_ILI_adunit[i]; + TimeSeries[n].cumDeath_SARI_adunit[i] = State.cumDeath_SARI_adunit[i]; + TimeSeries[n].cumDeath_Critical_adunit[i] = State.cumDeath_Critical_adunit[i]; } } @@ -4920,7 +5082,7 @@ void RecordSample(double t, int n, std::string const& output_file_base) if (P.DoAdUnits) for (int i = 0; i <= P.NumAdunits; i++) { - TimeSeries[n].incI_adunit[i] = TimeSeries[n].incC_adunit[i] = TimeSeries[n].cumT_adunit[i] = TimeSeries[n].incH_adunit[i] = TimeSeries[n].incDC_adunit[i] = TimeSeries[n].incCT_adunit[i] = TimeSeries[n].incDCT_adunit[i] = 0; //added detected cases: ggilani 03/02/15 + TimeSeries[n].incI_adunit[i] = TimeSeries[n].incC_adunit[i] = TimeSeries[n].cumT_adunit[i] = TimeSeries[n].incH_adunit[i] = TimeSeries[n].incDC_adunit[i] = TimeSeries[n].incCT_adunit[i] = TimeSeries[n].incDCT_adunit[i] = 0; //added detected cases: ggilani 03/02/15 for (j = 0; j < P.NumThreads; j++) { TimeSeries[n].incI_adunit[i] += (double)StateT[j].cumI_adunit[i]; @@ -4959,10 +5121,10 @@ void RecordSample(double t, int n, std::string const& output_file_base) TimeSeries[n].PropPlacesClosed[i] = ((double)numPC) / ((double)P.Nplace[i]); } for (int i = k = 0; i < P.NMC; i++) if (Mcells[i].socdist == 2) k++; - TimeSeries[n].PropSocDist=((double)k)/((double)P.NMC); + TimeSeries[n].PropSocDist = ((double)k) / ((double)P.NMC); //update contact number distribution in State - for (int i = 0; i < (MAX_CONTACTS+1); i++) + for (int i = 0; i < (MAX_CONTACTS + 1); i++) { for (j = 0; j < P.NumThreads; j++) { @@ -4970,30 +5132,56 @@ void RecordSample(double t, int n, std::string const& output_file_base) StateT[j].contact_dist[i] = 0; } } + if (P.OutputBitmap >= 1) + { + TSMean = TSMeanNE; TSVar = TSVarNE; + CaptureBitmap(); + OutputBitmap(0, output_file_base); + } +} + +void CalibrationThresholdCheck(double t,int n) +{ + int k; + int trigAlert, trigAlertCases; + unsigned short int ts; + + ts = (unsigned short int) (P.TimeStepsPerDay * t); trigAlertCases = State.cumDC; - if (n >= P.WindowToEvaluateTriggerAlert) trigAlertCases -= (int)TimeSeries[n - P.WindowToEvaluateTriggerAlert].cumDC; + if (n >= P.WindowToEvaluateTriggerAlert) { + trigAlertCases -= (int)TimeSeries[n - P.WindowToEvaluateTriggerAlert].cumDC; + } if (P.TriggerAlertOnDeaths) //// if using deaths as trigger (as opposed to detected cases) { trigAlert = (int)TimeSeries[n].D; if (n >= P.WindowToEvaluateTriggerAlert) trigAlert -= (int) TimeSeries[n - P.WindowToEvaluateTriggerAlert].D; } - else trigAlert = trigAlertCases; + else + { + trigAlert = trigAlertCases; + } double RatioPredictedObserved, DesiredAccuracy; // calibration variables. - if(((!P.DoAlertTriggerAfterInterv) && (trigAlert >= P.CaseOrDeathThresholdBeforeAlert)) || ((P.DoAlertTriggerAfterInterv) && - (((trigAlertCases >= P.CaseOrDeathThresholdBeforeAlert)&&(P.ModelCalibIteration<2)) || ((t>=P.Epidemic_StartDate_CalTime) && (P.ModelCalibIteration >= 2))))) + + if (((P.DoNoCalibration) && (t >= P.Epidemic_StartDate_CalTime)) || + ((!P.DoNoCalibration) && (((!P.DoAlertTriggerAfterInterv) && (trigAlert >= P.CaseOrDeathThresholdBeforeAlert)) || + ((P.DoAlertTriggerAfterInterv) && (((trigAlertCases >= P.CaseOrDeathThresholdBeforeAlert) && (P.ModelCalibIteration < 2)) + || ((t >= P.Epidemic_StartDate_CalTime) && ((P.ModelCalibIteration >= 2)||(P.InitialInfectionCalTime > 0) ))))))) { - if((!P.StopCalibration)&&(!InterruptRun)) + if ((!P.DoNoCalibration) && (!P.StopCalibration) && (!InterruptRun)) { - if (P.DateTriggerReached_SimTime == 0) // i.e. if this is first time that calibration has been called for this realisation. + if ((P.DateTriggerReached_SimTime == 0) && (P.InitialInfectionCalTime <=0)) { P.Epidemic_StartDate_CalTime = P.DateTriggerReached_SimTime = t; // initialize Epidemic_StartDate_CalTime & DateTriggerReached_SimTime to now (i.e. simulation time that trigger was reached) if (P.DateTriggerReached_CalTime >= 0) + { P.HolidaysStartDay_SimTime = P.DateTriggerReached_SimTime - P.Interventions_StartDate_CalTime; /// initialize holiday offset to time difference between DateTriggerReached_SimTime and day of year interventions start. +// fprintf(stderr, "@@## trigAlertCases=%i P.HolidaysStartDay_SimTime=%lg \n",trigAlertCases, P.HolidaysStartDay_SimTime); + } } - if ((P.DateTriggerReached_CalTime >= 0)&& (!P.DoAlertTriggerAfterInterv)) + if ((P.DateTriggerReached_CalTime >= 0) && (!P.DoAlertTriggerAfterInterv) && (P.InitialInfectionCalTime <= 0)) { P.StopCalibration = 1; InterruptRun = 1; @@ -5005,38 +5193,61 @@ void RecordSample(double t, int n, std::string const& output_file_base) RatioPredictedObserved = ((double)trigAlert)/((double)P.AlertTriggerAfterIntervThreshold); DesiredAccuracy = 1.1 / sqrt((double)P.AlertTriggerAfterIntervThreshold); if (DesiredAccuracy < 0.05) DesiredAccuracy = 0.05; - fprintf(stderr, "\n** %i %lf %lf | %lg / %lg \t", P.ModelCalibIteration, t, P.DateTriggerReached_SimTime + P.DateTriggerReached_CalTime - P.Interventions_StartDate_CalTime, P.HolidaysStartDay_SimTime,RatioPredictedObserved); + fprintf(stderr, "\n** %i %lf %lf | %lg / %lg \t", P.ModelCalibIteration, t, P.DateTriggerReached_SimTime + P.DateTriggerReached_CalTime - P.Interventions_StartDate_CalTime, P.HolidaysStartDay_SimTime, RatioPredictedObserved); fprintf(stderr, "| %i %i %i %i -> ", trigAlert, trigAlertCases, P.AlertTriggerAfterIntervThreshold, P.CaseOrDeathThresholdBeforeAlert); - if ((P.ModelCalibIteration >= 2) && ((((RatioPredictedObserved - 1.0) <= DesiredAccuracy) && (RatioPredictedObserved >= 1)) || (((1.0 - RatioPredictedObserved) <= DesiredAccuracy) && (RatioPredictedObserved < 1)))) - P.StopCalibration = 1; - else if (P.ModelCalibIteration == 0) + + if (P.InitialInfectionCalTime > 0) { - // rescale threshold - k = (int)(((double)P.CaseOrDeathThresholdBeforeAlert) / RatioPredictedObserved); - if (k > 0) P.CaseOrDeathThresholdBeforeAlert = k; + if ((P.ModelCalibIteration >= 2) && + ((((RatioPredictedObserved - 1.0) <= DesiredAccuracy) && (RatioPredictedObserved >= 1)) || + (((1.0 - RatioPredictedObserved) <= DesiredAccuracy) && (RatioPredictedObserved < 1)))) + P.StopCalibration = 1; + else if (P.ModelCalibIteration == 1) + P.SeedingScaling /= pow(RatioPredictedObserved, 0.7); + else if (P.ModelCalibIteration == 2) + P.SeedingScaling /= pow(RatioPredictedObserved, 0.6); + else if (P.ModelCalibIteration > 2) + P.SeedingScaling /= pow(RatioPredictedObserved, 0.3 + 0.2 * ranf()); // include random number to prevent loops } - else if ((P.ModelCalibIteration >= 2) && ((P.ModelCalibIteration) % 2 == 0)) // on even iterations, adjust timings + else { - if (RatioPredictedObserved > 1) // if too many predicted cases/deaths, make timings earlier... + if ((P.ModelCalibIteration >= 2) && + ((((RatioPredictedObserved - 1.0) <= DesiredAccuracy) && (RatioPredictedObserved >= 1)) || + (((1.0 - RatioPredictedObserved) <= DesiredAccuracy) && (RatioPredictedObserved < 1)))) + P.StopCalibration = 1; + else if (P.ModelCalibIteration == 0) { - P.Epidemic_StartDate_CalTime--; - P.HolidaysStartDay_SimTime--; + k = (int)(((double)P.CaseOrDeathThresholdBeforeAlert) / RatioPredictedObserved); + if (k > 0) P.CaseOrDeathThresholdBeforeAlert = k; } - else if (RatioPredictedObserved < 1) // ... otherwise if too few cases/deaths, make timings later + else if ((P.ModelCalibIteration >= 2) && ((P.ModelCalibIteration) % 3 < 2)) { - P.Epidemic_StartDate_CalTime++; - P.HolidaysStartDay_SimTime++; + if (RatioPredictedObserved > 1) + { + P.Epidemic_StartDate_CalTime--; + P.HolidaysStartDay_SimTime--; + } + else if (RatioPredictedObserved < 1) + { + P.Epidemic_StartDate_CalTime++; + P.HolidaysStartDay_SimTime++; + } + } + else if ((P.ModelCalibIteration >= 2) && ((P.ModelCalibIteration) % 3 == 2)) + { + P.SeedingScaling /= pow(RatioPredictedObserved, 0.2 + 0.3 * ranf()); // include random number to prevent loops } } - else if ((P.ModelCalibIteration >= 2) && ((P.ModelCalibIteration) % 2 == 1)) // on odd iterations, adjust seeding. - P.SeedingScaling /= pow(RatioPredictedObserved, 0.2 + 0.4 * ranf()); // include random number to prevent loops P.ModelCalibIteration++; fprintf(stderr, "%i : %lg\n", P.CaseOrDeathThresholdBeforeAlert, P.SeedingScaling); - if(P.StopCalibration) fprintf(stderr, "Calibration ended.\n"); - else InterruptRun = 1; + if(P.StopCalibration) + fprintf(stderr, "Calibration ended.\n"); + else + InterruptRun = 1; } - else P.StopCalibration = 1; + else + P.StopCalibration = 1; } } P.ControlPropCasesId = P.PostAlertControlPropCasesId; @@ -5135,12 +5346,160 @@ void RecordSample(double t, int n, std::string const& output_file_base) P.PlaceCloseCellIncThresh = P.PlaceCloseCellIncThresh2; } } +} - if (P.OutputBitmap >= 1) +void CalcLikelihood(int run, std::string const& DataFile, std::string const& OutFileBase) +{ + FILE* dat; + + static int DataAlreadyRead = 0, ncols,nrows, *ColTypes; + static double **Data,NegBinK,sumL; + + if (!DataAlreadyRead) { - TSMean = TSMeanNE; TSVar = TSVarNE; - CaptureBitmap (); - OutputBitmap (0, output_file_base); + char FieldName[1024]; + if (!(dat = fopen(DataFile.c_str(), "r"))) ERR_CRITICAL("Unable to open data file\n"); + fscanf(dat, "%i %i %lg", &nrows, &ncols, &NegBinK); + if (!(ColTypes = (int*)calloc(ncols, sizeof(int)))) ERR_CRITICAL("Unable to allocate data file storage\n"); + if (!(Data = (double**)calloc(nrows, sizeof(double *)))) ERR_CRITICAL("Unable to allocate data file storage\n"); + for(int i=0;i 0) ? P.clP[99] : NegBinK; //clP[99] reserved for fitting overdispersion + c = 1.0; // 1 / ((double)(P.NRactE + P.NRactNE)); + int offset= (P.Interventions_StartDate_CalTime > 0) ? ((int)(P.Interventions_StartDate_CalTime - P.DateTriggerReached_SimTime)) : 0; + for (int i = 1; i < ncols;i++) + { + if ((ColTypes[i] >= 0)&&(ColTypes[i] <= 2)) + { + double ModelValueSum = 0.0; + for (int j = 0; j < nrows; j++) + { + int day = (int)Data[j][0]; // day is day of year - directly indexes TimeSeries[] + if ((Data[j][i]>=-1) && (day < P.NumSamples)) // data is not NA (-ve) and within time range of model run + { + double ModelValue; + if (ColTypes[i]==0) + ModelValue=c*TimeSeries[day-offset].incD; // all deaths by date of death + else if (ColTypes[i] == 1) + ModelValue=c*(TimeSeries[day-offset].incDeath_Critical+ TimeSeries[day-offset].incDeath_SARI); // hospital deaths (SARI and Critical) by date of death + else if (ColTypes[i] == 2) + ModelValue = c * TimeSeries[day-offset].incDeath_ILI; // care home deaths (ILI) by date of death + ModelValueSum += ModelValue; + if (Data[j][i] >= 0) + { + if ((j > 0) && (Data[j - 1][i] == -1)) // cumulative column: -1 means sum column up to first >=0 value + { + ModelValue = ModelValueSum; + ModelValueSum = 0.0; // reset cumulative sum + } + if (NegBinK >= 10000) + //prob model and data from same underlying poisson + LL += lgamma(2 * (Data[j][i] + ModelValue) + 1) - lgamma(Data[j][i] + ModelValue + 1) - lgamma(Data[j][i] + 1) - lgamma(ModelValue + 1) - (3 * (Data[j][i] + ModelValue) + 1) * log(2); + else + { + //neg bin LL (NegBinK=1 implies no over-dispersion. >1 implies more) + double knb = 1.0 + ModelValue / kp; + double pnb = kp / (1.0 + kp); + LL += lgamma(Data[j][i] + knb) - lgamma(Data[j][i] + 1) - lgamma(knb) + knb * log(1.0 - pnb) + Data[j][i] * log(pnb); + } + } + } + } + } + else if (ColTypes[i] == 3) //seroprevalence by date of sample + { + for (int j = 0; j < nrows; j++) + { + int day = (int)Data[j][0]; // day is day of year - directly indexes TimeSeries[] + if ((Data[j][i] >= 0) && (day < P.NumSamples)) // data is not NA (-ve) and within time range of model run + { + double m = Data[j][i]; // numerator + double N = Data[j][i + 1]; // denominator + double ModelValue; + for (int k = offset; k < day; k++) // loop over all days of infection up to day of sample + { + double prob_seroconvert = P.SeroConvMaxSens*(1.0-0.5*(exp(-((double)(day - k))*P.SeroConvP1) + exp(-((double)(day - k))*P.SeroConvP2))); + ModelValue += c * TimeSeries[k - offset].incI * prob_seroconvert; + } + ModelValue += c * TimeSeries[day-offset].S * (1.0 - P.SeroConvSpec); + ModelValue /= ((double)P.PopSize); + LL += m * log(ModelValue + 1e-20) + (N - m) * log(1.0 - ModelValue); + } + } + } + else if (ColTypes[i] == 5) // infection prevalence by date of sample + { + for (int j = 0; j < nrows; j++) + { + int day = (int)Data[j][0]; // day is day of year - directly indexes TimeSeries[] + if ((Data[j][i] >= 0) && (day < P.NumSamples)) // data is not NA (-ve) and within time range of model run + { + double m = Data[j][i]; // numerator + double N = Data[j][i + 1]; // denominator + double ModelValue = P.InfPrevSurveyScale * c * TimeSeries[day-offset].I / ((double)P.PopSize); + LL += m * log(ModelValue + 1e-20) + (N - m) * log(1.0 - ModelValue); + } + } + } + } + fprintf(stderr, "Log-likelihood = %lg\n", LL); + if (run == 0) + sumL = LL; + else + { + double maxLL = LL; + if (sumL > maxLL) maxLL = sumL; + sumL = maxLL + log(exp(sumL - maxLL) + exp(LL - maxLL)); + } + + if (run + 1 == P.NumRealisations) + { + LL = sumL - log((double)P.NumRealisations); + std::string TmpFile = OutFileBase + ".ll.tmp"; + std::string OutFile = OutFileBase + ".ll.txt"; + if (!(dat = fopen(TmpFile.c_str(), "w"))) ERR_CRITICAL("Unable to open likelihood file\n"); + fprintf(dat, "%i\t%.8lg\n", P.FitIter, LL); + fclose(dat); + rename(TmpFile.c_str(), OutFile.c_str()); // rename only when file is complete and closed } } @@ -5262,7 +5621,7 @@ void RecordInfTypes(void) } nf = sizeof(Results) / sizeof(double); if (!P.DoAdUnits) nf -= MAX_ADUNITS; // TODO: This still processes most of the AdUnit arrays; just not the last one - fprintf(stderr, "extinct=%i (%i)\n", (int) TimeSeries[P.NumSamples - 1].extinct, P.NumSamples - 1); + if (TimeSeries[P.NumSamples - 1].extinct) { TSMean = TSMeanE; TSVar = TSVarE; P.NRactE++; @@ -5517,18 +5876,26 @@ int GetInputParameter3(FILE* dat, const char* SItemName, const char* ItemType, v if (NumItem == 1) { if(fscanf(dat, "%s", match) != 1) { ERR_CRITICAL_FMT("fscanf failed for %s\n", SItemName); } - if (match[0] == '#') { - int match_id = match[1] - '1'; - if ((match_id >= 1) && (match_id <= 6)) + if ((match[0] == '#') && (match[1] >= '0') && (match[1] <= '9')) + { + int cln; + if ((match[2] >= '0') && (match[2] <= '9')) + cln = ((int)(match[1] - '0')) * 10 + ((int)(match[2] - '0')); + else + cln = (int)(match[1] - '0'); + if ((n<3)&&(P.clP_copies[cln] < MAX_CLP_COPIES)) { - FindFlag++; - if (n == 1) - * ((double*)ItemPtr) = P.clP[match_id]; - else if (n == 2) - * ((int*)ItemPtr) = (int)P.clP[match_id]; - else if (n == 3) - sscanf(match, "%s", (char*)ItemPtr); + P.clP_type[cln][P.clP_copies[cln]] = n; + P.clP_ptr[cln][P.clP_copies[cln]] = ItemPtr; + P.clP_copies[cln]++; } + FindFlag++; + if (n == 1) + *((double*)ItemPtr) = P.clP[cln]; + else if (n == 2) + *((int*)ItemPtr) = (int)P.clP[cln]; + else if (n == 3) + sscanf(match, "%s", (char*)ItemPtr); } else if ((match[0] != '[') && (!feof(dat))) { @@ -5546,7 +5913,40 @@ int GetInputParameter3(FILE* dat, const char* SItemName, const char* ItemType, v for (CurPos = 0; CurPos < NumItem; CurPos++) { if(fscanf(dat, "%s", match) != 1) { ERR_CRITICAL_FMT("fscanf failed for %s\n", SItemName); } - if ((match[0] != '[') && (!feof(dat))) + if ((match[0] == '#') && (match[1] >= '0') && (match[1] <= '9')) + { + int cln; + if ((match[2] >= '0') && (match[2] <= '9')) + cln = ((int)(match[1] - '0')) * 10 + ((int)(match[2] - '0')); + else + cln = (int)(match[1] - '0'); + FindFlag++; + if (n == 1) + { + double* ipt = (((double*)ItemPtr) + CurPos + Offset); + *ipt = P.clP[cln]; + if (P.clP_copies[cln] < MAX_CLP_COPIES) + { + P.clP_type[cln][P.clP_copies[cln]] = 1; + P.clP_ptr[cln][P.clP_copies[cln]] = (void *)ipt; + P.clP_copies[cln]++; + } + } + else if (n == 2) + { + int* ipt = (((int*)ItemPtr) + CurPos + Offset); + *ipt = (int)P.clP[cln]; + if (P.clP_copies[cln] < MAX_CLP_COPIES) + { + P.clP_type[cln][P.clP_copies[cln]] = 2; + P.clP_ptr[cln][P.clP_copies[cln]] = (void*)ipt; + P.clP_copies[cln]++; + } + } + else if (n == 3) + sscanf(match, "%s", *(((char**)ItemPtr) + CurPos + Offset)); + } + else if ((match[0] != '[') && (!feof(dat))) { FindFlag++; if (n == 1) @@ -5568,11 +5968,44 @@ int GetInputParameter3(FILE* dat, const char* SItemName, const char* ItemType, v for (i = 0; i < NumItem2; i++) { if(fscanf(dat, "%s", match) != 1) { ERR_CRITICAL_FMT("fscanf failed for %s\n", SItemName); } - if ((match[0] != '[') && (!feof(dat))) + if ((match[0] == '#') && (match[1] >= '0') && (match[1] <= '9')) { FindFlag++; + int cln; + if ((match[2] >= '0') && (match[2] <= '9')) + cln = ((int)(match[1] - '0')) * 10 + ((int)(match[2] - '0')); + else + cln = (int)(match[1] - '0'); if (n == 1) - sscanf(match, "%lf", ((double**)ItemPtr)[j + Offset] + i + Offset); //changed from [j+Offset]+i+Offset to +j+Offset+i, as ItemPtr isn't an array - 01/10: changed it back + { + double* ipt = (((double**)ItemPtr)[j + Offset] + i + Offset); + *ipt = P.clP[cln]; + if (P.clP_copies[cln] < MAX_CLP_COPIES) + { + P.clP_type[cln][P.clP_copies[cln]] = 1; + P.clP_ptr[cln][P.clP_copies[cln]] = (void*)ipt; + P.clP_copies[cln]++; + } + } + else if (n == 2) + { + int* ipt = (((int**)ItemPtr)[j + Offset] + i + Offset); + *ipt = (int)P.clP[cln]; + if (P.clP_copies[cln] < MAX_CLP_COPIES) + { + P.clP_type[cln][P.clP_copies[cln]] = 2; + P.clP_ptr[cln][P.clP_copies[cln]] = (void*)ipt; + P.clP_copies[cln]++; + } + } + else if (n == 3) + sscanf(match, "%s", *(((char**)ItemPtr) + CurPos + Offset)); + } + else if((match[0] != '[') && (!feof(dat))) + { + FindFlag++; + if (n == 1) + sscanf(match, "%lf", ((double**)ItemPtr)[j + Offset] + i + Offset); else sscanf(match, "%i", ((int**)ItemPtr)[j + Offset] + i + Offset); } @@ -5582,8 +6015,8 @@ int GetInputParameter3(FILE* dat, const char* SItemName, const char* ItemType, v j = NumItem; } } - //Offset=Offset+(NumItem2-1); //added this line to get the correct offset in address position when incrementing j - } //added these braces + + } } } // fprintf(stderr,"%s\n",SItemName); diff --git a/src/Memory.cpp b/src/Memory.cpp index cb3f4ef5b..a9b0e1bd7 100644 --- a/src/Memory.cpp +++ b/src/Memory.cpp @@ -34,7 +34,7 @@ void* Memory::xcalloc(std::size_t nelem, std::size_t elsize) noexcept /* Ensure we're going to allocate some memory. */ if (elsize == 0 || nelem == 0) { - std::fprintf(stderr, "WARNING: xcalloc called with nelem = %zu and elsize = %zu.\n", nelem, elsize); + //std::fprintf(stderr, "WARNING: xcalloc called with nelem = %zu and elsize = %zu.\n", nelem, elsize); /* Memory we allocate shouldn't be used - so just set it to the smallest * amount possible. */ elsize = 1; diff --git a/src/Model.h b/src/Model.h index 9ba3cf4de..e69ac7daa 100644 --- a/src/Model.h +++ b/src/Model.h @@ -22,8 +22,6 @@ #pragma pack(push, 2) - - /* In the main InfectSweep loop, we cannot safely set Hosts[infectee].infector and Hosts[infectee].infect_type, as concurrent @@ -110,7 +108,7 @@ struct PopVar int cumDeath_ILI_adunit[MAX_ADUNITS], cumDeath_SARI_adunit[MAX_ADUNITS], cumDeath_Critical_adunit[MAX_ADUNITS]; // tracks cumulative deaths from ILI, SARI & Critical severities int cumDeath_ILI_age[NUM_AGE_GROUPS], cumDeath_SARI_age[NUM_AGE_GROUPS], cumDeath_Critical_age[NUM_AGE_GROUPS]; - int ** prevInf_age_adunit, ** cumInf_age_adunit; // prevalence, incidence, and cumulative incidence of infection by age and admin unit. + int **prevInf_age_adunit, **cumInf_age_adunit; // prevalence, incidence, and cumulative incidence of infection by age and admin unit. //// above quantities need to be amended in following parts of code: @@ -136,7 +134,7 @@ struct Results { // Initial values should not be touched by mean/var calculation double t; - double ** prevInf_age_adunit, ** incInf_age_adunit, ** cumInf_age_adunit; // prevalence, incidence, and cumulative incidence of infection by age and admin unit. + double** prevInf_age_adunit, ** incInf_age_adunit, ** cumInf_age_adunit; // prevalence, incidence, and cumulative incidence of infection by age and admin unit. // The following values must all be doubles or inline arrays of doubles // The first variable must be S. If that changes change the definition of diff --git a/src/Models/Person.h b/src/Models/Person.h index ccc964f50..b21593aaf 100644 --- a/src/Models/Person.h +++ b/src/Models/Person.h @@ -21,15 +21,20 @@ struct Person unsigned int keyworker : 1; // also used to binary index cumI_keyworker[] and related arrays unsigned int to_die : 1; unsigned int detected : 1; //added hospitalisation flag: ggilani 28/10/2014, added flag to determined whether this person's infection is detected or not + unsigned int care_home_resident : 1; + unsigned int quar_comply : 2; // can be 0, 1, or 2 + unsigned int digitalContactTracingUser : 1; + unsigned int digitalContactTraced : 1; + unsigned int index_case_dct : 2; unsigned char Travelling; // Range up to MAX_TRAVEL_TIME unsigned char age; unsigned char num_treats; // set to 0 and tested < 2. but never modified? - Severity Severity_Current, Severity_Final; //// Note we allow Severity_Final to take values: Severity_Mild, Severity_ILI, Severity_SARI, Severity_Critical (not e.g. Severity_Dead or Severity_RecoveringFromCritical) - unsigned short int PlaceGroupLinks[NUM_PLACE_TYPES]; // These can definitely get > 255 - short int infect_type; // INFECT_TYPE_MASK + + short int infect_type; // INFECT_TYPE_MASK InfStat inf; + Severity Severity_Current, Severity_Final; //// Note we allow Severity_Final to take values: Severity_Mild, Severity_ILI, Severity_SARI, Severity_Critical (not e.g. Severity_Dead or Severity_RecoveringFromCritical) unsigned short int detected_time; //added hospitalisation flag: ggilani 28/10/2014, added flag to determined whether this person's infection is detected or not unsigned short int absent_start_time, absent_stop_time; @@ -38,9 +43,6 @@ struct Person unsigned short int recovery_or_death_time; // set in DoIncub function unsigned short int SARI_time, Critical_time, RecoveringFromCritical_time; //// /*mild_time, ILI_time,*/ Time of infectiousness onset same for asymptomatic, Mild, and ILI infection so don't need mild_time etc. unsigned short int treat_start_time, treat_stop_time, vacc_start_time; //// set in TreatSweep function. - unsigned int digitalContactTraced : 1; - unsigned int index_case_dct : 2; - unsigned int digitalContactTracingUser : 1; unsigned short int dct_start_time, dct_end_time, dct_trigger_time, dct_test_time; //digital contact tracing start and end time: ggilani 10/03/20 int ncontacts; //added this in to record total number of contacts each index case records: ggilani 13/04/20 diff --git a/src/Param.h b/src/Param.h index 63d903e57..f156a06f2 100644 --- a/src/Param.h +++ b/src/Param.h @@ -38,8 +38,10 @@ struct Param CovidSim::TBD1::KernelStruct MoveKernel; CovidSim::TBD1::KernelStruct AirportKernel; unsigned int BinFileLen; - int DoBin; - double SnapshotSaveTime, SnapshotLoadTime, clP[6]; + int DoBin, DoSaveSnapshot, DoLoadSnapshot,FitIter; + double SnapshotSaveTime, SnapshotLoadTime, clP[100]; + int clP_copies[100], clP_type[100][MAX_CLP_COPIES]; + void *clP_ptr[100][MAX_CLP_COPIES]; int NC; // Number of cells int NMC; // Number of microcells int NMCL; // Number of microcells wide/high a cell is; i.e. NMC = NC * NMCL * NMCL @@ -67,42 +69,28 @@ struct Param int DoSI, DoPeriodicBoundaries, DoImmuneBitmap, OutputBitmapDetected; //added OutputBitmapDetected - ggilani 04/08/15 int DoHouseholds, DoPlaces, PlaceTypeNum, Nplace[NUM_PLACE_TYPES], SmallEpidemicCases, DoPlaceGroupTreat; int NumInitialInfections[MAX_NUM_SEED_LOCATIONS], DoRandomInitialInfectionLoc, DoAllInitialInfectioninSameLoc; - int MinPopDensForInitialInfection, NumSeedLocations,InitialInfectionsAdminUnitId[MAX_NUM_SEED_LOCATIONS],InitialInfectionsAdminUnit[MAX_NUM_SEED_LOCATIONS], MaxPopDensForInitialInfection; - int DoAge, DoSymptoms, IncThreshPop, GlobalIncThreshPop; + int MinPopDensForInitialInfection, NumSeedLocations,InitialInfectionsAdminUnitId[MAX_NUM_SEED_LOCATIONS],InitialInfectionsAdminUnit[MAX_NUM_SEED_LOCATIONS], MaxPopDensForInitialInfection, MaxAgeForInitialInfection; + int DoAge, DoSymptoms, LoadSaveNetwork, IncThreshPop, GlobalIncThreshPop; int OutputOnlyNonExtinct, DoInfectiousnessProfile, DoInfectionTree, DoWholeHouseholdImmunity, DoSpatial, DoDeath; - int DoAirports, Nairports, Air_popscale, DoRealSymptWithdrawal, CaseAbsentChildAgeCutoff, DoEarlyCaseDiagnosis; + int DoAirports, Nairports, Air_popscale, DoSchoolFile, DoRealSymptWithdrawal, CaseAbsentChildAgeCutoff, DoInterventionFile; int PlaceTypeNoAirNum; // If DoAirports then this is the number of non-airport place types (< PlaceTypeNum), else == PlaceTypeNum (~ no airport places). int HotelPlaceType; // If DoAirports then this is place type for hotel (>= PlaceTypeNoAirNum, < PlaceTypeNum), else == PlaceTypeNum (~ unused). + int FixLocalBeta; int32_t setupSeed1, setupSeed2; // RNG seeds from the command line, used to initialise the RNG for setup int32_t runSeed1, runSeed2; // RNG seeds from the command line, used to initialise the RNG for running the model int32_t nextSetupSeed1, nextSetupSeed2; // The next RNG seeds to use when we need to reinitialise the RNG for setup int32_t nextRunSeed1, nextRunSeed2; // The next RNG seeds to use when we need to reinitialise the RNG for the model int ResetSeeds,KeepSameSeeds, ResetSeedsPostIntervention, ResetSeedsFlag, TimeToResetSeeds; int OutputBitmap; // Whether to output a bitmap - double LongitudeCutLine; // Longitude to image earth is cut at to produce a flat map. Default -360 degrees (effectively -180). Use to ensure countries have a contiguous boundary - double SpatialBoundingBox[4], LocationInitialInfection[MAX_NUM_SEED_LOCATIONS][2], InitialInfectionsAdminUnitWeight[MAX_NUM_SEED_LOCATIONS], TimeStepsPerDay; - double FalsePositiveRate, FalsePositivePerCapitaIncidence, FalsePositiveAgeRate[NUM_AGE_GROUPS]; - double infectious_prof[INFPROF_RES + 1], infectiousness[MAX_INFECTIOUS_STEPS]; - - // use the wrapper class InverseCdf instead of the raw data type to enable code re-use - InverseCdf latent_icdf, infectious_icdf; - InverseCdf MildToRecovery_icdf, ILIToRecovery_icdf, SARIToRecovery_icdf, CriticalToCritRecov_icdf, CritRecovToRecov_icdf; - InverseCdf ILIToSARI_icdf, SARIToCritical_icdf, ILIToDeath_icdf, SARIToDeath_icdf, CriticalToDeath_icdf; - - /// means for above icdf's. - double Mean_MildToRecovery[NUM_AGE_GROUPS], Mean_ILIToRecovery[NUM_AGE_GROUPS], Mean_SARIToRecovery[NUM_AGE_GROUPS], Mean_CriticalToCritRecov[NUM_AGE_GROUPS], Mean_CritRecovToRecov[NUM_AGE_GROUPS]; - double Mean_TimeToTest, Mean_TimeToTestOffset, Mean_TimeToTestCriticalOffset, Mean_TimeToTestCritRecovOffset; - double Mean_ILIToSARI[NUM_AGE_GROUPS], Mean_SARIToCritical[NUM_AGE_GROUPS], Mean_CriticalToDeath[NUM_AGE_GROUPS], Mean_SARIToDeath[NUM_AGE_GROUPS], Mean_ILIToDeath[NUM_AGE_GROUPS]; - double Prop_Mild_ByAge[NUM_AGE_GROUPS], Prop_ILI_ByAge[NUM_AGE_GROUPS], Prop_SARI_ByAge[NUM_AGE_GROUPS], Prop_Critical_ByAge[NUM_AGE_GROUPS]; - double CFR_SARI_ByAge[NUM_AGE_GROUPS], CFR_Critical_ByAge[NUM_AGE_GROUPS], CFR_ILI_ByAge[NUM_AGE_GROUPS]; + int ts_age; + int DoSeverity; // Non-zero (true) if severity analysis should be done double TimeStep; // The length of a time step, in days double SampleTime; // The number of days to run for double SampleStep; // The length of a sampling step, in days double BitmapAspectScale; // Height of bitmap / Width of bitmap - int ts_age; - int DoSeverity; // Non-zero (true) if severity analysis should be done - + double LongitudeCutLine; // Longitude to image earth is cut at to produce a flat map. Default -360 degrees (effectively -180). Use to ensure countries have a contiguous boundary + /// Number of pixels per degree in bitmap output Geometry::Vector2 scale; @@ -114,15 +102,25 @@ struct Param /// Size of spatial domain in microcells Geometry::Size in_microcells_; + + double SpatialBoundingBox[4], LocationInitialInfection[MAX_NUM_SEED_LOCATIONS][2], InitialInfectionsAdminUnitWeight[MAX_NUM_SEED_LOCATIONS], InitialInfectionCalTime, TimeStepsPerDay; + double FalsePositiveRate, FalsePositivePerCapitaIncidence, FalsePositiveAgeRate[NUM_AGE_GROUPS]; + double SeroConvMaxSens, SeroConvP1, SeroConvP2, SeroConvSpec, InfPrevSurveyScale; + double AirportTrafficScale; + double R0, R0scale, LocalBeta; double LatentPeriod; // In days. Mean of icdf (inverse cumulative distribution function). + InverseCdf latent_icdf, infectious_icdf; + double infectious_prof[INFPROF_RES + 1], infectiousness[MAX_INFECTIOUS_STEPS]; double InfectiousPeriod; // In days. Mean of icdf (inverse cumulative distribution function). double R0household, R0places, R0spatial; double Seasonality[DAYS_PER_YEAR]; - double SusceptibilitySD,InfectiousnessSD, R0DensityScalePower; - double ProportionSymptomatic[NUM_AGE_GROUPS], LatentToSymptDelay, SymptInfectiousness; + double SusceptibilitySD, InfectiousnessSD, R0DensityScalePower; + double ProportionSymptomatic[NUM_AGE_GROUPS], LatentToSymptDelay, SymptInfectiousness, AsymptInfectiousness; double SymptSpatialContactRate, SymptPlaceTypeContactRate[NUM_PLACE_TYPES], InhibitInterAdunitPlaceAssignment[NUM_PLACE_TYPES]; + int CareHomePlaceType, CareHomeResidentMinimumAge, CareHomeAllowInitialInfections; + double CareHomeResidentHouseholdScaling, CareHomeResidentSpatialScaling, CareHomeWorkerGroupScaling, CareHomeResidentPlaceScaling, CareHomeRelProbHosp, CareHomePropResidents; double SymptPlaceTypeWithdrawalProp[NUM_PLACE_TYPES], CaseAbsenteeismDuration, CaseAbsenteeismDelay; double CaseAbsentChildPropAdultCarers; double RelativeTravelRate[NUM_AGE_GROUPS], RelativeSpatialContact[NUM_AGE_GROUPS]; @@ -130,10 +128,13 @@ struct Param double WAIFW_Matrix[NUM_AGE_GROUPS][NUM_AGE_GROUPS]; double HotelPropLocal, JourneyDurationDistrib[MAX_TRAVEL_TIME], LocalJourneyDurationDistrib[MAX_TRAVEL_TIME]; double MeanJourneyTime, MeanLocalJourneyTime; + + + int NoInfectiousnessSDinHH; // Default 0 int PlaceCloseRoundHousehold; // Default 1 (close places around a household), 0 (off) int AbsenteeismPlaceClosure; // Default 0 (off), 1 (on) track place closures in more detail int MaxAbsentTime; // In days. Max number of days absent, range [0, MAX_ABSENT_TIME]. Default 0 if !P.AbsenteeismPlaceClosure, otherwise MAX_ABSENT_TIME - int InvJourneyDurationDistrib[1025], InvLocalJourneyDurationDistrib[1026]; + int InvJourneyDurationDistrib[1025], InvLocalJourneyDurationDistrib[1025]; double HouseholdTrans, HouseholdSizeDistrib[MAX_ADUNITS][MAX_HOUSEHOLD_SIZE], HouseholdTransPow; double HouseholdDenomLookup[MAX_HOUSEHOLD_SIZE]; int PlaceTypeAgeMin[NUM_PLACE_TYPES], PlaceTypeAgeMax[NUM_PLACE_TYPES], PlaceTypeMaxAgeRead[NUM_PLACE_TYPES]; @@ -144,11 +145,24 @@ struct Param double PlaceTypePropAgeGroup3[NUM_PLACE_TYPES], PlaceTypeKernelShape[NUM_PLACE_TYPES], PlaceTypeKernelScale[NUM_PLACE_TYPES]; double PlaceTypeKernelP3[NUM_PLACE_TYPES], PlaceTypeKernelP4[NUM_PLACE_TYPES], PlaceTypeTrans[NUM_PLACE_TYPES]; double PlaceTypeMeanSize[NUM_PLACE_TYPES], PlaceTypePropBetweenGroupLinks[NUM_PLACE_TYPES], PlaceTypeSizeSD[NUM_PLACE_TYPES]; //added PlaceTypeSizeSD for lognormal distribution - ggilani 09/02/17 - double PlaceTypeSizePower[NUM_PLACE_TYPES], PlaceTypeSizeOffset[NUM_PLACE_TYPES], PlaceTypeSizeMax[NUM_PLACE_TYPES]; + double PlaceTypeSizePower[NUM_PLACE_TYPES], PlaceTypeSizeOffset[NUM_PLACE_TYPES], PlaceTypeSizeMax[NUM_PLACE_TYPES], PlaceTypeSizeMin[NUM_PLACE_TYPES]; double PlaceTypeGroupSizeParam1[NUM_PLACE_TYPES], PlaceExclusivityMatrix[NUM_PLACE_TYPES * NUM_PLACE_TYPES]; //changed PlaceExclusivityMatrix from [NUM_PLACE_TYPES][NUM_PLACE_TYPES] double PropAgeGroup[MAX_ADUNITS][NUM_AGE_GROUPS], PopByAdunit[MAX_ADUNITS][2]; double InvLifeExpecDist[MAX_ADUNITS][1001]; + double ScaleIFR; + + // use the wrapper class InverseCdf instead of the raw data type to enable code re-use + + InverseCdf MildToRecovery_icdf, ILIToRecovery_icdf, SARIToRecovery_icdf, CriticalToCritRecov_icdf, CritRecovToRecov_icdf; + InverseCdf ILIToSARI_icdf, SARIToCritical_icdf, ILIToDeath_icdf, SARIToDeath_icdf, CriticalToDeath_icdf; + /// means for above icdf's. + double Mean_MildToRecovery[NUM_AGE_GROUPS], Mean_ILIToRecovery[NUM_AGE_GROUPS], Mean_SARIToRecovery[NUM_AGE_GROUPS], Mean_CriticalToCritRecov[NUM_AGE_GROUPS], Mean_CritRecovToRecov[NUM_AGE_GROUPS]; + double Mean_TimeToTest, Mean_TimeToTestOffset, Mean_TimeToTestCriticalOffset, Mean_TimeToTestCritRecovOffset; + double Mean_ILIToSARI[NUM_AGE_GROUPS], Mean_SARIToCritical[NUM_AGE_GROUPS], Mean_CriticalToDeath[NUM_AGE_GROUPS], Mean_SARIToDeath[NUM_AGE_GROUPS], Mean_ILIToDeath[NUM_AGE_GROUPS]; + double Prop_Mild_ByAge[NUM_AGE_GROUPS], Prop_ILI_ByAge[NUM_AGE_GROUPS], Prop_SARI_ByAge[NUM_AGE_GROUPS], Prop_Critical_ByAge[NUM_AGE_GROUPS]; + double CFR_SARI_ByAge[NUM_AGE_GROUPS], CFR_Critical_ByAge[NUM_AGE_GROUPS], CFR_ILI_ByAge[NUM_AGE_GROUPS]; + double PlaceCloseTimeStart, PlaceCloseTimeStart2, PlaceCloseDurationBase, PlaceCloseDuration, PlaceCloseDuration2, PlaceCloseDelayMean, PlaceCloseRadius, PlaceCloseRadius2; double PlaceCloseEffect[NUM_PLACE_TYPES], PlaceClosePropAttending[NUM_PLACE_TYPES], PlaceCloseSpatialRelContact, PlaceCloseHouseholdRelContact; double PlaceCloseCasePropThresh, PlaceCloseAdunitPropThresh, PlaceCloseFracIncTrig; @@ -255,6 +269,8 @@ struct Param double AirportCloseTimeStartBase, HQuarantineTimeStartBase, CaseIsolationTimeStartBase, SocDistTimeStartBase, KeyWorkerProphTimeStartBase, DigitalContactTracingTimeStartBase; double InfectionImportRate1, InfectionImportRate2, InfectionImportChangeTime, ImportInfectionTimeProfile[MAX_DUR_IMPORT_PROFILE]; + int DoNoCalibration, CaseOrDeathThresholdBeforeAlert_CommandLine; + /**< CALIBRATION PARAMETERS Params below govern how epidemic is calibrated. Calibration relates simulation time to calendar time (e.g. which day of year corresponds to first day of epidemic / simulation?), and adjusts seeding of infection. @@ -318,7 +334,8 @@ struct Param int DoInterventionDelaysByAdUnit; - int OutputAge, OutputR0, OutputControls, OutputCountry, OutputAdUnitVar, OutputHousehold, OutputInfType, OutputNonSeverity, OutputSeverityAdminUnit, OutputSeverityAge, OutputNonSummaryResults, OutputAdUnitAge; + int OutputAge, OutputR0, OutputControls, OutputCountry, OutputAdUnitVar, OutputHousehold, OutputInfType, OutputNonSeverity; + int OutputSeverity, OutputSeverityAdminUnit, OutputSeverityAge, OutputNonSummaryResults, OutputAdUnitAge; int MeanChildAgeGap; // Average gap between ages of children in a household, in years int MinAdultAge; // The youngest age, in years, at which someone is considered to be an adult diff --git a/src/SetupModel.cpp b/src/SetupModel.cpp index 269d3ef35..2e4c531db 100644 --- a/src/SetupModel.cpp +++ b/src/SetupModel.cpp @@ -3,6 +3,7 @@ #include #include #include +#include #include #include "BinIO.h" @@ -31,7 +32,7 @@ void SetupModel(std::string const& density_file, std::string const& out_density_ { int l, m, j2, l2, m2; unsigned int rn; - double t, s, s2, s3, t2, t3, d, q; + double t, s, s2, t2; char buf[2048]; FILE* dat; @@ -40,7 +41,6 @@ void SetupModel(std::string const& density_file, std::string const& out_density_ P.nextSetupSeed1 = P.setupSeed1; P.nextSetupSeed2 = P.setupSeed2; setall(&P.nextSetupSeed1, &P.nextSetupSeed2); - P.DoBin = -1; if (!density_file.empty()) { @@ -226,66 +226,51 @@ void SetupModel(std::string const& density_file, std::string const& out_density_ TSMeanNE = (Results*)Memory::xcalloc(P.NumSamples, sizeof(Results)); TSVarNE = (Results*)Memory::xcalloc(P.NumSamples, sizeof(Results)); TSMean = TSMeanE; TSVar = TSVarE; - ///// This loops over index l twice just to reset the pointer TSMean from TSMeanE to TSMeanNE (same for TSVar). - int num_in_results = sizeof(Results) / sizeof(double); - for (l = 0; l < 2; l++) - { - for (int i = 0; i < P.NumSamples; i++) - { - double *ts_mean = (double *)&TSMean[i]; - double *ts_var = (double *)&TSVar[i]; - for (int j = 0; j < num_in_results; j++) ts_mean[j] = ts_var[j] = 0.0; - } - TSMean = TSMeanNE; TSVar = TSVarNE; - } if (P.DoAdUnits && P.OutputAdUnitAge) { - // initialize State age and admin unit breakdowns - State.prevInf_age_adunit = new int* [NUM_AGE_GROUPS](); - State.cumInf_age_adunit = new int* [NUM_AGE_GROUPS](); + State.prevInf_age_adunit = (int**)Memory::xcalloc(NUM_AGE_GROUPS, sizeof(int*)); + State.cumInf_age_adunit = (int**)Memory::xcalloc(NUM_AGE_GROUPS, sizeof(int*)); for (int AgeGroup = 0; AgeGroup < NUM_AGE_GROUPS; AgeGroup++) { - State.prevInf_age_adunit[AgeGroup] = new int[P.NumAdunits](); - State.cumInf_age_adunit [AgeGroup] = new int[P.NumAdunits](); + State.prevInf_age_adunit[AgeGroup] = (int*)Memory::xcalloc(P.NumAdunits, sizeof(int)); + State.cumInf_age_adunit [AgeGroup] = (int*)Memory::xcalloc(P.NumAdunits, sizeof(int)); } - // initialize threaded State age and admin unit breakdowns for (int Thread = 0; Thread < P.NumThreads; Thread++) { - StateT[Thread].prevInf_age_adunit = new int* [NUM_AGE_GROUPS](); - StateT[Thread].cumInf_age_adunit = new int* [NUM_AGE_GROUPS](); + StateT[Thread].prevInf_age_adunit = (int**)Memory::xcalloc(NUM_AGE_GROUPS, sizeof(int*)); + StateT[Thread].cumInf_age_adunit = (int**)Memory::xcalloc(NUM_AGE_GROUPS, sizeof(int*)); for (int AgeGroup = 0; AgeGroup < NUM_AGE_GROUPS; AgeGroup++) { - StateT[Thread].prevInf_age_adunit[AgeGroup] = new int[P.NumAdunits](); - StateT[Thread].cumInf_age_adunit [AgeGroup] = new int[P.NumAdunits](); + StateT[Thread].prevInf_age_adunit[AgeGroup] = (int*)Memory::xcalloc(P.NumAdunits, sizeof(int)); + StateT[Thread].cumInf_age_adunit [AgeGroup] = (int*)Memory::xcalloc(P.NumAdunits, sizeof(int)); } } - // initialize TimeSeries age and admin unit breakdowns for (int Time = 0; Time < P.NumSamples; Time++) { - TimeSeries[Time].prevInf_age_adunit = new double* [NUM_AGE_GROUPS](); - TimeSeries[Time].incInf_age_adunit = new double* [NUM_AGE_GROUPS](); - TimeSeries[Time].cumInf_age_adunit = new double* [NUM_AGE_GROUPS](); - TSMeanE [Time].prevInf_age_adunit = new double* [NUM_AGE_GROUPS](); - TSMeanE [Time].incInf_age_adunit = new double* [NUM_AGE_GROUPS](); - TSMeanE [Time].cumInf_age_adunit = new double* [NUM_AGE_GROUPS](); - TSMeanNE[Time].prevInf_age_adunit = new double* [NUM_AGE_GROUPS](); - TSMeanNE[Time].incInf_age_adunit = new double* [NUM_AGE_GROUPS](); - TSMeanNE[Time].cumInf_age_adunit = new double* [NUM_AGE_GROUPS](); + TimeSeries[Time].prevInf_age_adunit = (double**)Memory::xcalloc(NUM_AGE_GROUPS, sizeof(double*)); + TimeSeries[Time].incInf_age_adunit = (double**)Memory::xcalloc(NUM_AGE_GROUPS, sizeof(double*)); + TimeSeries[Time].cumInf_age_adunit = (double**)Memory::xcalloc(NUM_AGE_GROUPS, sizeof(double*)); + TSMeanE [Time].prevInf_age_adunit = (double**)Memory::xcalloc(NUM_AGE_GROUPS, sizeof(double*)); + TSMeanE [Time].incInf_age_adunit = (double**)Memory::xcalloc(NUM_AGE_GROUPS, sizeof(double*)); + TSMeanE [Time].cumInf_age_adunit = (double**)Memory::xcalloc(NUM_AGE_GROUPS, sizeof(double*)); + TSMeanNE[Time].prevInf_age_adunit = (double**)Memory::xcalloc(NUM_AGE_GROUPS, sizeof(double*)); + TSMeanNE[Time].incInf_age_adunit = (double**)Memory::xcalloc(NUM_AGE_GROUPS, sizeof(double*)); + TSMeanNE[Time].cumInf_age_adunit = (double**)Memory::xcalloc(NUM_AGE_GROUPS, sizeof(double*)); for (int AgeGroup = 0; AgeGroup < NUM_AGE_GROUPS; AgeGroup++) { - TimeSeries[Time].prevInf_age_adunit[AgeGroup] = new double[P.NumAdunits](); - TimeSeries[Time].incInf_age_adunit[AgeGroup] = new double[P.NumAdunits](); - TimeSeries[Time].cumInf_age_adunit[AgeGroup] = new double[P.NumAdunits](); - TSMeanE[Time].prevInf_age_adunit[AgeGroup] = new double[P.NumAdunits](); - TSMeanE[Time].incInf_age_adunit[AgeGroup] = new double[P.NumAdunits](); - TSMeanE[Time].cumInf_age_adunit[AgeGroup] = new double[P.NumAdunits](); - TSMeanNE[Time].prevInf_age_adunit[AgeGroup] = new double[P.NumAdunits](); - TSMeanNE[Time].incInf_age_adunit[AgeGroup] = new double[P.NumAdunits](); - TSMeanNE[Time].cumInf_age_adunit[AgeGroup] = new double[P.NumAdunits](); + TimeSeries[Time].prevInf_age_adunit[AgeGroup] = (double*)Memory::xcalloc(P.NumAdunits, sizeof(double)); + TimeSeries[Time].incInf_age_adunit[AgeGroup] = (double*)Memory::xcalloc(P.NumAdunits, sizeof(double)); + TimeSeries[Time].cumInf_age_adunit[AgeGroup] = (double*)Memory::xcalloc(P.NumAdunits, sizeof(double)); + TSMeanE[Time].prevInf_age_adunit[AgeGroup] = (double*)Memory::xcalloc(P.NumAdunits, sizeof(double)); + TSMeanE[Time].incInf_age_adunit[AgeGroup] = (double*)Memory::xcalloc(P.NumAdunits, sizeof(double)); + TSMeanE[Time].cumInf_age_adunit[AgeGroup] = (double*)Memory::xcalloc(P.NumAdunits, sizeof(double)); + TSMeanNE[Time].prevInf_age_adunit[AgeGroup] = (double*)Memory::xcalloc(P.NumAdunits, sizeof(double)); + TSMeanNE[Time].incInf_age_adunit[AgeGroup] = (double*)Memory::xcalloc(P.NumAdunits, sizeof(double)); + TSMeanNE[Time].cumInf_age_adunit[AgeGroup] = (double*)Memory::xcalloc(P.NumAdunits, sizeof(double)); } } } @@ -296,7 +281,6 @@ void SetupModel(std::string const& density_file, std::string const& out_density_ InfEventLog = (Events*)Memory::xcalloc(P.MaxInfEvents, sizeof(Events)); } - if(P.OutputNonSeverity) SaveAgeDistrib(out_file_base); fprintf(stderr, "Initialising places...\n"); @@ -323,14 +307,34 @@ void SetupModel(std::string const& density_file, std::string const& out_density_ Cells[i].L = Cells[i].I = Cells[i].R = 0; //Cells[i].susceptible=Cells[i].members; //added this line } - for (int i = 0; i < P.PopSize; i++) Hosts[i].keyworker = 0; - P.KeyWorkerNum = P.KeyWorkerIncHouseNum = m = l = 0; + fprintf(stderr, "Initialising kernel...\n"); P.Kernel = P.MoveKernel; P.KernelLookup.init(1.0, P.Kernel); CovidSim::TBD1::KernelLookup::init(P.KernelLookup, CellLookup, P.NCP); + for (int i = 0; i < P.PopSize; i++) Hosts[i].keyworker = Hosts[i].care_home_resident = 0; + double nstaff = 0, nres = 0; + if ((P.CareHomePlaceType >= 0) && (P.CareHomeResidentMinimumAge < 1000)) // label care home residents as they don't have household contacts + { + for (int i = 0; i < P.PopSize; i++) + if (Hosts[i].PlaceLinks[P.CareHomePlaceType] >= 0) + { + if (Hosts[i].age >= P.CareHomeResidentMinimumAge) + { + Hosts[i].care_home_resident = 1; + nres++; + } + else + nstaff++; + } + P.CareHomePropResidents = (nres > 0) ? (nres / (nres + nstaff)) : 0.0; + } + else + P.CareHomePropResidents = 0.0; + fprintf(stderr, "%lg care home residents\n%lg care home workers\n", nres, nstaff); + P.KeyWorkerNum = P.KeyWorkerIncHouseNum = m = l = 0; if (P.DoPlaces) { while ((m < P.KeyWorkerPopNum) && (l < 1000)) @@ -475,25 +479,162 @@ void SetupModel(std::string const& density_file, std::string const& out_density_ UpdateProbs(0); if (P.DoAirports) SetupAirports(); - if (P.R0scale != 1.0) + + TSMean = TSMeanNE; TSVar = TSVarNE; + fprintf(stderr, "Calculated approx cell probabilities\n"); + for (int i = 0; i < INFECT_TYPE_MASK; i++) inftype_av[i] = 0; + for (int i = 0; i < MAX_COUNTRIES; i++) infcountry_av[i] = infcountry_num[i] = 0; + for (int i = 0; i < MAX_SEC_REC; i++) + for (int j = 0; j < MAX_GEN_REC; j++) + indivR0_av[i][j] = 0; + for (int i = 0; i <= MAX_HOUSEHOLD_SIZE; i++) + for (int j = 0; j <= MAX_HOUSEHOLD_SIZE; j++) + inf_household_av[i][j] = case_household_av[i][j] = 0; + DoInitUpdateProbs = 1; + for (int i = 0; i < P.NC; i++) Cells[i].tot_treat = 1; //This makes sure InitModel intialises the cells. + P.NRactE = P.NRactNE = 0; + for (int i = 0; i < P.PopSize; i++) Hosts[i].esocdist_comply = (ranf() < P.EnhancedSocDistProportionCompliant[HOST_AGE_GROUP(i)]) ? 1 : 0; + if (P.EnhancedSocDistClusterByHousehold) { - P.HouseholdTrans *= P.R0scale; - P.R0 *= P.R0scale; - for (int j = 0; j < P.PlaceTypeNum; j++) - P.PlaceTypeTrans[j] *= P.R0scale; - fprintf(stderr, "Rescaled transmission coefficients by factor of %lg\n", P.R0scale); + for (int i = 0; i < P.NH;i++) + { + l = Households[i].FirstPerson; + m = l + Households[i].nh; + int i2 = 0; + for (int k = l; k < m; k++) if (Hosts[k].esocdist_comply) i2=1; + if (i2) + for (int k = l; k < m; k++) Hosts[k].esocdist_comply = 1; + } + } + + if (P.OutputBitmap) + { + InitBMHead(out_file_base); + } + if (P.DoMassVacc) + { + if (!(State.mvacc_queue = (int*)calloc(P.PopSize, sizeof(int)))) ERR_CRITICAL("Unable to allocate host storage\n"); + int queueIndex = 0; + for (int i = 0; i < P.PopSize; i++) + { + if ((HOST_AGE_YEAR(i) >= P.VaccPriorityGroupAge[0]) && (HOST_AGE_YEAR(i) <= P.VaccPriorityGroupAge[1])) + { + if (ranf() < P.VaccProp) + State.mvacc_queue[queueIndex++] = i; + } + } + int vaccineCount = queueIndex; + for (int i = 0; i < P.PopSize; i++) + { + if ((HOST_AGE_YEAR(i) < P.VaccPriorityGroupAge[0]) || (HOST_AGE_YEAR(i) > P.VaccPriorityGroupAge[1])) + { + if (ranf() < P.VaccProp) + State.mvacc_queue[queueIndex++] = i; + } + } + State.n_mvacc = queueIndex; + fprintf(stderr, "Number to be vaccinated=%i\n", State.n_mvacc); + for (int i = 0; i < 2; i++) + { + for (int j = 0; j < vaccineCount; j++) + { + l = (int)(ranf() * ((double)vaccineCount)); + m = State.mvacc_queue[j]; + State.mvacc_queue[j] = State.mvacc_queue[l]; + State.mvacc_queue[l] = m; + } + for (int j = vaccineCount; j < State.n_mvacc; j++) + { + l = vaccineCount + ((int)(ranf() * ((double)(State.n_mvacc - vaccineCount)))); + m = State.mvacc_queue[j]; + State.mvacc_queue[j] = State.mvacc_queue[l]; + State.mvacc_queue[l] = m; + } + } + fprintf(stderr, "Configured mass vaccination queue.\n"); } + PeakHeightSum = PeakHeightSS = PeakTimeSum = PeakTimeSS = 0; + int i = (P.ncw / 2) * P.nch + P.nch / 2; + int j = (P.ncw / 2 + 2) * P.nch + P.nch / 2; + fprintf(stderr, "UTM dist horiz=%lg %lg\n", sqrt(dist2_cc(Cells + i, Cells + j)), sqrt(dist2_cc(Cells + j, Cells + i))); + j = (P.ncw / 2) * P.nch + P.nch / 2 + 2; + fprintf(stderr, "UTM dist vert=%lg %lg\n", sqrt(dist2_cc(Cells + i, Cells + j)), sqrt(dist2_cc(Cells + j, Cells + i))); + j = (P.ncw / 2 + 2) * P.nch + P.nch / 2 + 2; + fprintf(stderr, "UTM dist diag=%lg %lg\n", sqrt(dist2_cc(Cells + i, Cells + j)), sqrt(dist2_cc(Cells + j, Cells + i))); + + //if(P.OutputBitmap) + //{ + // CaptureBitmap(); + // OutputBitmap(0); + //} + fprintf(stderr, "Model configuration complete.\n"); +} + +void ResetTimeSeries() +{ + TSMean = TSMeanE; TSVar = TSVarE; + ///// This loops over index l twice just to reset the pointer TSMean from TSMeanE to TSMeanNE (same for TSVar). + int num_in_results = sizeof(Results) / sizeof(double); + for (int l = 0; l < 2; l++) + { + for (int i = 0; i < P.NumSamples; i++) + { + double* ts_mean = (double*)&TSMean[i]; + double* ts_var = (double*)&TSVar[i]; + for (int j = 0; j < num_in_results; j++) ts_mean[j] = ts_var[j] = 0.0; + } + TSMean = TSMeanNE; TSVar = TSVarNE; + } + +} + +int ReadFitIter(std::string const& FitFile) +{ + FILE* dat; + int i,n,cl_index[100]; + double cl,cl2; + + std::string fit_file_iter = FitFile + ".f" + std::to_string(P.FitIter) + ".txt"; + P.clP[99] = -1; // CLP #99 reserved for fitting overdispersion in likelihood. + do + { + cl = ((double) clock()) / CLOCKS_PER_SEC; + do + { + cl2 = ((double)clock()) / CLOCKS_PER_SEC; + } + while ((cl2 > cl) && (cl2 < cl + 1.0)); + } while (!(dat = fopen(fit_file_iter.c_str(), "r"))); + fscanf(dat, "%i %i", &i, &n); + if (n <= 0) + fprintf(stderr, "Stop code read from file (iteration number <=0)\n"); + else if (i != P.FitIter) + fprintf(stderr, "Warning: iteration number %i in %s does not match file name iteration %i\n", i, fit_file_iter.c_str(), P.FitIter); + if (n > 0) + { + for (i = 0; i < n; i++) fscanf(dat, "%i", &(cl_index[i])); + for (i = 0; i < n; i++) fscanf(dat, "%lg", &P.clP[cl_index[i]]); + } + fclose(dat); + return (n > 0) ? 0 : 1; +} + +void InitTransmissionCoeffs(void) +{ + double d, t, t2, t3, s, s2, s3, q; + int l, m; + t = s = t2 = 0; for (int i = 0; i < MAX_HOUSEHOLD_SIZE; i++) { t += ((double)(i + 1)) * (P.HouseholdSizeDistrib[0][i] - t2); t2 = P.HouseholdSizeDistrib[0][i]; } + fprintf(stderr, "Household mean size=%lg\n", t); t2 = s = 0; s3 = 1.0; - -#pragma omp parallel for private(s2,q,l,d,m) schedule(static,1) reduction(+:s,t2) default(none) \ - shared(P, Households, Hosts) + double shd = 0.0; +#pragma omp parallel for private(s2,q,l,d,m) schedule(static,1) reduction(+:s,t2,shd) default(none) shared(P, Households, Hosts) for (int tn = 0; tn < P.NumThreads; tn++) { for (int i = tn; i < P.PopSize; i += P.NumThreads) @@ -501,21 +642,29 @@ void SetupModel(std::string const& density_file, std::string const& out_density_ if (P.SusceptibilitySD == 0) Hosts[i].susc = (float)((P.DoPartialImmunity) ? (1.0 - P.InitialImmunity[HOST_AGE_GROUP(i)]) : 1.0); else - Hosts[i].susc = (float) (((P.DoPartialImmunity) ? (1.0 - P.InitialImmunity[HOST_AGE_GROUP(i)]) : 1.0) * gen_gamma_mt(1 / (P.SusceptibilitySD * P.SusceptibilitySD), 1 / (P.SusceptibilitySD * P.SusceptibilitySD), tn)); + Hosts[i].susc = (float)(((P.DoPartialImmunity) ? (1.0 - P.InitialImmunity[HOST_AGE_GROUP(i)]) : 1.0) * gen_gamma_mt(1 / (P.SusceptibilitySD * P.SusceptibilitySD), 1 / (P.SusceptibilitySD * P.SusceptibilitySD), tn)); if (P.InfectiousnessSD == 0) Hosts[i].infectiousness = (float)P.AgeInfectiousness[HOST_AGE_GROUP(i)]; else Hosts[i].infectiousness = (float)(P.AgeInfectiousness[HOST_AGE_GROUP(i)] * gen_gamma_mt(1 / (P.InfectiousnessSD * P.InfectiousnessSD), 1 / (P.InfectiousnessSD * P.InfectiousnessSD), tn)); q = P.ProportionSymptomatic[HOST_AGE_GROUP(i)]; if (ranf_mt(tn) < q) - Hosts[i].infectiousness = (float)(-P.SymptInfectiousness * Hosts[i].infectiousness); + Hosts[i].infectiousness *= (float)(-P.SymptInfectiousness); + else + Hosts[i].infectiousness *= (float)P.AsymptInfectiousness; int j = (int)floor((q = ranf_mt(tn) * CDF_RES)); q -= ((double)j); Hosts[i].recovery_or_death_time = (unsigned short int) floor(0.5 - (P.InfectiousPeriod * log(q * P.infectious_icdf[j + 1] + (1.0 - q) * P.infectious_icdf[j]) / P.TimeStep)); if (P.DoHouseholds) { - s2 = P.TimeStep * P.HouseholdTrans * fabs(Hosts[i].infectiousness) * P.HouseholdDenomLookup[Households[Hosts[i].hh].nhr - 1]; + if (P.NoInfectiousnessSDinHH) + s2 = ((Hosts[i].infectiousness < 0) ? P.SymptInfectiousness : P.AsymptInfectiousness); + else + s2 = fabs(Hosts[i].infectiousness); + // Care home residents less likely to infect via "household" contacts. + if (Hosts[i].care_home_resident) s2 *= P.CareHomeResidentHouseholdScaling; + s2 *= P.TimeStep * P.HouseholdTrans * P.HouseholdDenomLookup[Households[Hosts[i].hh].nhr - 1]; d = 1.0; l = (int)Hosts[i].recovery_or_death_time; for (int k = 0; k < l; k++) { double y = 1.0 - s2 * P.infectiousness[k]; @@ -523,12 +672,14 @@ void SetupModel(std::string const& density_file, std::string const& out_density_ } l = Households[Hosts[i].hh].FirstPerson; m = l + Households[Hosts[i].hh].nh; - for (int k = l; k < m; k++) if ((Hosts[k].inf == InfStat_Susceptible) && (k != i)) s += (1 - d) * P.AgeSusceptibility[HOST_AGE_GROUP(i)]; + for (int k = l; k < m; k++) if ((Hosts[k].inf == InfStat_Susceptible) && (k != i)) s += (1 - d) * P.AgeSusceptibility[HOST_AGE_GROUP(i)] * ((Hosts[k].care_home_resident) ? P.CareHomeResidentHouseholdScaling : 1.0); + shd += (double)(Households[Hosts[i].hh].nhr - 1); } q = (P.LatentToSymptDelay > Hosts[i].recovery_or_death_time * P.TimeStep) ? Hosts[i].recovery_or_death_time * P.TimeStep : P.LatentToSymptDelay; - s2 = fabs(Hosts[i].infectiousness) * P.RelativeSpatialContact[HOST_AGE_GROUP(i)] * P.TimeStep; + // Care home residents less likely to infect via "spatial" contacts. This doesn't correct for non care home residents being less likely to infect care home residents, + // but since the latter are a small proportion of the population, this is a minor issue + s2 = fabs(Hosts[i].infectiousness) * P.RelativeSpatialContact[HOST_AGE_GROUP(i)] * ((Hosts[i].care_home_resident) ? P.CareHomeResidentSpatialScaling : 1.0) * P.TimeStep; l = (int)(q / P.TimeStep); - int k; for (k = 0; k < l; k++) t2 += s2 * P.infectiousness[k]; s2 *= ((Hosts[i].infectiousness < 0) ? P.SymptSpatialContactRate : 1); @@ -537,15 +688,16 @@ void SetupModel(std::string const& density_file, std::string const& out_density_ } } t2 *= (s3 / ((double)P.PopSize)); + fprintf(stderr, "Household SAR=%lg\n", s / shd); s /= ((double)P.PopSize); - fprintf(stderr, "Household mean size=%lg\nHousehold R0=%lg\n", t, P.R0household = s); + fprintf(stderr, "Household R0=%lg\n", P.R0household = s); t = 0; if (P.DoPlaces) for (int j = 0; j < P.PlaceTypeNum; j++) if (j != P.HotelPlaceType) { -#pragma omp parallel for private(d,q,s2,s3,t3,l,m) schedule(static,1000) reduction(+:t) default(none) \ - shared(P, Hosts, Places, j) + double tpl = t; +#pragma omp parallel for private(d,q,s2,s3,t3,l,m) schedule(static,1000) reduction(+:t) default(none) shared(P, Hosts, Places, j) for (int i = 0; i < P.PopSize; i++) { int k = Hosts[i].PlaceLinks[j]; @@ -554,13 +706,14 @@ void SetupModel(std::string const& density_file, std::string const& out_density_ q = (P.LatentToSymptDelay > Hosts[i].recovery_or_death_time * P.TimeStep) ? Hosts[i].recovery_or_death_time * P.TimeStep : P.LatentToSymptDelay; s2 = fabs(Hosts[i].infectiousness) * P.TimeStep * P.PlaceTypeTrans[j]; double x = s2 / P.PlaceTypeGroupSizeParam1[j]; - d = 1.0; l = (int)(q / P.TimeStep); + d = 1.0; + l = (int)(q / P.TimeStep); for (m = 0; m < l; m++) { double y = 1.0 - x * P.infectiousness[m]; d *= ((y < 0) ? 0 : y); } s3 = ((double)(Places[j][k].group_size[Hosts[i].PlaceGroupLinks[j]] - 1)); - x *= ((Hosts[i].infectiousness < 0) ? (P.SymptPlaceTypeContactRate[j] * (1 - P.SymptPlaceTypeWithdrawalProp[j])) : 1); + x *= (((Hosts[i].infectiousness < 0) && (!Hosts[i].care_home_resident)) ? (P.SymptPlaceTypeContactRate[j] * (1 - P.SymptPlaceTypeWithdrawalProp[j])) : 1); l = (int)Hosts[i].recovery_or_death_time; for (; m < l; m++) { double y = 1.0 - x * P.infectiousness[m]; @@ -569,12 +722,16 @@ void SetupModel(std::string const& density_file, std::string const& out_density_ t3 = d; x = P.PlaceTypePropBetweenGroupLinks[j] * s2 / ((double)Places[j][k].n); - d = 1.0; l = (int)(q / P.TimeStep); + // use group structure to model multiple care homes with shared staff - in which case residents of one "group" don't mix with those in another, only staff do. + // calculation uses average proportion of care home "members" who are residents. + if (Hosts[i].care_home_resident) x *= (1.0 - P.CareHomePropResidents) + P.CareHomePropResidents * (P.CareHomeWorkerGroupScaling * (((double)Places[j][k].n - 1) - s3) + s3) / ((double)Places[j][k].n - 1); + d = 1.0; + l = (int)(q / P.TimeStep); for (m = 0; m < l; m++) { double y = 1.0 - x * P.infectiousness[m]; d *= ((y < 0) ? 0 : y); } - x *= ((Hosts[i].infectiousness < 0) ? (P.SymptPlaceTypeContactRate[j] * (1 - P.SymptPlaceTypeWithdrawalProp[j])) : 1); + x *= (((Hosts[i].infectiousness < 0) && (!Hosts[i].care_home_resident)) ? (P.SymptPlaceTypeContactRate[j] * (1 - P.SymptPlaceTypeWithdrawalProp[j])) : 1); l = (int)Hosts[i].recovery_or_death_time; for (; m < l; m++) { double y = 1.0 - x * P.infectiousness[m]; @@ -583,123 +740,36 @@ void SetupModel(std::string const& density_file, std::string const& out_density_ t += (1 - t3 * d) * s3 + (1 - d) * (((double)(Places[j][k].n - 1)) - s3); } } - fprintf(stderr, "%lg ", t / ((double)P.PopSize)); + fprintf(stderr, "%lg ", (t-tpl) / ((double)P.PopSize)); } + double recovery_time_days = 0; + double recovery_time_timesteps = 0; +#pragma omp parallel for schedule(static,500) reduction(+:recovery_time_days,recovery_time_timesteps) default(none) shared(P, Hosts) + for (int i = 0; i < P.PopSize; i++) { - double recovery_time_days = 0; - double recovery_time_timesteps = 0; -#pragma omp parallel for schedule(static,500) reduction(+:recovery_time_days,recovery_time_timesteps) default(none) \ - shared(P, Hosts) - for (int i = 0; i < P.PopSize; i++) - { - recovery_time_days += Hosts[i].recovery_or_death_time * P.TimeStep; - recovery_time_timesteps += Hosts[i].recovery_or_death_time; - Hosts[i].recovery_or_death_time = 0; - } - t /= ((double)P.PopSize); - recovery_time_days /= ((double)P.PopSize); - recovery_time_timesteps /= ((double)P.PopSize); - fprintf(stderr, "R0 for places = %lg\nR0 for random spatial = %lg\nOverall R0=%lg\n", P.R0places = t, P.R0spatial = P.R0 - s - t, P.R0); - fprintf(stderr, "Mean infectious period (sampled) = %lg (%lg)\n", recovery_time_days, recovery_time_timesteps); - } - if (P.DoSI) - P.LocalBeta = (P.R0 / t2 - s - t); - else - P.LocalBeta = (P.R0 - s - t) / t2; - if ((P.LocalBeta < 0) || (!P.DoSpatial)) - { - P.LocalBeta = P.R0spatial = 0; - fprintf(stderr, "Reset spatial R0 to 0\n"); - } - fprintf(stderr, "LocalBeta = %lg\n", P.LocalBeta); - TSMean = TSMeanNE; TSVar = TSVarNE; - fprintf(stderr, "Calculated approx cell probabilities\n"); - for (int i = 0; i < INFECT_TYPE_MASK; i++) inftype_av[i] = 0; - for (int i = 0; i < MAX_COUNTRIES; i++) infcountry_av[i] = infcountry_num[i] = 0; - for (int i = 0; i < MAX_SEC_REC; i++) - for (int j = 0; j < MAX_GEN_REC; j++) - indivR0_av[i][j] = 0; - for (int i = 0; i <= MAX_HOUSEHOLD_SIZE; i++) - for (int j = 0; j <= MAX_HOUSEHOLD_SIZE; j++) - inf_household_av[i][j] = case_household_av[i][j] = 0; - DoInitUpdateProbs = 1; - for (int i = 0; i < P.NC; i++) Cells[i].tot_treat = 1; //This makes sure InitModel intialises the cells. - P.NRactE = P.NRactNE = 0; - for (int i = 0; i < P.PopSize; i++) Hosts[i].esocdist_comply = (ranf() < P.EnhancedSocDistProportionCompliant[HOST_AGE_GROUP(i)]) ? 1 : 0; - if (P.EnhancedSocDistClusterByHousehold) - { - for (int i = 0; i < P.NH;i++) - { - l = Households[i].FirstPerson; - m = l + Households[i].nh; - int i2 = 0; - for (int k = l; k < m; k++) if (Hosts[k].esocdist_comply) i2=1; - if (i2) - for (int k = l; k < m; k++) Hosts[k].esocdist_comply = 1; - } + recovery_time_days += Hosts[i].recovery_or_death_time * P.TimeStep; + recovery_time_timesteps += Hosts[i].recovery_or_death_time; + Hosts[i].recovery_or_death_time = 0; } - if (P.OutputBitmap) + t /= ((double)P.PopSize); + recovery_time_days /= ((double)P.PopSize); + recovery_time_timesteps /= ((double)P.PopSize); + fprintf(stderr, "\nR0 for places = %lg\n", P.R0places = t); + if (!P.FixLocalBeta) { - InitBMHead(out_file_base); - } - if (P.DoMassVacc) - { - State.mvacc_queue = (int*)Memory::xcalloc(P.PopSize, sizeof(int)); - int queueIndex = 0; - for (int i = 0; i < P.PopSize; i++) - { - if ((HOST_AGE_YEAR(i) >= P.VaccPriorityGroupAge[0]) && (HOST_AGE_YEAR(i) <= P.VaccPriorityGroupAge[1])) - { - if (ranf() < P.VaccProp) - State.mvacc_queue[queueIndex++] = i; - } - } - int vaccineCount = queueIndex; - for (int i = 0; i < P.PopSize; i++) - { - if ((HOST_AGE_YEAR(i) < P.VaccPriorityGroupAge[0]) || (HOST_AGE_YEAR(i) > P.VaccPriorityGroupAge[1])) - { - if (ranf() < P.VaccProp) - State.mvacc_queue[queueIndex++] = i; - } - } - State.n_mvacc = queueIndex; - fprintf(stderr, "Number to be vaccinated=%i\n", State.n_mvacc); - for (int i = 0; i < 2; i++) - { - for (int j = 0; j < vaccineCount; j++) - { - l = (int)(ranf() * ((double)vaccineCount)); - m = State.mvacc_queue[j]; - State.mvacc_queue[j] = State.mvacc_queue[l]; - State.mvacc_queue[l] = m; - } - for (int j = vaccineCount; j < State.n_mvacc; j++) - { - l = vaccineCount + ((int)(ranf() * ((double)(State.n_mvacc - vaccineCount)))); - m = State.mvacc_queue[j]; - State.mvacc_queue[j] = State.mvacc_queue[l]; - State.mvacc_queue[l] = m; - } - } - fprintf(stderr, "Configured mass vaccination queue.\n"); + if (P.DoSI) + P.LocalBeta = (P.R0 / t2 - s - t); + else + P.LocalBeta = (P.R0 - s - t) / t2; + if (P.LocalBeta < 0) P.LocalBeta = 0; + fprintf(stderr, "Set spatial beta to %lg\n", P.LocalBeta); } - PeakHeightSum = PeakHeightSS = PeakTimeSum = PeakTimeSS = 0; - int i = (P.ncw / 2) * P.nch + P.nch / 2; - int j = (P.ncw / 2 + 2) * P.nch + P.nch / 2; - fprintf(stderr, "UTM dist horiz=%lg %lg\n", sqrt(dist2_cc(Cells + i, Cells + j)), sqrt(dist2_cc(Cells + j, Cells + i))); - j = (P.ncw / 2) * P.nch + P.nch / 2 + 2; - fprintf(stderr, "UTM dist vert=%lg %lg\n", sqrt(dist2_cc(Cells + i, Cells + j)), sqrt(dist2_cc(Cells + j, Cells + i))); - j = (P.ncw / 2 + 2) * P.nch + P.nch / 2 + 2; - fprintf(stderr, "UTM dist diag=%lg %lg\n", sqrt(dist2_cc(Cells + i, Cells + j)), sqrt(dist2_cc(Cells + j, Cells + i))); + P.R0spatial = t2 * P.LocalBeta; + P.R0 = P.R0household + P.R0places + P.R0spatial; + fprintf(stderr, "R0 for random spatial = %lg\nOverall R0 = %lg\n", P.R0spatial, P.R0); + fprintf(stderr, "Mean infectious period (sampled) = %lg (%lg)\n", recovery_time_days, recovery_time_timesteps); - //if(P.OutputBitmap) - //{ - // CaptureBitmap(); - // OutputBitmap(0); - //} - fprintf(stderr, "Model configuration complete.\n"); } void SetupPopulation(std::string const& density_file, std::string const& out_density_file, std::string const& school_file, std::string const& reg_demog_file) @@ -1950,17 +2020,21 @@ void AssignPeopleToPlaces() for (int i = 0; i < P.Nplace[tp]; i++) { Places[tp][i].n = 0; - j = (int)gen_lognormal(P.PlaceTypeMeanSize[tp], P.PlaceTypeSizeSD[tp]); + do + { + j = (int)gen_lognormal(P.PlaceTypeMeanSize[tp], P.PlaceTypeSizeSD[tp]); + } + while (jP.PlaceTypeSizeMax[tp]); if (j > USHRT_MAX - 1) j = USHRT_MAX - 1; m += (int)(Places[tp][i].treat_end_time = (unsigned short)j); } } else { - s = pow(P.PlaceTypeSizeOffset[tp] / (P.PlaceTypeSizeOffset[tp] + P.PlaceTypeSizeMax[tp] - 1), P.PlaceTypeSizePower[tp]); + s = pow(P.PlaceTypeSizeOffset[tp] / (P.PlaceTypeSizeOffset[tp] + P.PlaceTypeSizeMax[tp] - P.PlaceTypeSizeMin[tp]), P.PlaceTypeSizePower[tp]); for (int i = 0; i < P.Nplace[tp]; i++) { - j = (int)floor(P.PlaceTypeSizeOffset[tp] * pow((1 - s) * ranf() + s, -1 / P.PlaceTypeSizePower[tp]) + 1 - P.PlaceTypeSizeOffset[tp]); + j = (int)floor(P.PlaceTypeSizeOffset[tp] * pow((1 - s) * ranf() + s, -1 / P.PlaceTypeSizePower[tp]) + P.PlaceTypeSizeMin[tp] - P.PlaceTypeSizeOffset[tp]); if (j > USHRT_MAX - 1) j = USHRT_MAX - 1; m += (int)(Places[tp][i].treat_end_time = (unsigned short)j); Places[tp][i].n = 0; @@ -2130,7 +2204,7 @@ void AssignPeopleToPlaces() if (mcell_country[ic] == host_country) { auto const& cur_cell = Mcells[ic]; - auto const place_type_count = cur_cell.np[tp]; + auto const place_type_count = cur_cell.np[tp]; for (cnt = 0; cnt < place_type_count; cnt++) { auto const place_idx = cur_cell.places[tp][cnt]; diff --git a/src/SetupModel.h b/src/SetupModel.h index 2ad5f2ee4..7630f5a9d 100644 --- a/src/SetupModel.h +++ b/src/SetupModel.h @@ -3,6 +3,10 @@ #include +int ReadFitIter(std::string const&); +void ResetTimeSeries(void); +void InitTransmissionCoeffs(void); + /** * Initialize and set up model functions before running the simulation. * @@ -47,6 +51,7 @@ void SetupPopulation(std::string const& density_file, std::string const& out_den /** * Initialize airports by assigning them to microcells and mapping to hotels. */ + void SetupAirports(void); /** diff --git a/src/Sweep.cpp b/src/Sweep.cpp index 3d8f27f9a..ee95b3442 100644 --- a/src/Sweep.cpp +++ b/src/Sweep.cpp @@ -529,11 +529,12 @@ void InfectSweep(double t, int run) //added run number as argument in order to r // calculate place susceptbility based on infectee (i3), place type (k), timestep (ts) // cell (ci) and thread number (tn) s = CalcPlaceSusc(i3, k, ts, ci, tn); + + // allow care home residents to mix more intensely in "groups" (i.e. individual homes) than staff do - to allow for PPE/environmental contamination. + if ((k==P.CareHomePlaceType)&&((!Hosts[ci].care_home_resident)||(!Hosts[i3].care_home_resident))) s *= P.CareHomeWorkerGroupScaling; + //these are all place group contacts to be tracked for digital contact tracing - add to StateT queue for contact tracing + //if infectee is also a user, add them as a contact - // ** add potential infectees to digital contact tracing queue** - // if contact tracing in place (fct) AND potential infectee (i3) is a contact tracing user - // AND potential infectee != infectionus person ci - // AND potential infectee (i3) isn't absent if ((fct) && (Hosts[i3].digitalContactTracingUser) && (ci != i3) && (!HOST_ABSENT(i3))) { // scale place susceptibility by proportion who self isolate and store as s6 @@ -554,14 +555,14 @@ void InfectSweep(double t, int run) //added run number as argument in order to r fprintf(stderr_shared, "No more space in queue! Thread: %i, AdUnit: %i\n", tn, ad); } } - }// digital contact tracing queue + } - // if ((Hosts[i3].inf == InfStat_Susceptible) && (!HOST_ABSENT(i3))) //// if person i3 uninfected and not absent. { Microcell* mt = Mcells + Hosts[i3].mcell; //downscale s if it has been scaled up do to digital contact tracing s *= CalcPersonSusc(i3, ts, ci, tn)*s4/s4_scaled; + // if blanket movement restrictions are in place if (bm) { @@ -580,7 +581,7 @@ void InfectSweep(double t, int run) //added run number as argument in order to r s *= P.MoveRestrEffect; } - // if susceptiblity is 1 ie 100% or random number is less than s + // if either susceptiblity is 100% or sample probability s if ((s == 1) || (ranf_mt(tn) < s)) { // select cell containing potential infectee @@ -635,8 +636,10 @@ void InfectSweep(double t, int run) //added run number as argument in order to r int i3 = Places[k][l].members[SamplingQueue[tn][m]]; // calculate place susceptibility s s = CalcPlaceSusc(i3, k, ts, ci, tn); - - // ** Do contact tracing in hotels ** + // use group structure to model multiple care homes with shared staff - in which case residents of one "group" don't mix with those in another, only staff do. + if ((Hosts[ci].care_home_resident) && (Hosts[i3].care_home_resident) && (Hosts[ci].PlaceGroupLinks[k]!= Hosts[i3].PlaceGroupLinks[k])) s *= P.CareHomeResidentPlaceScaling; + // allow care home staff to have lowere contacts in care homes - to allow for PPE/environmental contamination. + if ((k == P.CareHomePlaceType) && ((!Hosts[ci].care_home_resident) || (!Hosts[i3].care_home_resident))) s *= P.CareHomeWorkerGroupScaling; //these are all place group contacts to be tracked for digital contact tracing - add to StateT queue for contact tracing //if infectee is also a user, add them as a contact @@ -882,7 +885,8 @@ void InfectSweep(double t, int run) //added run number as argument in order to r // pick microcell of infectee (mt) Microcell* mt = Mcells + Hosts[i3].mcell; s = CalcSpatialSusc(i3, ts, ci, tn); - + // Care home residents may have fewer contacts + if ((Hosts[i3].care_home_resident) || (Hosts[ci].care_home_resident)) s *= P.CareHomeResidentSpatialScaling; //so this person is a contact - but might not be infected. if we are doing digital contact tracing, we want to add the person to the contacts list, if both are users if (fct) { diff --git a/src/Update.cpp b/src/Update.cpp index c6043a443..cc2f66b6b 100644 --- a/src/Update.cpp +++ b/src/Update.cpp @@ -415,8 +415,10 @@ void DoIncub(int ai, unsigned short int ts, int tn, int run) a->infectiousness *= (float)(-P.SymptInfectiousness); } else + { a->inf = InfStat_InfectiousAsymptomaticNotCase; - + a->infectiousness *= (float) P.AsymptInfectiousness; + } if (!P.DoSeverity || a->inf == InfStat_InfectiousAsymptomaticNotCase) //// if not doing severity or if person asymptomatic. { if (P.DoInfectiousnessProfile) a->recovery_or_death_time = a->latent_time + (unsigned short int) (P.InfectiousPeriod * P.TimeStepsPerDay); @@ -430,11 +432,18 @@ void DoIncub(int ai, unsigned short int ts, int tn, int run) a->Severity_Final = ChooseFinalDiseaseSeverity(age, tn); /// choose outcome recovery or death - if ( ((a->Severity_Final == Severity::Critical) && (ranf_mt(tn) < P.CFR_Critical_ByAge [age])) || - ((a->Severity_Final == Severity::SARI ) && (ranf_mt(tn) < P.CFR_SARI_ByAge [age])) || - ((a->Severity_Final == Severity::ILI ) && (ranf_mt(tn) < P.CFR_ILI_ByAge [age])) ) + if (((a->Severity_Final == Severity::Critical) && (ranf_mt(tn) < P.CFR_Critical_ByAge[age])) || + ((a->Severity_Final == Severity::SARI) && (ranf_mt(tn) < P.CFR_SARI_ByAge[age])) || + ((a->Severity_Final == Severity::ILI) && (ranf_mt(tn) < P.CFR_ILI_ByAge[age]))) a->to_die = 1; - + if ((a->care_home_resident) && ((a->Severity_Final == Severity::Critical) || (a->Severity_Final == Severity::SARI))&&(ranf_mt(tn)>P.CareHomeRelProbHosp)) + { + // care home residents who weren't hospitalised but would otherwise have needed critical care will all die + //if (a->Severity_Final == Severity_Critical) a->to_die = 1; + a->to_die = 1; + // change final severity to ILI (meaning not hospitalised), but leave to_die flag + a->Severity_Final = Severity::ILI; + } //// choose events and event times if (a->Severity_Final == Severity::Mild) { @@ -445,7 +454,7 @@ void DoIncub(int ai, unsigned short int ts, int tn, int run) a->SARI_time = CaseTime + P.ILIToSARI_icdf.choose(P.Mean_ILIToSARI[age], tn, P.TimeStepsPerDay); a->Critical_time = a->SARI_time + P.SARIToCritical_icdf.choose(P.Mean_SARIToCritical[age], tn, P.TimeStepsPerDay); if (a->to_die) - a->recovery_or_death_time = a->Critical_time + P.CriticalToDeath_icdf.choose(P.Mean_CriticalToDeath[age], tn, P.TimeStepsPerDay); + a->recovery_or_death_time = a->Critical_time + P.CriticalToDeath_icdf.choose(P.Mean_CriticalToDeath[age], tn, P.TimeStepsPerDay); else { a->RecoveringFromCritical_time = a->Critical_time + P.CriticalToCritRecov_icdf.choose(P.Mean_CriticalToCritRecov[age], tn, P.TimeStepsPerDay); @@ -527,7 +536,7 @@ void DoDetectedCase(int ai, double t, unsigned short int ts, int tn) { if (Mcells[Places[j][a->PlaceLinks[j]].mcell].place_trig < USHRT_MAX - 1) { -#pragma omp critical (place_trig) +#pragma omp atomic Mcells[Places[j][a->PlaceLinks[j]].mcell].place_trig++; } } @@ -787,7 +796,7 @@ void DoCase(int ai, double t, unsigned short int ts, int tn) //// makes an infec for (j = 0; j < P.PlaceTypeNum; j++) if ((a->PlaceLinks[j] >= 0) && (j != P.HotelPlaceType) && (!HOST_ABSENT(ai)) && (P.SymptPlaceTypeWithdrawalProp[j] > 0)) { - if ((P.SymptPlaceTypeWithdrawalProp[j] == 1) || (ranf_mt(tn) < P.SymptPlaceTypeWithdrawalProp[j])) + if ((!Hosts[ai].care_home_resident) && ((P.SymptPlaceTypeWithdrawalProp[j] == 1) || (ranf_mt(tn) < P.SymptPlaceTypeWithdrawalProp[j]))) { a->absent_start_time = ts + P.usCaseAbsenteeismDelay; a->absent_stop_time = ts + P.usCaseAbsenteeismDelay + P.usCaseAbsenteeismDuration; @@ -867,7 +876,7 @@ void DoFalseCase(int ai, double t, unsigned short int ts, int tn) /* Arguably adult absenteeism to take care of sick kids could be included here, but then output absenteeism would not be 'excess' absenteeism */ if ((P.ControlPropCasesId == 1) || (ranf_mt(tn) < P.ControlPropCasesId)) { - if ((!P.DoEarlyCaseDiagnosis) || (State.cumDC >= P.CaseOrDeathThresholdBeforeAlert)) StateT[tn].cumDC++; + if (State.cumDC >= P.CaseOrDeathThresholdBeforeAlert) StateT[tn].cumDC++; DoDetectedCase(ai, t, ts, tn); } StateT[tn].cumFC++; @@ -1008,7 +1017,7 @@ void DoProph(int ai, unsigned short int ts, int tn) StateT[tn].cumT_keyworker[Hosts[ai].keyworker]++; if ((++Hosts[ai].num_treats) < 2) StateT[tn].cumUT++; if (P.DoAdUnits) StateT[tn].cumT_adunit[Mcells[Hosts[ai].mcell].adunit]++; -#pragma omp critical (tot_treat) +#pragma omp atomic Cells[Hosts[ai].pcell].tot_treat++; if (P.OutputBitmap) { @@ -1036,7 +1045,7 @@ void DoProphNoDelay(int ai, unsigned short int ts, int tn, int nc) StateT[tn].cumT_keyworker[Hosts[ai].keyworker] += nc; if ((++Hosts[ai].num_treats) < 2) StateT[tn].cumUT++; if (P.DoAdUnits) StateT[tn].cumT_adunit[Mcells[Hosts[ai].mcell].adunit] += nc; -#pragma omp critical (tot_treat) +#pragma omp atomic Cells[Hosts[ai].pcell].tot_treat++; if (P.OutputBitmap) { @@ -1257,10 +1266,10 @@ void DoVacc(int ai, unsigned short int ts) if ((HOST_TO_BE_VACCED(ai)) || (Hosts[ai].inf < InfStat_InfectiousAlmostSymptomatic) || (Hosts[ai].inf >= InfStat_Dead_WasAsymp)) return; -#pragma omp critical (state_cumV) if (State.cumV < P.VaccMaxCourses) { cumV_OK = true; +#pragma omp atomic State.cumV++; } if (cumV_OK) @@ -1269,10 +1278,10 @@ void DoVacc(int ai, unsigned short int ts) if (P.VaccDosePerDay >= 0) { -#pragma omp critical (state_cumV_daily) +#pragma omp atomic State.cumV_daily++; } -#pragma omp critical (tot_vacc) +#pragma omp atomic Cells[Hosts[ai].pcell].tot_vacc++; if (P.OutputBitmap) { @@ -1296,10 +1305,10 @@ void DoVaccNoDelay(int ai, unsigned short int ts) if ((HOST_TO_BE_VACCED(ai)) || (Hosts[ai].inf < InfStat_InfectiousAlmostSymptomatic) || (Hosts[ai].inf >= InfStat_Dead_WasAsymp)) return; -#pragma omp critical (state_cumVG) if (State.cumVG < P.VaccMaxCourses) { cumVG_OK = true; +#pragma omp atomic State.cumVG++; } if (cumVG_OK) @@ -1307,10 +1316,10 @@ void DoVaccNoDelay(int ai, unsigned short int ts) Hosts[ai].vacc_start_time = ts; if (P.VaccDosePerDay >= 0) { -#pragma omp critical (state_cumV_daily) +#pragma omp atomic State.cumVG_daily++; } -#pragma omp critical (tot_vacc) +#pragma omp atomic Cells[Hosts[ai].pcell].tot_vacc++; if (P.OutputBitmap) { diff --git a/tests/uk-input/results-j1.cksum b/tests/uk-input/results-j1.cksum index 5f9edd9c1..c9705d9bc 100644 --- a/tests/uk-input/results-j1.cksum +++ b/tests/uk-input/results-j1.cksum @@ -1,93 +1,60 @@ results-int.00000.bmp a2bcacff67edd59711f7948a496167bbc6c11e73e923138af4133e2d2401b50142c85014889aba52b8aa19107d85afb81ccb0f25fea8cce5491060aeae81e056 -results-int.00100.bmp 1477d7e220515c9fe3f5295ae9ad89f27d6d62b1272bd948a6d2cfe6d96438cb010bc53dc412fcabaa1e228472d2a666d5b66a92e0170801c75242eea8348fe1 -results-int.00200.bmp e84630b773cf63d4f9ed0db3ec0ed12ab3d280907c8504f5e011a53048e42e38522b0ce04d669f5ddb6e4b6e8bc3add8f989a2f56f237684b568870514a89ae5 -results-int.00300.bmp dc219a84aa81806fad3ed1cc4dda07f60e0c168bb38667648fb2c43d974ad01dda79f10786213e46f83a57631844e083312e123fd0bc0bcf5351d04664558025 -results-int.00400.bmp f83bd6f7e80e0694cfdde76afb1f6493dccc012adfa3fe108697c46bffb063ac842bbd4245647c98f1f4a0fae01f8329c2197316573231dbd438136a3698d28e -results-int.00500.bmp 25a9b3a0e8c077c4c5c81d2336f609bfec5bd1585f066d316861728ddd0f734c54e013ed4f7ae1df5ee943670cc4c9e52b9eba0753b52bdaa70e227be3384413 -results-int.00600.bmp 96c872673cd19004a6ad0f05c1d0b8166c4f968ac6724e22c3c29ab9098e15815d85e8b64c830299534f94383d633d176a64991dc35a6351399136c7eb658d08 -results-int.00700.bmp 13bb7b7c3e458598b4bbfcc2bd39575baa3d42257b2e1732b99544a59e2d58d0e4b2f36cf0819fbd14a5ede40a707da52c14f05849cf58ba6b7b216997ad9ba1 -results-int.00800.bmp 99cf71b4e3002527b88994fe5c95b646384b268cb2e3c14fc97338ed2b5a86cc52dfe36645957ebdbbd056e34b84a0ed51286ff8367dda0d247b1a959b0277d6 -results-int.00900.bmp 97b4c1d2a10a393b7b2bca9223ce295c952f15c9731132ee3d3c5cf5a3f972e552dd169d33224e1091b42780a87b075dbc1f846aad74f3eb316bd34235acceb7 -results-int.01000.bmp 0af7d12d007211a165c0f86475015d9c4e2e17b3392987f02843f5aa9de6700378d852567586355aaa2df73eb602cbc2a4d0a02016e70a816fc4b0e0ac17bace -results-int.01100.bmp a47bcc8dd2122215ea9240dd670c97236d75a6286ef64c8ad335da109047845f448a12bd17c244e0ce924688363d46d2350af62faa056d6656f516ee142437e8 -results-int.01200.bmp 23d36beb63392cf2dee49ccdaaa2e1ef0c31072fcc501f682b21f3e73dafb690b1441bb5b611ce5bdde4634292db1f8b3d4a247ee9ff7ccd4dddf2ddf4c6decc -results-int.01300.bmp 3d3b8f4f581ded2668777a798827b05e7825cbe37455bec954c5e88c13b6a2fe642e0777f2cb2b70f8f904640cbcbfe89dac04f25984fa40d2314cf6d71ea500 -results-int.01400.bmp 3d2bc9adb069ffc283841360394878ddb58df733f833dd296238278830ae8e4240ee301a0feddb955ac909cab3453cf1200c87a68e9a519f36cd9c74317271da -results-int.01500.bmp c075febf67ca0f3e3ef3d9179b8cbc3d9c276d479895aa0aebb4110b7e87e28fce3151e85280a3fb9a16f32ecac2ccf4985fd65bb12c98e6d51fc87f85370ea2 -results-int.01600.bmp eac8e409250bfdb4e0b330db829d7c6a2c21e17104459b21f2865a98ae7e0b7ed417d5d9fbee45e10c6dc46113812a40d9dcd5c3192d8d428254c37abaabd0d7 -results-int.01700.bmp be8756698fa29e48c57f8dbbee8593526e9dd46e0b91c8e24bc5f836fac825b0a5928b24787a4406f7272e4033b20aea8f9157009520fc17e24b6966116b6bc8 -results-int.01800.bmp bc988e06e4156172c47afde9c1e8340968dfcc7e25d4d453701933222603a32b967fc2c6edd77ec4d02598553933d0395850d4704865c83cf537e8c0c530974b -results-int.01900.bmp bc988e06e4156172c47afde9c1e8340968dfcc7e25d4d453701933222603a32b967fc2c6edd77ec4d02598553933d0395850d4704865c83cf537e8c0c530974b -results-int.02000.bmp bc988e06e4156172c47afde9c1e8340968dfcc7e25d4d453701933222603a32b967fc2c6edd77ec4d02598553933d0395850d4704865c83cf537e8c0c530974b -results-int.02100.bmp bc988e06e4156172c47afde9c1e8340968dfcc7e25d4d453701933222603a32b967fc2c6edd77ec4d02598553933d0395850d4704865c83cf537e8c0c530974b -results-int.02200.bmp bc988e06e4156172c47afde9c1e8340968dfcc7e25d4d453701933222603a32b967fc2c6edd77ec4d02598553933d0395850d4704865c83cf537e8c0c530974b -results-int.avNE.age.xls 5e2b951120cddfd458bdd030b33ecc8e99ceedce9c80b12c04f3147202ab70d2779cc06794cec788868ecb33371e62be08f0aff3ef8b37659e748b6d38b16115 -results-int.avNE.severity.adunit.xls d322225f9c7c36a314e9ea9558c2cfd6b838a5f5e2686f158de2b7619641a80c6efc0629df4b0f8e3f5e2054f54883d10e9d0007fad521b3c4a34f597d6d5247 -results-int.avNE.severity.age.xls d9f635d793e958bc42596ecfc862811760c0283ef72316db3fd9ea9c2195140ed5baa13839d067480d6e577761329b5c28ad5536d1300cb3155851839caa810e -results-int.avNE.severity.xls a1167807c84e584be24e7068d75ea057800be5f6d9d4f8e5b7d65aac68047d7093a14895e2b1508048b6a50e20267b3e358582baba94b2911fb31154f2a6992f +results-int.00100.bmp 53b02dcb8bdad957fb26c1d94c1916425204f34ded76066483827ed08055b625174c0d7b5d43eb65c268f7cf9130d556dbb91a9d722d06dfe5d0e773f5a3a4b4 +results-int.00200.bmp 100f83f69ce62d594a2455c8ec30ee6abdf6fa2ee7a0d76a7d1de0fb4fc89f9bf2fd1d8fb359dff5697b67534cb65ff5151a66f233433c128898e686c3fab618 +results-int.00300.bmp 4ce3b0bf00bb56bc0d8f816c836510165b565a244082713866c2ac962ab1cb7ae5b91b49400bd0456ea41a4d852dc79c072ce1da80c80ca70402e547d3c6a65b +results-int.00400.bmp 7a3e44543db8fd32cbf85de8045d52f5e37f33e2c6ffedac32cf968d49856de2e7c9fee989c6468717b40764dbb9644d0965eaf473a652d4034218d347dd9414 +results-int.00500.bmp 5c4f3065f490238665179c5bd9c46ced6eefbd9a3143a49d97fb33f8ea89141459d8d1533af722c06a6be66bbe979f98f8aa09dda4856f235ffd9c83256bc6b1 +results-int.00600.bmp d7144691b7362227509a229ea9c89018f15409c881694ed336ffea9f1ff1f52964c8424f62fca47df3bd138f77beb841d57079b0964707b62e637bfe8981954a +results-int.00700.bmp 2a635b9e9d9eefe815c32066c1b26f46ade25453521b06b5a598e9732c14d184296a2480b5b4bf061d9a85b3417bf5afbf29d50bdf3d5247deec2f1bca740e17 +results-int.00800.bmp 1cf0316f852b21e6c2ca2a4aed679c5a7eba3dbc80094b001570201389b76474da0f3ba879efdcf9550f852dce588cbc40dcbed27e8305ff2c9b0d1a5666f4f9 +results-int.00900.bmp 322c160ef6347a17060e054acce9c47816d1f20ed7b4b2d1c5a90f32a4bb9c15989987d24153c38a47faa585ffb738fae69f00c1c0039dcf1c4507c1c855d45e +results-int.01000.bmp 322c160ef6347a17060e054acce9c47816d1f20ed7b4b2d1c5a90f32a4bb9c15989987d24153c38a47faa585ffb738fae69f00c1c0039dcf1c4507c1c855d45e +results-int.01100.bmp 322c160ef6347a17060e054acce9c47816d1f20ed7b4b2d1c5a90f32a4bb9c15989987d24153c38a47faa585ffb738fae69f00c1c0039dcf1c4507c1c855d45e +results-int.01200.bmp 322c160ef6347a17060e054acce9c47816d1f20ed7b4b2d1c5a90f32a4bb9c15989987d24153c38a47faa585ffb738fae69f00c1c0039dcf1c4507c1c855d45e +results-int.01300.bmp 322c160ef6347a17060e054acce9c47816d1f20ed7b4b2d1c5a90f32a4bb9c15989987d24153c38a47faa585ffb738fae69f00c1c0039dcf1c4507c1c855d45e +results-int.avNE.age.xls b3fbd0016aafa732ba0c4a8b600a330fc47799f3611338f215bd4e57f6442ba7e9d8241756cc6ba5f0ff475587f3d9c7d26978f08ad1242b62a2e7cb394d91c4 +results-int.avNE.severity.adunit.xls e5dadb0a10798da102926a6b1be933ffc0a060bbdc2e72ec2ba394b2b2917f438f1ed6c2c5a901756fe91c2e935cef618b8026d538ba18a1a5dbdf8a5a4a7a46 +results-int.avNE.severity.age.xls 6a7716834ea5bfb7817562e2f9d7ac980170bd84812376bb4a926bae297d2300d3e10e1bf5b95be0e34c84541cfba0fdb0da4a05ecb6d260aa0481f609d0162b +results-int.avNE.severity.xls b891735fca261b1dab57a953dd2c8c860d586cfc27dfe1d36775eb849ef678813b839c4ff6ecb2f32bcdd06204a43fd565944f37193d2d487f097953a5a75b8d results-noint-repeat.00000.bmp a2bcacff67edd59711f7948a496167bbc6c11e73e923138af4133e2d2401b50142c85014889aba52b8aa19107d85afb81ccb0f25fea8cce5491060aeae81e056 -results-noint-repeat.00100.bmp 1477d7e220515c9fe3f5295ae9ad89f27d6d62b1272bd948a6d2cfe6d96438cb010bc53dc412fcabaa1e228472d2a666d5b66a92e0170801c75242eea8348fe1 -results-noint-repeat.00200.bmp 0781ba1ee7133bbdbf2617cfcb10847be7f54095e80449f281bbd125e73b14b90299f9239e5e660666b77528efec362d1eeb3eb28cb57c2bb58a705bc212b453 -results-noint-repeat.00300.bmp 364deaaa65be6f9769966b8e762b59da660a2968a128e8dd8974faf1accb53e3b8994d7f6bddc0f8406081824d126700519a8db2fc014f5eabdc67f06e9b50b2 -results-noint-repeat.00400.bmp cc28dc00d0ac06b2eff69adc4038779c8541d8bdb2d86c12e731eec285778a23972adbb894010edd1c04d478de9525e42bc3ad5d34ec1c7858dcd92940416e55 -results-noint-repeat.00500.bmp f175d285db544c11c48645aea37ad33d32856f2c597a01faddf826f8397a0a31dc4a76bbd8eb4541a2b15c9a70e84b7210d2a7a8edd8cf46879f27e551a1597d -results-noint-repeat.00600.bmp 1342ed13f29c8cfae11668184d26a107371e841d3363dda94e732b280e672fb0bc7a0f5c182852aa21c91ebdf3680bc0f80c676caef3631f7392b7fae0ccc471 -results-noint-repeat.00700.bmp b5460b8b1e6beadf7fc54d097a2f7d55445cf00f3f4b2699c52b02c2705fde7b0ed34946244464a9fc4da84715c17806a5ac01b0bbaa8aee20efe8a3bc2e5c1c -results-noint-repeat.00800.bmp ab91015929a6cb9623dabde03ceb0963aa168e15b2a44b2ff692d33b6001371e7d4fddfe6885dcb2e3c26940e2d68d134205987f6271792b8a48b9f4477ff1ed -results-noint-repeat.00900.bmp a6f4f241fae9a046578451cb6f80daf821a989682ba057bdaebec6923d3225b50a38dbc5a0873af2ddde720992f4473ff320406db23c5ad540c3dd77334f9319 -results-noint-repeat.01000.bmp 52737e4ea22800df3d3ec4c1f8989c8aef371c13222056ae4ebb6c3aef68503619ea0d9c3e5e16a6574944b8e0bd44978d4a87ae875bbd2b25629f72d1bbda09 -results-noint-repeat.01100.bmp 4ba7a875c1623d7af6b0b18eb345dba78da0cf47ca43b5c6a84fd8ba64f461583fdecae98cb40835961ef13dbe875b6565f3f613de3791ad8b19873a0be6b05b -results-noint-repeat.01200.bmp 314fd184018ed2360d3bc016b9d8840c1ea5ba5e128aefba2e4ed999be56503643600e3d631af2a864c75c835024688ebc6ef8766116e83b6463e60534b2b037 -results-noint-repeat.01300.bmp d172179adc81a0a96f2c53c1e32c7b55222e63f60581a9906672711e2835f3c6ff523f0a1230ad09587a0a4cd8020177c50497255aa5fc0ab0fb3b2e78f8171d -results-noint-repeat.01400.bmp aafdcc3dd91bdada3fff2af4f646a91d436179064625d8bac53a907b3a4163882281a531224145cbd2cd81936ae420b45a949cb0ef939fa5f1d990bf08b88f3e -results-noint-repeat.01500.bmp 17a1c79dd284beebf4a1bbe6a237f434c7a70439f64548b1164993f6c0a2f4a52b4807ebd35563c5d3c87ec1c8f49617a7ff4bbbb0c5698cdec8dc17d8cd6ebd -results-noint-repeat.01600.bmp 92c6f57f8d4d81f3fd9ae8a51246541d71e825546eb98d1e252c2630e084cb2427a84cad5233b93bb70c9ed4f44485b8f738d752c9fc1b9b8d2110e0637e90b2 -results-noint-repeat.01700.bmp acf4b2eb67c8205726a77e57803a6799f4c68e4d8369d9d37009fd076f5aa1a1b848491db2f299f2131f9f4ed1a1685f41daae7ccc60bc5e82e06416333ed7e6 -results-noint-repeat.01800.bmp 018628b50223885f6f97c580013eaf96d2721384c02391db44f0bd896b62d61ce90a738a61e48a3948e27f2903421c605736c996fc2d506ec19a9025407dd16a -results-noint-repeat.01900.bmp 1ddf56ccb73cefb1b7705e764924a22b630c5c159c9430447ce2506bd6e3f52603c67728437699eac9378c93839deff2640a8270485c3c568cc04780dfd0a8e9 -results-noint-repeat.02000.bmp 0b1bd8c7fd46f9779fee15df3390fc554784100a841835cef60b543b9cfcbfb6ed52a45249edc52133a6fc225951985c0f8eb049e093f4106bdc752925a69232 -results-noint-repeat.02100.bmp 2d22f7ac34c4fae15d7404209e0715367fd649d260d764a9f3683c35430007c4533ab01c75a1648010dd07f0e11e2d92e35ebbb77f6d3c51de01cf97cb3617fd -results-noint-repeat.02200.bmp 2c584d465c4efd9dec31a2e4e3e1f37836f59cf67a33ea019e9a94d35f70be49497938c53495ff4465011ad7a6baaff13a4a5243e1d78dd1f8a5c94c1b377190 -results-noint-repeat.02300.bmp 8918b0c39b11f0e1c406ca74ba338283e0feff770a1728c20633b51913aa7bb449a8698e05fbc9de315cdfa7013db563a195ec849e474d9fa3f82ae7ff66ec5a -results-noint-repeat.02400.bmp 49296252a9c34762d180e61f199bafa3cc133660dc8b9f0905b7a7c9526ad4b9a6e99ae1ef3c086d4f0adb9ee4225a612c5ab8148d5c0f0a52f3dfb0cc6d7c1b -results-noint-repeat.02500.bmp 9614fd0ea5aad1a7d8801b1369dcf4378de600cfad20fe35f98b28a4109f3559f3941903e21baca1a3b6a7a3e2576362d7fbc6baa35eff8b5fa5c8b8db95aef7 -results-noint-repeat.02600.bmp 9614fd0ea5aad1a7d8801b1369dcf4378de600cfad20fe35f98b28a4109f3559f3941903e21baca1a3b6a7a3e2576362d7fbc6baa35eff8b5fa5c8b8db95aef7 -results-noint-repeat.02700.bmp 9614fd0ea5aad1a7d8801b1369dcf4378de600cfad20fe35f98b28a4109f3559f3941903e21baca1a3b6a7a3e2576362d7fbc6baa35eff8b5fa5c8b8db95aef7 -results-noint-repeat.02800.bmp 9614fd0ea5aad1a7d8801b1369dcf4378de600cfad20fe35f98b28a4109f3559f3941903e21baca1a3b6a7a3e2576362d7fbc6baa35eff8b5fa5c8b8db95aef7 -results-noint-repeat.avNE.age.xls 44ca8f8874f1637a6d7d330685b09a55d9210af024bb656ebc7f2d7cb8ef133fa1c5c439ef64c73b99bcaae1511b6a9cbf1dd1d8f974dd2b4ce5e13401980b80 -results-noint-repeat.avNE.severity.adunit.xls 39db33c7e898a5332c6a0ee3fb547b2eebfc82ef1cabbfef1bea291115223e0877562e381a100cc25bfa6518227f80eb614044cb46293b6f273bbf6cba697880 -results-noint-repeat.avNE.severity.age.xls 4dcdb254fe2a9f713ca9a0bccde5c3c05d4355123387e8774120e0d285775f0a844be3f31e2f5eac8acef7662545742d281bc938aaed71bf3f223dbefa3f7651 -results-noint-repeat.avNE.severity.xls a22600bffbd6a4352654ca9d839637c8e1312b8b1326117638b1be8d405c9ff154a86e57a319a4cbe8ceb643d357b79d51d30272fbe3c08542802551cd7a0c87 +results-noint-repeat.00100.bmp 53b02dcb8bdad957fb26c1d94c1916425204f34ded76066483827ed08055b625174c0d7b5d43eb65c268f7cf9130d556dbb91a9d722d06dfe5d0e773f5a3a4b4 +results-noint-repeat.00200.bmp afb83f01b065edb6eea4a186bbff7d72f46e64cb084f829406b816adf7bee846ed897ef2100e26370e20eb397e5a63f0997de99a148e0a99ec42a6f76c892cf3 +results-noint-repeat.00300.bmp 831232fe639d091dd2cfa99c869f343ccf5ec6eb93ddd2862caa8768a723d337c5b104d9949c688d273a3b1e74da91ba2f265c9d2cec30a73fb4ab4bab56b4ba +results-noint-repeat.00400.bmp dca3bdd0512377b8958fc6a8a0c058629d38aef16d726808b8396bcab9e6423af93e4b6ab1a2b8ab08cf1c2b9d24738261885b89778768de2299230e72d51809 +results-noint-repeat.00500.bmp 78072e960064bcab82135e2ef0b1f94859fd6f16229b91d3504cead2c7f619d14bf77c77d7b8b22f4fe3f9fc6539f11f6a440ecef4b3a9d5330ed7f3cc625492 +results-noint-repeat.00600.bmp f9322a3fbbeebc46d4b18a190b25d77fa44e2751bcfc2d60b080df75ebce218b48e1cb3c73e718218015e89abbfe0e4a155fb3597b8aad6c10f66828f53ddc56 +results-noint-repeat.00700.bmp a85d7d75c38925ab8e4f9fb05c9ac6d3b4fe57349d309bb731354702f919185218050bd80ee4f504584f80f32010ae6b6b2646277ca3594f0b1e1b834a5a6c7a +results-noint-repeat.00800.bmp 6964f076eb368c3572282489ada8e0590f4c570557b33d599274e42c45ba253e3a5c1d4c0e3fc966c4e7698fe7a7a448ee37b1454aae5fe560ea5536d8ae7e9e +results-noint-repeat.00900.bmp 48ce070b59895d7895a06bbd39560502f923c92baaa760fff05258f80d3ca93896d901ec7dcaed03aed365b3d386b82586d7efbc6ed0ebc274c4897022227a4d +results-noint-repeat.01000.bmp c3e285a385bc812113cc221a0aea8bf22310d96974c665087e880363a10e7bd48871fcfae9a82a7ea97d18c0bfd16624a08598c1b731592063b30cf1185f3170 +results-noint-repeat.01100.bmp 78fd8ebac9697f9827dcbf1cfe731787038000132042448c8a69b98388654c13420949fef1b150a3f8841c6b94bbed2556b2da83e125167cc6244d843cf7caca +results-noint-repeat.01200.bmp f651be87af4948e3daf3f0829a58dd275869616a43d0c31f2a6c3cdcaa06f929533dec405c501d001a1652eadc41186f507a0df08a38b5718dee7c95f6586553 +results-noint-repeat.01300.bmp f651be87af4948e3daf3f0829a58dd275869616a43d0c31f2a6c3cdcaa06f929533dec405c501d001a1652eadc41186f507a0df08a38b5718dee7c95f6586553 +results-noint-repeat.01400.bmp f651be87af4948e3daf3f0829a58dd275869616a43d0c31f2a6c3cdcaa06f929533dec405c501d001a1652eadc41186f507a0df08a38b5718dee7c95f6586553 +results-noint-repeat.01500.bmp f651be87af4948e3daf3f0829a58dd275869616a43d0c31f2a6c3cdcaa06f929533dec405c501d001a1652eadc41186f507a0df08a38b5718dee7c95f6586553 +results-noint-repeat.01600.bmp f651be87af4948e3daf3f0829a58dd275869616a43d0c31f2a6c3cdcaa06f929533dec405c501d001a1652eadc41186f507a0df08a38b5718dee7c95f6586553 +results-noint-repeat.avNE.age.xls 18b7437b40ff4ac9aaed42a3645d54366d0292e824273d82385c8d21174601a7a6656bec3fdddbe4a889e795c886f68ae5814d62a5bb7a1e679789a09ac2e556 +results-noint-repeat.avNE.severity.adunit.xls 90c8eb03c9eaa7353a14feaed79589a059c728cf91566527d616f5e0a4bcbe7dcad7492474d3349423ffa9ba9b25f444edc3d95a6b39fd6286cbcb59f7e572a7 +results-noint-repeat.avNE.severity.age.xls bb22d7955f215c0b8cffbd005c9ff8abba02d9c42e783c294f06ccba56cf6fbf58d09e7f7814e7e489e7e83a22e26067a17dd70f781a021421dee5acbf316c8d +results-noint-repeat.avNE.severity.xls 11fc4a376ac032a3da2c2f68db764580f094cf0d843246b409d1e131840827b51f5ac66040b68b39ef7cb82fde5d0494e746cc9b2b65fa5eab660eb4d2f11980 results-noint.00000.bmp a2bcacff67edd59711f7948a496167bbc6c11e73e923138af4133e2d2401b50142c85014889aba52b8aa19107d85afb81ccb0f25fea8cce5491060aeae81e056 -results-noint.00100.bmp 1477d7e220515c9fe3f5295ae9ad89f27d6d62b1272bd948a6d2cfe6d96438cb010bc53dc412fcabaa1e228472d2a666d5b66a92e0170801c75242eea8348fe1 -results-noint.00200.bmp 0781ba1ee7133bbdbf2617cfcb10847be7f54095e80449f281bbd125e73b14b90299f9239e5e660666b77528efec362d1eeb3eb28cb57c2bb58a705bc212b453 -results-noint.00300.bmp 364deaaa65be6f9769966b8e762b59da660a2968a128e8dd8974faf1accb53e3b8994d7f6bddc0f8406081824d126700519a8db2fc014f5eabdc67f06e9b50b2 -results-noint.00400.bmp cc28dc00d0ac06b2eff69adc4038779c8541d8bdb2d86c12e731eec285778a23972adbb894010edd1c04d478de9525e42bc3ad5d34ec1c7858dcd92940416e55 -results-noint.00500.bmp f175d285db544c11c48645aea37ad33d32856f2c597a01faddf826f8397a0a31dc4a76bbd8eb4541a2b15c9a70e84b7210d2a7a8edd8cf46879f27e551a1597d -results-noint.00600.bmp 1342ed13f29c8cfae11668184d26a107371e841d3363dda94e732b280e672fb0bc7a0f5c182852aa21c91ebdf3680bc0f80c676caef3631f7392b7fae0ccc471 -results-noint.00700.bmp b5460b8b1e6beadf7fc54d097a2f7d55445cf00f3f4b2699c52b02c2705fde7b0ed34946244464a9fc4da84715c17806a5ac01b0bbaa8aee20efe8a3bc2e5c1c -results-noint.00800.bmp ab91015929a6cb9623dabde03ceb0963aa168e15b2a44b2ff692d33b6001371e7d4fddfe6885dcb2e3c26940e2d68d134205987f6271792b8a48b9f4477ff1ed -results-noint.00900.bmp a6f4f241fae9a046578451cb6f80daf821a989682ba057bdaebec6923d3225b50a38dbc5a0873af2ddde720992f4473ff320406db23c5ad540c3dd77334f9319 -results-noint.01000.bmp 52737e4ea22800df3d3ec4c1f8989c8aef371c13222056ae4ebb6c3aef68503619ea0d9c3e5e16a6574944b8e0bd44978d4a87ae875bbd2b25629f72d1bbda09 -results-noint.01100.bmp 4ba7a875c1623d7af6b0b18eb345dba78da0cf47ca43b5c6a84fd8ba64f461583fdecae98cb40835961ef13dbe875b6565f3f613de3791ad8b19873a0be6b05b -results-noint.01200.bmp 314fd184018ed2360d3bc016b9d8840c1ea5ba5e128aefba2e4ed999be56503643600e3d631af2a864c75c835024688ebc6ef8766116e83b6463e60534b2b037 -results-noint.01300.bmp d172179adc81a0a96f2c53c1e32c7b55222e63f60581a9906672711e2835f3c6ff523f0a1230ad09587a0a4cd8020177c50497255aa5fc0ab0fb3b2e78f8171d -results-noint.01400.bmp aafdcc3dd91bdada3fff2af4f646a91d436179064625d8bac53a907b3a4163882281a531224145cbd2cd81936ae420b45a949cb0ef939fa5f1d990bf08b88f3e -results-noint.01500.bmp 17a1c79dd284beebf4a1bbe6a237f434c7a70439f64548b1164993f6c0a2f4a52b4807ebd35563c5d3c87ec1c8f49617a7ff4bbbb0c5698cdec8dc17d8cd6ebd -results-noint.01600.bmp 92c6f57f8d4d81f3fd9ae8a51246541d71e825546eb98d1e252c2630e084cb2427a84cad5233b93bb70c9ed4f44485b8f738d752c9fc1b9b8d2110e0637e90b2 -results-noint.01700.bmp acf4b2eb67c8205726a77e57803a6799f4c68e4d8369d9d37009fd076f5aa1a1b848491db2f299f2131f9f4ed1a1685f41daae7ccc60bc5e82e06416333ed7e6 -results-noint.01800.bmp 018628b50223885f6f97c580013eaf96d2721384c02391db44f0bd896b62d61ce90a738a61e48a3948e27f2903421c605736c996fc2d506ec19a9025407dd16a -results-noint.01900.bmp 1ddf56ccb73cefb1b7705e764924a22b630c5c159c9430447ce2506bd6e3f52603c67728437699eac9378c93839deff2640a8270485c3c568cc04780dfd0a8e9 -results-noint.02000.bmp 0b1bd8c7fd46f9779fee15df3390fc554784100a841835cef60b543b9cfcbfb6ed52a45249edc52133a6fc225951985c0f8eb049e093f4106bdc752925a69232 -results-noint.02100.bmp 2d22f7ac34c4fae15d7404209e0715367fd649d260d764a9f3683c35430007c4533ab01c75a1648010dd07f0e11e2d92e35ebbb77f6d3c51de01cf97cb3617fd -results-noint.02200.bmp 2c584d465c4efd9dec31a2e4e3e1f37836f59cf67a33ea019e9a94d35f70be49497938c53495ff4465011ad7a6baaff13a4a5243e1d78dd1f8a5c94c1b377190 -results-noint.02300.bmp 8918b0c39b11f0e1c406ca74ba338283e0feff770a1728c20633b51913aa7bb449a8698e05fbc9de315cdfa7013db563a195ec849e474d9fa3f82ae7ff66ec5a -results-noint.02400.bmp 49296252a9c34762d180e61f199bafa3cc133660dc8b9f0905b7a7c9526ad4b9a6e99ae1ef3c086d4f0adb9ee4225a612c5ab8148d5c0f0a52f3dfb0cc6d7c1b -results-noint.02500.bmp 9614fd0ea5aad1a7d8801b1369dcf4378de600cfad20fe35f98b28a4109f3559f3941903e21baca1a3b6a7a3e2576362d7fbc6baa35eff8b5fa5c8b8db95aef7 -results-noint.02600.bmp 9614fd0ea5aad1a7d8801b1369dcf4378de600cfad20fe35f98b28a4109f3559f3941903e21baca1a3b6a7a3e2576362d7fbc6baa35eff8b5fa5c8b8db95aef7 -results-noint.02700.bmp 9614fd0ea5aad1a7d8801b1369dcf4378de600cfad20fe35f98b28a4109f3559f3941903e21baca1a3b6a7a3e2576362d7fbc6baa35eff8b5fa5c8b8db95aef7 -results-noint.02800.bmp 9614fd0ea5aad1a7d8801b1369dcf4378de600cfad20fe35f98b28a4109f3559f3941903e21baca1a3b6a7a3e2576362d7fbc6baa35eff8b5fa5c8b8db95aef7 -results-noint.avNE.age.xls 44ca8f8874f1637a6d7d330685b09a55d9210af024bb656ebc7f2d7cb8ef133fa1c5c439ef64c73b99bcaae1511b6a9cbf1dd1d8f974dd2b4ce5e13401980b80 -results-noint.avNE.severity.adunit.xls 39db33c7e898a5332c6a0ee3fb547b2eebfc82ef1cabbfef1bea291115223e0877562e381a100cc25bfa6518227f80eb614044cb46293b6f273bbf6cba697880 -results-noint.avNE.severity.age.xls 4dcdb254fe2a9f713ca9a0bccde5c3c05d4355123387e8774120e0d285775f0a844be3f31e2f5eac8acef7662545742d281bc938aaed71bf3f223dbefa3f7651 -results-noint.avNE.severity.xls a22600bffbd6a4352654ca9d839637c8e1312b8b1326117638b1be8d405c9ff154a86e57a319a4cbe8ceb643d357b79d51d30272fbe3c08542802551cd7a0c87 \ No newline at end of file +results-noint.00100.bmp 53b02dcb8bdad957fb26c1d94c1916425204f34ded76066483827ed08055b625174c0d7b5d43eb65c268f7cf9130d556dbb91a9d722d06dfe5d0e773f5a3a4b4 +results-noint.00200.bmp afb83f01b065edb6eea4a186bbff7d72f46e64cb084f829406b816adf7bee846ed897ef2100e26370e20eb397e5a63f0997de99a148e0a99ec42a6f76c892cf3 +results-noint.00300.bmp 831232fe639d091dd2cfa99c869f343ccf5ec6eb93ddd2862caa8768a723d337c5b104d9949c688d273a3b1e74da91ba2f265c9d2cec30a73fb4ab4bab56b4ba +results-noint.00400.bmp dca3bdd0512377b8958fc6a8a0c058629d38aef16d726808b8396bcab9e6423af93e4b6ab1a2b8ab08cf1c2b9d24738261885b89778768de2299230e72d51809 +results-noint.00500.bmp 78072e960064bcab82135e2ef0b1f94859fd6f16229b91d3504cead2c7f619d14bf77c77d7b8b22f4fe3f9fc6539f11f6a440ecef4b3a9d5330ed7f3cc625492 +results-noint.00600.bmp f9322a3fbbeebc46d4b18a190b25d77fa44e2751bcfc2d60b080df75ebce218b48e1cb3c73e718218015e89abbfe0e4a155fb3597b8aad6c10f66828f53ddc56 +results-noint.00700.bmp a85d7d75c38925ab8e4f9fb05c9ac6d3b4fe57349d309bb731354702f919185218050bd80ee4f504584f80f32010ae6b6b2646277ca3594f0b1e1b834a5a6c7a +results-noint.00800.bmp 6964f076eb368c3572282489ada8e0590f4c570557b33d599274e42c45ba253e3a5c1d4c0e3fc966c4e7698fe7a7a448ee37b1454aae5fe560ea5536d8ae7e9e +results-noint.00900.bmp 48ce070b59895d7895a06bbd39560502f923c92baaa760fff05258f80d3ca93896d901ec7dcaed03aed365b3d386b82586d7efbc6ed0ebc274c4897022227a4d +results-noint.01000.bmp c3e285a385bc812113cc221a0aea8bf22310d96974c665087e880363a10e7bd48871fcfae9a82a7ea97d18c0bfd16624a08598c1b731592063b30cf1185f3170 +results-noint.01100.bmp 78fd8ebac9697f9827dcbf1cfe731787038000132042448c8a69b98388654c13420949fef1b150a3f8841c6b94bbed2556b2da83e125167cc6244d843cf7caca +results-noint.01200.bmp f651be87af4948e3daf3f0829a58dd275869616a43d0c31f2a6c3cdcaa06f929533dec405c501d001a1652eadc41186f507a0df08a38b5718dee7c95f6586553 +results-noint.01300.bmp f651be87af4948e3daf3f0829a58dd275869616a43d0c31f2a6c3cdcaa06f929533dec405c501d001a1652eadc41186f507a0df08a38b5718dee7c95f6586553 +results-noint.01400.bmp f651be87af4948e3daf3f0829a58dd275869616a43d0c31f2a6c3cdcaa06f929533dec405c501d001a1652eadc41186f507a0df08a38b5718dee7c95f6586553 +results-noint.01500.bmp f651be87af4948e3daf3f0829a58dd275869616a43d0c31f2a6c3cdcaa06f929533dec405c501d001a1652eadc41186f507a0df08a38b5718dee7c95f6586553 +results-noint.01600.bmp f651be87af4948e3daf3f0829a58dd275869616a43d0c31f2a6c3cdcaa06f929533dec405c501d001a1652eadc41186f507a0df08a38b5718dee7c95f6586553 +results-noint.avNE.age.xls 18b7437b40ff4ac9aaed42a3645d54366d0292e824273d82385c8d21174601a7a6656bec3fdddbe4a889e795c886f68ae5814d62a5bb7a1e679789a09ac2e556 +results-noint.avNE.severity.adunit.xls 90c8eb03c9eaa7353a14feaed79589a059c728cf91566527d616f5e0a4bcbe7dcad7492474d3349423ffa9ba9b25f444edc3d95a6b39fd6286cbcb59f7e572a7 +results-noint.avNE.severity.age.xls bb22d7955f215c0b8cffbd005c9ff8abba02d9c42e783c294f06ccba56cf6fbf58d09e7f7814e7e489e7e83a22e26067a17dd70f781a021421dee5acbf316c8d +results-noint.avNE.severity.xls 11fc4a376ac032a3da2c2f68db764580f094cf0d843246b409d1e131840827b51f5ac66040b68b39ef7cb82fde5d0494e746cc9b2b65fa5eab660eb4d2f11980 diff --git a/tests/uk-input/results-j2.cksum b/tests/uk-input/results-j2.cksum index ff0f2d307..d33b75975 100644 --- a/tests/uk-input/results-j2.cksum +++ b/tests/uk-input/results-j2.cksum @@ -1,50 +1,50 @@ results-int.00000.bmp 59c39fb51cca2ea8a5469c02e65359de2b82cbc0ad3166a3b236cda0a38e00db331bb00d9f490565028c11408ddf515f631f3c5f5954b2511252ef8117217b5a -results-int.00100.bmp 215f64e8f265ef6d1f9494b15cc57eab37bb693aeb6701482a1cc38fef1ffb12b1c6f90f9f2f02aecc7eb4202fad4234f401d88c041cfb4b3e4d81b933be0ed3 -results-int.00200.bmp d15289851739810e9935d5ccecb3217663f99cbc9c3ca7b6f899d5ba8fbb5e3dc0c69851a99348f31272a0a0c3764c365a93a5f13676843e5826a702fa3ad3f8 -results-int.00300.bmp f99eece95ed994a5d4b35ac225899de3b03153860355f27834eed9a59d53dcd46fb6dbd463d76cac4601dd8f259d1b2422f2b02af2abea0e2c987f5de651052e -results-int.00400.bmp 4323d052efb4bcefe72371f02aa8ac891708b6e6ce9c7e324471ba85650712c8f83e34b63f6e1c369959ccb9fb59044e051baece1a993f86abe9e167a5a91e0f -results-int.00500.bmp 687af0677b7ae54cb31a4541e58138df690a8a1e73fad5de4f21373b1536256b97f4def82d84093886838e03024b7a1b6f47282782f16b4898e6238bf1081869 -results-int.00600.bmp 5376098c7da8a8fdcfbaf0588debc7f1c286900142883c5a2614d227996c1c102f939eb200caf80de24070d3c797da48fc2357f170c530e7e03d84753342035d -results-int.00700.bmp 5376098c7da8a8fdcfbaf0588debc7f1c286900142883c5a2614d227996c1c102f939eb200caf80de24070d3c797da48fc2357f170c530e7e03d84753342035d -results-int.00800.bmp 5376098c7da8a8fdcfbaf0588debc7f1c286900142883c5a2614d227996c1c102f939eb200caf80de24070d3c797da48fc2357f170c530e7e03d84753342035d -results-int.00900.bmp 5376098c7da8a8fdcfbaf0588debc7f1c286900142883c5a2614d227996c1c102f939eb200caf80de24070d3c797da48fc2357f170c530e7e03d84753342035d -results-int.01000.bmp 5376098c7da8a8fdcfbaf0588debc7f1c286900142883c5a2614d227996c1c102f939eb200caf80de24070d3c797da48fc2357f170c530e7e03d84753342035d -results-int.01100.bmp 5376098c7da8a8fdcfbaf0588debc7f1c286900142883c5a2614d227996c1c102f939eb200caf80de24070d3c797da48fc2357f170c530e7e03d84753342035d -results-int.avNE.age.xls 528b9d5cf7d108365818e418af8fa84a9f582728eb9974714e305af9e40169d50f39a5290acabe480b38a0ee06e94bfdc822f7c170cdf7191b86a489f88b8ecd -results-int.avNE.severity.adunit.xls 28212050773c57107b6ae7de7e5962da6a1c706499c75d0d7ab5453d3d3cb8beafd0fdb0cfdeadd95a6e1209bce13fb645c3255443b6b7176c14c2b4c4aa35a3 -results-int.avNE.severity.age.xls 159184e954eaf4ce56f46c806bbf02afaa7507465085d6931ce4cd4f112fef0e8a18c38cf09e804b2be9e949763f12a52222a11481f7ac10c504ea5591786ad9 -results-int.avNE.severity.xls e633e380480c687e18b797fb7e5a49c9f175d05e169a10990fc6ce569a773d9aa8ed6c1e9d8cb0e0e7fe0942a1e282137906fbab7a15ca2eb46d24f6e1ecc7c1 +results-int.00100.bmp a151c34b1b7ab5f52ad4daed3dc1440725a82f736354e90c352ddb1917201d5e15de287e66a21d1008dddcd73d0a3f157da90568f3908ee6c4740c7d282878c5 +results-int.00200.bmp 41fc798d86dc36fbfce5b611df899c194c3103980746ef304bd748b57eff575d347bac2fcda02256ec57053e5bdd8771b78434524cfe85c4e93dfbf728be8dd9 +results-int.00300.bmp 4b5ca5a49253499ab209955fb08a200aad8a064c32cbcd2184b71f85d2a4ce33b036cfc2537a22b5034fb591f0c4459400c7b7635f9cfea35c6be49e14ba8e90 +results-int.00400.bmp 61c2769a00ff2554845bdc6ca63a8e7cb8e03559f9eb3a2d37a7f5cdf5387e1e828fee9339f142731fd679f79707ec3d834aa5f56ca3a20ab5a5af44e96243e7 +results-int.00500.bmp 31d75e20272bc050239da020d39a8bbfcce62bb462c6412e601658dc05b92450a2cd73955bf9292745715e04024dc547053e36f2117b7439aa0956a24bb433cd +results-int.00600.bmp c5af9e5f3b6cf9c478ee1316ad407ffeec31d46ae19c87c9febd7f4c79c8d637d54dc012669dda620db0e9648751d17db815f5ef851f6234b840c5c1fcdb6075 +results-int.00700.bmp c5af9e5f3b6cf9c478ee1316ad407ffeec31d46ae19c87c9febd7f4c79c8d637d54dc012669dda620db0e9648751d17db815f5ef851f6234b840c5c1fcdb6075 +results-int.00800.bmp c5af9e5f3b6cf9c478ee1316ad407ffeec31d46ae19c87c9febd7f4c79c8d637d54dc012669dda620db0e9648751d17db815f5ef851f6234b840c5c1fcdb6075 +results-int.00900.bmp c5af9e5f3b6cf9c478ee1316ad407ffeec31d46ae19c87c9febd7f4c79c8d637d54dc012669dda620db0e9648751d17db815f5ef851f6234b840c5c1fcdb6075 +results-int.01000.bmp c5af9e5f3b6cf9c478ee1316ad407ffeec31d46ae19c87c9febd7f4c79c8d637d54dc012669dda620db0e9648751d17db815f5ef851f6234b840c5c1fcdb6075 +results-int.01100.bmp c5af9e5f3b6cf9c478ee1316ad407ffeec31d46ae19c87c9febd7f4c79c8d637d54dc012669dda620db0e9648751d17db815f5ef851f6234b840c5c1fcdb6075 +results-int.avNE.age.xls b7d74276a56447bc16ef8b9a25a6896f53c9aa2aa1ed467be773107172f4de2f1a7cf5c353f82143f146cf20c3da9c9201d93b248c05139e33b5e96de30824a7 +results-int.avNE.severity.adunit.xls e097a8dc1d724b2e8e4123f4333dc736af6a3054b9bb4fc06a0815fbd09a31ad58814328a8d6c76aed9e09bee5b6dcbcb5779a4c25cf700490ce082414623e25 +results-int.avNE.severity.age.xls 9c18fc1ac4cff4620583b0df61189590600b87a31613a1e92086bbb9101dd8269a3f1bd5db83a7c5e21944caedb5cd571ad1d01fd010d20bd37102ed54305f1f +results-int.avNE.severity.xls 6de8a0d98ba02d45579d114e8e982a9b75f8e4c21853dba84e5f6b38017dc91b2d3475ff7657c101114b150beb35fec1a67e9b50837c5216e1b1edb5d69b40d4 results-noint-repeat.00000.bmp 59c39fb51cca2ea8a5469c02e65359de2b82cbc0ad3166a3b236cda0a38e00db331bb00d9f490565028c11408ddf515f631f3c5f5954b2511252ef8117217b5a -results-noint-repeat.00100.bmp 215f64e8f265ef6d1f9494b15cc57eab37bb693aeb6701482a1cc38fef1ffb12b1c6f90f9f2f02aecc7eb4202fad4234f401d88c041cfb4b3e4d81b933be0ed3 -results-noint-repeat.00200.bmp 3de2b93bb8a6402c87f194aa8988b0c3dda6762c3f4b80bd952461e4ce786b3513f0b64d98534a87950f92513a7d6b6462e7945a7e14b3242ff34a848f5ab1b2 -results-noint-repeat.00300.bmp ac753f127a7c220e5f14a8f993b09b90fe27da427e4a10c0e50b0341ca59a056a7ce9a415a94d6aa96acfe6cee95e839373dd2ad5173716b62ded07c16a9b893 -results-noint-repeat.00400.bmp 415b67ff91d7d5b4fe536b65ab677123800b530062efcadbf99181df8bc3a817a28d59042fbecf2823e99575770b0524ec29526590444c27c4561729d3c8c961 -results-noint-repeat.00500.bmp 1121a83ef727f69b8135edc031ad4f80137b1a95bd10370822bcdfe9eae8e2acaf4f25e2cf565460d7ab1bd24e9576a456e602c331e4b4b88c9d669144a40f44 -results-noint-repeat.00600.bmp 21a4d9e48a13bdd2885300644fe4693e9ed742dcd1db5f5fe14a5dd3c16c9c7e2d5a0f7917786dcd708be5fe14da69497ac8f11ff63477796dde48c0a116d1ba -results-noint-repeat.00700.bmp 6eadc7154f0da2e39be8546691d43f9ab7644c15a4f50d922a689a62c47740c1aecb9516e0cdb37b574b24c8c5420535b051da93004917bce8814922bfec651f -results-noint-repeat.00800.bmp af71826dacb8930f906099dd325423ffa229ee0ff4f1cc8cd85bb080713304cc5e7b130c7b624320c5ef98c70a2b8e25d83f4004c48b61fd2734c2163ac3014f -results-noint-repeat.00900.bmp af71826dacb8930f906099dd325423ffa229ee0ff4f1cc8cd85bb080713304cc5e7b130c7b624320c5ef98c70a2b8e25d83f4004c48b61fd2734c2163ac3014f -results-noint-repeat.01000.bmp af71826dacb8930f906099dd325423ffa229ee0ff4f1cc8cd85bb080713304cc5e7b130c7b624320c5ef98c70a2b8e25d83f4004c48b61fd2734c2163ac3014f -results-noint-repeat.01100.bmp af71826dacb8930f906099dd325423ffa229ee0ff4f1cc8cd85bb080713304cc5e7b130c7b624320c5ef98c70a2b8e25d83f4004c48b61fd2734c2163ac3014f -results-noint-repeat.01200.bmp af71826dacb8930f906099dd325423ffa229ee0ff4f1cc8cd85bb080713304cc5e7b130c7b624320c5ef98c70a2b8e25d83f4004c48b61fd2734c2163ac3014f -results-noint-repeat.avNE.age.xls 035b014df97c2edba0a5e6f1f5d7e27e65b2ca8c88623eed998846124bc43b7838fd0e28d2d46961d13612bc4863f4bc8ad4866732860ce3b763cbc2a80d798f -results-noint-repeat.avNE.severity.adunit.xls 3e4b945dbd8782c24b76d2e9dcfff6aa20deae7b684c79c35740c3ca537bedb3e37ba9c12bf576dcc8c6d6e5468af0559ed78634ecbb165b9810e919ee8f8ce0 -results-noint-repeat.avNE.severity.age.xls 084058390eee3ef33ca0cb15d794f361c717b4e90d437d895e5483eb1d3e723a0954e39b8928663b7cda7e23f9441aed17be6074605aba207e158e7a15cf34be -results-noint-repeat.avNE.severity.xls a6512707e06831c4728dd4dfd6e7f434f6e31441aa06f57263172ec0dbf8597e500c522535c0de1965f2cf560e72b91abdafae022b1b61964bbac376f50c8d83 +results-noint-repeat.00100.bmp a151c34b1b7ab5f52ad4daed3dc1440725a82f736354e90c352ddb1917201d5e15de287e66a21d1008dddcd73d0a3f157da90568f3908ee6c4740c7d282878c5 +results-noint-repeat.00200.bmp fcc3ccc88b0f1e2b7ecab19843daca2305b654c742dd2288d5cf14e0204c5c431152ba900abb783a30a9a09ffc731aa0086f864571a151793055104287980edd +results-noint-repeat.00300.bmp 70e1a9f2f70b409dae7083c595dd3615f862dff958b8cfae3fd2c734ea1b7669d6a78473e990fab5e311e26cdbc5ee4fb559dfd58a8ce4edbf170cecc566e454 +results-noint-repeat.00400.bmp dec7bea2ac82e6fd933e863e1b305e553921db46c88152cfd6794ea6242d253bbe6c05dada16b6be5457701abf7d7d016152a39e366b737e0f94f02839acc82a +results-noint-repeat.00500.bmp 44ef17ac9e0cc71db005c93a1a01bde84348dee1ffb7ca83c5aac132f8c68b1f940ec54a0e239485a1bc9965de1bd64b4730599a212bbaf646832cf5f5650bfb +results-noint-repeat.00600.bmp da6c654a25283ff35d485f7ef2eb33301f60f41ff41d40bdd3ee57fc91542d32d6ab06c7322c426321d54ea0564f5c2d4c3cd0090da0b3760a27453c675fc3b5 +results-noint-repeat.00700.bmp d6ee4acb9706bd5b2962820c82489ff1c7296522a3ad9099642e6baa30adb24d1606ee28c8202424d72de6bdb10b1d1e732689ffd0c04a37fc3e0a1fa923e212 +results-noint-repeat.00800.bmp 1956f900659d75fe4de2b46854e4b77707c7489c700fb49122bff2e01323d235101eb8326f6156c8574bce55349fa31cbc3e1be5ee191e8fbdbd9bc0f97f465f +results-noint-repeat.00900.bmp 1956f900659d75fe4de2b46854e4b77707c7489c700fb49122bff2e01323d235101eb8326f6156c8574bce55349fa31cbc3e1be5ee191e8fbdbd9bc0f97f465f +results-noint-repeat.01000.bmp 1956f900659d75fe4de2b46854e4b77707c7489c700fb49122bff2e01323d235101eb8326f6156c8574bce55349fa31cbc3e1be5ee191e8fbdbd9bc0f97f465f +results-noint-repeat.01100.bmp 1956f900659d75fe4de2b46854e4b77707c7489c700fb49122bff2e01323d235101eb8326f6156c8574bce55349fa31cbc3e1be5ee191e8fbdbd9bc0f97f465f +results-noint-repeat.01200.bmp 1956f900659d75fe4de2b46854e4b77707c7489c700fb49122bff2e01323d235101eb8326f6156c8574bce55349fa31cbc3e1be5ee191e8fbdbd9bc0f97f465f +results-noint-repeat.avNE.age.xls 4a2670711bb3848a0365ccb48f163651091fa905a4f7ab42c92e1cacadb80ce1be1678648c70eca993276e360a751d9681af38401e208c2a44a38e82d7e6c0b7 +results-noint-repeat.avNE.severity.adunit.xls 4ef9a68ebc9696014817d9c7072abe5756bd4ea384fc73f81046ab1ec34b46c5820d4bc84f5df29613ff1215c1bd1a0981ba4fc5f3dbe51af697f43c2b7e83da +results-noint-repeat.avNE.severity.age.xls 3ab5784cd2d2c9c33ad71675526d1dbf0edb83295a155b24bf3987f2ad68e1bee5976e2c38a962b7cf3ce53caefb65a65db9cb403da13ef5ee6a39e0c51ba093 +results-noint-repeat.avNE.severity.xls ee7673e6a67762bd2b34375722efe47053ef50767a8db42d84500623a17a2ff85faa3f7d01ef8dbf44f557465a6c7426e3f18af3a8177ff8555daa14212adea8 results-noint.00000.bmp 59c39fb51cca2ea8a5469c02e65359de2b82cbc0ad3166a3b236cda0a38e00db331bb00d9f490565028c11408ddf515f631f3c5f5954b2511252ef8117217b5a -results-noint.00100.bmp 215f64e8f265ef6d1f9494b15cc57eab37bb693aeb6701482a1cc38fef1ffb12b1c6f90f9f2f02aecc7eb4202fad4234f401d88c041cfb4b3e4d81b933be0ed3 -results-noint.00200.bmp 3de2b93bb8a6402c87f194aa8988b0c3dda6762c3f4b80bd952461e4ce786b3513f0b64d98534a87950f92513a7d6b6462e7945a7e14b3242ff34a848f5ab1b2 -results-noint.00300.bmp ac753f127a7c220e5f14a8f993b09b90fe27da427e4a10c0e50b0341ca59a056a7ce9a415a94d6aa96acfe6cee95e839373dd2ad5173716b62ded07c16a9b893 -results-noint.00400.bmp 415b67ff91d7d5b4fe536b65ab677123800b530062efcadbf99181df8bc3a817a28d59042fbecf2823e99575770b0524ec29526590444c27c4561729d3c8c961 -results-noint.00500.bmp 1121a83ef727f69b8135edc031ad4f80137b1a95bd10370822bcdfe9eae8e2acaf4f25e2cf565460d7ab1bd24e9576a456e602c331e4b4b88c9d669144a40f44 -results-noint.00600.bmp 21a4d9e48a13bdd2885300644fe4693e9ed742dcd1db5f5fe14a5dd3c16c9c7e2d5a0f7917786dcd708be5fe14da69497ac8f11ff63477796dde48c0a116d1ba -results-noint.00700.bmp 6eadc7154f0da2e39be8546691d43f9ab7644c15a4f50d922a689a62c47740c1aecb9516e0cdb37b574b24c8c5420535b051da93004917bce8814922bfec651f -results-noint.00800.bmp af71826dacb8930f906099dd325423ffa229ee0ff4f1cc8cd85bb080713304cc5e7b130c7b624320c5ef98c70a2b8e25d83f4004c48b61fd2734c2163ac3014f -results-noint.00900.bmp af71826dacb8930f906099dd325423ffa229ee0ff4f1cc8cd85bb080713304cc5e7b130c7b624320c5ef98c70a2b8e25d83f4004c48b61fd2734c2163ac3014f -results-noint.01000.bmp af71826dacb8930f906099dd325423ffa229ee0ff4f1cc8cd85bb080713304cc5e7b130c7b624320c5ef98c70a2b8e25d83f4004c48b61fd2734c2163ac3014f -results-noint.01100.bmp af71826dacb8930f906099dd325423ffa229ee0ff4f1cc8cd85bb080713304cc5e7b130c7b624320c5ef98c70a2b8e25d83f4004c48b61fd2734c2163ac3014f -results-noint.01200.bmp af71826dacb8930f906099dd325423ffa229ee0ff4f1cc8cd85bb080713304cc5e7b130c7b624320c5ef98c70a2b8e25d83f4004c48b61fd2734c2163ac3014f -results-noint.avNE.age.xls 035b014df97c2edba0a5e6f1f5d7e27e65b2ca8c88623eed998846124bc43b7838fd0e28d2d46961d13612bc4863f4bc8ad4866732860ce3b763cbc2a80d798f -results-noint.avNE.severity.adunit.xls 3e4b945dbd8782c24b76d2e9dcfff6aa20deae7b684c79c35740c3ca537bedb3e37ba9c12bf576dcc8c6d6e5468af0559ed78634ecbb165b9810e919ee8f8ce0 -results-noint.avNE.severity.age.xls 084058390eee3ef33ca0cb15d794f361c717b4e90d437d895e5483eb1d3e723a0954e39b8928663b7cda7e23f9441aed17be6074605aba207e158e7a15cf34be -results-noint.avNE.severity.xls a6512707e06831c4728dd4dfd6e7f434f6e31441aa06f57263172ec0dbf8597e500c522535c0de1965f2cf560e72b91abdafae022b1b61964bbac376f50c8d83 \ No newline at end of file +results-noint.00100.bmp a151c34b1b7ab5f52ad4daed3dc1440725a82f736354e90c352ddb1917201d5e15de287e66a21d1008dddcd73d0a3f157da90568f3908ee6c4740c7d282878c5 +results-noint.00200.bmp fcc3ccc88b0f1e2b7ecab19843daca2305b654c742dd2288d5cf14e0204c5c431152ba900abb783a30a9a09ffc731aa0086f864571a151793055104287980edd +results-noint.00300.bmp 70e1a9f2f70b409dae7083c595dd3615f862dff958b8cfae3fd2c734ea1b7669d6a78473e990fab5e311e26cdbc5ee4fb559dfd58a8ce4edbf170cecc566e454 +results-noint.00400.bmp dec7bea2ac82e6fd933e863e1b305e553921db46c88152cfd6794ea6242d253bbe6c05dada16b6be5457701abf7d7d016152a39e366b737e0f94f02839acc82a +results-noint.00500.bmp 44ef17ac9e0cc71db005c93a1a01bde84348dee1ffb7ca83c5aac132f8c68b1f940ec54a0e239485a1bc9965de1bd64b4730599a212bbaf646832cf5f5650bfb +results-noint.00600.bmp da6c654a25283ff35d485f7ef2eb33301f60f41ff41d40bdd3ee57fc91542d32d6ab06c7322c426321d54ea0564f5c2d4c3cd0090da0b3760a27453c675fc3b5 +results-noint.00700.bmp d6ee4acb9706bd5b2962820c82489ff1c7296522a3ad9099642e6baa30adb24d1606ee28c8202424d72de6bdb10b1d1e732689ffd0c04a37fc3e0a1fa923e212 +results-noint.00800.bmp 1956f900659d75fe4de2b46854e4b77707c7489c700fb49122bff2e01323d235101eb8326f6156c8574bce55349fa31cbc3e1be5ee191e8fbdbd9bc0f97f465f +results-noint.00900.bmp 1956f900659d75fe4de2b46854e4b77707c7489c700fb49122bff2e01323d235101eb8326f6156c8574bce55349fa31cbc3e1be5ee191e8fbdbd9bc0f97f465f +results-noint.01000.bmp 1956f900659d75fe4de2b46854e4b77707c7489c700fb49122bff2e01323d235101eb8326f6156c8574bce55349fa31cbc3e1be5ee191e8fbdbd9bc0f97f465f +results-noint.01100.bmp 1956f900659d75fe4de2b46854e4b77707c7489c700fb49122bff2e01323d235101eb8326f6156c8574bce55349fa31cbc3e1be5ee191e8fbdbd9bc0f97f465f +results-noint.01200.bmp 1956f900659d75fe4de2b46854e4b77707c7489c700fb49122bff2e01323d235101eb8326f6156c8574bce55349fa31cbc3e1be5ee191e8fbdbd9bc0f97f465f +results-noint.avNE.age.xls 4a2670711bb3848a0365ccb48f163651091fa905a4f7ab42c92e1cacadb80ce1be1678648c70eca993276e360a751d9681af38401e208c2a44a38e82d7e6c0b7 +results-noint.avNE.severity.adunit.xls 4ef9a68ebc9696014817d9c7072abe5756bd4ea384fc73f81046ab1ec34b46c5820d4bc84f5df29613ff1215c1bd1a0981ba4fc5f3dbe51af697f43c2b7e83da +results-noint.avNE.severity.age.xls 3ab5784cd2d2c9c33ad71675526d1dbf0edb83295a155b24bf3987f2ad68e1bee5976e2c38a962b7cf3ce53caefb65a65db9cb403da13ef5ee6a39e0c51ba093 +results-noint.avNE.severity.xls ee7673e6a67762bd2b34375722efe47053ef50767a8db42d84500623a17a2ff85faa3f7d01ef8dbf44f557465a6c7426e3f18af3a8177ff8555daa14212adea8 diff --git a/tests/us-input/results-j1.cksum b/tests/us-input/results-j1.cksum index 2c69594ce..5c44cc0b4 100644 --- a/tests/us-input/results-j1.cksum +++ b/tests/us-input/results-j1.cksum @@ -1,12 +1,12 @@ -results-int.avNE.age.xls 5614f2315334d49a51c9d0f628c58817bbb177394fdac63c471d0f24fa7f6f6441d55ca5a093d1daddce62b2aed2538296dfccc7c93dec82e107068dabc261b7 -results-int.avNE.severity.adunit.xls 226f2f19c3426452a382819fbb22b094780447ec9dd995e2b11c356225e41c05bb20750cc0c0673cd30d2e088c09d18ef0ae4334f884bdb2b5b4dbf2e03b00bd -results-int.avNE.severity.age.xls 477047a45c4b3d1798709f541c8b852315002bc1966f1020f5e3edf5d7294bf31f1268fddf16e357cf0de6579b6948dff8b1d29da8518f748bb17a02521791f3 -results-int.avNE.severity.xls 719b2172377f10e51162291f56684394ca468b2d03b8eaf091d8546f0e7ae6f759b7278c2a8c5f341cf1dd52a865fc44dc98e664d1ff8198dfc26a4483857a30 -results-noint-repeat.avNE.age.xls cb964bea60cf01659df12d2ba8de096d19a893202c10df338d207c00a77a0a8ad49ca17e44ba83b8dd71dcfaa413fa2d8ad3507ebb820bbad83a2af46da36006 -results-noint-repeat.avNE.severity.adunit.xls d6fe6d069019af9f8dfb4acc2720959eb79c5e3b5312be9ba18a200dfb461497674b53a10026282ca3cdbbfc8b2726b6307baef74b20e20588ae5fd19fa696f5 -results-noint-repeat.avNE.severity.age.xls 57b99ab61a80fa26e9835554cefe8be551dfa8100ac3a103dfe973abd65e98bd99ed604e2fef20193cf8584009faee179915edb526d210c79af3a05174db1199 -results-noint-repeat.avNE.severity.xls 9931cc90d813bdaa47eefcc6f4af7a6525efde4975493f763dc54d5e4abbb745ec3c8ea1bcaa9d0f6cc4e4c702cc534d603d0a1e41925c043220eb9a4f2b5e69 -results-noint.avNE.age.xls cb964bea60cf01659df12d2ba8de096d19a893202c10df338d207c00a77a0a8ad49ca17e44ba83b8dd71dcfaa413fa2d8ad3507ebb820bbad83a2af46da36006 -results-noint.avNE.severity.adunit.xls d6fe6d069019af9f8dfb4acc2720959eb79c5e3b5312be9ba18a200dfb461497674b53a10026282ca3cdbbfc8b2726b6307baef74b20e20588ae5fd19fa696f5 -results-noint.avNE.severity.age.xls 57b99ab61a80fa26e9835554cefe8be551dfa8100ac3a103dfe973abd65e98bd99ed604e2fef20193cf8584009faee179915edb526d210c79af3a05174db1199 -results-noint.avNE.severity.xls 9931cc90d813bdaa47eefcc6f4af7a6525efde4975493f763dc54d5e4abbb745ec3c8ea1bcaa9d0f6cc4e4c702cc534d603d0a1e41925c043220eb9a4f2b5e69 \ No newline at end of file +results-int.avNE.age.xls cc55e3f3419775b9bc2ca8f2f7d7bae1c5bfcc705114bb1a7e8741fb131ab3da031050363a580c5aa9dfbe9be425ddecbd2e9afa610dc20c9f7cfe05832066ee +results-int.avNE.severity.adunit.xls 67d56b599300f709c7a97a1966cc354907b977f84c92f1fb01c5675c761d0d643cf9ae151b65e04dcf6e4186807aa326390507f8b650f3dafe6681134fa2430c +results-int.avNE.severity.age.xls 045a0c898ff084715a24d751a965f5ef2d2fc12cf1d40563fadd11d6ec646df9d6eba7f565c34cc52c00fc57f102cdf8da4f10ac29cfdfc7d3a91fd956149b0e +results-int.avNE.severity.xls e367e48f67243105cf5e6b432254d5e945ad474d9b5765632a1ac717c39862dcd20e4d14958b148b9dba135db924d056c18008c657f7b9aa00ae700359d1f0a5 +results-noint-repeat.avNE.age.xls d212ae0e819797c593fcae20d10861bba9081adf2a8756f06f89d445898702b6a5ee3966afc0dd04298a1357f428a5b3e892f04c1f4063a96ecb1b8e558b8525 +results-noint-repeat.avNE.severity.adunit.xls 88acfc39a788bf5dffb5d679381a3917685b4fab0f5ddfe2d77b7bad25b0cc7fd972fac0fd6ad973bb41a1e8c7633307dbfbe96b83dd587d913f1a7d19dc0ffb +results-noint-repeat.avNE.severity.age.xls ca3e5e65efda95e4f3ee3206a4d842487a729e16148710582c9d7304b13ea03365056829d78d8433c78e3279f820ad4ffeb3a2197102334e380304fc80495700 +results-noint-repeat.avNE.severity.xls 76bb04f9347dc2b725558e07e47c672903638065668966d09a707eb4d25415fcef4552200b40844814687884e057a45da2e0b13ae5039bf54b676fbf25232fa8 +results-noint.avNE.age.xls d212ae0e819797c593fcae20d10861bba9081adf2a8756f06f89d445898702b6a5ee3966afc0dd04298a1357f428a5b3e892f04c1f4063a96ecb1b8e558b8525 +results-noint.avNE.severity.adunit.xls 88acfc39a788bf5dffb5d679381a3917685b4fab0f5ddfe2d77b7bad25b0cc7fd972fac0fd6ad973bb41a1e8c7633307dbfbe96b83dd587d913f1a7d19dc0ffb +results-noint.avNE.severity.age.xls ca3e5e65efda95e4f3ee3206a4d842487a729e16148710582c9d7304b13ea03365056829d78d8433c78e3279f820ad4ffeb3a2197102334e380304fc80495700 +results-noint.avNE.severity.xls 76bb04f9347dc2b725558e07e47c672903638065668966d09a707eb4d25415fcef4552200b40844814687884e057a45da2e0b13ae5039bf54b676fbf25232fa8 diff --git a/tests/us-input/results-j2.cksum b/tests/us-input/results-j2.cksum index 6960eecc6..fc3f59bd9 100644 --- a/tests/us-input/results-j2.cksum +++ b/tests/us-input/results-j2.cksum @@ -1,12 +1,12 @@ -results-int.avNE.age.xls e53cf1794fc4691acc175546093734c48a354d15c27e784e5de06f4d710ed3560ba0049d6c82407d1f90af607eb1bb603d4dcbe7e1ac73ca2cb56bf1665f9cb1 -results-int.avNE.severity.adunit.xls d0ef77ac0b9f9e30a04a6a9ffc206e26e5ae2843e04962b9c310db032d5cb8cd656f9399b428da76fad5cd97e0047618b9915a9044be8db62c06bdcdc31b8edf -results-int.avNE.severity.age.xls bbcaabca0e56919e97d2918d040a4115d63ab2a44ee0fe3eeb610bdbd42ad3e5c20abc2fd0f5a34d25638dfb18dc6cb06da689084cbfe01489f5071d3cd9058f -results-int.avNE.severity.xls 39f64409855ecfbfdadedb59be315d4e4bd695f541820b1c406a1e1e6e166a612e68637e8cb5f431e70de237c8dc045d92c0a6320a547f09fe0e6f156da922bd -results-noint-repeat.avNE.age.xls cc1dc689b3152e222923b4b134d45b85caa96a724bc8b6ac208f74961ca0f0bdde1bce16ee93e9fcf86b6c3a837f56e5d657c28c99d94735c73b570ea7d27e8d -results-noint-repeat.avNE.severity.adunit.xls b84ac5e6a32d862ede79eb867d4f001d9605f5b4aec5fbb0f9ecc3302b78f45e7ddbf440034e6f52a2651c5973ad5c362e5373815bd99eb72c0a2c711fd7d68f -results-noint-repeat.avNE.severity.age.xls 5012027aa4c19f19d264ae2807ff76a320ff2e82f667732199961d4e912bc3e9a41916450825e0aa2ca60b79a8da5e292a6b1def8cd720b5df23baca904d02a1 -results-noint-repeat.avNE.severity.xls 810cabe39f2d0fdc759720644ee10b871a6a1830f12bfdfe921e5395b17b64a2f77199be716192b228c286b96130f9578a6ea888ee040de64a0871b3531a6876 -results-noint.avNE.age.xls cc1dc689b3152e222923b4b134d45b85caa96a724bc8b6ac208f74961ca0f0bdde1bce16ee93e9fcf86b6c3a837f56e5d657c28c99d94735c73b570ea7d27e8d -results-noint.avNE.severity.adunit.xls b84ac5e6a32d862ede79eb867d4f001d9605f5b4aec5fbb0f9ecc3302b78f45e7ddbf440034e6f52a2651c5973ad5c362e5373815bd99eb72c0a2c711fd7d68f -results-noint.avNE.severity.age.xls 5012027aa4c19f19d264ae2807ff76a320ff2e82f667732199961d4e912bc3e9a41916450825e0aa2ca60b79a8da5e292a6b1def8cd720b5df23baca904d02a1 -results-noint.avNE.severity.xls 810cabe39f2d0fdc759720644ee10b871a6a1830f12bfdfe921e5395b17b64a2f77199be716192b228c286b96130f9578a6ea888ee040de64a0871b3531a6876 \ No newline at end of file +results-int.avNE.age.xls df5a1236ef07c4bcac1e4c325d2cbdf426001384515c5e53c5e0cb612651a77e46a1e516c458c3bc3201adc025006ed515748b0eb07af8d4caa5c95bbcabe647 +results-int.avNE.severity.adunit.xls 9480c6e7d07e1094d3fc27c7a89a4e152631d6b352a1e250ec92871cc578a23ba1e403db63af77dd84cfd10642465342ba18bdecd82112a1105889c300e65565 +results-int.avNE.severity.age.xls 55d1b2e18b6b7a2f6cfb2c6528ea37b36fdfdc3be6e7a4a7705c857a4dbb9f7bd3768323bc5e0a19865c67a816bc935b58ed7a8557484d33c3237aa160710039 +results-int.avNE.severity.xls 3ad023cb98f0daa326f05802e580743d997b16d9bef639a862bd416d4d480e80a2e33846365bf7b5525771cdc9936c4428db63d9cc36d9728f88bfdf99723de4 +results-noint-repeat.avNE.age.xls 3941689e96753eafad66153611ad5ce47db33d18ac3a43f345d46f74d939e428e31808961d6d0e725eea204eefb915e694eed67a6b39ded751d7e4c04fb8b0dd +results-noint-repeat.avNE.severity.adunit.xls 14a76787f879f81907a0cef737a6ebd58ad195f672665826546d510ed2a4c0d0d7420d0d879f479f11ad2dacc79e692d0884984c506e4187a78a6774620cfafa +results-noint-repeat.avNE.severity.age.xls 4dc75334d2cfe8f794eef8e72160a272977350e5c7f5f59b9cbf729a2b754a63913f24abc3afe78ff2e9b8919b0e38c2ee3358673def0ad550f37db5c1d79521 +results-noint-repeat.avNE.severity.xls d857f0e043673ec36e9706d5072c2659065d45c4c948c472cf29d9436c8c17c521c00d9621492ddc0223e65f213b2d6866ccb04a9d31dd710d246564a8ee9f3d +results-noint.avNE.age.xls 3941689e96753eafad66153611ad5ce47db33d18ac3a43f345d46f74d939e428e31808961d6d0e725eea204eefb915e694eed67a6b39ded751d7e4c04fb8b0dd +results-noint.avNE.severity.adunit.xls 14a76787f879f81907a0cef737a6ebd58ad195f672665826546d510ed2a4c0d0d7420d0d879f479f11ad2dacc79e692d0884984c506e4187a78a6774620cfafa +results-noint.avNE.severity.age.xls 4dc75334d2cfe8f794eef8e72160a272977350e5c7f5f59b9cbf729a2b754a63913f24abc3afe78ff2e9b8919b0e38c2ee3358673def0ad550f37db5c1d79521 +results-noint.avNE.severity.xls d857f0e043673ec36e9706d5072c2659065d45c4c948c472cf29d9436c8c17c521c00d9621492ddc0223e65f213b2d6866ccb04a9d31dd710d246564a8ee9f3d