bdi4jade

Plan Refactoring - part II

4/7/2014 4:33:15 PM

Changes

Details

diff --git a/bdi-jade/src/bdi4jade/core/BDIAgent.java b/bdi-jade/src/bdi4jade/core/BDIAgent.java
index e060953..679e93c 100644
--- a/bdi-jade/src/bdi4jade/core/BDIAgent.java
+++ b/bdi-jade/src/bdi4jade/core/BDIAgent.java
@@ -49,7 +49,6 @@ import bdi4jade.reasoning.BeliefRevisionStrategy;
 import bdi4jade.reasoning.DeliberationFunction;
 import bdi4jade.reasoning.OptionGenerationFunction;
 import bdi4jade.reasoning.PlanSelectionStrategy;
-import bdi4jade.softgoal.Softgoal;
 import bdi4jade.util.DefaultCapability;
 import bdi4jade.util.reasoning.DefaultBeliefRevisionStrategy;
 import bdi4jade.util.reasoning.DefaultDeliberationFunction;
@@ -195,7 +194,6 @@ public class BDIAgent extends Agent {
 	private OptionGenerationFunction optionGenerationFunction;
 	private PlanSelectionStrategy planSelectionStrategy;
 	private final Capability rootCapability;
-	private final Set<Softgoal> softgoals;
 
 	/**
 	 * Default constructor.
@@ -210,7 +208,6 @@ public class BDIAgent extends Agent {
 	public BDIAgent(Capability rootCapability) {
 		this.rootCapability = rootCapability;
 		this.intentions = new LinkedList<Intention>();
-		this.softgoals = new HashSet<Softgoal>();
 		this.bdiInterpreter = new BDIInterpreter(this);
 		this.beliefRevisionStrategy = new DefaultBeliefRevisionStrategy();
 		this.optionGenerationFunction = new DefaultOptionGenerationFunction();
@@ -239,29 +236,6 @@ public class BDIAgent extends Agent {
 	/**
 	 * Adds a new goal to this agent to be achieved.
 	 * 
-	 * @param goal
-	 *            the goal to be achieved.
-	 */
-	public void addGoal(Goal goal) {
-		this.addGoal(null, goal, null);
-	}
-
-	/**
-	 * Adds a new goal to this agent to be achieved and adds a listener to
-	 * observe its end.
-	 * 
-	 * @param goal
-	 *            the goal to be achieved.
-	 * @param goalListener
-	 *            the listener to be notified.
-	 */
-	public void addGoal(Goal goal, GoalListener goalListener) {
-		this.addGoal(null, goal, goalListener);
-	}
-
-	/**
-	 * Adds a new goal to this agent to be achieved.
-	 * 
 	 * @param owner
 	 *            the Capability that is owner of the goal.
 	 * @param goal
@@ -296,13 +270,26 @@ public class BDIAgent extends Agent {
 	}
 
 	/**
-	 * Adds a new softgoal to this agent.
+	 * Adds a new goal to this agent to be achieved.
+	 * 
+	 * @param goal
+	 *            the goal to be achieved.
+	 */
+	public void addGoal(Goal goal) {
+		this.addGoal(null, goal, null);
+	}
+
+	/**
+	 * Adds a new goal to this agent to be achieved and adds a listener to
+	 * observe its end.
 	 * 
-	 * @param softgoal
-	 *            the softgoal to be pursued.
+	 * @param goal
+	 *            the goal to be achieved.
+	 * @param goalListener
+	 *            the listener to be notified.
 	 */
-	public void addSoftgoal(Softgoal softgoal) {
-		this.softgoals.add(softgoal);
+	public void addGoal(Goal goal, GoalListener goalListener) {
+		this.addGoal(null, goal, goalListener);
 	}
 
 	/**
@@ -324,18 +311,6 @@ public class BDIAgent extends Agent {
 	}
 
 	/**
-	 * Drops a given softgoal of this agent. If the softgoal is not part of the
-	 * agent's current softgoals, no action is performed.
-	 * 
-	 * @param softgoal
-	 *            the softgoal to be dropped.
-	 */
-
-	public void dropSoftoal(Softgoal softgoal) {
-		this.softgoals.remove(softgoal);
-	}
-
-	/**
 	 * Returns a collection of all beliefs from all capabilities of this agent.
 	 * It may have two equivalent beliefs, i.e. beliefs with the same name.
 	 * 
@@ -394,15 +369,6 @@ public class BDIAgent extends Agent {
 	}
 
 	/**
-	 * Gets all softgoals of this agent.
-	 * 
-	 * @return the set of softgoals.
-	 */
-	public Set<Softgoal> getAllSoftgoals() {
-		return this.softgoals;
-	}
-
-	/**
 	 * @return the beliefRevisionStrategy
 	 */
 	public BeliefRevisionStrategy getBeliefRevisionStrategy() {
diff --git a/bdi-jade/src/bdi4jade/extension/softgoal/plan/AnnotatedPlan.java b/bdi-jade/src/bdi4jade/extension/softgoal/plan/AnnotatedPlan.java
new file mode 100644
index 0000000..045d995
--- /dev/null
+++ b/bdi-jade/src/bdi4jade/extension/softgoal/plan/AnnotatedPlan.java
@@ -0,0 +1,114 @@
+//----------------------------------------------------------------------------
+// Copyright (C) 2011  Ingrid Nunes
+// 
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// 
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Lesser General Public License for more details.
+// 
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+// 
+// To contact the authors:
+// http://inf.ufrgs.br/~ingridnunes/bdi4jade/
+//
+//----------------------------------------------------------------------------
+
+package bdi4jade.extension.softgoal.plan;
+
+import jade.lang.acl.MessageTemplate;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+
+import bdi4jade.extension.softgoal.core.Softgoal;
+import bdi4jade.goal.Goal;
+import bdi4jade.plan.SimplePlan;
+
+/**
+ * @author Ingrid Nunes
+ *
+ */
+public class AnnotatedPlan extends SimplePlan {
+
+	public enum DefaultMetadata {
+
+		CONTRIBUTIONS, DEPENDENCIES;
+
+	}
+	
+	/**
+	 * Constructs a new Plan. It sets the plan library and plan body class of
+	 * this plan, and initializes the goals that it can achieve and message
+	 * templates of messages it can process.
+	 * 
+	 * @param id
+	 *            plan identifier
+	 */
+	public AnnotatedPlan(String id) {
+		this(id, null, null);
+	}
+
+	/**
+	 * Constructs a new Plan. It sets the plan library and plan body class of
+	 * this plan, and initializes the goals that it can achieve and messages it
+	 * can process. The goals are initialized with the provided goal class.
+	 * 
+	 * @param id
+	 *            plan identifier
+	 * @param goalClass
+	 *            the goal that this plan can achieve
+	 */
+	public AnnotatedPlan(String id, Class<? extends Goal> goalClass) {
+		this(id, goalClass, null);
+	}
+
+	/**
+	 * Constructs a new Plan. It sets the plan library and plan body class of
+	 * this plan, and initializes the goals that it can achieve and messages it
+	 * can process. The goals are initialized with the provided goal class. The
+	 * message templates is initialized with the provided template.
+	 * 
+	 * @param id
+	 *            plan identifier
+	 * @param goalClass
+	 *            the goal that this plan can achieve
+	 * @param messageTemplate
+	 *            the template of messages that this plan can process.
+	 */
+	public AnnotatedPlan(String id, Class<? extends Goal> goalClass,
+			MessageTemplate messageTemplate) {		
+		super(id, goalClass, messageTemplate);
+
+		// Metadata
+		putMetadata(DefaultMetadata.CONTRIBUTIONS,
+				new HashMap<Softgoal, List<PlanContribution>>());
+		putMetadata(DefaultMetadata.DEPENDENCIES,
+				new ArrayList<PlanGoalDependency>());
+	}
+
+	/**
+	 * Constructs a new Plan. It sets the plan library and plan body class of
+	 * this plan, and initializes the goals that it can achieve and message
+	 * templates of messages it can process. The message templates is
+	 * initialized with the provided template.
+	 * 
+	 * @param id
+	 *            the plan identifier
+	 * @param messageTemplate
+	 *            the template of messages that this plan can process.
+	 */
+	public AnnotatedPlan(String id, MessageTemplate messageTemplate) {
+		this(id, null, messageTemplate);
+
+	}
+
+}
diff --git a/bdi-jade/src/bdi4jade/plan/AbstractPlan.java b/bdi-jade/src/bdi4jade/plan/AbstractPlan.java
index 0ada74c..cdddf70 100644
--- a/bdi-jade/src/bdi4jade/plan/AbstractPlan.java
+++ b/bdi-jade/src/bdi4jade/plan/AbstractPlan.java
@@ -33,11 +33,11 @@ import java.util.Set;
 
 import bdi4jade.core.PlanLibrary;
 import bdi4jade.exception.PlanInstantiationException;
+import bdi4jade.extension.softgoal.core.Softgoal;
+import bdi4jade.extension.softgoal.plan.PlanContribution;
+import bdi4jade.extension.softgoal.plan.PlanGoalDependency;
 import bdi4jade.goal.Goal;
 import bdi4jade.message.MessageGoal;
-import bdi4jade.softgoal.PlanContribution;
-import bdi4jade.softgoal.PlanGoalDependency;
-import bdi4jade.softgoal.Softgoal;
 import bdi4jade.util.MetadataElementImpl;
 
 /**
diff --git a/bdi-jade/src/bdi4jade/plan/Plan.java b/bdi-jade/src/bdi4jade/plan/Plan.java
index 3a63784..155ed94 100644
--- a/bdi-jade/src/bdi4jade/plan/Plan.java
+++ b/bdi-jade/src/bdi4jade/plan/Plan.java
@@ -37,12 +37,6 @@ import bdi4jade.util.MetadataElement;
  */
 public interface Plan extends MetadataElement {
 
-	public enum DefaultMetadata {
-
-		CONTRIBUTIONS, DEPENDENCIES;
-
-	}
-
 	/**
 	 * This enumuration represents the possible end states of a plan execution.
 	 * 
diff --git a/bdi-jade/src/bdi4jade/util/DefaultCapability.java b/bdi-jade/src/bdi4jade/util/DefaultCapability.java
index 1fd6be3..ceb0799 100644
--- a/bdi-jade/src/bdi4jade/util/DefaultCapability.java
+++ b/bdi-jade/src/bdi4jade/util/DefaultCapability.java
@@ -24,11 +24,11 @@ package bdi4jade.util;
 
 import bdi4jade.core.BDIAgent;
 import bdi4jade.core.Capability;
+import bdi4jade.plan.SimplePlan;
 import bdi4jade.util.goal.ParallelGoal;
 import bdi4jade.util.goal.SequentialGoal;
 import bdi4jade.util.plan.ParallelGoalPlanBody;
 import bdi4jade.util.plan.SequentialGoalPlanBody;
-import bdi4jade.util.plan.SimplePlan;
 
 /**
  * This capability is added in all {@link BDIAgent}. It provides default plans.
diff --git a/bdi-jade-test/src/bdi4jade/examples/blocksworld/BlocksWorldCapability.java b/bdi-jade-test/src/bdi4jade/examples/blocksworld/BlocksWorldCapability.java
index ec0a2aa..4fbf3bd 100644
--- a/bdi-jade-test/src/bdi4jade/examples/blocksworld/BlocksWorldCapability.java
+++ b/bdi-jade-test/src/bdi4jade/examples/blocksworld/BlocksWorldCapability.java
@@ -47,8 +47,8 @@ import bdi4jade.examples.blocksworld.plan.PerformMovePlanBody;
 import bdi4jade.examples.blocksworld.plan.TopLevelPlanBody;
 import bdi4jade.goal.Goal;
 import bdi4jade.plan.Plan;
+import bdi4jade.plan.SimplePlan;
 import bdi4jade.util.goal.BeliefSetValueGoal;
-import bdi4jade.util.plan.SimplePlan;
 
 /**
  * @author ingrid
diff --git a/bdi-jade-test/src/bdi4jade/examples/compositegoal/CompositeGoalCapability.java b/bdi-jade-test/src/bdi4jade/examples/compositegoal/CompositeGoalCapability.java
index 061ab79..697438a 100644
--- a/bdi-jade-test/src/bdi4jade/examples/compositegoal/CompositeGoalCapability.java
+++ b/bdi-jade-test/src/bdi4jade/examples/compositegoal/CompositeGoalCapability.java
@@ -36,10 +36,10 @@ import bdi4jade.event.GoalFinishedEvent;
 import bdi4jade.event.GoalListener;
 import bdi4jade.goal.Goal;
 import bdi4jade.plan.Plan;
+import bdi4jade.plan.SimplePlan;
 import bdi4jade.util.goal.CompositeGoal;
 import bdi4jade.util.goal.ParallelGoal;
 import bdi4jade.util.goal.SequentialGoal;
-import bdi4jade.util.plan.SimplePlan;
 
 /**
  * @author ingrid
diff --git a/bdi-jade-test/src/bdi4jade/examples/helloworld/HelloWorldAgent.java b/bdi-jade-test/src/bdi4jade/examples/helloworld/HelloWorldAgent.java
index b60d141..a997580 100644
--- a/bdi-jade-test/src/bdi4jade/examples/helloworld/HelloWorldAgent.java
+++ b/bdi-jade-test/src/bdi4jade/examples/helloworld/HelloWorldAgent.java
@@ -24,7 +24,7 @@ package bdi4jade.examples.helloworld;
 
 import bdi4jade.core.BDIAgent;
 import bdi4jade.goal.Goal;
-import bdi4jade.util.plan.SimplePlan;
+import bdi4jade.plan.SimplePlan;
 
 public class HelloWorldAgent extends BDIAgent {
 
diff --git a/bdi-jade-test/src/bdi4jade/examples/nestedcapabilities/NestedCapabilitiesAgent.java b/bdi-jade-test/src/bdi4jade/examples/nestedcapabilities/NestedCapabilitiesAgent.java
index 4ed8e92..8975558 100644
--- a/bdi-jade-test/src/bdi4jade/examples/nestedcapabilities/NestedCapabilitiesAgent.java
+++ b/bdi-jade-test/src/bdi4jade/examples/nestedcapabilities/NestedCapabilitiesAgent.java
@@ -27,7 +27,7 @@ import bdi4jade.core.BDIAgent;
 import bdi4jade.core.Capability;
 import bdi4jade.goal.Goal;
 import bdi4jade.plan.PlanBodyInterface;
-import bdi4jade.util.plan.SimplePlan;
+import bdi4jade.plan.SimplePlan;
 
 class ChildGoal implements Goal {
 	private static final long serialVersionUID = 7656633869373580240L;
diff --git a/bdi-jade-test/src/bdi4jade/examples/ping/PingPongCapability.java b/bdi-jade-test/src/bdi4jade/examples/ping/PingPongCapability.java
index b0371c1..f132068 100644
--- a/bdi-jade-test/src/bdi4jade/examples/ping/PingPongCapability.java
+++ b/bdi-jade-test/src/bdi4jade/examples/ping/PingPongCapability.java
@@ -31,7 +31,7 @@ import bdi4jade.core.BeliefBase;
 import bdi4jade.core.Capability;
 import bdi4jade.core.PlanLibrary;
 import bdi4jade.plan.Plan;
-import bdi4jade.util.plan.SimplePlan;
+import bdi4jade.plan.SimplePlan;
 
 /**
  * @author ingrid
diff --git a/bdi-jade-test/src/bdi4jade/examples/planfailed/PlanFailedCapability.java b/bdi-jade-test/src/bdi4jade/examples/planfailed/PlanFailedCapability.java
index 1ff1a33..6c65c70 100644
--- a/bdi-jade-test/src/bdi4jade/examples/planfailed/PlanFailedCapability.java
+++ b/bdi-jade-test/src/bdi4jade/examples/planfailed/PlanFailedCapability.java
@@ -36,7 +36,7 @@ import bdi4jade.event.GoalFinishedEvent;
 import bdi4jade.event.GoalListener;
 import bdi4jade.goal.Goal;
 import bdi4jade.plan.Plan;
-import bdi4jade.util.plan.SimplePlan;
+import bdi4jade.plan.SimplePlan;
 
 /**
  * @author ingrid
diff --git a/bdi-jade-test/src/bdi4jade/examples/planselection/Softgoals.java b/bdi-jade-test/src/bdi4jade/examples/planselection/Softgoals.java
index 0fee133..5843d67 100644
--- a/bdi-jade-test/src/bdi4jade/examples/planselection/Softgoals.java
+++ b/bdi-jade-test/src/bdi4jade/examples/planselection/Softgoals.java
@@ -22,8 +22,8 @@
 
 package bdi4jade.examples.planselection;
 
-import bdi4jade.softgoal.NamedSoftgoal;
-import bdi4jade.softgoal.Softgoal;
+import bdi4jade.extension.softgoal.core.NamedSoftgoal;
+import bdi4jade.extension.softgoal.core.Softgoal;
 
 /**
  * @author ingrid
diff --git a/bdi-jade-test/src/bdi4jade/examples/planselection/TransportationAgent.java b/bdi-jade-test/src/bdi4jade/examples/planselection/TransportationAgent.java
index 8493146..3015927 100644
--- a/bdi-jade-test/src/bdi4jade/examples/planselection/TransportationAgent.java
+++ b/bdi-jade-test/src/bdi4jade/examples/planselection/TransportationAgent.java
@@ -28,18 +28,19 @@ import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 
 import bdi4jade.belief.TransientBelief;
+import bdi4jade.extension.softgoal.core.SoftGoalBDIAgent;
+import bdi4jade.extension.softgoal.core.Softgoal;
+import bdi4jade.extension.softgoal.core.SoftgoalPreferences;
 import bdi4jade.plan.Plan;
-import bdi4jade.preference.SoftgoalPreferences;
-import bdi4jade.softgoal.Softgoal;
-import bdi4jade.util.agent.UtilityBasedBDIAgent;
-
+
 /**
  * @author ingrid
  * 
  */
-public class TransportationAgent extends UtilityBasedBDIAgent {
-
-	private static final long serialVersionUID = 2712019445290687786L;
+public class TransportationAgent extends SoftGoalBDIAgent {
+	
+	static final long serialVersionUID = 2712019445290687786L;
+	
 	public static final String SATISFACTION = "Satisfaction";
 
 	private final Random rand;
diff --git a/bdi-jade-test/src/bdi4jade/examples/planselection/TransportationPlan.java b/bdi-jade-test/src/bdi4jade/examples/planselection/TransportationPlan.java
index 436e093..0460527 100644
--- a/bdi-jade-test/src/bdi4jade/examples/planselection/TransportationPlan.java
+++ b/bdi-jade-test/src/bdi4jade/examples/planselection/TransportationPlan.java
@@ -26,9 +26,10 @@ import java.util.ArrayList;
 import java.util.List;
 import java.util.Map;
 
-import bdi4jade.softgoal.PlanContribution;
-import bdi4jade.softgoal.Softgoal;
-import bdi4jade.util.plan.SimplePlan;
+import bdi4jade.extension.softgoal.core.Softgoal;
+import bdi4jade.extension.softgoal.plan.AnnotatedPlan.DefaultMetadata;
+import bdi4jade.extension.softgoal.plan.PlanContribution;
+import bdi4jade.plan.SimplePlan;
 
 /**
  * @author ingrid
diff --git a/bdi-jade-test/src/bdi4jade/examples/planselection/TransportationPlanBody.java b/bdi-jade-test/src/bdi4jade/examples/planselection/TransportationPlanBody.java
index 3cbcd97..069fc22 100644
--- a/bdi-jade-test/src/bdi4jade/examples/planselection/TransportationPlanBody.java
+++ b/bdi-jade-test/src/bdi4jade/examples/planselection/TransportationPlanBody.java
@@ -28,9 +28,9 @@ import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 
 import bdi4jade.belief.TransientBelief;
+import bdi4jade.extension.softgoal.core.SoftgoalPreferences;
 import bdi4jade.plan.Plan.EndState;
 import bdi4jade.plan.PlanBody;
-import bdi4jade.preference.SoftgoalPreferences;
 
 /**
  * @author ingrid
@@ -139,5 +139,5 @@ public class TransportationPlanBody extends PlanBody {
 		this.preferences = (SoftgoalPreferences) getBeliefBase().getBelief(
 				SoftgoalPreferences.NAME);
 	}
-	
+
 }
diff --git a/bdi-jade-test/src/bdi4jade/examples/subgoal/SubgoalCapability.java b/bdi-jade-test/src/bdi4jade/examples/subgoal/SubgoalCapability.java
index 85fd630..25bdaf9 100644
--- a/bdi-jade-test/src/bdi4jade/examples/subgoal/SubgoalCapability.java
+++ b/bdi-jade-test/src/bdi4jade/examples/subgoal/SubgoalCapability.java
@@ -29,7 +29,7 @@ import bdi4jade.core.BeliefBase;
 import bdi4jade.core.Capability;
 import bdi4jade.core.PlanLibrary;
 import bdi4jade.plan.Plan;
-import bdi4jade.util.plan.SimplePlan;
+import bdi4jade.plan.SimplePlan;
 
 /**
  * @author ingrid
diff --git a/bdi-jade-test/src/bdi4jade/examples/template/MyAgent.java b/bdi-jade-test/src/bdi4jade/examples/template/MyAgent.java
index 8862600..caadeca 100644
--- a/bdi-jade-test/src/bdi4jade/examples/template/MyAgent.java
+++ b/bdi-jade-test/src/bdi4jade/examples/template/MyAgent.java
@@ -25,17 +25,17 @@ package bdi4jade.examples.template;
 import bdi4jade.examples.template.goal.MyGoal;
 import bdi4jade.examples.template.plan.MyPlan1;
 import bdi4jade.examples.template.plan.MyPlan2;
-import bdi4jade.preference.SoftgoalPreferences;
-import bdi4jade.softgoal.Softgoal;
-import bdi4jade.util.agent.UtilityBasedBDIAgent;
+import bdi4jade.extension.softgoal.core.SoftGoalBDIAgent;
+import bdi4jade.extension.softgoal.core.Softgoal;
+import bdi4jade.extension.softgoal.core.SoftgoalPreferences;
 
 /**
  * @author ingrid
  * 
  */
-public class MyAgent extends UtilityBasedBDIAgent {
+public class MyAgent extends SoftGoalBDIAgent {
 
-	private static final long serialVersionUID = 2712019445290687786L;
+	static final long serialVersionUID = 2712019445290687786L;
 
 	public MyAgent() {
 
diff --git a/bdi-jade-test/src/bdi4jade/examples/template/MyAgentSoftgoals.java b/bdi-jade-test/src/bdi4jade/examples/template/MyAgentSoftgoals.java
index 64184d9..481d64d 100644
--- a/bdi-jade-test/src/bdi4jade/examples/template/MyAgentSoftgoals.java
+++ b/bdi-jade-test/src/bdi4jade/examples/template/MyAgentSoftgoals.java
@@ -22,8 +22,8 @@
 
 package bdi4jade.examples.template;
 
-import bdi4jade.softgoal.NamedSoftgoal;
-import bdi4jade.softgoal.Softgoal;
+import bdi4jade.extension.softgoal.core.NamedSoftgoal;
+import bdi4jade.extension.softgoal.core.Softgoal;
 
 /**
  * @author ingrid
diff --git a/bdi-jade-test/src/bdi4jade/examples/template/plan/MyPlan1.java b/bdi-jade-test/src/bdi4jade/examples/template/plan/MyPlan1.java
index 6a2cd42..a7dc650 100644
--- a/bdi-jade-test/src/bdi4jade/examples/template/plan/MyPlan1.java
+++ b/bdi-jade-test/src/bdi4jade/examples/template/plan/MyPlan1.java
@@ -28,9 +28,10 @@ import java.util.Map;
 
 import bdi4jade.examples.template.MyAgentSoftgoals;
 import bdi4jade.examples.template.goal.MyGoal;
-import bdi4jade.softgoal.PlanContribution;
-import bdi4jade.softgoal.Softgoal;
-import bdi4jade.util.plan.SimplePlan;
+import bdi4jade.extension.softgoal.core.Softgoal;
+import bdi4jade.extension.softgoal.plan.AnnotatedPlan.DefaultMetadata;
+import bdi4jade.extension.softgoal.plan.PlanContribution;
+import bdi4jade.plan.SimplePlan;
 
 /**
  * @author ingrid
@@ -45,13 +46,17 @@ public class MyPlan1 extends SimplePlan {
 		List<PlanContribution> sgContributions = null;
 
 		sgContributions = new ArrayList<PlanContribution>();
-		sgContributions.add(new PlanContribution(MyAgentSoftgoals.Softgoal1, 0.6, 0.0));
-		sgContributions.add(new PlanContribution(MyAgentSoftgoals.Softgoal1, 0.4, 1.0));
+		sgContributions.add(new PlanContribution(MyAgentSoftgoals.Softgoal1,
+				0.6, 0.0));
+		sgContributions.add(new PlanContribution(MyAgentSoftgoals.Softgoal1,
+				0.4, 1.0));
 		contributions.put(MyAgentSoftgoals.Softgoal1, sgContributions);
 
 		sgContributions = new ArrayList<PlanContribution>();
-		sgContributions.add(new PlanContribution(MyAgentSoftgoals.Softgoal2, 0.2, 0.0));
-		sgContributions.add(new PlanContribution(MyAgentSoftgoals.Softgoal2, 0.8, 1.0));
+		sgContributions.add(new PlanContribution(MyAgentSoftgoals.Softgoal2,
+				0.2, 0.0));
+		sgContributions.add(new PlanContribution(MyAgentSoftgoals.Softgoal2,
+				0.8, 1.0));
 		contributions.put(MyAgentSoftgoals.Softgoal2, sgContributions);
 	}
 
diff --git a/bdi-jade-test/src/bdi4jade/examples/template/plan/MyPlan2.java b/bdi-jade-test/src/bdi4jade/examples/template/plan/MyPlan2.java
index d7e1cf1..2583274 100644
--- a/bdi-jade-test/src/bdi4jade/examples/template/plan/MyPlan2.java
+++ b/bdi-jade-test/src/bdi4jade/examples/template/plan/MyPlan2.java
@@ -28,9 +28,10 @@ import java.util.Map;
 
 import bdi4jade.examples.template.MyAgentSoftgoals;
 import bdi4jade.examples.template.goal.MyGoal;
-import bdi4jade.softgoal.PlanContribution;
-import bdi4jade.softgoal.Softgoal;
-import bdi4jade.util.plan.SimplePlan;
+import bdi4jade.extension.softgoal.core.Softgoal;
+import bdi4jade.extension.softgoal.plan.AnnotatedPlan.DefaultMetadata;
+import bdi4jade.extension.softgoal.plan.PlanContribution;
+import bdi4jade.plan.SimplePlan;
 
 /**
  * @author ingrid
@@ -45,13 +46,17 @@ public class MyPlan2 extends SimplePlan {
 		List<PlanContribution> sgContributions = null;
 
 		sgContributions = new ArrayList<PlanContribution>();
-		sgContributions.add(new PlanContribution(MyAgentSoftgoals.Softgoal1, 0.3, 0.0));
-		sgContributions.add(new PlanContribution(MyAgentSoftgoals.Softgoal1, 0.7, 1.0));
+		sgContributions.add(new PlanContribution(MyAgentSoftgoals.Softgoal1,
+				0.3, 0.0));
+		sgContributions.add(new PlanContribution(MyAgentSoftgoals.Softgoal1,
+				0.7, 1.0));
 		contributions.put(MyAgentSoftgoals.Softgoal1, sgContributions);
 
 		sgContributions = new ArrayList<PlanContribution>();
-		sgContributions.add(new PlanContribution(MyAgentSoftgoals.Softgoal2, 0.5, 0.0));
-		sgContributions.add(new PlanContribution(MyAgentSoftgoals.Softgoal2, 0.5, 1.0));
+		sgContributions.add(new PlanContribution(MyAgentSoftgoals.Softgoal2,
+				0.5, 0.0));
+		sgContributions.add(new PlanContribution(MyAgentSoftgoals.Softgoal2,
+				0.5, 1.0));
 		contributions.put(MyAgentSoftgoals.Softgoal2, sgContributions);
 	}