72 void SetSolver(
const string& solverName);
74 void SetTimer(
const string& start,
const string& end,
int timeStep,
const string& timeStepUnit);
76 void AddHydroUnitBrick(
const string& name,
const std::string& type =
"storage");
78 void AddSubBasinBrick(
const string& name,
const std::string& type =
"storage");
80 void AddLandCoverBrick(
const string& name,
const string& type);
82 void AddSurfaceComponentBrick(
const string& name,
const string& type);
84 void SetSurfaceComponentParent(
const string& name);
86 void AddBrickParameter(
const string& name,
float value,
const std::string& type =
"constant");
88 void SetBrickParameterValue(
const string& name,
float value,
const std::string& type =
"constant");
90 bool BrickHasParameter(
const string& name);
92 void AddBrickForcing(
const string& name);
94 void AddBrickProcess(
const string& name,
const string& type,
const string& target =
"",
bool log =
false);
96 void AddProcessParameter(
const string& name,
float value,
const std::string& type =
"constant");
98 void SetProcessParameterValue(
const string& name,
float value,
const std::string& type =
"constant");
100 void AddProcessForcing(
const string& name);
102 void AddProcessOutput(
const string& target);
104 void SetProcessOutputsAsInstantaneous();
106 void SetProcessOutputsAsStatic();
108 void OutputProcessToSameBrick();
110 void AddHydroUnitSplitter(
const string& name,
const string& type);
112 void AddSubBasinSplitter(
const string& name,
const string& type);
114 void AddSplitterParameter(
const string& name,
float value,
const std::string& type =
"constant");
116 void SetSplitterParameterValue(
const string& name,
float value,
const std::string& type =
"constant");
118 void AddSplitterForcing(
const string& name);
120 void AddSplitterOutput(
const string& target,
const string& fluxType =
"water");
122 void AddLoggingToItem(
const string& itemName);
124 void AddLoggingToItems(std::initializer_list<const string> items);
126 void AddBrickLogging(
const string& itemName);
128 void AddBrickLogging(std::initializer_list<const string> items);
130 void AddProcessLogging(
const string& itemName);
132 void AddSplitterLogging(
const string& itemName);
134 void GeneratePrecipitationSplitters(
bool withSnow);
136 void GenerateSnowpacks(
const string& snowMeltProcess);
138 void GenerateSnowpacksWithWaterRetention(
const string& snowMeltProcess,
const string& outflowProcess);
140 bool SelectStructure(
int id);
142 void SelectHydroUnitBrick(
int index);
144 void SelectSubBasinBrick(
int index);
146 bool SelectHydroUnitBrickIfFound(
const string& name);
148 bool SelectSubBasinBrickIfFound(
const string& name);
150 void SelectHydroUnitBrick(
const string& name);
152 void SelectHydroUnitBrickByName(
const string& name);
154 void SelectSubBasinBrick(
const string& name);
156 void SelectProcess(
int index);
158 void SelectProcess(
const string& name);
160 void SelectProcessWithParameter(
const string& name);
162 void SelectHydroUnitSplitter(
int index);
164 void SelectSubBasinSplitter(
int index);
166 bool SelectHydroUnitSplitterIfFound(
const string& name);
168 bool SelectSubBasinSplitterIfFound(
const string& name);
170 void SelectHydroUnitSplitter(
const string& name);
172 void SelectSubBasinSplitter(
const string& name);
174 bool ParseStructure(
const string& path);
176 bool ParseParameters(
const string& path);
178 bool SetParameterValue(
const string& component,
const string& name,
float value);
180 int GetStructuresNb()
const {
181 return int(m_modelStructures.size());
184 int GetHydroUnitBricksNb()
const {
185 wxASSERT(m_selectedStructure);
186 return int(m_selectedStructure->hydroUnitBricks.size());
189 int GetSubBasinBricksNb()
const {
190 wxASSERT(m_selectedStructure);
191 return int(m_selectedStructure->subBasinBricks.size());
194 int GetSurfaceComponentBricksNb()
const {
195 wxASSERT(m_selectedStructure);
196 return int(m_selectedStructure->surfaceComponentBricks.size());
199 int GetProcessesNb()
const {
200 wxASSERT(m_selectedBrick);
201 return int(m_selectedBrick->processes.size());
204 int GetHydroUnitSplittersNb()
const {
205 wxASSERT(m_selectedStructure);
206 return int(m_selectedStructure->hydroUnitSplitters.size());
209 int GetSubBasinSplittersNb()
const {
210 wxASSERT(m_selectedStructure);
211 return int(m_selectedStructure->subBasinSplitters.size());
223 wxASSERT(m_selectedStructure);
224 return m_selectedStructure->hydroUnitBricks[index];
227 BrickSettings GetHydroUnitBrickSettings(
const string& name)
const {
228 wxASSERT(m_selectedStructure);
230 for (
auto& brick : m_selectedStructure->hydroUnitBricks) {
231 if (brick.name == name) {
236 throw std::runtime_error(
"Brick not found.");
239 BrickSettings GetSurfaceComponentBrickSettings(
int index)
const {
240 wxASSERT(m_selectedStructure);
241 int brickIndex = m_selectedStructure->surfaceComponentBricks[index];
242 return m_selectedStructure->hydroUnitBricks[brickIndex];
245 vecInt GetSurfaceComponentBricksIndices()
const {
246 wxASSERT(m_selectedStructure);
247 return m_selectedStructure->surfaceComponentBricks;
250 vecInt GetLandCoverBricksIndices()
const {
251 wxASSERT(m_selectedStructure);
252 return m_selectedStructure->landCoverBricks;
255 vecStr GetLandCoverBricksNames()
const;
258 wxASSERT(m_selectedStructure);
259 return m_selectedStructure->subBasinBricks[index];
263 wxASSERT(m_selectedBrick);
264 return m_selectedBrick->processes[index];
268 wxASSERT(m_selectedStructure);
269 return m_selectedStructure->hydroUnitSplitters[index];
273 wxASSERT(m_selectedStructure);
274 return m_selectedStructure->subBasinSplitters[index];
277 vecStr GetSubBasinLogLabels();
279 vecStr GetSubBasinGenericLogLabels();
281 vecStr GetHydroUnitLogLabels();
283 void SetLogAll(
bool logAll =
true) {
285 wxLogVerbose(
"Logging all components.");
287 wxLogVerbose(
"Minimal logging.");
298 vector<ModelStructure> m_modelStructures;
306 vecStr ParseLandCoverNames(
const YAML::Node& settings);
308 vecStr ParseLandCoverTypes(
const YAML::Node& settings);
310 string ParseSolver(
const YAML::Node& settings);
312 bool LogAll(
const YAML::Node& settings);