def _setup(self): stock_template = ACLTemplate() stock_template.setOntology('stock') mt = MessageTemplate(stock_template) settings = self.Speculate() self.addBehaviour(settings, mt)
def _setup(self): self.port = unused_port("127.0.0.1") self.wui.setPort(self.port) self.wui.start() self.wui.registerController("update_position", self.update_position_controller) tpl = ACLTemplate() tpl.setProtocol(TRAVEL_PROTOCOL) template = MessageTemplate(tpl) self.addBehaviour(TravelBehaviour(), template)
def _setup(self): print "\n Agent\t" + self.getAID().getName() + " is up" feedback_template = ACLTemplate() feedback_template.setOntology('booking') mt = MessageTemplate(feedback_template) settings = self.BookingSettings() self.addBehaviour(settings, mt) settings.send_message(json.dumps({'request_type': 'games'}))
def _setup(self): self.strategija = odabrabaStrategija self.addBehaviour(self.Postaja()) self.protivnik = None self.potezi = {} self.mapa_strategija = { 2: Strategija.DrugiOdabir(), 1: Strategija.PrviOdabir(), 3: Strategija.TreciOdabir(), 4: Strategija.CetvrtiOdabir(self), 5: Strategija.PetiOdabir(self), 6: Strategija.SestiOdabir(self) } self.rezultati = [] p = ACLTemplate() p.setOntology('Protivnik') m = MessageTemplate(p) self.addBehaviour(self.Igranje(), m) p1 = ACLTemplate() p1.setOntology('Rezultat') m1 = MessageTemplate(p1) self.addBehaviour(self.Rezultat(), m1)
def add_strategy(self, strategyClass): tpl = ACLTemplate() tpl.setProtocol(REQUEST_PROTOCOL) template = MessageTemplate(tpl) self.addBehaviour(strategyClass(), template)
def postaviTemplate(self, ontologija): p = ACLTemplate() p.setOntology(ontologija) m = MessageTemplate(p) return m