![]() |
BotNavSim
v0.4.3
Mobile Robot Simulation
|
This is a manager class used to overlook the running of a simulation. More...
Classes | |
class | Observer |
class | Settings |
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< Settings > | batch = 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 |
This is a manager class used to overlook the running of a simulation.
Definition at line 8 of file Simulation.cs.
enum Simulation.State |
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.
enum Simulation.StopCode |
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.
|
staticprivate |
Initializes the Simulation class.
Definition at line 215 of file Simulation.cs.
|
private |
Definition at line 643 of file Simulation.cs.
|
static |
Begin simulating.
Definition at line 412 of file Simulation.cs.
|
static |
Stop all simulations.
Definition at line 516 of file Simulation.cs.
|
static |
Enter this instance.
Definition at line 401 of file Simulation.cs.
|
static |
Exit simulation.
Definition at line 536 of file Simulation.cs.
|
static |
Halt simulation and write log to file.
code | Reason for halt. |
Definition at line 497 of file Simulation.cs.
|
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.
|
static |
Stops the current test and starts the next test in current simulation.
Definition at line 461 of file Simulation.cs.
|
private |
called before application shuts down
Definition at line 696 of file Simulation.cs.
|
private |
Raises the draw gizmos event.
Definition at line 689 of file Simulation.cs.
|
static |
|
staticprivate |
Places the destination.
Definition at line 614 of file Simulation.cs.
|
staticprivate |
Places the robot in start area.
Definition at line 602 of file Simulation.cs.
|
static |
Return a random position inside the bounds, but not inside any physical objects.
Definition at line 553 of file Simulation.cs.
|
static |
|
staticprivate |
Definition at line 623 of file Simulation.cs.
|
private |
Called on the first frame
Definition at line 657 of file Simulation.cs.
|
staticprivate |
Routine for starting a new test
Definition at line 570 of file Simulation.cs.
|
private |
Update this instance (called every rendered frame)
Definition at line 664 of file Simulation.cs.
|
staticprivate |
Definition at line 392 of file Simulation.cs.
|
staticprivate |
Definition at line 393 of file Simulation.cs.
|
staticprivate |
Definition at line 391 of file Simulation.cs.
|
staticprivate |
Definition at line 390 of file Simulation.cs.
|
staticprivate |
Definition at line 387 of file Simulation.cs.
|
staticprivate |
Definition at line 388 of file Simulation.cs.
|
staticprivate |
Definition at line 394 of file Simulation.cs.
List of settings to iterate through in batch mode.
Definition at line 254 of file Simulation.cs.
|
static |
Exhibition mode will run continually and randomly choose camera perspectives and simulation settings.
Definition at line 236 of file Simulation.cs.
|
static |
Reference to the MonoBebehaviour instance
Definition at line 222 of file Simulation.cs.
|
static |
If true, simulation will be logged to a file via Log class.
Definition at line 347 of file Simulation.cs.
|
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.
|
staticgetprivate set |
Gets reference to the destination.
Definition at line 302 of file Simulation.cs.
|
staticgetset |
Gets or sets reference to the environment in the current simulation.
Definition at line 286 of file Simulation.cs.
|
staticget |
Gets a value indicating whether this Simulation is finished.
true
if is finished; otherwise, false
.
Definition at line 339 of file Simulation.cs.
|
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.
|
staticget |
Gets a value indicating whether this Simulation is running.
true
if is running; otherwise, false
.
Definition at line 325 of file Simulation.cs.
|
staticget |
Gets a value indicating whether this Simulation is stopped.
true
if is stopped; otherwise, false
.
Definition at line 332 of file Simulation.cs.
|
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.
|
staticgetprivate set |
Gets reference to the robot in the current simulation.
Definition at line 273 of file Simulation.cs.
|
staticgetset |
Gets or sets the settings for the current simulation.
Definition at line 241 of file Simulation.cs.
|
staticgetprivate set |
Gets the simulation number (index in batch list, 1 to batch.Count).
Definition at line 259 of file Simulation.cs.
|
staticgetprivate set |
Gets the simulation state.
Definition at line 230 of file Simulation.cs.
|
staticgetprivate set |
Gets the test area (Observer object)
Definition at line 309 of file Simulation.cs.
|
staticgetprivate set |
Gets the current test number (1 to settings.numberOfTests).
Definition at line 266 of file Simulation.cs.
|
staticget |
Time (in seconds) since robot started searching for destination.
Definition at line 366 of file Simulation.cs.
|
staticgetset |
Gets or sets the time scale.
Definition at line 376 of file Simulation.cs.