jadex.bdi.planlib.DefaultBDIVisionProcessor Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jadex-applib-bdi Show documentation
Show all versions of jadex-applib-bdi Show documentation
The Jadex applib BDI package contain
ready to use functionalities for
BDI agents mostly in form of modules
called capabilities.
package jadex.bdi.planlib;
import jadex.bdi.runtime.IBDIExternalAccess;
import jadex.bdi.runtime.IBDIInternalAccess;
import jadex.bridge.IComponentDescription;
import jadex.bridge.IComponentManagementService;
import jadex.bridge.IComponentStep;
import jadex.bridge.IInternalAccess;
import jadex.bridge.service.RequiredServiceInfo;
import jadex.bridge.service.SServiceProvider;
import jadex.commons.IValueFetcher;
import jadex.commons.SUtil;
import jadex.commons.SimplePropertyObject;
import jadex.commons.future.IFuture;
import jadex.commons.future.IResultListener;
import jadex.extension.envsupport.environment.IEnvironmentSpace;
import jadex.extension.envsupport.environment.IPerceptProcessor;
import jadex.extension.envsupport.environment.ISpaceObject;
import jadex.extension.envsupport.environment.space2d.Space2D;
import jadex.extension.envsupport.math.IVector1;
import jadex.extension.envsupport.math.IVector2;
import jadex.extension.envsupport.math.Vector1Double;
import jadex.javaparser.IParsedExpression;
import jadex.javaparser.SimpleValueFetcher;
import jadex.xml.annotation.XMLClassname;
import java.util.HashMap;
import java.util.Map;
import java.util.Set;
/**
* Default bdi agent vision processor.
* Updates the agent's beliefsets according to the percepts of new/disappeared waste.
*/
public class DefaultBDIVisionProcessor extends SimplePropertyObject implements IPerceptProcessor
{
//-------- constants --------
/** The percept types property. */
public static String PROPERTY_PERCEPTTYPES = "percepttypes";
/** The add action. */
public static String ADD = "add";
/** The remove action. */
public static String REMOVE = "remove";
/** The remove_outdated action (checks all entries in the belief set, if they should be seen, but are no longer there). */
public static String REMOVE_OUTDATED = "remove_outdated";
/** The set action. */
public static String SET = "set";
/** The unset action (sets a belief fact to null). */
public static String UNSET = "unset";
/** The maxrange property. */
public static String PROPERTY_MAXRANGE = "range";
/** The maxrange property. */
public static String PROPERTY_RANGE = "range_property";
//-------- attributes --------
/** The percepttypes infos. */
protected Map percepttypes;
//-------- methods --------
/**
* Process a new percept.
* @param space The space.
* @param type The type.
* @param percept The percept.
* @param agent The agent identifier.
* @param agent The avatar of the agent (if any).
*/
public void processPercept(final IEnvironmentSpace space, final String type, final Object percept, final IComponentDescription agent, final ISpaceObject avatar)
{
boolean invoke = false;
final String[][] metainfos = getMetaInfos(type);
for(int i=0; !invoke && metainfos!=null && i
© 2015 - 2025 Weber Informatics LLC | Privacy Policy