BotNavSim  v0.4.3
Mobile Robot Simulation
Simulation Class Reference

This is a manager class used to overlook the running of a simulation. More...

Inheritance diagram for Simulation:
Collaboration diagram for Simulation:

Classes

class  Observer
 
class  Settings
 

Public Types

enum  State {
  State.inactive, State.starting, State.simulating, State.stopped,
  State.end
}
 
enum  StopCode {
  StopCode.Unspecified, StopCode.UserRequestNextTest, StopCode.RobotReachedDestination, StopCode.MaxTimeExceeded,
  StopCode.RobotIsStuck
}
 

Static Public Member Functions

static void Enter ()
 Enter this instance. More...
 
static void Begin ()
 Begin simulating. More...
 
static void NextSimulation ()
 Halt current simulation. Load the next simulation in batch, or change state to State.end if at the end of batch. More...
 
static void NextTest ()
 Stops the current test and starts the next test in current simulation. More...
 
static void Run ()
 Run the simulation. More...
 
static void Pause ()
 Pause the simulation. More...
 
static void Halt (StopCode code)
 Halt simulation and write log to file. More...
 
static void End ()
 Stop all simulations. More...
 
static void Exit ()
 Exit simulation. More...
 
static Vector3 RandomInBounds (Bounds b)
 Return a random position inside the bounds, but not inside any physical objects. More...
 

Static Public Attributes

static Simulation Instance
 Reference to the MonoBebehaviour instance More...
 
static bool exhibitionMode
 Exhibition mode will run continually and randomly choose camera perspectives and simulation settings. More...
 
static List< Settingsbatch = new List<Settings>()
 List of settings to iterate through in batch mode. More...
 
static bool loggingEnabled = true
 If true, simulation will be logged to a file via Log class. More...
 

Properties

static State state [get, private set]
 Gets the simulation state. More...
 
static Settings settings [get, set]
 Gets or sets the settings for the current simulation. More...
 
static int simulationNumber [get, private set]
 Gets the simulation number (index in batch list, 1 to batch.Count). More...
 
static int testNumber [get, private set]
 Gets the current test number (1 to settings.numberOfTests). More...
 
static Robot robot [get, private set]
 Gets reference to the robot in the current simulation. More...
 
static GameObject environment [get, set]
 Gets or sets reference to the environment in the current simulation. More...
 
static GameObject destination [get, private set]
 Gets reference to the destination. More...
 
static IObservable testArea [get, private set]
 Gets the test area (Observer object) More...
 
static bool isInactive [get]
 Gets a value indicating whether this Simulation has not yet started. More...
 
static bool isRunning [get]
 Gets a value indicating whether this Simulation is running. More...
 
static bool isStopped [get]
 Gets a value indicating whether this Simulation is stopped. More...
 
static bool isFinished [get]
 Gets a value indicating whether this Simulation is finished. More...
 
static bool paused [get, set]
 Gets or sets a value indicating whether this Simulation is paused. More...
 
static float time [get]
 Time (in seconds) since robot started searching for destination. More...
 
static float timeScale [get, set]
 Gets or sets the time scale. More...
 
Bounds bounds [get, private set]
 The simulation bounds described as a cube. This is the search space indicated to INavigation. More...
 

Private Member Functions

void Awake ()
 
void Start ()
 Called on the first frame More...
 
void Update ()
 Update this instance (called every rendered frame) More...
 
void OnDrawGizmos ()
 Raises the draw gizmos event. More...
 
void OnApplicationQuit ()
 called before application shuts down More...
 

Static Private Member Functions

static Simulation ()
 Initializes the Simulation class. More...
 
static IEnumerator StartTestRoutine ()
 Routine for starting a new test More...
 
static void PlaceRobotInStartArea ()
 Places the robot in start area. More...
 
static void PlaceDestination ()
 Places the destination. More...
 
static void SetBounds ()
 

Static Private Attributes

static float _startTime
 
static float _stopTime
 
static Settings _settings
 
static Robot _robot
 
static Environment _environment
 
static bool _paused
 
static float _timeScale = 1f
 

Detailed Description

This is a manager class used to overlook the running of a simulation.

Definition at line 8 of file Simulation.cs.

Member Enumeration Documentation

Enumerator
inactive 

BotNavSim is not simulating.

starting 

Simulation is about to start.

