pNeuma_simulator.gang.particle module

class pNeuma_simulator.gang.particle.Particle(x, y, speed, theta, mode='Car', ID=None, styles=None)[source]

Bases: object

A class representing a two-dimensional particle.

This class models a particle with position, velocity, and other attributes relevant to its motion and interactions.

ID

The unique identifier of the particle.

Type:

int

mode

Type of particle, e.g., “Car” or “Moto”.

Type:

str

theta

Angle of the particle.

Type:

float

a0

The desired direction.

Type:

float

ttc

Time to collision.

Type:

float

f_a

Distance to collision.

Type:

list

image

Clone of the particle.

Type:

object

leader

The leading particle.

Type:

Particle

rad

The radius matrix.

Type:

numpy.ndarray

gap

The gap between particles.

Type:

float

tau

Adaptation time.

Type:

float

lam

Lambda parameter.

Type:

float

v0

Desired velocity.

Type:

float

s0

Jam spacing.

Type:

float

pos

The position of the particle.

Type:

numpy.ndarray

vel

The velocity of the particle.

Type:

numpy.ndarray

theta

The angle of the particle’s velocity.

Type:

float

interactions

List of interactions with other particles.

Type:

list

advance(dt, new_V, new_theta)[source]

Advance the particle’s position according to its velocity.

draw(ax)[source]

Add this Particle’s Ellipse patch to the Matplotlib Axes ax.

encode(t)[source]
property vx
property vy
property x
property y