def zephyrize(self):
     clock = self.environment.clock()
     zepy.advertise(self.environment, clock)
     zepy.advertise(self.demons, clock)
     for rewardFunction in self.rewards:
         zepy.monattr(rewardFunction,
                      'rewardValue',
                      clock=clock,
                      label=rewardFunction.label)
示例#2
0
 def zephyrize(self):
     Zephyr.registerLabeledCollection(self, "demons", "")
     monitoredList = [self.verifiers, self.environment, self.demons]
     for monitored in monitoredList:
         zepy.advertise(monitored, self.clock)
         self.logfile.add(monitored, 0)
     monitor = ZephyrPlotting.createMonitor(self.clock)
     for rewardFunction in self.rewards:
         zepy.monattr(rewardFunction, "rewardValue", clock=self.clock, label=rewardFunction.label())
示例#3
0
 def zephyrize(self):
     Zephyr.registerLabeledCollection(self, "demons", "")
     monitoredList = [self.verifiers, self.environment, self.demons]
     for monitored in monitoredList:
         zepy.advertise(monitored, self.clock)
         self.logfile.add(monitored, 0)
     monitor = ZephyrPlotting.createMonitor(self.clock)
     for rewardFunction in self.rewards:
         zepy.monattr(rewardFunction,
                      'rewardValue',
                      clock=self.clock,
                      label=rewardFunction.label())
示例#4
0
 def zephyrize(self):
     clock = self.environment.clock()
     zepy.advertise(self.environment, clock)
     zepy.advertise(self.demons, clock)
     for rewardFunction in self.rewards:
         zepy.monattr(rewardFunction, 'rewardValue', clock = clock, label = rewardFunction.label)
 def zephyrize(self):
     zepy.advertise(self.clock, self.environment)
     zepy.advertise(self.clock, self.horde)
     for rewardFunction in self.rewards:
         zepy.monattr(self.clock, rewardFunction, 'rewardValue', label = rewardFunction.label)
示例#6
0
 def run(self):
     clock = zepy.clock()
     zepy.monattr(clock, self, 'monitoredAttribute')
     zepy.monfunc(clock, (lambda: -self.monitoredAttribute), name="Function")
     while clock.tick():
         self.monitoredAttribute = (self.monitoredAttribute + 1) % 10
示例#7
0
 def __init__(self):
     self.clock = zepy.Clock("HelloZephyr")
     self.value = 0 
     zepy.monattr(self.clock, self, "value")
     zepy.monattr(self.clock, self, "someValue")