hydrobricks
Loading...
Searching...
No Matches
SettingsModel Class Reference
Inheritance diagram for SettingsModel:

Public Member Functions

void SetSolver (const string &solverName)
 
void SetTimer (const string &start, const string &end, int timeStep, const string &timeStepUnit)
 
void AddHydroUnitBrick (const string &name, const std::string &type="storage")
 
void AddSubBasinBrick (const string &name, const std::string &type="storage")
 
void AddLandCoverBrick (const string &name, const string &type)
 
void AddSurfaceComponentBrick (const string &name, const string &type)
 
void SetSurfaceComponentParent (const string &name)
 
void AddBrickParameter (const string &name, float value, const std::string &type="constant")
 
void SetBrickParameterValue (const string &name, float value, const std::string &type="constant")
 
bool BrickHasParameter (const string &name)
 
void AddBrickForcing (const string &name)
 
void AddBrickProcess (const string &name, const string &type, const string &target="", bool log=false)
 
void AddProcessParameter (const string &name, float value, const std::string &type="constant")
 
void SetProcessParameterValue (const string &name, float value, const std::string &type="constant")
 
void AddProcessForcing (const string &name)
 
void AddProcessOutput (const string &target, const string &fluxType="water")
 
void SetProcessOutputsAsInstantaneous ()
 
void SetProcessOutputsAsStatic ()
 
void OutputProcessToSameBrick ()
 
void AddHydroUnitSplitter (const string &name, const string &type)
 
void AddSubBasinSplitter (const string &name, const string &type)
 
void AddSplitterParameter (const string &name, float value, const std::string &type="constant")
 
void SetSplitterParameterValue (const string &name, float value, const std::string &type="constant")
 
void AddSplitterForcing (const string &name)
 
void AddSplitterOutput (const string &target, const string &fluxType="water")
 
void AddLoggingToItem (const string &itemName)
 
void AddLoggingToItems (std::initializer_list< const string > items)
 
void AddBrickLogging (const string &itemName)
 
void AddBrickLogging (std::initializer_list< const string > items)
 
void AddProcessLogging (const string &itemName)
 
void AddSplitterLogging (const string &itemName)
 
void GeneratePrecipitationSplitters (bool withSnow)
 
void GenerateSnowpacks (const string &snowMeltProcess, bool snowIceTransformation=false)
 
void GenerateSnowpacksWithWaterRetention (const string &snowMeltProcess, const string &outflowProcess)
 
bool SelectStructure (int id)
 
void SelectHydroUnitBrick (int index)
 
void SelectSubBasinBrick (int index)
 
bool SelectHydroUnitBrickIfFound (const string &name)
 
bool SelectSubBasinBrickIfFound (const string &name)
 
void SelectHydroUnitBrick (const string &name)
 
void SelectHydroUnitBrickByName (const string &name)
 
void SelectSubBasinBrick (const string &name)
 
void SelectProcess (int index)
 
void SelectProcess (const string &name)
 
void SelectProcessWithParameter (const string &name)
 
void SelectHydroUnitSplitter (int index)
 
void SelectSubBasinSplitter (int index)
 
bool SelectHydroUnitSplitterIfFound (const string &name)
 
bool SelectSubBasinSplitterIfFound (const string &name)
 
void SelectHydroUnitSplitter (const string &name)
 
void SelectSubBasinSplitter (const string &name)
 
bool SetParameterValue (const string &component, const string &name, float value)
 
int GetStructuresNb () const
 
int GetHydroUnitBricksNb () const
 
int GetSubBasinBricksNb () const
 
int GetSurfaceComponentBricksNb () const
 
int GetProcessesNb () const
 
int GetHydroUnitSplittersNb () const
 
int GetSubBasinSplittersNb () const
 
SolverSettings GetSolverSettings () const
 
TimerSettings GetTimerSettings () const
 
BrickSettings GetHydroUnitBrickSettings (int index) const
 
BrickSettings GetHydroUnitBrickSettings (const string &name) const
 
BrickSettings GetSurfaceComponentBrickSettings (int index) const
 
vecInt GetSurfaceComponentBricksIndices () const
 
vecInt GetLandCoverBricksIndices () const
 
vecStr GetLandCoverBricksNames () const
 
BrickSettings GetSubBasinBrickSettings (int index) const
 
ProcessSettings GetProcessSettings (int index) const
 
SplitterSettings GetHydroUnitSplitterSettings (int index) const
 
