Esempio n. 1
0
class SM_Test(StateMachine):
    def __init__(self,simulation):
        StateMachine.__init__(self,simulation)
        self.m1 = Actuator(self,V(1,'m/s'),V(1,'m/s^2'),'m1')
        
    def state000(self):
        """titre
           actions
           --> 001: time out
        """
        logging.debug('000')
        self.m1.move(V(2,'m'))
        self.simulation.aGlobalVar = 'toto'
    
    def state001(self):
        """titre
           actions
           --> 000: condition :to move
        """ 
        logging.debug('001')
        self.wait(self.time +V(7,'s'))
        assert self.simulation.aGlobalVar == 'toto' 
class SM_Test(StateMachine):
    def __init__(self, simulation):
        StateMachine.__init__(self, simulation)
        self.m1 = Actuator(self, V(1, 'm/s'), V(1, 'm/s^2'), 'm1')

    def state000(self):
        """titre
           actions
           --> 001: time out
        """
        logging.debug('000')
        self.m1.move(V(2, 'm'))
        self.simulation.aGlobalVar = 'toto'

    def state001(self):
        """titre
           actions
           --> 000: condition :to move
        """
        logging.debug('001')
        self.wait(self.time + V(7, 's'))
        assert self.simulation.aGlobalVar == 'toto'
 def __init__(self, simulation):
     StateMachine.__init__(self, simulation)
     self.m1 = Actuator(self, V(1, 'm/s'), V(1, 'm/s^2'), 'm1')
Esempio n. 4
0
 def __init__(self,simulation):
     StateMachine.__init__(self,simulation)
     self.m1 = Actuator(self,V(1,'m/s'),V(1,'m/s^2'),'m1')