pNeuma_simulator.gang.particle module

class pNeuma_simulator.gang.particle.Particle(x, y, vx, vy, 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

The mode of the particle, e.g., “Car” or “Moto”.

Type:

str

a_des

The desired acceleration.

Type:

float

a0

The initial acceleration.

Type:

float

ttc

Time to collision.

Type:

float

f_a

Distance to collision.

Type:

float

image

The visual representation of the particle.

Type:

object

leader

The leading particle.

Type:

Particle

rad

The radius of the particle.

Type:

float

gap

The gap between particles.

Type:

float

tau

Adaptation time.

Type:

float

lam

Lambda parameter.

Type:

float

v0

Initial velocity.

Type:

float

d

Distance parameter.

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()[source]
property vx
property vy
property x
property y