model

This module defines the PREP-SHOT model. The model is created using the pyoptinterface library.

prepshot.model.check_line_symmetry(existing)[源代码]

Check that each existing line has the same capacity in both directions.

A line has one entry for each direction, and the cost rules charge half of the line cost on each entry. An entry with no equal entry in the opposite direction would thus be charged incorrectly.

参数

existing (dict) -- transmission_existing, keyed (zone1, zone2) or (zone1, zone2, commission_year).

抛出

ValueError -- If the capacity of a line differs between the two directions.

返回类型

None

prepshot.model.create_model(params)[源代码]

Create the PREP-SHOT model.

参数

params (dict) -- Dictionary of parameters for the model.

返回

Model object.

返回类型

object

prepshot.model.define_active_zone_tech(model)[源代码]

Pull the sparse (zone, tech) set from model.params (built once at file-read time by load_data.compute_active_zone_tech) and derive the time-indexed key lists used by the constraint builders.

The (zone, tech) set itself is data-property (depends only on existing_fleet + expansion_candidates), so we compute it in load_data and reuse it unchanged across every PCM window. The (h, m, y, z, te) lists DO depend on the per-window time index sets, so they're materialised here.

参数

model (object) --

返回类型

None

prepshot.model.define_basic_sets(model)[源代码]

Define sets for the model.

参数

model (object) -- Model object to be solved.

返回类型

None

prepshot.model.define_complex_sets(model)[源代码]

Validate that every line param needed by the constraints is actually present in the loaded CSVs.

Refuses to silently default a missing entry. Each (active line, year) combination MUST have a row in the CSV.

参数

model (object) --

返回类型

None

prepshot.model.define_constraints(model)[源代码]

Define constraints for the model.

参数

model (object) -- Model to be solved.

返回类型

None

prepshot.model.define_model(params)[源代码]

This function creates the model class depending on predefined solver.

参数

params (dict) -- parameters for the model

返回

A pyoptinterface Model object depending on the solver

返回类型

object

抛出

ValueError -- Unsupported or undefined solver

prepshot.model.define_variables(model)[源代码]

Define variables for the model.

参数

model (object) -- Model to be solved.

返回类型

None