Logic

class logic.abfilter.ABFilter(kmax: int = 10)[source]

The ABFilter class

Provides methods for using alpha-beta filtering

filterAB(obj: Tracked, position: vec3, time: int) None[source]

A function that applies an alpha-beta filter to an object.

Parameters:
  • obj (Tracked) – Tracked object received from the tracker

  • position (glm.vec3) – Position of tracked object

  • time – The current time in the simulation

class logic.collision_detector.CollisionDetector(radar: Radar)[source]

The collision detectors class

Provides logic for calculating collisions of objects and signals

scan_floor(signals: list[Signal], time)[source]
scan_objects(signals: list[Signal], objects: list[Aircraft], time: int) list[Signal][source]

A method that search for collision between objects and signals.

Parameters:
  • signals (list[Signal]) – List of signals that will be checked

  • objects (list[Aircraft]) – List of objects that will be checked

  • time – Current time in the simulation

Returns:

List of signals that collided with objects

Return type:

list[Signal]

scan_radar(signals: list[Signal], time: int) list[Signal][source]

A method that search for collision between radar and reflected signals

Parameters:
  • signals (list[Signal]) – List of signals that will be checked

  • time (int) – Current time in the simulation

Returns:

List of signals that collided with radar

Return type:

list[Signal]

class logic.radar.Emitter(range_of_action: int, characteristics: list | None = None)[source]

The Emitter class

Provides methods for emitter stimulation

static send_signal(departure_time: int, direction: vec3, speed: vec3, power_multiply: int = 0)[source]

Create Signal object

Parameters:
  • departure_time (int) – Time when the signal was emitted.

  • direction (glm.vec3) – Vector of signal direction.

  • speed (glm.vec3) – Vector of signal speed.

  • power_multiply (int) – Coefficient for power

Returns:

Signal object

Return type:

Signal

send_signals(departure_time: int) list[Signal][source]

Send signal to half of sphere

Parameters:

departure_time (int) – Time of sending the signal.

Returns:

List of signals

Return type:

list[Signal]

class logic.radar.Radar(emitter: ~logic.radar.Emitter = <logic.radar.Emitter object>, receiver: ~logic.radar.Receiver = <logic.radar.Receiver object>)[source]

The Radar class

Provides object for radar simulation.

class logic.radar.Receiver(radius: float, position: vec3, characteristics: list | None = None)[source]

The Receiver class

Provides object for emitter stimulation.

class logic.signal.Signal(departure_time: int, direction: vec3, speed: vec3, power_multiply: int)[source]

The Signal class

Provides methods for signal modeling

check_depth()[source]
position(time: int) vec3[source]

Returns the position of the signal depending on the time. :param time: time in the simulation

reflect(new_time: int)[source]
update(new_direction, new_speed, new_time: int)[source]

Update signal if it collides with object :param new_direction: vector of new direction of signal :param new_speed: vector of new signal speed :param new_time: time when signal reflected

class logic.tracker.Tracker[source]

The Tracker class

Provides methods for tracking objects

static calculate_cluster_centers(result: MeanShiftResult) list[source]

Calculate positions of aircraft based on mean_shift clustering

Parameters:

result (MeanShiftResult) – result of mean_shift clustering

Returns:

list of aircraft positions

calculate_coordinate(signals: list[Signal], time: int) list[source]

Calculate position where signals was reflected.

Parameters:
  • signals (list[Signal]) – List of signals

  • time (int) – Current time in the simulation

Returns:

list of positions of signals

Return type:

list[glm.vec3]

static get_signal_noise(radius: int, time: int)[source]

Calculate signal noise ratio

Parameters:
  • radius – the distance that the signal traveled after it was reflected

  • time – time in the simulation

Returns:

signal noise ratio

process_signals(signals: list[Signal], current_time: int)[source]

Processes signals, finds new objects, or updates old ones

Parameters:
  • signals – list of signals

  • current_time – time in the simulation

Returns:

positions of tracked objects

update_objects(current_time: int)[source]

Deletes objects that have not been updated for a long time

Parameters:

current_time – time in the simulation