Base class#

A scenario describes a distribution of World that can be sampled to perform an experiment.

A group of agents that can be generated and added to the world.

Generate and add agents to the world.

Parameters:
  • world – The world

  • seed – An optional random seed

Adds a world initializer.

Parameters:

initializer – The initializer

Returns:

The associated key

Removed all initializers

Dumps the object to a YAML-string.

Returns:

The YAML representation

Return type:

str

Gets the value of the specified property.

Parameters:

name – The name of the property

Raise:

std::runtime_error A runtime error if no property is found.

Returns:

The value of the property

Check whether a type name has been registered.

Parameters:

type – The associated type name.

Returns:

True if the type name has been registered.

Initializes the world.

Parameters:
  • world – The world

  • seed – The random seed

Load a scenario modulation from a YAML string.

Returns:

The loaded scenario or None if loading fails.

Return type:

Scenario| None

Create an object of a sub-class selected by name.

Parameters:

type – The associated type name.

Returns:

An object of a registered sub-class or None in case the desired name is not found.

Creates and initialize a world.

Parameters:

seed – The random seed

Returns the json-schema that includes registered components.

Returns:

“anyOf” json-schema of all registered components.

Return type:

dict[str, typing.Any]

Remove the last added world initializer.

Parameters:

key – The key

Returns the json-schema of a component

Returns an empty dictionary if a not registered type is requested.

Parameters:
  • reference_register_schema – Whether to reference registered components schema in the base class schema.

  • type (str) – An optional registered type. If not specified, it returns the schema of the base class.

Returns:

A json-schema of the registered class

Return type:

dict[str, typing.Any]

Set the value of a named property. Fails silently if no property can be found or if the value has a non-compatible type.

Parameters:
  • name – The name of the property

  • value – The desired value for the property

Sets a world initializer.

Parameters:
  • key – The key

  • initializer – The initializer

Sets the yaml representation

Type:

Optional[navground.sim.BoundingBox]

An optional bounding box

Type:

list[navground.sim.Scenario.Group]

Groups

Type:

dict[str, Callable[[navground.sim.NativeWorld, Optional[int]], None]]

The world initializers.

Type:

list[navground.core.Disc]

Obstacles

Type:

dict[str, navground.core.Property]

The registered properties

Type:

str

The name associated to the type of an object

Type:

list[navground.core.LineSegment]

Walls to add