public class MSEnvironment extends java.lang.Object implements Environment
It is the base class for all the multiple step problems.
Constructor and Description |
---|
MSEnvironment()
It is the constructor of the class.
|
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 de
classifier given as a parameter.
|
double[] |
getCurrentState()
The function returns the current state.
|
int |
getEnvironmentClass()
Return 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 to the
environment.
|
double[] |
newState()
Create a new state of the problem.
|
boolean |
wasCorrect()
Determines if the classification was good
|
public boolean wasCorrect()
Determines if the classification was good
wasCorrect
in interface Environment
public double makeAction(int action)
This function returns the reward given when applying the action to the environment.
makeAction
in interface Environment
action
- is the action chosen to do.
public double[] getCurrentState()
The function returns the current state.
getCurrentState
in interface Environment
public double[] newState()
Create a new state of the problem. XCS has to decide the action to do.
newState
in interface Environment
public double getMaxPayoff()
Returns the environment maximum payoff
getMaxPayoff
in interface Environment
public double getMinPayoff()
Returns the environment minimum payoff
getMinPayoff
in interface Environment
public boolean isPerformed()
Returns if the class has been performed. It is used in multiple step problems.
isPerformed
in interface Environment
public int getEnvironmentClass()
Return the class of the environmental state. It is used by the UCS (supervised learning).
getEnvironmentClass
in interface Environment
public void beginSequentialExamples()
It initializes the first example. It is used in the file environment to get the examples sequentially.
beginSequentialExamples
in interface Environment
public double[] getSequentialState()
It returns the new Example of a single step file environment.
getSequentialState
in interface Environment
public int getNumberOfExamples()
It returns the number of examples of the database. It's only used in the file environments.
getNumberOfExamples
in interface Environment
public void deleteMatchedExamples(Classifier cl)
It deletes the examples of the database that match with de classifier given as a parameter. It's only used in the file environment.
deleteMatchedExamples
in interface Environment
cl
- classifier given.