econnerty / ICS_Docker

Docker recipe for ICS

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ICS_Docker

This repository contains the docker recipe to run the ICS project in a virtual environment.

Steps to create and run the docker image

  1. Download and install Docker Engine.
  2. Clone the repository.
  3. Build the docker image using the following command:
    docker build -t ics_docker:latest .
    • Note: This will take some time to build the image. The image size is around 2.9 GB.
    • Note: The image name (ics_docker) and tag (latest) can be changed as per your preference.
  4. Run the docker image using the following command:
    docker run -p 5901:80 -v <path_to_repository\data>:/home/data ics_docker:latest
    • Note: Replace <path_to_repository\data> with the absolute path to the data folder in the repository.
    • Note: The port number 5901 can be changed as per your preference.
  5. Open a browser and navigate to http://localhost:5901 to access and interact with the virtual environment. This should provide a LXDE Ubuntu desktop environment.
  6. Now in this environment we need to run the scripts to generate the input files and run the simulation.
    • Open the terminal: Menu (bottom left corner) -> System Tools -> LXTerminal
    • Run the following commands in the terminal to navigate to the home directory and run the ICS project:
      cd /home
      bash run_full_model.sh
      • This should generate the input files from agent factory and launch the netlogo 6.3.0 software. The input files will be generated in the data/input folder. The output files of the simulation will be generated in the data/output folder.
      • Note: run_full_model.sh script will run both the agent factory and netlogo modules. However, if you want to run the agent factory or netlogo modules individually, you can use the run_agent_factory.sh and run_netlogo.sh scripts respectively. This way the netlogo software can be launched separately and the simulation can be run multiple times without having to generate the input files again.

Folder Structure & Contents

Source Files

  • Agent Factory : src/Agent-Factory
    • Contains the python script files required to generate the input files for the simulation.
  • Netlogo Model : src/Netlogo-Model
    • Contains the netlogo model files required to run the simulation.

Data Files

  • Input Files : data/input
    • Contains the input files for the simulation generated from the agent factory.
    • Please add any additional inputs in this folder (ex: IP files).
  • Output Files : data/output
    • Contains the output files from the netlogo simulation.
  • Simulation State: data/state
    • Contains the state of the simulation. This file can be used to resume the simulation from a previous state. These state files are generated by the export world button in the netlogo interface.

Supporting Files for Docker

  • Dockerfile : Dockerfile
    • Contains the recipe to build the docker image.
    • Provides a VNC based virtual environment to interact and simulate the ICS project.
  • run_agent_factory.sh : for generating input files
    • Contains the script to run the agent factory script inside the docker environment.
  • run_netlogo.sh : for launching netlogo simulation
    • Contains the script to run the netlogo model inside the docker environment.
  • run_full_model.sh : for running the full model
    • Contains the script to run the full model (Agent Factory + Netlogo) inside the docker environment.

About

Docker recipe for ICS

License:MIT License


Languages

Language:NetLogo 76.3%Language:Python 20.8%Language:Dockerfile 1.9%Language:Shell 1.0%