55 #ifdef CHECK_MEMORY_LEAKS 57 #endif // CHECK_MEMORY_LEAKS 69 myLastParameterised(0) {
97 for (std::vector<MSLane*>::const_iterator it = lanes.begin(); it != lanes.end(); ++it) {
98 (*it)->saveState(out);
160 std::vector<std::string> vehIDs;
212 if (routingDevice != 0) {
void myStartElement(int element, const SUMOSAXAttributes &attrs)
Called on the opening of a tag;.
virtual int getInt(int id) const =0
Returns the int-value of the named (by its enum-value) attribute.
OutputDevice & writeAttr(const SumoXMLAttr attr, const T &val)
writes a named attribute
void discountStateLoaded(bool removed=false)
avoid counting a vehicle twice if it was loaded from state and route input
std::vector< std::string > getStringVector(const std::string &name) const
Returns the list of string-vector-value of the named option (only for Option_String) ...
void close()
Closes the device and removes it from the dictionary.
description of a vehicle type
Parameterised * myLastParameterised
the last object that potentially carries parameters
virtual void closeVehicle()
Ends the processing of a vehicle.
begin/end of the description of a single lane
static int dictSize()
Returns the number of edges.
SUMOVehicleParameter * myVehicleParameter
Parameter of the current vehicle, trip, person, container or flow.
void saveState(OutputDevice &out) const
Saves the current state into the given stream.
void closeVehicle()
Ends the processing of a vehicle.
SUMOVTypeParameter * myCurrentVType
The currently parsed vehicle type.
std::string time2string(SUMOTime t)
A device that performs vehicle rerouting based on current edge speeds.
weights: time range begin
static MSNet * getInstance()
Returns the pointer to the unique instance of MSNet (singleton).
std::pair< int, int > myEdgeAndLane
static long long int _2long(const E *const data)
converts a char-type array into the long value described by it
const MSEdge & getEdge() const
Returns the edge this segment belongs to.
#define WRITE_WARNING(msg)
virtual bool hasDeparted() const =0
Returns whether this vehicle has departed.
static void dict_saveState(OutputDevice &out)
Saves all known routes into the given stream.
static OptionsCont & getOptions()
Retrieves the options.
void loadState(std::vector< std::string > &vehIDs, MSVehicleControl &vc, const SUMOTime blockTime, const int queIdx)
Loads the state of this segment with the given parameters.
bool writeHeader(const SumoXMLTag &rootElement)
A road/street connecting two junctions.
static void parseStringVector(const std::string &def, std::vector< std::string > &into)
Splits the given string.
MESegment * getNextSegment() const
Returns the following segment on the same edge (0 if it is the last).
MSStateHandler(const std::string &file, const SUMOTime offset)
standard constructor
Representation of a vehicle.
Encapsulated SAX-Attributes.
parameter associated to a certain key
MSVehicleControl & getVehicleControl()
Returns the vehicle control.
SUMOTime string2time(const std::string &r)
void saveState(OutputDevice &out)
Saves the current state into the given stream.
SUMOSAXAttributes * myAttrs
cached attrs (used when loading vehicles)
void setState(int runningVehNo, int loadedVehNo, int endedVehNo, SUMOReal totalDepartureDelay, SUMOReal totalTravelTime)
Sets the current state variables as loaded from the stream.
void loadState(const SUMOSAXAttributes &attrs, const SUMOTime offset, MSVehicleControl &vc)
Loads one transfer vehicle state from the given descriptionn.
virtual std::string getString(int id) const =0
Returns the string-value of the named (by its enum-value) attribute.
virtual void myStartElement(int element, const SUMOSAXAttributes &attrs)
Called on the opening of a tag;.
virtual bool hasAttribute(int id) const =0
Returns the information whether the named (by its enum-value) attribute is within the current list...
static MSVehicleTransfer * getInstance()
Returns the instance of this object.
void addParameter(const std::string &key, const std::string &value)
Adds a parameter.
virtual void myEndElement(int element)
Called when a closing tag occurs.
trigger: the time of the step
The vehicle has departed (was inserted into the network)
int getNumericalID() const
Returns the numerical id of the edge.
bool myAmLoadingState
whether a state file is being loaded
static OutputDevice & getDevice(const std::string &name)
Returns the described OutputDevice.
static const MSEdgeVector & getAllEdges()
Returns all edges with a numerical id.
virtual ~MSStateHandler()
standard destructor
A single mesoscopic segment (cell)
void myEndElement(int element)
Called when a closing tag occurs.
MESegment * getSegmentForEdge(const MSEdge &e, SUMOReal pos=0)
Get the segment for a given edge at a given position.
static MELoop * gMesoNet
mesoscopic simulation infrastructure
SUMOVehicle * getVehicle(const std::string &id) const
Returns the vehicle with the given id.
std::set< std::string > myVehiclesToRemove
vehicles that shall be removed when loading state
bool notifyEnter(SUMOVehicle &veh, MSMoveReminder::Notification reason)
Computes a new route on vehicle insertion.
Static storage of an output device and its base (abstract) implementation.
virtual SUMOReal getFloat(int id) const =0
Returns the SUMOReal-value of the named (by its enum-value) attribute.
virtual SUMOSAXAttributes * clone() const =0
return a new deep-copy attributes object
The class responsible for building and deletion of vehicles.
T get(int attr, const char *objectid, bool &ok, bool report=true) const
Tries to read given attribute assuming it is an int.
virtual void loadState(const SUMOSAXAttributes &attrs, const SUMOTime offset)=0
Loads the state of this vehicle from the given description.
Parser and container for routes during their loading.
static void saveState(const std::string &file, SUMOTime step)
Saves the current state.
std::string id
The vehicle's id.
virtual MSDevice * getDevice(const std::type_info &type) const =0
Returns a device of the given type if it exists or 0.