Table of Contents

Class Particle

Namespace
Gym.Environments.Envs.Box2D
Assembly
Gym.Environments.dll

A skid mark (Gymnasium's car_dynamics.Particle): the polyline a skidding wheel leaves, black on the road and mud-coloured on grass, extended point by point while the wheel keeps skidding on the same ground (up to 30 points).

public sealed class Particle
Inheritance
Particle
Inherited Members
Extension Methods

Remarks

A mutable record of plain values, as Python's slotted dataclass is: Car appends to Poly while the skid lasts and keeps at most 30 marks. Reference: gymnasium/envs/box2d/car_dynamics.py.

Constructors

Particle(Color, List<(double X, double Y)>, bool, int)

A mark of a colour and starting polyline.

public Particle(Color color, List<(double X, double Y)> poly, bool grass, int ttl = 1)

Parameters

color Color

The colour: WheelColor on the road, MudColor on grass.

poly List<(double X, double Y)>

The world points, in metres; kept, not copied (Python's list is the same object).

grass bool

Whether the mark is on grass; a wheel only extends a mark on the same ground.

ttl int

Python's ttl, 1 by default and never read by Gymnasium.

Exceptions

ArgumentNullException

Thrown when poly is null.

Properties

Color

Python's color: the mark's colour.

public Color Color { get; set; }

Property Value

Color

Grass

Python's grass: whether the mark lies on grass.

public bool Grass { get; set; }

Property Value

bool

Poly

Python's poly: the polyline's world points in metres, which a skidding wheel appends to.

public List<(double X, double Y)> Poly { get; set; }

Property Value

List<(double X, double Y)>

Ttl

Python's ttl: 1, unused by Gymnasium's code.

public int Ttl { get; set; }

Property Value

int