Examples of DomPhysSparseNet


Examples of eas.users.students.dominikColling.rocket.brain.DomPhysSparseNet

     
      System.out.println("TIME: "+ simZyk.getCurrentTime());

      netPop2 = env.getNetPop();
     
      DomPhysSparseNet hirn = netPop2.getBestesNetz();
      int index = netPop2.getIndexBestesNetz();
      double groesseBestes = hirn.getDivZahlen().get(0);
     
      netPop.add(netPop2.getNet(index), netPop2.getFitness(index), netPop2.getMinAbstand(index), netPop2.getMaxAbstand(index), netPop2.getGeburt(index));
     
     
      for (int i = 0; i < netPop2.getSize(); i++) {
View Full Code Here

Examples of eas.users.students.dominikColling.rocket.brain.DomPhysSparseNet

      //System.out.println(id);
      double fitness2 = Double.valueOf(fitness);
      double id2 = Double.valueOf(id);
     
      DomPhysSparseNet net = new DomPhysSparseNet( (int)id2 , 0, liste3[3], encoding);
      //System.out.println(net.generateGenome(new DominikEncoding1())+ " Fitness: " + fitness2 + " ID: " + id2);
      //System.out.println(net.generateGenome(new DominikEncoding1())+ " Fitness: " + fitness2 + " ID: " + id2);
      double minAbstand = Double.MAX_VALUE;
      double maxAbstand = Double.MIN_VALUE;
      //System.out.println(netPop.getSize());
View Full Code Here

Examples of eas.users.students.dominikColling.rocket.brain.DomPhysSparseNet

    "Maximale Drehung: " + drehung + ", " +
    "Gravitationskonstante: "+ gravitationsKonstante + ", " +
    "Seed: " + rand + " ZXY\n";

    for (int i = 0; i < array.length - 1; i++) {
      DomPhysSparseNet net = netPop.getNet(i);
      int fitness = netPop.getFitness(i);
      double minAbstand = netPop.getMinAbstand(i);
      double maxAbstand = netPop.getMaxAbstand(i);
      int geburt = netPop.getGeburt(i);
      int generation = net.getGeneration();
      int id = net.getId();
      int vaterId = net.getVaterId();

      array [i + 1] ="Fitness: " + fitness + "/ " +
      "ID: " + id + "/ " +
      "Geburt: " + geburt + ", " +
      "VaterID: " + vaterId + ", " +
      "Generation: " + generation + ", " +
      "Minimaler Abstand: " + minAbstand + ", " +
      "Maximaler Abstand: " + maxAbstand + "/\n" +
      net.generateGenome(encoding);

    }
    return array;
  }
View Full Code Here

Examples of eas.users.students.dominikColling.rocket.brain.DomPhysSparseNet

    "Maximale Drehung: " + drehung + ", " +
    "Gravitationskonstante: "+ gravitationsKonstante + ", " +
    "Seed: " + rand + " ZXY\n";

    for (int i = 0; i < array.length - 1; i++) {
      DomPhysSparseNet net = netPop2.getNet(i);
      int fitness = netPop2.getFitness(i);
      double minAbstand = netPop2.getMinAbstand(i);
      double maxAbstand = netPop2.getMaxAbstand(i);
      int geburt = netPop2.getGeburt(i);
      int generation = net.getGeneration();
      int id = net.getId();
      int vaterId = net.getVaterId();

      array [i + 1] ="Fitness: " + fitness + "/ " +
      "ID: " + id + "/ " +
      "Geburt: " + geburt + ", " +
      "VaterID: " + vaterId + ", " +
      "Generation: " + generation + ", " +
      "Minimaler Abstand: " + minAbstand + ", " +
      "Maximaler Abstand: " + maxAbstand + ", " +
      "Gravitationskonstante"+ gravitationsKonstante + "/\n" +
      net.generateGenome(encoding);
    }
    return array;
  }
View Full Code Here

Examples of eas.users.students.dominikColling.rocket.brain.DomPhysSparseNet

      if (saveLoad == 0 || saveLoad == 1) {
        //speichern der noch lebenden
        for (int l = 0; l < netPop.getSize(); l++) {
          DomPhysAgent agent = (DomPhysAgent) env.getAgent(l +1);

          DomPhysSparseNet hirn = agent.getBrain().getNet();
          int fitness = agent.getEvaluationInt();
          double minAbstand = agent.getMinAbstand();
          double maxAbstand = agent.getMaxAbstand();
          int geburt = agent.getGeburt();
          netPop.addZwischen(hirn, fitness, minAbstand, maxAbstand, geburt);
        }
      }

      DomPhysSparseNet hirn9 = netPop.getBestesNetz();
      System.out.println("BESTES AM SCHLUSS: \n" + new DominikEncoding1().encode(hirn9));
    }
View Full Code Here

