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¶
bool: whether all commodities have single source/sink. |
|
Shared object for network objects. |
|
Get names and values for all vectors making up demand func. |
|
Whether demand function consists of single commodity only. |
|
Whether demand function consists of more than one commodity. |
|
Get value of demand function h(1). |
|
Get all unique sources. |
Methods¶
|
Value of demand function: demand(param). |
|
Derivative of demand function: demand'(param). |
Get indices of source and sink, and rates for all commodities. |
|
|
Get maxmimum inflow for every commodity. |
|
Reset cache values. |
|
Get the total inflow of all commodities for demand(param). |
Get the total inflow of all commodities for demand'(param). |
|
|
Delete all commodities that are made up by |
Map labels -> ids for all commodities. |
|
Map ids -> labels for all commodities. |
|
|
Decompose all commodities in demand vectors. |
|
Add demand data to xml.etree.ElementTree.Element. |
|
|
Generate dict to save object with numpy.savez. |
|
|
Save object into a single file in uncompressed |
|
Construct object from |
|
Get maxmimum inflow for every commodity. |