Defining the Setup
Model Setup
POMATWO.ModelSetup
— TypeModelSetup{T<:MarketType, PS<:ProsumerSetup, RD<:RedispatchSetup}
A container struct that holds the basic configuration for the market simulation model.
Fields
Scenario::String
: A descriptive name or identifier for the model scenario.TimeHorizon::TimeHorizon
: Time settings for the simulation (see section on 'TimeHorizon').MarketType::T
: Type of market structure to simulate (see section 'MarketType'). Defaults toZonalMarket()
.ProsumerSetup::ProsumerSetup
: Configuration of prosumer behavior in the model (see section 'ProsumerSetup'). Defaults toNoProsumer()
.RedispatchSetup::RedispatchSetup
: Configuration of redispatch modeling in the simulation (see section 'RedispatchSetup'). Defaults toNoRedispatch()
.
This struct supports keyword-based construction using default values where provided.
Example
ModelSetup(;
TimeHorizon = TimeHorizon(; offset = 0, split = 24, stop = 48),
MarketType = NodalMarketh(PhaseAngle),
ProsumerSetup = NoProsumer(),
RedispatchSetup = NoRedispatch(),
)
POMATWO.TimeHorizon
— TypeTimeHorizon(; start=1, stop=8760, split=24, offset=0)
Structure for defining a time horizon used in simulations or data analysis.
Fields
start::Int
: The starting timestep (hour) of the time horizon (default:1
).stop::Int
: The ending timestep (hour) of the time horizon (default:8760
).split::Int
: The length (hours) of each subinterval or chunk (default:24
).offset::Int
: An offset (in timesteps or hours) applied to the time horizon (default:0
). This allows subintervals that start at specific hours of the day.
Example
In this setup a time period of one year is used for market simulation. The optimizeation is cut into 365 subintervals, that start at hour 12 of each day.
setup = ModelSetup(;
TimeHorizon = TimeHorizon(start = 1, stop = 8760, split = 24, offset = 12),
MarketType = ZonalMarket()),
ProsumerSetup = NoProsumer(),
RedispatchSetup = DCLF(PhaseAngle),
)
Model Run
POMATWO.ModelRun
— TypeModelRun{MT<:MarketType, PS<:ProsumerSetup, RD<:RedispatchSetup}(params::Parameters, setup::ModelSetup{MT,PS,DR}, solver;
resultdir="results", scenarioname=randstring(6), overwrite=false)
Encapsulates a single simulation run of a market model, including its setup, solver, and output configuration.
Arguments
params::Parameters
: Input parameters for model creation (see section 'Parameters').setup::ModelSetup{MT,PS,DR}
: Struct containing the scenario description, time horizon, market type, and prosumer setup (see sectionModelSetup
).solver
: Optimization solver used in the simulation.
Keyword Arguments
resultdir::String = "results"
: Base directory where results will be stored.scenarioname::String = randstring(6)
: Unique identifier for the scenario; used to create a subdirectory.overwrite::Bool = false
: Whether to overwrite existing result directories.
Fields
params
: See above.setup
: See above.solver
: See above.resultdir
: Base directory path for storing results.scenarioname
: Name/identifier for this specific scenario run.scen_dir
: Full path to the scenario-specific result directory (joinpath(resultdir, scenarioname)
).overwrite
: Whether existing directories can be overwritten.
Behavior
- Automatically creates a result directory for the run.
- Throws an error if the scenario directory exists and
overwrite=false
.
Calling the optimizer
POMATWO.run
— Methodrun(mr::ModelRun)
Executes the configured POMATWO model simulation for the given ModelRun
object.
Saves input parameters to the results folder and runs the internal optimization routine.
Arguments
mr::ModelRun
: The simulation object containing model configuration and input data.
Side Effects
- Writes
params.jld2
to the scenario output directory. - Stores simulation results in output files.
Optimizer Attributes
Optimizer attributes can be set by using the JuMP.optimizer_with_attributes
function from the JuMP.jl
package. This function is re-exported from JuMP.jl
You can use optimizer_with_attributes
directly after importing this package, as it is re-exported for your convenience.
Additionally MathOptInterface
is imported as MOI