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 e69bc90 commit 5648898
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 93 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
70 changes: 17 additions & 53 deletions src/CovidSim.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,12 +69,8 @@ int GetInputParameter3(FILE *, const char *, const char *, void *, int, int, int

void SetICDF(double *icdf, double startValue);

///// ***** ///// ***** ///// ***** ///// ***** ///// ***** ///// ***** ///// ***** ///// *****
//////// ***** ///// ***** ///// ***** ///// ***** /////
///// ***** ///// ***** ///// ***** ///// ***** ///// ***** GLOBAL VARIABLES (some structures in
/// CovidSim.h file and some containers) - memory allocated later.
///// ***** ///// ***** ///// ***** ///// ***** ///// ***** ///// ***** ///// ***** ///// *****
//////// ***** ///// ***** ///// ***** ///// ***** /////
//// **** GLOBAL VARIABLES (some structures in CovidSim.h file and some containers)
//// **** - memory allocated later.

Param P;
Person *Hosts;
Expand Down Expand Up @@ -374,10 +370,7 @@ int main(int argc, char *argv[])
"[/R:R0scaling] SetupSeed1 SetupSeed2 RunSeed1 RunSeed2\n",
argv[0]);

//// **** //// **** //// **** //// **** //// **** //// **** //// **** //// **** //// **** ////
///**** //// **** //// **** //// **** //// **** / **** SET UP OMP / THREADS / **** //// ****
/////// **** //// **** //// **** //// **** //// **** //// **** //// **** //// **** //// ****
/////// **** //// **** //// ****
//// **** SET UP OMP / THREADS

#ifdef _OPENMP
P.NumThreads = omp_get_max_threads();
Expand Down Expand Up @@ -406,10 +399,7 @@ int main(int argc, char *argv[])
sprintf(PreParamFile, ".." DIRECTORY_SEPARATOR "Pre_%s", ParamFile);
}

//// **** //// **** //// **** //// **** //// **** //// **** //// **** //// **** //// **** ////
///**** //// **** //// **** //// **** //// **** / **** READ IN PARAMETERS, DATA ETC. / **** ////
///**** //// **** //// **** //// **** //// **** //// **** //// **** //// **** //// **** //// ****
/////// **** //// **** //// ****
//// **** READ IN PARAMETERS, DATA ETC.

P.NumRealisations = GotNR;
ReadParams(ParamFile, PreParamFile);
Expand All @@ -425,10 +415,7 @@ int main(int argc, char *argv[])
ReadAirTravel(AirTravelFile);
}

//// **** //// **** //// **** //// **** //// **** //// **** //// **** //// **** //// **** ////
///**** //// **** //// **** //// **** //// **** / **** INITIALIZE / **** //// **** //// **** ////
///**** //// **** //// **** //// **** //// **** //// **** //// **** //// **** //// **** //// ****
/////// ****
//// **** INITIALIZE

///// initialize model (for all realisations).
SetupModel(DensityFile, NetworkFile, SchoolFile, RegDemogFile);
Expand All @@ -443,10 +430,7 @@ int main(int argc, char *argv[])

// print out number of calls to random number generator

//// **** //// **** //// **** //// **** //// **** //// **** //// **** //// **** //// **** ////
///**** //// **** //// **** //// **** //// **** / **** RUN MODEL / **** //// **** //// **** ////
///**** //// **** //// **** //// **** //// **** //// **** //// **** //// **** //// **** //// ****
/////// ****
//// **** RUN MODEL

P.NRactE = P.NRactNE = 0;
for (i = 0; (i < P.NumRealisations) && (P.NRactNE < P.NumNonExtinctRealisations); i++)
Expand Down Expand Up @@ -2237,11 +2221,7 @@ void ReadParams(char *ParamFile, char *PreParamFile)
}
}

