jadex.application.space.envsupport.environment
Interface IEnvironmentSpace

All Superinterfaces:
IPropertyObject
All Known Implementing Classes:
AbstractEnvironmentSpace, ContinuousSpace2D, Grid2D, Space2D

public interface IEnvironmentSpace
extends IPropertyObject

Main interface for an environment space.


Method Summary
 void addDataView(String name, IDataView view)
          Adds a dataview to the space.
 void addEnvironmentListener(IEnvironmentListener listener)
          Add an environment listener.
 void addObjectTaskType(String typename, Class clazz, List properties)
          Add a object task type.
 void addPerceptGenerator(Object id, IPerceptGenerator gen)
          Adds a percept generator.
 void addPerceptType(PerceptType percepttype)
          Add a space percept type.
 void addSpaceAction(String name, ISpaceAction action)
          Adds an space action.
 void addSpaceObjectType(String typename, IPropertyMetaDataSet properties)
          Add a space object type.
 void addSpaceProcessType(String typename, Class clazz, List properties)
          Add a space process type.
 void addTaskListener(Object taskid, Object objectid, IResultListener listener)
          Add a result listener to an object task.
 Object createObjectTask(String typename, Map properties, Object objectid)
          Creates an object task.
 ISpaceObject createSpaceObject(String typename, Map properties, List tasks)
          Creates an object in this space.
 void createSpaceProcess(String type, Map props)
          Creates a space process.
 void destroySpaceObject(Object id)
          Destroys an object in this space.
 ISpaceObject getAvatar(IComponentIdentifier owner)
          Get the avatar.
 ISpaceObject[] getAvatars(IComponentIdentifier owner)
          Get the owned objects.
 IApplication getContext()
          Get the context of the space.
 IDataView getDataView(String name)
          Gets a specific dataview.
 Map getDataViews()
          Get all available dataviews in this space.
 PerceptType getPerceptType(String percepttype)
          Get a space percept type.
 ISpaceObject getSpaceObject(Object id)
          Returns an object in this space.
 ISpaceObject[] getSpaceObjectsByType(String type)
          Get all space object of a specific type.
 ISpaceProcess getSpaceProcess(Object id)
          Returns a space process.
 Object performSpaceAction(String name, Map parameters)
          Performs a space action.
 void performSpaceAction(String name, Map parameters, IResultListener listener)
          Perform an space action.
 void removeDataView(String name)
          Removes a dataview from the space.
 void removeEnvironmentListener(IEnvironmentListener listener)
          Remove an environment listener.
 void removeObjectTask(Object taskid, Object objectid)
          Remove an object task.
 void removeObjectTaskType(String typename)
          Remove an object task type.
 void removePerceptGenerator(Object id)
          Remove a percept generator.
 void removePerceptType(String typename)
          Remove a space process type.
 void removeSpaceAction(String name)
          Removes an space action.
 void removeSpaceObjectType(String typename)
          Remove a space object type.
 void removeSpaceProcess(Object id)
          Removes a space process.
 void removeSpaceProcessType(String typename)
          Remove a space process type.
 void removeTaskListener(Object taskid, Object objectid, IResultListener listener)
          Remove a result listener from an object task.
 void setOwner(Object id, IComponentIdentifier owner)
          Set the owner of an object.
 
Methods inherited from interface jadex.commons.IPropertyObject
getProperty, getPropertyNames, hasProperty, setProperty
 

Method Detail

getContext

IApplication getContext()
Get the context 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(String typename)
Remove a space process type.

Parameters:
typename - The type name.

getPerceptType

PerceptType getPerceptType(String percepttype)
Get a space percept type.

Parameters:
percepttype - The name of the percept type.
Returns:
The percept type.

addSpaceProcessType

void addSpaceProcessType(String typename,
                         Class clazz,
                         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(String typename)
Remove a space process type.

Parameters:
typename - The type name.

createSpaceProcess

void createSpaceProcess(String type,
                        Map props)
Creates a space process.

Parameters:
id - ID of the space process
type - The process type.

getSpaceProcess

ISpaceProcess getSpaceProcess(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(Object id)
Removes a space process.

Parameters:
id - ID of the space process

createSpaceObject

ISpaceObject createSpaceObject(String typename,
                               Map properties,
                               List tasks)
Creates an object in this space.

Parameters:
typename - the object's type
properties - initial properties (may be null)
tasks - initial task list (may be null)
Returns:
the object.

addSpaceObjectType

void addSpaceObjectType(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(String typename)
Remove a space object type.

Parameters:
typename - The type name.

destroySpaceObject

void destroySpaceObject(Object id)
Destroys an object in this space.

Parameters:
id - the object's ID

getSpaceObject

ISpaceObject getSpaceObject(Object id)
Returns an object in this space.

Parameters:
id - the object's ID
Returns:
the object in this space

getSpaceObjectsByType

ISpaceObject[] getSpaceObjectsByType(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(String typename,
                       Class clazz,
                       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(String typename)
Remove an object task type.

Parameters:
typename - The type name.

createObjectTask

Object createObjectTask(String typename,
                        Map properties,
                        Object objectid)
Creates an object task.

Parameters:
typename - The type name.
properties - The properties.
Returns:
The task id.

removeObjectTask

void removeObjectTask(Object taskid,
                      Object objectid)
Remove an object task.

Parameters:
typename - The type name.
properties - The properties.

addTaskListener

void addTaskListener(Object taskid,
                     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(Object taskid,
                        Object objectid,
                        IResultListener listener)
Remove a result listener from an object task.


addSpaceAction

void addSpaceAction(String name,
                    ISpaceAction action)
Adds an space action.

Parameters:
name - the action ID
action - the action

removeSpaceAction

void removeSpaceAction(String name)
Removes an space action.

Parameters:
name - the action ID

performSpaceAction

void performSpaceAction(String name,
                        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 action
parameters - parameters for the action (may be null)
listener - the result listener

performSpaceAction

Object performSpaceAction(String name,
                          Map parameters)
Performs a space action.

Parameters:
name - Id of the action
parameters - parameters for the action (may be null)
Returns:
return value of the action

addPerceptGenerator

void addPerceptGenerator(Object id,
                         IPerceptGenerator gen)
Adds a percept generator.

Parameters:
id - The percept generator id.
gen - The percept generator.

removePerceptGenerator

void removePerceptGenerator(Object id)
Remove a percept generator.

Parameters:
id - The percept generator id.

setOwner

void setOwner(Object id,
              IComponentIdentifier owner)
Set the owner of an object.

Parameters:
id - The object id.
owner - The object owner.

getAvatars

ISpaceObject[] getAvatars(IComponentIdentifier owner)
Get the owned objects.

Returns:
The owned objects.

getAvatar

ISpaceObject getAvatar(IComponentIdentifier owner)
Get the avatar.

Returns:
The avatar.

addDataView

void addDataView(String name,
                 IDataView view)
Adds a dataview to the space.

Parameters:
name - name of the view
view - the view

removeDataView

void removeDataView(String name)
Removes a dataview from the space.

Parameters:
name - name of the dataview

getDataView

IDataView getDataView(String name)
Gets a specific dataview.

Parameters:
name - name of the dataview
Returns:
the dataview

getDataViews

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.


Copyright © 2010. All Rights Reserved.