-
Notifications
You must be signed in to change notification settings - Fork 77
Expand file tree
/
Copy pathenvironment.py
More file actions
38 lines (27 loc) · 1.01 KB
/
environment.py
File metadata and controls
38 lines (27 loc) · 1.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
'''
file that contains all functions to define destinations in the
environment of the simulated world.
'''
import numpy as np
from hospital import Hospital
from school import School
'''
This class is used to save all environment change operations,
such as adding hospitals, adding residences, etc.
'''
class Environment:
def __init__(self):
self.building = []
#This function could create the building base on the input(building name, *location)
def create_building(self, building_type, xmin, xmax, ymin, ymax):
if building_type == 'hospital':
hospital = Hospital(xmin, xmax, ymin, ymax)
self.building.append(hospital)
elif building_type == 'school':
school = School(xmin, xmax, ymin, ymax)
self.building.append(school)
# Drawing the building here
def building_applied(self, plt, addcross):
if self.building:
for building in self.building:
building.display(plt,addcross)