///// **** ///// **** ///// **** ///// **** ///// **** ///// **** ///// **** ///// **** ///// ****
//////// **** ///// **** ///// ****
///// **** DIGITAL CONTACT TRACING
///// **** ///// **** ///// **** ///// **** ///// **** ///// **** ///// **** ///// **** ///// ****
//////// **** ///// **** ///// ****
//// **** DIGITAL CONTACT TRACING

// New code for digital contact tracing - ggilani: 09/03/20
if (!GetInputParameter2(ParamFile_dat, PreParamFile_dat, "Include digital contact tracing", "%i",
Expand Down Expand Up @@ -2400,11 +2380,7 @@ void ReadParams(char *ParamFile, char *PreParamFile)
P.ScalingFactorPlaceDigitalContacts = 1;
}

///// **** ///// **** ///// **** ///// **** ///// **** ///// **** ///// **** ///// **** ///// ****
//////// **** ///// **** ///// ****
///// **** PLACE CLOSURE
///// **** ///// **** ///// **** ///// **** ///// **** ///// **** ///// **** ///// **** ///// ****
//////// **** ///// **** ///// ****
//// **** PLACE CLOSURE

if (!GetInputParameter2(ParamFile_dat, PreParamFile_dat,
"Trigger incidence per cell for place closure", "%i",
Expand Down Expand Up @@ -2538,11 +2514,7 @@ void ReadParams(char *ParamFile, char *PreParamFile)
P.PlaceCloseByAdminUnit = 0;
}

///// **** ///// **** ///// **** ///// **** ///// **** ///// **** ///// **** ///// **** ///// ****
//////// **** ///// **** ///// ****
///// **** SOCIAL DISTANCING
///// **** ///// **** ///// **** ///// **** ///// **** ///// **** ///// **** ///// **** ///// ****
//////// **** ///// **** ///// ****
//// **** SOCIAL DISTANCING

if (!GetInputParameter2(ParamFile_dat, PreParamFile_dat,
"Trigger incidence per cell for social distancing", "%i",
Expand Down Expand Up @@ -2668,11 +2640,7 @@ void ReadParams(char *ParamFile, char *PreParamFile)
(void *)&(P.AirportCloseDuration), 1, 1, 0))
P.AirportCloseDuration = USHRT_MAX / P.TimeStepsPerDay;

///// **** ///// **** ///// **** ///// **** ///// **** ///// **** ///// **** ///// **** ///// ****
//////// **** ///// **** ///// ****
///// **** HOUSEHOLD QUARANTINE
///// **** ///// **** ///// **** ///// **** ///// **** ///// **** ///// **** ///// **** ///// ****
//////// **** ///// **** ///// ****
//// **** HOUSEHOLD QUARANTINE

if (P.DoHouseholds)
{
Expand Down Expand Up @@ -2748,11 +2716,7 @@ void ReadParams(char *ParamFile, char *PreParamFile)
P.CaseIsolationHouseEffectiveness = P.CaseIsolationEffectiveness;
}

///// **** ///// **** ///// **** ///// **** ///// **** ///// **** ///// **** ///// **** ///// ****
//////// **** ///// **** ///// ****
///// **** VARIABLE EFFICACIES OVER TIME
///// **** ///// **** ///// **** ///// **** ///// **** ///// **** ///// **** ///// **** ///// ****
//////// **** ///// **** ///// ****
//// **** VARIABLE EFFICACIES OVER TIME

if (!GetInputParameter2(ParamFile_dat, PreParamFile_dat, "Vary efficacies over time", "%i",
(void *)&(P.VaryEfficaciesOverTime), 1, 1, 0))
Expand Down Expand Up @@ -5104,7 +5068,7 @@ void SaveResults(void)
ERR_CRITICAL("Unable to open output file\n");
fprintf(dat, "t");

/////// ****** /////// ****** /////// ****** COLNAMES
//// **** COLNAMES
//// prevalence
for (i = 0; i < P.NumAdunits; i++)
fprintf(dat, "\tMild_%s", AdUnits[i].ad_name);
Expand Down Expand Up @@ -5161,7 +5125,7 @@ void SaveResults(void)

fprintf(dat, "\n");

/////// ****** /////// ****** /////// ****** Populate table.
//// **** Populate table.
for (i = 0; i < P.NumSamples; i++)
{
fprintf(dat, "%.10f", TimeSeries[i].t);
Expand Down Expand Up @@ -5785,7 +5749,7 @@ void SaveSummaryResults(void) //// calculates and saves summary results (called
ERR_CRITICAL("Unable to open output file\n");
fprintf(dat, "t");

/////// ****** /////// ****** /////// ****** COLNAMES
//// **** COLNAMES
//// prevalance
for (i = 0; i < NUM_AGE_GROUPS; i++)
fprintf(dat, "\tMild_%i", i);
Expand Down Expand Up @@ -5854,7 +5818,7 @@ void SaveSummaryResults(void) //// calculates and saves summary results (called

fprintf(dat, "\n");

/////// ****** /////// ****** /////// ****** Populate table.
//// **** Populate table.
for (i = 0; i < P.NumSamples; i++)
{
for (j = 0; j < NUM_AGE_GROUPS; j++)
Expand Down Expand Up @@ -5990,7 +5954,7 @@ void SaveSummaryResults(void) //// calculates and saves summary results (called
ERR_CRITICAL("Unable to open output file\n");
fprintf(dat, "t");

/////// ****** /////// ****** /////// ****** COLNAMES
//// **** COLNAMES
//// prevalance
for (i = 0; i < P.NumAdunits; i++)
fprintf(dat, "\tMild_%s", AdUnits[i].ad_name);
Expand Down Expand Up @@ -6059,7 +6023,7 @@ void SaveSummaryResults(void) //// calculates and saves summary results (called

fprintf(dat, "\n");

/////// ****** /////// ****** /////// ****** Populate table.
//// **** Populate table.
for (i = 0; i < P.NumSamples; i++)
{
for (j = 0; j < P.NumAdunits; j++)
Expand Down
6 changes: 1 addition & 5 deletions src/Dist.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,7 @@

double sinx[361], cosx[361], asin2sqx[1001];

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

double periodic_xy(double x, double y)
{
Expand Down
4 changes: 1 addition & 3 deletions src/Kernels.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,7 @@ void InitKernel(double norm)
}
}

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

double ExpKernel(double r2)
{
Expand Down
6 changes: 1 addition & 5 deletions src/Rand.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,7 @@
int32_t *Xcg1, *Xcg2;
int **SamplingQueue = nullptr;

///////////// ********* ///////////// ********* ///////////// ********* ///////////// *********
//////////////// ********* ///////////// *********
/////////////////////// NEIL rand_lib code (with some Gemma rand lib also)
///////////// ********* ///////////// ********* ///////////// ********* ///////////// *********
//////////////// ********* ///////////// *********
//// **** NEIL rand_lib code (with some Gemma rand lib also)

double ranf(void)
{
Expand Down
36 changes: 12 additions & 24 deletions src/Sweep.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -303,9 +303,9 @@ void InfectSweep(double t,
///(and therefore number of new infections to) i) their house; ii) their place(s); iii) other
/// spatial cells. / Each force of infection includes infectiousness and susceptibility
/// components. / Infectiousness is (broadly) a function of 1 person (their age, treatment status,
///places, no. people in their household etc.) / Susceptibility is (broadly) a function of 2
/// people (a person's susceptibility TO ANOTHER PERSON / potential infector) / After loop 1a) over
/// infectious people, spatial infections are doled out.
/// places, no. people in their household etc.) / Susceptibility is (broadly) a function of 2
/// people (a person's susceptibility TO ANOTHER PERSON / potential infector) / After loop 1a)
/// over infectious people, spatial infections are doled out.

int n; //// number of people you could potentially infect in your place group, then number of
/// potential spatial infections doled out by cell on other cells.
Expand Down Expand Up @@ -462,9 +462,9 @@ void InfectSweep(double t,
// 1= household
// 2..NUM_PLACE_TYPES+1 = within-class/work-group place based
// transmission NUM_PLACE_TYPES+2..2*NUM_PLACE_TYPES+1 =
// between-class/work-group place based transmission 2*NUM_PLACE_TYPES+2
// = "spatial" transmission (spatially local random mixing)
// bits >4 store the generation of infection
// between-class/work-group place based transmission 2*NUM_PLACE_TYPES+2 =
// "spatial" transmission (spatially local random mixing) bits >4 store the
// generation of infection

short int infect_type =
1 + INFECT_TYPE_MASK * (1 + si->infect_type / INFECT_TYPE_MASK);
Expand Down Expand Up @@ -1820,9 +1820,7 @@ int TreatSweep(double t)
/// microcells that are within this admin unit (and around this microcell) to be treated,
/// using the flags set to avoid duplication.

//// **** //// **** //// **** //// **** //// **** //// **** //// **** //// **** //// ****
/////// **** //// **** //// **** / **** //// **** //// **** //// **** TREATMENT / **** ////
///**** //// **** //// **** //// **** //// **** //// **** //// ****
//// **** TREATMENT

if ((Mcells[b].treat == 2) && (ts >= Mcells[b].treat_end_time))
{
Expand Down Expand Up @@ -1911,9 +1909,7 @@ int TreatSweep(double t)
}
}

//// **** //// **** //// **** //// **** //// **** //// **** //// **** //// **** //// ****
/////// **** //// **** //// **** / **** //// **** //// **** //// **** VACCINATION / ****
/////// **** //// **** //// **** //// **** //// **** //// **** //// ****
//// **** VACCINATION

//// vaccinates proportion VaccProp of people in microcell (or at least adds them to
/// geovacc_queue).
Expand Down Expand Up @@ -2010,9 +2006,7 @@ int TreatSweep(double t)
}
}

//// **** //// **** //// **** //// **** //// **** //// **** //// **** //// **** //// ****
/////// **** //// **** //// **** / **** //// **** //// **** //// **** PLACE CLOSURE / ****
/////// **** //// **** //// **** //// **** //// **** //// **** //// ****
//// **** PLACE CLOSURE

///// note that here f2 bool asks whether trigger lower than stop threshold. A few blocks
/// down meaning changes to almost the opposite: asking whether trigger has exceeded
Expand Down Expand Up @@ -2124,9 +2118,7 @@ int TreatSweep(double t)
}
}

//// **** //// **** //// **** //// **** //// **** //// **** //// **** //// **** //// ****
/////// **** //// **** //// **** / **** //// **** //// **** //// **** MOVEMENT RESTRICTIONS
//// **** //// **** //// **** //// **** //// **** //// **** //// **** //// ****
//// **** MOVEMENT RESTRICTIONS

if ((Mcells[b].moverest == 2) && (ts >= Mcells[b].move_end_time))
{
Expand Down Expand Up @@ -2207,9 +2199,7 @@ int TreatSweep(double t)
}
}

//// **** //// **** //// **** //// **** //// **** //// **** //// **** //// **** //// ****
/////// **** //// **** //// **** / **** //// **** //// **** //// **** SOCIAL DISTANCING /
///**** //// **** //// **** //// **** //// **** //// **** //// **** //// ****
//// **** SOCIAL DISTANCING

if (P.DoGlobalTriggers)
f2 = (global_trig < P.SocDistCellIncStopThresh);
Expand Down Expand Up @@ -2295,9 +2285,7 @@ int TreatSweep(double t)
}
}

//// **** //// **** //// **** //// **** //// **** //// **** //// **** //// **** //// ****
/////// **** //// **** //// **** / **** //// **** //// **** //// **** KEY-WORKER PROPHYLAXIS
//// **** //// **** //// **** //// **** //// **** //// **** //// **** //// ****
//// **** KEY-WORKER PROPHYLAXIS

if ((Mcells[b].keyworkerproph == 2) && (ts >= Mcells[b].keyworkerproph_end_time))
{
Expand Down

0 comments on commit 5648898

Please sign in to comment.