simulating 

Simulation is running.

stopped 

Simulation is stopped.

end 

Simulation has reached the end of the batch.

Definition at line 10 of file Simulation.cs.

10  {
14  inactive,
15 
19  starting,
20 
24  simulating,
25 
29  stopped,
30 
34  end
35  }
Simulation is stopped.
BotNavSim is not simulating.
Simulation has reached the end of the batch.
Simulation is about to start.
Simulation is running.
Enumerator
Unspecified 

Reason for simulation stopping is not given.

UserRequestNextTest 

Simulation stopped because user requested next test.

RobotReachedDestination 

Simulation stopped because the robot reached the destination.

MaxTimeExceeded 

Simulation stopped because the maximum test time was exceeded.

RobotIsStuck 

Simulation stopped because the robot appears to be stuck. i.e. the robot position has not changed for some time.

Definition at line 37 of file Simulation.cs.

37  {
42 
47 
52 
57 
63  }
Simulation stopped because the maximum test time was exceeded.
Simulation stopped because the robot reached the destination.
Simulation stopped because the robot appears to be stuck. i.e. the robot position has not changed for...
Simulation stopped because user requested next test.
Reason for simulation stopping is not given.

Constructor & Destructor Documentation

static Simulation.Simulation ( )
staticprivate

Initializes the Simulation class.

Definition at line 215 of file Simulation.cs.

215  {
216  testArea = new Observer();
217  }
static IObservable testArea
Gets the test area (Observer object)
Definition: Simulation.cs:309

Member Function Documentation

void Simulation.Awake ( )
private

Definition at line 643 of file Simulation.cs.

643  {
644  // singleton pattern (can only be one Instance of Simulation)
645  if (Instance) {
646  Destroy(this.gameObject);
647  }
648  else {
649  Instance = this;
650  }
651  _settings = new Settings();
652  }
static Simulation Instance
Reference to the MonoBebehaviour instance
Definition: Simulation.cs:222
static Settings _settings
Definition: Simulation.cs:390
static void Simulation.Begin ( )
static

Begin simulating.

Definition at line 412 of file Simulation.cs.

412  {
413  Debug.Log("Simulation Begin");
414  simulationNumber = 0;
415  NextSimulation();
416  }
static int simulationNumber
Gets the simulation number (index in batch list, 1 to batch.Count).
Definition: Simulation.cs:259
static void NextSimulation()
Halt current simulation. Load the next simulation in batch, or change state to State.end if at the end of batch.
Definition: Simulation.cs:423

Here is the call graph for this function:

Here is the caller graph for this function:

static void Simulation.End ( )
static

Stop all simulations.

Definition at line 516 of file Simulation.cs.

516  {
517  Debug.Log("Simulation End.");
518  settings.active = false;
519  state = State.end;
520 
521  // in exhibition mode, run more simulations with random settings
522  if (exhibitionMode) {
523  if (batch.Count > 10) {
524  batch.RemoveAt(0);
525  }
526  settings = new Settings();
528  batch.Add(settings);
529  Begin();
530  }
531  }
static List< Settings > batch
List of settings to iterate through in batch mode.
Definition: Simulation.cs:254
static State state
Gets the simulation state.
Definition: Simulation.cs:230
void Randomize()
Randomly select simulation parameters.
Definition: Simulation.cs:175
static Settings settings
Gets or sets the settings for the current simulation.
Definition: Simulation.cs:241
static bool exhibitionMode
Exhibition mode will run continually and randomly choose camera perspectives and simulation settings...
Definition: Simulation.cs:236
bool active
Gets or sets a value indicating whether this Simulation.Settings is active and determines which prope...
Definition: Simulation.cs:143
static void Begin()
Begin simulating.
Definition: Simulation.cs:412

Here is the call graph for this function:

Here is the caller graph for this function:

static void Simulation.Enter ( )
static

Enter this instance.

Definition at line 401 of file Simulation.cs.

401  {
407  }
static void AddViewMode(ViewMode mode)
Adds a ViewMode to viewModeList.
static void AddAreaOfInterest(IObservable area)
Adds an area of interest to the list of areas for the camera to observe.
static IObservable testArea
Gets the test area (Observer object)
Definition: Simulation.cs:309
Controls the camera orientation and render modes according to ViewMode in viewModeList user input...

