Commits

Anonymous committed ee3efcf

added the --nofullroutes commandline parameter.

Comments (0)

Files changed (1)

     parser.add_argument("--maxhtl", help="The maximum length of routes to be successful.", default=20, type=int)
     parser.add_argument("--steps", help="The maximum number of modelsteps.", default=60, type=int)
     parser.add_argument("--perstep", help="The number of requests to run per step.", default=100, type=int)
+    parser.add_argument("--nofullroutes", help="Don’t calculate full routes but break at maxhtl. This gives weaker statistics but is much faster for random networks with very long routes and very low success rate", action="store_true", default=False, type=bool)
     parser.add_argument("-o", "--output", help="Filename of the pylab plot.", default="plot.png")
     return parser.parse_args()
 
         linklens = linklengths(net)
         print (np.mean(linklens), np.mean(routelengths), "±", np.std(routelengths), "succ", len([r for r in routelengths if r < args.maxhtl])/len(routelengths), min(routelengths), max(routelengths), sum(deviationfromsmallworld(linklens, numbins=10)))
         for i in range(args.steps):
-            routelengths = fold(net, foldperstep, args.strategy, args.maxhtl)
+            routelengths = fold(net, foldperstep, args.strategy, args.maxhtl, fullroutes=not args.nofullroutes)
             linklens = linklengths(net)
             lensnapshots[(run, i+1)] = linklens, routelengths
             print (np.mean(linklens), np.mean(routelengths), "±", np.std(routelengths), "succ", len([r for r in routelengths if r < args.maxhtl])/len(routelengths),
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.