SplitterSettings GetSubBasinSplitterSettings (int index) const
 
vecStr GetSubBasinLogLabels ()
 
vecStr GetSubBasinGenericLogLabels ()
 
vecStr GetHydroUnitLogLabels ()
 
void SetLogAll (bool logAll=true)
 
bool LogAll ()
 

Protected Member Functions

bool LogAll (const YAML::Node &settings)
 

Protected Attributes

bool m_logAll
 
vector< ModelStructurem_modelStructures
 
SolverSettings m_solver
 
TimerSettings m_timer
 
ModelStructurem_selectedStructure
 
BrickSettingsm_selectedBrick
 
ProcessSettingsm_selectedProcess
 
SplitterSettingsm_selectedSplitter
 

Member Function Documentation

◆ AddBrickForcing()

void SettingsModel::AddBrickForcing ( const string & name)

Add a forcing to the selected brick.

Parameters
namename of the forcing.

◆ AddBrickLogging() [1/2]

void SettingsModel::AddBrickLogging ( const string & itemName)

Add logging to the selected brick.

Parameters
itemNamename of the item to log.

◆ AddBrickLogging() [2/2]

void SettingsModel::AddBrickLogging ( std::initializer_list< const string > items)

Add logging to a list of items in the selected brick.

Parameters
itemslist of items to log.

◆ AddBrickParameter()

void SettingsModel::AddBrickParameter ( const string & name,
float value,
const std::string & type = "constant" )

Add a parameter to the selected brick.

Parameters
namename of the parameter.
valuevalue of the parameter.
typetype of the parameter.

◆ AddBrickProcess()

void SettingsModel::AddBrickProcess ( const string & name,
const string & type,
const string & target = "",
bool log = false )

Add a process to the selected brick.

Parameters
namename of the process.
typetype of the process.
targettarget of the process.
logtrue if the process should be logged, false otherwise.

◆ AddHydroUnitBrick()

void SettingsModel::AddHydroUnitBrick ( const string & name,
const std::string & type = "storage" )

Add a hydro unit brick to the model (e.g. storage).

Parameters
namename of the hydro unit brick.
typetype of the hydro unit brick.

◆ AddHydroUnitSplitter()

void SettingsModel::AddHydroUnitSplitter ( const string & name,
const string & type )

Add a hydro unit splitter to the selected structure.

Parameters
namename of the hydro unit splitter.
typetype of the hydro unit splitter.

◆ AddLandCoverBrick()

void SettingsModel::AddLandCoverBrick ( const string & name,
const string & type )

Add a land cover brick to the model (e.g. glacier).

Parameters
namename of the land cover brick.
typetype of the land cover brick.

◆ AddLoggingToItem()

void SettingsModel::AddLoggingToItem ( const string & itemName)

Add logging to a given item.

Parameters
itemNamename of the item to log.

◆ AddLoggingToItems()

void SettingsModel::AddLoggingToItems ( std::initializer_list< const string > items)

Add logging to a list of items.

Parameters
itemslist of items to log.

◆ AddProcessForcing()

void SettingsModel::AddProcessForcing ( const string & name)

Add a forcing to the selected process.

Parameters
namename of the forcing.

◆ AddProcessLogging()

void SettingsModel::AddProcessLogging ( const string & itemName)

Add logging to the selected process.

Parameters
itemNamename of the item to log.

◆ AddProcessOutput()

void SettingsModel::AddProcessOutput ( const string & target,
const string & fluxType = "water" )

Add an output to the selected process.

Parameters
targettarget of the output.
fluxTypetype of the flux.

◆ AddProcessParameter()

void SettingsModel::AddProcessParameter ( const string & name,
float value,
const std::string & type = "constant" )

Add a parameter to the selected process.

Parameters
namename of the parameter.
valuevalue of the parameter.
typetype of the parameter.

◆ AddSplitterForcing()

void SettingsModel::AddSplitterForcing ( const string & name)

Add a forcing to the selected splitter.

Parameters
namename of the forcing.

◆ AddSplitterLogging()

void SettingsModel::AddSplitterLogging ( const string & itemName)

Add logging to the selected splitter.

Parameters
itemNamename of the item to log.

◆ AddSplitterOutput()

void SettingsModel::AddSplitterOutput ( const string & target,
const string & fluxType = "water" )

Add an output to the selected splitter.

Parameters
targettarget of the output.
fluxTypetype of the flux.

◆ AddSplitterParameter()

void SettingsModel::AddSplitterParameter ( const string & name,
float value,
const std::string & type = "constant" )

