Package aufnahme.fmg.edu.kit.aifb.PopulationTyp

Examples of aufnahme.fmg.edu.kit.aifb.PopulationTyp.Roboter


                }
            }
           
            // Roboter:
            for (RobSnapshot r : p.getRobSchnapp()) {
                Roboter neuRob;
                aktPop.addNewRoboter();
                neuRob = aktPop
                        .getRoboterArray(aktPop.getRoboterArray().length - 1);
                // ID:
                neuRob.setID(r.getId());
                neuRob = aktPop
                        .getRoboterArray(aktPop.getRoboterArray().length - 1);
                // Position:
                neuRob.addNewPos();
                neuRob.getPos().setWinkel(r.getWinkel());
                neuRob.getPos().setX(r.getPosition().x);
                neuRob.getPos().setY(r.getPosition().y);
                // Dehnung:
                neuRob.addNewDehn();
                neuRob.getDehn().setX((int) r.getBreite());
                neuRob.getDehn().setY((int) r.getLaenge());
                // Fitness:
                neuRob.setFit(r.getFitness()[0]);
                // Zustand:
                // Zu beachten: zustand = -1 ==> zustand ist Startzustand.
                neuRob.setZust(r.getZustand());
                // Sensoren:
                sens = "";
                for (   int i = 0;
                        i < eas.simulation.ConstantsSimulation.SENS_RICHT.length;
                        i++) {
                    sens += r.getSensoren()[i] + ";";
                }
                neuRob.setSens(sens);

                XMLAufnahmePlugin aufnahme = (XMLAufnahmePlugin) this.umgebung
                        .getPluginObject(new XMLAufnahmePlugin().id());
               
                if (aufnahme == null) {
                    throw new RuntimeException(
                        "Etwas läuft falsch in XMLAufnSpeichern: "
                        + "Aufnahmeplugin nicht aktiviert.");
                }
               
                // Verhaltensgen:
                if (aufnahme.isXmlvg()) {
                    if (!r.getVCodes()[0].equals("")
                            && this.aktVG[r.getId()].equals(r.getVCodes()[0])) {
                        neuRob.setVG("!" + this.aktVGnum[r.getId()]);
                    } else {
                        this.aktVG[r.getId()] = r.getVCodes()[0];
                        this.aktVGnum[r.getId()] = popID;
                        neuRob.setVG(r.getVCodes()[0].replace(",", ""));
                    }
                } else {
                    neuRob.setVG("");
                }
                // Translatorgen:
                if (aufnahme.isXmltg()) {
                    if (!r.getTCodes()[0].equals("")
                            && this.aktTG[r.getId()].equals(r.getTCodes()[0])) {
                        neuRob.setTG("!" + this.aktTGnum[r.getId()]);
                    } else {
                        this.aktTG[r.getId()] = r.getTCodes()[0];
                        this.aktTGnum[r.getId()] = popID;
                        neuRob.setTG(r.getTCodes()[0].replace(",", ""));
                    }
                } else {
                    neuRob.setTG("");
                }
                // Verhaltensphenotyp:
                if (aufnahme.isXmlvp()) {
                    if (!r.getVStdCodes().equals("")
                            && this.aktVP[r.getId()]
                                    .equals(r.getVStdCodes()[0])) {
                        neuRob.setVP("!" + this.aktVPnum[r.getId()]);
                    } else {
                        this.aktVP[r.getId()] = r.getVStdCodes()[0];
                        this.aktVPnum[r.getId()] = popID;
                        neuRob.setVP(r.getVStdCodes()[0].replace(",", ""));
                    }
                } else {
                    neuRob.setVP("");
                }
                // Verhaltensgen:
                if (aufnahme.isXmlvg()) {
                    if (!r.getTStdCodes().equals("")
                            && this.aktTP[r.getId()]
                                    .equals(r.getTStdCodes()[0])) {
                        neuRob.setTP("!" + this.aktTPnum[r.getId()]);
                    } else {
                        this.aktTP[r.getId()] = r.getTStdCodes()[0];
                        this.aktTPnum[r.getId()] = popID;
                        neuRob.setTP(r.getTStdCodes()[0].replace(",", ""));
                    }
                } else {
                    neuRob.setTP("");
                }
            }
        }
        this.populationen.clear();
    }
View Full Code Here

TOP

Related Classes of aufnahme.fmg.edu.kit.aifb.PopulationTyp.Roboter

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.