use of planetwar.EvoAgent in project SimpleAsteroids by ljialin.
the class Game method setPlayouts.
public void setPlayouts() {
if (showPlayouts && controller instanceof EvoAgentAdapter) {
EvoAgentAdapter adapter = (EvoAgentAdapter) controller;
EvoAgent evoAgent = (EvoAgent) adapter.agent;
view.playouts = evoAgent.evoAlg.getLogger().solutions;
}
}
use of planetwar.EvoAgent in project SimpleAsteroids by ljialin.
the class Game method getEvoAgent.
Controller getEvoAgent() {
//
// todo Add in the code t make this
int nResamples = 1;
DefaultMutator mutator = new DefaultMutator(null);
// setting to true may give best performance
mutator.totalRandomChaosMutation = true;
SimpleRMHC simpleRMHC = new SimpleRMHC();
simpleRMHC.setSamplingRate(nResamples);
simpleRMHC.setMutator(mutator);
EvoAlg evoAlg = simpleRMHC;
// evoAlg = new SlidingMeanEDA();
int nEvals = 20;
int seqLength = 100;
EvoAgent evoAgent = new EvoAgent().setEvoAlg(evoAlg, nEvals).setSequenceLength(seqLength);
evoAgent.setUseShiftBuffer(true);
evoAgent.setVisual();
return new EvoAgentAdapter().setAgent(evoAgent);
}
use of planetwar.EvoAgent in project SimpleAsteroids by ljialin.
the class GameRunner method getEvoAgent.
public static EvoAgent getEvoAgent() {
int nResamples = 1;
EvoAlg evoAlg = new SimpleRMHC(nResamples);
// evoAlg = new SlidingMeanEDA();
evoAlg = new NTupleBanditEA();
int nEvals = 20;
int seqLength = 100;
EvoAgent evoAgent = new EvoAgent().setEvoAlg(evoAlg, nEvals).setSequenceLength(seqLength);
evoAgent.setUseShiftBuffer(true);
return evoAgent;
}
Aggregations