def __init__(self, verbose=False): RepeatedTask.__init__(self,1,self.step) self.name = "TheDiceMachine" self.frequency = 50.0 self.status = self.Status.Stopped self.state = None self.debug = False
def __init__(self, verbose=False): RepeatedTask.__init__(self,1,self.step) self.name = "PingMachine" self.frequency = 10.0 self.status = self.Status.Stopped self.state = None self.debug = False self.submachines = {}
def __init__(self, debug=False): RepeatedTask.__init__(self,1,self.step) '''The name of the machine''' self.name = "" '''A description of its behaviour''' self.description = "" '''The frequency of the machine''' self.frequency = 1.0 '''The preamble''' self.preamble = "" '''The code executed on stop''' self.onstop = "" '''The dict of states (name-> state)''' self.states = {} self.states['Initial'] = StateMachine.State("Initial") self.states['Final'] = StateMachine.State("Final") '''The dict of submachines''' self.submachines = {} '''The current state''' self.state = None '''The playing status of the machine''' self.status = self.Status.Stopped '''The error status of the machine''' self.error = "" '''The date where playing begins''' self.begin = time() '''The total playing duration''' self.duration = float("inf") '''The map of monitored moves to the map from states to output values''' self.monitored_states = {} self.debug = debug '''True if the machine is animated by a thread, falseif anaimated by calls to step (by an stm loader for example)''' self.threaded = False self.globals = globals() self.locals = locals() '''Minimal time to spend in the current state''' self.min_ticks = 0
def __init__(self, verbose=False): global PongMachine global PingMachine RepeatedTask.__init__(self,1,self.step) self.name = "PingPongMachine" self.frequency = 1.0 self.status = self.Status.Stopped self.state = None self.debug = False self.submachines = {} PongMachine = PongMachineClass() self.submachines['PongMachine'] = PongMachine PingMachine = PingMachineClass() self.submachines['PingMachine'] = PingMachine
def __init__(self, debug=False): RepeatedTask.__init__(self,1,self.step) '''The name of the machine''' self.name = "" '''A description of its behaviour''' self.description = "" '''The frequency of the machine''' self.frequency = 1.0 '''The preamble''' self.preamble = "" '''The dict of states (name-> state)''' self.states = {} self.states['Initial'] = StateMachine.State("Initial") self.states['Final'] = StateMachine.State("Final") '''The dict of submachines''' self.submachines = {} '''The current state''' self.state = None '''The playing status of the machine''' self.status = self.Status.Stopped '''The date where playing begins''' self.begin = time() '''The total playing duration''' self.duration = float("inf") self.debug = debug
def __init__(self): RepeatedTask.__init__(self,0.1,self.step) self.machines = [] RepeatedTask.start(self)