62 if (!oc.
isSet(
"robocup-dir")) {
69 for (std::vector<std::string>::const_iterator file = files.begin(); file != files.end(); ++file) {
71 std::string nodesName = (*file) +
"/node.bin";
73 WRITE_ERROR(
"Could not open robocup-node-file '" + nodesName +
"'.");
77 handler.loadNodes(nodesName);
80 std::string edgesName = (*file) +
"/road.bin";
82 WRITE_ERROR(
"Could not open robocup-road-file '" + edgesName +
"'.");
86 handler.loadEdges(edgesName);
117 int entrySize, id, posX, posY, numEdges;
125 std::vector<int> edges;
126 for (
int j = 0; j < numEdges; ++j) {
129 edges.push_back(edge);
135 std::vector<int> turns;
136 for (
int j = 0; j < numEdges; ++j) {
139 turns.push_back(turn);
142 std::vector<std::pair<int, int> > conns;
143 for (
int j = 0; j < numEdges; ++j) {
147 conns.push_back(std::pair<int, int>(connF, connT));
150 std::vector<std::vector<int> > times;
151 for (
int j = 0; j < numEdges; ++j) {
156 std::vector<int> time;
160 times.push_back(time);
163 Position pos((
double)(posX / 1000.), -(
double)(posY / 1000.));
168 }
while (noNodes != 0);
182 std::cout <<
"Expected edge number: " << noEdges << std::endl;
184 std::cout <<
" left " << (noEdges) << std::endl;
185 int entrySize, id, begNode, endNode, length, roadKind, carsToHead,
186 carsToTail, humansToHead, humansToTail, width, block, repairCost, median,
187 linesToHead, linesToTail, widthForWalkers;
188 dev >> entrySize >>
id >> begNode >> endNode >> length >> roadKind >> carsToHead
189 >> carsToTail >> humansToHead >> humansToTail >> width >> block >> repairCost
190 >> median >> linesToHead >> linesToTail >> widthForWalkers;
193 double speed = (double)(50. / 3.6);
196 if (linesToHead > 0) {
197 NBEdge* edge =
new NBEdge(
toString(
id), fromNode, toNode,
"", speed, linesToHead, priority,
NBEdge::UNSPECIFIED_WIDTH,
NBEdge::UNSPECIFIED_OFFSET,
"", spread);
202 if (linesToTail > 0) {
203 NBEdge* edge =
new NBEdge(
"-" +
toString(
id), toNode, fromNode,
"", speed, linesToTail, priority,
NBEdge::UNSPECIFIED_WIDTH,
NBEdge::UNSPECIFIED_OFFSET,
"", spread);
209 }
while (noEdges != 0);
NBNode * retrieve(const std::string &id) const
Returns the node with the given name.
static bool transformCoordinate(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.
static const double UNSPECIFIED_OFFSET
unspecified lane offset
~NIImporter_RobocupRescue()
Destructor.
static const double UNSPECIFIED_WIDTH
unspecified lane width
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.
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
A point in 2D or 3D with translation and scaling methods.
NBEdgeCont & getEdgeCont()
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)
NBNodeCont & getNodeCont()
Returns a reference to 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)