Examples of EnvironmentEA


Examples of eas.simulation.spatial.sim2D.marbSimulation.EnvironmentEA

    @Override
    public void runDuringSimulation(
            final EnvironmentEA env,
            final Wink simZyk,
            final ParCollection params) {
        EnvironmentEA umg = env;

        long zwischenSp = (Long) params
                .getParValue(XMLAufnahmePlugin.ZWISCHENSP_PAR);
        long schnappint = (Long) params.getParValue("xmlschnappint");

        // Aktualisierung der Parameter.
        this.zwSp = (Long) params.getParValue(XMLAufnahmePlugin.ZWISCHENSP_PAR);
        this.datName = (String) params
                .getParValue(XMLAufnahmePlugin.AUFN_DAT_PAR);
        this.xmlvp = (Boolean) params.getParValue("xmlvp?");
        this.xmlvg = (Boolean) params.getParValue("xmlvg?");
        this.xmltp = (Boolean) params.getParValue("xmltp?");
        this.xmltg = (Boolean) params.getParValue("xmltg?");           
       
        if (simZyk.isTick() && simZyk.getLastTick() % schnappint == 0) {
            this.aufnahme.addPopSn(new PopSnapshot(
                    this.roblistToRobsnlist(umg.getRobAgents()),
                    umg.getGegVerschieb(),
                    simZyk.getLastTick(),
                    umg.getTatdynVersch(),
                    umg.getTatdynDrehWinkel(),
                    umg.getTatdynDrehMittPkt(),
                    umg.getTatdynHorFaktor(),
                    umg.getTatdynVertFaktor()));
        }
       
        if (simZyk.isTick() && simZyk.getLastTick() != 0
                && simZyk.getLastTick() % zwischenSp == 0) {
            this.aufnahme.speichernXML(params);
View Full Code Here

Examples of eas.simulation.spatial.sim2D.marbSimulation.EnvironmentEA

        }
    }

    @Override
    public void runBeforeSimulation(EnvironmentEA env, ParCollection params) {
        EnvironmentEA umg = env;
        int anzAgenten;
        EAPlugin ea = (EAPlugin) umg.getPluginObject(new EAPlugin().id());
        anzAgenten = ea.anzRob(params);
       
        this.aufnahme = new XMLAufnSpeichern(
                params,
                anzAgenten,
View Full Code Here

Examples of eas.simulation.spatial.sim2D.marbSimulation.EnvironmentEA

    @Override
    public void runDuringSimulation(
            final EnvironmentEA env,
            final Wink simZyk,
            final ParCollection params) {
        EnvironmentEA umg = env;

        ArrayList<RobEA> akteure = umg.getRobAgents();
        ArrayList<RobCode> kindAkteure;

        if (this.isRekAktiv() && simZyk.isTick() && simZyk.getLastTick() >= 1
            && simZyk.getLastTick() % params.getParValueLong(
                    EvolutionPluginCompletelyEvolvable.REK_ZYK_ATTR) == 0) {
            kindAkteure = this.rekombination.rekombiniere(akteure);
            umg.uebernimmPop(kindAkteure);
            StaticMethods.log(
                    StaticMethods.LOG_DEBUG,
                    "(Zyklus " + simZyk + ") Rekombination "
                    + this.rekombination.id()
                    + " durchgeführt.",
View Full Code Here

Examples of eas.simulation.spatial.sim2D.marbSimulation.EnvironmentEA

    @Override
    public void runDuringSimulation(
            final EnvironmentEA env,
            final Wink simZyk,
            final ParCollection params) {
        EnvironmentEA umg = env;

        // Umschalten Evolution ==> Simulation?
        if (simZyk.getLastTick() <= params.getParValueDouble("TimeToTermination") - 25000) {
            umg.dreheWand(
                    47,
                    umg.getDynDrehWinkel()[47] * 180 / Math.PI + 0.75);
            umg.dreheWand(
                    221,
                    umg.getDynDrehWinkel()[221] * 180 / Math.PI - 0.75);
        } else {
            this.nachUmschalten(umg, simZyk, params);
        }
    }
View Full Code Here

Examples of eas.simulation.spatial.sim2D.marbSimulation.EnvironmentEA

    @Override
    public void runDuringSimulation(
            final EnvironmentEA env,
            final Wink simZyk,
            final ParCollection params) {
        EnvironmentEA umg = env;
       
        if (this.waende == null) {
            this.waende = new LinkedList<Integer>();
            this.drehen = new LinkedList<Boolean>();
            this.versch = new LinkedList<Boolean>();
            this.verzerr = new LinkedList<Boolean>();
            this.winkel = new LinkedList<Double>();
            this.xRicht = new LinkedList<Double>();
            this.yRicht = new LinkedList<Double>();
           
            for (int i = 0; i < umg.getDynWaende().length; i++) {
                if (umg.getDynWaende()[i] != null) {
                    this.waende.add(i);
                    this.drehen.add(true);
                    this.versch.add(true);
                    this.verzerr.add(true);
                    this.winkel.add(this.random.nextDouble() * 0.25);
                    this.xRicht.add(this.random.nextDouble() * 0.25);
                    this.yRicht.add(this.random.nextDouble() * 0.25);
                }
            }
        }

        for (int i = 0; i < this.waende.size(); i++) {
            if (this.drehen.get(i)) {
                if (null != umg.dreheWand(
                        this.waende.get(i),
                        umg.getDynDrehWinkel()[this.waende.get(i)]
                                               * 180 / Math.PI
                                               + this.winkel.get(i))) {
                    this.drehen.set(i, !this.drehen.get(i));
                    this.winkel.set(i, this.random.nextDouble() * 0.25);
                }
            } else {
                if (null != umg.dreheWand(
                        this.waende.get(i),
                        umg.getDynDrehWinkel()[this.waende.get(i)]
                                               * 180 / Math.PI
                                               - this.winkel.get(i))) {
                    this.drehen.set(i, !this.drehen.get(i));
                    this.winkel.set(i, this.random.nextDouble() * 0.25);
                }
            }
            if (this.versch.get(i)) {
                Vector2D vSchiebg = umg.getDynVersch()[this.waende.get(i)];
                vSchiebg.translate(new Vector2D(
                        this.xRicht.get(i),
                        this.yRicht.get(i)));
               
                if (null != umg.verschWand(
                        this.waende.get(i),
                        vSchiebg)) {
                    this.versch.set(i, !this.versch.get(i));
                    this.xRicht.set(i, this.random.nextDouble() * 0.25);
                    this.yRicht.set(i, this.random.nextDouble() * 0.25);
                }
            } else {
                Vector2D vSchiebg = umg.getDynVersch()[this.waende.get(i)];
                vSchiebg.translate(new Vector2D(
                        -this.xRicht.get(i),
                        -this.yRicht.get(i)));
               
                if (null != umg.verschWand(
                        this.waende.get(i),
                        vSchiebg)) {
                    this.versch.set(i, !this.versch.get(i));
                    this.xRicht.set(i, this.random.nextDouble() * 0.25);
                    this.yRicht.set(i, this.random.nextDouble() * 0.25);
 
View Full Code Here

Examples of eas.simulation.spatial.sim2D.marbSimulation.EnvironmentEA

        return "mutateInitialAutomatonEA";
    }

    @Override
    public void runBeforeSimulation(EnvironmentEA env, ParCollection params) {
        EnvironmentEA environment = env;
        int number = params.getParValueInt("numberOfMutations");
       
        for (RobEA r : environment.getRobAgents()) {
            for (int i = 0; i < number; i++) {
                r.getMutVerh().mutiere(r);
            }
        }
    }
View Full Code Here

Examples of eas.simulation.spatial.sim2D.marbSimulation.EnvironmentEA

    @Override
    public void runDuringSimulation(
            EnvironmentEA env,
            Wink simZyk,
            ParCollection params) {
        EnvironmentEA environment = env;
        int count = 0;
       
        for (RobEA r : environment.getRobAgents()) {
            if (fit.fitness(r) > 0) {
                count++;
            }
        }
       
        this.stats.add("" + count + ";" + environment.getRobAgents().size());
    }
View Full Code Here

Examples of eas.simulation.spatial.sim2D.marbSimulation.EnvironmentEA

    @Override
    public void runDuringSimulation(
            final EnvironmentEA env,
            final Wink simZyk,
            final ParCollection params) {
        EnvironmentEA umg = env;

       
        // Umschalten Evolution ==> Simulation?
        if (simZyk.getLastTick() <= params.getParValueDouble("TimeToTermination") - 0) {
            double geschwAussen = 0.23;
View Full Code Here

Examples of eas.simulation.spatial.sim2D.marbSimulation.EnvironmentEA

    @Override
    public void runBeforeSimulation(
            final EnvironmentEA env,
            final ParCollection params) {
        EnvironmentEA umg = env;

        int minLen = (Integer) params.getParValue("mingenomlaenge");
        int maxLen = (Integer) params.getParValue("maxgenomlaenge");

        this.rand = new Random(params.getSeed());
View Full Code Here

Examples of eas.simulation.spatial.sim2D.marbSimulation.EnvironmentEA

        EnvironmentEA[] list = new EnvironmentEA[i];
        Random rand = new Random(params.getSeed());
       
        for (int j = 0; j < i; j++) {
            rand = new Random(rand.nextLong());
            list[j] = new EnvironmentEA(
                    rand,
                    j,
                    null,
                    params,
                    params.getPlugins(),
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.