Beispiel #1
0
    def evaluate(self):
        if self.is_constant():
            return self.begin

        count = int(UnitSettings.get('speed') * self.element.elapsed_time() //
                    self.period)
        if self.count != INFINITY:
            repeat = count // self.count
            if repeat >= self.repeat:
                return self.end
            count -= repeat * self.count
        value = self.begin + self.skip * count
        return value
Beispiel #2
0
    def evaluate(self):
        if self.is_constant():
            return self.begin

        count = int(
            UnitSettings.get('speed') * self.element.elapsed_time() //
            self.period)
        if self.count != INFINITY:
            repeat = count // self.count
            if repeat >= self.repeat:
                return self.end
            count -= repeat * self.count
        value = self.begin + self.skip * count
        return value
Beispiel #3
0
 def next_time(self, t):
     speed = UnitSettings.get('speed')
     t += self.period / speed
     if self.random_delay:
         t += Poisson.next_poisson(self.random_delay) / speed
     return t
Beispiel #4
0
 def _command_time(self):
     return (self.sequence[self.next_command][0] / UnitSettings.get('speed')
             + self.cycle_time)
Beispiel #5
0
 def next_time(self, t):
     speed = UnitSettings.get('speed')
     t += self.period / speed
     if self.random_delay:
         t += Poisson.next_poisson(self.random_delay) / speed
     return t
Beispiel #6
0
 def _command_time(self):
     return (
         self.sequence[self.next_command][0] / UnitSettings.get('speed') +
         self.cycle_time)