Gadget
Public Member Functions | Protected Attributes | List of all members
StochasticData Class Reference

This is the class used to get values for the variables used in the model simulation. These values are either read from an InitialInputFile, or received from the network if the simulation is part of a parallel optimisation, using paramin. More...

#include <stochasticdata.h>

Collaboration diagram for StochasticData:
Collaboration graph

Public Member Functions

 StochasticData ()
 This is the default StochasticData constructor. More...
 
 StochasticData (const char *const filename, int p)
 This is the StochasticData constructor specifying a file to read the data from. More...
 
 StochasticData (const char *const filename)
 This is the StochasticData constructor specifying a file to read the data from. More...
 
virtual ~StochasticData ()
 This is the default StochasticData destructor. More...
 
void readNextLine ()
 This function will read the next line of data from the input file. More...
 
int isDataLeft ()
 This function will check to see if there is more data to read in the input file. More...
 
int numVariables () const
 This function will return the number of variables read from the input file. More...
 
int numSwitches () const
 This function will return the number of switches read from the input file. More...
 
int isOptGiven () const
 This function will check to see if optimising flags have been specified in the input file. More...
 
int getOptFlag (int i) const
 This function will return the optimising flag for a switch in the input file. More...
 
double getValue (int i) const
 This function will return the value of a switch in the input file. More...
 
double getLowerBound (int i) const
 This function will return the lower bound for a switch in the input file. More...
 
double getUpperBound (int i) const
 This function will return the upper bound for a switch in the input file. More...
 
Parameter getSwitch (int i) const
 This function will return the paramter name for a switch in the input file. More...
 

Protected Attributes

InitialInputFilereadInfo
 This is the InitialInputFile used to read from file the initial values and bounds of the parameters for the current model. More...
 
ParameterVector switches
 This is the ParameterVector used to store the parameters read from file. More...
 
DoubleVector values
 This is the DoubleVector used to store the values of the parameters read from file. More...
 
DoubleVector lowerbound
 This is the DoubleVector used to store the lower bounds of the parameters read from file. More...
 
DoubleVector upperbound
 This is the DoubleVector used to store the upper bounds of the parameters read from file. More...
 
IntVector optimise
 This is the IntVector used to store the flag to denote whether to optimise the parameters read from file. More...
 
int netrun
 This is the flag to denote whether gadget is running in network mode or not. More...
 

Detailed Description

This is the class used to get values for the variables used in the model simulation. These values are either read from an InitialInputFile, or received from the network if the simulation is part of a parallel optimisation, using paramin.

Constructor & Destructor Documentation

◆ StochasticData() [1/3]

StochasticData::StochasticData ( )

This is the default StochasticData constructor.

◆ StochasticData() [2/3]

StochasticData::StochasticData ( const char *const  filename,
int  p 
)

This is the StochasticData constructor specifying a file to read the data from.

Parameters
filenameis the name of the file to read the data from
pis the number of the node

◆ StochasticData() [3/3]

StochasticData::StochasticData ( const char *const  filename)

This is the StochasticData constructor specifying a file to read the data from.

Parameters
filenameis the name of the file to read the data from

◆ ~StochasticData()

StochasticData::~StochasticData ( )
virtual

This is the default StochasticData destructor.

Member Function Documentation

◆ getLowerBound()

double StochasticData::getLowerBound ( int  i) const
inline

This function will return the lower bound for a switch in the input file.

Parameters
iis the index for the switch
Returns
lower bound for the switch

◆ getOptFlag()

int StochasticData::getOptFlag ( int  i) const

This function will return the optimising flag for a switch in the input file.

Parameters
iis the index for the switch
Returns
optimise flag for the switch

◆ getSwitch()

Parameter StochasticData::getSwitch ( int  i) const
inline

This function will return the paramter name for a switch in the input file.

Parameters
iis the index for the switch
Returns
parameter name for the switch

◆ getUpperBound()

double StochasticData::getUpperBound ( int  i) const
inline

This function will return the upper bound for a switch in the input file.

Parameters
iis the index for the switch
Returns
upper bound for the switch

◆ getValue()

double StochasticData::getValue ( int  i) const
inline

This function will return the value of a switch in the input file.

Parameters
iis the index for the switch
Returns
value of the switch

◆ isDataLeft()

int StochasticData::isDataLeft ( )
inline

This function will check to see if there is more data to read in the input file.

Returns
1 if there is more data to read from the input file, 0 otherwise

◆ isOptGiven()

int StochasticData::isOptGiven ( ) const

This function will check to see if optimising flags have been specified in the input file.

Returns
1 if the optimising flags have been specified, 0 otherwise

◆ numSwitches()

int StochasticData::numSwitches ( ) const
inline

This function will return the number of switches read from the input file.

Returns
number of switches

◆ numVariables()

int StochasticData::numVariables ( ) const
inline

This function will return the number of variables read from the input file.

Returns
number of variables

◆ readNextLine()

void StochasticData::readNextLine ( )

This function will read the next line of data from the input file.

Note
This function is only called if the input file has data using the 'repeated values' format

Member Data Documentation

◆ lowerbound

DoubleVector StochasticData::lowerbound
protected

This is the DoubleVector used to store the lower bounds of the parameters read from file.

◆ netrun

int StochasticData::netrun
protected

This is the flag to denote whether gadget is running in network mode or not.

◆ optimise

IntVector StochasticData::optimise
protected

This is the IntVector used to store the flag to denote whether to optimise the parameters read from file.

◆ readInfo

InitialInputFile* StochasticData::readInfo
protected

This is the InitialInputFile used to read from file the initial values and bounds of the parameters for the current model.

◆ switches

ParameterVector StochasticData::switches
protected

This is the ParameterVector used to store the parameters read from file.

◆ upperbound

DoubleVector StochasticData::upperbound
protected

This is the DoubleVector used to store the upper bounds of the parameters read from file.

◆ values

DoubleVector StochasticData::values
protected

This is the DoubleVector used to store the values of the parameters read from file.


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