10 namespace traffic_manager {
13 using ActorIdSet = std::unordered_set<ActorId>;
15 using Buffer = std::deque<SimpleWaypointPtr>;
49 const std::vector<SimpleWaypointPtr> waypoints);
std::unordered_map< uint64_t, ActorIdSet > WaypointOverlap
Structure to keep track of overlapping waypoints between vehicles.
cg::Location hero_location
Current hero location.
std::unordered_set< uint64_t > WaypointIdSet
Structure to keep track of waypoints occupied by vehicles;.
void SetHeroLocation(const cg::Location location)
void UpdatePassingVehicle(uint64_t waypoint_id, ActorId actor_id)
Methods to update, remove and retrieve vehicles passing through a waypoint.
void UpdateGridPosition(const ActorId actor_id, const Buffer &buffer)
This file contains definitions of common data structures used in traffic manager. ...
std::unordered_set< ActorId > ActorIdSet
std::deque< std::shared_ptr< SimpleWaypoint > > Buffer
void RemovePassingVehicle(uint64_t waypoint_id, ActorId actor_id)
std::unordered_map< GeoGridId, ActorIdSet > grid_to_actors
Actors currently passing through grids.
void UpdateUnregisteredGridPosition(const ActorId actor_id, const std::vector< SimpleWaypointPtr > waypoints)
WaypointOverlap waypoint_overlap_tracker
ActorIdSet GetOverlappingVehicles(ActorId actor_id) const
void DeleteActor(ActorId actor_id)
Method to delete actor data from tracking.
WaypointOccupancyMap waypoint_occupied
std::shared_ptr< SimpleWaypoint > SimpleWaypointPtr
void AddTakenGrid(const GeoGridId geogrid_id, const ActorId actor_id)
cg::Location GetHeroLocation() const
bool IsGeoGridFree(const GeoGridId geogrid_id) const
ActorIdSet GetPassingVehicles(uint64_t waypoint_id) const
std::unordered_map< ActorId, std::unordered_set< GeoGridId > > actor_to_grids
Geodesic grids occupied by actors's paths.
std::unordered_map< ActorId, WaypointIdSet > WaypointOccupancyMap