57 const std::string&
id,
const std::string& programID,
SUMOTime delay,
76 void setParameter(
const std::string& key,
const std::string& value)
override;
241 const std::map<std::string, std::vector<MSRailSignalConstraint*> >&
getConstraints()
const {
263 typedef std::pair<const SUMOVehicle* const, const MSLink::ApproachingVehicleInformation>
Approaching;
303 static std::string
describeLinks(std::vector<MSLink*> links);
326 std::string
getID()
const;
std::vector< MSEdge * > MSEdgeVector
ConstMSEdgeVector::const_iterator MSRouteIterator
#define UNUSED_PARAMETER(x)
Representation of a lane in the micro simulation.
The definition of a single phase of a tls logic.
A base class for constraints.
bool isMovingBlock() const
static VehicleVector myRivalVehicles
std::string getBlockingVehicleIDs() const
Phases myPhases
The list of phases this logic uses.
static VehicleVector myPriorityVehicles
std::string getRequestedDriveWay() const
int myPhaseIndex
MSTrafficLightLogic requires that the phase index changes whenever signals change their state.
SUMOTime getOffsetFromIndex(int index) const override
Returns the position (start of a phase during a cycle) from of a given step.
void setParameter(const std::string &key, const std::string &value) override
Sets a parameter and updates internal constants.
static std::string myConstraintInfo
MSPhaseDefinition myCurrentPhase
The current phase.
void addConstraint(const std::string &tripId, MSRailSignalConstraint *constraint)
register constraint for signal switching
std::vector< LinkInfo > myLinkInfos
data storage for every link at this node (more than one when directly guarding a switch)
const MSDriveWay & retrieveDriveWayForVeh(int tlIndex, const SUMOVehicle *veh)
SUMOTime getPhaseIndexAtTime(SUMOTime simStep) const override
Returns the index of the logic at the given simulation step.
std::string getPriorityVehicleIDs() const
static std::string myRequestedDriveWay
const std::map< std::string, std::vector< MSRailSignalConstraint * > > & getConstraints() const
VehicleVector getBlockingVehicles(int linkIndex) override
return vehicles that block the intersection/rail signal for vehicles that wish to pass the given link...
void writeBlocks(OutputDevice &od, bool writeVehicles) const
write rail signal block output for all links and driveways
void changeStepAndDuration(MSTLLogicControl &tlcontrol, SUMOTime simStep, int step, SUMOTime stepDuration) override
Changes the current phase and her duration.
VehicleVector getRivalVehicles(int linkIndex) override
return vehicles that approach the intersection/rail signal and are in conflict with vehicles that wis...
int myDriveWayIndex
running number of driveways created for this signal
static std::string describeLinks(std::vector< MSLink * > links)
print link descriptions
bool getsMajorGreen(int) const override
whether the given link index ever turns 'G'
~MSRailSignal()
Destructor.
void adaptLinkInformationFrom(const MSTrafficLightLogic &logic) override
Applies information about controlled links and lanes from the given logic.
static VehicleVector myBlockingVehicles
bool constraintsAllow(const SUMOVehicle *veh, bool storeWaitRelation=false) const
whether the given vehicle is free to drive
void storeTraCIVehicles(int linkIndex)
update vehicle lists for traci calls
int getIndexFromOffset(SUMOTime offset) const override
Returns the step (the phasenumber) of a given position of the cycle.
void init(NLDetectorBuilder &nb) override
Initialises the rail signal with information about adjacent rail signals.
std::map< std::string, std::vector< MSRailSignalConstraint * > > myConstraints
map from tripId to constraint list
std::pair< const SUMOVehicle *const, const MSLink::ApproachingVehicleInformation > Approaching
int getNumericalID() const
int getPhaseNumber() const override
Returns the number of phases.
const MSPhaseDefinition & getPhase(int givenstep) const override
Returns the definition of the phase from the given position within the plan.
static VehicleVector & rivalVehicles()
static bool storeVehicles()
SUMOTime trySwitch() override
Switches to the next phase.
std::string getBlockingDriveWayIDs() const
const std::vector< MSDriveWay * > retrieveDriveWays(int tlIndex) const
const MSDriveWay & retrieveDriveWay(int numericalID) const
static bool myStoreVehicles
std::map< const MSLane *, int, ComparatorNumericalIdLess > LaneVisitedMap
bool myMovingBlock
whether the signal is in moving block mode (only protects from oncoming and flanking trains)
bool removeConstraint(const std::string &tripId, MSRailSignalConstraint *constraint)
remove constraint for signal switching
static std::vector< const MSDriveWay * > myBlockingDriveWays
bool updateCurrentPhase()
returns the state of the signal that actually required
static VehicleVector & priorityVehicles()
const Phases & getPhases() const override
Returns the phases of this tls program.
const MSPhaseDefinition & getCurrentPhaseDef() const override
Returns the definition of the current phase.
void updateDriveway(int numericalID)
update driveway for extended deadlock protection
std::string getConstraintInfo() const
static std::vector< const MSDriveWay * > & blockingDriveWays()
static VehicleVector & blockingVehicles()
std::string getNewDrivewayID()
static void initDriveWays(const SUMOVehicle *ego, bool update)
void addLink(MSLink *link, MSLane *lane, int pos) override
Adds a link on building.
const MSDriveWay & retrieveDriveWayForRoute(int tlIndex, MSRouteIterator first, MSRouteIterator end)
std::string getRivalVehicleIDs() const
static bool hasInsertionConstraint(MSLink *link, const MSVehicle *veh, std::string &info, bool &isInsertionOrder)
VehicleVector getPriorityVehicles(int linkIndex) override
return vehicles that approach the intersection/rail signal and have priority over vehicles that wish ...
std::vector< const MSDriveWay * > getBlockingDriveWays(int linkIndex) override
return vehicles that approach the intersection/rail signal and have priority over vehicles that wish ...
int getCurrentPhaseIndex() const override
Returns the current index within the program.
A class that stores and controls tls and switching of their programs.
The parent class for traffic light logics.
std::vector< const SUMOVehicle * > VehicleVector
list of vehicles
std::vector< MSPhaseDefinition * > Phases
Definition of a list of phases, being the junction logic.
Representation of a vehicle in the micro simulation.
Builds detectors for microsim.
Static storage of an output device and its base (abstract) implementation.
std::map< std::string, std::string > Map
parameters map
Representation of a vehicle.
void reroute(SUMOVehicle *veh, const MSEdgeVector &occupied)
try rerouting vehicle if reservation failed
SUMOTime myLastRerouteTime
MSDriveWay & getDriveWay(const SUMOVehicle *)
retrieve an existing Driveway or construct a new driveway based on the vehicles route
void reset()
init LinkInfo
std::vector< MSDriveWay * > myDriveways
all driveways immediately following this link
SUMOVehicle * myLastRerouteVehicle
std::string getID() const
return id for this railsignal-link