Skip to content

Integration#23

Merged
bensimner merged 80 commits intomasterfrom
integration
Jun 8, 2018
Merged

Integration#23
bensimner merged 80 commits intomasterfrom
integration

Conversation

@bensimner
Copy link
Contributor

Integrate with master/

bensimner and others added 30 commits May 30, 2018 10:52
@HarveyHunt
Copy link
Contributor

I've noticed that when lots get full and there is nowhere to park, the simulation raises an exception:

Traceback (most recent call last):
  File "/home/hunt/code/parking/simulation/simulation.py", line 784, in attempt_routine
    await car.retry(now, plot)
  File "/home/hunt/code/parking/simulation/simulation.py", line 485, in retry
    self.waypoints += get_route(rp, bestLot.lot.location, self.waypoints[-1].time, self.speed)
AttributeError: 'NoneType' object has no attribute 'lot'

This is due to bestLot being set to None and not being updated:

https://github.com/educationallylimited/parking/pull/23/files#diff-81dcd941ac2ae10867d3df2e0c956d99R387

The car should probably just remain where it is if it can't find a valid lot to park in.

I imagine you can reproduce this with any args that mean you have many cars and only a few lots. Here's the command line I used:

python -m simulation --num-spaces 10 --num-cars 100 --car-seed 1528299115 --parking-seed 1528299115

@bensimner bensimner merged commit e072c59 into master Jun 8, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants