OWA-EPANET Toolkit 2.3
|
Functions | |
int DLLEXPORT | EN_getdemandmodel (EN_Project ph, int *out_type, double *out_pmin, double *out_preq, double *out_pexp) |
Retrieves the type of demand model in use and its parameters. | |
int DLLEXPORT | EN_setdemandmodel (EN_Project ph, int type, double pmin, double preq, double pexp) |
Sets the type of demand model to use and its parameters. | |
int DLLEXPORT | EN_adddemand (EN_Project ph, int nodeIndex, double baseDemand, const char *demandPattern, const char *demandName) |
appends a new demand to a junction node demands list. | |
int DLLEXPORT | EN_deletedemand (EN_Project ph, int nodeIndex, int demandIndex) |
deletes a demand from a junction node. | |
int DLLEXPORT | EN_getdemandindex (EN_Project ph, int nodeIndex, const char *demandName, int *out_demandIndex) |
Retrieves the index of a node's named demand category. | |
int DLLEXPORT | EN_getnumdemands (EN_Project ph, int nodeIndex, int *out_numDemands) |
Retrieves the number of demand categories for a junction node. | |
int DLLEXPORT | EN_getbasedemand (EN_Project ph, int nodeIndex, int demandIndex, double *out_baseDemand) |
Gets the base demand for one of a node's demand categories. | |
int DLLEXPORT | EN_setbasedemand (EN_Project ph, int nodeIndex, int demandIndex, double baseDemand) |
Sets the base demand for one of a node's demand categories. | |
int DLLEXPORT | EN_getdemandpattern (EN_Project ph, int nodeIndex, int demandIndex, int *out_patIndex) |
Retrieves the index of a time pattern assigned to one of a node's demand categories. | |
int DLLEXPORT | EN_setdemandpattern (EN_Project ph, int nodeIndex, int demandIndex, int patIndex) |
Sets the index of a time pattern used for one of a node's demand categories. | |
int DLLEXPORT | EN_getdemandname (EN_Project ph, int nodeIndex, int demandIndex, char *out_demandName) |
Retrieves the name of a node's demand category. | |
int DLLEXPORT | EN_setdemandname (EN_Project ph, int nodeIndex, int demandIdx, const char *demandName) |
Assigns a name to a node's demand category. | |
These functions are used for managing nodal demands.
int DLLEXPORT EN_adddemand | ( | EN_Project | ph, |
int | nodeIndex, | ||
double | baseDemand, | ||
const char * | demandPattern, | ||
const char * | demandName ) |
appends a new demand to a junction node demands list.
ph | an EPANET project handle. |
nodeIndex | the index of a node (starting from 1). |
baseDemand | the demand's base value. |
demandPattern | the name of a time pattern used by the demand |
demandName | the name of the demand's category |
A NULL or blank string can be used for demandPattern
and for demandName
to indicate that no time pattern or category name is associated with the demand.
int DLLEXPORT EN_deletedemand | ( | EN_Project | ph, |
int | nodeIndex, | ||
int | demandIndex ) |
deletes a demand from a junction node.
ph | an EPANET project handle. |
nodeIndex | the index of a node (starting from 1). |
demandIndex | the position of the demand in the node's demands list (starting from 1). |
int DLLEXPORT EN_getbasedemand | ( | EN_Project | ph, |
int | nodeIndex, | ||
int | demandIndex, | ||
double * | out_baseDemand ) |
Gets the base demand for one of a node's demand categories.
ph | an EPANET project handle. | |
nodeIndex | a node's index (starting from 1). | |
demandIndex | the index of a demand category for the node (starting from 1). | |
[out] | out_baseDemand | the category's base demand. |
int DLLEXPORT EN_getdemandindex | ( | EN_Project | ph, |
int | nodeIndex, | ||
const char * | demandName, | ||
int * | out_demandIndex ) |
Retrieves the index of a node's named demand category.
ph | an EPANET project handle. | |
nodeIndex | the index of a node (starting from 1) | |
demandName | the name of a demand category for the node | |
[out] | out_demandIndex | the index of the demand being sought |
int DLLEXPORT EN_getdemandmodel | ( | EN_Project | ph, |
int * | out_type, | ||
double * | out_pmin, | ||
double * | out_preq, | ||
double * | out_pexp ) |
Retrieves the type of demand model in use and its parameters.
ph | an EPANET project handle. | |
[out] | out_type | Type of demand model (see EN_DemandModel). |
[out] | out_pmin | Pressure below which there is no demand. |
[out] | out_preq | Pressure required to deliver full demand. |
[out] | out_pexp | Pressure exponent in demand function. |
Parameters out_pmin
, out_preq
, and out_pexp
are only used when the demand model is EN_PDA
.
int DLLEXPORT EN_getdemandname | ( | EN_Project | ph, |
int | nodeIndex, | ||
int | demandIndex, | ||
char * | out_demandName ) |
Retrieves the name of a node's demand category.
ph | an EPANET project handle. | |
nodeIndex | a node's index (starting from 1). | |
demandIndex | the index of one of the node's demand categories (starting from 1). | |
[out] | out_demandName | The name of the selected category. |
out_demandName
must be sized to contain at least EN_MAXID+1 characters.
int DLLEXPORT EN_getdemandpattern | ( | EN_Project | ph, |
int | nodeIndex, | ||
int | demandIndex, | ||
int * | out_patIndex ) |
Retrieves the index of a time pattern assigned to one of a node's demand categories.
ph | an EPANET project handle. | |
nodeIndex | the node's index (starting from 1). | |
demandIndex | the index of a demand category for the node (starting from 1). | |
[out] | out_patIndex | the index of the category's time pattern. |
A returned pattern index of 0 indicates that no time pattern has been assigned to the demand category.
int DLLEXPORT EN_getnumdemands | ( | EN_Project | ph, |
int | nodeIndex, | ||
int * | out_numDemands ) |
Retrieves the number of demand categories for a junction node.
ph | an EPANET project handle. | |
nodeIndex | the index of a node (starting from 1). | |
[out] | out_numDemands | the number of demand categories assigned to the node. |
int DLLEXPORT EN_setbasedemand | ( | EN_Project | ph, |
int | nodeIndex, | ||
int | demandIndex, | ||
double | baseDemand ) |
Sets the base demand for one of a node's demand categories.
ph | an EPANET project handle. |
nodeIndex | a node's index (starting from 1). |
demandIndex | the index of a demand category for the node (starting from 1). |
baseDemand | the new base demand for the category. |
int DLLEXPORT EN_setdemandmodel | ( | EN_Project | ph, |
int | type, | ||
double | pmin, | ||
double | preq, | ||
double | pexp ) |
Sets the type of demand model to use and its parameters.
ph | an EPANET project handle. |
type | Type of demand model (see EN_DemandModel). |
pmin | Pressure below which there is no demand. |
preq | Pressure required to deliver full demand. |
pexp | Pressure exponent in demand function. |
Set type
to EN_DDA
for a traditional demand driven analysis (in which case the remaining three parameter values are ignored) or to EN_PDA
for a pressure driven analysis. In the latter case a node's demand is 0 when pressure is below pmin
, is at full demand when pressure is above preq
, or is otherwise computed as:
Dfull * [ (P - pmin) / (preq - pmin) ] ^ pexp
where Dfull
is the full demand and P
is the current pressure.
A valid value for preq
must be at least 0.1 pressure units larger than pmin
.
int DLLEXPORT EN_setdemandname | ( | EN_Project | ph, |
int | nodeIndex, | ||
int | demandIdx, | ||
const char * | demandName ) |
Assigns a name to a node's demand category.
ph | an EPANET project handle. |
nodeIndex | a node's index (starting from 1). |
demandIdx | the index of one of the node's demand categories (starting from 1). |
demandName | the new name assigned to the category. |
The category name must contain no more than EN_MAXID characters.
int DLLEXPORT EN_setdemandpattern | ( | EN_Project | ph, |
int | nodeIndex, | ||
int | demandIndex, | ||
int | patIndex ) |
Sets the index of a time pattern used for one of a node's demand categories.
ph | an EPANET project handle. |
nodeIndex | a node's index (starting from 1). |
demandIndex | the index of one of the node's demand categories (starting from 1). |
patIndex | the index of the time pattern assigned to the category. |
Specifying a pattern index of 0 indicates that no time pattern is assigned to the demand category.