
jadex.bdi.examples.cleanerworld_classic.cleaner.RemoteGetVisionActionPlan 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_classic.cleaner;
import jadex.bdi.examples.cleanerworld_classic.Cleaner;
import jadex.bdi.examples.cleanerworld_classic.Location;
import jadex.bdi.examples.cleanerworld_classic.RequestVision;
import jadex.bdi.examples.cleanerworld_classic.Vision;
import jadex.bdi.examples.cleanerworld_classic.Waste;
import jadex.bdi.runtime.IGoal;
import jadex.bridge.fipa.Done;
/**
* Get the vision.
*/
public class RemoteGetVisionActionPlan extends RemoteActionPlan
{
//-------- methods --------
/**
* The plan body.
*/
public void body()
{
Cleaner cl = new Cleaner((Location)getBeliefbase().getBelief("my_location").getFact(), getComponentName(),
(Waste)getBeliefbase().getBelief("carriedwaste").getFact(),
((Number)getBeliefbase().getBelief("my_vision").getFact()).doubleValue(),
((Number)getBeliefbase().getBelief("my_chargestate").getFact()).doubleValue());
RequestVision rv = new RequestVision();
rv.setCleaner(cl);
IGoal result = requestAction(rv);
Vision vision = ((RequestVision)(((Done)result.getParameter("result").getValue()).getAction())).getVision();
getParameter("vision").setValue(vision);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy