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

This is the class used to associate actions with specific timesteps within the model. More...

#include <actionattimes.h>

Collaboration diagram for ActionAtTimes:
Collaboration graph

Public Member Functions

 ActionAtTimes ()
 This is the ActionAtTimes constructor. More...
 
 ~ActionAtTimes ()
 This is the ActionAtTimes destructor. More...
 
int readFromFile (CommentStream &infile, const TimeClass *const TimeInfo)
 This is the function used to read in the action at times parameters. More...
 
void addActions (const IntVector &years, const IntVector &steps, const TimeClass *const TimeInfo)
 This is the function used to add the action for a set of steps and years. More...
 
void addActionsAllYears (const IntVector &steps, const TimeClass *const TimeInfo)
 This is the function used to add the action on all years for a set of steps. More...
 
void addActionsAllSteps (const IntVector &years, const TimeClass *const TimeInfo)
 This is the function used to add the action on all steps for a set of years. More...
 
int atCurrentTime (const TimeClass *const TimeInfo) const
 This is the function used to check whether an action takes place on the current timestep. More...
 

Protected Attributes

int everyStep
 This is the flag if the action takes place on every timestep. More...
 
IntVector TimeSteps
 This is the IntVector of the timesteps on which the action takes place. More...
 
IntVector Years
 This is the IntVector of the years on which the action takes place. More...
 
IntVector Steps
 This is the IntVector of the steps on which the action takes place. More...
 

Detailed Description

This is the class used to associate actions with specific timesteps within the model.

This class is used to determine whether an action should take place on the current timestep in the model. The actions include changing the population of the stock (either by fishing from the stock or adding to the stock) calculating the score from a likelihood component or printing output from the model. This is done by storing a list of timesteps when the action takes place, and comparing it to the current timestep in the model.

Constructor & Destructor Documentation

◆ ActionAtTimes()

ActionAtTimes::ActionAtTimes ( )
inline

This is the ActionAtTimes constructor.

◆ ~ActionAtTimes()

ActionAtTimes::~ActionAtTimes ( )
inline

This is the ActionAtTimes destructor.

Member Function Documentation

◆ addActions()

void ActionAtTimes::addActions ( const IntVector years,
const IntVector steps,
const TimeClass *const  TimeInfo 
)

This is the function used to add the action for a set of steps and years.

Parameters
stepsis the IntVector of all the steps that have the action taking place
yearsis the IntVector of all the years that have the action taking place
TimeInfois the TimeClass for the current model

◆ addActionsAllSteps()

void ActionAtTimes::addActionsAllSteps ( const IntVector years,
const TimeClass *const  TimeInfo 
)

This is the function used to add the action on all steps for a set of years.

Parameters
yearsis the IntVector of all the years that have the action taking place
TimeInfois the TimeClass for the current model

◆ addActionsAllYears()

void ActionAtTimes::addActionsAllYears ( const IntVector steps,
const TimeClass *const  TimeInfo 
)

This is the function used to add the action on all years for a set of steps.

Parameters
stepsis the IntVector of all the steps that have the action taking place
TimeInfois the TimeClass for the current model

◆ atCurrentTime()

int ActionAtTimes::atCurrentTime ( const TimeClass *const  TimeInfo) const

This is the function used to check whether an action takes place on the current timestep.

Parameters
TimeInfois the TimeClass for the current model
Returns
1 if action takes place, 0 otherwise

◆ readFromFile()

int ActionAtTimes::readFromFile ( CommentStream infile,
const TimeClass *const  TimeInfo 
)

This is the function used to read in the action at times parameters.

Parameters
infileis the CommentStream to read the actionattimes parameters from
TimeInfois the TimeClass for the current model
Returns
1 if the read from file was successful, 0 otherwise

Member Data Documentation

◆ everyStep

int ActionAtTimes::everyStep
protected

This is the flag if the action takes place on every timestep.

◆ Steps

IntVector ActionAtTimes::Steps
protected

This is the IntVector of the steps on which the action takes place.

◆ TimeSteps

IntVector ActionAtTimes::TimeSteps
protected

This is the IntVector of the timesteps on which the action takes place.

◆ Years

IntVector ActionAtTimes::Years
protected

This is the IntVector of the years on which the action takes place.


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