Scenarios
When running simply as a stand-alone simulation tool the match_market.py script can be used to load, generate and save a scenario and run it for the configured parameters (e.g. the number of simulations steps or Matching Algorithms).
A scenario consists of - market participants (Actors and Market Maker) including individual data on which orders are generated during a simulation - network and grid fee definition regarding the location of Actors
Configuration File
In all cases for using simply, a configuration file (config.cfg) is required to specify the correct parameters of the scenario and simulation. If a parameter is not specified in config.cfg and there is a default option, this will be chosen. The file is split into the sections scenario, market and outputs, and the parameters for each section are outlined as follows:
name |
description |
type |
default |
|---|---|---|---|
load_scenario |
if True, loads existing scenario (path required); if False, a random scenario is generated |
bool |
True |
results_path |
path to where results are saved |
str |
your_project_name/market_results |
scenario_path |
path to where the scenario is stored |
str |
your_project_name/scenario |
data_format |
data format of inputs and results |
str |
csv |
nb_actors |
number of actors in the simulation |
int |
5 |
nb_nodes |
number of nodes in the simulation |
int |
4 |
weight_factor |
network charges to power network weight |
num |
0.1 |
EPS |
tolerance value for assertions, comparisons etc. |
num |
1.00E-06 |
name |
description |
type |
default |
|---|---|---|---|
start |
initial timestep |
int |
0 |
nb_ts |
number of timesteps in simulation |
int |
3 |
step_size |
interval between simulation timesteps |
int |
1 |
market_type |
selects matching strategy: pab (pay-as-bid)| pac (pay-as-clear); fair (custom BEST matching) |
str |
pab |
reset_market |
resets market after each interval (discards unmatched orders) |
bool |
True |
energy_unit |
size of energy units to be traded individually |
num |
0.01 |
default_grid_fee |
default grid fee to be used by the market maker |
num |
0 |
name |
description |
type |
default |
|---|---|---|---|
horizon |
Horizon up to which energy management is considered |
int |
24 |
actor_strategy |
strategy that every actor uses if not specified |
int |
0 |
name |
description |
type |
default |
|---|---|---|---|
show_prints |
print debug info to the console |
bool |
False |
show_plots |
show various plots |
bool |
False |
save_csv |
save orders and matching results to csv files |
bool |
False |
Building your own scenario
A scenario is built using the build_scenario.py script (see Create your own scenario) from a number of required inputs:
data collection (scenario_inputs): load, pricing, generation, load timeseries
information on each actor (actors_config.json)
information on the network connecting the actors (network_config.json)
a configuration file (config.cfg)
The structure to build a scenario can be set up as shown below. Note that the directory containing your data timeseries (scenario_inputs) can be located elsewhere if you specify in the command line (Create your own scenario). However, actors_config, config and network_config must all be stored in your project directory:
|-- projects
|-- your_project_name
|-- scenario_inputs
|-- load
|-- your load timeseries
|-- price
|-- your price timeseries
|-- generation
|-- your generation timeseries
|-- loads_dir.csv
|-- actors_config.json
|-- config.cfg
|-- network_config.json
Scenario inputs
The input timeseries data can be in either csv or json format. Below shows the generic format of the input timeseries. The Time column contains entries for each interval in the format YYYY-MM-DD hh:mm:ss, where the interval time is specified in config.cfg. The number of entries must be greater than the specified number of simulation timesteps nb_ts plus the prediction horizon (also specified in config.cfg). The second column contains the values for each interval for either load, generation or pricing, and col_name will change based on which data is represented.
+---------------------+------------+
| Time | col_name |
+=====================+============+
| 2020-01-01 00:00:00 | 0.02 |
+---------------------+------------+
| 2020-01-01 00:00:15 | 0.05 |
+---------------------+------------+
| ... | ... |
+---------------------+------------+
Note
There are no units set in simply, so all input files must be consistent with their units!
Actors configuration
The actors_config.json file represents a template for setting up a market community consisting of the market maker
(simply.market_maker.MarketMaker) and other market participants.
For each market actor (simply.actor.Actor), the following must be specified, analogous to the example file:
The name of the market actor, e.g. “residential_1”.
The market actor type, i.e. “market_maker”, “residential”, “industrial” or “business”.
The location of the actor in the community network, i.e. the network node at which the prosumer is located.
The information about power consumption and power devices (if any):
The device type, i.e. “load”, “solar” or “battery”.
The device ID: here is the name of a file (.json or .csv), which is to be stored under /sample and contains the load curve for the respective power consumption or the respective power device.
Each actor is represented with the following structure:
{
"comment": "An example of a residential prosumer with load and pv data specified by their 'deviceID'",
"prosumerName": "residential_1",
"prosumerType": "residential",
"gridLocation": "N04",
"devices": [
{
"deviceType": "load",
"deviceID": "CHH10_sample.csv"
},
{
"deviceType": "solar",
"deviceID": "generated_pv.csv"
}
]
}
Network configuration
The file network_config.json represents a template for the construction of a market community network in a common Graph output format with nodes and links.
Under “nodes” the names of the individual nodes are listed (e.g. N01, N02). The Market Maker as a special market participant does not have to be represented in the network.
Under “links” the network charge is defined for each combination of two nodes. Nodes between which there is a network charge of 0 represent a common cluster (see BEST Matching Algorithm). The general structure is shown below:
{
"example_network": {
"directed": false,
"multigraph": false,
"graph": {},
"nodes": [
{
"id": "N01"
},
{
... : ...
}
],
"links": [
{
"weight": 0,
"source": "N01",
"target": "N02"
},
{
... : ...,
... : ...,
... : ...
}
]
}
}