Search in sources :

Example 1 with EvoAgent

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;
    }
}
Also used : EvoAgent(planetwar.EvoAgent)

Example 2 with EvoAgent

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);
}
Also used : SimpleRMHC(ga.SimpleRMHC) DefaultMutator(evodef.DefaultMutator) EvoAgent(planetwar.EvoAgent) EvoAlg(evodef.EvoAlg)

Example 3 with 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;
}
Also used : SimpleRMHC(ga.SimpleRMHC) EvoAgent(planetwar.EvoAgent) NTupleBanditEA(ntuple.NTupleBanditEA) EvoAlg(evodef.EvoAlg)

Aggregations

EvoAgent (planetwar.EvoAgent)3 EvoAlg (evodef.EvoAlg)2 SimpleRMHC (ga.SimpleRMHC)2 DefaultMutator (evodef.DefaultMutator)1 NTupleBanditEA (ntuple.NTupleBanditEA)1