diff --git a/config/business.csv b/config/business.csv index e13cfe3..129907a 100644 --- a/config/business.csv +++ b/config/business.csv @@ -1,5 +1,5 @@ building_type,min_workhour,max_workhour,min_start_hour,max_start_hour,day,min_activity_per_week,max_activity_per_week,open_24_hours_chance restaurant,10,12,10,11,everyday,5,7,0.1 -barbershop,8,12,9,11,everyday,5,7,0 +hairdresser,8,12,9,11,everyday,5,7,0 retail,10,12,8,10,everyday,6,7,0.1 hospital,24,24,0,0,everyday,7,7,1 diff --git a/config/jobs.csv b/config/jobs.csv index 79fee67..ae4705a 100644 --- a/config/jobs.csv +++ b/config/jobs.csv @@ -7,6 +7,6 @@ university_professor ,5,9,university,28,70,200,8,9,weekday,3,5,no salaryman_outside_city,9,9,train_station,19,70,800,8,9,weekday,5,5,yes retailer,8,8,retail,19,70,450,0,23,everyday,3,5,no salaryman,4,5,office,19,70,1000,8,10,weekday,5,5,no -barber,7,8,barbershop,20,70,10,8,12,everyday,5,6,no +barber,7,8,hairdresser,20,70,10,8,12,everyday,5,6,no restaurant_worker,8,10,restaurant,16,70,140,0,18,everyday,5,7,no -scientist,5,9,laboratory,21,70,150,8,9,weekday,3,5,no +scientist,5,9,research_institute,21,70,150,8,9,weekday,3,5,no diff --git a/config/tsukuba-tu-building-data.csv b/config/tsukuba-tu-building-data.csv index caf0dec..2aecb27 100644 --- a/config/tsukuba-tu-building-data.csv +++ b/config/tsukuba-tu-building-data.csv @@ -1,15 +1,15 @@ y,y1,x,number,type -9,0,0,All,laboratory +9,0,0,All,research_institute 9,0,1,All,residential -9,0,2,1,barbershop +9,0,2,1,hairdresser 9,0,2,1,retail 9,0,2,All,residential 8,1,0,5,office 8,1,0,All,residential -8,1,1,2,laboratory -8,1,1,All,laboratory +8,1,1,2,research_institute +8,1,1,All,research_institute 8,1,2,All,residential -8,1,3,All,laboratory +8,1,3,All,research_institute 8,1,4,All,university 8,1,7,3,retail 8,1,7,All,office @@ -17,12 +17,12 @@ y,y1,x,number,type 8,1,8,1,residential 8,1,8,1,skill school 8,1,8,All,retail -7,2,1,All,laboratory +7,2,1,All,research_institute 7,2,2,All,university 7,2,3,1,retail 6,3,3,3,residential 7,2,3,All,university -7,2,4,All,laboratory +7,2,4,All,research_institute 7,2,5,4,house 7,2,5,4,residential 7,2,5,4,residential @@ -44,9 +44,9 @@ y,y1,x,number,type 6,3,0,All,house 6,3,1,1,pachinko 6,3,1,All,house -6,3,2,13,laboratory -6,3,3,1,barbershop -6,3,3,All,University +6,3,2,13,research_institute +6,3,3,1,hairdresser +6,3,3,All,university 6,3,4,1,church 6,3,4,1,office 6,3,4,1,residential @@ -60,7 +60,7 @@ y,y1,x,number,type 6,3,6,All,apartments 6,3,7,1,clinic 6,3,7,1,office -6,3,7,3,barbershop +6,3,7,3,hairdresser 6,3,7,4,retail 6,3,7,All,apartments 6,3,8,2,residential @@ -68,7 +68,7 @@ y,y1,x,number,type 5,4,0,1,house 5,4,0,All,apartments 5,4,1,All,house -5,4,2,2,barbershop +5,4,2,2,hairdresser 5,4,2,4,house 5,4,2,4,residential 5,4,2,All,apartments @@ -88,7 +88,7 @@ y,y1,x,number,type 4,5,1,2,residential 4,5,1,2,retail 4,5,1,All,apartments -4,5,2,1,barbershop +4,5,2,1,hairdresser 4,5,2,1,university 4,5,2,2,retail 4,5,2,3,restaurant @@ -109,17 +109,17 @@ y,y1,x,number,type 3,6,0,1,office 3,6,0,2,apartments 3,6,0,All,house -3,6,1,1,laboratory +3,6,1,1,research_institute 3,6,1,1,restaurant 3,6,1,All,house -3,6,2,3,laboratory +3,6,2,3,research_institute 3,6,2,All,apartments 3,6,3,1,hospital -3,6,3,All,laboratory +3,6,3,All,research_institute 3,6,4,1,hospital -3,6,4,2,laboratory +3,6,4,2,research_institute 3,6,4,All,residential -3,6,5,1,barbershop +3,6,5,1,hairdresser 3,6,5,1,school 3,6,5,4,retail 3,6,5,6,restaurant @@ -129,7 +129,7 @@ y,y1,x,number,type 3,6,6,All,apartments 3,6,7,All,apartments 2,7,1,All,apartments -2,7,2,1,laboratory +2,7,2,1,research_institute 2,7,2,2,restaurant 2,7,2,2,retail 2,7,2,All,apartments @@ -140,7 +140,7 @@ y,y1,x,number,type 2,7,4,All,apartments 2,7,5,2,hall 2,7,5,3,university -2,7,5,All,laboratory +2,7,5,All,research_institute 2,7,6,1,restaurant 2,7,6,1,retail 2,7,6,All,apartments @@ -149,7 +149,7 @@ y,y1,x,number,type 2,7,7,3,restaurant 2,7,7,3,retail 2,7,7,All,apartments -2,7,8,1,laboratory +2,7,8,1,research_institute 2,7,8,1,skill school 2,7,8,All,apartments 1,8,0,3,retail @@ -168,7 +168,7 @@ y,y1,x,number,type 1,8,3,1,restaurant 1,8,3,1,retail 1,8,3,1,skill school -1,8,3,2,barbershop +1,8,3,2,hairdresser 1,8,3,All,apartments 1,8,4,1,restaurant 1,8,4,All,office diff --git a/lib/Map/Building.py b/lib/Map/Building.py index 6d5d410..402a283 100644 --- a/lib/Map/Building.py +++ b/lib/Map/Building.py @@ -32,7 +32,11 @@ def __init__(self, way): self.entryPointNode = None self.tags = way.tags self.setType(self.tags.get("building")) - if self.type == "yes" and "amenity" in self.tags.keys(): + if 'amenity' in self.tags.keys() and self.tags.get('amenity') == 'research_institute': + self.setType('research_institute') + elif 'shop' in self.tags.keys() and self.tags.get('shop') == 'hairdresser': + self.setType('hairdresser') + elif self.type == "yes" and "amenity" in self.tags.keys(): self.setType(self.tags.get("amenity")) self.node = None self.content = {} diff --git a/lib/Simulation/Agent.py b/lib/Simulation/Agent.py index 86ab525..78ec21a 100644 --- a/lib/Simulation/Agent.py +++ b/lib/Simulation/Agent.py @@ -45,7 +45,7 @@ def __init__(self,agentId, osmMap,age,job, businessesDict,rng, gender = None): self.idle = 0 self.energy = 100.0 self.faveRetailer = rng.choice(businessesDict["retail"]) - self.faveBarber = rng.choice(businessesDict["barbershop"]) + self.faveBarber = rng.choice(businessesDict["hairdresser"]) self.risk = rng.integers(1,3) self.status = "Normal" self.activities = "idle" diff --git a/lib/Simulation/Simulator.py b/lib/Simulation/Simulator.py index 4048e60..f0e85e1 100644 --- a/lib/Simulation/Simulator.py +++ b/lib/Simulation/Simulator.py @@ -143,7 +143,10 @@ def __init__(self, for jobClass in jobClassData: temp = JobClass(jobClass) temp.buildings = osmMap.buildingsDict.get(temp.place) - self.jobClasses.append(temp) + if not temp.buildings: + print(f"JobClass {temp.name} has no buildings associated.") + else: + self.jobClasses.append(temp) self.agents = [] self.unshuffledAgents = [] self.timeStamp = TimeStamp()