Experiments
Class Sequencer

java.lang.Object
  |
  +--Experiments.Sequencer

class Sequencer
extends java.lang.Object

The sequencer lets alternatively the environment and the agent compute their new outputs. It works as the following : 1 - The environment computes its first outputs and given reward 2a - The agent (RuleBasedSystem) gets the outputs and reward and learns what it can 2b - The agent acts (i.e? sets its own output) 2c - The environments computes its new output and reward according to the action computed by the agent 2d - Go to 2a until the agent is allowed to act 3 - Perform last step NB : 2* is a step as we defined it. The agent perceives at once perceptions and reward, and then learns and acts.

Author:
Olivier Sigaud and Pierre Gérard.

Field Summary
private  MACS.ClassifierSystem controlRules
           
private  Environments.Environment environment
           
private  boolean environmentChanged
           
private  double knowledge
           
private  short NB_SIMUS_PER_ENV
           
private  int nbFailures
           
private  java.io.FileWriter reportFile
           
private  Experiments.ReportsManager reportsManager
           
private static MACS.RuleBasedSystem system
           
 
Constructor Summary
(package private) Sequencer(Environments.Environment env, MACS.RuleBasedSystem syst)
          private double initEpsilonGreedy;
 
Method Summary
private  void changeEnvironment(short noSimu)
           
protected  void checkForKnowledgePercentage(int step)
           
protected  boolean environmentJustChanged()
           
 Environments.Environment getEnvironment()
           
protected  double getKnowledgePercentage()
           
protected  MACS.RuleBasedSystem getRuleBasedSystem()
           
 void run(int nbSimulations, int nbSteps)
           
 void run(int nbSimulations, int nbTrials, int nbSteps)
           
private  void runSimulation(int nbSteps)
           
private  void runSimulation(int nbTrials, int nbSteps)
           
protected  int runTrial(int nbSteps)
           
protected  void takeStep(int step, int globalstep)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NB_SIMUS_PER_ENV

private final short NB_SIMUS_PER_ENV
See Also:
Constant Field Values

environmentChanged

private boolean environmentChanged

nbFailures

private int nbFailures

knowledge

private double knowledge

environment

private Environments.Environment environment

system

private static MACS.RuleBasedSystem system

controlRules

private MACS.ClassifierSystem controlRules

reportFile

private java.io.FileWriter reportFile

reportsManager

private Experiments.ReportsManager reportsManager
Constructor Detail

Sequencer

Sequencer(Environments.Environment env,
          MACS.RuleBasedSystem syst)
private double initEpsilonGreedy;

Parameters:
env -
syst -
Method Detail

getRuleBasedSystem

protected MACS.RuleBasedSystem getRuleBasedSystem()
Returns:
Experiments.RuleBasedSystem

getEnvironment

public Environments.Environment getEnvironment()
Returns:
Environments.Environment

takeStep

protected void takeStep(int step,
                        int globalstep)
Parameters:
step -

runTrial

protected int runTrial(int nbSteps)
Parameters:
nbSteps -
Returns:
int

runSimulation

private void runSimulation(int nbSteps)
Parameters:
nbSteps -

runSimulation

private void runSimulation(int nbTrials,
                           int nbSteps)
Parameters:
nbTrials -
nbSteps -

changeEnvironment

private void changeEnvironment(short noSimu)
Parameters:
noSimu -

environmentJustChanged

protected boolean environmentJustChanged()
Returns:
boolean

run

public void run(int nbSimulations,
                int nbTrials,
                int nbSteps)
Parameters:
nbSimulations -
nbTrials -
nbSteps -

run

public void run(int nbSimulations,
                int nbSteps)
Parameters:
nbSimulations -
nbSteps -

getKnowledgePercentage

protected double getKnowledgePercentage()
Returns:
double

checkForKnowledgePercentage

protected void checkForKnowledgePercentage(int step)
Parameters:
step -