Add a parameter to the selected splitter.

Parameters
namename of the parameter.
valuevalue of the parameter.
typetype of the parameter.

◆ AddSubBasinBrick()

void SettingsModel::AddSubBasinBrick ( const string & name,
const std::string & type = "storage" )

Add a sub-basin brick to the model (e.g. lumped storage).

Parameters
namename of the sub-basin brick.
typetype of the sub-basin brick.

◆ AddSubBasinSplitter()

void SettingsModel::AddSubBasinSplitter ( const string & name,
const string & type )

Add a sub-basin splitter to the selected structure.

Parameters
namename of the sub-basin splitter.
typetype of the sub-basin splitter.

◆ AddSurfaceComponentBrick()

void SettingsModel::AddSurfaceComponentBrick ( const string & name,
const string & type )

Add a surface component brick to the model (e.g. snowpack).

Parameters
namename of the surface component brick.
typetype of the surface component brick.

◆ BrickHasParameter()

bool SettingsModel::BrickHasParameter ( const string & name)

Check if the selected brick has a parameter.

Parameters
namename of the parameter.
Returns
true if the brick has the parameter, false otherwise.

◆ GeneratePrecipitationSplitters()

void SettingsModel::GeneratePrecipitationSplitters ( bool withSnow)

Generate precipitation splitters (rain/snow).

Parameters
withSnowtrue if snow is included, false otherwise.

◆ GenerateSnowpacks()

void SettingsModel::GenerateSnowpacks ( const string & snowMeltProcess,
bool snowIceTransformation = false )

Generate snowpacks.

Parameters
snowMeltProcessname of the snow melt process.
snowIceTransformationtrue if snow-ice transformation is included, false otherwise.

◆ GenerateSnowpacksWithWaterRetention()

void SettingsModel::GenerateSnowpacksWithWaterRetention ( const string & snowMeltProcess,
const string & outflowProcess )

Generate snowpacks with water retention.

Parameters
snowMeltProcessname of the snow melt process.
outflowProcessname of the outflow process.

◆ GetHydroUnitBrickSettings() [1/2]

BrickSettings SettingsModel::GetHydroUnitBrickSettings ( const string & name) const
inline

Get the hydro unit brick settings by name.

Parameters
namename of the hydro unit brick.
Returns
hydro unit brick settings.

◆ GetHydroUnitBrickSettings() [2/2]

BrickSettings SettingsModel::GetHydroUnitBrickSettings ( int index) const
inline

Get the hydro unit brick settings by index.

Parameters
indexindex of the hydro unit brick.
Returns
hydro unit brick settings.

◆ GetHydroUnitBricksNb()

int SettingsModel::GetHydroUnitBricksNb ( ) const
inline

Get the number of hydro unit bricks in the selected structure.

Returns
number of hydro unit bricks.

◆ GetHydroUnitLogLabels()

vecStr SettingsModel::GetHydroUnitLogLabels ( )

Get the logging labels for the hydro unit components

Returns
logging labels for the hydro unit components.

◆ GetHydroUnitSplitterSettings()

SplitterSettings SettingsModel::GetHydroUnitSplitterSettings ( int index) const
inline

Get the splitter settings by index.

Parameters
indexindex of the splitter.
Returns
splitter settings.

◆ GetHydroUnitSplittersNb()

int SettingsModel::GetHydroUnitSplittersNb ( ) const
inline

Get the number of hydro unit splitters in the selected structure.

Returns
number of hydro unit splitters.

◆ GetLandCoverBricksIndices()

vecInt SettingsModel::GetLandCoverBricksIndices ( ) const
inline

Get the indices of the land cover bricks.

Returns
indices of the land cover bricks.

◆ GetLandCoverBricksNames()

vecStr SettingsModel::GetLandCoverBricksNames ( ) const

Get the names of the land cover bricks.

Returns
names of the land cover bricks.

◆ GetProcessesNb()

int SettingsModel::GetProcessesNb ( ) const
inline

Get the number of processes in the selected brick.

Returns
number of processes.

◆ GetProcessSettings()

ProcessSettings SettingsModel::GetProcessSettings ( int index) const
inline

Get the process settings by index.

Parameters
indexindex of the process.
Returns
process settings.

◆ GetSolverSettings()

SolverSettings SettingsModel::GetSolverSettings ( ) const
inline

Get the solver settings.

Returns
solver settings.

◆ GetStructuresNb()

