Examples of Simulator


Examples of avrora.sim.Simulator

    micaZ = (MicaZ) factory.newPlatform(1, program.getProgram());
    myCpu = (AtmelMicrocontroller) micaZ.getMicrocontroller();
    eeprom = (EEPROM) myCpu.getDevice("eeprom");
   
    avrProperties = (AVRProperties) myCpu.getProperties();
    Simulator sim = myCpu.getSimulator();
    interpreter = (AtmelInterpreter) sim.getInterpreter();
//     State state = interpreter.getState();
    myMemory = new AvrMoteMemory(program.getProgram().getSourceMapping(), avrProperties, interpreter);
  }
View Full Code Here

Examples of ca.nengo.sim.Simulator

 
  public static void main(String[] args) {
       
    try {
      Network network = createNetwork();
      Simulator simulator = network.getSimulator();
     
      Probe inputRecorder = simulator.addProbe("input", "input", true);
      Probe integratorRecorder = simulator.addProbe("integrator", NEFEnsemble.X, true);
      Probe neuronRecorder = simulator.addProbe("integrator", 0, "V", true);

      long startTime = System.currentTimeMillis();
      simulator.run(0f, 1f, .0002f);
      System.out.println("Run time: " + ((System.currentTimeMillis() - startTime)/1000f) );
   
      TimeSeries integratorData = integratorRecorder.getData();
      integratorData.getLabels()[0] = "decoded output";
     
View Full Code Here

Examples of ch.bfh.ti.kybernetik.engine.controller.Simulator

    final int width = (int) (screensize.getWidth() * 0.8f);
    final int height = (int) (screensize.getHeight() * 0.8f);

    final RoboterController[] roboterControllers = buildRobotorControllers(width, height);
    final LightBulbController[] lightBulbControllers = buildLightBulbControllers(width, height);
    final Simulator simulator = buildSimulator(roboterControllers, lightBulbControllers);

    // Start Simulator Thread
    Thread t = new Thread(simulator);
    t.setName("simulatorThread");
    t.start();
View Full Code Here

Examples of com.cburch.logisim.circuit.Simulator

  public void clear() {
    queueSize = 0;
  }
 
  public void propagationCompleted(SimulatorEvent e) {
    Simulator sim = e.getSource();
    if (!sim.isTicking()) {
      queueSize = 0;
    }
  }
View Full Code Here

Examples of com.cburch.logisim.circuit.Simulator

  public void simulatorStateChanged(SimulatorEvent e) {
    propagationCompleted(e);
  }

  public void tickCompleted(SimulatorEvent e) {
    Simulator sim = e.getSource();
    if (!sim.isTicking()) {
      queueSize = 0;
    } else {
      double freq = sim.getTickFrequency();
      if (freq != tickFrequency) {
        queueSize = 0;
        tickFrequency = freq;
      }
     
View Full Code Here

Examples of com.cburch.logisim.circuit.Simulator

  //
  // ChangeListener methods
  //
  public void stateChanged(ChangeEvent e) {
    Simulator sim = project.getSimulator();
    boolean running = sim != null && sim.isRunning();
    boolean ticking = sim != null && sim.isTicking();
    simEnable.setIcon(running ? "simstop.png" : "simplay.png");
    simEnable.setToolTip(running ? Strings.getter("simulateDisableStepsTip")
        : Strings.getter("simulateEnableStepsTip"));
    tickEnable.setIcon(ticking ? "simtstop.png" : "simtplay.png");
    tickEnable.setToolTip(ticking ? Strings.getter("simulateDisableTicksTip")
View Full Code Here

Examples of com.cburch.logisim.circuit.Simulator

  // ProjectListener methods
  //
  public void projectChanged(ProjectEvent event) {
    int action = event.getAction();
    if (action == ProjectEvent.ACTION_SET_STATE) {
      Simulator sim = project.getSimulator();
      CircuitState root = sim.getCircuitState();
      if (model.getRootState() != root) {
        model = new SimulationTreeModel(root);
        tree.setModel(model);
      }
      model.setCurrentView(project.getCircuitState());
View Full Code Here

Examples of com.cburch.logisim.circuit.Simulator

    log.setText(Strings.get("simulateLogItem"));
  }
 
  public void setCurrentState(Simulator sim, CircuitState value) {
    if (currentState == value) return;
    Simulator oldSim = currentSim;
    CircuitState oldState = currentState;
    currentSim = sim;
    currentState = value;
    if (bottomState == null) {
      bottomState = currentState;
    } else if (currentState == null) {
      bottomState = null;
    } else {
      CircuitState cur = bottomState;
      while (cur != null && cur != currentState) {
        cur = cur.getParentState();
      }
      if (cur == null) bottomState = currentState;
    }
   
    boolean oldPresent = oldState != null;
    boolean present = currentState != null;
    if (oldPresent != present) {
      computeEnabled();
    }

    if (currentSim != oldSim) {
      double freq = currentSim == null ? 1.0 : currentSim.getTickFrequency();
      for (int i = 0; i < tickFreqs.length; i++) {
        tickFreqs[i].setSelected(Math.abs(tickFreqs[i].freq - freq) < 0.001);
      }

      if (oldSim != null) oldSim.removeSimulatorListener(myListener);
      if (currentSim != null) currentSim.addSimulatorListener(myListener);
      myListener.simulatorStateChanged(new SimulatorEvent(sim));
    }

    clearItems(downStateItems);
View Full Code Here

Examples of com.cburch.logisim.circuit.Simulator

  }

  @Override
  void computeEnabled() {
    boolean present = currentState != null;
    Simulator sim = this.currentSim;
    boolean simRunning = sim != null && sim.isRunning();
    setEnabled(present);
    run.setEnabled(present);
    reset.setEnabled(present);
    step.setEnabled(present && !simRunning);
    upStateMenu.setEnabled(present);
View Full Code Here

Examples of com.cburch.logisim.circuit.Simulator

  private class MyListener implements ActionListener, SimulatorListener,
      ChangeListener {
    public void actionPerformed(ActionEvent e) {
      Object src = e.getSource();
      Project proj = menubar.getProject();
      Simulator sim = proj == null ? null : proj.getSimulator();
      if (src == run || src == LogisimMenuBar.SIMULATE_ENABLE) {
        if (sim != null) {
          sim.setIsRunning(!sim.isRunning());
          proj.repaintCanvas();
        }
      } else if (src == reset) {
        if (sim != null) sim.requestReset();
      } else if (src == step || src == LogisimMenuBar.SIMULATE_STEP) {
        if (sim != null) sim.step();
      } else if (src == tickOnce || src == LogisimMenuBar.TICK_STEP) {
        if (sim != null) sim.tick();
      } else if (src == ticksEnabled || src == LogisimMenuBar.TICK_ENABLE) {
        if (sim != null) sim.setIsTicking(!sim.isTicking());
      } else if (src == log) {
        LogFrame frame = menubar.getProject().getLogFrame(true);
        frame.setVisible(true);
      }
    }
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.