Demands#
module wntr.network.elements
- class Demands[source]#
Bases:
MutableSequence
Demands class.
The Demands object is used to store multiple demands per junction in a list. The class includes specialized demand-specific calls and type checking.
A demand list is a list of demands and can be used with all normal list- like commands.
The demand list does not have any attributes, but can be created by passing in demand objects or demand tuples as
(base_demand, pattern, category_name)
- base_demand_list(category=None)[source]#
Returns a list of the base demands, optionally of a single category.
- count(value) integer -- return number of occurrences of value #
- index(value[, start[, stop]]) integer -- return first index of value. #
Raises ValueError if the value is not present.
Supporting start and stop arguments is optional, but recommended.
- pattern_list(category=None)[source]#
Returns a list of the patterns, optionally of a single category.
- pop([index]) item -- remove and return item at index (default last). #
Raise IndexError if list is empty or index is out of range.
- remove(value)#
S.remove(value) – remove first occurrence of value. Raise ValueError if the value is not present.
- reverse()#
S.reverse() – reverse IN PLACE