2424import hso .autonomy .util .commandline .Argument ;
2525import hso .autonomy .util .commandline .EnumArgument ;
2626import hso .autonomy .util .commandline .HelpArgument ;
27+ import hso .autonomy .util .commandline .IntegerArgument ;
2728import hso .autonomy .util .commandline .StringArgument ;
2829import java .awt .event .ActionEvent ;
2930import java .awt .event .ActionListener ;
@@ -68,6 +69,8 @@ public static void run(String[] args, UserInterface userInterface)
6869 StringArgument defaultPathArgument =
6970 new StringArgument ("defaultPath" , "examples" , "the initial path to use for file dialogs" );
7071
72+ IntegerArgument defaultRandomSeed = new IntegerArgument ("randomSeed" , (int ) BenchmarkConfiguration .DEFAULT_RANDOM_SEED , 0 , "the random seed to use" );
73+
7174 new HelpArgument (challengeArgument , startScriptFolderArgument , roboVizServerArgument , defaultPathArgument )
7275 .parse (args );
7376
@@ -80,15 +83,16 @@ public static void run(String[] args, UserInterface userInterface)
8083 String startScriptFolder = startScriptFolderArgument .parse (args );
8184 String roboVizServer = roboVizServerArgument .parse (args );
8285 String defaultPath = defaultPathArgument .parse (args );
86+ int randomSeed = defaultRandomSeed .parse (args );
8387 Argument .endParse (args );
8488
8589 defaultPath = defaultPath .replaceFirst ("^~" , System .getProperty ("user.home" ));
8690
87- new BenchmarkController (userInterface , challenge , startScriptFolder , roboVizServer , defaultPath );
91+ new BenchmarkController (userInterface , challenge , startScriptFolder , roboVizServer , defaultPath , randomSeed );
8892 }
8993
9094 public BenchmarkController (UserInterface userInterface , ChallengeType challenge , String startScriptFolder ,
91- String roboVizServer , String defaultPath )
95+ String roboVizServer , String defaultPath , int randomSeed )
9296 {
9397 this .startScriptFolder = startScriptFolder ;
9498 this .roboVizServer = roboVizServer ;
@@ -97,7 +101,8 @@ public BenchmarkController(UserInterface userInterface, ChallengeType challenge,
97101
98102 switch (userInterface ) {
99103 case CLI :
100- model .start (new BenchmarkConfiguration (roboVizServer ),
104+ System .out .println ("Using random seed: " + randomSeed );
105+ model .start (new BenchmarkConfiguration (roboVizServer , randomSeed ),
101106 Collections .singletonList (new TeamConfiguration ("magma" , startScriptFolder , 0.4f )));
102107 break ;
103108 case GUI :
0 commit comments