Skip to content

Commit

Permalink
Fix bug in in-contract
Browse files Browse the repository at this point in the history
  • Loading branch information
klasbo committed Mar 30, 2022
1 parent 4b5fc21 commit b290854
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
1 change: 0 additions & 1 deletion cost_fns/hall_request_assigner/build.sh

This file was deleted.

5 changes: 4 additions & 1 deletion cost_fns/hall_request_assigner/optimal_hall_requests.d
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,10 @@ in {
bool isInBounds(int f){ return f >= 0 && f < numFloors; }
assert(elevatorStates.values.map!(a => isInBounds(a.floor)).all,
"Some elevator is at an invalid floor");
assert(elevatorStates.values.map!(a => isInBounds(a.floor + a.direction)).all,
assert(elevatorStates.values
.filter!(a => a.behaviour == ElevatorBehaviour.moving)
.map!(a => isInBounds(a.floor + a.direction))
.all,
"Some elevator is moving away from an end floor");
}
do {
Expand Down

0 comments on commit b290854

Please sign in to comment.