66 return "RailSignalConstraint";
118 static std::string
getVehID(
const std::string& tripID);
171 bool hasPassed(
const std::string& tripId,
int limit)
const;
180 void loadState(
int index,
const std::vector<std::string>& tripIDs);
205 static std::map<const MSLane*, PassedTracker*, ComparatorNumericalIdLess>
myTrackerLookup;
SumoXMLTag
Numbers representing SUMO-XML - element names.
@ SUMO_TAG_BIDI_PREDECESSOR
Predecessor constraint for rail signal before bidirectional section.
@ SUMO_TAG_INSERTION_PREDECESSOR
Predecessor constraint on insertion before rail signal.
@ SUMO_TAG_FOE_INSERTION
Predecessor constraint on switching a rail signal.
@ SUMO_TAG_INSERTION_ORDER
Predecessor constraint on insertion before rail signal.
@ SUMO_TAG_PREDECESSOR
Predecessor constraint on switching a rail signal.
Representation of a lane in the micro simulation.
Something on a lane to be noticed about vehicle movement.
Notification
Definition of a vehicle state.
bool hasPassed(const std::string &tripId, int limit) const
void raiseLimit(int limit)
bool notifyEnter(SUMOTrafficObject &veh, MSMoveReminder::Notification reason, const MSLane *enteredLane=0)
tracks vehicles that passed this link (entered the next lane)
void loadState(int index, const std::vector< std::string > &tripIDs)
loads the current passed states into the given stream
PassedTracker(MSLane *lane)
void clearState()
Clear all passed states before quick-loading state.
int myLastIndex
index of the last passed object
std::vector< std::string > myPassed
passed tripIds
void saveState(OutputDevice &out)
Saves the current passed states into the given stream.
static std::map< const MSLane *, PassedTracker *, ComparatorNumericalIdLess > myTrackerLookup
MSRailSignalConstraint_Predecessor & operator=(const MSRailSignalConstraint_Predecessor &s)=delete
invalidated assignment operator
MSRailSignalConstraint_Predecessor(ConstraintType type, const MSRailSignal *signal, const std::string &tripId, int limit, bool active)
Constructor.
const MSRailSignal * myFoeSignal
store the foe signal (for TraCI access)
bool cleared() const
whether the constraint has been met
bool myAmActive
Whether this constraint is currently active.
static void loadState(const SUMOSAXAttributes &attrs)
loads the constraint state from the given attrs
static void saveState(OutputDevice &out)
Saves the current constraint states into the given stream.
const std::string myTripId
id of the predecessor that must already have passed
std::string getDescription() const
void setActive(bool active)
static void clearState()
Clear all constraint states before quick-loading state.
static void cleanup()
clean up state
std::vector< PassedTracker * > myTrackers
the tracker object for this constraint
void write(OutputDevice &out, const std::string &tripId) const
const int myLimit
the number of passed vehicles within which tripId must have occured
~MSRailSignalConstraint_Predecessor()
Destructor.
A base class for constraints.
MSRailSignalConstraint(ConstraintType type)
Constructor.
virtual std::string getDescription() const
virtual void setActive(bool active)=0
static void saveState(OutputDevice &out)
Saves the current constraint states into the given stream.
ConstraintType getType() const
bool isInsertionConstraint() const
static std::string getVehID(const std::string &tripID)
static void clearState()
Clear all constraint states before quick-loading state.
virtual bool isActive() const =0
static void clearAll()
Remove all constraints before quick-loading state.
SumoXMLTag getTag() const
virtual bool cleared() const =0
whether the constraint has been met
ConstraintType getSwappedType() const
static void cleanup()
clean up state
virtual void write(OutputDevice &out, const std::string &tripId) const =0
virtual ~MSRailSignalConstraint()
Destructor.
Static storage of an output device and its base (abstract) implementation.
An upper class for objects with additional parameters.
Encapsulated SAX-Attributes.
Representation of a vehicle, person, or container.