CARLA
TrafficLightStage.h
Go to the documentation of this file.
1 
2 #pragma once
3 
9 
10 namespace carla {
11 namespace traffic_manager {
12 
13 /// This class has functionality for responding to traffic lights
14 /// and managing entry into non-signalized junctions.
16 private:
17  const std::vector<ActorId> &vehicle_id_list;
21  const cc::World &world;
22  /// Map containing the time ticket issued for vehicles.
23  std::unordered_map<ActorId, cc::Timestamp> vehicle_last_ticket;
24  /// Map containing the previous time ticket issued for junctions.
25  std::unordered_map<JunctionID, cc::Timestamp> junction_last_ticket;
26  /// Map containing the previous junction visited by a vehicle.
27  std::unordered_map<ActorId, JunctionID> vehicle_last_junction;
31 
32  bool HandleNonSignalisedJunction(const ActorId ego_actor_id, const JunctionID junction_id,
33  cc::Timestamp timestamp);
34 
35 public:
36  TrafficLightStage(const std::vector<ActorId> &vehicle_id_list,
37  const SimulationState &Simulation_state,
38  const BufferMap &buffer_map,
39  const Parameters &parameters,
40  const cc::World &world,
41  TLFrame &output_array,
42  RandomGeneratorMap &random_devices);
43 
44  void Update(const unsigned long index) override;
45 
46  void RemoveActor(const ActorId actor_id) override;
47 
48  void Reset() override;
49 };
50 
51 } // namespace traffic_manager
52 } // namespace carla
std::vector< bool > TLFrame
This class holds the state of all the vehicles in the simlation.
This file contains definitions of common data structures used in traffic manager. ...
Definition: Carla.cpp:99
std::unordered_map< JunctionID, cc::Timestamp > junction_last_ticket
Map containing the previous time ticket issued for junctions.
std::unordered_map< carla::rpc::ActorId, RandomGenerator > RandomGeneratorMap
TrafficLightStage(const std::vector< ActorId > &vehicle_id_list, const SimulationState &Simulation_state, const BufferMap &buffer_map, const Parameters &parameters, const cc::World &world, TLFrame &output_array, RandomGeneratorMap &random_devices)
void RemoveActor(const ActorId actor_id) override
std::unordered_map< carla::ActorId, Buffer > BufferMap
void Update(const unsigned long index) override
const std::vector< ActorId > & vehicle_id_list
carla::road::JuncId JunctionID
carla::ActorId ActorId
This class has functionality for responding to traffic lights and managing entry into non-signalized ...
Stage type interface.
Definition: Stage.h:12
std::unordered_map< ActorId, cc::Timestamp > vehicle_last_ticket
Map containing the time ticket issued for vehicles.
bool HandleNonSignalisedJunction(const ActorId ego_actor_id, const JunctionID junction_id, cc::Timestamp timestamp)
std::unordered_map< ActorId, JunctionID > vehicle_last_junction
Map containing the previous junction visited by a vehicle.