Skip to main content

Hydrogen Plant Simulation

This repository provides a simulation of a hydrogen plant with multiple simulation modes. You can run the simulation in different modes:

  • Legacy Simulation Only (-legacy)
  • Lair Simulation Only (-lair)
  • Both Simulations (default or using -both)

Below you will find instructions for running the simulation via the terminal as well as using the Visual Studio Code debugger.


Prerequisites

  • Python 3.8+: Make sure you have an appropriate version of Python installed.
  • Dependencies: Install the required Python packages. If a requirements.txt file is provided, run:
    pip install -r requirements.txt
  • Configuration File: Ensure you have the dev-parameters.json file (or your custom configuration file) in the workspace.

Running via Terminal

Open your terminal in the project directory and use one of the following command snippets:

  • Run Both Simulations (default):
    python main.py dev-parameters.json -both
  • Run Legacy Simulation Only:
    python main.py dev-parameters.json -legacy
  • Run Lair Simulation Only:
    python main.py dev-parameters.json -lair

Simply copy and paste the command that corresponds to your desired simulation mode into your terminal.


Running in Debug Mode with Visual Studio Code

Visual Studio Code comes with pre-configured debug configurations defined in the .vscode/launch.json file.

Steps to Debug:

  1. Open the Project: Launch Visual Studio Code and open the project folder.
  2. Access Debug Panel: Click on the Debug icon in the Activity Bar on the side of VSCode or press Ctrl+Shift+D (Windows/Linux) or Cmd+Shift+D (macOS).
  3. Select Configuration: Choose one of the available configurations:
    • Main Both
    • Main Legacy
    • Main Lair
    • RTHM
    • Python Debugger: Urvish epxlo
  4. Start Debugging: Press F5 or click the green "Start Debugging" button.

Quick Debug Command Snippets in VSCode Terminal:

If you prefer running commands directly in the integrated terminal in VSCode, you can use the same commands as for the normal terminal:

  • Both Simulations:
    python main.py dev-parameters.json -both
  • Legacy Simulation:
    python main.py dev-parameters.json -legacy
  • Lair Simulation:
    python main.py dev-parameters.json -lair

Additional Notes

  • Simulation Output: The simulation generates output files (e.g., simulation_output.json and simulation_raw_data.csv). Note that asset creation and data uploading are controlled by the UPLOAD flag in the script.
  • Configuration Adjustments: You may need to adjust parameters in dev-parameters.json or directly within the code to fit your simulation needs.

Enjoy running your hydrogen plant simulation!