 |
Eclipse SUMO - Simulation of Urban MObility
|
Go to the documentation of this file.
71 myDetectorBuilder(db),
74 myNetIsLoaded(false) {
88 const std::string& key,
92 const std::vector<MSLane*>& incomingLanes,
93 const std::vector<MSLane*>& internalLanes) {
108 throw ProcessError(
"Information about the number of nodes was missing.");
145 if (junction !=
nullptr) {
218 MSSimpleTrafficLightLogic::Phases::const_iterator i =
myActivePhases.begin();
222 if (existing ==
nullptr) {
239 while (offset >= (*i)->duration) {
241 offset -= (*i)->duration;
245 if (existing !=
nullptr) {
317 if (tlLogic !=
nullptr) {
347 const std::string& response,
348 const std::string& foes,
377 myActiveLogic.push_back(std::bitset<SUMO_MAX_CONNECTIONS>(response));
379 myActiveFoes.push_back(std::bitset<SUMO_MAX_CONNECTIONS>(foes));
404 myActivePhases.push_back(
new MSPhaseDefinition(duration, state, minDuration, maxDuration, nextPhases, name, transient_notdecisional, commit, targetLanes));
448 throw ProcessError(
"Traffic lights could not be built.");
458 const std::string& value) {
virtual ~NLJunctionControlBuilder()
Destructor.
void initTrafficLightLogic(const std::string &id, const std::string &programID, TrafficLightType type, SUMOTime offset)
Begins the reading of a traffic lights logic.
NLDetectorBuilder & myDetectorBuilder
The detector builder to use.
@ NODETYPE_TRAFFIC_LIGHT_RIGHT_ON_RED
virtual const Phases & getPhases() const =0
Returns the phases of this tls program.
std::bitset< SUMO_MAX_CONNECTIONS > myActiveConts
The description about which lanes have an internal follower.
void postLoadInitialization()
initialize junctions after all connections have been loaded
@ NODETYPE_DEAD_END_DEPRECATED
Class for low-level marching policy.
The base class for an intersection.
LaneVector myActiveInternalLanes
The list of the internal lanes of the currently chosen junction.
MSBitsetLogic::Logic myActiveLogic
The right-of-way-logic of the currently chosen bitset-logic.
std::string myActiveKey
The key of the currently chosen junction.
The simulated network and simulation perfomer.
std::string myActiveProgram
void closeJunctionLogic()
Ends the building of a junction logic (row-logic)
static const int NO_REQUEST_SIZE
virtual MSJunction * buildInternalJunction()
Builds an internal junction.
std::vector< std::bitset< N > > Foes
Container holding the information which internal lanes prohibt which links Build the same way as Logi...
SUMOTime myAbsDuration
The absolute duration of a tls-control loop.
MSNet & myNet
The net to use.
std::vector< std::string > LaneIdVector
const std::string & getActiveSubKey() const
Returns the active sub key.
PositionVector myShape
The shape of the current junction.
void closeJunction(const std::string &basePath)
Closes (ends) the processing of the current junction.
A self-organizing traffic light logic based on a particular policy.
Position myPosition
The position of the junction.
SUMOTime myOffset
The switch offset within the tls.
Container for junctions; performs operations on all stored junctions.
MSTLLogicControl::TLSLogicVariants & getTLLogic(const std::string &id) const
Returns a previously build tls logic.
virtual void changeStepAndDuration(MSTLLogicControl &tlcontrol, SUMOTime simStep, int step, SUMOTime stepDuration)=0
Changes the current phase and her duration.
void updateParameters(const std::map< std::string, std::string > &mapArg)
Adds or updates all given parameters from the map.
TLSLogicVariants & get(const std::string &id) const
Returns the variants of a named tls.
MSJunctionControl * myJunctions
The junctions controls.
std::string myActiveID
The id of the currently chosen junction.
@ NODETYPE_TRAFFIC_LIGHT_NOJUNCTION
MSSimpleTrafficLightLogic::Phases myActivePhases
The current phase definitions for a simple traffic light.
std::vector< std::bitset< N > > Logic
Container that holds the right of way bitsets. Each link has it's own bitset. The bits in the bitsets...
virtual MSJunction * buildLogicJunction()
Builds a junction with a logic.
TrafficLightType myLogicType
The current logic type.
virtual void closeTrafficLightLogic(const std::string &basePath)
Ends the building of a traffic lights logic.
SumoXMLNodeType
Numbers representing special SUMO-XML-attribute values for representing node- (junction-) types used ...
void set(double x, double y)
set positions x and y
SUMOTime getCurrentTimeStep() const
Returns the current simulation step.
void openJunction(const std::string &id, const std::string &key, const SumoXMLNodeType type, const Position pos, const PositionVector &shape, const std::vector< MSLane * > &incomingLanes, const std::vector< MSLane * > &internalLanes)
Begins the processing of the named junction.
SUMOTime getDefaultCycleTime() const
Returns the cycle time (in ms)
std::map< std::string, MSJunctionLogic * > myLogics
Map of loaded junction logics.
A traffic lights logic which represents a tls in an off-mode.
A point in 2D or 3D with translation and scaling methods.
A fixed traffic light logic.
int myRequestSize
The size of the request.
MSJunction * retrieve(const std::string id)
try to retrieve junction by id
bool myNetIsLoaded
whether the network has been loaded
An actuated (adaptive) traffic light logic.
void addParam(const std::string &key, const std::string &value)
Adds a parameter.
The parent class for traffic light logics.
int myRequestItemNumber
Counter for the inserted items.
Class for low-level request policy.
@ NODETYPE_RIGHT_BEFORE_LEFT
A junction with right-of-way - rules.
NLJunctionControlBuilder(MSNet &net, NLDetectorBuilder &db)
Constructor.
MSTLLogicControl & getTLLogicControlToUse() const
Returns the used tls control.
bool myCurrentHasError
Information whether the current logic had an error.
MSBitsetLogic::Foes myActiveFoes
The description about which lanes disallow other passing the junction simultaneously.
static bool gUsingInternalLanes
Information whether the simulation regards internal lanes.
MSTLLogicControl & getTLSControl()
Returns the tls logics control.
virtual MSJunction * buildNoLogicJunction()
Builds a junction that does not use a logic.
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
SumoXMLNodeType myType
The type of the currently chosen junction.
Class for low-level phase policy.
MSBitSetLogic< SUMO_MAX_CONNECTIONS > MSBitsetLogic
StringParameterMap myAdditionalParameter
Parameter map (key->value)
#define SUMO_MAX_CONNECTIONS
the maximum number of connections across an intersection
LaneVector myActiveIncomingLanes
The list of the incoming lanes of the currently chosen junction.
void addPhase(SUMOTime duration, const std::string &state, const std::vector< int > &nextPhases, SUMOTime min, SUMOTime max, const std::string &name)
Adds a phase to the currently built traffic lights logic.
T get(const std::string &id) const
Retrieves an item.
An actuated traffic light logic based on time delay of approaching vehicles.
MSTLLogicControl * myLogicControl
The tls control to use (0 if net's tls control shall be used)
void initJunctionLogic(const std::string &id)
Initialises a junction logic.
Storage for all programs of a single tls.
std::vector< MSTrafficLightLogic * > myLogics2PostLoadInit
The container for information which junctions shall be initialised using which values.
A class that stores and controls tls and switching of their programs.
Class for low-level platoon policy.
MSJunctionLogic * getJunctionLogicSecure()
Returns the current junction logic.
The definition of a single phase of a tls logic.
@ TLTYPE_HILVL_DETERMINISTIC
virtual void init(NLDetectorBuilder &nb)
Initialises the tls with information about incoming lanes.
MSJunctionControl * build() const
Builds the MSJunctionControl which holds all of the simulations junctions.
MSTLLogicControl * buildTLLogics()
Returns the built tls-logic control.
bool closeNetworkReading()
Lets MSTLLogicControl know that the network has been loaded.
Builds detectors for microsim.
const std::string & getActiveKey() const
Returns the active key.
void addLogicItem(int request, const std::string &response, const std::string &foes, bool cont)
Adds a logic item.
bool add(const std::string &id, T item)
Adds an item.