From: <jom...@us...> - 2016-04-10 14:20:46
|
Revision: 1893 http://sourceforge.net/p/jason/svn/1893 Author: jomifred Date: 2016-04-10 14:20:44 +0000 (Sun, 10 Apr 2016) Log Message: ----------- minor change in the cent ag arch async Modified Paths: -------------- trunk/applications/as-unit-test/src/jason/asunit/TestArch.java trunk/applications/jason-moise/example/auction/auction-os.xml trunk/applications/jason-moise/example/auction-ora4mas/auction-os.xml trunk/demos/persistent-belief-base/VoidBB.java trunk/demos/using-only-jason-BDI-engine/SimpleJasonAgent.java trunk/examples/auction/AuctioneerGUI.java trunk/release-notes.txt trunk/src/jason/architecture/AgArch.java trunk/src/jason/infra/centralised/CentralisedAgArch.java trunk/src/jason/infra/centralised/CentralisedAgArchAsynchronous.java trunk/src/jason/infra/jade/JasonBridgeArch.java Modified: trunk/applications/as-unit-test/src/jason/asunit/TestArch.java =================================================================== --- trunk/applications/as-unit-test/src/jason/asunit/TestArch.java 2016-04-09 21:04:35 UTC (rev 1892) +++ trunk/applications/as-unit-test/src/jason/asunit/TestArch.java 2016-04-10 14:20:44 UTC (rev 1893) @@ -83,7 +83,7 @@ super.act(action); //, feedback); //env.scheduleAction(getAgName(), action.getActionTerm(), action); } else { action.setResult(true); - actDone(action); //feedback.add(action); + actionExecuted(action); //feedback.add(action); } } Modified: trunk/applications/jason-moise/example/auction/auction-os.xml =================================================================== --- trunk/applications/jason-moise/example/auction/auction-os.xml 2016-04-09 21:04:35 UTC (rev 1892) +++ trunk/applications/jason-moise/example/auction/auction-os.xml 2016-04-10 14:20:44 UTC (rev 1893) @@ -23,9 +23,9 @@ <links> <link from="auctioneer" to="participant" type="communication" scope="intra-group" - extends-sub-groups="false" bi-dir="true"/> + extends-subgroups="false" bi-dir="true"/> <link from="participant" to="participant" type="communication" scope="intra-group" - extends-sub-groups="false" bi-dir="false"/> + extends-subgroups="false" bi-dir="false"/> </links> </group-specification> Modified: trunk/applications/jason-moise/example/auction-ora4mas/auction-os.xml =================================================================== --- trunk/applications/jason-moise/example/auction-ora4mas/auction-os.xml 2016-04-09 21:04:35 UTC (rev 1892) +++ trunk/applications/jason-moise/example/auction-ora4mas/auction-os.xml 2016-04-10 14:20:44 UTC (rev 1893) @@ -23,9 +23,9 @@ <links> <link from="auctioneer" to="participant" type="communication" scope="intra-group" - extends-sub-groups="false" bi-dir="true"/> + extends-subgroups="false" bi-dir="true"/> <link from="participant" to="participant" type="communication" scope="intra-group" - extends-sub-groups="false" bi-dir="false"/> + extends-subgroups="false" bi-dir="false"/> </links> </group-specification> Modified: trunk/demos/persistent-belief-base/VoidBB.java =================================================================== --- trunk/demos/persistent-belief-base/VoidBB.java 2016-04-09 21:04:35 UTC (rev 1892) +++ trunk/demos/persistent-belief-base/VoidBB.java 2016-04-10 14:20:44 UTC (rev 1893) @@ -1,34 +1,20 @@ -import jason.asSemantics.Agent; +import java.util.ArrayList; +import java.util.HashSet; +import java.util.Iterator; +import java.util.Set; + import jason.asSemantics.Unifier; import jason.asSyntax.Atom; import jason.asSyntax.Literal; import jason.asSyntax.PredicateIndicator; import jason.bb.BeliefBase; -import java.util.ArrayList; -import java.util.HashSet; -import java.util.Iterator; -import java.util.Set; -import org.w3c.dom.Document; -import org.w3c.dom.Element; - - /** * Void Belief Base: store nothing! */ -public class VoidBB implements jason.bb.BeliefBase { +public class VoidBB extends jason.bb.BeliefBase { - public void init(Agent ag, String[] args) { - } - public void stop() { - } - public void clear() { - } - public int size() { - return 0; - } - public Iterator<Literal> getPercepts() { return new ArrayList<Literal>().iterator(); } @@ -54,11 +40,6 @@ return new ArrayList<Literal>().iterator(); } - @Deprecated - public Iterator<Literal> getAll() { - return iterator(); - } - public boolean remove(Literal l) { return true; } @@ -74,20 +55,7 @@ public Iterator<Literal> getCandidateBeliefs(Literal l, Unifier u) { return new ArrayList<Literal>().iterator(); } - - @Deprecated - public Iterator<Literal> getRelevant(Literal l) { - return new ArrayList<Literal>().iterator(); - } - public Iterator<Unifier> logCons(final Literal l, final Unifier un) { - return new ArrayList<Unifier>().iterator(); - } - - public Element getAsDOM(Document document) { - return null; - } - public BeliefBase clone() { return new VoidBB(); } Modified: trunk/demos/using-only-jason-BDI-engine/SimpleJasonAgent.java =================================================================== --- trunk/demos/using-only-jason-BDI-engine/SimpleJasonAgent.java 2016-04-09 21:04:35 UTC (rev 1892) +++ trunk/demos/using-only-jason-BDI-engine/SimpleJasonAgent.java 2016-04-10 14:20:44 UTC (rev 1893) @@ -68,7 +68,7 @@ getTS().getLogger().info("Agent " + getAgName() + " is doing: " + action.getActionTerm()); // set that the execution was ok action.setResult(true); - actDone(action); + actionExecuted(action); } @Override Modified: trunk/examples/auction/AuctioneerGUI.java =================================================================== --- trunk/examples/auction/AuctioneerGUI.java 2016-04-09 21:04:35 UTC (rev 1892) +++ trunk/examples/auction/AuctioneerGUI.java 2016-04-10 14:20:44 UTC (rev 1893) @@ -45,7 +45,7 @@ jt.append("Winner of auction " + action.getActionTerm().getTerm(0)); jt.append(" is " + action.getActionTerm().getTerm(1) + "\n"); action.setResult(true); - actDone(action); + actionExecuted(action); auction.setEnabled(true); // enable GUI button } else { Modified: trunk/release-notes.txt =================================================================== --- trunk/release-notes.txt 2016-04-09 21:04:35 UTC (rev 1892) +++ trunk/release-notes.txt 2016-04-10 14:20:44 UTC (rev 1893) @@ -31,7 +31,7 @@ Changes in the API: - AgArch act method has just one parameter -- Java 8 is used +- Java 1.7 is used New Tutorial on BDI (see doc/index.html) Modified: trunk/src/jason/architecture/AgArch.java =================================================================== --- trunk/src/jason/architecture/AgArch.java 2016-04-09 21:04:35 UTC (rev 1892) +++ trunk/src/jason/architecture/AgArch.java 2016-04-10 14:20:44 UTC (rev 1893) @@ -195,8 +195,9 @@ } /** called to inform that the action execution is finished */ - public void actDone(ActionExec act) { + public void actionExecuted(ActionExec act) { getTS().getC().addFeedbackAction(act); + wakeUpAct(true); } /** Returns true if the agent can enter in sleep mode. */ Modified: trunk/src/jason/infra/centralised/CentralisedAgArch.java =================================================================== --- trunk/src/jason/infra/centralised/CentralisedAgArch.java 2016-04-09 21:04:35 UTC (rev 1892) +++ trunk/src/jason/infra/centralised/CentralisedAgArch.java 2016-04-10 14:20:44 UTC (rev 1893) @@ -315,7 +315,7 @@ public void receiveMsg(Message m) { mbox.offer(m); - wake(); + wakeUpSense(false); } public void broadcast(jason.asSemantics.Message m) throws Exception { @@ -350,12 +350,6 @@ infraEnv.act(getAgName(), action); } - /** called the the environment when the action was executed */ - public void actionExecuted(ActionExec action) { - getTS().getC().addFeedbackAction(action); - wake(); - } - public boolean canSleep() { return mbox.isEmpty() && isRunning(); } Modified: trunk/src/jason/infra/centralised/CentralisedAgArchAsynchronous.java =================================================================== --- trunk/src/jason/infra/centralised/CentralisedAgArchAsynchronous.java 2016-04-09 21:04:35 UTC (rev 1892) +++ trunk/src/jason/infra/centralised/CentralisedAgArchAsynchronous.java 2016-04-10 14:20:44 UTC (rev 1893) @@ -1,5 +1,7 @@ package jason.infra.centralised; +import java.util.concurrent.ExecutorService; + import jason.asSemantics.ActionExec; import jason.asSemantics.CircumstanceListener; import jason.asSemantics.Message; @@ -7,9 +9,6 @@ import jason.infra.components.DeliberateComponent; import jason.infra.components.SenseComponent; -import java.util.Queue; -import java.util.concurrent.ExecutorService; - public class CentralisedAgArchAsynchronous extends CentralisedAgArch implements Runnable { private SenseComponent senseComponent; private DeliberateComponent deliberateComponent; @@ -70,7 +69,6 @@ public boolean isSleepingSense() { return sleepingSense; } - public void sleepDeliberate() { sleepingDeliberate = true; @@ -147,16 +145,14 @@ public void receiveMsg(Message m) { synchronized (objSense) { - ((Queue<Message>) getMBox()).offer(m); - wakeUpSense(false); + super.receiveMsg(m); } } /** called the the environment when the action was executed */ public void actionExecuted(ActionExec action) { synchronized (objSense) { - getTS().getC().addFeedbackAction(action); - wakeUpSense(false); + super.actionExecuted(action); } } } Modified: trunk/src/jason/infra/jade/JasonBridgeArch.java =================================================================== --- trunk/src/jason/infra/jade/JasonBridgeArch.java 2016-04-09 21:04:35 UTC (rev 1892) +++ trunk/src/jason/infra/jade/JasonBridgeArch.java 2016-04-10 14:20:44 UTC (rev 1893) @@ -244,7 +244,7 @@ } else { a.setResult(false); } - actDone(a); + actionExecuted(a); } else { logger.log(Level.SEVERE, "Error: received feedback for an Action that is not pending. The message is "+m); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |