2 agent discute chacun dans un pc different
voila l'ami mon problème :
j'ai 2 agents sur 2 ordi et je veux qu'ils discute mais ca marche pas voila le code du lancement des 2 agents chacun sur un pc :
code du lancement de l'agent1 sur pc1 dans le port 8888:
Code:
1 2 3 4 5 6 7 8 9 10
| Runtime rt = Runtime.instance();
Profile p = new ProfileImpl(nul,8888,nul);
ContainerController cc = rt.createAgentContainer(p);
AgentController AgentFils1;
try {
AgentFils1=cc.createNewAgent("Agent1","firstAgent.Agent1",null);
AgentFils1.start();
} catch (StaleProxyException e) {
e.printStackTrace();
} |
code du lance ment de l'agent2 sur le port 8888:
Code:
1 2 3 4 5 6 7 8 9 10
| Runtime rt = Runtime.instance();
Profile p = new ProfileImpl(nul,8888,nul);
ContainerController cc = rt.createAgentContainer(p);
AgentController AgentFils1;
try {
AgentFils1=cc.createNewAgent("Agent2","firstAgent.Agent2",null);
AgentFils1.start();
} catch (StaleProxyException e) {
e.printStackTrace();
} |
probleme sur l'exemple tut 1 de l'agent HelloWorldAgent
Bonsoir,
Malgré k j'au utilisé deux versions différentes d'ECLIPSE, j'ai la même réponse comme celle de l'internaute "mimish" qui confirme qu'il a réglé le probleme qui été au niveau d'eclipse.
Sachant k j'ai essayé la version 3.5.2 et 3.5.1, mais son succés. Le message suivant s'affiche:
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59
| 23 juin 2010 01:51:24 jade.core.Runtime beginContainer
INFO: ----------------------------------
This is JADE snapshot - revision $WCREV$ of $WCDATE$
downloaded in Open Source, under LGPL restrictions,
at http://jade.tilab.com/
----------------------------------------
23 juin 2010 01:51:26 jade.core.AgentContainerImpl joinPlatform
GRAVE: Some problem occurred while joining agent platform.
jade.core.ProfileException: Can't get a proxy to the Platform Manager [nested jade.core.IMTPException: The Service Manager was already bound in the RMI Registry [nested java.rmi.AlreadyBoundException: ServiceManager]]
at jade.core.ProfileImpl.createPlatformManager(ProfileImpl.java:574)
at jade.core.ProfileImpl.getPlatformManager(ProfileImpl.java:487)
at jade.core.ProfileImpl.getServiceManager(ProfileImpl.java:501)
at jade.core.AgentContainerImpl.init(AgentContainerImpl.java:336)
at jade.core.AgentContainerImpl.joinPlatform(AgentContainerImpl.java:472)
at jade.core.Runtime.createMainContainer(Runtime.java:148)
at jade.Boot.<init>(Boot.java:130)
at jade.Boot.main(Boot.java:70)
Nested Exception:
jade.core.IMTPException: The Service Manager was already bound in the RMI Registry [nested java.rmi.AlreadyBoundException: ServiceManager]
at jade.imtp.rmi.RMIIMTPManager.exportPlatformManager(RMIIMTPManager.java:276)
at jade.core.ProfileImpl.createPlatformManager(ProfileImpl.java:563)
at jade.core.ProfileImpl.getPlatformManager(ProfileImpl.java:487)
at jade.core.ProfileImpl.getServiceManager(ProfileImpl.java:501)
at jade.core.AgentContainerImpl.init(AgentContainerImpl.java:336)
at jade.core.AgentContainerImpl.joinPlatform(AgentContainerImpl.java:472)
at jade.core.Runtime.createMainContainer(Runtime.java:148)
at jade.Boot.<init>(Boot.java:130)
at jade.Boot.main(Boot.java:70)
Nested Exception:
java.rmi.AlreadyBoundException: ServiceManager
at sun.rmi.registry.RegistryImpl.bind(Unknown Source)
at sun.rmi.registry.RegistryImpl_Skel.dispatch(Unknown Source)
at sun.rmi.server.UnicastServerRef.oldDispatch(Unknown Source)
at sun.rmi.server.UnicastServerRef.dispatch(Unknown Source)
at sun.rmi.transport.Transport$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at sun.rmi.transport.Transport.serviceCall(Unknown Source)
at sun.rmi.transport.tcp.TCPTransport.handleMessages(Unknown Source)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(Unknown Source)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(Unknown Source)
at sun.rmi.transport.StreamRemoteCall.executeCall(Unknown Source)
at sun.rmi.server.UnicastRef.invoke(Unknown Source)
at sun.rmi.registry.RegistryImpl_Stub.bind(Unknown Source)
at java.rmi.Naming.bind(Unknown Source)
at jade.imtp.rmi.RMIIMTPManager.exportPlatformManager(RMIIMTPManager.java:224)
at jade.core.ProfileImpl.createPlatformManager(ProfileImpl.java:563)
at jade.core.ProfileImpl.getPlatformManager(ProfileImpl.java:487)
at jade.core.ProfileImpl.getServiceManager(ProfileImpl.java:501)
at jade.core.AgentContainerImpl.init(AgentContainerImpl.java:336)
at jade.core.AgentContainerImpl.joinPlatform(AgentContainerImpl.java:472)
at jade.core.Runtime.createMainContainer(Runtime.java:148)
at jade.Boot.<init>(Boot.java:130)
at jade.Boot.main(Boot.java:70)
23 juin 2010 01:51:26 jade.core.Runtime$1 run
INFO: JADE is closing down now. |
SVP, réponsez moi. Merci
quel type de behaviour utiliser?
Citation:
Bonsoir,
je dois implementer un modèle de négociation que j'ai conçu. Ce modèle est constitué de deux phases:
phase1: un agent client négocie avec un ensemble d'agents fournisseurs selon un protocole simple que nous pouvons modéliser par un automate.
Pour implementer ce protocole j'imagine utiliser des behaviours simples.
Cependant, pour la phase 2 du modèle l'agent client négocie avec un sous ensemble des agents fournisseurs selon un protocole un petit peu compliqué. C'est un protocole d'offres alternatives ou il a les trois choix suivants:
1. accepter un offre
2. générer une contre offre
3. rejeter l'offre
Ce protocole s'excute sur plusieurs tour jusqu'à trouver une entente ou terminer par un echec.
Bref, voilà ma question:
QUEL BEHAVIOUR DOIS JE UTILISER POUR LA PHASE 2?
:roll: