/TheGreatEscape

An evacuation simulator written in Golang and Python

Primary LanguageGoMIT LicenseMIT

run_left The Great Escape run_left

The Great Escape is a building evacuation simulator developed in Go (back end) and Python 3.x (front end) with support for custom PNG maps (see 2.1).

1. Getting Started

Clone the repository and read section 1 and 2 below.

1.1. Prerequisites

The application is written in Python 3.x and Go:

1.2. Installing

1.2.1. Linux

Instructions for settings up a development/user environment:
$ sudo apt-get update
$ sudo apt-get install python3

Install Tkinter if needed:

$ sudo apt-get install python3-tk

Install pip3 for managing software packages within Python 3.x:

$ sudo apt-get install python3-pip

Then install PyGame:

$ sudo pip3 install pygame

and NumPy:

$ sudo pip3 install numpy

and inflect:

$ sudo pip3 install inflect

and matplotlib:

$ sudo pip3 install matplotlib

and psutil:

$ sudo pip3 install psutil

and colorama:

$ sudo pip3 install colorama

and termcolor:

$ sudo pip3 install termcolor

and SciPy:

$ sudo pip3 install scipy

Install Go

$ sudo apt-get install golang-go

Install testing in go

$ go get github.com/stretchr/testify/assert

1.2.2. Windows and macOS

As long as Python 3.x, Go and pip3 are installed, use the pip3 commands in 1.2.1.

Windows users will need to look at Unofficial Windows Binaries for Python Extension Packages for SciPy and Numpy+MKL.

macOS users will need to install

pip3 install -U --pre -f https://wxpython.org/Phoenix/snapshot-builds/ wxPython_Phoenix

if this is unsuccessful, you are pretty much out of luck for choosing maps through the file dialog.

2. Deployment

2.1 Custom Maps

A few sample maps are included, but it is possible to add custom maps in /gui/maps and load them in the Python program. Maps must be in PNG format and only consist of the following pixels with 100% opacity.

  • #ffffff rgb(255, 255, 255)   - Floor and inner door.
  • #000000 rgb(0, 0, 0)             - Wall.
  • #ff0000 rgb(255, 0, 0)          - Exit door.
  • #7f7f7f rgb(127, 127, 127)   - Out of bounds (outdoors).

Each pixel represents an area of 0.5m × 0.5m. Make sure that every room has an inner door and that there exists a valid path from every room to at least one exit door.

2.2. Run Program

Run the program from /TheGreatEscape with:

$ make run

2.3. Run Tests

Run the backend tests from /TheGreatEscape with:

$ make test

3. Created With

4. Authors

  • Tobias Hiort
  • Jenny Olsson
  • Linn Löfquist
  • Robin Larsson
  • Elsa Slättegård
  • Sinae Lee
  • Axel Hallsenius

6. License

This project is licensed under the MIT License. See the LICENSE.md file for details.

7. Repository Directory Tree

The Great Escape
|   Makefile
│   LICENSE.md
|   README.md
|
└─── gui/
|   |   Makefile
│   │   gui.py
│   │   utils.py
│   │
│   └─── fonts/
│   |   │   ...
│   |
│   └─── gui/
|   |   |   ... 
|   |
|   └─── maps/
|       |   ...
|
└─── src/
    |   Makefile
    |   gameMaster.go 
    |   main.go
    |   map.go
    |   map_test.go
    |   pathfinder.go
    |   pathfinder_test.go
    |   people.go
    |   people_test.go
    |   print.go 
    |   queue.go
    |   queue_test.go
    |   concurrency_test.go