 |
Eclipse SUMO - Simulation of Urban MObility
|
Go to the documentation of this file.
55 if (!oc.
isSet(
"robocup-dir")) {
62 for (std::vector<std::string>::const_iterator file = files.begin(); file != files.end(); ++file) {
64 std::string nodesName = (*file) +
"/node.bin";
66 WRITE_ERROR(
"Could not open robocup-node-file '" + nodesName +
"'.");
70 handler.loadNodes(nodesName);
73 std::string edgesName = (*file) +
"/road.bin";
75 WRITE_ERROR(
"Could not open robocup-road-file '" + edgesName +
"'.");
79 handler.loadEdges(edgesName);
90 : myNodeCont(nc), myEdgeCont(ec) {}
110 int entrySize, id, posX, posY, numEdges;
118 std::vector<int> edges;
119 for (
int j = 0; j < numEdges; ++j) {
122 edges.push_back(edge);
128 std::vector<int> turns;
129 for (
int j = 0; j < numEdges; ++j) {
132 turns.push_back(turn);
135 std::vector<std::pair<int, int> > conns;
136 for (
int j = 0; j < numEdges; ++j) {
140 conns.push_back(std::pair<int, int>(connF, connT));
143 std::vector<std::vector<int> > times;
144 for (
int j = 0; j < numEdges; ++j) {
149 std::vector<int> time;
153 times.push_back(time);
156 Position pos((
double)(posX / 1000.), -(
double)(posY / 1000.));
161 }
while (noNodes != 0);
175 std::cout <<
"Expected edge number: " << noEdges << std::endl;
177 std::cout <<
" left " << (noEdges) << std::endl;
178 int entrySize, id, begNode, endNode, length, roadKind, carsToHead,
179 carsToTail, humansToHead, humansToTail, width, block, repairCost, median,
180 linesToHead, linesToTail, widthForWalkers;
181 dev >> entrySize >>
id >> begNode >> endNode >> length >> roadKind >> carsToHead
182 >> carsToTail >> humansToHead >> humansToTail >> width >> block >> repairCost
183 >> median >> linesToHead >> linesToTail >> widthForWalkers;
186 double speed = (double)(50. / 3.6);
189 if (linesToHead > 0) {
190 NBEdge* edge =
new NBEdge(
toString(
id), fromNode, toNode,
"", speed, linesToHead, priority,
NBEdge::UNSPECIFIED_WIDTH,
NBEdge::UNSPECIFIED_OFFSET,
"", spread);
195 if (linesToTail > 0) {
196 NBEdge* edge =
new NBEdge(
"-" +
toString(
id), toNode, fromNode,
"", speed, linesToTail, priority,
NBEdge::UNSPECIFIED_WIDTH,
NBEdge::UNSPECIFIED_OFFSET,
"", spread);
202 }
while (noEdges != 0);
bool isSet(const std::string &name, bool failOnNonExistant=true) const
Returns the information whether the named option is set.
static const double UNSPECIFIED_OFFSET
unspecified lane offset
Storage for edges, including some functionality operating on multiple edges.
Instance responsible for building networks.
bool insert(const std::string &id, const Position &position, NBDistrict *district=0)
Inserts a node into the map.
NBEdgeCont & myEdgeCont
The edge container to fill.
static bool transformCoordinate(Position &from, bool includeInBoundary=true, GeoConvHelper *from_srs=0)
transforms loaded coordinates handles projections, offsets (using GeoConvHelper) and import of height...
bool insert(NBEdge *edge, bool ignorePrunning=false)
Adds an edge to the dictionary.
Container for nodes during the netbuilding process.
NBEdgeCont & getEdgeCont()
The representation of a single edge during network building.
const StringVector & getStringVector(const std::string &name) const
Returns the list of string-value of the named option (only for Option_StringVector)
void loadNodes(const std::string &file)
Loads nodes from the given file.
static void loadNetwork(const OptionsCont &oc, NBNetBuilder &nb)
Loads content of the optionally given RoboCup Rescue League files.
A point in 2D or 3D with translation and scaling methods.
A storage for options typed value containers)
~NIImporter_RobocupRescue()
Destructor.
NBNodeCont & myNodeCont
The node container to fill.
NIImporter_RobocupRescue(NBNodeCont &nc, NBEdgeCont &ec)
Constructor.
NBNode * retrieve(const std::string &id) const
Returns the node with the given name.
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
#define PROGRESS_BEGIN_MESSAGE(msg)
#define PROGRESS_DONE_MESSAGE()
static const double UNSPECIFIED_WIDTH
unspecified lane width
LaneSpreadFunction
Numbers representing special SUMO-XML-attribute values Information how the edge's lateral offset shal...
static bool isReadable(std::string path)
Checks whether the given file is readable.
void loadEdges(const std::string &file)
Loads edges from the given file.
Represents a single node (junction) during network building.
NBNodeCont & getNodeCont()
Returns a reference to the node container.
Importer for networks stored in robocup rescue league format.
#define WRITE_MESSAGE(msg)