Commits

Anonymous committed ee3efcf

added the --nofullroutes commandline parameter.

  • Participants
  • Parent commits 045c047

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),