optiwindnet.MILP.ortoolsΒΆ
Module ContentsΒΆ
- optiwindnet.MILP.ortools.make_min_length_model(A: networkx.Graph, capacity: int, *, topology: optiwindnet.MILP._core.Topology = Topology.BRANCHED, feeder_route: optiwindnet.MILP._core.FeederRoute = FeederRoute.SEGMENTED, feeder_limit: optiwindnet.MILP._core.FeederLimit = FeederLimit.UNLIMITED, balanced: bool = False, max_feeders: int = 0) tuple[ortools.math_opt.python.mathopt.Model, optiwindnet.MILP._core.ModelMetadata][source]ΒΆ
Make discrete optimization model over link set A.
Build OR-tools CP-SAT model for the collector system length minimization.
- Parameters:
A β graph with the available edges to choose from
capacity β maximum link flow capacity
topology β one of
Topology.{BRANCHED, RADIAL}feeder_route β
FeederRoute.SEGMENTEDβ feeder routes may be detoured around subtrees;FeederRoute.STRAIGHTβ feeder routes must be straight, direct linesfeeder_limit β one of
FeederLimit.{MINIMUM, UNLIMITED, EXACTLY, SPECIFIED, MIN_PLUS1, MIN_PLUS2, MIN_PLUS3}balanced β enforce subtree loads differing at most by one unit (only possible if
feeder_limitpins the feeder count to a single value)max_feeders β upper bound if
feeder_limitisFeederLimit.SPECIFIED, exact count if it isFeederLimit.EXACTLY, unused otherwise
- optiwindnet.MILP.ortools.warmup_model(model: ortools.math_opt.python.mathopt.Model, metadata: optiwindnet.MILP._core.ModelMetadata, S: networkx.Graph) ortools.math_opt.python.mathopt.Model[source]ΒΆ
Set initial solution into
model.Changes
modelandmetadatain-place.- Parameters:
model β CP-SAT model to apply the solution to.
metadata β indices to the modelβs variables.
S β solution topology
- Returns:
The same model instance that was provided, now with a solution.
- Raises:
OWNWarmupFailed β if some link in S is not available in model.