com.agentfactory.cldc
Class PerceptionManager

java.lang.Object
  extended by com.agentfactory.cldc.PerceptionManager

public class PerceptionManager
extends java.lang.Object

The perception manager enables perceptors to interact with modules and services.

Author:
Conor Muldoon

Constructor Summary
PerceptionManager(Agent agent, AgentName agentName, java.util.Hashtable modules, java.util.Hashtable services, Scheduler sched)
          Creates a new instance of PerceptorManager
 
Method Summary
 void adoptBelief(FOS fos)
          Adds a belief to the agent.
 void appendName(java.lang.StringBuffer buffer)
          Appends the agents name to a string buffer.
 FOS perManage(java.lang.Object key, int perceptionID)
          Returns a first order structure that represents the information that has been perceived in a module or a service.
 void scheduleTask(java.lang.Object key, java.lang.Runnable task, int period)
          Associates a task with a key and schedules it to be executed at a specific periodic interval.
 void scheduleTask(java.lang.Runnable task)
          Schedules a task to be executed in a once off manner.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PerceptionManager

public PerceptionManager(Agent agent,
                         AgentName agentName,
                         java.util.Hashtable modules,
                         java.util.Hashtable services,
                         Scheduler sched)
Creates a new instance of PerceptorManager

Parameters:
agent - the agent that the perception manager belongs to.
agentName - the name of the agent that the perception manager belongs to.
modules - the modules for the agent.
services - the services for the platform.
sched - the scheduler for the platform.
Method Detail

scheduleTask

public void scheduleTask(java.lang.Object key,
                         java.lang.Runnable task,
                         int period)
Associates a task with a key and schedules it to be executed at a specific periodic interval.

Parameters:
key - the key the task is to be assoicated with.
task - the task to be executed.
period - the period at which the task should be executed.

scheduleTask

public void scheduleTask(java.lang.Runnable task)
Schedules a task to be executed in a once off manner.

Parameters:
task - the task to be executed.

adoptBelief

public void adoptBelief(FOS fos)
Adds a belief to the agent.

Parameters:
fos - the belief to be added.

perManage

public FOS perManage(java.lang.Object key,
                     int perceptionID)
Returns a first order structure that represents the information that has been perceived in a module or a service. The module or service is identified through the use of the object key. The perception ID is used to determine between different types of perception that can be performed on the module or service in question. If no module or service match the key specified, null will be returned. If no information has been perceived, null will be returned.

Parameters:
key - the key of the module or service that the agent wishes to perceive.
perceptionID - the ID of the information within the module or service that the agent wishes to perceive.
Returns:
a first order structure that represents the information that has been perceived in a module or a service.

appendName

public void appendName(java.lang.StringBuffer buffer)
Appends the agents name to a string buffer.

Parameters:
buffer - the buffer the name is to be appended to.