int SettingsModel::GetStructuresNb ( ) const
inline

Get the number of structures in the model.

Returns
number of structures.

◆ GetSubBasinBrickSettings()

BrickSettings SettingsModel::GetSubBasinBrickSettings ( int index) const
inline

Get the sub basin brick settings by index.

Parameters
indexindex of the sub basin brick.
Returns
sub basin brick settings.

◆ GetSubBasinBricksNb()

int SettingsModel::GetSubBasinBricksNb ( ) const
inline

Get the number of sub-basin bricks in the selected structure.

Returns
number of sub-basin bricks.

◆ GetSubBasinGenericLogLabels()

vecStr SettingsModel::GetSubBasinGenericLogLabels ( )

Get the generic logging labels for the sub basin components

Returns
generic logging labels for the sub basin components.

◆ GetSubBasinLogLabels()

vecStr SettingsModel::GetSubBasinLogLabels ( )

Get the logging labels for the sub basin components

Returns
logging labels for the sub basin components.

◆ GetSubBasinSplitterSettings()

SplitterSettings SettingsModel::GetSubBasinSplitterSettings ( int index) const
inline

Get the sub basin splitter settings by index.

Parameters
indexindex of the sub basin splitter.
Returns
sub basin splitter settings.

◆ GetSubBasinSplittersNb()

int SettingsModel::GetSubBasinSplittersNb ( ) const
inline

Get the number of sub-basin splitters in the selected structure.

Returns
number of sub-basin splitters.

◆ GetSurfaceComponentBrickSettings()

BrickSettings SettingsModel::GetSurfaceComponentBrickSettings ( int index) const
inline

Get the surface component brick settings by index.

Parameters
indexindex of the surface component brick.
Returns
surface component brick settings.

◆ GetSurfaceComponentBricksIndices()

vecInt SettingsModel::GetSurfaceComponentBricksIndices ( ) const
inline

Get the indices of the surface component bricks.

Returns
indices of the surface component bricks.

◆ GetSurfaceComponentBricksNb()

int SettingsModel::GetSurfaceComponentBricksNb ( ) const
inline

Get the number of surface component bricks in the selected structure.

Returns
number of surface component bricks.

◆ GetTimerSettings()

TimerSettings SettingsModel::GetTimerSettings ( ) const
inline

Get the timer settings.

Returns
timer settings.

◆ LogAll()

bool SettingsModel::LogAll ( )
inline

Check if all components are logged.

Returns
true if all components are logged, false otherwise.

◆ OutputProcessToSameBrick()

void SettingsModel::OutputProcessToSameBrick ( )

Set the outputs of the selected process to the same brick.

◆ SelectHydroUnitBrick() [1/2]

void SettingsModel::SelectHydroUnitBrick ( const string & name)

Select a hydro unit brick by its name. Raise an exception if the brick is not found.

Parameters
namename of the hydro unit brick.

◆ SelectHydroUnitBrick() [2/2]

void SettingsModel::SelectHydroUnitBrick ( int index)

Select a hydro unit brick by its index.

Parameters
indexindex of the hydro unit brick.

◆ SelectHydroUnitBrickByName()

void SettingsModel::SelectHydroUnitBrickByName ( const string & name)

Select a hydro unit brick by its name. Raise an exception if the brick is not found. Same as SelectHydroUnitBrick, but used in the Python bindings.

Parameters
namename of the hydro unit brick.

◆ SelectHydroUnitBrickIfFound()

bool SettingsModel::SelectHydroUnitBrickIfFound ( const string & name)

Select a hydro unit brick by its name. Tolerate if the brick is not found.

Parameters
namename of the hydro unit brick.
Returns
true if the hydro unit brick is found, false otherwise.

◆ SelectHydroUnitSplitter() [1/2]

void SettingsModel::SelectHydroUnitSplitter ( const string & name)

Select a hydro unit splitter by its name. Raise an exception if the splitter is not found.

Parameters
namename of the hydro unit splitter.

◆ SelectHydroUnitSplitter() [2/2]

void SettingsModel::SelectHydroUnitSplitter ( int index)

Select a hydro unit splitter by its index.

Parameters
indexindex of the hydro unit splitter.

◆ SelectHydroUnitSplitterIfFound()

bool SettingsModel::SelectHydroUnitSplitterIfFound ( const string & name)

Select a hydro unit splitter by its name. Tolerate if the splitter is not found.

Parameters
namename of the hydro unit splitter.
Returns
true if the hydro unit splitter is found, false otherwise.

