Skip to content

Sequence diagrams

How the layers of the data model interact at run time.

Pipeline

EnergySystem.optimize() is three calls: build the problem, build and solve the model, wrap the outcome.

Participants: EnergySystem, OptimizationProblem, build_model, solve, OptimalDispatchResults.

sequenceDiagram
    actor User
    participant ES as EnergySystem
    participant OP as OptimizationProblem
    participant MB as build_model
    participant S as solve
    participant R as OptimalDispatchResults
    User->>ES: optimize(solver_config)
    ES->>OP: assemble(entities, horizon, scenario_set, condition_set, objective)
    OP-->>ES: problem (context, formulations, objective terms)
    ES->>MB: build_model(problem)
    MB-->>ES: linopy.Model
    ES->>S: solve(model, solver_config)
    S-->>ES: SolveOutcome
    ES->>R: OptimalDispatchResults(outcome, problem.dispatches)
    R->>OP: dispatches(solution), only when outcome.has_solution
    OP-->>R: one Dispatch per formulation
    R-->>User: results