All Downloads are FREE. Search and download functionalities are using the official Maven repository.

jadex.bdi.examples.cleanerworld.cleaner.MemorizePositionsPlan Maven / Gradle / Ivy

Go to download

The Jadex BDI applications package contain several example applications, benchmarks and testcases using BDI agents.

There is a newer version: 2.4
Show newest version
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




© 2015 - 2024 Weber Informatics LLC | Privacy Policy