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
colorColorThe colour: WheelColor on the road, MudColor on grass.
polyList<(double X, double Y)>The world points, in metres; kept, not copied (Python's list is the same object).
grassboolWhether the mark is on grass; a wheel only extends a mark on the same ground.
ttlintPython's
ttl, 1 by default and never read by Gymnasium.
Exceptions
- ArgumentNullException
Thrown when
polyis null.
Properties
Color
Python's color: the mark's colour.
public Color Color { get; set; }
Property Value
Grass
Python's grass: whether the mark lies on grass.
public bool Grass { get; set; }
Property Value
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
Ttl
Python's ttl: 1, unused by Gymnasium's code.
public int Ttl { get; set; }