 |
Eclipse SUMO - Simulation of Urban MObility
|
Go to the documentation of this file.
44 std::vector<double> speed =
getSpeed();
47 of <<
"<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\n";
48 of <<
"<VTKFile type=\"PolyData\" version=\"0.1\" order=\"LittleEndian\">\n";
50 of <<
" <Piece NumberOfPoints=\"" << speed.size() <<
"\" NumberOfVerts=\"1\" NumberOfLines=\"0\" NumberOfStrips=\"0\" NumberOfPolys=\"0\">\n";
51 of <<
"<PointData>\n";
52 of <<
" <DataArray type=\"Float64\" Name=\"speed\" format=\"ascii\">" <<
List2String(
getSpeed()) <<
"</DataArray>\n";
53 of <<
"</PointData>\n";
54 of <<
"<CellData/>\n";
56 of <<
" <DataArray type=\"Float64\" Name=\"Points\" NumberOfComponents=\"3\" format=\"ascii\">" <<
List2String(
getPositions()) <<
"</DataArray>\n";
59 of <<
" <DataArray type=\"Int64\" Name=\"connectivity\" format=\"ascii\">" <<
getOffset((
int) speed.size()) <<
"</DataArray>\n";
60 of <<
" <DataArray type=\"Int64\" Name=\"offsets\" format=\"ascii\">" << speed.size() <<
"</DataArray>\n";
63 of <<
" <DataArray type=\"Int64\" Name=\"connectivity\" format=\"ascii\"/>\n";
64 of <<
" <DataArray type=\"Int64\" Name=\"offsets\" format=\"ascii\"/>\n";
67 of <<
" <DataArray type=\"Int64\" Name=\"connectivity\" format=\"ascii\"/>\n";
68 of <<
" <DataArray type=\"Int64\" Name=\"offsets\" format=\"ascii\"/>\n";
71 of <<
" <DataArray type=\"Int64\" Name=\"connectivity\" format=\"ascii\"/>\n";
72 of <<
" <DataArray type=\"Int64\" Name=\"offsets\" format=\"ascii\"/>\n";
75 of <<
"</PolyData>\n";
83 std::vector<double> output;
90 for (; it != end; ++it) {
91 const MSVehicle* veh = static_cast<const MSVehicle*>((*it).second);
107 std::vector<double> output;
114 for (; it != end; ++it) {
115 const MSVehicle* veh = static_cast<const MSVehicle*>((*it).second);
133 std::string output =
"";
134 for (
int i = 0; i < (int)input.size(); i++) {
136 std::stringstream ss;
143 ss << input[i] <<
" ";
153 std::string output =
"";
154 for (
int i = 0; i < nr; i++) {
156 std::stringstream ss;
166 if (c ==
' ' || c ==
'\t' || c ==
'\r' || c ==
'\n' || c == 11) {
174 bool trimmed =
false;
177 istring.erase(istring.length() - 1);
189 return trim(istring);
bool isOnRoad() const
Returns the information whether the vehicle is on a road (is simulated)
Static storage of an output device and its base (abstract) implementation.
double z() const
Returns the z-position.
std::map< std::string, SUMOVehicle * >::const_iterator constVehIt
Definition of the internal vehicles map iterator.
static std::vector< double > getPositions()
Get a Vector of the Positions (x,y,z) of each vehicle in the actual timestep.
Position getPosition(const double offset=0) const
Return current position (x/y, cartesian)
double getPositionOnLane() const
Get the vehicle's position along the lane.
constVehIt loadedVehEnd() const
Returns the end of the internal vehicle map.
Position positionAtOffset(double pos, double lateralOffset=0) const
Returns the position at the given length.
A point in 2D or 3D with translation and scaling methods.
double x() const
Returns the x-position.
static void write(OutputDevice &of, SUMOTime timestep)
Produce a VTK output to use with Tools like ParaView.
MSLane * getLane() const
Returns the lane the vehicle is on.
static std::vector< double > getSpeed()
Get a Vector with the speed values of each vehicle in the actual timestep.
const PositionVector & getShape() const
Returns this lane's shape.
static MSNet * getInstance()
Returns the pointer to the unique instance of MSNet (singleton).
double y() const
Returns the y-position.
static std::string List2String(std::vector< double > input)
Get a comma separated String from a Vector.
static std::string getOffset(int nr)
Get a String with the indexes of all vehicles (needed in the VTk File)
The class responsible for building and deletion of vehicles.
static std::string trim(std::string istring)
Deletes the whitespaces at the end of a String.
double getSpeed() const
Returns the vehicle's current speed.
static bool ctype_space(const char c)
Checks if there is a whitespace.
constVehIt loadedVehBegin() const
Returns the begin of the internal vehicle map.
MSVehicleControl & getVehicleControl()
Returns the vehicle control.
Representation of a vehicle in the micro simulation.