 |
Eclipse SUMO - Simulation of Urban MObility
|
Go to the documentation of this file.
49 const std::vector<MSLane*>& destLanes,
50 const std::string& file) :
53 myDestLanes(destLanes),
54 myCurrentSpeed(destLanes[0]->getSpeedLimit()),
55 myDefaultSpeed(destLanes[0]->getSpeedLimit()),
56 myAmOverriding(false),
57 mySpeedOverrideValue(destLanes[0]->getSpeedLimit()),
87 (*myCurrentEntry).first);
104 std::vector<MSLane*>::iterator i;
110 while (first !=
nullptr) {
111 first->
setSpeed(speed, currentTime, -1);
117 (*i)->setMaxSpeed(speed);
128 return ((*myCurrentEntry).first) - ((*(
myCurrentEntry - 1)).first);
197 return (*myCurrentEntry).second;
214 return (*myCurrentEntry).second;
#define UNUSED_PARAMETER(x)
static bool runParser(GenericSAXHandler &handler, const std::string &file, const bool isNet=false)
Runs the given handler on the given file; returns if everything's ok.
void setOverridingValue(double val)
double mySpeedOverrideValue
The speed to use if overriding the read speed.
std::vector< std::pair< SUMOTime, double > >::iterator myCurrentEntry
virtual void addEvent(Command *operation, SUMOTime execTimeStep=-1)
Adds an Event.
#define WRITE_WARNING(msg)
SAX-handler base for SUMO-files.
A single mesoscopic segment (cell)
MSEventControl * getBeginOfTimestepEvents()
Returns the event control for events executed at the begin of a time step.
double myDefaultSpeed
The original speed allowed on the lanes.
SUMOTime execute(SUMOTime currentTime)
Executes a switch command.
A wrapper for a Command function.
SUMOTime getSUMOTimeReporting(int attr, const char *objectid, bool &ok, bool report=true) const
Tries to read given attribute assuming it is a SUMOTime.
virtual void myStartElement(int element, const SUMOSAXAttributes &attrs)
Called on the opening of a tag;.
std::vector< std::pair< SUMOTime, double > > myLoadedSpeeds
@ SUMO_TAG_VSS
A variable speed sign.
SUMOTime getCurrentTimeStep() const
Returns the current simulation step.
MESegment * getSegmentForEdge(const MSEdge &e, double pos=0)
Get the segment for a given edge at a given position.
@ SUMO_TAG_STEP
trigger: a step description
std::string time2string(SUMOTime t)
MESegment * getNextSegment() const
Returns the following segment on the same edge (0 if it is the last).
T getOpt(int attr, const char *objectid, bool &ok, T defaultValue, bool report=true) const
Tries to read given attribute assuming it is an int.
@ SUMO_ATTR_TIME
trigger: the time of the step
SUMOTime processCommand(bool move2next, SUMOTime currentTime)
An abstract device that changes the state of the micro simulation.
virtual ~MSLaneSpeedTrigger()
Destructor.
static MSNet * getInstance()
Returns the pointer to the unique instance of MSNet (singleton).
static MELoop * gMesoNet
mesoscopic simulation infrastructure
bool myAmOverriding
The information whether the read speed shall be overridden.
void setOverriding(bool val)
bool myDidInit
The information whether init was called.
MSLaneSpeedTrigger(const std::string &id, const std::vector< MSLane * > &destLanes, const std::string &file)
Constructor.
double getDefaultSpeed() const
void setSpeed(double newSpeed, SUMOTime currentTime, double jamThresh=DO_NOT_PATCH_JAM_THRESHOLD)
reset mySpeed and patch the speed of all vehicles in it. Also set/recompute myJamThreshold
virtual void myEndElement(int element)
Called on the closing of a tag;.
Encapsulated SAX-Attributes.
const std::string & getID() const
Returns the id.
double getCurrentSpeed() const
Returns the current speed.
std::vector< MSLane * > myDestLanes