Précédent   Forum du club des développeurs et IT Pro > Java > Général Java > Langage > Autres > Programmation par agent
Programmation par agent Forum d'entraide pour la programmation orientée agents et les frameworks associés (JADE, JACK, Jadex, JAgent, Janus, Jason, MadKit, ...)
Partagez cette discussion sur d'autres réseaux sociaux : Viadeo Twitter Google Facebook Digg Delicious MySpace Yahoo
Réponse Actualité déjà publiée
 
Outils de la discussion
Publicité
'
Vieux 12/08/2009, 13h10   #1
Djug
Rédacteur
 
Avatar de Djug
 
Homme
Inscription : mai 2007
Messages : 3 170
Détails du profil
Informations personnelles :
Sexe : Homme
Âge : 26
Localisation : Algérie

Informations forums :
Inscription : mai 2007
Messages : 3 170
Points : 19 490
Points : 19 490
Par défaut Les communications des agents JADE

Bonjour,

voici un article sur Les communications des agents JADE

http://djug.developpez.com/java/jade/communication/


vos remarques sont les bienvenues.
Djug est déconnecté   Envoyer un message privé Réponse avec citation 10
Vieux 09/09/2009, 20h40   #2
Golgotha
Modérateur
 
Avatar de Golgotha
 
Homme cédric
Artiste développeur
Inscription : août 2007
Messages : 1 060
Détails du profil
Informations personnelles :
Nom : Homme cédric
Localisation : France

Informations professionnelles :
Activité : Artiste développeur
Secteur : High Tech - Éditeur de logiciels

Informations forums :
Inscription : août 2007
Messages : 1 060
Points : 2 116
Points : 2 116
Envoyer un message via Skype™ à Golgotha
Bonjour,

j'ai essayer de faire marcher AgentA et AgentB, mais ça ne marche pas.. apparemment, AgentA se block et n'envoie jamais rien à AgentB...

Une idée ?
__________________
modérateur webmasters - développements web & php
faq jQuery - règles du forum - faqs web


mon site web : exile-reborn : un mmorpg gratuit en ligne.
Golgotha est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 09/09/2009, 21h23   #3
Djug
Rédacteur
 
Avatar de Djug
 
Homme
Inscription : mai 2007
Messages : 3 170
Détails du profil
Informations personnelles :
Sexe : Homme
Âge : 26
Localisation : Algérie

Informations forums :
Inscription : mai 2007
Messages : 3 170
Points : 19 490
Points : 19 490
je viens de retester l'exemple il fonctionne très bien.

comment tu lances tes agents ? quelle est la commande utilisé

dans mon cas j'ai utilisé les deux commandes suivantes (pour lancer chaque agent dans un nouveau Container):
Code :
1
2
3
 
java jade.Boot -container AgentA:AgentA
java jade.Boot -container AgentB:AgentB


voici le résultat:

dans la fenêtre de l'agent AgentA
Citation:
9 sept. 2009 20:19:54 jade.core.Runtime beginContainer
INFO: ----------------------------------
This is JADE 3.5 - revision 5988 of 2007/06/21 11:02:30
downloaded in Open Source, under LGPL restrictions,
at http://jade.tilab.com/
----------------------------------------
9 sept. 2009 20:19:54 jade.core.BaseService init
INFO: Service jade.core.management.AgentManagement initialized
9 sept. 2009 20:19:54 jade.core.BaseService init
INFO: Service jade.core.messaging.Messaging initialized
9 sept. 2009 20:19:54 jade.core.BaseService init
INFO: Service jade.core.mobility.AgentMobility initialized
9 sept. 2009 20:19:54 jade.core.BaseService init
INFO: Service jade.core.event.Notification initialized
9 sept. 2009 20:19:54 jade.core.messaging.MessagingService clearCachedSlice
INFO: Clearing cache
9 sept. 2009 20:19:54 jade.core.AgentContainerImpl joinPlatform
INFO: --------------------------------------
Agent container Container-3@workstation is ready.
--------------------------------------------
---------------------------------------
----------------agent A----------------
---------------------------------------
en attente de l agent B
envoi de la valeur 9
en attente de l agent B
envoi de la valeur 9
en attente de l agent B
envoi de la valeur 8
en attente de l agent B
envoi de la valeur 1
en attente de l agent B
envoi de la valeur 7
en attente de l agent B
envoi de la valeur 7
en attente de l agent B
envoi de la valeur 9
en attente de l agent B
envoi de la valeur 4
en attente de l agent B
envoi de la valeur 3
arret de l'agent
et dans la fenêtre de l'agent AgentB:
Citation:
9 sept. 2009 20:19:54 jade.core.Runtime beginContainer
INFO: ----------------------------------
This is JADE 3.5 - revision 5988 of 2007/06/21 11:02:30
downloaded in Open Source, under LGPL restrictions,
at http://jade.tilab.com/
----------------------------------------
9 sept. 2009 20:19:54 jade.core.BaseService init
INFO: Service jade.core.management.AgentManagement initialized
9 sept. 2009 20:19:54 jade.core.BaseService init
INFO: Service jade.core.messaging.Messaging initialized
9 sept. 2009 20:19:54 jade.core.BaseService init
INFO: Service jade.core.mobility.AgentMobility initialized
9 sept. 2009 20:19:54 jade.core.BaseService init
INFO: Service jade.core.event.Notification initialized
9 sept. 2009 20:19:54 jade.core.messaging.MessagingService clearCachedSlice
INFO: Clearing cache
9 sept. 2009 20:19:54 jade.core.AgentContainerImpl joinPlatform
INFO: --------------------------------------
Agent container Container-3@workstation is ready.
--------------------------------------------
---------------------------------------
----------------agent A----------------
---------------------------------------
en attente de l agent B
envoi de la valeur 9
en attente de l agent B
envoi de la valeur 9
en attente de l agent B
envoi de la valeur 8
en attente de l agent B
envoi de la valeur 1
en attente de l agent B
envoi de la valeur 7
en attente de l agent B
envoi de la valeur 7
en attente de l agent B
envoi de la valeur 9
en attente de l agent B
envoi de la valeur 4
en attente de l agent B
envoi de la valeur 3
arret de l'agent

lances les agents avec ces deux commandes et dis moi ce que tu trouve comme résultats
__________________
Tweet more than 140 characters with long-tweets.com

Tutoriels JADE (Java Agent DEvelopment Framework)
http://djug.developpez.com

Je ne réponds pas aux questions techniques par Messages privés: les forums sont faits pour ça
Djug est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 09/09/2009, 22h06   #4
Golgotha
Modérateur
 
Avatar de Golgotha
 
Homme cédric
Artiste développeur
Inscription : août 2007
Messages : 1 060
Détails du profil
Informations personnelles :
Nom : Homme cédric
Localisation : France

Informations professionnelles :
Activité : Artiste développeur
Secteur : High Tech - Éditeur de logiciels

Informations forums :
Inscription : août 2007
Messages : 1 060
Points : 2 116
Points : 2 116
Envoyer un message via Skype™ à Golgotha
Bonjour,

j'utilise ce que tu donne dans le première article :

Citation:
Et dans l'onglet arguments : tapez le code suivant :

-gui jade.Boot NomDuL'agent:LeNomDuPackage.LeNomDeLaClasse



Dans notre exemple on tape le code suivant :

-gui jade.boot smith:firstAgent.HelloWorldAgent



puis cliquez sur apply pour ne pas refaire cette configuration plusieurs fois dans le même projet
Ducoup je lance chaque agent a la suite, en remplacent les paramètres dans les configurations..

-gui jade.boot AgentA:firstAgent.AgentA
puis
-gui jade.boot AgentB:firstAgent.AgentB
pour le deuxième.

Mais ça ne marche pas..
__________________
modérateur webmasters - développements web & php
faq jQuery - règles du forum - faqs web


mon site web : exile-reborn : un mmorpg gratuit en ligne.
Golgotha est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 10/09/2009, 00h19   #5
Djug
Rédacteur
 
Avatar de Djug
 
Homme
Inscription : mai 2007
Messages : 3 170
Détails du profil
Informations personnelles :
Sexe : Homme
Âge : 26
Localisation : Algérie

Informations forums :
Inscription : mai 2007
Messages : 3 170
Points : 19 490
Points : 19 490
quand on lance un agent à partir de Eclipse de la manière mentionnée dans le 1er tuto , alors la plateforme JADE sera lancer avant le lancement de l'agent,
dans notre cas (lancement de l'agent AgentA) on va voir comme résultat:
Citation:
---------------------------------------
----------------agent A----------------
---------------------------------------
en attente de l agent B
puis l'agent s'arrête et attend l'agent AgentB


alors si on refait la même procédure pour lancer le 2em agent alors un message d'erreur apparait:
Citation:
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(Unknown Source)
at jade.core.ProfileImpl.getPlatformManager(Unknown Source)
at jade.core.ProfileImpl.getServiceManager(Unknown Source)
at jade.core.AgentContainerImpl.init(Unknown Source)
at jade.core.AgentContainerImpl.joinPlatform(Unknown Source)
at jade.core.Runtime.createMainContainer(Unknown Source)
at jade.Boot.<init>(Unknown Source)
at jade.Boot.main(Unknown Source)
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(Unknown Source)
at jade.core.ProfileImpl.createPlatformManager(Unknown Source)
at jade.core.ProfileImpl.getPlatformManager(Unknown Source)
at jade.core.ProfileImpl.getServiceManager(Unknown Source)
at jade.core.AgentContainerImpl.init(Unknown Source)
at jade.core.AgentContainerImpl.joinPlatform(Unknown Source)
at jade.core.Runtime.createMainContainer(Unknown Source)
at jade.Boot.<init>(Unknown Source)
at jade.Boot.main(Unknown Source)
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(Unknown Source)
at jade.core.ProfileImpl.createPlatformManager(Unknown Source)
at jade.core.ProfileImpl.getPlatformManager(Unknown Source)
at jade.core.ProfileImpl.getServiceManager(Unknown Source)
at jade.core.AgentContainerImpl.init(Unknown Source)
at jade.core.AgentContainerImpl.joinPlatform(Unknown Source)
at jade.core.Runtime.createMainContainer(Unknown Source)
at jade.Boot.<init>(Unknown Source)
at jade.Boot.main(Unknown Source)
9 sept. 2009 23:10:50 jade.core.Runtime$1 run
INFO: JADE is closing down now.
parce que on ne peut pas lancer deux plateforme JADE sur la même machine.

alors pour lancer le 2e agent nous avons les deux choix suivants:

1. lancer l'agent AgentB à partir de l'interface graphique de la plateforme:
clique droit sur Main-Container >Start new agent > introduire "AgentB" (sans les " )dans la zone du nom de l'agent et de sa classe.

dans ce cas la, il faut que la classe de l'agent soit dans un dossier dont le chemin fait partie de la variable d'environnement classpath

2. lancer l'agent AgentB par la ligne de commande de la manière suivante:


Code :
java jade.Boot -container AgentB:AgentB
__________________
Tweet more than 140 characters with long-tweets.com

Tutoriels JADE (Java Agent DEvelopment Framework)
http://djug.developpez.com

Je ne réponds pas aux questions techniques par Messages privés: les forums sont faits pour ça
Djug est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 10/09/2009, 09h45   #6
Golgotha
Modérateur
 
Avatar de Golgotha
 
Homme cédric
Artiste développeur
Inscription : août 2007
Messages : 1 060
Détails du profil
Informations personnelles :
Nom : Homme cédric
Localisation : France

Informations professionnelles :
Activité : Artiste développeur
Secteur : High Tech - Éditeur de logiciels

Informations forums :
Inscription : août 2007
Messages : 1 060
Points : 2 116
Points : 2 116
Envoyer un message via Skype™ à Golgotha
Ok, merci beaucoup !

Les articles sont très bien, j'espère qu'il y en aura d'autre.

Sinon pour le dernière article, avec les deux agent, pour les lancer proprement dans éclipse on peut faire un agent "Monde" ou AgentZ par exemple et lancer les deux agent AgentA et AgentB par cette agent :

Code :
1
2
3
4
5
AgentA = container.createNewAgent("AgentA", "MyfirstAgent.AgentA", null);
AgentA.start();
 
AgentB = container.createNewAgent("AgentB", "MyfirstAgent.AgentB", null);
AgentB.start();
Qu'en pense tu ?
__________________
modérateur webmasters - développements web & php
faq jQuery - règles du forum - faqs web


mon site web : exile-reborn : un mmorpg gratuit en ligne.
Golgotha est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 10/09/2009, 12h19   #7
Djug
Rédacteur
 
Avatar de Djug
 
Homme
Inscription : mai 2007
Messages : 3 170
Détails du profil
Informations personnelles :
Sexe : Homme
Âge : 26
Localisation : Algérie

Informations forums :
Inscription : mai 2007
Messages : 3 170
Points : 19 490
Points : 19 490
voici le code d'un agent Lanceur.java" qui va lancer les deux premiers agents l'un après l'autre:

Code java :
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
 
import jade.core.Agent;
import jade.core.Runtime;
import jade.core.Profile;
import jade.core.ProfileImpl;
import jade.wrapper.*;
 
 
 
public class AgLAg extends Agent {
 
 
 
	protected void setup(){
 
		System.out.println("je m appel    "+ getLocalName());
 
 
 
 
		Runtime rt = Runtime.instance();
		Profile p = new ProfileImpl();
		ContainerController cc = rt.createAgentContainer(p);
 
 
 
		AgentController AgentFils;
		AgentController AgentFils2;
 
 
 
			System.out.println("l'agent "+ getLocalName()+ " va lancer les deux agents AgentA et AgentB ");
 
			try {
				AgentFils = cc.createNewAgent("AgentA","AgentA",null);
				AgentFils.start();
				AgentFils2 = cc.createNewAgent("AgnetB","AgentB",null);
				AgentFils2.start();
 
 
			} catch (StaleProxyException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
 
 
 
 
	}
}
__________________
Tweet more than 140 characters with long-tweets.com

Tutoriels JADE (Java Agent DEvelopment Framework)
http://djug.developpez.com

Je ne réponds pas aux questions techniques par Messages privés: les forums sont faits pour ça
Djug est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 10/09/2009, 13h25   #8
Golgotha
Modérateur
 
Avatar de Golgotha
 
Homme cédric
Artiste développeur
Inscription : août 2007
Messages : 1 060
Détails du profil
Informations personnelles :
Nom : Homme cédric
Localisation : France

Informations professionnelles :
Activité : Artiste développeur
Secteur : High Tech - Éditeur de logiciels

Informations forums :
Inscription : août 2007
Messages : 1 060
Points : 2 116
Points : 2 116
Envoyer un message via Skype™ à Golgotha
Parfait

Merci !
__________________
modérateur webmasters - développements web & php
faq jQuery - règles du forum - faqs web


mon site web : exile-reborn : un mmorpg gratuit en ligne.
Golgotha est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 19/12/2009, 11h14   #9
zelda19
Invité de passage
 
Inscription : décembre 2009
Messages : 2
Détails du profil
Informations forums :
Inscription : décembre 2009
Messages : 2
Points : 1
Points : 1
bonjour;
alors , j"essaye de faire integré une inerface graphique avec un agent,
mé je ne sé pa comment attacher mon interface avec cette agent; j'attend votre aide les amis , pliiiiiiiiiiiiiz
zelda19 est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 22/12/2009, 15h26   #10
Djug
Rédacteur
 
Avatar de Djug
 
Homme
Inscription : mai 2007
Messages : 3 170
Détails du profil
Informations personnelles :
Sexe : Homme
Âge : 26
Localisation : Algérie

Informations forums :
Inscription : mai 2007
Messages : 3 170
Points : 19 490
Points : 19 490
tu trouvera un exemple sur l'utilisation d'un GUI avec JADE dans la section exemple du JADE

Citation:
JADE-examples-3.x\jade\src\examples\bookTrading
__________________
Tweet more than 140 characters with long-tweets.com

Tutoriels JADE (Java Agent DEvelopment Framework)
http://djug.developpez.com

Je ne réponds pas aux questions techniques par Messages privés: les forums sont faits pour ça
Djug est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 05/02/2010, 20h38   #11
nxmatar
Invité de passage
 
Matar Niang
Inscription : février 2010
Messages : 1
Détails du profil
Informations personnelles :
Nom : Matar Niang

Informations forums :
Inscription : février 2010
Messages : 1
Points : 1
Points : 1
Citation:
Envoyé par Djug Voir le message
voici le code d'un agent Lanceur.java" qui va lancer les deux premiers agents l'un après l'autre:

Code java :
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
 
import jade.core.Agent;
import jade.core.Runtime;
import jade.core.Profile;
import jade.core.ProfileImpl;
import jade.wrapper.*;
 
 
 
public class AgLAg extends Agent {
 
 
 
	protected void setup(){
 
		System.out.println("je m appel    "+ getLocalName());
 
 
 
 
		Runtime rt = Runtime.instance();
		Profile p = new ProfileImpl();
		ContainerController cc = rt.createAgentContainer(p);
 
 
 
		AgentController AgentFils;
		AgentController AgentFils2;
 
 
 
			System.out.println("l'agent "+ getLocalName()+ " va lancer les deux agents AgentA et AgentB ");
 
			try {
				AgentFils = cc.createNewAgent("AgentA","AgentA",null);
				AgentFils.start();
				AgentFils2 = cc.createNewAgent("AgnetB","AgentB",null);
				AgentFils2.start();
 
 
			} catch (StaleProxyException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
 
 
 
 
	}
}
Bonjour,
je suis nouveau avec la plateforme Jade j'essaie d'exécuter les 2 agents (A et B) en utilisant ton lanceur mais je n'arrive pas à le faire ça m'affiche des erreurs. Svp pouvez-vous m'expliquer comment on l'exécute?


voici ce qui affiché:
Code java :
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
60
 
5 févr. 2010 20:48:32 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/
----------------------------------------
5 févr. 2010 20:48:34 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:342)
	at jade.core.AgentContainerImpl.joinPlatform(AgentContainerImpl.java:478)
	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:342)
	at jade.core.AgentContainerImpl.joinPlatform(AgentContainerImpl.java:478)
	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:342)
	at jade.core.AgentContainerImpl.joinPlatform(AgentContainerImpl.java:478)
	at jade.core.Runtime.createMainContainer(Runtime.java:148)
	at jade.Boot.<init>(Boot.java:130)
	at jade.Boot.main(Boot.java:70)
5 févr. 2010 20:48:34 jade.core.Runtime$1 run
INFO: JADE is closing down now.
nxmatar est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 10/02/2010, 08h39   #12
Djug
Rédacteur
 
Avatar de Djug
 
Homme
Inscription : mai 2007
Messages : 3 170
Détails du profil
Informations personnelles :
Sexe : Homme
Âge : 26
Localisation : Algérie

Informations forums :
Inscription : mai 2007
Messages : 3 170
Points : 19 490
Points : 19 490
peux-tu indiquer comment tu lances chaque agents (l'ordre d'exécution, les commandes utilisées)?
__________________
Tweet more than 140 characters with long-tweets.com

Tutoriels JADE (Java Agent DEvelopment Framework)
http://djug.developpez.com

Je ne réponds pas aux questions techniques par Messages privés: les forums sont faits pour ça
Djug est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 10/02/2010, 20h02   #13
mimish
Nouveau Membre du Club
 
Inscription : avril 2009
Messages : 158
Détails du profil
Informations forums :
Inscription : avril 2009
Messages : 158
Points : 39
Points : 39
Par défaut Probléme avec JADE

Bonsoir tous le monde,
je suis un débutant avec les agents mobile, j'ai essayer ce tutoriel (http://djug.developpez.com/java/jade/creation-agent/) qui explique comment crée votre premier agent mobile.
j'ai fais tous ce qu'il dit mais il m'affiche pas le bon résultat, voilà ce qu'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
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
60
61
62
63
10 févr. 2010 19:38:46 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/
----------------------------------------
10 févr. 2010 19:38:47 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: Communication failure while starting JADE Runtime System. Check if the RMIRegistry CLASSPATH includes the RMI Stub classes of JADE. [nested java.rmi.server.ExportException: Port already in use: 1099; nested exception is: 
	java.net.BindException: Address already in use: JVM_Bind]]
	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:342)
	at jade.core.AgentContainerImpl.joinPlatform(AgentContainerImpl.java:478)
	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: Communication failure while starting JADE Runtime System. Check if the RMIRegistry CLASSPATH includes the RMI Stub classes of JADE. [nested java.rmi.server.ExportException: Port already in use: 1099; nested exception is: 
	java.net.BindException: Address already in use: JVM_Bind]
	at jade.imtp.rmi.RMIIMTPManager.exportPlatformManager(RMIIMTPManager.java:273)
	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:342)
	at jade.core.AgentContainerImpl.joinPlatform(AgentContainerImpl.java:478)
	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.server.ExportException: Port already in use: 1099; nested exception is: 
	java.net.BindException: Address already in use: JVM_Bind
	at sun.rmi.transport.tcp.TCPTransport.listen(Unknown Source)
	at sun.rmi.transport.tcp.TCPTransport.exportObject(Unknown Source)
	at sun.rmi.transport.tcp.TCPEndpoint.exportObject(Unknown Source)
	at sun.rmi.transport.LiveRef.exportObject(Unknown Source)
	at sun.rmi.server.UnicastServerRef.exportObject(Unknown Source)
	at sun.rmi.registry.RegistryImpl.setup(Unknown Source)
	at sun.rmi.registry.RegistryImpl.<init>(Unknown Source)
	at java.rmi.registry.LocateRegistry.createRegistry(Unknown Source)
	at jade.imtp.rmi.RMIIMTPManager.getRmiRegistry(RMIIMTPManager.java:209)
	at jade.imtp.rmi.RMIIMTPManager.exportPlatformManager(RMIIMTPManager.java:223)
	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:342)
	at jade.core.AgentContainerImpl.joinPlatform(AgentContainerImpl.java:478)
	at jade.core.Runtime.createMainContainer(Runtime.java:148)
	at jade.Boot.<init>(Boot.java:130)
	at jade.Boot.main(Boot.java:70)
Caused by: java.net.BindException: Address already in use: JVM_Bind
	at java.net.PlainSocketImpl.socketBind(Native Method)
	at java.net.PlainSocketImpl.bind(Unknown Source)
	at java.net.ServerSocket.bind(Unknown Source)
	at java.net.ServerSocket.<init>(Unknown Source)
	at java.net.ServerSocket.<init>(Unknown Source)
	at sun.rmi.transport.proxy.RMIDirectSocketFactory.createServerSocket(Unknown Source)
	at sun.rmi.transport.proxy.RMIMasterSocketFactory.createServerSocket(Unknown Source)
	at sun.rmi.transport.tcp.TCPEndpoint.newServerSocket(Unknown Source)
	... 18 more
10 févr. 2010 19:38:47 jade.core.Runtime$1 run
INFO: JADE is closing down now.
au lieu de
Code :
1
2
3
4
5
6
7
8
9
10
11
12
-----blablaba
----blablaba
-----blablaba
sun.rmi.transport.proxy.RMIMasterSocketFactory.createServerSocket(Unknown Source)
	at sun.rmi.transport.tcp.TCPEndpoint.newServerSocket(Unknown Source)
	... 18 more
10 févr. 2010 19:38:47 jade.core.Runtime$1 run
INFO:-----------------------------
Agent container Main-container@djug is realy
-----------------------------------
Hello word my name is smith
et voila mon code :
Code :
1
2
3
4
5
6
7
8
9
10
11
12
13
14
package firstAgent;
import jade.core.Agent;
/**
This example shows a minimal agent that just prints "Hello World!"
and then terminates.
@author Giovanni Caire - TILAB
*/
public class HelloWorldAgent extends Agent {
protected void setup() {
System.out.println("Hello World! My name is "+getLocalName());
// Make this agent terminate
doDelete();
}
}

Je peux savoir Pourquoi ?
Merci d'avance
mimish est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 11/02/2010, 12h36   #14
mimish
Nouveau Membre du Club
 
Inscription : avril 2009
Messages : 158
Détails du profil
Informations forums :
Inscription : avril 2009
Messages : 158
Points : 39
Points : 39
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
mimish est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 12/02/2010, 08h37   #15
Djug
Rédacteur
 
Avatar de Djug
 
Homme
Inscription : mai 2007
Messages : 3 170
Détails du profil
Informations personnelles :
Sexe : Homme
Âge : 26
Localisation : Algérie

Informations forums :
Inscription : mai 2007
Messages : 3 170
Points : 19 490
Points : 19 490
comment tu lances les agents? (quelles sont les commandes utilisées)?
__________________
Tweet more than 140 characters with long-tweets.com

Tutoriels JADE (Java Agent DEvelopment Framework)
http://djug.developpez.com

Je ne réponds pas aux questions techniques par Messages privés: les forums sont faits pour ça
Djug est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 12/02/2010, 09h54   #16
mimish
Nouveau Membre du Club
 
Inscription : avril 2009
Messages : 158
Détails du profil
Informations forums :
Inscription : avril 2009
Messages : 158
Points : 39
Points : 39
c'est Bon Djug j'ai trouvé mon erreur , il faut juste préciser pour les membres que quand vous ajoutez la class AgLAgqui permet de lancer AgentA et AgentB il faut lui attribuer un nom comme dans le premier tuto, contrairement a AgentA et AgentB.

merci Djug
mimish est déconnecté   Envoyer un message privé Réponse avec citation 10
Vieux 12/02/2010, 23h18   #17
mimish
Nouveau Membre du Club
 
Inscription : avril 2009
Messages : 158
Détails du profil
Informations forums :
Inscription : avril 2009
Messages : 158
Points : 39
Points : 39
Bonjour,
Dans le tuto concernant les Behaviours, j'ai vu une manière bizarre de créer et initialiser un behaviour pour le passer en argument à addBehaviour(...) :

Code :
1
2
3
4
5
6
 
addBehaviour(new TickerBehaviour(this, 2000) {
			protected void onTick() {
				System.out.println("Il reste "+(nombreDeSecondes-getTickCount())+" seconds ");
			} 
		});
Pouvez vous m'expliquer celà ? Peut on faire autrement ?

Pour un autre bout de code qui est le suivant :

Code :
1
2
3
4
5
6
 
addBehaviour(new OneShotBehaviour(this){
			public void action(){
			    System.out.println("Hola blabla");
		  }
	  });
J'ai pue le remplacer par ce qui suit, pour bien le comprendre (mais pour le code concernant les behaviours planifiés, je ne vois pas vraiment) :

Code :
1
2
3
4
5
6
7
8
9
10
11
 
<...>
protected void setup() {
   addBehaviour(new MaClass());
}
private class MaClass extends OneShotBehaviour {
   public void action(){
      System.out.println("Hola blabla");
   }
}
<...>
Merci
mimish est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 15/02/2010, 08h42   #18
Djug
Rédacteur
 
Avatar de Djug
 
Homme
Inscription : mai 2007
Messages : 3 170
Détails du profil
Informations personnelles :
Sexe : Homme
Âge : 26
Localisation : Algérie

Informations forums :
Inscription : mai 2007
Messages : 3 170
Points : 19 490
Points : 19 490
Citation:
Bonjour,
Dans le tuto concernant les Behaviours, j'ai vu une manière bizarre de créer et initialiser un behaviour pour le passer en argument à addBehaviour(...) :
c'est la manière la plus efficace pour ajouter un behaviour.


tu peux aussi faire:

Code :
1
2
3
4
5
6
7
 
behaviour monBeh =new TickerBehaviour(this, 2000) {
			protected void onTick() {
				System.out.println("Il reste "+(nombreDeSecondes-getTickCount())+" seconds ");
			} 
		}
addBehaviour(monBeh );
création d'une variable en plus



et j'ai pas bien compris la 2em question (si tu peux la poser d'une autre manière)
__________________
Tweet more than 140 characters with long-tweets.com

Tutoriels JADE (Java Agent DEvelopment Framework)
http://djug.developpez.com

Je ne réponds pas aux questions techniques par Messages privés: les forums sont faits pour ça
Djug est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 15/02/2010, 18h47   #19
mimish
Nouveau Membre du Club
 
Inscription : avril 2009
Messages : 158
Détails du profil
Informations forums :
Inscription : avril 2009
Messages : 158
Points : 39
Points : 39
Ma deuxième question étais:
comment écrire les Behaviours planifiés de façon a déclarer le Behaviour dans la méthode Setup() mais ses méthodes ( onTick ou bien onWake ) en dehors de Setup() ?
comme les Behaviours simple j'ai pue faire :
Code :
1
2
3
4
5
6
7
8
9
10
<...>
protected void setup() {
   addBehaviour(new MaClass());
}
private class MaClass extends OneShotBehaviour {
   public void action(){
      System.out.println("Hola blabla");
   }
}
<...>
mais puisque tu dit que l'autre maniére c'est la plus efficace alors on fait avec .
maintenant est ce que je peu savoir quel est l'ordre d'exécution des Behaviours ? quand je lance un programme qui contient un OneShotBehaviour , CyclicBehaviour puis Genéric Behaviour selon cet ordre , il commence par l'éxécution de OneShotBehaviour ensuite CyclicBehaviour ensuite Genéric Behaviour ensuite CyclicBehaviour ensuite Genéric Behaviour.... alors que je m'attendais a l'éxécution de OneShotBehaviour puis CyclicBehaviour( comme une boucle infini puique done() return false ) et l'éxécution de Genéric Behaviour n'aura jamais lieu !!!
mimish est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 16/02/2010, 08h28   #20
Djug
Rédacteur
 
Avatar de Djug
 
Homme
Inscription : mai 2007
Messages : 3 170
Détails du profil
Informations personnelles :
Sexe : Homme
Âge : 26
Localisation : Algérie

Informations forums :
Inscription : mai 2007
Messages : 3 170
Points : 19 490
Points : 19 490
pour déclarer un behaviour en dehors de la méthode setup() on peux envisager la méthode suivante (utiliser quand le corps du behaviour est de grande taille et c'est un behaviour quand utilise plusieurs fois):


créer une Inner class (une classe écrite dans le meme fichier que la classe de l'agent en question). on l'appel monBehaviour:

ajouter le behaviour de la manière suivante:

Code :
addBehaviour(new monBehaviour());
pour définir l'ordre d'exécution, il faut utiliser les FSMBehaviour (une sorte de machine d'états finis)


PS: il est préférable de poser les questions sur les Behaviour ici
__________________
Tweet more than 140 characters with long-tweets.com

Tutoriels JADE (Java Agent DEvelopment Framework)
http://djug.developpez.com

Je ne réponds pas aux questions techniques par Messages privés: les forums sont faits pour ça
Djug est déconnecté   Envoyer un message privé Réponse avec citation 00
Réponse Actualité déjà publiée
Outils de la discussion

Navigation rapide


Fuseau horaire GMT +2. Il est actuellement 23h10.


 
 
 
 
Partenaires

Hébergement Web