public interface Environment
This interface is the environment interface. It has to be implemented for all the environment problems. At first, it is extended in three classes, the single step environment problems (SSEnvirontment), the single step environment problems that have to be read from a file (SSFileEnvironment), an the multiple step environment problems (MSEnvironment). To implement a new problem environment it's necessary to extend one of these three classes, defining all their functions.
Modifier and Type | Method and Description |
---|---|
void |
beginSequentialExamples()
It initializes the first example.
|
void |
deleteMatchedExamples(Classifier cl)
It deletes the examples of the database that match with the
given classifier.
|
double[] |
getCurrentState()
The function returns the current state.
|
int |
getEnvironmentClass()
Returns the class of the environmental state.
|
double |
getMaxPayoff()
Returns the environment maximum payoff
|
double |
getMinPayoff()
Returns the environment minimum payoff
|
int |
getNumberOfExamples()
It returns the number of examples of the database.
|
double[] |
getSequentialState()
It returns the new Example of a single step file environment.
|
boolean |
isPerformed()
Returns if the class has been performed.
|
double |
makeAction(int action)
This function returns the reward given when applying the action in the
environment.
|
double[] |
newState()
Creates a new state of the problem.
|
boolean |
wasCorrect()
Determines if the classification was good
|
boolean wasCorrect()
Determines if the classification was good
double makeAction(int action)
This function returns the reward given when applying the action in the environment.
action
- is the action chosen to do.double[] getCurrentState()
The function returns the current state.
double[] newState()
Creates a new state of the problem. XCS has to decide the action to do.
double getMaxPayoff()
Returns the environment maximum payoff
double getMinPayoff()
Returns the environment minimum payoff
boolean isPerformed()
Returns if the class has been performed. It is used in the multiple step problems.
int getEnvironmentClass()
Returns the class of the environmental state. It is used by UCS (supervised learning).
void beginSequentialExamples()
It initializes the first example. It is used in the file environment to get the examples sequentially.
double[] getSequentialState()
It returns the new Example of a single step file environment.
int getNumberOfExamples()
It returns the number of examples of the database. It is only used in the file environments.
void deleteMatchedExamples(Classifier cl)
It deletes the examples of the database that match with the given classifier. It is only used in the file enviornment.
cl
- classifier given.