change RL-Controller initialization process and action space iterable

- no fake builder pattern anymore, moved needed fields into constructor
- add serializeUID
- action space extends iterable interface to simplify looping over all actions (and not returning the actual list)
This commit is contained in:
2019-12-24 19:38:35 +01:00
parent 5a4e380faf
commit b2c3854b3a
9 changed files with 78 additions and 66 deletions
+10 -8
View File
@@ -10,14 +10,16 @@ public class JumpingDino {
public static void main(String[] args) {
RNG.setSeed(55);
RLController<DinoAction> rl = new RLController<DinoAction>()
.setEnvironment(new DinoWorld())
.setAllowedActions(DinoAction.values())
.setMethod(Method.MC_ONPOLICY_EGREEDY)
.setDiscountFactor(1f)
.setEpsilon(0.15f)
.setDelay(200)
.setEpisodes(100000);
RLController<DinoAction> rl = new RLController<>(
new DinoWorld(),
Method.MC_ONPOLICY_EGREEDY,
DinoAction.values());
rl.setDelay(200);
rl.setDiscountFactor(1f);
rl.setEpsilon(0.15f);
rl.setEpisodes(5000);
rl.start();
}
}