Here is the call graph for this function:

Here is the caller graph for this function:

static void Simulation.Exit ( )
static

Exit simulation.

Definition at line 536 of file Simulation.cs.

536  {
537  Debug.Log("Simulation Exit.");
538  Instance.StopAllCoroutines();
539  settings = null;
540  if (Log.logging) Log.Stop(StopCode.Unspecified);
541  if (robot) robot.Recycle();
542  if (environment) environment.transform.Recycle();
545  state = State.inactive;
546  }
static State state
Gets the simulation state.
Definition: Simulation.cs:230
static Simulation Instance
Reference to the MonoBebehaviour instance
Definition: Simulation.cs:222
static Settings settings
Gets or sets the settings for the current simulation.
Definition: Simulation.cs:241
static Robot robot
Gets reference to the robot in the current simulation.
Definition: Simulation.cs:273
static GameObject environment
Gets or sets reference to the environment in the current simulation.
Definition: Simulation.cs:286
Controls the camera orientation and render modes according to ViewMode in viewModeList user input...
static bool logging
Gets a value indicating whether this Log is logging.
Definition: Log.cs:64
Provides data logging capabilities. Data is logged in CSV format.
Definition: Log.cs:10
static void Stop(Simulation.StopCode stopcode)
Stop logging with Simulation.Stopcode and write log to CSV file.
Definition: Log.cs:161
static void ClearViewModeList()
Clears the view mode list.
static void ClearAreaList()
Clears the area list.

Here is the call graph for this function:

Here is the caller graph for this function:

static void Simulation.Halt ( StopCode  code)
static

Halt simulation and write log to file.

Parameters
codeReason for halt.

Definition at line 497 of file Simulation.cs.

497  {
498  Debug.Log("Simulation Halt! " + code.ToString());
499  // stop logging
500  if (Log.logging) Log.Stop(code);
501 
502  // freeze the robot
503  if (robot) {
504  robot.rigidbody.velocity = Vector3.zero;
505  robot.rigidbody.angularVelocity = Vector3.zero;
506  robot.moveEnabled = false;
507  }
508  // set simulation state
509  state = State.stopped;
510  }
static State state
Gets the simulation state.
Definition: Simulation.cs:230
static Robot robot
Gets reference to the robot in the current simulation.
Definition: Simulation.cs:273
bool moveEnabled
A flag indicating whether the robot should try moving.
Definition: Robot.cs:29
static bool logging
Gets a value indicating whether this Log is logging.
Definition: Log.cs:64
Provides data logging capabilities. Data is logged in CSV format.
Definition: Log.cs:10
static void Stop(Simulation.StopCode stopcode)
Stop logging with Simulation.Stopcode and write log to CSV file.
Definition: Log.cs:161

Here is the call graph for this function:

Here is the caller graph for this function:

static void Simulation.NextSimulation ( )
static

Halt current simulation. Load the next simulation in batch, or change state to State.end if at the end of batch.

Definition at line 423 of file Simulation.cs.

