53 #ifdef CHECK_MEMORY_LEAKS 55 #endif // CHECK_MEMORY_LEAKS 67 if (!oc.
isSet(
"robocup-dir")) {
74 for (std::vector<std::string>::const_iterator file = files.begin(); file != files.end(); ++file) {
76 std::string nodesName = (*file) +
"/node.bin";
78 WRITE_ERROR(
"Could not open robocup-node-file '" + nodesName +
"'.");
82 handler.loadNodes(nodesName);
85 std::string edgesName = (*file) +
"/road.bin";
87 WRITE_ERROR(
"Could not open robocup-road-file '" + edgesName +
"'.");
91 handler.loadEdges(edgesName);
122 int entrySize, id, posX, posY, numEdges;
130 std::vector<int> edges;
131 for (
int j = 0; j < numEdges; ++j) {
134 edges.push_back(edge);
140 std::vector<int> turns;
141 for (
int j = 0; j < numEdges; ++j) {
144 turns.push_back(turn);
147 std::vector<std::pair<int, int> > conns;
148 for (
int j = 0; j < numEdges; ++j) {
152 conns.push_back(std::pair<int, int>(connF, connT));
155 std::vector<std::vector<int> > times;
156 for (
int j = 0; j < numEdges; ++j) {
161 std::vector<int> time;
165 times.push_back(time);
173 }
while (noNodes != 0);
187 std::cout <<
"Expected edge number: " << noEdges << std::endl;
189 std::cout <<
" left " << (noEdges) << std::endl;
190 int entrySize, id, begNode, endNode, length, roadKind, carsToHead,
191 carsToTail, humansToHead, humansToTail, width, block, repairCost, median,
192 linesToHead, linesToTail, widthForWalkers;
193 dev >> entrySize >>
id >> begNode >> endNode >> length >> roadKind >> carsToHead
194 >> carsToTail >> humansToHead >> humansToTail >> width >> block >> repairCost
195 >> median >> linesToHead >> linesToTail >> widthForWalkers;
201 if (linesToHead > 0) {
202 NBEdge* edge =
new NBEdge(
toString(
id), fromNode, toNode,
"", speed, linesToHead, priority,
NBEdge::UNSPECIFIED_WIDTH,
NBEdge::UNSPECIFIED_OFFSET,
"", spread);
207 if (linesToTail > 0) {
208 NBEdge* edge =
new NBEdge(
"-" +
toString(
id), toNode, fromNode,
"", speed, linesToTail, priority,
NBEdge::UNSPECIFIED_WIDTH,
NBEdge::UNSPECIFIED_OFFSET,
"", spread);
214 }
while (noEdges != 0);
NBNode * retrieve(const std::string &id) const
Returns the node with the given name.
static const SUMOReal UNSPECIFIED_WIDTH
unspecified lane width
static bool transformCoordinates(Position &from, bool includeInBoundary=true, GeoConvHelper *from_srs=0)
transforms loaded coordinates handles projections, offsets (using GeoConvHelper) and import of height...
static bool isReadable(std::string path)
Checks whether the given file is readable.
Importer for networks stored in robocup rescue league format.
NIImporter_RobocupRescue(NBNodeCont &nc, NBEdgeCont &ec)
Constructor.
The representation of a single edge during network building.
~NIImporter_RobocupRescue()
Destructor.
static const SUMOReal UNSPECIFIED_OFFSET
unspecified lane offset
NBEdgeCont & myEdgeCont
The edge container to fill.
bool isSet(const std::string &name, bool failOnNonExistant=true) const
Returns the information whether the named option is set.
bool insert(NBEdge *edge, bool ignorePrunning=false)
Adds an edge to the dictionary.
A point in 2D or 3D with translation and scaling methods.
NBEdgeCont & getEdgeCont()
Returns the edge container.
static void loadNetwork(const OptionsCont &oc, NBNetBuilder &nb)
Loads content of the optionally given RoboCup Rescue League files.
void loadNodes(const std::string &file)
Loads nodes from the given file.
Storage for edges, including some functionality operating on multiple edges.
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) ...
#define PROGRESS_BEGIN_MESSAGE(msg)
std::string toString(const T &t, std::streamsize accuracy=OUTPUT_ACCURACY)
NBNodeCont & getNodeCont()
Returns the node container.
Instance responsible for building networks.
A storage for options typed value containers)
bool insert(const std::string &id, const Position &position, NBDistrict *district=0)
Inserts a node into the map.
LaneSpreadFunction
Numbers representing special SUMO-XML-attribute values Information how the edge's lateral offset shal...
NBNodeCont & myNodeCont
The node container to fill.
Represents a single node (junction) during network building.
Container for nodes during the netbuilding process.
#define PROGRESS_DONE_MESSAGE()
void loadEdges(const std::string &file)
Loads edges from the given file.
#define WRITE_MESSAGE(msg)