MCFI: Minimum Cost Flow Interpolation¶
Class Description¶
- class paminco.algo.mcfi.MCFI(net: paminco.net.network.Network, name=None, callback=None, use_simple_timer: bool = True, optim=None, kw_optim=None, **kwargs)[source]¶
Minimum Cost Flow Interpolation.
Computes min costs flows for breakpoints. For parameters in-between the breakpoints, a min cost flow is then interpolated.
- Parameters
- netNetwork
Network to find min cost flows for. A min cost flow
f
for someparam
is found by:minimize net.cost(f) s.t. net.Gamma.dot(f) = net.demand(param).
- namestr, optional
Name of solver.
- callbackcallable, or list of callable, optional
Callbacks called during initialization and run method. Can be used for debugging and timing.
- use_simple_timerbool, default=True
Whether to time MCFI. If
True
, timestamps for intializtion and every iteration will be saved to attributetimer
.- kw_optimkeyword arguments, optional
Further arguments passed to min cost flow optimizer.
- kwargskeyword arguments, optional
Further parameters for MCFI, see MCFIConfig.
See also
MCFIConfig
All settings for MCFI.
paminco.optim.fw_net.NetworkFW
Optimizer to find min cost flows for a given parameter.
Examples
Find user equilibrium (UE) for various specified demand factors:
>>> import paminco >>> net = paminco.net.load_sioux() >>> net.integrate_cost() # integrate to calc UE >>> mcfi = MCFI(net) >>> demand_fac = [0.2, 0.5, 0.6] >>> mcfi.run(param=demand_fac) >>> mcfi.cost_at(demand_fac).round(2) array([ 638722.63, 1673514.68, 2062773.13])
- Attributes
config
MCFIConfigSettings of MCFI.
network
NetworkGet network obj.
name
strGet name of object.
param_solution
ParametricSolutionGet ParametricSolution object.
Settings¶
|
Settings for the Marginal Cost Flow Interpolator. |
|
Enum defining the step rule used in the MCFI algorithm. |
Attributes¶
Get network obj. |
|
Get name of object. |
|
Settings of MCFI. |
|
Get ParametricSolution object. |
Methods¶
|
Run MCFI. |