qns.entity.timer package

Submodules

qns.entity.timer.timer module

class qns.entity.timer.timer.Timer(name: str, start_time: float, end_time: float = 0, step_time: float = 1, trigger_func=None)[source]

Bases: qns.entity.entity.Entity

A Timer is an Entity that trigger the function trigger_func one-shot or periodically.

install(simulator: qns.simulator.simulator.Simulator) None[source]

install is called before simulator runs to initialize or set initial events

Parameters

simulator (qns.simulator.simulator.Simulator) – the simulator

trigger()[source]
class qns.entity.timer.timer.TimerEvent(timer: qns.entity.timer.timer.Timer, t: Optional[qns.simulator.ts.Time] = None, name: Optional[str] = None, by: Optional[Any] = None)[source]

Bases: qns.simulator.event.Event

TimerEvent is the event that triggers the Timer’s trigger_func

invoke() None[source]

Invoke the event, should be implemented

Module contents

class qns.entity.timer.Timer(name: str, start_time: float, end_time: float = 0, step_time: float = 1, trigger_func=None)[source]

Bases: qns.entity.entity.Entity

A Timer is an Entity that trigger the function trigger_func one-shot or periodically.

install(simulator: qns.simulator.simulator.Simulator) None[source]

install is called before simulator runs to initialize or set initial events

Parameters

simulator (qns.simulator.simulator.Simulator) – the simulator

trigger()[source]