
jadex.bdi.examples.cleanerworld.cleaner.ExploreMapPlan 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.
The newest version!
package jadex.bdi.examples.cleanerworld.cleaner;
import jadex.bdi.runtime.IGoal;
import jadex.bdi.runtime.Plan;
import jadex.extension.envsupport.environment.space2d.Space2D;
import jadex.extension.envsupport.math.IVector1;
import jadex.extension.envsupport.math.IVector2;
import java.util.List;
/**
* Plan to explore the map by going to the seldom visited positions.
* Uses the absolute quantity to go to positions that are not yet
* explored.
*/
public class ExploreMapPlan extends Plan
{
//-------- constructors --------
/**
* Create a new plan.
*/
public ExploreMapPlan()
{
// getLogger().info("Created: "+this+" for goal "+getRootGoal());
}
//-------- methods --------
/**
* The plan body.
*/
public void body()
{
// Use shortest not seen point
Space2D env = (Space2D)getBeliefbase().getBelief("environment").getFact();
IVector2 mypos = (IVector2)getBeliefbase().getBelief("my_location").getFact();
List mps = (List)getExpression("query_min_quantity").execute();
MapPoint mp = (MapPoint)mps.get(0);
IVector1 dist = env.getDistance(mypos, mp.getLocation());
int cnt = 1;
for( ; cnt
© 2015 - 2025 Weber Informatics LLC | Privacy Policy