jadex.bdi.examples.cleanerworld.cleaner.MemorizePositionsPlan 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.examples.cleanerworld.cleaner;
import jadex.application.space.envsupport.math.IVector1;
import jadex.application.space.envsupport.math.IVector2;
import jadex.application.space.envsupport.math.Vector1Double;
import jadex.bdi.runtime.Plan;
/**
* Memorize the visited positions.
*/
public class MemorizePositionsPlan extends Plan
{
//-------- methods --------
/**
* The plan body.
*/
public void body()
{
double forget = 0.01;
while(true)
{
IVector2 my_location = (IVector2)getBeliefbase().getBelief("my_location").getFact();
MapPoint[] mps = (MapPoint[])getBeliefbase().getBeliefSet("visited_positions").getFacts();
double my_vision = ((Double)getBeliefbase().getBelief("my_vision").getFact()).doubleValue();
IVector1 dist = new Vector1Double(my_vision);
for(int i=0; i