convert classe java en classe jade
BONJOUR Mr.djug
pouvez vous nous donner quelques recommandations de convertir les classe JAVA en classe ou syntaxe JADE
merci pour la reponse
lancement de deux agents jade
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
migration entre plusieurs plateformes jade
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:
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);
}});
}
} |
migration entre plusieurs plateformes jade
bonjour djug
j'essaye de faire migrer les agents entre deux platforme sur la meme machine
c'est possibile?
je veux faire migrer les agents entre deux platformes je ne sais pas est ce que c'est possible entre la meme machine ou non?
lancement de deux plateformes
bonjour djug
voici le code qui peux lançer deux plateformes sur la meme machine ,
mais je n'arrive pas à faire migrer l'agent mobile entre ces deux platefromes.
le code:
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
| 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 amina extends Agent{
public void setup(){
System.out.println("hellow je suis l'agent" +getAID().getLocalName());
addBehaviour(new OneShotBehaviour(this){
public void action() {
Runtime rt =Runtime.instance();
Profile pMain = new ProfileImpl(null, 8888, null);
AgentContainer mc = rt.createMainContainer(pMain);
ProfileImpl pContainer = new ProfileImpl(null, 8888, null);
try {
AgentController rma = mc.createNewAgent("RMA", "jade.tools.rma.rma", new Object[0]);
rma.start();
} catch (StaleProxyException e) {
e.printStackTrace();
}
}
});
}
} |
merciiiii pour vos réponses.
SVP comment tu as pu résoudre ton problème je suis débutante avec jade
Citation:
Envoyé par
mimish
c'est Bon sa marché pour le premier tuto, le problème étais dans éclipse !
maintenant j'ai essayé le programme avec 2 agents(AgentA et AgentB) et il ne marche pas :(
j'ai ajouté la class
AgLAg.java qui ce charge de lancer les deux class:
AgentA et
AgentB
il m'affiche dans la console:
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
| 11 févr. 2010 13:14:14 jade.core.Runtime beginContainer
INFO: ----------------------------------
This is JADE 3.7 - revision 6154 of 2009/07/01 17:34:15
downloaded in Open Source, under LGPL restrictions,
at http://jade.tilab.com/
----------------------------------------
11 févr. 2010 13:14:16 jade.core.BaseService init
INFO: Service jade.core.management.AgentManagement initialized
11 févr. 2010 13:14:16 jade.core.BaseService init
INFO: Service jade.core.messaging.Messaging initialized
11 févr. 2010 13:14:16 jade.core.BaseService init
INFO: Service jade.core.mobility.AgentMobility initialized
11 févr. 2010 13:14:16 jade.core.BaseService init
INFO: Service jade.core.event.Notification initialized
11 févr. 2010 13:14:16 jade.core.messaging.MessagingService clearCachedSlice
INFO: Clearing cache11 févr. 2010 13:14:16 jade.mtp.http.HTTPServer <init>
INFO: HTTP-MTP Using XML parser com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser
11 févr. 2010 13:14:16 jade.core.messaging.MessagingService boot
INFO: MTP addresses:
<a href="http://windows-89387e3:7778/acc" target="_blank">http://windows-89387e3:7778/acc</a>
11 févr. 2010 13:14:16 jade.core.AgentContainerImpl joinPlatform
INFO: --------------------------------------
Agent container Main-Container@windows-89387e3 is ready.
-------------------------------------------- |
PS:
quand je lance l'agentA seulement , il m'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
| 11 févr. 2010 13:21:36 jade.core.Runtime beginContainer
INFO: ----------------------------------
This is JADE 3.7 - revision 6154 of 2009/07/01 17:34:15
downloaded in Open Source, under LGPL restrictions,
at http://jade.tilab.com/
----------------------------------------
11 févr. 2010 13:21:37 jade.core.BaseService init
INFO: Service jade.core.management.AgentManagement initialized
11 févr. 2010 13:21:37 jade.core.BaseService init
INFO: Service jade.core.messaging.Messaging initialized
11 févr. 2010 13:21:37 jade.core.BaseService init
INFO: Service jade.core.mobility.AgentMobility initialized
11 févr. 2010 13:21:37 jade.core.BaseService init
INFO: Service jade.core.event.Notification initialized
11 févr. 2010 13:21:37 jade.core.messaging.MessagingService clearCachedSlice
INFO: Clearing cache
11 févr. 2010 13:21:38 jade.mtp.http.HTTPServer <init>
INFO: HTTP-MTP Using XML parser com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser
11 févr. 2010 13:21:38 jade.core.messaging.MessagingService boot
INFO: MTP addresses:
http://windows-89387e3:7778/acc
11 févr. 2010 13:21:38 jade.core.AgentContainerImpl joinPlatform
INFO: --------------------------------------
Agent container Main-Container@windows-89387e3 is ready.
-------------------------------------------- |
alors que normalement il m'affiche :
Code:
1 2 3 4
| ---------------------------------------
----------------agent A----------------
---------------------------------------
en attente de l agent B |
merci