This POC use Grid2Op platform to perform it simulation.
Grid2Op is a platform, built with modularity in mind, that allows to perform powergrid operation. And that's what it stands for: Grid To Operate. Grid2Op acts as a replacement of pypownet as a library used for the Learning To Run Power Network L2RPN.
This framework allows to perform most kind of powergrid operations, from modifying the setpoint of generators, to load shedding, performing maintenance operations or modifying the topology of a powergrid to solve security issues.
For further explanation on Grid2Op, the official documentation of Grid2Op is available at https://grid2op.readthedocs.io/. And it can also be found here Grid2Op/README.md.
- Python >= 3.6
- Docker and Docker Compose
Follow this section in case you are working on localhost, and without Docker.
cd InteractiveAI/usecases_examples/PowerGrid
pip3 install -U virtualenv
python3 -m virtualenv venv_grid2op
source venv_grid2op/bin/activate
Either use CASE 1 or CASE 2 to install the PowerGrid's simulator of your choice.
- Install dependencies for the console simulator (optional, yet required when working on localhost):
cd InteractiveAI/usecases_examples/PowerGrid
pip install -r requirements-consol.txt
- Launch the InteractiveAI event listener server, compatible with the console simulator.
docker-compose up -d --build api
The launched API might be accessible at this address: http://SERVER_ADDRESS:5100
The SERVER_ADDRESS will be the one of the computer used to launch the Docker command.
- Install dependencies for the console simulator (optional, yet required when working on localhost):
cd InteractiveAI/usecases_examples/PowerGrid
pip install -r requirements-app.txt
2. Launch the whole all in one web app simulator through docker on a computer (BEST APPROACH):
docker-compose up -d --build app
The launched app might be accessible at this address: http://SERVER_ADDRESS:5100/
The SERVER_ADDRESS will be the one of the computer used to launch the Docker command.
- Define your simulation configuration in the file:
/InteractiveAI/usecases_examples/PowerGrid/config/CONFIG.toml
- Define InteractiveAI connection settings in the file:
/InteractiveAI/usecases_examples/PowerGrid/config/API_POWERGRID_CAB.toml
cd InteractiveAI/usecases_examples/PowerGrid
python PowerGrid_poc_simulator_consol.py
Open a web browser and navigate to the URL returned by Docker after running the containers.
This URL will typically be http://localhost:5100/
unless you've configured a different port.
Note: If you're running Docker on a remote machine or using Docker Toolbox on Windows, you may need to replace 'localhost' with the appropriate IP address. For example : http://SERVER_ADDRESS:5100/ with SERVER_ADDRESS the one of your remote machine.
cd InteractiveAI/usecases_examples/PowerGrid
python PowerGrid_poc_simulator_app.py
To run the simulation, you will need the following credentials:
InteractiveAI credentials:
- Username:
publisher_test
- Password:
test
These credentials are created by the InteractiveAI platform. The PowerGrid's simulator only requests access to the InteractiveAI platform server using these credentials.
/Resources
: Contains resources needed for the simulator./app
: Contains the web application code for the simulator./config
: Contains configuration files for the simulator.
PowerGrid_poc_simulator_consol.py
: Main script to run the simulator in console mode.PowerGrid_poc_simulator_app.py
: Main script to run the simulator in web application mode.requirements-consol.txt
: List of dependencies for the console mode simulator.requirements-app.txt
: List of dependencies for the web application mode simulator.docker-compose.yml
: Configuration for the Docker environment.Dockerfile.app
andDockerfile.api
: Dockerfile files to build Docker images.