Bonjour à tous!
pour le lancement de deux agents j'applique tous ce que dit là, mais aucune choseles agents ne veulent pas lancer
hier j'ai testé de lancer les deux agents A et B et j'ai réussi et j'ai fait la suite:
1/ j'ai mis dans l'onglet Arguments de Run configuration de la classe de l'agent A : -gui " pour lancer le Jade seulement"
2/ et après j'ai lancé l'agent A par l'icon "start new agent", donc il m'affiche
3/ la meme chose pour l'agent B , il m'affiche le résultat qu'il faut m'apparait.---------------------------------------
----------------agent A----------------
---------------------------------------
en attente de l agent B
mais aujourd'hui , il m'affiche une erreur et je ne sais pas pourquoi
il m'affiche comme ça lorsque je crée l'agent B
une idée, svp????----------------agent B----------------
*** Uncaught Exception for agent b ***
java.lang.NumberFormatException: For input string: "( (action ( agent-identifier :name b@192.168.1.4:1099/JADE :addresses (sequence http://UTILISATEUR-PC:7778/acc )) (ACLMessage) ) (MTS-error ( agent-identifier :name AgentA@192.168.1.4:1099/JADE ) (internal-error "Agent not found: getContainerID() failed to find agent AgentA@192.168.1.4:1099/JADE")) )"
at java.lang.NumberFormatException.forInputString(Unknown Source)
at java.lang.Integer.parseInt(Unknown Source)
at java.lang.Integer.parseInt(Unknown Source)ERROR: Agent b died without being properly terminated !!!
State was 2
at firstAgent.AgentB$afficher.action(AgentB.java:47)
at jade.core.behaviours.Behaviour.actionWrapper(Behaviour.java:344)
at jade.core.behaviours.CompositeBehaviour.action(CompositeBehaviour.java:109)
at jade.core.behaviours.Behaviour.actionWrapper(Behaviour.java:344)
at jade.core.Agent$ActiveLifeCycle.execute(Agent.java:1504)
at jade.core.Agent.run(Agent.java:1443)
at java.lang.Thread.run(Unknown Source)
le message d'erreur
indique que le 2e agent n'a pas pu trouvé le premier Agent nommé AgentA.
Code : Sélectionner tout - Visualiser dans une fenêtre à part gent not found: getContainerID() failed to find agent AgentA@192.168.1.4:1099/JADE
il me semble que tu as nommé tes agents en a et b (au lieu de AgentA et AgentB) et du coup tu dois également remplacer AgentA par a et AgentB par a et b dans le code des 2 agents.
Merci Mr.Djug pour votre réponse
vous voulez me dire qu'il faut nommer les agents: AgentA et AgentB comme leurs classes ??
si oui, j'avais cru que les noms des agents sont choisis aléatoirement![]()
jé essayé l'exemple de communication qui se trouve dans le tutoriel mé ça pas marchéil affiche le message suivant:
22 févr. 2012 10:29:43 jade.core.Runtime beginContainer
INFO: ----------------------------------
This is JADE 3.6 - revision 6032 of 2008/05/05 14:07:10
downloaded in Open Source, under LGPL restrictions,
at http://jade.tilab.com/
----------------------------------------
22 févr. 2012 10:29:45 jade.core.BaseService init
INFO: Service jade.core.management.AgentManagement initialized
22 févr. 2012 10:29:45 jade.core.BaseService init
INFO: Service jade.core.messaging.Messaging initialized
22 févr. 2012 10:29:45 jade.core.BaseService init
INFO: Service jade.core.mobility.AgentMobility initialized
22 févr. 2012 10:29:45 jade.core.BaseService init
INFO: Service jade.core.event.Notification initialized
22 févr. 2012 10:29:45 jade.core.messaging.MessagingService clearCachedSlice
INFO: Clearing cache
22 févr. 2012 10:29:45 jade.mtp.http.HTTPServer <init>
INFO: HTTP-MTP Using XML parser com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser
22 févr. 2012 10:29:45 jade.core.messaging.MessagingService boot
INFO: MTP addresses:
http://192.168.50.42:7778/acc
22 févr. 2012 10:29:45 jade.core.AgentContainerImpl joinPlatform
INFO: --------------------------------------
Agent container Main-Container@hpcompak-HP is ready.
--------------------------------------------
----------------agent B----------------
*** Uncaught Exception for agent toutou ***
java.lang.NumberFormatException: For input string: "( (action ( agent-identifier :name toutou@hpcompak-HP:1099/JADE :addresses (sequence http://192.168.50.42:7778/acc )) (ACLMessage) ) (MTS-error ( agent-identifier :name AgentA@hpcompak-HP:1099/JADE ) (internal-error "Agent not found: getContainerID() failed to find agent AgentA@hpcompak-HP:1099/JADE")) )"
at java.lang.NumberFormatException.forInputString(Unknown Source)
at java.lang.Integer.parseInt(Unknown Source)
at java.lang.Integer.parseInt(Unknown Source)
at firstAgent.HelloWorldAgent$afficher.action(HelloWorldAgent.java:59)
at jade.core.behaviours.Behaviour.actionWrapper(Behaviour.java:340)
at jade.core.behaviours.CompositeBehaviour.action(CompositeBehaviour.java:109)
at jade.core.behaviours.Behaviour.actionWrapper(Behaviour.java:340)
at jade.core.Agent$ActiveLifeCycle.execute(Agent.java:1530)
at jade.core.Agent.run(Agent.java:1468)
at java.lang.Thread.run(Unknown Source)
ERROR: Agent toutou died without being properly terminated !!!
State was 2
salut
est ce qu'on peut lançer deux agents jade en parallèle et comment?
j'ai essayé votre tutoriel (communication) mais ça na marche pas il se bloque à ------------ agentB---------------
merci cordialement
bonjour djug
je n'arrive pas à faire migrer les agents entre plateformes
j'ai creé deux plateformes
j'ai creé una agent Agent1 dans la plateform1 mais je n'arrive as à le faire migrer vers l'autre platefrome
voici le code que j'ai essayé
Code : Sélectionner tout - Visualiser dans une fenêtre à part
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 import jade.core.*; import jade.core.Runtime; import jade.core.behaviours.OneShotBehaviour; import jade.wrapper.AgentContainer; import jade.wrapper.AgentController; import jade.wrapper.ContainerController; import jade.wrapper.ControllerException; import jade.wrapper.PlatformController.Listener; import jade.wrapper.PlatformState; import jade.wrapper.PlatformEvent; import jade.wrapper.StaleProxyException; import jade.domain.mobility.MobilityOntology; import jade.core.mobility.AgentMobilityService; public class essai extends Agent { public void setup(){ System.out.println("hellow je suis l'agent" +getLocalName()); Runtime rt =Runtime.instance(); Profile pmain = new ProfileImpl(null,9999,null); AgentContainer mc=rt.createMainContainer(pmain); ProfileImpl pContainer = new ProfileImpl(null,9999,null); try { AgentController rma = mc.createNewAgent("RMA", "jade.tools.rma.rma", new Object[0]); rma.start(); } catch (StaleProxyException e) { e.printStackTrace(); } addBehaviour(new OneShotBehaviour(this){ public void action() { AID remoteAMS = new AID("ams@qlubic:9999/JADE", AID.ISGUID); // Specify the MTP by setting the transport address of the remote // AMS remoteAMS.addAddresses("http://qlubicaddr:7778/acc"); // Create the Location object PlatformID destination = new PlatformID(remoteAMS); // Change of the agent state to move myAgent.doMove(destination); }}); } }
Vous essayez de faire migrer l’agent d’un container à un autre sur la même plateforme (des containers sur une ou plusieurs machine), ou entre deux plateforme sur deux machines distincts ?
Partager