AffineDemandFunction

Class Description

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

An affine demand function.

Modelling the function:

demand(param) = b0 + param * b

where b0 and b are demand vectors modelling an equal amount of commodities.

Parameters
b0DemandVector, DemandVectorSP, spmatrix or iterable

Base demand, unaffected by param.

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
b0DemandVector or DemandVectorSP

Base demand, unaffected by param.

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

AffineDemandFunction._dv0

AffineDemandFunction.all_single_pairs

bool: whether all commodities have single source/sink.

AffineDemandFunction.n

AffineDemandFunction.shared

Shared object for network objects.

AffineDemandFunction.dtype_int

AffineDemandFunction.dtype_float

AffineDemandFunction.demand_vectors

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

AffineDemandFunction.is_single_commodity

Whether demand function consists of single commodity only.

AffineDemandFunction.is_multi_commodity

Whether demand function consists of more than one commodity.

AffineDemandFunction.value_at_1

Get value of demand function h(1).

AffineDemandFunction.unique_sources

Get all unique sources.

Methods

AffineDemandFunction.value([param])

Value of demand function: demand(param).

AffineDemandFunction.ddx(param, **kwargs)

Derivative of demand function: demand'(param).

AffineDemandFunction.get_source_sink_rate(param)

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

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

Get maxmimum inflow for every commodity.

AffineDemandFunction.reset_cache([hard])

Reset cache values.

AffineDemandFunction.inflow(param)

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

AffineDemandFunction.ddx_inflow(param)

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

AffineDemandFunction.delete_nodes(*args, ...)

Delete all commodities that are made up by nodes.

AffineDemandFunction.map_node_label_to_id()

Map labels -> ids for all commodities.

AffineDemandFunction.map_node_id_to_label()

Map ids -> labels for all commodities.

AffineDemandFunction.to_single_pairs(**kwargs)

Decompose all commodities in demand vectors.

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

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

AffineDemandFunction.from_xml(data[, shared])

AffineDemandFunction.make_save_dict([...])

Generate dict to save object with numpy.savez.

AffineDemandFunction.save_to_numpy(file, ...)

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

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

Construct object from .npz file.

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

Get maxmimum inflow for every commodity.