67 return "RailSignalConstraint";
110 static void storeTripId(
const std::string& tripId,
const std::string& vehID);
112 static const std::string&
lookupVehId(
const std::string& tripId);
127 static const SUMOVehicle*
getVeh(
const std::string& tripID,
bool checkID =
false);
184 bool hasPassed(
const std::string& tripId,
int limit)
const;
193 void loadState(
int index,
const std::vector<std::string>& tripIDs);
218 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
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
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.
MSRailSignalConstraint_Predecessor & operator=(const MSRailSignalConstraint_Predecessor &s)=delete
invalidated assignment operator
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
const SUMOVehicle * getFoe() const
~MSRailSignalConstraint_Predecessor()
Destructor.
A base class for constraints.
MSRailSignalConstraint(ConstraintType type)
Constructor.
virtual std::string getDescription() const
virtual void setActive(bool active)=0
static const SUMOVehicle * getVeh(const std::string &tripID, bool checkID=false)
static void saveState(OutputDevice &out)
Saves the current constraint states into the given stream.
static std::map< std::string, std::string > myTripIdLookup
ConstraintType getType() const
bool isInsertionConstraint() const
static void clearState()
Clear all constraint states before quick-loading state.
virtual bool isActive() const =0
virtual const SUMOVehicle * getFoe() const
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
static void storeTripId(const std::string &tripId, const std::string &vehID)
static const std::string & lookupVehId(const std::string &tripId)
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.
Representation of a vehicle.