示例#1
0
 async def run(self):
     msg = await self.receive(timeout=1)
     if msg:
         LogManager.received(self.agent.name)
         tm = json.loads(msg.body)
         self.agent._orders.append(Order(tm["min_time"],
                                         tm["priority"]))
示例#2
0
 async def run(self):
     msg = await self.receive(timeout=5)
     if (msg):
         LogManager.received(self.agent.name)
         stat = json.loads(msg.body)
         self.agent._ranking = stat["ranking"]
         self.agent._tot_score = stat["tot_score"]
         self.agent._avg_time = stat["avg_time"]
         self.agent._tot_orders = stat["tot_orders"]
         self.agent._errors = stat["errors"]
示例#3
0
 async def run(self):
     msg = await self.receive(timeout=60)
     if (msg):
         LogManager.received(self.agent.name)
         if (self.agent._is_working):
             self.agent._time += 1
示例#4
0
 async def run(self):
     msg = await self.receive(timeout=1)
     if msg:
         LogManager.received(self.agent.name)
         tm = json.loads(msg.body)
         self.agent._ranking = tm["ranking"]