Interface Environment

All Known Implementing Classes:
Square

public interface Environment

This is the interface that must be implemented by all problems presented to the XCSJava implementation.

Since:
JDK 1.3

Method Summary
 double computeDistance(java.lang.String state, java.lang.String condition)
          Compute the distance between the signal and the most remote classifier from the signal.
 boolean doReset()
          Returns if the agent has reached the end of a problem.
 double executeAction(int action)
          Executes an action in the environment.
 int getConditionLength()
          Returns the length of the coded situations.
 java.lang.String getCurrentState()
          Returns the current situation.
 int getMaxPayoff()
          Returns the maximal payoff receivable in an environment.
 int getNrActions()
          Returns the number of possible actions in the environment
 double getProblemSurface()
          Returns the size of the problem space
 boolean isMultiStepProblem()
          Returns true if the problem is a multi-step problem.
 java.lang.String resetState()
          Resets the current state to a random instance of a problem.
 boolean wasCorrect()
          Returns if this action was a good/correct action.
 

Method Detail

resetState

public java.lang.String resetState()
Resets the current state to a random instance of a problem. A random instance can be a next problem in a table, a randomly generated string, a random position in a maze ...


getCurrentState

public java.lang.String getCurrentState()
Returns the current situation. A situation can be the current perceptual inputs, a random problem instance ...


executeAction

public double executeAction(int action)
Executes an action in the environment.

Parameters:
action - An action can be an active action like a movement, grip... or a simple classification (good/bad, correct/incorrect, class1/class2/class3, ...).

wasCorrect

public boolean wasCorrect()
Returns if this action was a good/correct action. This function is essentially necessary in single-step (classification) problems in order to evaluate the performance.


doReset

public boolean doReset()
Returns if the agent has reached the end of a problem. In a classification problem such as the Square Problem, this function should return true after a classification was executed.


getConditionLength

public int getConditionLength()
Returns the length of the coded situations.


getMaxPayoff

public int getMaxPayoff()
Returns the maximal payoff receivable in an environment.


isMultiStepProblem

public boolean isMultiStepProblem()
Returns true if the problem is a multi-step problem. Although the doReset() function already distinguishes multi-step and single-step problems, this functions is used in order to get a better performance analysis!


getNrActions

public int getNrActions()
Returns the number of possible actions in the environment


computeDistance

public double computeDistance(java.lang.String state,
                              java.lang.String condition)
Compute the distance between the signal and the most remote classifier from the signal. The computation uses an euclidean distance.


getProblemSurface

public double getProblemSurface()
Returns the size of the problem space