60 #ifdef CHECK_MEMORY_LEAKS
62 #endif // CHECK_MEMORY_LEAKS
71 oc.
addCallExample(
"-c <CONFIGURATION>",
"create net from given configuration");
72 oc.
addCallExample(
"--grid [grid-network options] -o <OUTPUTFILE>",
"create grid net");
73 oc.
addCallExample(
"--spider [spider-network options] -o <OUTPUTFILE>",
"create spider net");
74 oc.
addCallExample(
"--rand [random-network options] -o <OUTPUTFILE>",
"create random net");
76 oc.
setAdditionalHelpMessage(
" Either \"--grid\", \"--spider\" or \"--rand\" must be supplied.\n In dependance to these switches other options are used.");
96 oc.
addSynonyme(
"default-junction-type",
"junctions");
97 oc.
addDescription(
"default-junction-type",
"Building Defaults",
"[traffic_light|priority|right_before_left] Determines the type of the build junctions");
117 bool hadError =
false;
118 if (oc.
getInt(
"spider.arm-number") < 3) {
119 WRITE_ERROR(
"Spider networks need at least 3 arms.");
122 if (oc.
getInt(
"spider.circle-number") < 1) {
123 WRITE_ERROR(
"Spider networks need at least one circle.");
126 if (oc.
getFloat(
"spider.space-radius") < 10) {
127 WRITE_ERROR(
"The radius of spider networks must be at least 10m.");
136 oc.
getFloat(
"spider.space-radius"), !oc.
getBool(
"spider.omit-center"));
142 int xNo = oc.
getInt(
"grid.x-number");
143 int yNo = oc.
getInt(
"grid.y-number");
148 xNo = oc.
getInt(
"grid.number");
151 yNo = oc.
getInt(
"grid.number");
154 xLength = oc.
getFloat(
"grid.length");
157 yLength = oc.
getFloat(
"grid.length");
160 bool hadError =
false;
161 if (xNo < 2 || yNo < 2) {
162 WRITE_ERROR(
"The number of nodes must be at least 2 in both directions.");
165 if (xLength < 10. || yLength < 10.) {
166 WRITE_ERROR(
"The distance between nodes must be at least 10m in both directions.");
169 if (attachLength != 0.0 && attachLength < 10.) {
170 WRITE_ERROR(
"The length of attached streets must be at least 10m.");
183 neighborDist.
add(1, oc.
getFloat(
"rand.neighbor-dist1"));
184 neighborDist.
add(2, oc.
getFloat(
"rand.neighbor-dist2"));
185 neighborDist.
add(3, oc.
getFloat(
"rand.neighbor-dist3"));
186 neighborDist.
add(4, oc.
getFloat(
"rand.neighbor-dist4"));
187 neighborDist.
add(5, oc.
getFloat(
"rand.neighbor-dist5"));
188 neighborDist.
add(6, oc.
getFloat(
"rand.neighbor-dist6"));
195 oc.
getInt(
"rand.num-tries"),
244 if (std::string(e.what()) != std::string(
"Process Error") && std::string(e.what()) != std::string(
"")) {
250 }
catch (
const std::exception& e) {
251 if (std::string(e.what()) != std::string(
"")) {
263 std::cout <<
"Success." << std::endl;