Skip to content
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion src/Utils.H
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,13 @@ struct ICType {
/*! \brief Namespace with utility functions */
namespace Utils {

/*! \brief Read in test parameters in #ExaEpi::TestParams from input file */
void getTestParams(ExaEpi::TestParams& params, const std::string& prefix);
}

/*! \brief returns whether day i is a work day */
bool isWorkday(int i);

} // namespace Utils
} // namespace ExaEpi

#endif
6 changes: 5 additions & 1 deletion src/Utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
using namespace amrex;
using namespace ExaEpi;

/*! \brief Read in test parameters in #ExaEpi::TestParams from input file */
void ExaEpi::Utils::getTestParams (TestParams& params, /*!< Test parameters */
const std::string& prefix /*!< ParmParse prefix */) {
ParmParse pp(prefix);
Expand Down Expand Up @@ -83,3 +82,8 @@ void ExaEpi::Utils::getTestParams (TestParams& params, /*!< Test parameters */

pp.query("fast", params.fast);
}

bool ExaEpi::Utils::isWorkday (int i) {
// right now we work on days 0-4, rest on 5-6
return ((i % 7) < 5);
}
11 changes: 7 additions & 4 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -494,10 +494,13 @@ void runAgent () {
pc.moveAirTravel(censusData.unit_mf, air, censusData.demo);
}

// Typical day
pc.morningCommute(mask_behavior);
pc.interactDay(mask_behavior);
pc.eveningCommute(mask_behavior);
// Process daytime / nighttime interactions.
// Only do daytime interactions on weekdays
if (ExaEpi::Utils::isWorkday(i)) {
pc.morningCommute(mask_behavior);
pc.interactDay(mask_behavior);
pc.eveningCommute(mask_behavior);
}
Comment on lines +499 to +505
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you want to make this change in AgentContainer::interactDay() instead (put the isWorkDay condition around the lines calling work, school, and work neighborhood interactions? We can then later add social interactions for the !workDay case.

pc.interactEvening(mask_behavior);
pc.interactNight(mask_behavior);

Expand Down
Loading