19 #include <boost/geometry.hpp>
20 #include <boost/geometry/geometries/point.hpp>
21 #include <boost/geometry/geometries/box.hpp>
22 #include <boost/geometry/index/rtree.hpp>
23 #include <unordered_map>
38 typedef boost::geometry::model::box<env::BorderBased::Coordinate::boost_point>
boost_box;
40 template<
typename T1,
typename T2>
50 template<
typename value_type,
typename Tfirst>
56 return boost::geometry::equals<Tfirst,Tfirst>(v1.first, v2.first) && v1.second == v2.second;
64 boost::geometry::index::quadratic<16>,
65 boost::geometry::index::indexable<idxCoordinate2tcdID>,
69 typedef std::pair<std::unordered_map<int, env::TrafficControlDevice*>::iterator,std::unordered_map<int, env::TrafficControlDevice*>::iterator>
TCDIteratorPair;
77 std::unordered_map<int, env::TrafficControlDevice*>
m_id2TCD;
130 bool returnValue =
true;
190 for(
auto it = iterators.first; it != iterators.second; it++)
242 std::vector<int> tcdsToRemove;
248 for(
auto it = tcdsToRemove.begin(); it!=tcdsToRemove.end();it++)
270 std::cout <<
"TCDSet::getTCD(int tcdID): TrafficControlDevice with ID " << tcdID <<
" does not exist." << std::endl;
279 std::cout <<
"TCDSet::getTCD(int tcdID): TrafficControlDevice with ID " << tcdID <<
" does not exist." << std::endl;
double m_guard
Definition: tcdset.h:81
bool m_isOwner
Definition: tcdset.h:83
bool insertTCD(env::TrafficControlDevice *tcd)
Definition: tcdset.h:128
void setMovementId(int tcdId, int movementId)
Definition: tcdset.h:149
virtual ~TCDSet()
Definition: tcdset.h:99
std::pair< std::unordered_map< int, env::TrafficControlDevice * >::iterator, std::unordered_map< int, env::TrafficControlDevice * >::iterator > TCDIteratorPair
Definition: tcdset.h:69
Coordinate2tcdIDs_RT m_coordinate2tcdIDs
Definition: tcdset.h:74
bool getIsOwner()
Definition: tcdset.h:118
void clear()
Definition: tcdset.h:185
bool eraseTCD(int tcdID)
Definition: tcdset.h:165
bool hasTCD(int tcdID)
Definition: tcdset.h:259
void setJunctionId(int movementId, int junctionId)
Definition: tcdset.h:154
std::pair< env::BorderBased::Coordinate::boost_point, int > idxCoordinate2tcdID
Definition: tcdset.h:61
void removeTCDsOutsideRegion(double x0, double x1, double y0, double y1)
Definition: tcdset.h:240
boost::geometry::index::rtree< idxCoordinate2tcdID, boost::geometry::index::quadratic< 16 >, boost::geometry::index::indexable< idxCoordinate2tcdID >, my_equal< idxCoordinate2tcdID, env::BorderBased::Coordinate::boost_point > > Coordinate2tcdIDs_RT
Definition: tcdset.h:67
adore::env::TCDTrafficLightSet m_tcdTlSet
Definition: tcdset.h:78
ItCoordinate2tcdID getTCDsInRegion(double x0, double x1, double y0, double y1)
Definition: tcdset.h:214
TCDSet()
Definition: tcdset.h:89
itpair< Coordinate2tcdIDs_RT::const_query_iterator, Coordinate2tcdIDs_RT::const_query_iterator > ItCoordinate2tcdID
Definition: tcdset.h:70
env::TrafficControlDevice * getTCD(int tcdID)
Definition: tcdset.h:264
TCDIteratorPair getAllTCDs()
Definition: tcdset.h:205
std::unordered_map< int, env::TrafficControlDevice * > m_id2TCD
Definition: tcdset.h:77
boost::geometry::model::box< env::BorderBased::Coordinate::boost_point > boost_box
Definition: tcdset.h:38
void setIsOwner(bool b)
Definition: tcdset.h:108
env::TTCDTrafficLightTuple getTCDTrafficLight(int tcdID)
Definition: tcdset.h:273
ItCoordinate2tcdID getTCDsOutsideRegion(double x0, double x1, double y0, double y1)
Definition: tcdset.h:228
Definition: tcdtrafficlightset.h:31
void setJunctionId(int movementId, int junctionId)
Definition: tcdtrafficlightset.h:60
void setMovementId(int tcdId, int movementId)
Definition: tcdtrafficlightset.h:52
void addTcd(TrafficControlDevice *tcd)
Definition: tcdtrafficlightset.h:47
Definition: trafficcontroldevice.h:24
BorderBased::Coordinate getCoordinate() const
Definition: trafficcontroldevice.h:175
int getID() const
Definition: trafficcontroldevice.h:146
TCDType getType() const
Definition: trafficcontroldevice.h:155
@ TRAFFIC_LIGHT
Definition: trafficcontroldevice.h:29
std::tuple< TrafficControlDevice *, int, int > TTCDTrafficLightTuple
Definition: tcdtrafficlightset.h:25
x0
Definition: adore_set_goal.py:25
y0
Definition: adore_set_goal.py:26
y1
Definition: adore_set_pose.py:29
x1
Definition: adore_set_pose.py:28
Definition: areaofeffectconverter.h:20
boost::geometry::model::point< double, 3, boost::geometry::cs::cartesian > boost_point
Definition: coordinate.h:36
boost_point getBoostPoint()
Get a boost_point that has the same coordinates as the Coordinate object.
Definition: coordinate.h:202
T1 first
Definition: tcdset.h:43
T2 second
Definition: tcdset.h:44
T1 & current()
Definition: tcdset.h:46
itpair(T1 first, T2 second)
Definition: tcdset.h:45
T2 & end()
Definition: tcdset.h:47
bool result_type
Definition: tcdset.h:53
result_type operator()(value_type const &v1, value_type const &v2) const
Definition: tcdset.h:54