A PySimpleGUI-based graphical grid that allows users to annotate locations for various kinds of terrains/members:
- N (normal/none)
- F (fire/danger)
- B (bottleneck--e.g., exit)
- W (wall)
- S (safe)
- P (people)
A square in the grid may be 0 or 1 of {N, F} AND 0 or 1 of {W, B} If nothing, a square must have at least the 'N' attribute
The program outputs a graph as a pickled dictionary:
graph = {
(i,j): {'W': 0 or 1, 'N': 0 or 1, 'F': 0 or 1, 'B': 0 or 1, 'S': 0 or 1,
'distF': ..., 'distS': ...,
'nbrs': set},
.
.
.
}
./floorplan.py [-h] [-o OUTPUT] R C
design a floor plan for egress simulation programs
positional arguments:
R number of rows in the grid. max: 20
C number of cols in the grid. max: 20
optional arguments:
-h, --help show this help message and exit
-o OUTPUT, --output OUTPUT
name of file to output plan to (default: floor.txt)
-
Annotate To annotate a square, click on a square in the grid. Click again to undo.
-
Select mode To choose the attribute you wish to annotate with using Options > Editing mode.
-
Save to file Choose File > Save in order to save the layout to pickle (default: floor.txt.pkl)
-
Load and edit existing file Click on Menu > Open (from floor.txt.pkl)
Here's a sample 10x10 grid.
Below is the output created from this grid.
S; S; S; S; S; S; S; S; S; S
S; N; W,N; W,N; W,N; W,N; N,B; W,N; N; S
S; W,N; W,N; N; N; N; N; W,N; N; S
S; W,N; N; N; N; N; N; W,N; N; S
S; W,N; N; N; F; F; N; W,N; N; S
S; N,B; N; N; F; F; N; W,N; N; S
S; W,N; N; N; N; N; N; W,N; N; S
S; W,N; W,N; N; N; N; W,N; W,N; N; S
S; N; W,N; W,N; W,N; W,N; W,N; N; N; S
S; S; S; S; S; S; S; S; S; S
This program is Free Software (C) 2019