Interface IEnvironmentSpace
-
- All Superinterfaces:
IExtensionInstance
,IPropertyObject
- All Known Implementing Classes:
AbstractEnvironmentSpace
,ContinuousSpace2D
,ContinuousSpace3D
,Grid2D
,Grid3D
,Space2D
,Space3D
public interface IEnvironmentSpace extends IPropertyObject, IExtensionInstance
Main interface for an environment space.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
addDataView(java.lang.String name, IDataView view)
Adds a dataview to the space.void
addEnvironmentListener(IEnvironmentListener listener)
Add an environment listener.void
addObjectTaskType(java.lang.String typename, java.lang.Class clazz, java.util.List properties)
Add a object task type.void
addPerceptGenerator(java.lang.Object id, IPerceptGenerator gen)
Adds a percept generator.void
addPerceptType(PerceptType percepttype)
Add a space percept type.void
addSpaceAction(java.lang.String name, ISpaceAction action)
Adds an space action.void
addSpaceObjectType(java.lang.String typename, IPropertyMetaDataSet properties)
Add a space object type.void
addSpaceProcessType(java.lang.String typename, java.lang.Class clazz, java.util.List properties)
Add a space process type.void
addTaskListener(java.lang.Object taskid, java.lang.Object objectid, IResultListener listener)
Add a result listener to an object task.void
cancelSpaceAction(int id)
Cancel a queued space action.java.lang.Object
createObjectTask(java.lang.String typename, java.util.Map properties, java.lang.Object objectid)
Creates an object task.ISpaceObject
createSpaceObject(java.lang.String typename, java.util.Map properties, java.util.List tasks)
Creates an object in this space.void
createSpaceProcess(java.lang.String type, java.util.Map props)
Creates a space process.void
destroySpaceObject(java.lang.Object id)
Destroys an object in this space.ISpaceObject
getAvatar(IComponentDescription owner)
Get the avatar.ISpaceObject[]
getAvatars(IComponentDescription owner)
Get the owned objects.IDataView
getDataView(java.lang.String name)
Gets a specific dataview.java.util.Map
getDataViews()
Get all available dataviews in this space.IExternalAccess
getExternalAccess()
Get the component of the space.PerceptType
getPerceptType(java.lang.String percepttype)
Get a space percept type.ISpaceObject
getSpaceObject(java.lang.Object id)
Returns an object in this space.ISpaceObject[]
getSpaceObjectsByType(java.lang.String type)
Get all space object of a specific type.ISpaceProcess
getSpaceProcess(java.lang.Object id)
Returns a space process.int
performSpaceAction(java.lang.String name, java.util.Map parameters, IResultListener listener)
Perform an space action.void
removeDataView(java.lang.String name)
Removes a dataview from the space.void
removeEnvironmentListener(IEnvironmentListener listener)
Remove an environment listener.void
removeObjectTask(java.lang.Object taskid, java.lang.Object objectid)
Remove an object task.void
removeObjectTaskType(java.lang.String typename)
Remove an object task type.void
removePerceptGenerator(java.lang.Object id)
Remove a percept generator.void
removePerceptType(java.lang.String typename)
Remove a space process type.void
removeSpaceAction(java.lang.String name)
Removes an space action.void
removeSpaceObjectType(java.lang.String typename)
Remove a space object type.void
removeSpaceProcess(java.lang.Object id)
Removes a space process.void
removeSpaceProcessType(java.lang.String typename)
Remove a space process type.void
removeTaskListener(java.lang.Object taskid, java.lang.Object objectid, IResultListener listener)
Remove a result listener from an object task.void
setOwner(java.lang.Object id, IComponentDescription owner)
Set the owner of an object.IFuture<java.lang.Void>
waitForTask(java.lang.Object taskid, java.lang.Object objectid)
Add a result listener to an object task.-
Methods inherited from interface jadex.application.IExtensionInstance
init, terminate
-
Methods inherited from interface jadex.commons.IPropertyObject
getProperty, getPropertyNames, hasProperty, setProperty
-
-
-
-
Method Detail
-
getExternalAccess
IExternalAccess getExternalAccess()
Get the component of the space.
-
addPerceptType
void addPerceptType(PerceptType percepttype)
Add a space percept type.- Parameters:
typename
- The percept name.objecttypes
- The objecttypes.componenttypes
- The componenttypes.
-
removePerceptType
void removePerceptType(java.lang.String typename)
Remove a space process type.- Parameters:
typename
- The type name.
-
getPerceptType
PerceptType getPerceptType(java.lang.String percepttype)
Get a space percept type.- Parameters:
percepttype
- The name of the percept type.- Returns:
- The percept type.
-
addSpaceProcessType
void addSpaceProcessType(java.lang.String typename, java.lang.Class clazz, java.util.List properties)
Add a space process type.- Parameters:
typename
- The type name.properties
- The properties (list of maps with name/value/dynamic).
-
removeSpaceProcessType
void removeSpaceProcessType(java.lang.String typename)
Remove a space process type.- Parameters:
typename
- The type name.
-
createSpaceProcess
void createSpaceProcess(java.lang.String type, java.util.Map props)
Creates a space process.- Parameters:
id
- ID of the space processtype
- The process type.
-
getSpaceProcess
ISpaceProcess getSpaceProcess(java.lang.Object id)
Returns a space process.- Parameters:
id
- ID of the space process- Returns:
- the space process or null if not found
-
removeSpaceProcess
void removeSpaceProcess(java.lang.Object id)
Removes a space process.- Parameters:
id
- ID of the space process
-
createSpaceObject
ISpaceObject createSpaceObject(java.lang.String typename, java.util.Map properties, java.util.List tasks)
Creates an object in this space.- Parameters:
typename
- the object's typeproperties
- initial properties (may be null)tasks
- initial task list (may be null)- Returns:
- the object.
-
addSpaceObjectType
void addSpaceObjectType(java.lang.String typename, IPropertyMetaDataSet properties)
Add a space object type.- Parameters:
typename
- The type name.properties
- The properties (map of maps with name->name/value/dynamic/event).
-
removeSpaceObjectType
void removeSpaceObjectType(java.lang.String typename)
Remove a space object type.- Parameters:
typename
- The type name.
-
destroySpaceObject
void destroySpaceObject(java.lang.Object id)
Destroys an object in this space.- Parameters:
id
- the object's ID
-
getSpaceObject
ISpaceObject getSpaceObject(java.lang.Object id)
Returns an object in this space.- Parameters:
id
- the object's ID- Returns:
- the object in this space
-
getSpaceObjectsByType
ISpaceObject[] getSpaceObjectsByType(java.lang.String type)
Get all space object of a specific type.- Parameters:
type
- The space object type.- Returns:
- The space objects of the desired type.
-
addObjectTaskType
void addObjectTaskType(java.lang.String typename, java.lang.Class clazz, java.util.List properties)
Add a object task type.- Parameters:
typename
- The type name.properties
- The properties (list of maps with name/value/dynamic).
-
removeObjectTaskType
void removeObjectTaskType(java.lang.String typename)
Remove an object task type.- Parameters:
typename
- The type name.
-
createObjectTask
java.lang.Object createObjectTask(java.lang.String typename, java.util.Map properties, java.lang.Object objectid)
Creates an object task.- Parameters:
typename
- The type name.properties
- The properties.- Returns:
- The task id.
-
removeObjectTask
void removeObjectTask(java.lang.Object taskid, java.lang.Object objectid)
Remove an object task.- Parameters:
typename
- The type name.properties
- The properties.
-
addTaskListener
void addTaskListener(java.lang.Object taskid, java.lang.Object objectid, IResultListener listener)
Add a result listener to an object task. The listener result will be the task id. If the task is already finished, the listener will be notified.
-
removeTaskListener
void removeTaskListener(java.lang.Object taskid, java.lang.Object objectid, IResultListener listener)
Remove a result listener from an object task.
-
waitForTask
IFuture<java.lang.Void> waitForTask(java.lang.Object taskid, java.lang.Object objectid)
Add a result listener to an object task. The listener result will be the task id. If the task is already finished, the listener will be notified.
-
addSpaceAction
void addSpaceAction(java.lang.String name, ISpaceAction action)
Adds an space action.- Parameters:
name
- the action IDaction
- the action
-
removeSpaceAction
void removeSpaceAction(java.lang.String name)
Removes an space action.- Parameters:
name
- the action ID
-
performSpaceAction
int performSpaceAction(java.lang.String name, java.util.Map parameters, IResultListener listener)
Perform an space action. It will be executed according to the space execution policy (e.g. at the end of a round).- Parameters:
name
- Id of the actionparameters
- parameters for the action (may be null)listener
- the result listener- Returns:
- The id of the action instance for later access.
-
cancelSpaceAction
void cancelSpaceAction(int id)
Cancel a queued space action.
-
addPerceptGenerator
void addPerceptGenerator(java.lang.Object id, IPerceptGenerator gen)
Adds a percept generator.- Parameters:
id
- The percept generator id.gen
- The percept generator.
-
removePerceptGenerator
void removePerceptGenerator(java.lang.Object id)
Remove a percept generator.- Parameters:
id
- The percept generator id.
-
setOwner
void setOwner(java.lang.Object id, IComponentDescription owner)
Set the owner of an object.- Parameters:
id
- The object id.owner
- The object owner.
-
getAvatars
ISpaceObject[] getAvatars(IComponentDescription owner)
Get the owned objects.- Returns:
- The owned objects.
-
getAvatar
ISpaceObject getAvatar(IComponentDescription owner)
Get the avatar.- Returns:
- The avatar.
-
addDataView
void addDataView(java.lang.String name, IDataView view)
Adds a dataview to the space.- Parameters:
name
- name of the viewview
- the view
-
removeDataView
void removeDataView(java.lang.String name)
Removes a dataview from the space.- Parameters:
name
- name of the dataview
-
getDataView
IDataView getDataView(java.lang.String name)
Gets a specific dataview.- Parameters:
name
- name of the dataview- Returns:
- the dataview
-
getDataViews
java.util.Map getDataViews()
Get all available dataviews in this space.- Returns:
- all available dataviews
-
addEnvironmentListener
void addEnvironmentListener(IEnvironmentListener listener)
Add an environment listener.- Parameters:
listener
- The environment listener.
-
removeEnvironmentListener
void removeEnvironmentListener(IEnvironmentListener listener)
Remove an environment listener.- Parameters:
listener
- The environment listener.
-
-