56 const std::vector<MSLane*>& destLanes,
57 const std::string& file) :
60 myDestLanes(destLanes),
61 myCurrentSpeed(destLanes[0]->getSpeedLimit()),
62 myDefaultSpeed(destLanes[0]->getSpeedLimit()),
63 myAmOverriding(false),
64 mySpeedOverrideValue(destLanes[0]->getSpeedLimit()),
94 (*myCurrentEntry).first);
111 std::vector<MSLane*>::iterator i;
118 first->
setSpeed(speed, currentTime, -1);
124 (*i)->setMaxSpeed(speed);
135 return ((*myCurrentEntry).first) - ((*(
myCurrentEntry - 1)).first);
204 return (*myCurrentEntry).second;
221 return (*myCurrentEntry).second;
MESegment * getNextSegment() const
Returns the following segment on the same edge (0 if it is the last).
std::vector< MSLane * > myDestLanes
MESegment * getSegmentForEdge(const MSEdge &e, double pos=0)
Get the segment for a given edge at a given position.
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 ...
double myDefaultSpeed
The original speed allowed on the lanes.
double getCurrentSpeed() const
Returns the current speed.
std::vector< std::pair< SUMOTime, double > >::iterator myCurrentEntry
std::string time2string(SUMOTime t)
virtual void myStartElement(int element, const SUMOSAXAttributes &attrs)
Called on the opening of a tag;.
SUMOTime execute(SUMOTime currentTime)
Executes a switch command.
static MSNet * getInstance()
Returns the pointer to the unique instance of MSNet (singleton).
const std::string & getID() const
Returns the id.
SAX-handler base for SUMO-files.
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.
SUMOTime getSUMOTimeReporting(int attr, const char *objectid, bool &ok, bool report=true) const
Tries to read given attribute assuming it is a SUMOTime.
#define UNUSED_PARAMETER(x)
#define WRITE_WARNING(msg)
std::vector< std::pair< SUMOTime, double > > myLoadedSpeeds
An abstract device that changes the state of the micro simulation.
Encapsulated SAX-Attributes.
MSEventControl * getBeginOfTimestepEvents()
Returns the event control for events executed at the begin of a time step.
A wrapper for a Command function.
virtual void addEvent(Command *operation, SUMOTime execTimeStep=-1)
Adds an Event.
SUMOTime getCurrentTimeStep() const
Returns the current simulation step.
bool myAmOverriding
The information whether the read speed shall be overridden.
MSLaneSpeedTrigger(const std::string &id, const std::vector< MSLane *> &destLanes, const std::string &file)
Constructor.
void setOverriding(bool val)
trigger: the time of the step
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.
A single mesoscopic segment (cell)
SUMOTime processCommand(bool move2next, SUMOTime currentTime)
static MELoop * gMesoNet
mesoscopic simulation infrastructure
virtual ~MSLaneSpeedTrigger()
Destructor.
double getDefaultSpeed() const
bool myDidInit
The information whether init was called.
virtual void myEndElement(int element)
Called on the closing of a tag;.
trigger: a step description
void setOverridingValue(double val)
double mySpeedOverrideValue
The speed to use if overriding the read speed.