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

This is the class used to store information for the current model given from the command-line. More...

#include <maininfo.h>

Collaboration diagram for MainInfo:
Collaboration graph

Public Member Functions

 MainInfo ()
 This is the MainInfo constructor. More...
 
 ~MainInfo ()
 This is the default MainInfo destructor. More...
 
void showCorrectUsage (char *error)
 This function will print an error message, brief help information and then exit. More...
 
void showUsage ()
 This function will print help information and then exit. More...
 
void checkUsage (const char *const inputdir, const char *const workingdir)
 This function will check the options that have been specified on the commandline. More...
 
void read (int aNumber, char *const aVector[])
 This function will read input from the command line. More...
 
void setPrintInitialFile (char *filename)
 This function will store the filename that the initial model information will be written to. More...
 
void setPrintFinalFile (char *filename)
 This function will store the filename that the final model information will be written to. More...
 
void setInitialParamFile (char *filename)
 This function will store the filename that the initial values for the model parameters will be read from. More...
 
void setMainGadgetFile (char *filename)
 This function will store the filename that the main model information will be read from. More...
 
void setOptInfoFile (char *filename)
 This function will store the filename that the optimisation information will be read from. More...
 
int runOptimise () const
 This function will return the flag used to determine whether the likelihood score should be optimised. More...
 
int runStochastic () const
 This function will return the flag used to determine whether a simulation run should be performed. More...
 
int runNetwork () const
 This function will return the flag used to determine whether the current simulation has been started using paramin. More...
 
int runPrint () const
 This function will return the flag used to determine whether the current simulation should print the model output. More...
 
int getOptInfoGiven () const
 This function will return the flag used to determine whether the optimisation parameters have been given. More...
 
int getInitialParamGiven () const
 This function will return the flag used to determine whether the initial values for the model parameters have been given. More...
 
int getForcePrint () const
 This function will return the flag used to force the model to print the model output to file. More...
 
PrintInfo getPI () const
 This function will return the PrintInfo used to store printing information. More...
 
int printInitial () const
 This function will return the flag used to determine whether the initial model information should be printed to file. More...
 
int printFinal () const
 This function will return the flag used to determine whether the final model information should be printed to file. More...
 
char * getInitialParamFile () const
 This function will return the filename that the initial values for the model parameters will be read from. More...
 
char * getPrintInitialFile () const
 This function will return the filename that the initial model information will be written to. More...
 
char * getPrintFinalFile () const
 This function will return the filename that the final model information will be written to. More...
 
char * getMainGadgetFile () const
 This function will return the filename that the main model information will be read from. More...
 
char * getOptInfoFile () const
 This function will return the filename that the optimisation information will be read from. More...
 
double getMaxRatio () const
 This function will return the maximum ratio of a stock that can be consumed on any given timestep. More...
 

Detailed Description

This is the class used to store information for the current model given from the command-line.

Constructor & Destructor Documentation

◆ MainInfo()

MainInfo::MainInfo ( )

This is the MainInfo constructor.

◆ ~MainInfo()

MainInfo::~MainInfo ( )

This is the default MainInfo destructor.

Member Function Documentation

◆ checkUsage()

void MainInfo::checkUsage ( const char *const  inputdir,
const char *const  workingdir 
)

This function will check the options that have been specified on the commandline.

Parameters
inputdiris the name of the directory containing the input files to the model
workingdiris the name of the directory used for the output from the model

◆ getForcePrint()

int MainInfo::getForcePrint ( ) const
inline

This function will return the flag used to force the model to print the model output to file.

Returns
flag

◆ getInitialParamFile()

char* MainInfo::getInitialParamFile ( ) const
inline

This function will return the filename that the initial values for the model parameters will be read from.

Returns
filename

◆ getInitialParamGiven()

int MainInfo::getInitialParamGiven ( ) const
inline

This function will return the flag used to determine whether the initial values for the model parameters have been given.

Returns
flag

◆ getMainGadgetFile()

char* MainInfo::getMainGadgetFile ( ) const
inline

This function will return the filename that the main model information will be read from.

Returns
filename

◆ getMaxRatio()

double MainInfo::getMaxRatio ( ) const
inline

This function will return the maximum ratio of a stock that can be consumed on any given timestep.

Returns
maxratio

◆ getOptInfoFile()

char* MainInfo::getOptInfoFile ( ) const
inline

This function will return the filename that the optimisation information will be read from.

Returns
filename

◆ getOptInfoGiven()

int MainInfo::getOptInfoGiven ( ) const
inline

This function will return the flag used to determine whether the optimisation parameters have been given.

Returns
flag

◆ getPI()

PrintInfo MainInfo::getPI ( ) const
inline

This function will return the PrintInfo used to store printing information.

Returns
pi, the PrintInfo containing the printing information

◆ getPrintFinalFile()

char* MainInfo::getPrintFinalFile ( ) const
inline

This function will return the filename that the final model information will be written to.

Returns
filename

◆ getPrintInitialFile()

char* MainInfo::getPrintInitialFile ( ) const
inline

This function will return the filename that the initial model information will be written to.

Returns
filename

◆ printFinal()

int MainInfo::printFinal ( ) const
inline

This function will return the flag used to determine whether the final model information should be printed to file.

Returns
flag

◆ printInitial()

int MainInfo::printInitial ( ) const
inline

This function will return the flag used to determine whether the initial model information should be printed to file.

Returns
flag

◆ read()

void MainInfo::read ( int  aNumber,
char *const  aVector[] 
)

This function will read input from the command line.

Parameters
aNumberis the number of command line entries
aVectorcontains the command line entries

◆ runNetwork()

int MainInfo::runNetwork ( ) const
inline

This function will return the flag used to determine whether the current simulation has been started using paramin.

Returns
flag

◆ runOptimise()

int MainInfo::runOptimise ( ) const
inline

This function will return the flag used to determine whether the likelihood score should be optimised.

Returns
flag

◆ runPrint()

int MainInfo::runPrint ( ) const
inline

This function will return the flag used to determine whether the current simulation should print the model output.

Returns
flag

◆ runStochastic()

int MainInfo::runStochastic ( ) const
inline

This function will return the flag used to determine whether a simulation run should be performed.

Returns
flag

◆ setInitialParamFile()

void MainInfo::setInitialParamFile ( char *  filename)

This function will store the filename that the initial values for the model parameters will be read from.

Parameters
filenameis the name of the file

◆ setMainGadgetFile()

void MainInfo::setMainGadgetFile ( char *  filename)

This function will store the filename that the main model information will be read from.

Parameters
filenameis the name of the file

◆ setOptInfoFile()

void MainInfo::setOptInfoFile ( char *  filename)

This function will store the filename that the optimisation information will be read from.

Parameters
filenameis the name of the file

◆ setPrintFinalFile()

void MainInfo::setPrintFinalFile ( char *  filename)

This function will store the filename that the final model information will be written to.

Parameters
filenameis the name of the file

◆ setPrintInitialFile()

void MainInfo::setPrintInitialFile ( char *  filename)

This function will store the filename that the initial model information will be written to.

Parameters
filenameis the name of the file

◆ showCorrectUsage()

void MainInfo::showCorrectUsage ( char *  error)

This function will print an error message, brief help information and then exit.

Parameters
erroris the error message

◆ showUsage()

void MainInfo::showUsage ( )

This function will print help information and then exit.


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