Examples of PopSnapshot


Examples of eas.simulation.spatial.sim2D.marbSimulation.statistik.PopSnapshot

     * @return  Die Fitnesswerte der Roboter der Population als String.
     */
    public static String extrEinzelPopFitness(final XMLAufnSpeichern a,
                                              final int      popNum) {
        String s = "";
        PopSnapshot p = a.getPops().get(popNum);
        RobSnapshot[] robs = p.getRobSchnapp();
       
        for (int i = 0; i < robs.length; i++) {
            s = s + robs[i].getFitness();
            if (i < robs.length - 1) {
                s = s + "_";
View Full Code Here

Examples of eas.simulation.spatial.sim2D.marbSimulation.statistik.PopSnapshot

       
        // Liste der Populationsschnappsch�sse auff�llen.
        this.aufnahme = aufn;
       
        for (int i = 0; i < this.aufnahme.popNum(); i++) {
            PopSnapshot aktPop = this.aufnahme.getPop(i);
            this.addListEl(""
                           + i
                           + ". Snapshot ("
                           + aktPop.getId()
                           + ") ["
                           + aktPop.getFitSum()
                           + "]");
        }
       
       
        this.traceListe.setVisible(true);
View Full Code Here

Examples of eas.simulation.spatial.sim2D.marbSimulation.statistik.PopSnapshot

                                     dia.getResult().equals(
                                             "Zeichne mit Fitness"));
                }
            } else if (cmd.equals("Finde beste")) {
                long max = Integer.MIN_VALUE;
                PopSnapshot p;
                int i = (this.lastBest + 1)
                        % this.aufnahme.popNum();
                int last = this.lastBest;
                int anfang = this.lastBest;
               
                while (i != anfang) {
                    p = this.aufnahme.getPop(i);
                   
                    if (p.getFitSum() > max) {
                        max = p.getFitSum();
                        last = i;
                    }
                   
                    i = (i + 1) % this.aufnahme.popNum();
                }
               
                p = this.aufnahme.getPop(anfang);
                if (p.getFitSum() > max) {
                    max = p.getFitSum();
                    last = anfang;
                }
               
                this.traceListe.select(last);
                this.itemStateChanged(null);
View Full Code Here

Examples of eas.simulation.spatial.sim2D.marbSimulation.statistik.PopSnapshot

        long lang = 20;
        Vector2D norm;
        RobSnapshot rob;
        int anfang = startSnap;
        int ende = endSnap;
        PopSnapshot pop;
        Vector2D[] letzte = new Vector2D[grIndizes.length];
        byte farbe;
       
        for (int i = anfang; i <= ende; i++) {
            pop = this.aufnahme.getPop(i);
            for (int j = 0; j < grIndizes.length; j++) {
                rob = pop.getRobSchnapp()[grIndizes[j]];
               
                farbe
                    = eas.simulation.ConstantsSimulation.FARBEN_BENUTZER[
                      grIndizes[j]
                      % eas.simulation.ConstantsSimulation.FARBEN_BENUTZER.length];
View Full Code Here

Examples of eas.simulation.spatial.sim2D.marbSimulation.statistik.PopSnapshot

     * lädt einen einzelnen Snapshot in die Graphenliste.
     *
     * @param nummer  Die Nummer des zu ladenden Snapshots.
     */
    private void ladeSnap(final int nummer) {
        PopSnapshot pop
            = this.aufnahme.getPop(nummer);
        RobSnapshot[] robs = pop.getRobSchnapp();
        Vis neuVis;
        Translator[] trans = new Translator[robs[0].getTStdCodes().length];
       
        this.popNum = pop.getId();
        this.graphen.clear();
       
        for (int i = 0; i < robs.length; i++) {
            for (int j = 0; j < trans.length; j++) {
                trans[j] = new Translator(
                        robs[i].getTStdCodes()[j],
                        new ScriptInterpreter(
                                this.aktParams,
                                StaticMethods.MODUS_TRANSLATOR),
                        this.aktParams);
            }
           
            neuVis = new Vis(
                    this.nameRob(pop, robs[i]),
                    robs[i].getVStdCodes(),
                    robs[i].getConds(),
                    robs[i].getId(),
                    this.aktParams,
                    trans,
                    null);
            this.graphen.add(neuVis);
           
            int zustand = robs[i].getZustand();
            if (zustand < 0) {
                // Markiere Startzustand, falls zustand = -1.
                if (neuVis.getRob().vAuts()[0].holeStartzustand() != null) {
                    zustand = neuVis.getRob().vAuts()[0]
                                     .holeStartzustand().holeName();
                }
            }
            neuVis.selKnoten(
                  neuVis.getRob().vAuts()[0].holeKnoten(zustand),
                  0);

            neuVis.setBounds(this.getWidth(),
                             0,
                             800,
                             700);
        }
       
    /*
     * Erzeugt eine Simulationsumgebung, in der die Aufnahme angezeigt wird:
     */
        SimulationsZeit simZ;
        int size = robs.length;
       
        String[][] vAutStd  = new String[size][];
        String[][] tAutStd  = new String[size][];
        String[][] vAut  = new String[size][];
        String[][] tAut  = new String[size][];
        int[] identitaeten  = new int[size];
        Vector2D[] positionen = new Vector2D[size];
        double[] winkel     = new double[size];
        Vector2D[] versch;
        Vector2D[] neuVersch;
        int[][] fitness = new int[size][];
        Condition[][] conds = new Condition[size][];
       
        Vis[] visGr = new Vis[this.graphen.size()];
       
        int i = 0;
        Iterator<Vis> it = this.graphen.iterator();
        while (it.hasNext()) {
            visGr[i] = it.next();
           
            for (int j = 0; j < robs.length; j++) {
                if (visGr[i].getRob().id() == robs[j].getId()) {
                    vAutStd[i] = robs[j].getVStdCodes();
                    vAut[i] = robs[j].getVCodes();
                    tAutStd[i] = robs[j].getTStdCodes();
                    tAut[i] = robs[j].getTCodes();
                    fitness[i] = robs[j].getFitness();
                    identitaeten[i] = robs[j].getId();
                    positionen[i] = robs[j].getPosition();
                    winkel[i] = robs[j].getWinkel();
                    conds[i] = new Condition[robs[j].getConds().length];
                    for (int k = 0; k < robs[j].getConds().length; k++) {
                        conds[i][k] = robs[j].getConds()[k];
                    }
                    break;
                }
            }
            i++;
        }
           
        // Erzeugt eine neue Simulation, falls noch keine erzeugt wurde.
        if (this.guiSim == null) {
            Plugin<?>[] plugins = new Plugin[this.aktParams.getPlugins().size()];
           
            for (int z = 0; z < this.aktParams.getPlugins().size(); z++) {
                try {
                    plugins[z] = PluginFactory.getKonstPlug(
                            this.aktParams.getPlugins().get(z).id(),
                            this.aktParams);
                } catch (Exception e) {
                    plugins[z] = PluginFactory.getKonstPlug(new AllroundTimeEstimatorPlugin().id(), this.aktParams);
                }
            }

            this.guiSim = new GuiSimulation(
                    "Snapshot"
                    + " ["
                    + this.graphen.size()
                    + " robots]",
                    null,
                    this,
                    this.parsAufn,
                    this.aufnahme);
   
            simZ = new SimulationsZeit(
                    this.parsAufn,
                    this.guiSim,
                    visGr,
                    vAutStd,
                    conds,
                    identitaeten,
                    this.aufnahme);
           
            this.guiSim.setVisible(true);
            this.guiSim.registriereTakt(simZ);
        }

        // Dynamische Wände zeichnen.
        this.guiSim.getUmgeb().leereFeld();
        for (int j = 0; j < pop.getTatdynDrehMittPkt().length; j++) {
            if (pop.getTatdynDrehMittPkt()[j] != null) {
                this.guiSim.getUmgeb().setDynDrehMittPkt(j,
                        pop.getTatdynDrehMittPkt()[j]);
                this.guiSim.getUmgeb().dreheWand(j,
                        pop.getTatdynDrehWinkel()[j] * 180 / Math.PI);
                this.guiSim.getUmgeb().verschWand(j, pop.getTatdynVersch()[j]);
                this.guiSim.getUmgeb().verzerrWand(j,
                        pop.getTatdynSkalFaktor()[j].x,
                        pop.getTatdynSkalFaktor()[j].y);
            }
        }
        this.guiSim.getUmgeb().alleFelderNeu();
       
        // Gegenst�nde setzen.
        versch = pop.getVerschiebungen();
        if (versch != null) {
            if (this.aktVersch == null) {
                this.aktVersch = new Vector2D[versch.length];
                for (int k = 0; k < this.aktVersch.length; k++) {
                    this.aktVersch[k] = new Vector2D(0, 0);
View Full Code Here

Examples of eas.simulation.spatial.sim2D.marbSimulation.statistik.PopSnapshot

        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(),
View Full Code Here

Examples of eas.simulation.spatial.sim2D.marbSimulation.statistik.PopSnapshot

                    .getDynSkalierung().getX();
            tatVert[id] = xmlpop.getDynWaende().getWandArray()[i]
                    .getDynSkalierung().getY();
        }
       
        PopSnapshot pop = new PopSnapshot(
                roboter,
                ggstVerschbgn,
                ident,
                tatVersch,
                tatWink,
View Full Code Here

Examples of eas.simulation.spatial.sim2D.marbSimulation.statistik.PopSnapshot

     *
     * @return  Die extrahierten Fitnesswerte.
     */
    public static String extrahiereFit(
            final XMLAufnLesen aufn) {
        PopSnapshot pop;
        long popNummer;
        String sGes = "";
       
        // Erste Zeile.
        sGes = sGes + "SnapshotID";
       
        for (int i = 0;
             i < aufn.getPop(0).getRobSchnapp().length;
             i++) {
            sGes = sGes + ";Fitness (Roboter " + i + ")";
        }
        sGes = sGes + "\n";
       
        // Rest.
        for (int i = 0; i < aufn.popNum(); i++) {
            String s = "";
           
            pop = aufn.getPop(i);
            popNummer = pop.getId();
           
            s = s + popNummer;
               
            for (int j = 0; j < pop.getRobSchnapp().length; j++) {
                s = s
                    + ";"
                    + pop.getRobSchnapp()[j].getFitness()[0];
            }
           
            sGes = sGes + s + "\n";
        }

View Full Code Here

Examples of fmg.fmg8.statistik.PopSnapshot

            } else {
                automatSp = false;
            }
                this.schnappAuts++;
                this.schnappZyklen = 0;
                this.aufnahme.addPopSn(new PopSnapshot(
                                       this.umgebung.getAkteure(),
                                       this.umgebung.getGegVerschieb(),
                                       this.simZyklen,
                                       automatSp));
        }
View Full Code Here

Examples of fmg.fmg8.statistik.PopSnapshot

                } else {
                    automatSp = false;
                }
   
                this.schnappAuts++;
                this.aufnahme.addPopSn(new PopSnapshot(
                        this.umgebung.getAkteure(),
                        this.umgebung.getGegVerschieb(),
                        this.simZyklen,
                        automatSp,
                        this.umgebung.getAktDynPixel()));
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.