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

Improve data structure of agent routing #99

Open
leo-desbureaux-tellae opened this issue Nov 26, 2024 · 0 comments
Open

Improve data structure of agent routing #99

leo-desbureaux-tellae opened this issue Nov 26, 2024 · 0 comments

Comments

@leo-desbureaux-tellae
Copy link
Contributor

leo-desbureaux-tellae commented Nov 26, 2024

Agent routing is quite complicated right now.

When agents ask for a route between two positions, it triggers a shortest path evaluation, and then a route_data evaluation using the shortest path.

The route data contains the intermediate points of the path, with the timestamp of each point.

When processing the route_data for generating the trace, we concatenate the path elements, while converting them to GPS localisation. We also add position from other events like InputEvent or PositionEvent.

All of this makes the Topology classes and their path methods hard to use outside of the simulation, and even inside, the route_data structure is not clearly defined.

Idea

We could implement a TopologyRoute class that represents a route in a given topology. When asked for a path, topologies would return an instance of TopologyRoute.

This class would store all of the route properties:

  • detailed path (list of nodes)
  • total length
  • total duration
  • timestamp and/or travel_time at each node
  • weight of the path using the Topology's NetworkWeight

It would also have methods like:

  • iteration : to iterate over the path nodes and the travel time between them, for agents to use
  • concatenation: concatenate TopologyRoute instances
  • append/prepend: add nodes at the start/end of the path
  • convert to GeojsonTrace feature (LineString with "timestamps" property)

This class should be able to work on its own with a Topology instance. This would make external use and testing easier.

Replaced methods

The following methods of Topology would be replaced/moved/deleted:

  • shortest_path_length
  • compute_dijkstra_path
  • evaluate_path_duration_and_length
  • evaluate_path_lengths
  • evaluate_path_durations
  • evaluate_path_durations_with_uniform_speed
  • evaluate_on_path
  • evaluate_route_data
  • route_event_trace

Questions

  • We compute and manage many routes in a simulation. Would this implementation make the simulation slower ? How much slower ?
  • How do we concatenate paths on different topologies ?
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