52 #ifdef CHECK_MEMORY_LEAKS 54 #endif // CHECK_MEMORY_LEAKS 61 const std::vector<MSLane*>& destLanes,
62 const std::string& file) :
65 myDestLanes(destLanes),
66 myCurrentSpeed(destLanes[0]->getSpeedLimit()),
67 myDefaultSpeed(destLanes[0]->getSpeedLimit()),
68 myAmOverriding(false),
69 mySpeedOverrideValue(destLanes[0]->getSpeedLimit()),
116 std::vector<MSLane*>::iterator i;
123 first->
setSpeed(speed, currentTime, -1);
129 (*i)->setMaxSpeed(speed);
140 return ((*myCurrentEntry).first) - ((*(
myCurrentEntry - 1)).first);
209 return (*myCurrentEntry).second;
226 return (*myCurrentEntry).second;
MESegment * getNextSegment() const
Returns the following segment on the same edge (0 if it is the last).
void setOverridingValue(SUMOReal val)
std::vector< MSLane * > myDestLanes
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)
SUMOReal getLoadedSpeed()
SUMOReal getCurrentSpeed() const
Returns the current speed.
SUMOReal myDefaultSpeed
The original speed allowed on the lanes.
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.
SUMOTime getCurrentTimeStep() const
Returns the current simulation step.
bool myAmOverriding
The information whether the read speed shall be overridden.
std::vector< std::pair< SUMOTime, SUMOReal > >::iterator myCurrentEntry
MSLaneSpeedTrigger(const std::string &id, const std::vector< MSLane *> &destLanes, const std::string &file)
Constructor.
void setOverriding(bool val)
virtual SUMOTime addEvent(Command *operation, SUMOTime execTimeStep, AdaptType type)
Adds an Event.
void setSpeed(SUMOReal newSpeed, SUMOTime currentTime, SUMOReal jamThresh=DO_NOT_PATCH_JAM_THRESHOLD)
reset mySpeed and patch the speed of all vehicles in it. Also set/recompute myJamThreshold ...
SUMOReal mySpeedOverrideValue
The speed to use if overriding the read speed.
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)
MESegment * getSegmentForEdge(const MSEdge &e, SUMOReal pos=0)
Get the segment for a given edge at a given position.
SUMOTime processCommand(bool move2next, SUMOTime currentTime)
static MELoop * gMesoNet
mesoscopic simulation infrastructure
virtual ~MSLaneSpeedTrigger()
Destructor.
std::vector< std::pair< SUMOTime, SUMOReal > > myLoadedSpeeds
bool myDidInit
The information whether init was called.
virtual void myEndElement(int element)
Called on the closing of a tag;.
SUMOReal getDefaultSpeed() const