![]() |
OpenSWMM Engine
6.0.0-alpha.1
Data-oriented, plugin-extensible SWMM Engine (6.0.0-alpha.1)
|
Controls file local functions. More...
Functions | |
| int | addPremise (int r, int type, char *Tok[], int nToks) |
| Adds a premise clause to a control rule. | |
| int | getPremiseVariable (char *tok[], int nToks, int *k, struct TVariable *v) |
| Parses a variable (e.g., Node 123 Depth) used in a control rule. | |
| int | getPremiseValue (char *token, int attrib, double *value) |
| Parses the numerical value of a particular node/link attribute in the premise clause of a control rule. | |
| int | addAction (int r, char *Tok[], int nToks) |
| Adds a new action to a control rule. | |
| int | evaluatePremise (struct TPremise *p, double tStep) |
| Evaluates premise clause of a control rule. | |
| double | getVariableValue (struct TVariable v) |
| Gets the value of a variable. | |
| int | compareTimes (double lhsValue, int relation, double rhsValue, double halfStep) |
| Compares two times. | |
| int | compareValues (double lhsValue, int relation, double rhsValue) |
| Compares two values. | |
| void | updateActionList (struct TAction *a) |
| Updates action list. | |
| int | executeActionList (DateTime currentTime) |
| Executes action list. | |
| void | clearActionList (void) |
| Clears action list. | |
| void | deleteActionList (void) |
| Deletes action list. | |
| void | deleteRules (void) |
| Deletes control rules. | |
| int | findExactMatch (char *s, char *keyword[]) |
| Finds the exact match between a string and an array of keyword strings. | |
| int | setActionSetting (char *tok[], int nToks, int *curve, int *tseries, int *attrib, double value[]) |
| Identifies how control actions settings are determined. | |
| void | updateActionValue (struct TAction *a, DateTime currentTime, double dt) |
| Updates the value of a control action. | |
| double | getPIDSetting (struct TAction *a, double dt) |
| Gets PID setting. | |
| int | getVariableIndex (char *varName) |
| Gets variable index. | |
| double | getNamedVariableValue (int varIndex) |
| Gets named variable value. | |
| int | getExpressionIndex (char *exprName) |
| Gets expression index. | |
| int | getGageAttrib (char *token) |
| Determines the attribute code for a rain gage variable. | |
| double | getRainValue (struct TVariable v) |
| Gets rain value. | |
Controls file local functions.
| int addAction | ( | int | r, |
| char * | tok[], | ||
| int | nToks | ||
| ) |
Adds a new action to a control rule.
Adds a new action to a control rule.
| [in] | r | Rule index |
| [in] | tok | Array of string tokens containing action statement |
| [in] | nToks | Number of string tokens |
| [in] | r | Rule index |
| [in] | tok | Array of string tokens containing action statement |
| [in] | nToks | Number of string tokens |
| int addPremise | ( | int | r, |
| int | type, | ||
| char * | tok[], | ||
| int | nToks | ||
| ) |
Adds a premise clause to a control rule.
Adds a premise clause to a control rule.
| [in] | r | Rule index |
| [in] | type | Premise type |
| [in] | Tok | Array of string tokens |
| [in] | nToks | Number of tokens |
| [in] | r | Rule index |
| [in] | type | Premise type |
| [in] | Tok | Array of string tokens |
| [in] | nToks | Number of tokens |
| void clearActionList | ( | void | ) |
Clears action list.
Clears the list of actions to be executed.
| int compareTimes | ( | double | lhsValue, |
| int | relation, | ||
| double | rhsValue, | ||
| double | halfStep | ||
| ) |
Compares two times.
Evaluates the truth of a relation between two date/times.
| [in] | lhsValue | Left hand side value |
| [in] | relation | Relation operator |
| [in] | rhsValue | Right hand side value |
| [in] | halfStep | Half time step |
| [in] | lhsValue | Date/time value on left hand side of relation |
| [in] | relation | Relational operator code (see RuleRelation enumeration) |
| [in] | rhsValue | Date/time value on right hand side of relation |
| [in] | halfStep | 1/2 the current time step (days) |
| int compareValues | ( | double | lhsValue, |
| int | relation, | ||
| double | rhsValue | ||
| ) |
Compares two values.
Evaluates the truth of a relation between two values.
| [in] | lhsValue | Left hand side value |
| [in] | relation | Relation operator |
| [in] | rhsValue | Right hand side value |
| [in] | lhsValue | Value on left hand side of relation |
| [in] | relation | Relational operator code (see RuleRelation enumeration) |
| [in] | rhsValue | Value on right hand side of relation |
| void deleteActionList | ( | void | ) |
Deletes action list.
Frees the memory used to hold the list of actions to be executed.
| void deleteRules | ( | void | ) |
Deletes control rules.
Frees the memory used for all of the control rules.
| int evaluatePremise | ( | struct TPremise * | p, |
| double | tStep | ||
| ) |
Evaluates premise clause of a control rule.
Evaluates the truth of a control rule premise condition.
| [in] | p | Premise structure to evaluate |
| [in] | tStep | Time step |
| [in] | p | Control rule premise condition |
| [in] | tStep | Current time step (days) |
| int executeActionList | ( | DateTime | currentTime | ) |
Executes action list.
Executes all actions required by fired control rules.
| [in] | currentTime | Current time |
| [in] | currentTime | Current simulation date/time |
| int findExactMatch | ( | char * | s, |
| char * | keyword[] | ||
| ) |
Finds the exact match between a string and an array of keyword strings.
Finds the exact match between a string and an array of keyword strings.
| [in] | s | Character string |
| [in] | keyword | Array of keyword strings |
| [in] | s | Character string |
| [in] | keyword | Array of keyword strings |
| int getExpressionIndex | ( | char * | exprName | ) |
Gets expression index.
Gets expression index.
| [in] | exprName | Name of expression to find index of |
| [in] | exprName | Name of expression to find index of |
| int getGageAttrib | ( | char * | token | ) |
Determines the attribute code for a rain gage variable.
Determines the attribute code for a rain gage variable.
| [in] | token | String token |
| [in] | token | String token |
| double getNamedVariableValue | ( | int | varIndex | ) |
Gets named variable value.
Gets the value of a variable.
| [in] | varIndex | Index of variable |
Gets variable value.
| [in] | v | Variable structure |
| [in] | v | Variable structure |
| double getPIDSetting | ( | struct TAction * | a, |
| double | dt | ||
| ) |
Gets PID setting.
Computes a new setting for a link subject to a PID controller.
| [in] | a | Action structure |
| [in] | dt | Time step |
| [in] | a | Action object |
| [in] | dt | Current time step (days) |
| int getPremiseValue | ( | char * | token, |
| int | attrib, | ||
| double * | value | ||
| ) |
Parses the numerical value of a particular node/link attribute in the premise clause of a control rule.
Parses the numerical value of a particular node/link attribute in the premise clause of a control rule.
| [in] | token | String token |
| [in] | attrib | Index of a node/link attribute |
| [out] | value | Attribute value |
| [in] | token | String token |
| [in] | attrib | Index of a node/link attribute |
| [out] | value | Attribute value |
| int getPremiseVariable | ( | char * | tok[], |
| int | nToks, | ||
| int * | k, | ||
| struct TVariable * | v | ||
| ) |
Parses a variable (e.g., Node 123 Depth) used in a control rule.
Parses a variable (e.g., Node 123 Depth) used in a control rule.
| [in] | tok | Array of string tokens |
| [in] | nToks | Number of tokens |
| [in] | k | Index of current token |
| [in,out] | v | Variable structure |
| [in] | tok | Array of string tokens |
| [in] | nToks | Number of tokens |
| [in] | k | Index of current token |
| [in,out] | v | Variable structure |
| double getRainValue | ( | struct TVariable | v | ) |
Gets rain value.
Retrieves the current or past rainfall amount for a rain gage.
| v | Variable structure | |
| [in] | v | Rule premise variable for a rain gage |
| int getVariableIndex | ( | char * | varName | ) |
Gets variable index.
| [in] | varName | Name of variable to find index of |
| double getVariableValue | ( | struct TVariable | v | ) |
Gets the value of a variable.
Gets variable value.
| [in] | v | Variable structure |
| [in] | v | Variable structure |
| int setActionSetting | ( | char * | tok[], |
| int | nToks, | ||
| int * | curve, | ||
| int * | tseries, | ||
| int * | attrib, | ||
| double | values[] | ||
| ) |
Identifies how control actions settings are determined.
| [in] | tok | Array of string tokens containing action statement |
| [in] | nToks | Number of string tokens |
| [in] | curve | Index of controller curve |
| [in] | tseries | Index of controller time series |
| [in] | attrib | r_PID if PID controller used |
| [out] | values | Values of control settings |
| void updateActionList | ( | struct TAction * | a | ) |
Updates action list.
Adds a new action to the list of actions to be taken.
| [in] | a | Action structure |
Updates the value of a control action.
Updates the value of actions found from Curves or Time Series.
| [in] | a | Action structure |
| [in] | currentTime | Current time |
| [in] | dt | Time step |
| [in] | a | Action structure |
| [in] | currentTime | Current time of simulation in days (days) |
| [in] | dt | Time step (days) |