Package ca.nengo.model

Examples of ca.nengo.model.Probeable


       * Construct probes
       */
      Probe[] probes = getViewerParent().getNetworkParent().getSimulator().getProbes();

      for (Probe probe : probes) {
        Probeable target = probe.getTarget();

        if(target != null){
          if (!(target instanceof Node)) {
            UserMessages.showError("Unsupported target type for probe");
          } else {
View Full Code Here


        /*
         * Add probes
         */
        for (Probe probe : probeToAdd) {
            Probeable target = probe.getTarget();

            if (!(target instanceof Node)) {
                UserMessages.showError("Unsupported target type for probe");
            } else {

View Full Code Here

     */
    AbstractMenuBuilder probesMenu = menu.addSubMenu("Add probe");
    boolean somethingFound = false;
    if (getModel() instanceof Probeable) {

      Probeable probeable = (Probeable) getModel();
      Properties states = probeable.listStates();

      // Enumeration e = states.elements();
      Iterator<?> it = states.entrySet().iterator();

      while (it.hasNext()) {
View Full Code Here

     * @see ca.nengo.sim.Simulator#addProbe(java.lang.String, java.lang.String,
     *      boolean)
     */
    public Probe addProbe(String nodeName, String state, boolean record)
            throws SimulationException {
        Probeable p = getNode(nodeName);
        return addProbe(null, p, state, record);
    }
View Full Code Here

     * @see ca.nengo.sim.Simulator#addProbe(java.lang.String, int,
     *      java.lang.String, boolean)
     */
    public Probe addProbe(String ensembleName, int neuronIndex, String state,
            boolean record) throws SimulationException {
        Probeable p = getNeuron(ensembleName, neuronIndex);
        return addProbe(ensembleName, p, state, record);
    }
View Full Code Here

  /**
   * @see ca.nengo.model.Probeable#getHistory(java.lang.String)
   */
  public TimeSeries getHistory(String stateName) throws SimulationException {
    Probeable p = myProbeables.get(stateName);
    String n = myProbeableStates.get(stateName);

    return p.getHistory(n);
  }
View Full Code Here

    Properties result = new Properties();

    Iterator<String> it = myProbeables.keySet().iterator();
    while (it.hasNext()) {
      String key = it.next();
      Probeable p = myProbeables.get(key);
      String n = myProbeableStates.get(key);
      result.put(key, p.listStates().getProperty(n));
    }

    return result;
  }
View Full Code Here

    myExposedOriginNames.put(origin, name);
    OrderedExposedOrigins.add(temp);

    // automatically add exposed origin to exposed states
    if (origin.getNode() instanceof Probeable) {
      Probeable p=(Probeable)(origin.getNode());
      try {
        exposeState(p,origin.getName(),name);
      } catch (StructuralException e) {
      }
    }
View Full Code Here

    //TODO: take another look at Probe design (maybe Probeables reference Probes?)
    result.mySimulator = mySimulator.clone();
    result.mySimulator.initialize(result);
    Probe[] oldProbes = mySimulator.getProbes();
    for (Probe oldProbe : oldProbes) {
      Probeable target = oldProbe.getTarget();
      if (target instanceof Node) {
        Node oldNode = (Node) target;
        if (oldProbe.isInEnsemble()) {
          try {
            Ensemble oldEnsemble = (Ensemble) getNode(oldProbe.getEnsembleName());
            int neuronIndex = -1;
            for (int j = 0; j < oldEnsemble.getNodes().length && neuronIndex < 0; j++) {
              if (oldNode == oldEnsemble.getNodes()[j]) {
                                neuronIndex = j;
                            }
            }
            result.mySimulator.addProbe(oldProbe.getEnsembleName(), neuronIndex, oldProbe.getStateName(), true);
          } catch (SimulationException e) {
            ourLogger.warn("Problem copying Probe", e);
          } catch (StructuralException e) {
            ourLogger.warn("Problem copying Probe", e);
          }
        } else {
          try {
            result.mySimulator.addProbe(oldNode.getName(), oldProbe.getStateName(), true);
          } catch (SimulationException e) {
            ourLogger.warn("Problem copying Probe", e);
          }
        }
      } else {
        ourLogger.warn("Can't copy Probe on type " + target.getClass().getName()
            + " (to be addressed in a future release)");
      }
    }

    return result;
View Full Code Here

    private void addTimeSeries(DefaultMutableTreeNode top, Network topnetwork, Network probenetwork) {
        Probe[] probes = probenetwork.getSimulator().getProbes();
        for (Probe probe : probes) {
            DefaultMutableTreeNode top0 = top;

            Probeable target = probe.getTarget();
            if (!(target instanceof Node)) {
                Util.Assert(false, "Probe target is not a node");
                continue;
            }
View Full Code Here

TOP

Related Classes of ca.nengo.model.Probeable

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.