
jadex.bdi.examples.spaceworld3d.movement.RandomWalkPlan 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.spaceworld3d.movement;
import jadex.bdi.runtime.IGoal;
import jadex.bdi.runtime.Plan;
import jadex.extension.envsupport.environment.space3d.Space3D;
import jadex.extension.envsupport.math.IVector3;
import jadex.extension.envsupport.math.Vector3Int;
/**
* Wander around randomly.
*/
public class RandomWalkPlan extends Plan
{
//-------- constructors --------
/**
* Create a new plan.
*/
public RandomWalkPlan()
{
//getLogger().info("Created: "+this+" for goal "+getRootGoal());
}
//-------- methods --------
/**
* The plan body.
*/
public void body()
{
// System.out.println("RandomWalk: "+getComponentIdentifier());
IVector3 dest = ((Space3D)getBeliefbase().getBelief("environment").getFact()).getRandomPosition(Vector3Int.ZERO);
IGoal moveto = createGoal("move_dest");
moveto.getParameter("destination").setValue(dest);
dispatchSubgoalAndWait(moveto);
getLogger().info("Reached point: "+dest);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy