Permalink
Browse files

- improving documentation and java docs, adding TODOs

  • Loading branch information...
1 parent 6bda23a commit a09dc597ffa96895d65c643f7520cbb0474ab545 @Salaboy Salaboy committed Jan 24, 2012
Showing with 233 additions and 366 deletions.
  1. +1 −9 drools-mas-acl/src/main/java/org/drools/mas/body/acts/AbstractMessageBody.java
  2. +10 −4 drools-mas-acl/src/main/java/org/drools/mas/body/acts/Inform.java
  3. +5 −3 drools-mas-acl/src/main/java/org/drools/mas/body/acts/InformIf.java
  4. +7 −1 drools-mas-acl/src/main/java/org/drools/mas/body/acts/QueryIf.java
  5. +8 −6 drools-mas-acl/src/main/java/org/drools/mas/body/content/Info.java
  6. +1 −0 drools-mas-core/src/main/resources/org/drools/mas/acl_protocol.drl
  7. +0 −255 drools-mas-core/src/test/java/TestACLMessage.java
  8. 0 drools-mas-core/src/test/java/{ → org/drools/mas/core/tests}/TestAgent.java
  9. +49 −7 drools-mas-doc/src/main/docbook/en-US/architecturalOverview.xml
  10. +2 −4 drools-mas-doc/src/main/docbook/en-US/book.xml
  11. +4 −4 drools-mas-doc/src/main/docbook/en-US/components.xml
  12. +2 −2 drools-mas-doc/src/main/docbook/en-US/deployment.xml
  13. +4 −7 drools-mas-doc/src/main/docbook/en-US/futureWork.xml
  14. +7 −11 drools-mas-doc/src/main/docbook/en-US/gettingInvolved.xml
  15. +28 −16 drools-mas-doc/src/main/docbook/en-US/gettingStarted.xml
  16. BIN drools-mas-doc/src/main/docbook/en-US/images/01-agent-high-level-arch.png
  17. BIN drools-mas-doc/src/main/docbook/en-US/images/02-module-core.png
  18. BIN drools-mas-doc/src/main/docbook/en-US/images/03-module-core-mind-and-sessions.png
  19. +30 −9 drools-mas-doc/src/main/docbook/en-US/introduction.xml
  20. +44 −10 drools-mas-doc/src/main/docbook/en-US/module-acl.xml
  21. +16 −5 drools-mas-doc/src/main/docbook/en-US/module-core.xml
  22. +2 −2 drools-mas-doc/src/main/docbook/en-US/referencesLinks.xml
  23. +13 −11 examples/drools-mas-emergency-agent/pom.xml
@@ -16,18 +16,11 @@
package org.drools.mas.body.acts;
-
-
import java.io.Serializable;
import javax.xml.bind.annotation.*;
-
import org.drools.mas.Act;
import org.drools.mas.Encodings;
-import org.drools.mas.body.content.Action;
-import org.drools.mas.body.content.Info;
-import org.drools.mas.body.content.Query;
-import org.drools.mas.body.content.Ref;
-import org.drools.mas.body.content.Rule;
+import org.drools.mas.body.content.*;
import org.drools.mas.mappers.MyMapArgsEntryType;
import org.drools.mas.mappers.MyMapReferenceEntryType;
@@ -43,7 +36,6 @@
@XmlElement(required = true)
public Act performative;
-
public AbstractMessageBody() {
}
@@ -13,23 +13,30 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
package org.drools.mas.body.acts;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlType;
-import org.drools.mas.Act;
import org.drools.mas.body.content.Info;
+/*
+ * The sender informs the receiver that a given proposition is true. inform
+ * indicates that the sending agent:
+ *
+ * · holds that some proposition is true,
+ *
+ * · intends that the receiving agent also comes to believe that the proposition is true, and,
+ *
+ * · does not already believe that the receiver has any knowledge of the truth of the proposition.
+ */
@XmlType(name = "Inform", namespace = "http://acts.body.mas.drools.org/")
@XmlAccessorType(XmlAccessType.FIELD)
public class Inform extends AbstractMessageBody {
@XmlElement(required = true)
private Info proposition;
-
public Inform() {
}
@@ -71,5 +78,4 @@ public Info getProposition() {
public void setProposition(Info proposition) {
this.proposition = proposition;
}
-
}
@@ -20,15 +20,17 @@
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlType;
-import org.drools.mas.Act;
-import org.drools.mas.Encodings;
import org.drools.mas.body.content.Info;
+/*
+ * A macro action for the agent of the action to inform the recipient whether or not a proposition is true.
+ * (macro acts can be planned and requested, but not directly performed)
+ */
+
@XmlType(name = "InformIf", namespace = "http://acts.body.mas.drools.org/")
@XmlAccessorType(XmlAccessType.FIELD)
public class InformIf extends AbstractMessageBody {
-
@XmlElement(required = true)
private Info proposition;
@@ -20,9 +20,15 @@
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlType;
-import org.drools.mas.Act;
import org.drools.mas.body.content.Info;
+/*
+ * The action of asking another agent whether or not a given proposition is true.
+ * The agent performing the query-if act:
+ * · has no knowledge of the truth value of the proposition, and,
+ * · believes that the other agent can inform the querying agent if it knows the truth of the proposition.
+ */
+
@XmlType(name = "QueryIf", namespace = "http://acts.body.mas.drools.org/")
@XmlAccessorType(XmlAccessType.FIELD)
public class QueryIf extends AbstractMessageBody {
@@ -21,12 +21,18 @@
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlType;
+/*
+ * The Info class is in charge of hosting a piece of data that. Here we are using info as a synonim of Proposition.
+ * @TODO: we should rename this class to Proposition and add the truth attr (boolean)
+ */
+
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "Info", namespace="http://content.body.mas.drools.org/")
public class Info extends AbstractMessageContent {
@XmlElement()
private Object data;
-
+ //@TODO: we should add here a truth value.. like a negation boolean to
+ // explicitely say if the data is a true or false propositon
public Info() {
}
@@ -44,10 +50,6 @@ public Object getData() {
public void setData(Object data) {
this.data = data;
- }
-
-
-
-
+ }
}
@@ -116,6 +116,7 @@ when
performative == Act.QUERY_IF )
$resp : ResponseContent( messageId == $msgId, $data : data != null)
then
+ //@TODO: This should be an Inform not an InformIf
ACLMessage ans = aclFactory.newReplyWithInformIfMessage($msg, agentName, $data);
// System.out.println("PROTOCOL RULES : " + agentName + " >>>> " + ans);
// System.out.println("\t"+$msg.hashCode()+", "+ $msg);
Oops, something went wrong.

0 comments on commit a09dc59

Please sign in to comment.