423  {
424  // stop current simulation
425  if (state == State.simulating) {
426  Halt(StopCode.Unspecified);
427  }
428  // next in batch
430  if (simulationNumber > batch.Count) {
431  // end of batch
432  Halt(StopCode.Unspecified);
433  End();
434  return;
435  }
436  Debug.Log("Simulation NextSimulation: " + simulationNumber + " of " + batch.Count);
437  // load simulation settings
439  Log.Settings();
440  // load environment
443  destination.transform.position = RandomInBounds(Instance.bounds);
444  // load robot
449  // configure camera
453  // reset test number
454  testNumber = 0;
455  NextTest();
456  }
static List< Settings > batch
List of settings to iterate through in batch mode.
Definition: Simulation.cs:254
static void NextTest()
Stops the current test and starts the next test in current simulation.
Definition: Simulation.cs:461
static State state
Gets the simulation state.
Definition: Simulation.cs:230
string navigationAssemblyName
The filename of the navigation assembly to load.
Definition: Simulation.cs:89
static int simulationNumber
Gets the simulation number (index in batch list, 1 to batch.Count).
Definition: Simulation.cs:259
string robotName
The filename of the robot to load.
Definition: Simulation.cs:93
static void Settings()
Serialize the current simulation settings and write to XML file.
Definition: Log.cs:146
static Simulation Instance
Reference to the MonoBebehaviour instance
Definition: Simulation.cs:222
static void End()
Stop all simulations.
Definition: Simulation.cs:516
Environment loader searches for and loads environment GameObjects from the Unity Resources folder...
Definition: EnvLoader.cs:9
static void SetAreaOfInterest(int index)
Sets the area of interest by index.
static GameObject LoadEnvironment(string name)
Loads the environment.
Definition: EnvLoader.cs:29
static Settings settings
Gets or sets the settings for the current simulation.
Definition: Simulation.cs:241
static Robot robot
Gets reference to the robot in the current simulation.
Definition: Simulation.cs:273
static void AddAreaOfInterest(IObservable area)
Adds an area of interest to the list of areas for the camera to observe.
static GameObject destination
Gets reference to the destination.
Definition: Simulation.cs:302
Bounds bounds
The simulation bounds described as a cube. This is the search space indicated to INavigation.
Definition: Simulation.cs:637
string environmentName
The filename of the environment to load.
Definition: Simulation.cs:85
static void SetViewMode(ViewMode mode)
Sets the view mode.
Bot loader provides functions for finding and loading robots.
Definition: BotLoader.cs:8
INavigation navigation
Interface to the navigation assembly.
Definition: Robot.cs:67
static void Halt(StopCode code)
Halt simulation and write log to file.
Definition: Simulation.cs:497
static GameObject environment
Gets or sets reference to the environment in the current simulation.
Definition: Simulation.cs:286
static int testNumber
Gets the current test number (1 to settings.numberOfTests).
Definition: Simulation.cs:266
Controls the camera orientation and render modes according to ViewMode in viewModeList user input...
static void SearchForRobots()
Searchs for robots.
Definition: BotLoader.cs:19
static Vector3 RandomInBounds(Bounds b)
Return a random position inside the bounds, but not inside any physical objects.
Definition: Simulation.cs:553
static Robot LoadRobot(int index)
Load a robot by index in robotsFound list.
Definition: BotLoader.cs:34
static void RemoveAreaOfInterest(IObservable area)
Removes an area of interest from the list of areas for the camera to observe.
static INavigation LoadPlugin(string name)
Instantiate the INavigation assembly from a given filename (not filepath).
Definition: NavLoader.cs:35
Provides data logging capabilities. Data is logged in CSV format.
Definition: Log.cs:10
static void SearchForEnvironments()
Searchs for environments.
Definition: EnvLoader.cs:16
Used to find and load INavigation implementations from .dll files.
Definition: NavLoader.cs:10

Here is the call graph for this function:

Here is the caller graph for this function:

static void Simulation.NextTest ( )
static

Stops the current test and starts the next test in current simulation.

Definition at line 461 of file Simulation.cs.

461  {
463  Halt(StopCode.Unspecified);
464  NextSimulation();
465  return;
466  }
467  // start test routine
468  if (state != State.starting) Instance.StartCoroutine(StartTestRoutine());
469  }
int numberOfTests
The number of repeat tests with these parameters.
Definition: Simulation.cs:78
static State state
Gets the simulation state.
Definition: Simulation.cs:230
static IEnumerator StartTestRoutine()
Routine for starting a new test
Definition: Simulation.cs:570
static Simulation Instance
Reference to the MonoBebehaviour instance
Definition: Simulation.cs:222
static Settings settings
Gets or sets the settings for the current simulation.
Definition: Simulation.cs:241
static void Halt(StopCode code)
Halt simulation and write log to file.
Definition: Simulation.cs:497
static int testNumber
Gets the current test number (1 to settings.numberOfTests).
Definition: Simulation.cs:266
static void NextSimulation()
Halt current simulation. Load the next simulation in batch, or change state to State.end if at the end of batch.
Definition: Simulation.cs:423

Here is the call graph for this function:

Here is the caller graph for this function:

void Simulation.OnApplicationQuit ( )
private

called before application shuts down

Definition at line 696 of file Simulation.cs.

696  {
697  Log.Stop(StopCode.Unspecified);
698  }
Provides data logging capabilities. Data is logged in CSV format.
Definition: Log.cs:10
static void Stop(Simulation.StopCode stopcode)
Stop logging with Simulation.Stopcode and write log to CSV file.
Definition: Log.cs:161

Here is the call graph for this function:

void Simulation.OnDrawGizmos ( )
private

Raises the draw gizmos event.

Definition at line 689 of file Simulation.cs.

689  {
690  Gizmos.DrawWireCube(bounds.center, bounds.size);
691  }
Bounds bounds
The simulation bounds described as a cube. This is the search space indicated to INavigation.
Definition: Simulation.cs:637
static void Simulation.Pause ( )
static

Pause the simulation.

Definition at line 485 of file Simulation.cs.

485  {
486  Debug.Log("Simulation Pause.");
487  if (state == State.simulating) {
488  Time.timeScale = 0f;
489  state = State.stopped;
490  }
491  }
static State state
Gets the simulation state.
Definition: Simulation.cs:230
static void Simulation.PlaceDestination ( )
staticprivate

Places the destination.

Definition at line 614 of file Simulation.cs.

614  {
617  } else {
618  destination.transform.position = _environment.destinationBounds.center;
619  }
620  }
static Environment _environment
Definition: Simulation.cs:392
bool randomizeDestination
If true, destination starts each test at a random location in simulation bounds.
Definition: Simulation.cs:105
static Settings settings
Gets or sets the settings for the current simulation.
Definition: Simulation.cs:241
Bounds destinationBounds
Gets the destination bounds.
Definition: Environment.cs:31
static GameObject destination
Gets reference to the destination.
Definition: Simulation.cs:302
static Vector3 RandomInBounds(Bounds b)
Return a random position inside the bounds, but not inside any physical objects.
Definition: Simulation.cs:553

Here is the call graph for this function:

Here is the caller graph for this function:

static void Simulation.PlaceRobotInStartArea ( )
staticprivate

Places the robot in start area.

Definition at line 602 of file Simulation.cs.

602  {
605  } else {
607  }
608  robot.transform.rotation = Quaternion.identity;
609  }
static Environment _environment
Definition: Simulation.cs:392
static Settings settings
Gets or sets the settings for the current simulation.
Definition: Simulation.cs:241
static Robot robot
Gets reference to the robot in the current simulation.
Definition: Simulation.cs:273
Bounds originBounds
Gets the origin bounds.
Definition: Environment.cs:22
Vector3 position
Gets or sets the transform position.
Definition: Robot.cs:106
bool randomizeOrigin
If true, robot starts each test at a random location in simulation bounds.
Definition: Simulation.cs:101
static Vector3 RandomInBounds(Bounds b)
Return a random position inside the bounds, but not inside any physical objects.
Definition: Simulation.cs:553

Here is the call graph for this function:

Here is the caller graph for this function:

static Vector3 Simulation.RandomInBounds ( Bounds  b)
static

Return a random position inside the bounds, but not inside any physical objects.

Returns
Random position inside bounds.

Definition at line 553 of file Simulation.cs.

553  {
554  Vector3 v = new Vector3();
555  v.x = Random.Range(b.min.x, b.max.x);
556  v.y = b.max.y;
557  v.z = Random.Range(b.min.z, b.max.z);
558  RaycastHit hit;
559  if (Physics.Raycast(v, Vector3.down, out hit)) {
560  v = hit.point + hit.normal* 0.25f;
561  Debug.DrawRay(v, Vector3.down, Color.white, 5f);
562  }
563  return v;
564  }

Here is the caller graph for this function:

static void Simulation.Run ( )
static

Run the simulation.

Definition at line 474 of file Simulation.cs.

474  {
475  Debug.Log("Simulation run.");
476  if (state == State.stopped) {
477  Time.timeScale = _timeScale;
478  state = State.simulating;
479  }
480  }
static State state
Gets the simulation state.
Definition: Simulation.cs:230
static float _timeScale
Definition: Simulation.cs:394
static void Simulation.SetBounds ( )
staticprivate

Definition at line 623 of file Simulation.cs.

623  {
624  Bounds b = new Bounds();
625  foreach(Renderer r in environment.GetComponentsInChildren<Renderer>())
626  b.Encapsulate(r.bounds);
627 
628  Instance.bounds = b;
629  }
static Simulation Instance
Reference to the MonoBebehaviour instance
Definition: Simulation.cs:222
Bounds bounds
The simulation bounds described as a cube. This is the search space indicated to INavigation.
Definition: Simulation.cs:637
static GameObject environment
Gets or sets reference to the environment in the current simulation.
Definition: Simulation.cs:286
void Simulation.Start ( )
private

