Package jade.wrapper

Examples of jade.wrapper.AgentController


        {
            rt.shutDown();
        }
    });
   
    AgentController initiator = cc.createNewAgent("Initiator",
        InitiatorAgent.class.getCanonicalName(), null);
    AgentController participant1 = cc.createNewAgent("Participant-1",
        ParticipantAgent.class.getCanonicalName(), null);
    AgentController participant2 = cc.createNewAgent("Participant-2",
        ParticipantAgent.class.getCanonicalName(), null);
    AgentController participant3 = cc.createNewAgent("Participant-3",
        ParticipantAgent.class.getCanonicalName(), null);
   
   
    participant1.start();
    participant2.start();
    participant3.start();
   
    initiator.start();
  }
View Full Code Here


        {
            rt.shutDown();
        }
    });
   
    AgentController initiator = cc.createNewAgent("Initiator",
        InitiatorAgent.class.getCanonicalName(), null);
   
    ArrayList<AgentController> participants = new ArrayList<AgentController>();
    for (int i=0;i<20;i++) {
      participants.add(cc.createNewAgent("Participant-"+i,
        ParticipantAgent.class.getCanonicalName(), null));
    }
   
    for (AgentController part : participants) {
      part.start();
    }
   
   
    initiator.start();
  }
View Full Code Here

        {
            rt.shutDown();
        }
    });
   
    AgentController initiator = cc.createNewAgent("Initiator",
        InitiatorAgent.class.getCanonicalName(), null);
   
    ArrayList<AgentController> participants = new ArrayList<AgentController>();
    for (int i=0;i<2;i++) {
      participants.add(cc.createNewAgent("Participant-"+i,
        ParticipantAgent.class.getCanonicalName(), null));
    }
   
    for (AgentController part : participants) {
      part.start();
    }
   
   
    initiator.start();
  }
View Full Code Here

   
    Runtime rt = Runtime.instance();
    Profile p = new ProfileImpl();
    p.setParameter("gui", "true");
    ContainerController cc = rt.createMainContainer(p);
    AgentController senderAgent1 = cc.createNewAgent("SenderAgent-1",
        SenderAgent.class.getCanonicalName(), null);
    AgentController senderAgent2 = cc.createNewAgent("SenderAgent-2",
        SenderAgent.class.getCanonicalName(), null);
    AgentController senderAgent3 = cc.createNewAgent("SenderAgent-3",
        SenderAgent.class.getCanonicalName(), null);
    AgentController receiverAgent1 = cc.createNewAgent("ReceiverAgent-1",
        ReceiverAgent.class.getCanonicalName(), null);
//    AgentController receiverAgent2 = cc.createNewAgent("ReceiverAgent-2",
//        ReceiverAgent.class.getCanonicalName(), null);
//    AgentController receiverAgent3 = cc.createNewAgent("ReceiverAgent-3",
//        ReceiverAgent.class.getCanonicalName(), null);
   
    senderAgent1.start();
    senderAgent2.start();
    senderAgent3.start();
   
    receiverAgent1.start();
//    receiverAgent2.start();
//    receiverAgent3.start();
  }
View Full Code Here

        {
            rt.shutDown();
        }
    });
   
    AgentController initiator = cc.createNewAgent("Initiator",
        InitiatorAgent.class.getCanonicalName(), null);
    AgentController participant1 = cc.createNewAgent("Participant-1",
        ParticipantAgent.class.getCanonicalName(), null);
    AgentController participant2 = cc.createNewAgent("Participant-2",
        ParticipantAgent.class.getCanonicalName(), null);
    AgentController participant3 = cc.createNewAgent("Participant-3",
        ParticipantAgent.class.getCanonicalName(), null);
   
   
    participant1.start();
    participant2.start();
    participant3.start();
   
    initiator.start();
  }
View Full Code Here

     * @param selection The operation the resource should perform
     * @param name The name of the agent that will be launched
     */
    public void addResource(String selection, String name) {
        try {
            AgentController ac = getContainerController().createNewAgent(selection + "-" + name, ResourceAgent.class.getName(), new Object[]{selection});
            // Start the AgentController so the setup will run
            ac.start();
        } catch (StaleProxyException ex) {
            Logger.getLogger(ClientAgent.class.getName()).log(Level.SEVERE, null, ex);
        }
    }
View Full Code Here

     */
    private void createNode(String resource, ACLMessage initialMessage) {
        try {
            long time = System.currentTimeMillis();
            String agentName = resource + "-node-" + time;
            AgentController agentController = getContainerController().createNewAgent(
                    agentName, NodeAgent.class.getName(),
                    new Object[]{resource, initialMessage});
            agentController.start();
            addBehaviour(new ClientBehaviour());
        } catch (StaleProxyException ex) {
            Logger.getLogger(ClientAgent.class.getName()).log(Level.SEVERE, null, ex);
        }
    }
View Full Code Here

        try{
            //MODEL = (Auto) v;
            Object[] args = new Object[1];
            args[0] = v;
            this.model = (Auto) v;
            AgentController guest = container.createNewAgent(localName, "trafficjams.agents.VehicleDriveAgent", args);
            guest.start();

        }catch (Exception e){
            e.printStackTrace();
        }
    }
View Full Code Here

TOP

Related Classes of jade.wrapper.AgentController

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.