
jadex.bdi.examples.blocksworld.ConfigureBlocksPlan 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.blocksworld;
import jadex.bdi.runtime.IGoal;
import jadex.bdi.runtime.Plan;
import java.awt.Color;
import java.util.HashSet;
import java.util.Iterator;
import java.util.Set;
/**
* Stack blocks according to the target configuration.
*/
public class ConfigureBlocksPlan extends Plan
{
//-------- methods --------
/**
* The plan body.
*/
public void body()
{
Table configuration = (Table)getParameter("configuration").getValue();
// getParameterSet("blocks").addValues(configuration.getAllBlocks());
// Create set of blocks currently on the table.
Table table = (Table)getBeliefbase().getBelief("table").getFact();
Block[] blocks = table.getAllBlocks();
Set oldblocks = new HashSet();
for(int i=0; i
© 2015 - 2025 Weber Informatics LLC | Privacy Policy