 |
Eclipse SUMO - Simulation of Urban MObility
|
Go to the documentation of this file.
46 oc.
addSynonyme(
"person-device.rerouting.period",
"person-device.routing.period",
true);
47 oc.
addDescription(
"person-device.rerouting.period",
"Routing",
"The period with which the person shall be rerouted");
107 if (key ==
"period") {
122 if (key ==
"period") {
127 }
else if (oldPeriod <= 0) {
141 std::vector<std::string> internals;
SUMOTime myPeriod
The period with which a vehicle shall be rerouted.
bool wasSet(int what) const
Returns whether the given parameter was set.
static void insertOptions(OptionsCont &oc)
Inserts MSTransportableDevice_Routing-options.
void setParameter(const std::string &key, const std::string &value)
try to set the given parameter for this device. Throw exception for unsupported key
virtual void addEvent(Command *operation, SUMOTime execTimeStep=-1)
Adds an Event.
virtual std::string getString(int id) const =0
Returns the string-value of the named (by its enum-value) attribute.
Static storage of an output device and its base (abstract) implementation.
static SUMOTime getLastAdaptation()
Information when the last edge weight adaptation occurred.
static double toDouble(const std::string &sData)
converts a string into the double value described by it by calling the char-type converter
const int VEHPARS_FORCE_REROUTE
std::string getString(const std::string &name) const
Returns the string-value of the named option (only for Option_String)
void deschedule()
Marks this Command as being descheduled.
static void buildDevices(MSTransportable &p, std::vector< MSTransportableDevice * > &into)
Build devices for the given person, if needed.
void loadState(const SUMOSAXAttributes &attrs)
Loads the state of the device from the given description.
static OptionsCont & getOptions()
Retrieves the options.
const std::string deviceName() const
return the name for this type of device
bool closeTag(const std::string &comment="")
Closes the most recently opened tag and optionally adds a comment.
OutputDevice & writeAttr(const SumoXMLAttr attr, const T &val)
writes a named attribute
static void initEdgeWeights()
initialize the edge weights if not done before
void addDescription(const std::string &name, const std::string &subtopic, const std::string &description)
Adds a description for an option.
static void insertDefaultAssignmentOptions(const std::string &deviceName, const std::string &optionsTopic, OptionsCont &oc, const bool isPerson=false)
Adds common command options that allow to assign devices to vehicles.
void addSynonyme(const std::string &name1, const std::string &name2, bool isDeprecated=false)
Adds a synonyme for an options name (any order)
std::string getParameter(const std::string &key) const
try to retrieve the given parameter from this device. Throw exception for unsupported key
void doRegister(const std::string &name, Option *v)
Adds an option under the given name.
std::string time2string(SUMOTime t)
A storage for options typed value containers)
Abstract in-person device.
SUMOTime string2time(const std::string &r)
static void initWeightUpdate()
intialize period edge weight update
void reroute(const SUMOTime currentTime, const bool onInit=false)
initiate the rerouting, create router / thread pool on first use
WrappingCommand< MSTransportableDevice_Routing > * myRerouteCommand
The (optional) command responsible for rerouting.
OutputDevice & openTag(const std::string &xmlElement)
Opens an XML tag.
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
static bool hasEdgeUpdates()
returns whether any routing actions take place
static MSNet * getInstance()
Returns the pointer to the unique instance of MSNet (singleton).
static bool equippedByDefaultAssignmentOptions(const OptionsCont &oc, const std::string &deviceName, DEVICEHOLDER &v, bool outputOptionSet, const bool isPerson=false)
Determines whether a vehicle should get a certain device.
MSEventControl * getInsertionEvents()
Returns the event control for insertion events.
SUMOTime wrappedRerouteCommandExecute(SUMOTime currentTime)
Performs rerouting after a period.
const std::string & getID() const
returns the id of the transportable
SUMOTime myLastRouting
The last time a routing took place.
MSTransportableDevice_Routing(MSTransportable &holder, const std::string &id, SUMOTime period)
Constructor.
void saveState(OutputDevice &out) const
Saves the state of the device.
Encapsulated SAX-Attributes.
const SUMOVehicleParameter & getParameter() const
const std::string & getID() const
Returns the id.
~MSTransportableDevice_Routing()
Destructor.