Called on the first frame

Definition at line 657 of file Simulation.cs.

657  {
658  destination = GameObject.Find("Destination");
659  }
static GameObject destination
Gets reference to the destination.
Definition: Simulation.cs:302
static IEnumerator Simulation.StartTestRoutine ( )
staticprivate

Routine for starting a new test

Returns
The test routine.

Definition at line 570 of file Simulation.cs.

570  {
571  if (isRunning) Halt(StopCode.Unspecified);
572  state = State.starting;
574  yield return new WaitForSeconds(1f);
575 
576  // place the robot
577  robot.Reset();
579 
580  // place the destination
582 
583  yield return new WaitForSeconds(1f);
584 
586  destination.SendMessage("ChooseRandomSprite");
587  testNumber++;
588  Debug.Log("Simulation NextTest: " + testNumber + " of " + settings.numberOfTests);
589 
590  yield return new WaitForSeconds(1f);
591 
592  _startTime = Time.time;
593  state = State.simulating;
594  if (loggingEnabled) Log.Start();
595  robot.moveEnabled = true;
597  }
int numberOfTests
The number of repeat tests with these parameters.
Definition: Simulation.cs:78
static void PlaceRobotInStartArea()
Places the robot in start area.
Definition: Simulation.cs:602
static State state
Gets the simulation state.
Definition: Simulation.cs:230
static void Start()
Start logging.
Definition: Log.cs:117
void OnTestStart()
Raises the test start event. (handles camera exhibitionMode behaviour)
static float _startTime
Definition: Simulation.cs:387
static CamController Instance
Gets the MonoBehaviour instance.
static Settings settings
Gets or sets the settings for the current simulation.
Definition: Simulation.cs:241
static Robot robot
Gets reference to the robot in the current simulation.
Definition: Simulation.cs:273
void OnTestEnd()
Raises the test end event. (handles camera exhibitionMode behaviour)
static GameObject destination
Gets reference to the destination.
Definition: Simulation.cs:302
bool moveEnabled
A flag indicating whether the robot should try moving.
Definition: Robot.cs:29
static bool isRunning
Gets a value indicating whether this Simulation is running.
Definition: Simulation.cs:325
static void Halt(StopCode code)
Halt simulation and write log to file.
Definition: Simulation.cs:497
void Reset()
Reset the robot, disable sensors
Definition: Robot.cs:176
static int testNumber
Gets the current test number (1 to settings.numberOfTests).
Definition: Simulation.cs:266
Controls the camera orientation and render modes according to ViewMode in viewModeList user input...
Provides data logging capabilities. Data is logged in CSV format.
Definition: Log.cs:10
static void PlaceDestination()
Places the destination.
Definition: Simulation.cs:614
static bool loggingEnabled
If true, simulation will be logged to a file via Log class.
Definition: Simulation.cs:347
void NavigateToDestination()
Enable sensors, start moving toward destination using INavigation
Definition: Robot.cs:164

Here is the call graph for this function:

Here is the caller graph for this function:

void Simulation.Update ( )
private

Update this instance (called every rendered frame)

Definition at line 664 of file Simulation.cs.

664  {
665  if (isRunning) {
666  // check for conditions to end the test
668  Debug.Log("Simulation: nav objective complete!");
669  Halt(StopCode.RobotReachedDestination);
670  NextTest();
671  }
673  Debug.LogWarning("Simulation: Robot appears to be stuck! Skipping test.");
674  Halt(StopCode.RobotIsStuck);
675  NextTest();
676  }
678  Debug.LogWarning("Simulation: Max test time exceeded! Skipping test.");
679  Halt(StopCode.MaxTimeExceeded);
680  NextTest();
681  }
682 
683  }
684  }
bool atDestination
Definition: Robot.cs:125
static void NextTest()
Stops the current test and starts the next test in current simulation.
Definition: Simulation.cs:461
bool isStuck
Definition: Robot.cs:146
bool continueOnNavObjectiveComplete
If true, test ends when robot reaches the destination.
Definition: Simulation.cs:116
static Settings settings
Gets or sets the settings for the current simulation.
Definition: Simulation.cs:241
static Robot robot
Gets reference to the robot in the current simulation.
Definition: Simulation.cs:273
static bool isRunning
Gets a value indicating whether this Simulation is running.
Definition: Simulation.cs:325
static void Halt(StopCode code)
Halt simulation and write log to file.
Definition: Simulation.cs:497
int maximumTestTime
The maximum test time in seconds.
Definition: Simulation.cs:112
static float time
Time (in seconds) since robot started searching for destination.
Definition: Simulation.cs:366
bool continueOnRobotIsStuck
If true, test ends when robot average position over time doesn't change enough.
Definition: Simulation.cs:120

