@Override
public void run() {
int episodes = 500;
int runs = 100;
double[][] allrewards = new double[runs][episodes];
EpisodicRewardStepStatistic stat = new EpisodicRewardStepStatistic(episodes);
sim.addStatistic(stat);
for ( int r = 0; r < runs; r++ ) {
sim.init();
agent.setInterruptOptions(false);
//sim.suspend();
//agent.setInterruptOptions(true);
for ( int i = 0; i < episodes; i++ ) {
if ( i == 400 )
agent.setInterruptOptions(true);
sim.runEpisode();
sim.reset();
}
allrewards[r] = stat.getRewards();
}
System.out.println(agent.getValueFunction());
System.out.println("FINISHED");
System.out.println(qf);