Health-GPS  1.2.2.0
Global Health Policy Simulation model (Health-GPS)
hgps::PolicyInterval Struct Reference

Defines the policy active interval. More...

#include <intervention_scenario.h>

Public Member Functions

 PolicyInterval (int start_at_time, std::optional< int > finish_at_time=std::nullopt)
 Initialise a new instance of the PolicyInterval structure. More...
 
bool contains (const int &time) const noexcept
 Determine whether this interval contains a given time. More...
 

Public Attributes

int start_time {}
 The intervention start time. More...
 
std::optional< int > finish_time {}
 The intervention finish time, if given, or no upper bound. More...
 

Detailed Description

Defines the policy active interval.

Constructor & Destructor Documentation

◆ PolicyInterval()

hgps::PolicyInterval::PolicyInterval ( int  start_at_time,
std::optional< int >  finish_at_time = std::nullopt 
)
inline

Initialise a new instance of the PolicyInterval structure.

Parameters
start_at_timeIntervention start time, inclusive
finish_at_timeIntervention finish time, or no upper bound
Exceptions
std::out_of_rangefor policy with negative start time or finishing before start time

Member Function Documentation

◆ contains()

bool hgps::PolicyInterval::contains ( const int &  time) const
inlinenoexcept

Determine whether this interval contains a given time.

Parameters
timeThe time to check
Returns
true, if the time is in the interval range; otherwise, false.
Here is the caller graph for this function:

Member Data Documentation

◆ finish_time

std::optional<int> hgps::PolicyInterval::finish_time {}

The intervention finish time, if given, or no upper bound.

◆ start_time

int hgps::PolicyInterval::start_time {}

The intervention start time.


The documentation for this struct was generated from the following file: