._site

(Arne Babenhauserheide)
2012-07-27: allow selecting the starting_configs to be calculated. tip

allow selecting the starting_configs to be calculated.

diff --git a/sim.py b/sim.py
--- a/sim.py
+++ b/sim.py
@@ -491,6 +491,7 @@ def parse_args():
     from argparse import ArgumentParser
     parser = ArgumentParser(description="Simulate Freenet network optimization.")
     parser.add_argument("--strategy", help="The optimization strategy: switch switchalways switchonesided jump  jumphalf jumpgolden jumpgoldensmall connect connectsimple replacebest replacelongest", default="jumphalf")
+    parser.add_argument("--starting-config", help="The starting configurations: flat or ideal. Take two by seperating them with a comma", default="ideal,flat")
     parser.add_argument("--size", help="The size of the network.", default=1000, type=int)
     parser.add_argument("--connections", help="The mean number of connections per node.", default=20, type=int)
     parser.add_argument("--maxhtl", help="The maximum length of routes to be successful.", default=20, type=int)
@@ -505,7 +506,7 @@ if __name__ == "__main__":
     nodes = randomnodes(args.size)
     lensnapshots = {}
     foldperstep = args.perstep
-    runs = ["ideal", "flat"]
+    runs = args.starting_config.split(",")
     for run in runs:
         if run == "ideal": 
             net = generatesmallworldunclean(nodes, args.connections)