Learn R Programming

epanet2toolkit (version 1.0.8)

ENgetcount: Get number of network elements.

Description

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

Usage

ENgetcount(compcode)

Value

The number of network components.

Arguments

compcode

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

Details

Component codes consist of the following:

EN_NODECOUNT0Nodes
EN_TANKCOUNT1Reservoirs and tank nodes
EN_LINKCOUNT2Links
EN_PATCOUNT3Time patterns
EN_CURVECOUNT4Curves
EN_CONTROLCOUNT5Simple controls
EN_RULECOUNT5Simple controls

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

Examples

Run this code
# 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()

Run the code above in your browser using DataLab