Beispiel #1
0
 /// <summary>
 /// Halt current simulation.
 /// Load the next simulation in batch, or
 ///  change state to State.end if at the end of batch.
 /// </summary>
 public static void NextSimulation()
 {
     // stop current simulation
     if (state == State.simulating)
     {
         Halt(StopCode.Unspecified);
     }
     // next in batch
     simulationNumber++;
     if (simulationNumber > batch.Count)
     {
         // end of batch
         Halt(StopCode.Unspecified);
         End();
         return;
     }
     Debug.Log("Simulation NextSimulation: " + simulationNumber + " of " + batch.Count);
     // load simulation settings
     settings = batch[simulationNumber - 1];
     Log.Settings();
     // load environment
     EnvLoader.SearchForEnvironments();
     environment = EnvLoader.LoadEnvironment(settings.environmentName);
     destination.transform.position = RandomInBounds(Instance.bounds);
     // load robot
     if (robot)
     {
         CamController.RemoveAreaOfInterest(robot);
     }
     BotLoader.SearchForRobots();
     robot            = BotLoader.LoadRobot(settings.robotName);
     robot.navigation = NavLoader.LoadPlugin(settings.navigationAssemblyName);
     // configure camera
     CamController.AddAreaOfInterest(robot);
     CamController.SetViewMode(CamController.ViewMode.Birdseye);
     CamController.SetAreaOfInterest(robot);
     // reset test number
     testNumber = 0;
     NextTest();
 }
Beispiel #2
0
 /// <summary>
 /// Removes the path.
 /// </summary>
 /// <param name="path">Path.</param>
 public static void RemovePath(BotPath path)
 {
     paths.Remove(path);
     CamController.RemoveAreaOfInterest(path);
 }