jadex.bdi.tutorial.RemoveWordPlanE3 Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jadex-applications-bdi Show documentation
Show all versions of jadex-applications-bdi Show documentation
The Jadex BDI applications package contain
several example applications, benchmarks and
testcases using BDI agents.
package jadex.bdi.tutorial;
import jadex.bdi.runtime.Plan;
/**
* Remove a word from a word table.
*/
public class RemoveWordPlanE3 extends Plan
{
//-------- attributes --------
/** The belief name. */
// protected String beliefsetname;
//-------- constructor --------
/**
* Create a new plan.
* @param beliefsetname The beliefset name.
*/
public RemoveWordPlanE3()
{
// this("egwords");
}
/**
* Create a new plan.
* @param beliefsetname The beliefset name.
* /
public RemoveWordPlanE3(String beliefsetname)
{
getLogger().info("Created: "+this);
this.beliefsetname = beliefsetname;
}*/
//-------- methods --------
/**
* The plan body.
*/
public void body()
{
Object[] facts = getBeliefbase().getBeliefSet("egwords").getFacts();
getBeliefbase().getBeliefSet("egwords").removeFact(facts[0]);
getLogger().info("Success, removed: "+facts[0]);
}
}