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)


__init__(patterns, *args)[source]#
append(obj)[source]#

S.append(object) - append object to the end

at(time, category=None, multiplier=1)[source]#

Return the total demand at a given time.

base_demand_list(category=None)[source]#

Returns a list of the base demands, optionally of a single category.

category_list()[source]#

Returns a list of all the pattern categories.

clear()[source]#

S.clear() - remove all entries

count(value) integer -- return number of occurrences of value#
extend(iterable)[source]#

S.extend(iterable) - extend list by appending elements from the iterable

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.

insert(index, obj)[source]#

S.insert(index, object) - insert object before index

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.

remove_category(category)[source]#

Remove all demands from a specific category

reverse()#

S.reverse() – reverse IN PLACE

to_list()[source]#
to_ts(obj)[source]#

Time series representation of demands