EPANET  2.1
Patterns

Functions

int ENgetpatternindex (char *id, int *index)
 Retrieves the index of the time pattern with specified ID. More...
 
int ENgetpatternid (int index, char *id)
 Retrieves ID of a time pattern with specific index. More...
 
int ENgetpatternlen (int index, int *len)
 Retrieves the number of multipliers in a time pattern. More...
 
int ENgetpatternvalue (int index, int period, EN_API_FLOAT_TYPE *value)
 Retrive a multiplier from a pattern for a specific time period. More...
 
int ENgetaveragepatternvalue (int index, EN_API_FLOAT_TYPE *value)
 Retrieve the average multiplier value in a time pattern. More...
 
int ENgetdemandpattern (int nodeIndex, int demandIndex, int *pattIndex)
 Get the index of the demand pattern assigned to a node for a category index. More...
 
int ENaddpattern (char *id)
 Add a new time pattern. More...
 
int ENsetpattern (int index, EN_API_FLOAT_TYPE *f, int len)
 Set multipliers for a specific pattern. More...
 
int ENsetpatternvalue (int index, int period, EN_API_FLOAT_TYPE value)
 Set the multiplier for a specific pattern at a specific period. More...
 

Detailed Description

Function Documentation

int ENaddpattern ( char *  id)

Add a new time pattern.

Parameters
idThe string ID of the pattern to add.
Returns
Error code.
See also
ENgetpatternindex
int ENgetaveragepatternvalue ( int  index,
EN_API_FLOAT_TYPE *  value 
)

Retrieve the average multiplier value in a time pattern.

Parameters
indexThe index of a time pattern
[out]valueThe average of all of this time pattern's values
Returns
Error code
int ENgetdemandpattern ( int  nodeIndex,
int  demandIndex,
int *  pattIndex 
)

Get the index of the demand pattern assigned to a node for a category index.

Parameters
nodeIndexThe index of a node (first node is index 1).
demandIndexThe index of a category (first category is index 1).
[out]pattIndexThe index of the pattern for this node and category.
Returns
Error code
int ENgetpatternid ( int  index,
char *  id 
)

Retrieves ID of a time pattern with specific index.

Parameters
indexThe index of a time pattern.
[out]idThe string ID of the time pattern.
Returns
Error code
See also
ENgetpatternindex
int ENgetpatternindex ( char *  id,
int *  index 
)

Retrieves the index of the time pattern with specified ID.

Parameters
idString ID of the time pattern
[out]indexIndex of the specified time pattern
Returns
Error code
See also
ENgetpatternid
int ENgetpatternlen ( int  index,
int *  len 
)

Retrieves the number of multipliers in a time pattern.

Parameters
indexThe index of a time pattern.
[out]lenThe length of the time pattern.
Returns
Error code
int ENgetpatternvalue ( int  index,
int  period,
EN_API_FLOAT_TYPE *  value 
)

Retrive a multiplier from a pattern for a specific time period.

Parameters
indexThe index of a time pattern
periodThe pattern time period. First time period is 1.
[out]valuePattern multiplier
Returns
Error code
int ENsetpattern ( int  index,
EN_API_FLOAT_TYPE *  f,
int  len 
)

Set multipliers for a specific pattern.

Parameters
indexThe index of a pattern. First pattern is index 1.
fAn array of multipliers
lenThe length of array f.
Returns
Error code.
See also
ENgetpatternindex
int ENsetpatternvalue ( int  index,
int  period,
EN_API_FLOAT_TYPE  value 
)

Set the multiplier for a specific pattern at a specific period.

Parameters
indexThe index of a pattern. First pattern is index 1.
periodThe period of the pattern to set.
valueThe value of the multiplier to set.
Returns
Error code.