odys.domain.scenario¶
Scenarios for deterministic and stochastic optimization. A Scenario holds the typed profiles of one possible future, with a name and a probability. ScenarioSet holds the scenarios of one problem and checks that their probabilities sum to 1 and their names are unique; EnergySystem builds it from the scenarios you pass.
See Scenario and Several scenarios in the User Guide.
Scenarios for deterministic and stochastic optimization.
A scenario represents one possible realization of the energy system's exogenous inputs (load demand, generator availability, market prices), given as typed profiles. A single scenario gives a deterministic problem. Several weighted scenarios give a stochastic problem, where the optimizer finds decisions that perform well in expectation across all of them.
Scenario
¶
Bases: BaseModel
One possible realization of the energy system's exogenous inputs.
A scenario holds the profiles (demand, available capacity, prices) of one possible future. Each entity has at most one profile of each kind, and every profile must have one value per optimization timestep.
For deterministic optimization, pass a single scenario; its name and probability keep their defaults. For stochastic optimization, pass several scenarios with unique names and probabilities that sum to 1.
Source code in src/odys/domain/scenario.py
23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 | |
profile_for(entity)
¶
Return the profile that references the given entity, if the scenario has one.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
entity
|
EnergyEntity
|
The asset or market to look up. |
required |
Returns:
| Type | Description |
|---|---|
Profile | None
|
The entity's profile, or None if the scenario has no profile for it. |
Source code in src/odys/domain/scenario.py
65 66 67 68 69 70 71 72 73 74 75 | |
profiles_of(kind)
¶
Return all profiles of the given kind, in the order they were given.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
kind
|
type[ProfileT]
|
The profile type to select, such as |
required |
Returns:
| Type | Description |
|---|---|
tuple[ProfileT, ...]
|
The profiles that are instances of |
Source code in src/odys/domain/scenario.py
53 54 55 56 57 58 59 60 61 62 63 | |
ScenarioSet
¶
Bases: BaseModel
The scenarios of one optimization problem.
Owns the rules that span scenarios: their probabilities sum to 1 (within floating-point tolerance) and their names are unique.
Source code in src/odys/domain/scenario.py
78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 | |
names
property
¶
Return the scenario names, in order.