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