示例#1
0
    def _setup(self):
        stock_template = ACLTemplate()
        stock_template.setOntology('stock')

        mt = MessageTemplate(stock_template)
        settings = self.Speculate()
        self.addBehaviour(settings, mt)
    def _setup(self):
        helper.print_green("\nVAS Stock exchange\t%s\tis up" % self.getAID().getAddresses())

        template = ACLTemplate()
        template.setOntology('stock')

        behaviour = spade.Behaviour.MessageTemplate(template)
        self.addBehaviour(self.OpenStockExchange(), behaviour)
示例#3
0
    def _setup(self):
        print "\n Agent\t" + self.getAID().getName() + " is up"

        template = ACLTemplate()
        template.setOntology('booking')

        behaviour = spade.Behaviour.MessageTemplate(template)
        booking = self.Booking()
        self.addBehaviour(booking, behaviour)
    def _setup(self):
        print "\n Agent\t" + self.getAID().getName() + " is up"

        feedback_template = ACLTemplate()
        feedback_template.setOntology('game')

        message_template = MessageTemplate(feedback_template)
        settings = self.Coordinate()
        self.addBehaviour(settings, message_template)
示例#5
0
    def _setup(self):
        print "\n Agent\t" + self.getAID().getName() + " is up"

        template = ACLTemplate()
        template.setOntology('booking')

        behaviour = spade.Behaviour.MessageTemplate(template)
        booking = self.Booking()
        self.addBehaviour(booking, behaviour)
示例#6
0
    def _setup(self):
        print "\n Agent\t" + self.getAID().getName() + " is up"

        game_template = ACLTemplate()
        game_template.setOntology('game')

        message_template = MessageTemplate(game_template)
        settings = self.Play()
        self.addBehaviour(settings, message_template)
        settings.say_ready()
示例#7
0
文件: traveler.py 项目: lpredova/pyTA
    def _setup(self):
        print "\n Agent\t" + self.getAID().getName() + " is up"

        feedback_template = ACLTemplate()
        feedback_template.setOntology('travel')

        mt = MessageTemplate(feedback_template)
        settings = self.Travel()
        self.addBehaviour(settings, mt)
        settings.set_preferences()
示例#8
0
    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() + " je aktivan"

        feedback_template = ACLTemplate()
        feedback_template.setOntology("termin_sastanka")
        mt = MessageTemplate(feedback_template)
        termin = self.PrimiTerminSastanka()
        self.addBehaviour(termin, mt)
        termin.setGoogleAccountPodatke(self.google_client_id, self.google_client_secret, self.google_client_username,
                                       self.getAID().getName(), self.ne_preferirani_termini)
示例#10
0
    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'}))
示例#11
0
    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):

        time.sleep(5)

        print "\n Agent\t" + self.getName() + " je aktivan"

        povratna_informacija = ACLTemplate()
        povratna_informacija.setOntology("povratna_informacija")
        predlozak = spade.Behaviour.MessageTemplate(povratna_informacija)
        pregovaranje = self.Pregovaranje()

        self.addBehaviour(pregovaranje, predlozak)
        pregovaranje.prikaziIzbornik()
示例#13
0
    def _setup(self):
        print "\n Agent\t" + self.getAID().getName() + " is up"

        feedback_template = ACLTemplate()
        feedback_template.setOntology('game')

        message_template = MessageTemplate(feedback_template)

        self.addBelieve(expr('Vrijednost(gamer2)'))

        s1 = self.Evaluate(P=expr("Vrijednost( 0 )"), Q=expr("Vrijednost( 1 )"))
        # self.addPlan(self.bdiBehav, None, P=expr('Sadrzim( 1, 0 )'), Q=expr('Sadrzim( 2, 0 )'))

        g = Goal(expr('Pobjeda(gamer2)'))
        self.addGoal(g)

        settings = self.Whisper()
        self.addBehaviour(settings, message_template)
示例#14
0
 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)
示例#15
0
 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