Examples of eas.users.students.dominikColling.rocket.brain.DomPhysSparseNet

          System.out.println("Antrieb: " + agent.getActuatorWerte()[0] *80 + " / Drehung: " + agent.getActuatorWerte()[1] * 0.3);
        }*/

          if(!lebend) {

            DomPhysSparseNet netAlt = agent.getBrain().getNet();
            double minAbstand = agent.getMinAbstand();
            double maxAbstand = agent.getMaxAbstand();
            int geburt = agent.getGeburt();
            netPop.add(netAlt, fitness, minAbstand, maxAbstand, geburt);
            //System.out.println("Jetzt hinzufuegen: " + new DominikEncoding1().encode(hirn));

            env.removeAgent(l);

            // mutiertes Hirn
            DomPhysSparseNet netNeu = (DomPhysSparseNet) this.randVerteilung(netPop.getNetze(), netPop.getFitnesswerte(), env.getRand());

            DomPhysSparseNet mutNetNeu = netNeu.createMutatedOffspring(i, rand);

            DomPhysNeuroBrain hirnNeu = new DomPhysNeuroBrain(agent, i, env.getRand(), mutNetNeu);

            agent.implantBrain(hirnNeu);
           
            //Erkennung
              //if(i == 1131) {
                //agent.setAgentShapeBIG();
                //System.out.println(l);
              //}

            /*if(l == 37) {
              System.out.println("1. X: " + agent.getForce().getX() + "Y: " + agent.getForce().getY() +" ROTATION: " +agent.getRotation()+ " Antrieb: " + agent.getActuatorWerte()[0] + " Drehung: " +  agent.getActuatorWerte()[1]);
              System.out.println("2. X: " + agent.getVelocity().getX() + "Y: " + agent.getVelocity().getY()+ "WINKELGESCHW: " + agent.getAngularVelocity() +  "ID: " + agent.getID());
            }*/

            int runde = ((int) simZyk.getCurrentTime());
            agent.reset(runde);

            i++;
           
            Vector2D startPosition = startPositionen.get(l - 1);
            double startWinkel = this.generiereStartWinkel(startPosition);

            env.addAgent(agent, startPosition, startWinkel);
           
            // für Versuch 110707.4
            float y = (float) Math.cos(startWinkel) * -50;
            float x = (float) Math.sin(startWinkel) * 50;
           
            //agent.adjustVelocity(new Vector2f(x,y));

            /*if(l == 37) {
              System.out.println("3. X: " + agent.getForce().getX() + "Y: " + agent.getForce().getY() +" ROTATION: " +agent.getRotation()+ " Antrieb: " + agent.getActuatorWerte()[0] + " Drehung: " +  agent.getActuatorWerte()[1]);
              System.out.println("4. X: " + agent.getVelocity().getX() + "Y: " + agent.getVelocity().getY()+ "WINKELGESCHW: " + agent.getAngularVelocity() +  "ID: " + agent.getID());
              System.out.println("Antrieb: " + agent.getActuatorWerte()[0] *80);
              System.out.println("Drehung: " + agent.getActuatorWerte()[1] * 0.3);
            }*/

          }
        }
        if((simZyk.getCurrentTime() % 1000 == 0)) {
          //Zwischenspeichern noch lebenden
          for (int l = 1; l < popSize + 1; l++) {
            DomPhysAgent agent = (DomPhysAgent) env.getAgent(l);

            DomPhysSparseNet hirn = agent.getBrain().getNet();
            int fitness = agent.getEvaluationInt();
            double minAbstand = agent.getMinAbstand();
            double maxAbstand = agent.getMaxAbstand();
            int geburt = agent.getGeburt();
            netPop.addZwischen(hirn, fitness, minAbstand, maxAbstand, geburt);
View Full Code Here

Examples of eas.users.students.dominikColling.rocket.brain.DomPhysSparseNet

           }                          
         }
        
         int anStelle =this.fitnessWerte.lastIndexOf(maxFitness);
        
         DomPhysSparseNet net = nets.get(anStelle);
   
     return net;
  }
View Full Code Here

Examples of eas.users.students.dominikColling.rocket.brain.DomPhysSparseNet

           }                          
         }
        
         int anStelle =zaehler;
        
         DomPhysSparseNet net = nets.get(anStelle);
   
     return net;
   
  }
View Full Code Here

Examples of eas.users.students.dominikColling.rocket.brain.DomPhysSparseNet

  @Override
  public void runDuringSimulation(DomPhysEnv env, Wink simZyk, ParCollection params) {
    DomPhysNetPopulation netPop = env.getNetPop();
   
    for (int i = 0; i < netPop.getSize(); i++) {
      DomPhysSparseNet hirn = netPop.getNet(i);
     
      List<DomPhysNeuron> neurons = hirn.getNeurons();
      for (int j = 0; j < neurons.size() - 1; j++) {
        int k = neurons.get(j).getId();
        int l = neurons.get(j + 1).getId();
        if (k == l) {
          System.out.println("TIME: " + simZyk.getCurrentTime() + " NR" + i + ":  zweimal gleich!!! " + hirn.generateGenome(new DominikEncoding1()) );
          System.out.println("ID: " + hirn.getId() + " VaterID: " + hirn.getVaterId());
         
          System.out.println(netPop.getNet(99).generateGenome(new DominikEncoding1()) );
          System.out.println("ID: " + netPop.getNet(99).getId() + " VaterID: " + netPop.getNet(4).getVaterId());
              }
      }
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.