Package eas.simulation.spatial.sim2D.marbSimulation.translator

Examples of eas.simulation.spatial.sim2D.marbSimulation.translator.Translator


            this.besteVerhAut[i] = null;
            this.besteStdVerh[i] = null;
           
            if (this.translatoren[i] == null) {
                if (this.getPars().getParValueBoolean("UseTranslatorWITHCompletingTransitions")) {
                    this.translatoren[i] = new Translator(
                            eas.simulation.spatial.sim2D.marbSimulation.translator.ConstantsTranslator.STD_TRANS_STR,
                            new ScriptInterpreter(
                                    this.getPars(),
                                    ScriptInterpreter.MODUS_VERHALTEN),
                                    this.getPars());
                } else {
                    this.translatoren[i] = new Translator(
                            eas.simulation.spatial.sim2D.marbSimulation.translator.versionOhneErgKante.ConstantsTranslatorWOC.STD_TRANS_STR,
                            new ScriptInterpreter(
                                    this.getPars(),
                                    ScriptInterpreter.MODUS_VERHALTEN),
                                    this.getPars());
View Full Code Here


             * übersetzer angegeben werden, weil die Methode erzTransSeq(...)
             * standardmäßig einen Verhaltensübersetzer benutzt.
             */
            if (trans2[i] == null) {
                if (this.getPars().getParValueBoolean("UseTranslatorWITHCompletingTransitions")) {
                    trans2[i] = new Translator(
                            eas.simulation.spatial.sim2D.marbSimulation.translator.ConstantsTranslator.STD_TRANS_STR,
                            new ScriptInterpreter(
                                    this.getPars(),
                                    StaticMethods.MODUS_TRANSLATOR),
                                    this.getPars());
                } else {
                    trans2[i] = new Translator(
                            eas.simulation.spatial.sim2D.marbSimulation.translator.versionOhneErgKante.ConstantsTranslatorWOC.STD_TRANS_STR,
                            new ScriptInterpreter(
                                    this.getPars(),
                                    StaticMethods.MODUS_TRANSLATOR),
                            this.getPars());
View Full Code Here

//        if (trans != null) {
//            altMod = trans.getModus();
//            trans.setModus(SonstMeth.MODUS_TRANSLATOR);
//        }
       
        this.translatoren[transNum] = new Translator(
                "",
                new ScriptInterpreter(
                        this.getPars(),
                        ScriptInterpreter.MODUS_VERHALTEN),
                this.getPars());
View Full Code Here

    @Override
    public boolean evaluiere(final Object aut) {
        int zahl1;
        int zahl2;
        RobEA rob;
        Translator trans;
       
        if (aut == null) {
            zahl1 = this.operand1;
            zahl2 = this.operand2;
        } else if (aut.getClass().equals(RobEA.class)) {
            rob = (RobEA) aut;
            if (this.sensor1) {
                zahl1 = (Integer) rob.sense(this.operand1 - 1);
            } else {
                zahl1 = this.operand1;
            }
   
            if (this.sensor2) {
                zahl2 = (Integer) rob.sense(this.operand2 - 1);
            } else {
                zahl2 = this.operand2;
            }
        } else if (aut.getClass().equals(Translator.class)) {
            trans = (Translator) aut;
            if (this.sensor1) {
                zahl1 = trans.getH(this.operand1);
            } else {
                zahl1 = this.operand1;
            }
   
            if (this.sensor2) {
                zahl2 = trans.getH(this.operand2);
            } else {
                zahl2 = this.operand2;
            }
        } else {
            throw new RuntimeException(
View Full Code Here

     * @param robID  Der Roboter, dessen Automaten neu übersetzt werden sollen.
     * @param level  Der Level i, ab dem übersetzt werden soll.
     */
    private void translationFuerRoboterAbLevel(final int robID, final int level, ParCollection params) {
        EndlicherAutomat ea;
        Translator trans;
       
        if (this.automaten.get(robID) == null) {
            this.automaten.put(robID, new ArrayList<EndlicherAutomat>(this.mutationsarten.size()));
        }

        // Oberste Hierarchiestufe initialisieren.
        if (this.getAutomat(robID, this.levelAnzahl - 1) == null) {
            if (params.getParValueBoolean("UseTranslatorWITHCompletingTransitions")) {
                if (this.levelAnzahl <= 2) {
                    this.setAutomat(robID, ConstantsTranslator.getStdTranslatorBE(params), this.levelAnzahl - 1);
                } else {
                    this.setAutomat(robID, ConstantsTranslator.getStdTranslatorTR(params), this.levelAnzahl - 1);
                }
            } else {
                if (this.levelAnzahl <= 2) {
                    this.setAutomat(robID, ConstantsTranslatorWOC.getStdTranslatorBE(params), this.levelAnzahl - 1);
                } else {
                    this.setAutomat(robID, ConstantsTranslatorWOC.getStdTranslatorTR(params), this.levelAnzahl - 1);
                }
            }
        }
       
        if (level > 1) {
            trans = new Translator("", this.scriptInterpreterTranslator, this.pars);
        } else {
            trans = new Translator("", this.scriptInterpreterVerhalten, this.pars);
        }

        // Konstanter Translator-Level.
        if (level >= this.levelAnzahl - 1) {
            throw new RuntimeException("Translator vom Level " + level + " ist konstant und kann nicht mutiert bzw. neu übersetzt werden.");
        } else if (level > 0) { // (Mutierbarer oder unmutierbarer) Translator-Level.
            this.setAutomat(robID, trans, level);
            trans.generateFromSequence(StaticMethods.stringAusListSeq(this.getGenom(robID, level)), (Translator) this.getAutomat(robID, level + 1), false, params);
            this.setAutomat(robID, trans, level);
           
            params.logStage1(this.id().toUpperCase() + " -- Roboter " + robID
                    + " / Level " + level + " (StdSeq übersetzt: \""
                    + this.getAutomat(robID, level).erzeugeStringSeq() + "\")");
View Full Code Here

TOP

Related Classes of eas.simulation.spatial.sim2D.marbSimulation.translator.Translator

Copyright © 2018 www.massapicom. 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.