SystemComponents Module

API Reference

The base components define the: Catchments submodule of the SystemComponents module.

Catchments Components

Catchment.h

class Catchment
#include <Catchment.h>

This class defines a catchment object.

Created by bernardo on 1/13/17.

Subclassed by EvaporationSeries

Public Functions

Catchment(vector<vector<double>> *streamflows_all, int series_length)

Constructor for a new Catchment object.

Parameters:
  • streamflows_all – A 2D vector containing all combined historical and synthetic streamflow realizations.

  • series_length – An integer representing the length of the streamflow time series.

Catchment(const Catchment &catchment)

Copy constructor for a Catchment object. This constructor does not copy the parent pointer. Set parent to false to distinguish between a parent Catchment and those created as copies. Initializes a new instance of Catchment with data copied from the original Catchment object.

Parameters:

catchment – A Catchment object.

virtual ~Catchment()

Destructor for a Catchment object.

Catchment &operator=(const Catchment &catchment)

Copy assignment operator.

Parameters:

catchment

double getStreamflow(int week)

Gets streamflow for a given week AFTER the first delta_week weeks used to calculate the ROFs. This function assures that the number of past inflows used for ROF calculations are reserved in the beginning of the time series for ROF calculations.

Parameters:

week – An integer representing the week of the entire streamflow time series.

Returns:

A double representing the streamflow for the given week.

virtual void setRealization(unsigned long r, vector<double> &rdm_factors)

Sets the 1D vector time series corresponding to realization index and eliminate reference to the full 2D comprehensive streamflow data set.

Parameters:
  • r – An unsigned long integer representing the realization index.

  • rdm_factors – A reference to a vector of doubles representing the random factors used to generate the streamflow realization (UNUSED).

Protected Attributes

vector<vector<double>> *streamflows_all

A pointer to a 2D vector containing all combined historical and synthetic streamflow realizations.

vector<double> streamflows_realization

A 1D vector containing the streamflows for a specific realization for the catchment.

int series_length

An integer representing the length of the streamflow time series. It should be longer than WEEKS_IN_YEAR * NUMBER_REALIZATIONS_ROF.

bool parent = true

A boolean indicating whether this catchment is a parent catchment or not. Parent catchments are catchments (INSERT DESCRIPTION HERE).

int delta_week = (int)std::round(Constants::WEEKS_IN_YEAR * Constants::NUMBER_REALIZATIONS_ROF)

An integer indicating the number of weeks to skip in the beginning of the time series to identify the correct week for the start of a given realization. This is the number of weeks of historical data used to calculate the ROFs. Should take on the value of WEEKS_IN_YEAR * NUMBER_REALIZATIONS_ROF.