cosapp.core.time

Classes

TimeManager(*args, **kwargs)

Observer pattern subject notifying its observers when time changes

TimeObserver([sign_in])

Abstract time observer.

UniversalClock(*args, **kwargs)

Unique (singleton) time manager

class cosapp.core.time.TimeManager(*args, **kwargs)[source]

Bases: cosapp.patterns.observer.Subject

Observer pattern subject notifying its observers when time changes

reset(t: numbers.Number = 0)[source]

Reset time to a chosen value, without notifying observers

property time

Current simulation time

class cosapp.core.time.TimeObserver(sign_in=True)[source]

Bases: cosapp.patterns.observer.Observer

Abstract time observer. Concrete derived classes must implement abstract method ‘_update’.

observe()[source]

Sign in as observer of the universal time manager

observes()bool[source]

Bool: has object signed up as an observer?

property t

Current simulation time - alias for time

property time

Current simulation time

class cosapp.core.time.UniversalClock(*args, **kwargs)[source]

Bases: cosapp.core.time.TimeManager

Unique (singleton) time manager