hydrobricks
Loading...
Searching...
No Matches
Action Class Reference
Inheritance diagram for Action:
ActionGlacierEvolutionAreaScaling ActionGlacierEvolutionDeltaH ActionGlacierSnowToIceTransformation ActionLandCoverChange

Public Member Functions

virtual bool Init ()
 
virtual void Reset ()
 
void ResetCursor ()
 
void AddRecursiveDate (int month, int day)
 
virtual bool Apply (double date=0)
 
virtual bool ApplyIfRecursive (const Time date)
 
int GetIndexForInsertion (double date) const
 
double CheckLandCoverAreaFraction (const string &name, int id, double fraction, double unitArea, double lcArea)
 
void SetManager (ActionsManager *manager)
 
const vecDouble & GetSporadicDates () const
 
int GetSporadicItemCount () const
 
void IncrementCursor ()
 
bool IsRecursive () const
 
virtual bool IsValid () const
 
virtual void Validate () const
 

Protected Attributes

ActionsManager_manager
 
int _cursor
 
vecDouble _sporadicDates
 
bool _recursive
 
vecInt _recursiveMonths
 
vecInt _recursiveDays
 

Member Function Documentation

◆ AddRecursiveDate()

void Action::AddRecursiveDate ( int month,
int day )

Add a recursive date for the action.

Parameters
monththe month of the year (1-12).
daythe day of the month (1-31).

◆ Apply()

bool Action::Apply ( double date = 0)
virtual

Apply the action for a specific date.

Parameters
datethe date of the action.
Returns
true if the action was applied successfully.

Reimplemented in ActionGlacierEvolutionAreaScaling, ActionGlacierEvolutionDeltaH, ActionGlacierSnowToIceTransformation, and ActionLandCoverChange.

◆ ApplyIfRecursive()

bool Action::ApplyIfRecursive ( const Time date)
virtual

Apply the recursive action, for a specific date.

Parameters
datethe date of the action.
Returns
true if the action was applied successfully.

◆ CheckLandCoverAreaFraction()

double Action::CheckLandCoverAreaFraction ( const string & name,
int id,
double fraction,
double unitArea,
double lcArea )

Check if the land cover area fraction is valid.

Parameters
namethe name of the land cover.
idthe ID of the hydro unit.
fractionthe area fraction to check.
unitAreathe area of the hydro unit.
lcAreathe area of the land cover.
Returns
the corrected area fraction if it was invalid, or the original fraction if it was valid.

◆ GetIndexForInsertion()

int Action::GetIndexForInsertion ( double date) const

Get the index for insertion in the sporadic dates vector.

Parameters
datethe date to insert.
Returns
the index for insertion.

◆ GetSporadicDates()

const vecDouble & Action::GetSporadicDates ( ) const
inline

Get the sporadic dates vector.

Returns
the sporadic dates vector.

◆ GetSporadicItemCount()

int Action::GetSporadicItemCount ( ) const
inline

Get the number of sporadic items.

Returns
the number of sporadic items.

◆ IncrementCursor()

void Action::IncrementCursor ( )
inline

Increment the cursor.

◆ Init()

bool Action::Init ( )
virtual

Initialize the action.

Returns
true if the initialization was successful.

Reimplemented in ActionGlacierEvolutionAreaScaling, ActionGlacierEvolutionDeltaH, and ActionGlacierSnowToIceTransformation.

◆ IsRecursive()

bool Action::IsRecursive ( ) const
inlinenodiscard

Check if the action is recursive.

Returns
true if the action is recursive.

◆ IsValid()

bool Action::IsValid ( ) const
nodiscardvirtual

Check if the action is valid. Verifies that the action is properly configured.

Returns
true if the action is valid, false otherwise.

◆ Reset()

void Action::Reset ( )
virtual

◆ ResetCursor()

void Action::ResetCursor ( )

Reset the action cursor.

◆ SetManager()

void Action::SetManager ( ActionsManager * manager)
inline

Set the manager of the action.

Parameters
managerthe manager to set.

◆ Validate()

void Action::Validate ( ) const
virtual

Validate the action. Throws an exception if the action is invalid.

Exceptions
ModelConfigErrorif validation fails.

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