NGen
|
Collection interface to HY_Features objects and their associated model formulations. More...
#include <HY_Features.hpp>
Public Member Functions | |
HY_Features () | |
Construct a new, default HY_Features object. | |
HY_Features (geojson::GeoJSON fabric, std::shared_ptr< Formulation_Manager > formulations) | |
Construct a new HY_Features object from a GeoJSON feature collection and a set of formulations. | |
HY_Features (geojson::GeoJSON catchments, std::string *link_key, std::shared_ptr< Formulation_Manager > formulations) | |
Construct a new HY_Features object from a Network and a set of formulations. | |
std::shared_ptr< HY_CatchmentRealization > | catchment_at (std::string id) |
Get the HY_CatchmentRealization pointer identified by id . | |
HY_Features (network::Network network, std::shared_ptr< Formulation_Manager > formulations, geojson::GeoJSON fabric) | |
Construct a new HY_Features object from a Network and a set of formulations. | |
std::shared_ptr< HY_HydroNexus > | nexus_at (const std::string &id) |
Get the HY_HydroNexus pointer identifed by id . | |
auto | catchments () |
An iterator of only the catchment feature ids. | |
auto | catchments (long lyr) |
An iterator of only the catchment feature ids from only the specified layer. | |
const auto & | layers () |
Return a set of layers that contain a catchment. | |
auto | nexuses () |
An iterator of only the nexus feature ids. | |
std::vector< std::shared_ptr< HY_HydroNexus > > | destination_nexuses (const std::string &id) |
Get a vector of destination (downstream) nexus pointers. | |
void | validate_dendritic () |
Validates that the feature topology is dendritic. | |
virtual | ~HY_Features () |
Destroy the hy features object. | |
Private Types | |
using | Formulation_Manager = realization::Formulation_Manager |
Private Attributes | |
std::unordered_map< std::string, std::shared_ptr< HY_Catchment > > | _catchments |
Internal mapping of catchment id -> HY_Catchment pointer. | |
std::unordered_map< std::string, std::shared_ptr< HY_HydroNexus > > | _nexuses |
Internal mapping of nexus id -> HY_HydroNexus pointer. | |
network::Network | network |
network::Network graph of identities. | |
std::shared_ptr< Formulation_Manager > | formulations |
Pointer to the formulation manager used to associate catchment formulations with HY_Catchment objects. | |
std::set< long > | hf_layers |
The set of layers that contain at least one catchment. | |
Collection interface to HY_Features objects and their associated model formulations.
A HY_Features collection provides organized access to HY_Features objects. It is backed by a topologically connected network::Network index and provides quick id based iteration of various feature types, as well as helper functions for accessing pointers to the constructed features.
Simple usage example to execute model formulations for each catchment for a single time:
|
inline |
Construct a new, default HY_Features object.
HY_Features::HY_Features | ( | geojson::GeoJSON | fabric, |
std::shared_ptr< Formulation_Manager > | formulations ) |
Construct a new HY_Features object from a GeoJSON feature collection and a set of formulations.
Constructs the network::Network index and then
fabric | |
formulations |
HY_Features::HY_Features | ( | geojson::GeoJSON | catchments, |
std::string * | link_key, | ||
std::shared_ptr< Formulation_Manager > | formulations ) |
Construct a new HY_Features object from a Network and a set of formulations.
Constructs the HY_Catchment objects for each catchment connecting them with the provided link_key attaches the formulation associated with the catchment found in the Formulation_Manager. Also constucts each nexus as a HY_PointHydroNexus.
catchments | |
link_key | |
formulations |
HY_Features::HY_Features | ( | network::Network | network, |
std::shared_ptr< Formulation_Manager > | formulations, | ||
geojson::GeoJSON | fabric ) |
Construct a new HY_Features object from a Network and a set of formulations.
Constructs the HY_Catchment objects for each catchment feature in the network, and attaches tha formaulation associated with the catchment found in the Formulation_Manager. Also constucts each nexus as a HY_PointHydroNexus.
network | |
formulations |
References _catchments, _nexuses, formulations, hf_layers, hy_features::identifiers::isCatchment(), hy_features::identifiers::isNexus(), and hy_features::identifiers::seperator.
|
inlinevirtual |
Destroy the hy features object.
|
inline |
Get the HY_CatchmentRealization pointer identified by id
.
If no realization exists for id
, a nullptr is returned.
id |
References _catchments.
Referenced by ngen::Layer::update_models().
|
inline |
An iterator of only the catchment feature ids.
References hy_features::identifiers::catchment.
Referenced by validate_dendritic().
|
inline |
An iterator of only the catchment feature ids from only the specified layer.
References hy_features::identifiers::catchment.
|
inline |
Get a vector of destination (downstream) nexus pointers.
If id
is not a known catchment identifier, then an empty vector is returned.
id |
References _catchments, and _nexuses.
Referenced by ngen::Layer::update_models().
|
inline |
Return a set of layers that contain a catchment.
References hf_layers.
|
inline |
Get the HY_HydroNexus pointer identifed by id
.
If no nexus exists for id
, a nullptr is returned.
id |
References _nexuses.
Referenced by ngen::SurfaceLayer::update_models().
|
inline |
An iterator of only the nexus feature ids.
References hy_features::identifiers::nexus.
Referenced by ngen::SurfaceLayer::update_models().
|
inline |
Validates that the feature topology is dendritic.
References catchments().
|
private |
Internal mapping of catchment id -> HY_Catchment pointer.
Referenced by HY_Features(), catchment_at(), and destination_nexuses().
|
private |
Internal mapping of nexus id -> HY_HydroNexus pointer.
Referenced by HY_Features(), destination_nexuses(), and nexus_at().
|
private |
Pointer to the formulation manager used to associate catchment formulations with HY_Catchment objects.
Referenced by HY_Features().
|
private |
The set of layers that contain at least one catchment.
Referenced by HY_Features(), and layers().
|
private |
network::Network graph of identities.