Base class#
#include "navground/sim/scenario.h"
A scenario is a generator of World.
Sub-classes should override init_world with a custom initialization that is performed each time a world is sampled (e.g., during an experiment).
They can also be customized by adding groups using add_group and/or initializers using add_init, although these are not exposed to YAML.
Subclassed by navground::sim::AntipodalScenario, navground::sim::CollisionsScenario, navground::sim::CorridorScenario, navground::sim::CrossScenario, navground::sim::CrossTorusScenario, navground::sim::SimpleScenario
Public Types
A world initializer: a function that takes as input world and optional seed and perform some initialization on the world.
A collection of world initializers
A collection of groups
A collection of property samplers
Public Functions
Constructs a new instance.
- Parameters:
inits – [in] The collection of world initializers to use.
Initializes the world.
Users can specialize this method to specialize a scenario but should call make_world when creating a world.
- Parameters:
world – The world
seed – The random seed
Applies the initializers from get_inits.
Should be called after init_world to complete the initialization, as make_world does automatically.
- Parameters:
world – The world
Creates and initialize a world.
- Parameters:
seed – The random seed
Adds a world initializer.
- Parameters:
initializer – [in] The initializer
- Returns:
The associated key
Sets a world initializer.
- Parameters:
key – [in] The key
initializer – [in] The initializer
Remove the last added world initializer.
- Parameters:
key – [in] The key
Removed all initializers.
Gets the world initializers.
- Returns:
The initializers.
Gets the groups.
- Returns:
The groups.
Gets a group.
- Parameters:
index – [in] The index
- Returns:
The group or null if the index is not defined.
Adds a group.
- Parameters:
group – [in] The group
Remove the added group.
- Parameters:
group – [in] The group
Remove the added group.
- Parameters:
index – [in] The index
Remove all groups.
Returns the samplers that this scenario uses for its properties.
- Returns:
The samplers.
Adds a property sampler.
- Parameters:
name – [in] The name of the property
value – [in] The sampler
Removes a property sampler.
- Parameters:
name – [in] The name of the property
Clears the property samplers.
Sets world attributes from scenario properties.
Sets an attribute with the current value for each (registered) property.
- Parameters:
world – The world
Public Members
Obstacles
Walls to add
An optional bounding box
A group of agents that can be generated and added to the world.
Subclassed by navground::sim::AgentSampler< W >
Public Functions
Generate and add agents to the world.
- Parameters:
world – The world
seed – An optional random seed