Controls Module

API Reference

Below is the API reference for base implementation of the Controls module.

Base Components

ControlRules.h

class ControlRules
#include <ControlRules.h>

This class is a header-only abstract class that defines the interface for control rules.

Created by bernardoct on 6/26/17.

Subclassed by DataSeries, WwtpDischargeRule

Private Functions

virtual double get_dependent_variable(double x) = 0

Returns the double dependent variable for a given independent variable.

Parameters:

x – independent variable.

Returns:

dependent variable.

virtual double get_dependent_variable(int x) = 0

Returns the integer dependent variable for a given independent variable.

Parameters:
  • x – independent variable.

  • week – week of the year.

Returns:

dependent variable.

virtual double get_dependent_variable(double x, int week) = 0

Returns the double dependent variable for a given independent variable at a specific week.

Parameters:
  • x – independent variable.

  • week – week of the year.

Returns:

dependent variable.

virtual double get_dependent_variable(int x, int week) = 0

Returns the integer dependent variable for a given independent variable at a specific week.

Parameters:
  • x – independent variable.

  • week – week of the year.

Returns:

dependent variable.

MinEnvFlowControl.h

class MinEnvFlowControl
#include <MinEnvFlowControl.h>

This class is a defines the control rules for minimum environmental flow.

This class represents a minimum environmental flow control object. FIXME: This class is seems to be a duplicate of the MinEnvFlowControl class.

Created by bernardoct on 6/28/17.

Created by bct52 on 6/28/17.

Subclassed by FallsLakeMinEnvFlowControl, FixedMinEnvFlowControl, InflowMinEnvFlowControl, JordanLakeMinEnvFlowControl, SeasonalMinEnvFlowControl, StorageMinEnvFlowControl

Public Functions

MinEnvFlowControl(int water_source_id, const vector<int> &aux_water_sources_id, const vector<int> &aux_utilities_ids, int type)

Constructs a MinEnvFlowControl object for managing minimum environmental flow controls on specified water sources. Initializes the object with associated water source and utility IDs and a control type.

Parameters:
  • water_source_id – Integer representing the ID of the primary water source under environmental flow control.

  • water_sources_ids – Reference to a vector of integers containing the IDs of additional water sources affected by the control.

  • aux_utilities_ids – Reference to a vector of integers containing the IDs of auxiliary utilities associated with the control.

  • type – Integer representing the type of environmental flow control.

MinEnvFlowControl(const MinEnvFlowControl &min_env_control)

Copy constructor for a MinEnvFlowControl object. This function copies the attributes from an existing MinEnvFlowControl object.

Parameters:

min_env_control – Reference to the MinEnvFlowControl object to be copied.

virtual ~MinEnvFlowControl()

Destructor for the MinEnvFlowControl class. Cleans up resources associated with the object. Since the destructor is defaulted, no custom cleanup is required.

Returns:

void

virtual double getRelease(int week) = 0

Get the Release object. This function is a pure virtual function that must be implemented by derived classes.

Parameters:

week – The week for which the release is requested.

Returns:

double

void addComponents(vector<WaterSource*> water_sources, vector<Utility*> utilities)

Associates water sources and utilities with the MinEnvFlowControl object based on their IDs. The associations are established by mapping the provided vectors of water sources and utilities to the corresponding IDs.

Parameters:
  • water_sources – A vector of pointers to WaterSource objects representing all available water sources.

  • utilities – A vector of pointers to Utility objects representing all available utilities.

Returns:

void

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

Sets the realization for the MinEnvFlowControl object. This function is a pure virtual function that must be implemented by derived classes.

Parameters:
  • r – Unsigned long integer representing the realization ID.

  • rdm_factors – Reference to a vector of doubles containing the RDM factors to be applied.

Returns:

void

Public Members

const vector<int> water_sources_ids

A vector of WaterSource IDs that require minimum environment flow control.

const vector<int> utilities_ids

A vector of Utility IDs that enable minimum environment flow control.

const int water_source_id

The ID of the WaterSource object that requires minimum environment flow control.

const int type

The type of minimum environment flow control.

Protected Attributes

vector<WaterSource*> water_sources

A vector of WaterSource objects that require minimum environment flow control.

vector<Catchment*> catchments

A vector of Catchment objects that enable minimum environment flow control.

vector<Utility*> utilities

A vector of Utility objects that enable minimum environment flow control.

MinEnvironFlowControl.h

class MinEnvironFlowControl
#include <MinEnvironFlowControl.h>

Public Functions

MinEnvironFlowControl(int water_source_id, const vector<int> &aux_water_sources_id, const vector<int> &aux_utilities_ids, int type)

Constructs a MinEnvFlowControl object for managing minimum environmental flow controls on specified water sources. Initializes the object with associated water source and utility IDs and a control type.

Parameters:
  • water_source_id – Integer representing the ID of the primary water source under environmental flow control.

  • water_sources_ids – Reference to a vector of integers containing the IDs of additional water sources affected by the control.

  • aux_utilities_ids – Reference to a vector of integers containing the IDs of auxiliary utilities associated with the control.

  • type – Integer representing the type of environmental flow control.

MinEnvironFlowControl(const MinEnvironFlowControl &min_env_control)

Copy constructor for a MinEnvFlowControl object. This function copies the attributes from an existing MinEnvFlowControl object.

Parameters:

min_env_control – Reference to the MinEnvFlowControl object to be copied.

virtual double getRelease(int week) = 0

Get the Release object. This function is a pure virtual function that must be implemented by derived classes.

Parameters:

week – The week for which the release is requested.

Returns:

double

void addComponents(vector<WaterSource*> water_sources, vector<Utility*> utilities)

Associates water sources and utilities with the MinEnvFlowControl object based on their IDs. The associations are established by mapping the provided vectors of water sources and utilities to the corresponding IDs.

Parameters:
  • water_sources – A vector of pointers to WaterSource objects representing all available water sources.

  • utilities – A vector of pointers to Utility objects representing all available utilities.

Returns:

void

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

Sets the realization for the MinEnvFlowControl object. This function is a pure virtual function that must be implemented by derived classes.

Parameters:
  • r – Unsigned long integer representing the realization ID.

  • rdm_factors – Reference to a vector of doubles containing the RDM factors to be applied.

Returns:

void

Public Members

const vector<int> water_sources_ids

A vector of WaterSource IDs that require minimum environment flow control.

const vector<int> utilities_ids

A vector of Utility IDs that enable minimum environment flow control.

const int water_source_id

The ID of the WaterSource object that requires minimum environment flow control.

const int type

The type of minimum environment flow control.

Protected Attributes

vector<WaterSource*> water_sources

A vector of WaterSource objects that require minimum environment flow control.

vector<Catchment*> catchments

A vector of Catchment objects that enable minimum environment flow control.

vector<Utility*> utilities

A vector of Utility objects that enable minimum environment flow control.