53 const std::vector<MSLane*>& destLanes,
54 const std::string& file) :
57 myDestLanes(destLanes),
58 myDefaultSpeed(destLanes[0]->getSpeedLimit()),
59 myDefaultFriction(destLanes[0]->getFrictionCoefficient()),
60 myAmOverriding(false),
61 mySpeedOverrideValue(destLanes[0]->getSpeedLimit()),
120 lane->setMaxSpeed(speed, altered);
140 lane->setFrictionCoefficient(friction);
169 if (speed < 0 && friction < 0) {
#define WRITE_WARNINGF(...)
#define WRITE_ERRORF(...)
std::string time2string(SUMOTime t, bool humanReadable)
convert SUMOTime to string (independently of global format setting)
@ SUMO_TAG_STEP
trigger: a step description
@ SUMO_TAG_VSS
A variable speed sign.
@ SUMO_ATTR_TIME
trigger: the time of the step
virtual void addEvent(Command *operation, SUMOTime execTimeStep=-1)
Adds an Event.
Representation of a lane in the micro simulation.
void setOverridingValue(double val)
void setOverriding(bool val)
static std::map< std::string, MSLaneSpeedTrigger * > myInstances
MSLaneSpeedTrigger(const std::string &id, const std::vector< MSLane * > &destLanes, const std::string &file)
Constructor.
std::vector< std::pair< SUMOTime, double > > myLoadedSpeeds
virtual void myEndElement(int element)
Called on the closing of a tag;.
double getCurrentFriction() const
Returns the current friction.
double getCurrentSpeed() const
Returns the current speed.
double mySpeedOverrideValue
The speed to use if overriding the read speed.
SUMOTime executeFrictionChange(SUMOTime currentTime)
virtual ~MSLaneSpeedTrigger()
Destructor.
const double myDefaultFriction
The original friction on the lanes.
std::vector< std::pair< SUMOTime, double > >::iterator myCurrentSpeedEntry
std::vector< MSLane * > myDestLanes
std::vector< std::pair< SUMOTime, double > > myLoadedFrictions
std::vector< std::pair< SUMOTime, double > >::iterator myCurrentFrictionEntry
bool myAmOverriding
The information whether the read speed shall be overridden.
virtual void myStartElement(int element, const SUMOSAXAttributes &attrs)
Called on the opening of a tag;.
SUMOTime executeSpeedChange(SUMOTime currentTime)
Executes a switch command.
const double myDefaultSpeed
The original speed allowed on the lanes.
SUMOTime processCommand(bool move2next, SUMOTime currentTime)
double getDefaultSpeed() const
bool myDidInit
The information whether init was called.
static MSNet * getInstance()
Returns the pointer to the unique instance of MSNet (singleton).
MSEventControl * getBeginOfTimestepEvents()
Returns the event control for events executed at the begin of a time step.
SUMOTime getCurrentTimeStep() const
Returns the current simulation step.
Base class for objects which have an id.
const std::string & getID() const
Returns the id.
Encapsulated SAX-Attributes.
T getOpt(int attr, const char *objectid, bool &ok, T defaultValue=T(), bool report=true) const
Tries to read given attribute assuming it is an int.
virtual bool hasAttribute(int id) const =0
Returns the information whether the named (by its enum-value) attribute is within the current list.
SUMOTime getSUMOTimeReporting(int attr, const char *objectid, bool &ok, bool report=true) const
Tries to read given attribute assuming it is a SUMOTime.
SAX-handler base for SUMO-files.
A wrapper for a Command function.
static bool runParser(GenericSAXHandler &handler, const std::string &file, const bool isNet=false, const bool isRoute=false, const bool isExternal=false, const bool catchExceptions=true)
Runs the given handler on the given file; returns if everything's ok.