sdom.initialize_model#

sdom.initialize_model(data, n_hours=8760, with_resilience_constraints=False, model_name='SDOM_Model')[source]#

Initialize a Pyomo SDOM optimization model (dispatcher).

Selects the model-construction path based on the Network formulation declared in data["formulations"] and the number of areas in data["areas"]:

  • Legacy fast path (Network = CopperPlateNetwork and len(data["areas"]) == 1): delegates to _initialize_model_copperplate(), which is the historical model body preserved verbatim. This guarantees bit-identical objective values for every legacy data folder (locked by tests/test_zonal_legacy_regression.py).

  • Per-area Block path (Network = AreaTransportationModelNetwork or len(data["areas"]) > 1): not yet implemented in this commit; will be wired in commit #9b together with the builder refactor that lets each add_* consume a per-area data slice.

Parameters:
  • data (dict) – Data dictionary as returned by sdom.io_manager.load_data(). Must contain "formulations" and "areas" keys.

  • n_hours (int, optional) – Number of hours to simulate (default 8760).

  • with_resilience_constraints (bool, optional) – If True, adds resilience-related constraints. Combined with Network = AreaTransportationModelNetwork raises NotImplementedError (deferred per PRD).

  • model_name (str, optional) – Name to assign to the Pyomo model instance (default "SDOM_Model").

Returns:

A fully initialized Pyomo model ready for optimization, with a profiler attribute attached.

Return type:

pyomo.environ.ConcreteModel

Raises:

NotImplementedError – When the per-area Block path is required (zonal data or Network = AreaTransportationModelNetwork). This branch lands in commit #9b.