madkit.strobekit
Class CognitiveEnv

java.lang.Object
  extended bymadkit.strobekit.CognitiveEnv

public class CognitiveEnv
extends java.lang.Object

This class define the cognitive environment structure of the STROBEKIT API. A CognitiveEnv belongs to a Strobe agent and is dedicated to another one. It has two input and output stream of messages.

A CognitiveEnv is associated to a Scheme environment (provided by Kawa). This Scheme environment contains a Scheme interpreter used by the CognitiveEnv to evaluate messages.

This class contains methods for:

Version:
0.1 01/30/2006
Author:
Clement Jonquet - Mail to jonquet@lirmm.fr

Constructor Summary
CognitiveEnv(StrobeAbstractAgent owner, madkit.kernel.AgentAddress dedicated)
          Create a new cognitive environment dedicated to dedicated which belongs to owner.
 
Method Summary
 void evaluateStrobeMsg(StrobeMsg msg)
          Evaluate a Strobe message in the cognitive environment (with the local interpreter); if the result is a message then it is push in the cognitive environment output stream else, the method analyzeAnswer of the owner Strobe agent is called.
 gnu.mapping.SimpleEnvironment getBind()
          Return the cognitive environment Scheme environment.
 java.util.Vector getInputStream()
          Return the cognitive environment input stream of messages.
 java.util.Vector getOutputStream()
          Return the cognitive environment output stream of messages.
 void initializeWithSchemeFile(java.lang.String scmfilename)
          Allow to load a Scheme file in the cognitive environment.
 boolean isStreamEmpty(java.util.Vector msgStream)
          Return true if msgStream is empty
 StrobeMsg popStream(java.util.Vector msgStream)
          Remove a message to a cognitive environment stream (input or output).
 void pushStream(java.util.Vector msgStream, StrobeMsg msg)
          Add a message to a cognitive environment stream (input or output).
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CognitiveEnv

public CognitiveEnv(StrobeAbstractAgent owner,
                    madkit.kernel.AgentAddress dedicated)
Create a new cognitive environment dedicated to dedicated which belongs to owner.

Method Detail

initializeWithSchemeFile

public void initializeWithSchemeFile(java.lang.String scmfilename)
Allow to load a Scheme file in the cognitive environment.


getBind

public gnu.mapping.SimpleEnvironment getBind()
Return the cognitive environment Scheme environment.


getInputStream

public java.util.Vector getInputStream()
Return the cognitive environment input stream of messages.


getOutputStream

public java.util.Vector getOutputStream()
Return the cognitive environment output stream of messages.


pushStream

public void pushStream(java.util.Vector msgStream,
                       StrobeMsg msg)
Add a message to a cognitive environment stream (input or output).


popStream

public StrobeMsg popStream(java.util.Vector msgStream)
Remove a message to a cognitive environment stream (input or output).


isStreamEmpty

public boolean isStreamEmpty(java.util.Vector msgStream)
Return true if msgStream is empty


evaluateStrobeMsg

public void evaluateStrobeMsg(StrobeMsg msg)
Evaluate a Strobe message in the cognitive environment (with the local interpreter); if the result is a message then it is push in the cognitive environment output stream else, the method analyzeAnswer of the owner Strobe agent is called.