Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vehicle_state_ops.move, MoveResult should support optional partition boundaries #28

Open
robfitzgerald opened this issue Jul 7, 2021 · 0 comments
Milestone

Comments

@robfitzgerald
Copy link
Collaborator

robfitzgerald commented Jul 7, 2021

in hive, when a vehicle is updated on move, it runs exactly to the end of the time step. however, in a distributed setting, it may reach the partition boundary before completing the time step. in base hive, this is not an issue.

in order to support both behaviors, the move method could be parameterized by the Optional[GeoId] of the boundary, defaulting to None. if a move reaches this boundary, we need to return the partially-consumed time step in the MoveResult. this includes the current time step, the entity location where we stopped, and the remaining, un-consumed time.

move needs to be refactored to inspect the vehicle state to see if any remaining_time is stored (see below).

modify the chain of methods inside move so that

  1. partially-consumed traversals are properly modeled in the resulting VehicleState (route, remaining_time)
  2. move uses the SimTime duration for execution unless the VehicleState provides remaining_time, which is then used instead

important for hive-dist: after such a move, the vehicle's entity position should be at the origin of the next link as opposed to the destination of the last traversed link: this allows us to discover that the vehicle is out-of-partition in hive-dist.

Q: all of this needs to travel down the pipeline from adding a vehicle and updating it manually in distributed simulation. does that require adding the Seconds remaining to the vehicle state for all move-able states? answering this question may be out-of-scope: since the default case of this is "None" we can take this first step without breaking anything, and save the final step for a separate issue.

a move state may have only partially completed its time step, and if so, the remaining unused time needs to be recorded as state of the vehicle. the only natural place to put this is in the VehicleState. this applies to all move actions.

@robfitzgerald robfitzgerald added this to the nice-to-haves milestone Apr 4, 2023
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

No branches or pull requests

1 participant