LinearDemandFunction

Class Description

class paminco.net.demand.LinearDemandFunction(b, shared=None, **kwargs)[source]

A Linear demand function.

Modelling the function:

demand(param) = param * b.
Parameters
bDemandVector, DemandVectorSP, spmatrix or iterable

Demand direction, scales linearly with param.

sharedShared, optional

Shared object for all network objects.

See also

demand_vector

Initialization of demand vectors.

Attributes
bDemandVector or DemandVectorSP

Demand direction, scales linearly with param.

cacheCache

A cache.

shared

Shared object for network objects.

all_single_pairs

bool: whether all commodities have single source/sink.

shared

Shared object for network objects.

demand_vectors

Get names and values for all vectors making up demand func.

is_single_commodity

Whether demand function consists of single commodity only.

is_multi_commodity

Whether demand function consists of more than one commodity.

value_at_1

Get value of demand function h(1).

unique_sources

Get all unique sources.

Attributes

LinearDemandFunction._dv0

LinearDemandFunction.all_single_pairs

bool: whether all commodities have single source/sink.

LinearDemandFunction.n

LinearDemandFunction.shared

Shared object for network objects.

LinearDemandFunction.dtype_int

LinearDemandFunction.dtype_float

LinearDemandFunction.demand_vectors

Get names and values for all vectors making up demand func.

LinearDemandFunction.is_single_commodity

Whether demand function consists of single commodity only.

LinearDemandFunction.is_multi_commodity

Whether demand function consists of more than one commodity.

LinearDemandFunction.value_at_1

Get value of demand function h(1).

LinearDemandFunction.unique_sources

Get all unique sources.

Methods

LinearDemandFunction.value([param])

Value of demand function: demand(param).

LinearDemandFunction.ddx(param, **kwargs)

Derivative of demand function: demand'(param).

LinearDemandFunction.get_source_sink_rate(param)

Get indices of source and sink, and rates for all commodities.

LinearDemandFunction.max_inflow(max_param[, ...])

Inflow rate at max_param for all commodities.

LinearDemandFunction.ddx_inflow(param)

Get the total inflow of all commodities for demand'(param).

LinearDemandFunction.reset_cache([hard])

Reset cache values.

LinearDemandFunction.inflow(param)

Get the total inflow of all commodities for demand(param).

LinearDemandFunction.delete_nodes(*args, ...)

Delete all commodities that are made up by nodes.

LinearDemandFunction.map_node_label_to_id()

Map labels -> ids for all commodities.

LinearDemandFunction.map_node_id_to_label()

Map ids -> labels for all commodities.

LinearDemandFunction.to_single_pairs(**kwargs)

Decompose all commodities in demand vectors.

LinearDemandFunction.add_to_etree(root[, ...])

Add demand data to xml.etree.ElementTree.Element.

LinearDemandFunction.from_xml(data[, shared])

Load object from .xml data

LinearDemandFunction.make_save_dict([...])

Generate dict to save object with numpy.savez.

LinearDemandFunction.save_to_numpy(file, ...)

Save object into a single file in uncompressed .npz format.

LinearDemandFunction.from_npz(data[, ...])

Construct object from .npz file.

LinearDemandFunction.max_inflow(max_param[, ...])

Inflow rate at max_param for all commodities.