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
Networkformulation declared indata["formulations"]and the number of areas indata["areas"]:Legacy fast path (
Network = CopperPlateNetworkandlen(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 bytests/test_zonal_legacy_regression.py).Per-area Block path (
Network = AreaTransportationModelNetworkorlen(data["areas"]) > 1): not yet implemented in this commit; will be wired in commit #9b together with the builder refactor that lets eachadd_*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 = AreaTransportationModelNetworkraisesNotImplementedError(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
profilerattribute 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.