package jadex.bdi.examples.garbagecollector; import jadex.application.space.envsupport.environment.IEnvironmentSpace; import jadex.application.space.envsupport.environment.ISpaceAction; import jadex.bdi.runtime.IGoal; import jadex.bdi.runtime.Plan; import java.util.HashMap; import java.util.Map; /** * Burn a piece of garbage. */ public class BurnPlanEnv extends Plan { /** * The plan body. */ public void body() { // System.out.println("Burn plan activated!"); IEnvironmentSpace env = (IEnvironmentSpace)getBeliefbase().getBelief("env").getFact(); // Pickup the garbarge. IGoal pickup = createGoal("pick"); dispatchSubgoalAndWait(pickup); SyncResultListener srl = new SyncResultListener(); Map params = new HashMap(); params.put(ISpaceAction.ACTOR_ID, getComponentIdentifier()); env.performSpaceAction("burn", params, srl); srl.waitForResult(); } }