47 #include <mesosim/MELoop.h>
48 #include <mesosim/MESegment.h>
51 #ifdef CHECK_MEMORY_LEAKS
53 #endif // CHECK_MEMORY_LEAKS
65 for (MSEdgeVector::const_iterator e = edges.begin(); e != edges.end(); ++e) {
80 MESegment* seg = MSGlobals::gMesoNet->getSegmentForEdge(edge);
82 if (seg->getCarNumber() != 0) {
86 seg = seg->getNextSegment();
90 const std::vector<MSLane*>& lanes = edge.
getLanes();
91 for (std::vector<MSLane*>::const_iterator lane = lanes.begin(); lane != lanes.end(); ++lane) {
92 if (((**lane).getVehicleNumber() != 0)) {
104 if (dump || persons.size() > 0 || containers.size() > 0) {
109 MESegment* seg = MSGlobals::gMesoNet->getSegmentForEdge(edge);
111 seg->writeVehicles(of);
112 seg = seg->getNextSegment();
116 const std::vector<MSLane*>& lanes = edge.
getLanes();
117 for (std::vector<MSLane*>::const_iterator lane = lanes.begin(); lane != lanes.end(); ++lane) {
125 for (std::vector<MSPerson*>::const_iterator it_p = persons.begin(); it_p != persons.end(); ++it_p) {
130 of.
writeAttr(
"stage", (*it_p)->getCurrentStageDescription());
134 for (std::vector<MSContainer*>::const_iterator it_c = containers.begin(); it_c != containers.end(); ++it_c) {
139 of.
writeAttr(
"stage", (*it_c)->getCurrentStageDescription());
149 of.
openTag(
"lane") <<
" id=\"" << lane.
myID <<
"\"";
151 for (std::vector<MSVehicle*>::const_iterator veh = lane.
myVehBuffer.begin();
155 for (MSLane::VehCont::const_iterator veh = lane.
myVehicles.begin();
173 const unsigned int personNumber =
static_cast<const MSVehicle&
>(veh).getPersonNumber();
174 if (personNumber > 0) {
177 const unsigned int containerNumber =
static_cast<const MSVehicle&
>(veh).getContainerNumber();
178 if (containerNumber > 0) {
static void write(OutputDevice &of, const MSEdgeControl &ec, SUMOTime timestep, int precision)
Writes the complete network state of the given edges into the given device.
static bool gOmitEmptyEdgesOnDump
Information whether empty edges shall be written on dump.
OutputDevice & writeAttr(const SumoXMLAttr attr, const T &val)
writes a named attribute
VehCont myVehicles
The lane's vehicles. The entering vehicles are inserted at the front of this container and the leavin...
Representation of a vehicle in the micro simulation.
const std::vector< MSLane * > & getLanes() const
Returns this edge's lanes.
virtual SUMOReal getPositionOnLane() const =0
Get the vehicle's position along the lane.
std::string time2string(SUMOTime t)
virtual bool isOnRoad() const
Returns the information whether the vehicle is on a road (is simulated)
std::vector< MSContainer * > getSortedContainers(SUMOTime timestep) const
Returns this edge's containers sorted by pos.
The base class for microscopic and mesoscopic vehicles.
const std::string & getID() const
Returns the id.
A road/street connecting two junctions.
void setPrecision(unsigned int precision=OUTPUT_ACCURACY)
Sets the precison or resets it to default.
std::vector< MSVehicle * > myVehBuffer
static void writeLane(OutputDevice &of, const MSLane &lane)
Writes the dump of the given lane into the given device.
Stores edges and lanes, performs moving of vehicle.
unsigned int getVehicleNumber() const
Returns the number of vehicles on this lane.
std::string myID
The name of the object.
virtual SUMOReal getSpeed() const =0
Returns the vehicle's current speed.
static void writeEdge(OutputDevice &of, const MSEdge &edge, SUMOTime timestep)
Writes the dump of the given edge into the given device.
Static storage of an output device and its base (abstract) implementation.
bool closeTag()
Closes the most recently opened tag.
static const bool gUseMesoSim
std::vector< MSEdge * > MSEdgeVector
static void writeVehicle(OutputDevice &of, const MSBaseVehicle &veh)
Writes the dump of the given vehicle into the given device.
std::vector< MSPerson * > getSortedPersons(SUMOTime timestep) const
Returns this edge's persons sorted by pos.
Representation of a lane in the micro simulation.
OutputDevice & openTag(const std::string &xmlElement)
Opens an XML tag.
const MSEdgeVector & getEdges() const
Returns loaded edges.
const std::string & getID() const
Returns the name of the vehicle.