Skip to content

Commit

Permalink
small bugfix in office selection.
Browse files Browse the repository at this point in the history
  • Loading branch information
djgroen committed Apr 8, 2022
1 parent 8d26c5e commit 255f0a1
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions facs/base/facs.py
Expand Up @@ -469,15 +469,14 @@ def find_nearest_locations(self, e):
n = []
ni = []
for l in lnames:
if location_type == "office": # offices are picked randomly, not based on proximity.
if "office" not in e.locations.keys():
n.append(None)
print("WARNING: location type missing")
nearest_loc_index = get_rndint(len(e.locations[l]))

elif l not in e.locations.keys():
if l not in e.locations.keys():
n.append(None)
print("WARNING: location type missing")
elif l == "office": # offices are picked randomly, not based on proximity.
nearest_loc_index = get_rndint(len(e.locations[l]))

n.append(e.locations[l][nearest_loc_index])
ni.append(nearest_loc_index)
else:
min_score = 99999.0
nearest_loc_index = 0
Expand All @@ -495,6 +494,7 @@ def find_nearest_locations(self, e):
print("To detect these, you can use the following command:")
print("cat <buildings file name>.csv | grep -v house | grep \",0$\"")
sys.exit()

n.append(e.locations[l][nearest_loc_index])
ni.append(nearest_loc_index)

Expand Down

0 comments on commit 255f0a1

Please sign in to comment.