Examples of Simulation


Examples of avrora.sim.Simulation

     */
    public void run(String[] args) throws Exception {
        StringUtil.REPORT_SECONDS = REPORT_SECONDS.get();
        StringUtil.SECONDS_PRECISION = (int)SECONDS_PRECISION.get();

        Simulation sim = Defaults.getSimulation(SIMULATION.get());
        sim.process(options, args);

        printSimHeader();
        long startms = System.currentTimeMillis();
        try {
            sim.start();
            sim.join();
        } catch (BreakPointException e) {
            Terminal.printYellow("Simulation terminated");
            Terminal.println(": breakpoint at " + StringUtil.addrToString(e.address) + " reached.");
        } catch (TimeoutException e) {
            Terminal.printYellow("Simulation terminated");
View Full Code Here

Examples of ch.idsia.mario.simulation.Simulation

    private void evaluateServerMode()
    {
        Server server = new Server(evaluationOptions.getServerAgentPort(), Environment.numberOfObservationElements, Environment.numberOfButtons);
        evaluationOptions.setAgent(new ServerAgent(server, evaluationOptions.isFastTCP()));

        Simulation simulator = new BasicSimulator(evaluationOptions.getSimulationOptionsCopy());
        while (server.isRunning())
        {
            String resetData = server.recvUnSafe();
            if (resetData.startsWith("ciao"))
            {
                System.out.println("Evaluator: ciao received from client; restarting server");
                server.restartServer();
                continue;
            }
            if (resetData.startsWith("reset"))
            {
                resetData = resetData.split("reset\\s*")[1];
                evaluationOptions.setUpOptions(resetData.split("[\\s]+"));
                //TODO: Fix this in more general way
                ((ServerAgent)evaluationOptions.getAgent()).setFastTCP(evaluationOptions.isFastTCP());
                init(evaluationOptions);
                // Simulate One Level
                EvaluationInfo evaluationInfo;

                long startTime = System.currentTimeMillis();
                String startMessage = "Evaluation started at " + GlobalOptions.getDateTime(null);
                LOGGER.println(startMessage, LOGGER.VERBOSE_MODE.ALL);

                simulator.setSimulationOptions(evaluationOptions);
                evaluationInfo = simulator.simulateOneLevel();

                evaluationInfo.levelType = evaluationOptions.getLevelType();
                evaluationInfo.levelDifficulty = evaluationOptions.getLevelDifficulty();
                evaluationInfo.levelRandSeed = evaluationOptions.getLevelRandSeed();
                evaluationSummary.add(evaluationInfo);
View Full Code Here

Examples of core.simulation.Simulation


      // Duerme un intervalo de tiempo
      try
      {
        Simulation sim = Simulation.getCurrent();
        Thread.sleep( sim != null ? sim.getStepTime() : 0 );
        sleepCounts++;
      }
      catch (InterruptedException e)
      { }
       
View Full Code Here

Examples of core.simulation.Simulation

          });
        }
      }
     
      // Se crea una simulaci�n vac�a que se ir� llenando.
      Simulation newSim = new Simulation();
      if ( newSim != null )
        newSim.setPlaybackSimualtion( false );
      else
        Logger.error( "No pude instanciarse la nueva simulaci�n" );
     
      composite1.layout(true);
     
View Full Code Here

Examples of core.simulation.Simulation

    canvas.redraw();
  }
 
 
  private void linkedIcons() { 
    Simulation simulation = Simulation.getCurrent();
    RecognizedShape[] icons = simulation.getGps().getMazeItems().recognizedColoredIcons;
   
    Point originPoint = new Point(x,y);
    Point endPoint = new Point(x+w,y+h);
    RecognizedShape origin = null, end = null;
   
View Full Code Here

Examples of core.simulation.Simulation

            }
          }         
         
          if(resolved){
            Set<Integer> keys = linkedIcons.keySet();
            Simulation simulation = Simulation.getCurrent();
           
            for (Integer placeId : keys) {
              Set<Integer> connections = linkedIcons.get(placeId);             
              for (Integer destiny : connections) {
                places[placeId-1][destiny-1]=true;
                places[destiny-1][placeId-1]=true;
              }
            }
         
            for (int i = 0; i < places.length; i++) {
              for (int j = 0; j < places.length; j++) {
                if(places[i][j]) simulation.setPlace(i+1,j+1);
              }
            }
          }
        }
        else {
View Full Code Here

Examples of core.simulation.Simulation


      // Duerme un intervalo de tiempo
      try
      {
        Simulation sim = Simulation.getCurrent();
        Thread.sleep( sim != null ? sim.getStepTime() : 0 );
        sleepCounts++;
      }
      catch (InterruptedException e)
      { }
       
View Full Code Here

Examples of eas.users.students.benediktMueller.qswarm.sim.Simulation

  int cycles = 3000;
 
  public CleaningExperiment(int robs, int cycles)
  {
    this.cycles = cycles;
    sim = new Simulation(robs);
  }
View Full Code Here

Examples of jmt.engine.simEngine.Simulation

    try {
      //add class
      JobClass[] classes = new JobClass[1];
      classes[0] = new JobClass("prima");
      Simulation sim = new Simulation(-1, testName);
      sim.addClasses(classes);

      //terminal
      RandomStrategy[] rrs_term = new RandomStrategy[1];
      rrs_term[0] = new RandomStrategy();

      int[] numJobs = { N }; //variable population

      ServiceTimeStrategy[] ds = { new ServiceTimeStrategy(DelayExp[0], DelayPar[0]) };

      sim.addNode("terminal", new Terminal(numJobs), new Delay(ds), new Router(rrs_term));

      //server 1
      ServiceStrategy[] serv_strat1 = new ServiceStrategy[1];
      serv_strat1[0] = new ServiceTimeStrategy(serverExp1[0], serverPar1[0]);

      RandomStrategy[] rrs_serv1 = new RandomStrategy[1];
      rrs_serv1[0] = new RandomStrategy();

      sim.addNode("server1", new Queue(-1, false, null, null), new Server(1, null, serv_strat1), new Router(rrs_serv1));

      //server 2
      ServiceStrategy[] serv_strat2 = new ServiceStrategy[1];
      serv_strat2[0] = new ServiceTimeStrategy(serverExp2[0], serverPar2[0]);

      RandomStrategy[] rrs_serv2 = new RandomStrategy[1];
      rrs_serv2[0] = new RandomStrategy();

      sim.addNode("server2", new Queue(-1, false, null, null), new Server(1, null, serv_strat2), new Router(rrs_serv2));

      //connections
      sim.addConnection("terminal", "server1");
      sim.addConnection("server1", "server2");
      sim.addConnection("server2", "terminal");

      //measure

      jmt.engine.dataAnalysis.Measure mis3_s1 = new InverseMeasure(testName + "_x1.out", .1, .1, 1000000, true);
      jmt.engine.dataAnalysis.Measure mis3_s2 = new InverseMeasure(testName + "_x2.out", .1, .1, 1000000, true);

      int through = SimConstants.THROUGHPUT;

      sim.addMeasure(through, "server1", mis3_s1, classes[0].getName());
      //sim.addMeasure(through, "server2", mis3_s2, classes[0].getName());

      sim.initialize();
      sim.run();

      System.out.println("tot time = " + NetSystem.getElapsedTime());

    } catch (Exception e) {
      e.printStackTrace();
View Full Code Here

Examples of jmt.engine.simEngine.Simulation

    try {
      //File model = new File(path);
      //FileInputStream is = new FileInputStream(model);
      SimLoader loader = new SimLoader(path);
      Simulation sim = loader.getSim();
      sim.initialize();

      start = System.currentTimeMillis();
      sim.run();
      stop = System.currentTimeMillis();
      elapsed = stop - start;
      //System.out.println("Duration execution "+i+": ");
      //System.out.println(Long.toString(elapsed));
    } catch (FileNotFoundException e) {
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.