How to use the spade.DF.DfAgentDescription function in spade

To help you get started, we’ve selected a few spade examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github javipalanca / spade / examples / unittests / dadTestCase.py View on Github external
def CreateDAD(s=""):
    dad = spade.DF.DfAgentDescription()
    aid = spade.AID.aid()
    aid.setName("aidname"+s)
    dad.setAID(aid)

    dad.addProtocol("protocol1"+s)
    dad.addOntologies("ontology1"+s)
    dad.addLanguage("language1"+s)
    dad.setLeaseTime(1000)
    dad.addScope("scope1"+s)

    return dad
github javipalanca / spade / examples / unittests / dadTestCase.py View on Github external
def testMatchDAD(self):
        
        dad1 = CreateDAD("a")
        dad2 = spade.DF.DfAgentDescription()
        aid = spade.AID.aid()
        aid.setName("aidnamea")
        dad2.setAID(aid)
        self.assertEqual(dad1.match(dad2),True)
        
        dad2.addLanguage("language1a")
        self.assertEqual(dad1.match(dad2),True)
        
        dad1.addLanguage("language2a")
        self.assertEqual(dad1.match(dad2),True)

        dad2.addLanguage("language3a")
        self.assertEqual(dad1.match(dad2),False)
        
        dad1 = CreateDAD("a")
        dad2 = spade.DF.DfAgentDescription()
github javipalanca / spade / examples / unittests / dfTestCase.py View on Github external
def EmptySearch_DAD(agent):
            dad = spade.DF.DfAgentDescription()
            agent.result = agent.searchService(dad)
github javipalanca / spade / examples / unittests / dadTestCase.py View on Github external
aid = spade.AID.aid()
        aid.setName("aidnamea")
        dad2.setAID(aid)
        self.assertEqual(dad1.match(dad2),True)
        
        dad2.addLanguage("language1a")
        self.assertEqual(dad1.match(dad2),True)
        
        dad1.addLanguage("language2a")
        self.assertEqual(dad1.match(dad2),True)

        dad2.addLanguage("language3a")
        self.assertEqual(dad1.match(dad2),False)
        
        dad1 = CreateDAD("a")
        dad2 = spade.DF.DfAgentDescription()
        aid = spade.AID.aid()
        aid.setName("aidnamea")
        dad2.setAID(aid)
        sd1 = CreateSD("a")
        dad1.addService(sd1)
        dad2.addService(sd1)
        self.assertEqual(dad1.match(dad2),True)
        
        sd2 = CreateSD("b")
        dad2.addService(sd2)
        self.assertEqual(dad1.match(dad2),False)
        dad1.addService(sd2)
        self.assertEqual(dad1.match(dad2),True)
github javipalanca / spade / examples / unittests / dfTestCase.py View on Github external
def Search_2_DAD(agent, param):

            dad = spade.DF.DfAgentDescription()
            
            sd = spade.DF.ServiceDescription()
            sd.setName("unittest_name_1_"+param)
            #sd.setType("unittest_type_1")
            dad.addService(sd)
            
            sd = spade.DF.ServiceDescription()
            sd.setName("unittest_name_2_"+param)
            #sd.setType("unittest_type_1")
            dad.addService(sd)

            dad.setAID(agent.getAID())
            agent.result = agent.searchService(dad)