NGen
|
#include <Catchment_Formulation.hpp>
Public Types | |
typedef long | time_step_t |
Public Member Functions | |
Catchment_Formulation (std::string id, std::shared_ptr< data_access::GenericDataProvider > forcing, utils::StreamHandler output_stream) | |
Catchment_Formulation (std::string id) | |
virtual std::string | get_output_header_line (std::string delimiter=DEFAULT_FORMULATION_OUTPUT_DELIMITER) const |
Get a header line appropriate for a file made up of entries from this type's implementation of get_output_line_for_timestep . | |
virtual std::string | get_output_line_for_timestep (int timestep, std::string delimiter=DEFAULT_FORMULATION_OUTPUT_DELIMITER)=0 |
Get a formatted line of output values for the given time step as a delimited string. | |
virtual double | get_response (time_step_t t_index, time_step_t t_delta) override=0 |
Execute the backing model formulation for the given time step, where it is of the specified size, and return the response output. | |
const std::vector< std::string > & | get_required_parameters () const override=0 |
void | create_formulation (boost::property_tree::ptree &config, geojson::PropertyMap *global=nullptr) override=0 |
void | create_formulation (geojson::PropertyMap properties) override=0 |
virtual | ~Catchment_Formulation () |
void | finalize () |
Release resources of the given forcing provider. | |
virtual std::string | get_formulation_type () const =0 |
std::string | get_id () const |
void | set_output_stream (std::string file_path) |
void | write_output (std::string out) |
Static Public Member Functions | |
static void | config_pattern_substitution (geojson::PropertyMap &properties, const std::string &key, const std::string &pattern, const std::string &replacement) |
Perform in-place substitution on the given config property item, if the item and the pattern are present. | |
Protected Member Functions | |
std::string | get_catchment_id () const override |
void | set_catchment_id (std::string cat_id) override |
geojson::PropertyMap | interpret_parameters (boost::property_tree::ptree &config, geojson::PropertyMap *global=nullptr) |
void | validate_parameters (geojson::PropertyMap options) |
Protected Attributes | |
std::shared_ptr< data_access::GenericDataProvider > | forcing |
std::string | id |
polygon_t | bounds |
utils::StreamHandler | output |
std::shared_ptr< HY_Catchment > | realized_catchment |
unsigned long | id_number |
Private Attributes | |
std::string | cat_id |
|
inherited |
|
inline |
References set_catchment_id().
|
inline |
References set_catchment_id().
|
inlinevirtual |
|
inlinestatic |
Perform in-place substitution on the given config property item, if the item and the pattern are present.
Any and all instances of the substring pattern
are replaced by replacement
, if key
maps to a present string-type property value.
properties | A reference to the properties config object to be altered. |
key | The key for the configuration property to potentially adjust. |
pattern | The pattern substring to search for that, when present, should be replaced. |
replacement | The replacement substring to potentially insert. |
References geojson::String.
Referenced by realization::Formulation_Manager::construct_missing_formulation(), and realization::Bmi_Multi_Formulation::init_nested_module().
|
overridepure virtual |
Implements realization::Formulation.
Implemented in realization::Bmi_Module_Formulation, and realization::Bmi_Multi_Formulation.
|
overridepure virtual |
Implements realization::Formulation.
Implemented in realization::Bmi_Module_Formulation, and realization::Bmi_Multi_Formulation.
|
inline |
Release resources of the given forcing provider.
References forcing.
|
inlineoverrideprotectedvirtual |
Implements HY_CatchmentRealization.
References cat_id.
Referenced by realization::Bmi_Multi_Formulation::create_multi_formulation(), realization::Bmi_Multi_Formulation::get_value(), realization::Bmi_Multi_Formulation::get_values(), realization::Bmi_Multi_Formulation::get_var_value_as_double(), and realization::Bmi_Module_Formulation::set_model_inputs_prior_to_update().
|
pure virtualinherited |
Implemented in realization::Bmi_C_Formulation, realization::Bmi_Cpp_Formulation, and realization::Bmi_Multi_Formulation.
Referenced by realization::Bmi_Module_Formulation::get_response(), realization::Bmi_Module_Formulation::get_value(), realization::Bmi_Module_Formulation::get_values(), and realization::Formulation::validate_parameters().
|
inlineinherited |
References realization::Formulation::id.
|
inlinevirtual |
Get a header line appropriate for a file made up of entries from this type's implementation of get_output_line_for_timestep
.
Note that like the output generating function, this line does not include anything for time step.
A default implementation is provided for inheritors of this type, which includes only "Total Discharge."
Reimplemented in realization::Bmi_Formulation.
Referenced by ngen::DomainLayer::DomainLayer().
|
pure virtual |
Get a formatted line of output values for the given time step as a delimited string.
This method is useful for preparing calculated data in a representation useful for output files, such as CSV files.
The resulting string will contain calculated values for applicable output variables for the particular formulation, as determined for the given time step. However, the string will not contain any representation of the time step itself.
An empty string is returned if the time step value is not in the range of valid time steps for which there are calculated values for all variables.
timestep | The time step for which data is desired. |
delimiter | The value delimiter for the string. |
Implemented in realization::Bmi_Module_Formulation, and realization::Bmi_Multi_Formulation.
Referenced by ngen::DomainLayer::update_models().
|
overridepure virtual |
Implements realization::Formulation.
Implemented in realization::Bmi_Formulation, and realization::Bmi_Module_Formulation.
|
overridepure virtual |
Execute the backing model formulation for the given time step, where it is of the specified size, and return the response output.
Any inputs and additional parameters must be made available as instance members.
Types should clearly document the details of their particular response output.
t_index | The index of the time step for which to run model calculations. |
t_delta | The duration, in seconds, of the time step for which to run model calculations. |
Implements HY_CatchmentRealization.
Implemented in realization::Bmi_Module_Formulation, and realization::Bmi_Multi_Formulation.
Referenced by ngen::DomainLayer::update_models().
|
inlineprotectedinherited |
|
inlineoverrideprotectedvirtual |
Implements HY_CatchmentRealization.
References cat_id.
Referenced by Catchment_Formulation(), and Catchment_Formulation().
|
inlineinherited |
References HY_CatchmentArea::output.
|
inlineprotectedinherited |
References realization::Formulation::get_formulation_type(), and realization::Formulation::get_required_parameters().
Referenced by realization::Bmi_Multi_Formulation::create_multi_formulation(), realization::Bmi_Module_Formulation::inner_create_formulation(), and realization::Formulation::interpret_parameters().
|
inlineinherited |
References HY_CatchmentArea::output.
Referenced by ngen::DomainLayer::DomainLayer(), and ngen::DomainLayer::update_models().
|
protectedinherited |
|
private |
Referenced by get_catchment_id(), and set_catchment_id().
|
protected |
Referenced by realization::Bmi_Multi_Formulation::create_multi_formulation(), realization::Bmi_Module_Formulation::determine_model_time_offset(), finalize(), realization::Bmi_Multi_Formulation::get_variable_time_begin(), realization::Bmi_Multi_Formulation::get_variable_time_end(), and realization::Bmi_Module_Formulation::set_model_inputs_prior_to_update().
|
protectedinherited |
Referenced by realization::Formulation::get_id().
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |