+package communication.ex01;
+
+import static communication.ex01.Society.COMMUNITY;
+import static communication.ex01.Society.GROUP;
+import static communication.ex01.Society.ROLE;
+
+import java.util.logging.Level;
+
+import madkit.kernel.Agent;
+import madkit.kernel.AgentAddress;
+import madkit.kernel.Message;
+
+/**
+ * Shows how agents exchange messages.
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ * To exchange messages, agents have to exist in an artificial society. That is, agents have to create communities
+ * containing groups and take roles within to interact with others. Doing so, agents get agent addresses which could be
+ * used to send them messages. Here, two agents take a role and ping the other one.
+ */
+public class PingAgent extends Agent {
+
+ /**
+ * Firstly, take a position in the artificial society
+ */
+ @Override
+ protected void activate() {
+
+ getLogger().setLevel(Level.FINEST);
+
+ createGroup(COMMUNITY, GROUP);
+ requestRole(COMMUNITY, GROUP, ROLE);
+
+ pause(500);
+ }
+
+ /**
+ * Now ping the other agent with a message
+ */
+ @Override
+ protected void live() {
+
+ // method seen in organization's tutorial
+AgentAddress other = null;
+ while (other == null) {
+ other = getAgentWithRole(COMMUNITY, GROUP, ROLE);
+ pause(1000);
+ }
+
+ getLogger().info("\n\tI found someone !!\n" + other + "\n\n");
+ pause(2000);
+
+ // sending the message to other: Success will be logged
+ sendMessage(other, new Message());
+ pause(2000);
+
+ // waiting other's message: The reception will be logged
+ waitNextMessage();
+ pause(20000);
+ }
+
+ /**
+ * @param args
+ */
+ public static void main(String[] argss) {
+ executeThisAgent(2, true);
+ // or
+ // String[] args = { "--launchAgents", PingAgent.class.getName() + ",true,2" };
+ // Madkit.main(args);
+ }
+
+}
+
+
+
+
+PingAgent.java
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/release/html/communication/communication/ex01/Society.java.html b/release/html/communication/communication/ex01/Society.java.html
new file mode 100644
index 0000000..5980f8e
--- /dev/null
+++ b/release/html/communication/communication/ex01/Society.java.html
@@ -0,0 +1,38 @@
+
+
+
+
+
+communication.ex01.Society (Java2HTML)
+
+
+
+
+
+Society.java
+
+
+
+
+
+package communication.ex01;
+
+public class Society {
+
+ public static final String COMMUNITY = "communication";
+ public static final String GROUP = "ex01";
+ public static final String ROLE = "ping agent";
+
+}
+
+
+
+
+Society.java
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/release/html/communication/communication/ex02_targetingRoles/PingAgent2.java.html b/release/html/communication/communication/ex02_targetingRoles/PingAgent2.java.html
new file mode 100644
index 0000000..e3a91de
--- /dev/null
+++ b/release/html/communication/communication/ex02_targetingRoles/PingAgent2.java.html
@@ -0,0 +1,88 @@
+
+
+
+
+
+communication.ex02_targetingRoles.PingAgent2 (Java2HTML)
+
+
+
+
+
+PingAgent2.java
+
+
+
+
+
+package communication.ex02_targetingRoles;
+
+import static communication.ex01.Society.COMMUNITY;
+import static communication.ex01.Society.GROUP;
+import static communication.ex01.Society.ROLE;
+
+import java.util.logging.Level;
+
+import communication.ex01.PingAgent;
+import madkit.kernel.Madkit;
+import madkit.kernel.Message;
+
+/**
+ * Shows how agents exchange messages by targeting roles.
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ * Looking for someone, agents do not necessarily need to know who they talk to in terms of real ID. Indeed, what
+ * matters in the artificial society is the roles an agent take. organization tell a lot about what the agent is capable of and
+ * supposed to do. So, agents can send messages to roles rather than to IDs. Here, the idea is: I need to contact a
+ * "ping agent", no matter who will receive the message. And it is possible to do so using what follows:
+ */
+public class PingAgent2 extends PingAgent {// So I do the same activate
+
+ /**
+ * Now ping another agent, just by targeting the role
+ */
+ @Override
+ protected void live() {
+
+ getLogger().setLevel(Level.ALL);
+
+ ReturnCode code = null;
+
+ // until I find someone having role
+ while (code != ReturnCode.SUCCESS) {
+ // This will randomly choose a receiver having this role
+ code = sendMessage(COMMUNITY, GROUP, ROLE, new Message());
+ pause((int) (Math.random() * 1000 + 100));
+ }
+
+ nextMessage();
+ pause(10000);
+ }
+
+ @SuppressWarnings("unused")
+ public static void main(String[] args) {
+ //This will launch a new kernel. It will automatically ends when all the agents living on this kernel are done.
+ new Madkit("--launchAgents", PingAgent2.class.getName() + ",true,3;", PingAgent.class.getName()// This one so that PingAgent2 agents always find someone (breaking the
+ // first while)
+ );
+ }
+
+}
+
+
+
+
+PingAgent2.java
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/release/html/communication/communication/ex03_replyingToMessages/ReplierAgent.java.html b/release/html/communication/communication/ex03_replyingToMessages/ReplierAgent.java.html
new file mode 100644
index 0000000..f38126e
--- /dev/null
+++ b/release/html/communication/communication/ex03_replyingToMessages/ReplierAgent.java.html
@@ -0,0 +1,80 @@
+
+
+
+
+
+communication.ex03_replyingToMessages.ReplierAgent (Java2HTML)
+
+
+
+
+
+ReplierAgent.java
+
+
+
+
+
+package communication.ex03_replyingToMessages;
+
+import static communication.ex01.Society.COMMUNITY;
+import static communication.ex01.Society.GROUP;
+import static communication.ex01.Society.ROLE;
+
+import communication.ex01.PingAgent;
+import madkit.kernel.Madkit;
+import madkit.kernel.Message;
+import madkit.message.StringMessage;
+
+/**
+ * Shows how agents exchange messages by targeting roles.
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ * Receiving a message, you can learn information about the sender. This is illustrated firstly in this example.
+ * Sometimes, agents need to communicate by replying to messages. There are primitives for that and they have two
+ * advantages. (1) This will identify the message as being a concrete reply to the received message thus easing the
+ * programming of protocols for instance. (2) This greatly improves code legibility
+ */
+public class ReplierAgent extends PingAgent {// So I do the same activate
+
+ @Override
+ protected void live() {
+
+ // until I found someone having that role
+ while (sendMessage(COMMUNITY, GROUP, ROLE, new Message()) != ReturnCode.SUCCESS) {
+ pause((int) (Math.random() * 1000 + 100));
+ }
+
+Message m = nextMessage();
+ if (m != null) {
+ getLogger().info("I have to thank " + m.getSender());
+ sendReply(m, new StringMessage("thanks"));
+ }
+ pause(10000);
+ }
+
+ @SuppressWarnings("unused")
+ public static void main(String[] args) {
+ new Madkit("--launchAgents", ReplierAgent.class.getName() + ",true,10;", PingAgent.class.getName()// This one so that agents always find someone (breaking the first while)
+ );
+ }
+
+}
+
+
+
+
+ReplierAgent.java
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/release/html/communication/communication/ex04/Agent1.java.html b/release/html/communication/communication/ex04/Agent1.java.html
new file mode 100644
index 0000000..5a33d06
--- /dev/null
+++ b/release/html/communication/communication/ex04/Agent1.java.html
@@ -0,0 +1,115 @@
+
+
+
+
+
+communication.ex04.Agent1 (Java2HTML)
+
+
+
+
+
+Agent1.java
+
+
+
+
+
+package communication.ex04;
+
+import java.util.logging.Level;
+
+import madkit.gui.AgentFrame;
+import madkit.kernel.Agent;
+import madkit.kernel.AgentAddress;
+import madkit.kernel.Madkit;
+import madkit.kernel.Message;
+
+/**
+ * Shows how agents exchange messages.
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ * To exchange messages, agents have to exist in an artificial society. That is, agents have to create communities
+ * containing groups and take roles within to interact with others. Doing so, agents get agent addresses which could be
+ * used to send them messages. Here, one agent (Agent1) is communicating with another agent (Agent2) by getting its
+ * agent address in the artificial society and using it with sendMessage.
+ */
+public class Agent1 extends Agent {
+
+ /*
+ * Firstly, take a position in the artificial society.
+ */
+ @Override
+ protected void activate() {
+ getLogger().setLevel(Level.FINEST);
+
+ createGroup("communication", "GroupTest");// Create the group GroupTest in the community communication.
+ requestRole("communication", "GroupTest", "RoleTest1");// Request the role RoleTest1.
+ pause(500);
+ }
+
+ /*
+ * First getting an Agent address, and then sending him a message.
+ */
+ @Override
+ protected void live() {
+AgentAddress other = null;
+ // Until we have an agent (in the group GroupTest in the community communication) having the role RoleTest2.
+ while (other == null) {
+ // Getting the address of an agent being in the community "communication" and the group "GroupTest", and having the role
+ // "RoleTest2".
+ other = getAgentWithRole("communication", "GroupTest", "RoleTest2");
+
+ // Trying to get another agent (Agent3).
+ if (other == null) {
+ other = getAgentWithRole("communication", "GroupTest", "RoleTest3");
+ }
+ pause(1000);
+ }
+ getLogger().info("\n\tI found someone !!\n" + other + "\n\n");
+ pause(1000);
+
+ sendMessage(other, new Message());// Sending the message to the agent we found.
+ pause(1000);
+
+ while (nextMessage() != null)
+ pause(6000);
+ }
+
+ /*
+ * Set where the agent's window will be for avoiding a clear presentation. This method give
+ * the opportunity to modify the default settings of the frame.
+ * It will be more explained in GUI tutorial.
+ */
+ @Override
+ public void setupFrame(AgentFrame frame) {
+ super.setupFrame(frame);
+ frame.setLocation(100, 320 * (hashCode() - 2));
+ }
+
+ /**
+ * @param argss
+ * Running Agent1 will launch 2 instances of both Agent1 and Agent2. They will send themselves 1 message.
+ */
+ @SuppressWarnings("unused")
+ public static void main(String[] argss) {
+ new Madkit("--launchAgents", Agent1.class.getName() + ",true,2;", Agent2.class.getName() + ",true,2;");
+ }
+}
+
+
+
+Agent1.java
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/release/html/communication/communication/ex04/Agent2.java.html b/release/html/communication/communication/ex04/Agent2.java.html
new file mode 100644
index 0000000..77e54d3
--- /dev/null
+++ b/release/html/communication/communication/ex04/Agent2.java.html
@@ -0,0 +1,92 @@
+
+
+
+
+
+communication.ex04.Agent2 (Java2HTML)
+
+
+
+
+
+Agent2.java
+
+
+
+
+
+package communication.ex04;
+
+import java.util.logging.Level;
+
+import madkit.gui.AgentFrame;
+import madkit.kernel.Agent;
+import madkit.kernel.AgentAddress;
+import madkit.kernel.Madkit;
+import madkit.kernel.Message;
+
+/**
+ * Agent2 works as Agent1, using a different role.
+ *
+ * #jws communication.ex05.Agent1 jws#
+ *
+ * Agent2 is almost like Agent1, the only difference is the role and frame's location.
+ */
+
+public class Agent2 extends Agent {
+
+ @Override
+ protected void activate() {
+ getLogger().setLevel(Level.FINEST);
+
+ createGroup("communication", "GroupTest");
+ requestRole("communication", "GroupTest", "RoleTest2");
+ pause(500);
+ }
+
+ @Override
+ protected void live() {
+AgentAddress other = null;
+ while (other == null) {
+ other = getAgentWithRole("communication", "GroupTest", "RoleTest1");
+ pause(1000);
+ }
+ getLogger().info("\n\tI found someone !!\n" + other + "\n\n");
+ pause(1000);
+
+ sendMessage(other, new Message());
+ pause(1000);
+
+ while (nextMessage() != null)
+ pause(6000);
+ }
+
+ /**
+ * Will launch 2 instances of both Agent1 and Agent2. They will send themselves 1 message.
+ */
+ @SuppressWarnings("unused")
+ public static void main(String[] argss) {
+ new Madkit("--launchAgents", Agent1.class.getName() + ",true,2;", Agent2.class.getName() + ",true,2;");
+ }
+
+ /*
+ * Setting where the agent's window will be.
+ */
+ @Override
+ public void setupFrame(AgentFrame frame) {
+ super.setupFrame(frame);
+ frame.setLocation(550, 350 * (hashCode() - 4));
+ }
+}
+
+
+
+
+Agent2.java
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/release/html/communication/communication/ex04/Agent3.java.html b/release/html/communication/communication/ex04/Agent3.java.html
new file mode 100644
index 0000000..659f54f
--- /dev/null
+++ b/release/html/communication/communication/ex04/Agent3.java.html
@@ -0,0 +1,103 @@
+
+
+
+
+
+communication.ex04.Agent3 (Java2HTML)
+
+
+
+
+
+Agent3.java
+
+
+
+
+
+package communication.ex04;
+
+import java.util.logging.Level;
+
+import madkit.gui.AgentFrame;
+import madkit.kernel.Agent;
+import madkit.kernel.Madkit;
+import madkit.kernel.Message;
+
+/**
+ * Shows how agents exchange messages.
+ *
+ *
+ *
+ *
+ *
+ *
+ * This Agent3 is communicating using another method than Agent 1 and 2.
+ */
+public class Agent3 extends Agent {
+
+ /*
+ * This Activate period is almost the same as Agent 1 and 2, the difference is that this Agent 3 create is own Role.
+ */
+ @Override
+ protected void activate() {
+ getLogger().setLevel(Level.FINEST);
+
+ createGroup("communication", "GroupTest");
+ requestRole("communication", "GroupTest", "RoleTest3");
+ pause(500);
+ }
+
+ /**
+ * Agent3 is sending his message in a loop, until this message is successfully sent to another Agent having the Role
+ * "RoleTest1".
+ */
+ @Override
+ protected void live() {
+ ReturnCode code = null;
+
+ // Until we succeed in sending a message to an agent (in the group GroupTest in the community communication with the
+ // role RoleTest1).
+ while (code != ReturnCode.SUCCESS) {
+ // If several agents match, the target is chosen randomly.
+ code = sendMessage("communication", "GroupTest", "RoleTest1", new Message());
+ pause((int) (Math.random() * 1000 + 100));
+ }
+
+ while (nextMessage() != null)
+ pause(6000);
+ pause(6000);
+ }
+
+ /**
+ * @param argss
+ * Running Agent1 will launch 2 Agent1 and 2 Agent2. They will send themselves 1 message.
+ */
+ public static void main(String[] argss) {
+ new Madkit("--launchAgents", Agent1.class.getName() + ",true,1;", // During his the live() period, Agent 1 will first try to found an Agent with the role "RoleTest2", than
+ // he will find Agend3 ("RoleTest3").
+Agent3.class.getName() + ",true,1;");
+ }
+
+ /**
+ * Setting where the agent's window will be.
+ */
+ @Override
+ public void setupFrame(AgentFrame frame) {
+ super.setupFrame(frame);
+ frame.setLocation(550, 100);
+ }
+
+}
+
+
+
+
+Agent3.java
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/release/html/communication/communication/ex05/Agent4.java.html b/release/html/communication/communication/ex05/Agent4.java.html
new file mode 100644
index 0000000..2288e08
--- /dev/null
+++ b/release/html/communication/communication/ex05/Agent4.java.html
@@ -0,0 +1,105 @@
+
+
+
+
+
+communication.ex05.Agent4 (Java2HTML)
+
+
+
+
+
+Agent4.java
+
+
+
+
+
+package communication.ex05;
+
+import java.util.logging.Level;
+
+import madkit.gui.AgentFrame;
+import madkit.kernel.Agent;
+import madkit.kernel.AgentAddress;
+import madkit.kernel.Madkit;
+import madkit.kernel.Madkit.Option;
+import madkit.kernel.Message;
+
+/**
+ * Shows how agents exchange messages.
+ *
+ *
+ *
+ *
+ *
+ *
+ * Agent4 will get an agent's address, and then send his message using sendMessageWithRole.
+ */
+
+public class Agent4 extends Agent {
+
+ /**
+ * Firstly, taking position in the artificial society (having a RoleTest4).
+ */
+ @Override
+ protected void activate() {
+ getLogger().setLevel(Level.FINEST);
+
+ createGroup("communication", "GroupTest");
+ requestRole("communication", "GroupTest", "RoleTest4");
+ pause(500);
+ }
+
+ @Override
+ protected void live() {
+AgentAddress other = null;// other will contain the Agent's address.
+ while (other == null)// Until we found an Agent having "("communication","GroupTest","RoleTest4")".
+ {
+ other = getAgentWithRole("communication", "GroupTest", "RoleTest4");
+ pause(1000);
+
+ if (other == null)// Or an Agent having "("communication","GroupTest","RoleTest5")".
+ {
+ other = getAgentWithRole("communication", "GroupTest", "RoleTest5");
+ }
+ pause(1000);
+ }
+ getLogger().info("\n\tI found someone !!\n" + other + "\n\n");// Displaying our Agent properties (the one we founded).
+ pause(1000);
+
+ sendMessageWithRole(other, new Message(), "RoleTest4");// Sending the message specifying the sender's role.
+
+ while (nextMessage() != null)
+ pause(6000);
+ }
+
+ /**
+ * @param argss
+ * Running Agent4 will launch 2 Agent4.
+ */
+ public static void main(String[] argss)// Launching two Agent4.
+ {
+ new Madkit(Option.launchAgents.toString(), Agent4.class.getName() + ",true,2;");
+ }
+
+ /*
+ * Setting where the agent's window will be for a clear presentation.
+ */
+ @Override
+ public void setupFrame(AgentFrame frame) {
+ super.setupFrame(frame);
+ frame.setLocation(100, 350 * (hashCode() - 2));
+ }
+}
+
+
+
+Agent4.java
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/release/html/communication/communication/ex05/Agent5.java.html b/release/html/communication/communication/ex05/Agent5.java.html
new file mode 100644
index 0000000..7eb82d1
--- /dev/null
+++ b/release/html/communication/communication/ex05/Agent5.java.html
@@ -0,0 +1,102 @@
+
+
+
+
+
+communication.ex05.Agent5 (Java2HTML)
+
+
+
+
+
+Agent5.java
+
+
+
+
+
+package communication.ex05;
+
+import java.util.logging.Level;
+
+import madkit.gui.AgentFrame;
+import madkit.kernel.Agent;
+import madkit.kernel.AgentAddress;
+import madkit.kernel.Madkit;
+import madkit.kernel.Message;
+
+/**
+ * Shows how agents exchange messages.
+ *
+ *
+ *
+ *
+ *
+ *
+ * Agent5 is almost like Agent4, the only difference is their roles.
+ */
+
+public class Agent5 extends Agent {
+
+ /*
+ * Firstly, taking position in the artificial society (having a RoleTest5).
+ */
+ @Override
+ protected void activate() {
+ getLogger().setLevel(Level.FINEST);
+
+ createGroup("communication", "GroupTest");
+ requestRole("communication", "GroupTest", "RoleTest5");
+ pause(500);
+ }
+
+ /*
+ * First getting an Agent address, and then sending him a message.
+ */
+ @Override
+ protected void live()// In this live period, Agent5 is doing exactly the same as Agent4, with a different role (RoleTest5).
+ {
+AgentAddress other = null;
+ while (other == null) {
+ other = getAgentWithRole("communication", "GroupTest", "RoleTest4");
+ pause(1000);
+ }
+
+ getLogger().info("\n\tI found someone !!\n" + other + "\n\n");
+ pause(1000);
+
+ sendMessageWithRole(other, new Message(), "RoleTest5");
+
+ while (nextMessage() != null)
+ pause(6000);
+ }
+
+ /**
+ * @param argss
+ * Launching one Agent4 and one Agent 5.
+ */
+ public static void main(String[] argss) {
+ new Madkit("--launchAgents", Agent4.class.getName() + ",true,1;", Agent5.class.getName() + ",true,1;");
+ }
+
+ /*
+ * Setting where the agent's window will be for a clear presentation.
+ */
+ @Override
+ public void setupFrame(AgentFrame frame) {
+ super.setupFrame(frame);
+ frame.setLocation(100, 350 * (hashCode() - 2));
+ }
+}
+
+
+
+
+Agent5.java
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/release/html/communication/communication/ex06/Agent6.java.html b/release/html/communication/communication/ex06/Agent6.java.html
new file mode 100644
index 0000000..68b7146
--- /dev/null
+++ b/release/html/communication/communication/ex06/Agent6.java.html
@@ -0,0 +1,100 @@
+
+
+
+
+
+communication.ex06.Agent6 (Java2HTML)
+
+
+
+
+
+Agent6.java
+
+
+
+
+
+package communication.ex06;
+
+import java.util.logging.Level;
+
+import madkit.gui.AgentFrame;
+import madkit.kernel.Agent;
+import madkit.kernel.Madkit;
+import madkit.kernel.Message;
+
+/**
+ * Shows how agents exchange messages.
+ *
+ *
+ *
+ *
+ *
+ *
+ * Agent6 won't get an agent address, he will send him a message using sendMessageWithRole.
+ *
+ * @author Authors ARAGON Joseph and WAGNER Pascal.
+ */
+
+public class Agent6 extends Agent {
+
+ /*
+ * Firstly, taking position in the artificial society (having a RoleTest6).
+ */
+ @Override
+ protected void activate() {
+ getLogger().setLevel(Level.FINEST);
+
+ createGroupIfAbsent("communication", "GroupTest");
+ requestRole("communication", "GroupTest", "RoleTest6");
+ pause(500);
+ }
+
+ /**
+ * Trying to send a message in a loop until this Agent succeeds sending a message with sendMessageWithRole.
+ */
+ @Override
+ protected void live() {
+ ReturnCode code = null;
+ while (code != ReturnCode.SUCCESS)// Until we succeed sending the message.
+ {
+ // Sending a message to an Agent having a RoleTest7 Specifying Agent6's role.
+ code = sendMessageWithRole("communication", "GroupTest", "RoleTest7", new Message(), "RoleTest6");
+ pause(3000);
+ }
+ while (nextMessage() != null)
+ pause(6000);
+ }
+
+ /**
+ * @param argss
+ * It will run one Agent6 and one Agent7.
+ */
+ @SuppressWarnings("unused")
+ public static void main(String[] argss)// Launching two agents, Agent6 and Agent7.
+ {
+ new Madkit("--launchAgents", Agent6.class.getName() + ",true,1;", Agent7.class.getName() + ",true,1;");
+ }
+
+ /*
+ * Setting where the agent's window will be for a clear presentation.
+ */
+ @Override
+ public void setupFrame(AgentFrame frame) {
+ super.setupFrame(frame);
+ frame.setLocation(100, 350 * (hashCode() - 2));
+ }
+
+}
+
+
+
+Agent6.java
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/release/html/communication/communication/ex06/Agent7.java.html b/release/html/communication/communication/ex06/Agent7.java.html
new file mode 100644
index 0000000..10bf604
--- /dev/null
+++ b/release/html/communication/communication/ex06/Agent7.java.html
@@ -0,0 +1,76 @@
+
+
+
+
+
+communication.ex06.Agent7 (Java2HTML)
+
+
+
+
+
+Agent7.java
+
+
+
+
+
+package communication.ex06;
+
+import java.util.logging.Level;
+
+import madkit.gui.AgentFrame;
+import madkit.kernel.Agent;
+import madkit.kernel.Message;
+
+/**
+ * Shows how agents exchange messages. As in previous examples, Agent7 is doing the same job as Agent6, having a
+ * RoleTest7.
+ *
+ * @author Authors ARAGON Joseph and WAGNER Pascal.
+ */
+
+public class Agent7 extends Agent {
+
+ @Override
+ protected void activate() {
+ getLogger().setLevel(Level.FINEST);
+
+ createGroupIfAbsent("communication", "GroupTest");
+ requestRole("communication", "GroupTest", "RoleTest7");
+ pause(500);
+ }
+
+ /*
+ * Trying to send a message in a loop until this Agent succeeds sending a message with sendMessageWithRole.
+ */
+ @Override
+ protected void live() {
+ ReturnCode code = null;
+
+ while (code != ReturnCode.SUCCESS) {
+ code = sendMessageWithRole("communication", "GroupTest", "RoleTest6", new Message(), "RoleTest7");
+ pause(2000);
+ }
+ while (nextMessage() != null)
+ pause(6000);
+ }
+
+ @Override
+ public void setupFrame(AgentFrame frame) {
+ super.setupFrame(frame);
+ frame.setLocation(500, 100);
+ }
+}
+
+
+
+
+Agent7.java
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/release/html/communication/front.html b/release/html/communication/front.html
new file mode 100644
index 0000000..27a0a81
--- /dev/null
+++ b/release/html/communication/front.html
@@ -0,0 +1,19 @@
+
+
+
+Java2HTML
+
+
+
+
Communication
+
+
Communication between agents
+
+
+
+
Examples are structured in packages explicitely named and ordered according to their complexity