Here is the call graph for this function:

Member Data Documentation

Environment Simulation._environment
staticprivate

Definition at line 392 of file Simulation.cs.

bool Simulation._paused
staticprivate

Definition at line 393 of file Simulation.cs.

Robot Simulation._robot
staticprivate

Definition at line 391 of file Simulation.cs.

Settings Simulation._settings
staticprivate

Definition at line 390 of file Simulation.cs.

float Simulation._startTime
staticprivate

Definition at line 387 of file Simulation.cs.

float Simulation._stopTime
staticprivate

Definition at line 388 of file Simulation.cs.

float Simulation._timeScale = 1f
staticprivate

Definition at line 394 of file Simulation.cs.

List<Settings> Simulation.batch = new List<Settings>()
static

List of settings to iterate through in batch mode.

Definition at line 254 of file Simulation.cs.

bool Simulation.exhibitionMode
static

Exhibition mode will run continually and randomly choose camera perspectives and simulation settings.

Definition at line 236 of file Simulation.cs.

Simulation Simulation.Instance
static

Reference to the MonoBebehaviour instance

Definition at line 222 of file Simulation.cs.

bool Simulation.loggingEnabled = true
static

If true, simulation will be logged to a file via Log class.

Definition at line 347 of file Simulation.cs.

Property Documentation

Bounds Simulation.bounds
getprivate set

The simulation bounds described as a cube. This is the search space indicated to INavigation.

Instance Methods

Definition at line 637 of file Simulation.cs.

GameObject Simulation.destination
staticgetprivate set

Gets reference to the destination.

Definition at line 302 of file Simulation.cs.

GameObject Simulation.environment
staticgetset

Gets or sets reference to the environment in the current simulation.

Definition at line 286 of file Simulation.cs.

bool Simulation.isFinished
staticget

Gets a value indicating whether this Simulation is finished.

true if is finished; otherwise, false.

Definition at line 339 of file Simulation.cs.

bool Simulation.isInactive
staticget

Gets a value indicating whether this Simulation has not yet started.

true if pre simulation; otherwise, false.

Definition at line 318 of file Simulation.cs.

bool Simulation.isRunning
staticget

Gets a value indicating whether this Simulation is running.

true if is running; otherwise, false.

Definition at line 325 of file Simulation.cs.

bool Simulation.isStopped
staticget

Gets a value indicating whether this Simulation is stopped.

true if is stopped; otherwise, false.

Definition at line 332 of file Simulation.cs.

bool Simulation.paused
staticgetset

Gets or sets a value indicating whether this Simulation is paused.

true if paused; otherwise, false.

Definition at line 354 of file Simulation.cs.

Robot Simulation.robot
staticgetprivate set

Gets reference to the robot in the current simulation.

Definition at line 273 of file Simulation.cs.

Settings Simulation.settings
staticgetset

Gets or sets the settings for the current simulation.

Definition at line 241 of file Simulation.cs.

int Simulation.simulationNumber
staticgetprivate set

Gets the simulation number (index in batch list, 1 to batch.Count).

Definition at line 259 of file Simulation.cs.

State Simulation.state
staticgetprivate set

Gets the simulation state.

Definition at line 230 of file Simulation.cs.

IObservable Simulation.testArea
staticgetprivate set

Gets the test area (Observer object)

Definition at line 309 of file Simulation.cs.

int Simulation.testNumber
staticgetprivate set

Gets the current test number (1 to settings.numberOfTests).

Definition at line 266 of file Simulation.cs.

float Simulation.time
staticget

Time (in seconds) since robot started searching for destination.

Definition at line 366 of file Simulation.cs.

float Simulation.timeScale
staticgetset

Gets or sets the time scale.

Definition at line 376 of file Simulation.cs.


The documentation for this class was generated from the following file: