Skip to content

Commit

Permalink
Tidy up some comments
Browse files Browse the repository at this point in the history
The clangformat auto-applied patch produced some untidily formatted
comments.  This commit tidies up the ones I spotted.
  • Loading branch information
Matthew Gretton-Dann committed Jun 18, 2020
1 parent fd64119 commit cecd109
Show file tree
Hide file tree
Showing 16 changed files with 378 additions and 393 deletions.
4 changes: 1 addition & 3 deletions src/Bitmap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,7 @@
#include "Model.h"
#include "Param.h"

//// **** //// **** //// **** //// **** //// **** //// **** //// **** //// **** //// **** //// ****
/////// **** //// **** //// **** //// **** //// **** //// **** //// **** //// **** / **** BITMAP
///stuff.
//// **** BITMAP stuff

#ifdef _WIN32
// HAVI avi;
Expand Down
20 changes: 10 additions & 10 deletions src/CalcInfSusc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@
#include "ModelMacros.h"
#include "Param.h"

//// Infectiousness functions (House, Place, Spatial, Person). Idea is that in addition to a
///person's personal infectiousness, they have separate "infectiousnesses" for their house, place
///and on other cells (spatial). / These functions consider one person only. A person has an
///infectiousness that is independent of other people. Slightly different therefore than
///susceptibility functions.
/// Infectiousness functions (House, Place, Spatial, Person). Idea is that in addition to a
/// person's personal infectiousness, they have separate "infectiousnesses" for their house, place
/// and on other cells (spatial). / These functions consider one person only. A person has an
/// infectiousness that is independent of other people. Slightly different therefore than
/// susceptibility functions.
double CalcHouseInf(int j, unsigned short int ts)
{
return ((HOST_ISOLATED(j) && (Hosts[j].digitalContactTraced != 1))
Expand Down Expand Up @@ -54,11 +54,11 @@ double CalcPersonInf(int j, unsigned short int ts)
fabs(Hosts[j].infectiousness) * P.infectiousness[ts - Hosts[j].latent_time - 1];
}

//// Susceptibility functions (House, Place, Spatial, Person). Similarly, idea is that in addition
///to a person's personal susceptibility, they have separate "susceptibilities" for their house,
///place and on other cells (spatial) / These functions consider two people. A person has a
///susceptibility TO ANOTHER PERSON/infector. Slightly different therefore than infectiousness
///functions.
/// Susceptibility functions (House, Place, Spatial, Person). Similarly, idea is that in addition
/// to a person's personal susceptibility, they have separate "susceptibilities" for their house,
/// place and on other cells (spatial) / These functions consider two people. A person has a
/// susceptibility TO ANOTHER PERSON/infector. Slightly different therefore than infectiousness
/// functions.
double CalcHouseSusc(int ai, unsigned short int ts, int infector, int tn)
{
return CalcPersonSusc(ai, ts, infector, tn) *
Expand Down
5 changes: 3 additions & 2 deletions src/Constants.h
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,8 @@ const int NNA = 10;
const int MIN_HOTELS_PER_AIRPORT = 20;
const int HOTELS_PER_1000PASSENGER = 10;

const int MAX_NUM_INTERVENTION_CHANGE_TIMES =
100; // may want to make this intervention-specifc, but keep simple for now.
/// Max number of intervention changes possible. May want to make this
/// intervention-specific, but keep simple for now.
const int MAX_NUM_INTERVENTION_CHANGE_TIMES = 100;

#endif // COVIDSIM_CONSTANTS_H_INCLUDED_
205 changes: 93 additions & 112 deletions src/CovidSim.cpp

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/Dist.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ double sinx[361], cosx[361], asin2sqx[1001];

//// **** //// **** //// **** //// **** //// **** //// **** //// **** //// **** //// **** //// ****
/////// **** //// **** //// **** //// **** //// **** //// **** //// **** //// **** / **** DISTANCE
///FUNCTIONS (return distance-squared, which is input for every Kernel function) / **** //// ****
/// FUNCTIONS (return distance-squared, which is input for every Kernel function) / **** //// ****
/////// **** //// **** //// **** //// **** //// **** //// **** //// **** //// **** //// **** ////
///**** //// **** //// **** //// **** //// **** //// **** //// ****

Expand Down
6 changes: 3 additions & 3 deletions src/InfStat.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
#define COVIDSIM_INFSTAT_H_INCLUDED_

//// Infection Status definitions / labels (generally positive value indicates asymptomatic
///infection, / negative value indicates symptomatic infection).
/// infection, / negative value indicates symptomatic infection).

enum InfStat
{

//// Note - DO NOT CHANGE these definitions without accounting for "Quarantined not Infected" /
//// "Quarantined not symptomatic" calculation: relies on value below being negative for
///symptomatic people.
/// symptomatic people.

//// Susceptible
InfStat_Susceptible = 0,
Expand All @@ -28,7 +28,7 @@ enum InfStat
//// InfStat_Recovered (will use this for abs() values) so code reads correctly
InfStat_Recovered = 3,
//// Immune at start of epidemic - used to model partially immune population. Distinct from
///recovered, who recovered during runtime. Doesn't take negative values.
/// recovered, who recovered during runtime. Doesn't take negative values.
InfStat_ImmuneAtStart = 4,
//// Dead was asymptomatic
InfStat_Dead_WasAsymp = 5,
Expand Down
2 changes: 1 addition & 1 deletion src/Kernels.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ void InitKernel(double norm)

//// **** //// **** //// **** //// **** //// **** //// **** //// **** //// **** //// **** //// ****
/////// **** //// **** //// **** //// **** //// **** //// **** //// **** //// **** / **** KERNEL
///DEFINITIONS
/// DEFINITIONS

double ExpKernel(double r2)
{
Expand Down
18 changes: 9 additions & 9 deletions src/Model.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
#include "Models/Person.h"

//// need to test that inequalities in IncubRecoverySweep can be replaced if you initialize to
///USHRT_MAX, rather than zero. / need to output quantities by admin unit
/// USHRT_MAX, rather than zero. / need to output quantities by admin unit

#pragma pack(push, 2)

Expand Down Expand Up @@ -62,7 +62,7 @@ struct PopVar
int cumC_country[MAX_COUNTRIES]; // added cumulative cases by country: ggilani 12/11/14
int cumHQ, cumAC, cumAA, cumAH, cumACS, cumAPC, cumAPA, cumAPCS;
//// age specific versions of above variables. e.g. cumI is cumulative infections. cumIa is
///cumulative infections by age group.
/// cumulative infections by age group.
int cumIa[NUM_AGE_GROUPS], cumCa[NUM_AGE_GROUPS], cumDa[NUM_AGE_GROUPS];
int cumI_adunit[MAX_ADUNITS], cumC_adunit[MAX_ADUNITS], cumD_adunit[MAX_ADUNITS],
cumT_adunit[MAX_ADUNITS], cumH_adunit[MAX_ADUNITS],
Expand Down Expand Up @@ -94,9 +94,9 @@ struct PopVar
ContactEvent *dct_queue[MAX_ADUNITS]; // queues for digital contact tracing: ggilani 14/04/20
int ndct_queue[MAX_ADUNITS]; // queues for digital contact tracing: ggilani 10/03/20
int contact_dist[MAX_CONTACTS + 1]; // added this to store contact distribution: ggilani
// 13/04/20
double *origin_dest[MAX_ADUNITS]; // added intermediate storage for calculation of
// origin-destination matrix: ggilani 02/02/15
// 13/04/20
double *origin_dest[MAX_ADUNITS]; // added intermediate storage for calculation of
// origin-destination matrix: ggilani 02/02/15

///// Prevalence quantities (+ by admin unit)
int Mild, ILI, SARI, Critical, CritRecov, /*cumulative incidence*/ cumMild, cumILI, cumSARI,
Expand Down Expand Up @@ -232,7 +232,7 @@ struct Results
//// ii) RecordSample: add to incidence / Timeseries).
//// iii) SaveResults and SaveSummary results.
///// need to update these quantities in InitModel (DONE), Record Sample (DONE) (and of course
///places where you need to increment, decrement).
/// places where you need to increment, decrement).
};

// The offset (in number of doubles) of the first double field in Results.
Expand Down Expand Up @@ -356,9 +356,9 @@ extern AdminUnit AdUnits[MAX_ADUNITS];

//// Time Series defs:
//// TimeSeries is an array of type results, used to store (unsurprisingly) a time series of every
///quantity in results. Mostly used in RecordSample. / TSMeanNE and TSVarNE are the mean and
///variance of non-extinct time series. TSMeanE and TSVarE are the mean and variance of extinct time
///series. TSMean and TSVar are pointers that point to either extinct or non-extinct.
/// quantity in results. Mostly used in RecordSample. / TSMeanNE and TSVarNE are the mean and
/// variance of non-extinct time series. TSMeanE and TSVarE are the mean and variance of extinct
/// time series. TSMean and TSVar are pointers that point to either extinct or non-extinct.
extern Results *TimeSeries, *TSMean, *TSVar, *TSMeanNE, *TSVarNE, *TSMeanE,
*TSVarE; //// TimeSeries used in RecordSample, RecordInfTypes, SaveResults. TSMean and TSVar

Expand Down
2 changes: 1 addition & 1 deletion src/Models/Cell.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ struct Cell
int n, S, L, I, R, D, cumTC, S0, tot_treat, tot_vacc;
int *members, *susceptible, *latent,
*infected; //// pointers to people in cell. e.g. *susceptible identifies where the final
///susceptible member of cel is.
/// susceptible member of cel is.
int *InvCDF;
float tot_prob, *cum_trans, *max_trans;
short int CurInterv[MAX_INTERVENTION_TYPES];
Expand Down
14 changes: 7 additions & 7 deletions src/Models/Person.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ struct Person
int listpos; // Goes up to at least MAX_SEC_REC, also used as a temp variable?

int PlaceLinks[NUM_PLACE_TYPES]; //// indexed by i) place type. Value is the number of that
///place type (e.g. school no. 17; office no. 310 etc.)
///Place[i][person->PlaceLinks[i]], can be up to P.Nplace[i]
/// place type (e.g. school no. 17; office no. 310 etc.)
/// Place[i][person->PlaceLinks[i]], can be up to P.Nplace[i]
float infectiousness, susc, ProbAbsent, ProbCare;

unsigned int esocdist_comply : 1;
Expand All @@ -28,8 +28,8 @@ struct Person
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)
/// 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
Expand All @@ -48,8 +48,8 @@ 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.
/// 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;
Expand All @@ -58,5 +58,5 @@ struct Person
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
// ggilani 13/04/20
};
77 changes: 39 additions & 38 deletions src/Param.h
Original file line number Diff line number Diff line change
Expand Up @@ -267,29 +267,29 @@ struct Param
(enhanced) social distancing */
double SD_SpatialEffects_OverTime
[MAX_NUM_INTERVENTION_CHANGE_TIMES]; //// time-varying equivalent of
///SocDistSpatialEffectCurrent
/// SocDistSpatialEffectCurrent
double SD_HouseholdEffects_OverTime
[MAX_NUM_INTERVENTION_CHANGE_TIMES]; //// time-varying equivalent of
///SocDistHouseholdEffectCurrent
/// SocDistHouseholdEffectCurrent
double SD_PlaceEffects_OverTime[MAX_NUM_INTERVENTION_CHANGE_TIMES]
[NUM_PLACE_TYPES]; //// indexed by i) change time; ii) place
///type; //// time-varying equivalent of
///SocDistPlaceEffectCurrent
/// type; //// time-varying equivalent of
/// SocDistPlaceEffectCurrent
int SD_CellIncThresh_OverTime[MAX_NUM_INTERVENTION_CHANGE_TIMES]; //// time-varying equivalent
///of SocDistCellIncThresh
/// of SocDistCellIncThresh

/**< enhanced */
double Enhanced_SD_SpatialEffects_OverTime
[MAX_NUM_INTERVENTION_CHANGE_TIMES]; //// time-varying equivalent of
///EnhancedSocDistSpatialEffectCurrent
/// EnhancedSocDistSpatialEffectCurrent
double Enhanced_SD_HouseholdEffects_OverTime
[MAX_NUM_INTERVENTION_CHANGE_TIMES]; //// time-varying equivalent of
///EnhancedSocDistHouseholdEffectCurrent
/// EnhancedSocDistHouseholdEffectCurrent
double
Enhanced_SD_PlaceEffects_OverTime[MAX_NUM_INTERVENTION_CHANGE_TIMES]
[NUM_PLACE_TYPES]; //// indexed by i) change time; ii)
///place type; time-varying equivalent
///of EnhancedSocDistPlaceEffectCurrent
/// place type; time-varying equivalent
/// of EnhancedSocDistPlaceEffectCurrent

int Num_CI_ChangeTimes; //// must be at most MAX_NUM_INTERVENTION_CHANGE_TIMES
int Num_HQ_ChangeTimes; //// must be at most MAX_NUM_INTERVENTION_CHANGE_TIMES
Expand All @@ -301,76 +301,77 @@ struct Param
case isolation */
double CI_SpatialAndPlaceEffects_OverTime
[MAX_NUM_INTERVENTION_CHANGE_TIMES]; //// time-varying equivalent of
///CaseIsolationEffectiveness
/// CaseIsolationEffectiveness
double CI_HouseholdEffects_OverTime
[MAX_NUM_INTERVENTION_CHANGE_TIMES]; //// time-varying equivalent of
///CaseIsolationHouseEffectiveness
/// CaseIsolationHouseEffectiveness
double CI_Prop_OverTime[MAX_NUM_INTERVENTION_CHANGE_TIMES]; //// time-varying equivalent of
///CaseIsolationProp
double
CI_CellIncThresh_OverTime[MAX_NUM_INTERVENTION_CHANGE_TIMES]; //// time-varying equivalent
///of
///CaseIsolation_CellIncThresh
/// CaseIsolationProp
double CI_CellIncThresh_OverTime
[MAX_NUM_INTERVENTION_CHANGE_TIMES]; //// time-varying equivalent
/// of
/// CaseIsolation_CellIncThresh

/**< HOUSEHOLD QUARANTINE */
double HQ_ChangeTimes[MAX_NUM_INTERVENTION_CHANGE_TIMES]; /**< change times for intensity of
household quarantine */
double
HQ_SpatialEffects_OverTime[MAX_NUM_INTERVENTION_CHANGE_TIMES]; //// time-varying equivalent
///of
///HQuarantineSpatialEffect
/// of
/// HQuarantineSpatialEffect
double HQ_HouseholdEffects_OverTime
[MAX_NUM_INTERVENTION_CHANGE_TIMES]; //// time-varying equivalent of HQuarantineHouseEffect
double HQ_PlaceEffects_OverTime[MAX_NUM_INTERVENTION_CHANGE_TIMES]
[NUM_PLACE_TYPES]; //// indexed by i) change time; ii) place
///type; time-varying equivalent of
///HQuarantinePlaceEffect
/// type; time-varying equivalent of
/// HQuarantinePlaceEffect
double HQ_Individual_PropComply_OverTime
[MAX_NUM_INTERVENTION_CHANGE_TIMES]; //// time-varying equivalent of
///HQuarantinePropIndivCompliant
/// HQuarantinePropIndivCompliant
double HQ_Household_PropComply_OverTime
[MAX_NUM_INTERVENTION_CHANGE_TIMES]; //// time-varying equivalent of
///HQuarantinePropHouseCompliant
/// HQuarantinePropHouseCompliant
double
HQ_CellIncThresh_OverTime[MAX_NUM_INTERVENTION_CHANGE_TIMES]; //// time-varying equivalent
///of HHQuar_CellIncThresh
/// of HHQuar_CellIncThresh

/**< PLACE CLOSURE */
double PC_ChangeTimes[MAX_NUM_INTERVENTION_CHANGE_TIMES]; /**< change times for intensity of
place closure */
double PC_SpatialEffects_OverTime
[MAX_NUM_INTERVENTION_CHANGE_TIMES]; //// time-varying equivalent of
///PlaceCloseSpatialRelContact
/// PlaceCloseSpatialRelContact
double PC_HouseholdEffects_OverTime
[MAX_NUM_INTERVENTION_CHANGE_TIMES]; //// time-varying equivalent of
///PlaceCloseHouseholdRelContact
/// PlaceCloseHouseholdRelContact
double PC_PlaceEffects_OverTime[MAX_NUM_INTERVENTION_CHANGE_TIMES]
[NUM_PLACE_TYPES]; //// indexed by i) change time; ii) place
///type; //// time-varying equivalent of
///PlaceCloseEffect
/// type; //// time-varying equivalent of
/// PlaceCloseEffect
double PC_PropAttending_OverTime[MAX_NUM_INTERVENTION_CHANGE_TIMES][NUM_PLACE_TYPES];
int PC_IncThresh_OverTime[MAX_NUM_INTERVENTION_CHANGE_TIMES]; //// time-varying equivalent of
///PlaceCloseIncTrig /
///PlaceCloseIncTrig1
/// PlaceCloseIncTrig /
/// PlaceCloseIncTrig1
double
PC_FracIncThresh_OverTime[MAX_NUM_INTERVENTION_CHANGE_TIMES]; //// time-varying equivalent
///of PlaceCloseFracIncTrig
/// of PlaceCloseFracIncTrig
int PC_CellIncThresh_OverTime[MAX_NUM_INTERVENTION_CHANGE_TIMES]; //// time-varying equivalent
///of PlaceCloseCellIncThresh
/// of PlaceCloseCellIncThresh
double PC_Durs_OverTime[MAX_NUM_INTERVENTION_CHANGE_TIMES]; //// time-varying equivalent of
///PlaceCloseDuration
/// PlaceCloseDuration

/**< DIGITAL CONTACT TRACING */
double DCT_ChangeTimes[MAX_NUM_INTERVENTION_CHANGE_TIMES]; /**< change times for intensity of
digital contact tracing */
double DCT_SpatialAndPlaceEffects_OverTime
[MAX_NUM_INTERVENTION_CHANGE_TIMES]; //// time-varying equivalent of
///DCTCaseIsolationEffectiveness
/// DCTCaseIsolationEffectiveness
double DCT_HouseholdEffects_OverTime
[MAX_NUM_INTERVENTION_CHANGE_TIMES]; //// time-varying equivalent of
///DCTCaseIsolationHouseEffectiveness
double DCT_Prop_OverTime[MAX_NUM_INTERVENTION_CHANGE_TIMES]; //// time-varying equivalent of
///ProportionDigitalContactsIsolate
/// DCTCaseIsolationHouseEffectiveness
double
DCT_Prop_OverTime[MAX_NUM_INTERVENTION_CHANGE_TIMES]; //// time-varying equivalent of
/// ProportionDigitalContactsIsolate
int DCT_MaxToTrace_OverTime[MAX_NUM_INTERVENTION_CHANGE_TIMES];

double KeyWorkerProphTimeStart, KeyWorkerProphDuration,
Expand Down Expand Up @@ -431,7 +432,7 @@ struct Param
int WindowToEvaluateTriggerAlert; // Number of days to accummulate cases/deaths before alert
int DoAlertTriggerAfterInterv; // Alert trigger starts after interventions, i.e. were there
// interventions before date specified in
// DateTriggerReached_CalTime / "Day of year trigger is reached"?
// DateTriggerReached_CalTime / "Day of year trigger is reached"?
int AlertTriggerAfterIntervThreshold; // initialized to CaseOrDeathThresholdBeforeAlert (i.e.
// number cases or deaths accumulated before alert).

Expand Down Expand Up @@ -465,7 +466,7 @@ struct Param
int DoRecordInfEvents, MaxInfEvents, RecordInfEventsPerRun;
unsigned short int usHQuarantineHouseDuration, usVaccTimeToEfficacy,
usVaccTimeEfficacySwitch; //// us = unsigned short versions of their namesakes, multiplied
///by P.TimeStepsPerDay
/// by P.TimeStepsPerDay
unsigned short int usCaseIsolationDuration, usCaseIsolationDelay, usCaseAbsenteeismDuration,
usCaseAbsenteeismDelay, usAlignDum; // last is for 8 byte alignment

Expand Down
Loading

0 comments on commit cecd109

Please sign in to comment.