Package eas.startSetup.marbBuilder.graph

Examples of eas.startSetup.marbBuilder.graph.Knoten


     * @param ea  Der zu mutierende Automat.
     * @return  Ob ein Zustand gelöscht wurde.
     */
    public final boolean ageSynMutZustandRem2(final EndlicherAutomat ea) {
        ArrayList<Integer> knListe = ea.getKnList();
        Knoten zufallsKnoten1;
        int zufallsIndex;

        while (knListe.size() > 0) {
            zufallsIndex = this.rand.nextInt(knListe.size());
            zufallsKnoten1 = ea.holeKnoten(knListe.get(zufallsIndex));
            if (zufallsKnoten1.getInfo().getAktion()
                    == Konstanten.IDLE_BEFEHL
                    && zufallsKnoten1.holeNachfolger().size() == 0
                    && !ea.istStartZ(zufallsKnoten1)) {
                Integer index = knListe.get(zufallsIndex);
                ea.entferneKnoten(index);
                return true;
            }         
View Full Code Here


     * @param ea  Der zu mutierende Automat.
     * @return  Ob ein Zustand mutiert wurde.
     */
    public final boolean ageSemMutZustand(final EndlicherAutomat ea) {
        ArrayList<Integer> knListe = ea.getKnList();
        Knoten zufallsKnoten1;
        int veraenderung;
        int neuParam;
        int altParam;
        int neuBefehl;
        int zufallsIndex;

        if (knListe.size() == 0) {
            return false;
        } else {
            zufallsIndex = this.rand.nextInt(knListe.size());
            zufallsKnoten1 = ea.holeKnoten(knListe.get(zufallsIndex));
            if (pars.getParValueBoolean("ageDecrement")) {
                zufallsKnoten1.getInfo().setAlter(Math.max(1, zufallsKnoten1.getInfo().getAlter() - 1));
            }
            else {
                zufallsKnoten1.getInfo().setAlter(1);
            }
            veraenderung = this.rand.nextInt(2 * this.k) - this.k;
            altParam = (zufallsKnoten1.getInfo()).getParam();
            if (veraenderung + altParam > 0) {
                neuParam = altParam + veraenderung;
                neuBefehl = (zufallsKnoten1.getInfo()).getAktion();
            } else if (veraenderung + altParam < 0) {
                neuParam = (veraenderung + altParam) * -1;
                neuBefehl = StaticMethods.glVertZwischen(
                        StaticMethods.minBef(this.modus),
                        StaticMethods.maxBef(this.modus, this.pars),
                        this.rand);

            } else { // veraenderung + altparam == 0
                neuParam = 1;
                neuBefehl = (zufallsKnoten1.getInfo()).getAktion();
            }

            if (checkMutation(zufallsKnoten1.getInfo().getAlter())) {
                (zufallsKnoten1.getInfo()).setAkt(neuBefehl);
                (zufallsKnoten1.getInfo()).setPar(neuParam);
                return true;
            }
            else {
                return false;
            }
View Full Code Here

        String[] gespGr = verz.list(new FileNamePostfixFilter(endung));
        ArrayList<Integer> a;
        Iterator<Integer> it2;
        int anzahl = 0;
        RobEA aktRob;
        Knoten l;
        int gesAnz = 0;
        String[] verzPar = {"verz", verzeichnis};
        ParCollection params = GlobalVariables.getPrematureParameters();
        params.overwriteParameterList(verzPar);
       
       
        if (positiv) {
            System.out.println("Positive Automaten:");
        } else {
            System.out.println("Negative Automaten:");
        }
       
        for (int i = 0; i < gespGr.length; i++) {
            System.gc();
            if ((!positiv
                && (gespGr[i].contains("-")
                    || gespGr[i].contains("_0")))
                || positiv
                && !(gespGr[i].contains("-")
                     || gespGr[i].contains("_0"))) {
               
                gesAnz++;
               
                aktRob = new VisMantel(
                        gespGr[i].substring(0, gespGr[i].length() - 4),
                        null,
                        null,
                        null,
                        null,
                        -1,
                        params,
                        false,
                        null).getRob();

                a = aktRob.vAuts()[0].getKnList();
               
                it2 = a.iterator();
                while (it2.hasNext()) {
                    l = aktRob.vAuts()[0].holeKnoten(it2.next());
                    if (l.getInfo().getAktion()
                            == bef) {
                        if (!erreichbar
                            || aktRob.vAuts()[0].erreichbar(l.holeName())) {
                                anzahl++;
                                System.out.println(anzahl
                                                   + "/"
                                                   + gesAnz
                                                   + " "
View Full Code Here

     * @param ea  Der zu mutierende Automat.
     * @return  Ob ein Zustand gelöscht wurde.
     */
    public final boolean mutationZustandRem1(final EndlicherAutomat ea) {
        ArrayList<Integer> knListe = ea.getKnList();
        Knoten zufallsKnoten1;
        int zufallsIndex;

        while (knListe.size() > 0) {
            zufallsIndex = this.rand.nextInt(knListe.size());
            zufallsKnoten1 = ea.holeKnoten(knListe.get(zufallsIndex));
            if (!ea.istStartZ(zufallsKnoten1)
                && zufallsKnoten1.holeVorgaenger().size() == 0) {
               
                ea.entferneKnoten(knListe.get(zufallsIndex));
                return true;
            }
            knListe.remove(zufallsIndex);
View Full Code Here

     * @param ea  Der zu mutierende Automat.
     * @return  Ob ein Zustand gelöscht wurde.
     */
    public final boolean mutationZustandRem2(final EndlicherAutomat ea) {
        ArrayList<Integer> knListe = ea.getKnList();
        Knoten zufallsKnoten1;
        int zufallsIndex;

        while (knListe.size() > 0) {
            zufallsIndex = this.rand.nextInt(knListe.size());
            zufallsKnoten1 = ea.holeKnoten(knListe.get(zufallsIndex));
            if (zufallsKnoten1.getInfo().getAktion()
                    == Konstanten.IDLE_BEFEHL
                && zufallsKnoten1.holeNachfolger().size() == 0
                && !ea.istStartZ(zufallsKnoten1)) {
               
                ea.entferneKnoten(knListe.get(zufallsIndex));
                return true;
            }
View Full Code Here

     * @param ea  Der zu mutierende Automat.
     * @return  Ob ein Zustand mutiert wurde.
     */
    public final boolean mutationZustand(final EndlicherAutomat ea) {
        ArrayList<Integer> knListe = ea.getKnList();
        Knoten zufallsKnoten1;
        int veraenderung;
        int neuParam;
        int altParam;
        int neuBefehl;
        int zufallsIndex;
       
        if (knListe.size() == 0) {
            return false;
        } else {
            zufallsIndex = this.rand.nextInt(knListe.size());
            zufallsKnoten1 = ea.holeKnoten(knListe.get(zufallsIndex));
            veraenderung = this.rand.nextInt(2 * this.k) - this.k;
            altParam = (zufallsKnoten1.getInfo()).getParam();
            if (veraenderung + altParam > 0) {
                neuParam = altParam + veraenderung;
                neuBefehl = (zufallsKnoten1.getInfo()).getAktion();
            } else if (veraenderung + altParam < 0) {
                neuParam = (veraenderung + altParam) * -1;
                neuBefehl = StaticMethods.glVertZwischen(
                        StaticMethods.minBef(this.modus),
                        StaticMethods.maxBef(this.modus, this.pars),
                        this.rand);
               
            } else { // veraenderung + altparam == 0
                neuParam = 1;
                neuBefehl = (zufallsKnoten1.getInfo()).getAktion();
            }
               
           
            (zufallsKnoten1.getInfo()).setAkt(neuBefehl);
            (zufallsKnoten1.getInfo()).setPar(neuParam);
           
            return true;
        }
    }
View Full Code Here

TOP

Related Classes of eas.startSetup.marbBuilder.graph.Knoten

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.