FRED
Age_Map Class Reference

#include <Age_Map.h>

List of all members.

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

Detailed Description

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


Constructor & Destructor Documentation

Age_Map::Age_Map ( )

Default constructor

Age_Map::Age_Map ( string  Name)

Constructor that sets the Age_Map's name attribute

Parameters:
Namethe name of the Age_Map

Member Function Documentation

void Age_Map::add_value ( int  lower_age,
int  upper_age,
double  val 
)

Add a value to the Age_Map

Parameters:
lower_agethe lower bound for the key
upper_agethe upper bound for the key
valwhat 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.

Parameters:
agethe age to find
Returns:
the found value
int Age_Map::get_maximum_age ( void  ) const
Returns:
the maximum age in the age range vector
int Age_Map::get_minimum_age ( void  ) const
Returns:
the minimum age in the age range vector
int Age_Map::get_num_ages ( ) const [inline]
Returns:
the size of the age range vector
bool Age_Map::is_empty ( ) const [inline]
Returns:
whether or not the age range vector is empty
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)
Parameters:
Inputa 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)

Parameters:
Inputa string that will be parsed to use for a parameter lookup
ian index that will be appended
jan 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)

Parameters:
Inputa string that will be parsed to use for a parameter lookup
ian index that will be appended

The documentation for this class was generated from the following files:
 All Classes Functions