optiwindnet.MILP.pyomo ====================== .. py:module:: optiwindnet.MILP.pyomo Module Contents --------------- .. py:function:: 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[pyomo.environ.ConcreteModel, optiwindnet.MILP._core.ModelMetadata] Make discrete optimization model over link set A. Build ILP Pyomo model for the collector system length minimization. :param A: graph with the available edges to choose from :param capacity: maximum link flow capacity :param topology: one of ``Topology.{BRANCHED, RADIAL}`` :param feeder_route: ``FeederRoute.SEGMENTED`` → feeder routes may be detoured around subtrees; ``FeederRoute.STRAIGHT`` → feeder routes must be straight, direct lines :param feeder_limit: one of ``FeederLimit.{MINIMUM, UNLIMITED, EXACTLY, SPECIFIED, MIN_PLUS1, MIN_PLUS2, MIN_PLUS3}`` :param balanced: enforce subtree loads differing at most by one unit (only possible if ``feeder_limit`` pins the feeder count to a single value) :param max_feeders: upper bound if ``feeder_limit`` is ``FeederLimit.SPECIFIED``, exact count if it is ``FeederLimit.EXACTLY``, unused otherwise .. py:function:: warmup_model(model: pyomo.environ.ConcreteModel, metadata: optiwindnet.MILP._core.ModelMetadata, S: networkx.Graph) -> pyomo.environ.ConcreteModel Set initial solution into ``model``. Changes ``model`` and ``metadata`` in-place. :param model: pyomo model to apply the solution to. :param metadata: indices to the model's variables. :param 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.