def main(): agentes = list() set_ams('localhost', 8000, debug=False) a = AgenteHorario(AID(name='horario')) a.ams = {'name': 'localhost', 'port': 8000} agentes.append(a) a = AgenteRelogio(AID(name='relogio')) a.ams = {'name': 'localhost', 'port': 8000} agentes.append(a) start_loop(agentes, gui=True)
def main(): AMS = {'name' : 'localhost', 'port' : 8000} set_ams(AMS['name'], AMS['port']) agentes = list() a = AgenteHorario(AID(name='horario')) a.ams = AMS agentes.append(a) a = AgenteRelogio(AID(name='relogio')) a.ams = AMS agentes.append(a) start_loop(agentes)
from pade.misc.utility import display_message from pade.misc.common import set_ams, start_loop from pade.core.agent import Agent from pade.acl.aid import AID class AgenteHelloWorld(Agent): def __init__(self, aid): super(AgenteHelloWorld, self).__init__(aid=aid, debug=False) display_message(self.aid.localname, 'Hello World!') if __name__ == '__main__': set_ams('localhost', 8000, debug=False) agents = list() agente_hello = AgenteHelloWorld(AID(name='agente_hello')) agente_hello.ams = {'name': 'localhost', 'port': 8000} agents.append(agente_hello) start_loop(agents, gui=True)
class AgenteParticipante(Agent): def __init__(self, aid, pot_disp): super(AgenteParticipante, self).__init__(aid=aid, debug=False) self.pot_disp = pot_disp comp = CompContNet2(self) self.behaviours.append(comp) if __name__ == "__main__": AMS = {'name' : 'localhost', 'port' : 8000} set_ams(AMS['name'], AMS['port']) aa_1 = AgenteIniciante(AID(name='AI1')) aa_1.ams = AMS aa_2 = AgenteParticipante(AID(name='AP1'), 150.0) aa_2.ams = AMS aa_3 = AgenteParticipante(AID(name='AP2'), 100.0) aa_3.ams = AMS agents_list = list([aa_1, aa_2, aa_3]) start_loop(agents_list)
self.call_later(2.0, comp.on_start) class AgenteParticipante(Agent): def __init__(self, aid, pot_disp): super(AgenteParticipante, self).__init__(aid=aid, debug=False) self.pot_disp = pot_disp comp = CompContNet2(self) self.behaviours.append(comp) if __name__ == "__main__": set_ams('localhost', 5000, debug=False) aa_1 = AgenteIniciante(AID(name='AI1')) aa_1.ams = {'name': 'localhost', 'port': 5000} aa_2 = AgenteParticipante(AID(name='AP1'), 150.0) aa_2.ams = {'name': 'localhost', 'port': 5000} aa_3 = AgenteParticipante(AID(name='AP2'), 100.0) aa_3.ams = {'name': 'localhost', 'port': 5000} agents_list = list([aa_1, aa_2, aa_3]) start_loop(agents_list, gui=True)
from pade.misc.common import set_ams, start_loop if __name__ == '__main__': set_ams('localhost', 8000) start_loop(list(), gui=True)