Repository navigation
This release introduces a native simulation backend, structured experiment results, and a rebuilt viewer for simulation studies.
We also simplified the modeling API and now model grid connections explicitly as dispatchable resources.
Native simulation backend
- Vessim now runs simulations directly through a native backend, reducing scheduling overhead for parameter sweeps, optimization, and probabilistic studies.
- Mosaik remains available for connecting external simulators, including models running in other processes or on other computers.
Installvessim[mosaik]and selectbackend="mosaik"when creating the environment. - Trace lookups, dispatch, and recording have been optimized for repeated simulations.
Environment.run()now returns aRunResultwith the final state and execution information.
Recording and metrics
- Added
Recorderfor metrics, optional time series, and experiment metadata.
UseRecorder("results/run")to save a run, orRecorder(timeseries=False)to collect metrics without retaining its trajectory. - Built-in metrics track energy production and consumption, grid imports and exports, and peak grid demand.
- Added
Metric,ElectricityImportCost,ElectricityExportRevenue, andGridImportEmissionsfor custom objectives and price or carbon accounting. - Added
ExperimentResultfor loading, inspecting, and saving recorded runs.
Results include configuration, parameters, metric definitions, and execution status.
Vessim Viewer
- Rebuilt the viewer around simulation studies, with comparisons across configurations and repeated runs.
- Added configurable results tables, scatter plots, distributions, and Pareto-front selection for exploring trade-offs.
- Compare time series across runs and configurations, with shared controls for signals, aggregation, and units.
- The selected study and view are stored in the URL so results can be linked directly.
- Export an interactive report for static hosting with
python -m vessim view results/study --export report. - Published examples are available directly in the documentation viewer.
Modeling API
- Added
ConsumerandProducerfor demand and generation.
Both accept a number or aSignal, whileActorsupports components that can change direction. - Added
GridConnectionas a dispatchable resource with import and export limits, ramp constraints, and disconnection support. - The default dispatch policy allocates power in resource order while respecting operating limits.
Infeasible demand or surplus now raises an error. - Added
Trace.select()to use different columns of a shared input trace. - Controllers and REST clients can replace an actor's signal to change future demand or generation.
Breaking changes
- Recording:
RecorderreplacesMemoryLoggerandCsvLogger.
Saved results now useexperiment.jsonand an optionaltimeseries.csv, replacing the previousmetadata.yamlformat.
The new viewer requires recordings in the new format. - Grid connections: Add
GridConnection()explicitly to a microgrid's dispatchables when it can exchange power with the grid.
DefaultDispatchPolicy(mode=...)was removed.
Custom policies must assign balanced resource setpoints and returnNoneinstead of returning residual grid power. - Actors: The
consumerargument was removed.
ReplaceActor("load", StaticSignal(700), consumer=True)withConsumer("load", signal=700).
Custom actors now implementsample(elapsed)to return power and diagnostic state, replacing the separatepower()andstate()hooks. - Live integrations: The
silextra is nowlive, andSilSignalis nowLiveSignal.
Install live integrations withpip install 'vessim[live]'. - Mosaik coupling: Mosaik is now optional, and individual actors are no longer exposed as simulator entities.
Callenv.prepare()and connect external simulators throughenv.entities[microgrid_name]. - Environment lifecycle: Environments are single-use, and ordinary simulations require a finite duration.
UseEnvironment.live()for indefinite runs. - Signals: The environment now starts and finalizes attached signals, including shared signals.
Live polling starts when the simulation runs, and closed live signals cannot be reused.
Standalone use of Vessim signals as a data-access API is deprecated.
Documentation and examples
- Reworked Getting Started, concept pages, and the API reference around building, running, and inspecting a simulation.
- Added guides for simulation studies, optimization, live modeling, and connecting external simulators.
- Added reproducible examples for infrastructure sizing, Optuna searches, probabilistic dispatch, parallel battery-sizing studies, demand response, and custom metrics.
- Unified example setup and output handling, including seeded inputs and protection against overwriting existing results.
Fixes and compatibility
- Battery state now advances through the full requested duration, including a shortened final interval.
- Fixed minimum-charge handling in
ClcBatteryand strengthened validation of battery parameters and resource setpoints. - Traces now reject invalid timestamps, duplicate entries, nonfinite data, and sampling outside their bounds.
- Improved cleanup after failed or interrupted runs, including live polling, API brokers, external simulators, and recording status.
- Added support for Python 3.14 and 3.15.
Full Changelog: 0.15.1...0.16.0