◆ SelectProcess() [1/2]

void SettingsModel::SelectProcess ( const string & name)

Select a process by its name.

Parameters
namename of the process.

◆ SelectProcess() [2/2]

void SettingsModel::SelectProcess ( int index)

Select a process by its index.

Parameters
indexindex of the process.

◆ SelectProcessWithParameter()

void SettingsModel::SelectProcessWithParameter ( const string & name)

Select a process by one of its parameter name.

Parameters
namename of the process.

◆ SelectStructure()

bool SettingsModel::SelectStructure ( int id)

Select a structure by its ID.

Parameters
idID of the structure.
Returns
true if the structure is found, false otherwise.

◆ SelectSubBasinBrick() [1/2]

void SettingsModel::SelectSubBasinBrick ( const string & name)

Select a sub-basin brick by its name. Raise an exception if the brick is not found.

Parameters
namename of the sub-basin brick.

◆ SelectSubBasinBrick() [2/2]

void SettingsModel::SelectSubBasinBrick ( int index)

Select a sub-basin brick by its index.

Parameters
indexindex of the sub-basin brick.

◆ SelectSubBasinBrickIfFound()

bool SettingsModel::SelectSubBasinBrickIfFound ( const string & name)

Select a sub-basin brick by its name. Tolerate if the brick is not found.

Parameters
namename of the sub-basin brick.
Returns
true if the sub-basin brick is found, false otherwise.

◆ SelectSubBasinSplitter() [1/2]

void SettingsModel::SelectSubBasinSplitter ( const string & name)

Select a sub-basin splitter by its name. Raise an exception if the splitter is not found.

Parameters
namename of the sub-basin splitter.

◆ SelectSubBasinSplitter() [2/2]

void SettingsModel::SelectSubBasinSplitter ( int index)

Select a sub-basin splitter by its index.

Parameters
indexindex of the sub-basin splitter.

◆ SelectSubBasinSplitterIfFound()

bool SettingsModel::SelectSubBasinSplitterIfFound ( const string & name)

Select a sub-basin splitter by its name. Tolerate if the splitter is not found.

Parameters
namename of the sub-basin splitter.
Returns
true if the sub-basin splitter is found, false otherwise.

◆ SetBrickParameterValue()

void SettingsModel::SetBrickParameterValue ( const string & name,
float value,
const std::string & type = "constant" )

Set the value of a parameter of the selected brick.

Parameters
namename of the parameter.
valuevalue of the parameter.
typetype of the parameter.

◆ SetLogAll()

void SettingsModel::SetLogAll ( bool logAll = true)
inline

Flag to log all components.

Parameters
logAlltrue to log all components, false to log only the selected ones.

◆ SetParameterValue()

bool SettingsModel::SetParameterValue ( const string & component,
const string & name,
float value )

Set parameter value for a component.

Parameters
componentname of the component.
namename of the parameter.
valuevalue of the parameter.
Returns
true if the parameter is set, false otherwise.

◆ SetProcessOutputsAsInstantaneous()

void SettingsModel::SetProcessOutputsAsInstantaneous ( )

Set the outputs of the selected process as instantaneous.

◆ SetProcessOutputsAsStatic()

void SettingsModel::SetProcessOutputsAsStatic ( )

Set the outputs of the selected process as static.

◆ SetProcessParameterValue()

void SettingsModel::SetProcessParameterValue ( const string & name,
float value,
const std::string & type = "constant" )

Set the value of the selected process parameter.

Parameters
namename of the parameter.
valuevalue of the parameter.
typetype of the parameter.

◆ SetSolver()

void SettingsModel::SetSolver ( const string & solverName)

Set the solver name.

Parameters
solverNamename of the solver.

◆ SetSplitterParameterValue()

void SettingsModel::SetSplitterParameterValue ( const string & name,
float value,
const std::string & type = "constant" )

Set the value of the selected splitter parameter.

Parameters
namename of the parameter.
valuevalue of the parameter.
typetype of the parameter.

◆ SetSurfaceComponentParent()

void SettingsModel::SetSurfaceComponentParent ( const string & name)

Set the parent of the selected surface component brick.

Parameters
namename of the parent brick.

◆ SetTimer()

void SettingsModel::SetTimer ( const string & start,
const string & end,
int timeStep,
const string & timeStepUnit )

Set the timer settings.

Parameters
startstart date.
endend date.
timeSteptime step.
timeStepUnittime step unit.

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