ENgetcount {epanet2toolkit}R Documentation

Get number of network elements.

Description

ENgetcount retrieves the number of network components of a specific type.

Usage

ENgetcount(compcode)

Arguments

compcode

A character string, integer or numeric specifying the component code(s) (see below).

Details

Component codes consist of the following:

EN_NODECOUNT 0 Nodes
EN_TANKCOUNT 1 Reservoirs and tank nodes
EN_LINKCOUNT 2 Links
EN_PATCOUNT 3 Time patterns
EN_CURVECOUNT 4 Curves
EN_CONTROLCOUNT 5 Simple controls
EN_RULECOUNT 5 Simple controls

The number of junctions in a network equals the number of nodes minus the number of tanks and reservoirs.

Value

The number of network components.

Examples

# path to Net1.inp example file included with this package
inp <- file.path( find.package("epanet2toolkit"), "extdata","Net1.inp")  
ENopen( inp, "Net1.rpt")
ENgetcount(0)
ENgetcount("EN_NODECOUNT")
ENclose()

[Package epanet2toolkit version 1.0.4 Index]