FRED
|
#include <Age_Map.h>
Public Member Functions | |
Age_Map () | |
Age_Map (string Name) | |
int | get_num_ages () const |
int | get_minimum_age () const |
int | get_maximum_age () const |
bool | is_empty () const |
void | read_from_input (string Input) |
void | read_from_input (string Input, int i) |
void | read_from_input (string Input, int i, int j) |
void | add_value (int lower_age, int upper_age, double val) |
double | find_value (int age) const |
void | print () const |
bool | quality_control () const |
Class used to map a range of ages to a given value. These often come from the parameters file and are structured like in the following example:
vaccine_dose_efficacy_ages[0][0] = 4 0 4 5 100
vaccine_dose_efficacy_values[0][0] = 2 0.70 0.83
In this example, the ages 0 - 4 would map to value 0.70 and ages 5 - 100 would map to 0.83
Age_Map::Age_Map | ( | ) |
Default constructor
Age_Map::Age_Map | ( | string | Name | ) |
Constructor that sets the Age_Map's name attribute
Name | the name of the Age_Map |
void Age_Map::add_value | ( | int | lower_age, |
int | upper_age, | ||
double | val | ||
) |
Add a value to the Age_Map
lower_age | the lower bound for the key |
upper_age | the upper bound for the key |
val | what value should be returned |
double Age_Map::find_value | ( | int | age | ) | const |
Tries to find a value given an age. If the age falls within an lower and upper bound for a given age range, then the associated value is returned. Will return 0.0 if no matching range is found.
age | the age to find |
int Age_Map::get_maximum_age | ( | void | ) | const |
int Age_Map::get_minimum_age | ( | void | ) | const |
int Age_Map::get_num_ages | ( | ) | const [inline] |
bool Age_Map::is_empty | ( | ) | const [inline] |
void Age_Map::print | ( | ) | const |
Print out information about this object
bool Age_Map::quality_control | ( | ) | const |
Perform validation on the Age_Map. First check to see there are a proper number of values for each age. Next checks that the ages groups are correct, the low and high ages are right. Last, makes sure the age groups are mutually exclusive.
void Age_Map::read_from_input | ( | string | Input | ) |
Input | a string that will be parsed to use for a parameter lookup |
void Age_Map::read_from_input | ( | string | Input, |
int | i, | ||
int | j | ||
) |
Will concatenate tow indices onto the input string and then pass to Age_Map::read_from_input(string Input)
Input | a string that will be parsed to use for a parameter lookup |
i | an index that will be appended |
j | an index that will be appended |
void Age_Map::read_from_input | ( | string | Input, |
int | i | ||
) |
Will concatenate an index onto the input string and then pass to Age_Map::read_from_input(string Input)
Input | a string that will be parsed to use for a parameter lookup |
i | an index that will be appended |