Gadget
Public Member Functions | List of all members
ModelVariable Class Reference

This is the base class used to calculate the value of variables used in the model simulation that are based on other values within the model. This can be used to calculate values that can change due to time (using the TimeVariable class) or values that are based on stock population (using the StockVariable class). More...

#include <modelvariable.h>

Collaboration diagram for ModelVariable:
Collaboration graph

Public Member Functions

 ModelVariable ()
 This is the default ModelVariable constructor. More...
 
 ~ModelVariable ()
 This is the default ModelVariable destructor. More...
 
virtual void read (CommentStream &infile, const TimeClass *const TimeInfo, Keeper *const keeper)
 This function will read ModelVariable data from file. More...
 
 operator double () const
 This operator will return the value of the ModelVariable. More...
 
void Interchange (ModelVariable &newMV, Keeper *const keeper) const
 This function will swap the ModelVariable value for a new value. More...
 
void setValue (double newValue)
 This function will update the ModelVariable value. More...
 
void Update (const TimeClass *const TimeInfo)
 This function will update the ModelVariable value. More...
 
void Delete (Keeper *const keeper) const
 This function will delete a ModelVariable value. More...
 
int didChange (const TimeClass *const TimeInfo)
 This function will check to see if the ModelVariable value has changed. More...
 
MVType getMVType () const
 This will return the type of model variable to be used. More...
 

Detailed Description

This is the base class used to calculate the value of variables used in the model simulation that are based on other values within the model. This can be used to calculate values that can change due to time (using the TimeVariable class) or values that are based on stock population (using the StockVariable class).

Note
This will always be overridden by the derived classes that actually calculate the model values

Constructor & Destructor Documentation

◆ ModelVariable()

ModelVariable::ModelVariable ( )

This is the default ModelVariable constructor.

◆ ~ModelVariable()

ModelVariable::~ModelVariable ( )
inline

This is the default ModelVariable destructor.

Member Function Documentation

◆ Delete()

void ModelVariable::Delete ( Keeper *const  keeper) const

This function will delete a ModelVariable value.

Parameters
keeperis the Keeper for the current model

◆ didChange()

int ModelVariable::didChange ( const TimeClass *const  TimeInfo)

This function will check to see if the ModelVariable value has changed.

Parameters
TimeInfois the TimeClass for the current model
Returns
1 if the values have changed, 0 otherwise

◆ getMVType()

MVType ModelVariable::getMVType ( ) const
inline

This will return the type of model variable to be used.

Returns
sitype

◆ Interchange()

void ModelVariable::Interchange ( ModelVariable newMV,
Keeper *const  keeper 
) const

This function will swap the ModelVariable value for a new value.

Parameters
newMVis the new ModelVariable value
keeperis the Keeper for the current model

◆ operator double()

ModelVariable::operator double ( ) const
inline

This operator will return the value of the ModelVariable.

Returns
the value of the ModelVariable

◆ read()

void ModelVariable::read ( CommentStream infile,
const TimeClass *const  TimeInfo,
Keeper *const  keeper 
)
virtual

This function will read ModelVariable data from file.

Parameters
infileis the CommentStream to read the data from
TimeInfois the TimeClass for the current model
keeperis the Keeper for the current model

◆ setValue()

void ModelVariable::setValue ( double  newValue)

This function will update the ModelVariable value.

Parameters
newValueis the new value of the ModelVariable value

◆ Update()

void ModelVariable::Update ( const TimeClass *const  TimeInfo)

This function will update the ModelVariable value.

Parameters
TimeInfois the TimeClass for the current model

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