Package ca.nengo.model

Examples of ca.nengo.model.SimulationException


          new float[][]{jointCoordinates}, Units.uniform(Units.M, definition.length));
    } else if (stateName.matches("p\\d+")) {
      int coord = Integer.parseInt(stateName.substring(1));
      result = new TimeSeries1DImpl(new float[]{myTime}, new float[]{myDynamics.getState()[coord]}, Units.UNK);
    } else {
      throw new SimulationException("The state " + stateName + " is unknown");
    }

    return result;
  }
View Full Code Here


      } else if (nodeAttachedTo.getNetworkParent() != null) {
        probe = nodeAttachedTo.getNetworkParent().getSimulator().addProbe(node.getName(),
            state,
            true);
      } else {
        throw new SimulationException(
            "Cannot add a probe to a node that is not inside a Network");
      }
     
      nodeAttachedTo.showPopupMessage("Probe (" + state + ") added");
View Full Code Here

         * Check that no duplicate probes are created
         */
        for (Probe probe : myProbes) {
            if (probe.getTarget() == target) {
                if (probe.getStateName().compareTo(state) == 0) {
                    throw new SimulationException("A probe already exists on this target & state");
                }
            }
        }

        Probe result = new ProbeImpl();
View Full Code Here

    /**
     * @see ca.nengo.sim.Simulator#removeProbe(ca.nengo.util.Probe)
     */
    public void removeProbe(Probe probe) throws SimulationException {
        if (!myProbes.remove(probe)) {
            throw new SimulationException("Probe could not be removed");
        }
       
        if (!myProbeTasks.remove(probe.getProbeTask())) {
            throw new SimulationException("Probe could not be removed");
        }
       
        fireVisibleChangeEvent();
    }
View Full Code Here

    private Probeable getNode(String nodeName) throws SimulationException {
        Node result = myNodeMap.get(nodeName);

        if (result == null) {
            throw new SimulationException("The named Node does not exist");
        }

        if (!(result instanceof Probeable)) {
            throw new SimulationException("The named Node is not Probeable");
        }

        return (Probeable) result;
    }
View Full Code Here

    private Probeable getNeuron(String nodeName, int index)
            throws SimulationException {
        Node ensemble = myNodeMap.get(nodeName);

        if (ensemble == null) {
            throw new SimulationException("The named Ensemble does not exist");
        }

        if (!(ensemble instanceof Ensemble)) {
            throw new SimulationException("The named Node is not an Ensemble");
        }

        Node[] nodes = ((Ensemble) ensemble).getNodes();
        if (index < 0 || index >= nodes.length) {
            throw new SimulationException("The Node index " + index
                    + " is out of range for Ensemble size " + nodes.length);
        }

        if (!(nodes[index] instanceof Probeable)) {
            throw new SimulationException("The specified Node is not Probeable");
        }

        return (Probeable) nodes[index];
    }
View Full Code Here

      myConstantValues = constantValues;
    }
   
    public TimeSeries getHistory(String stateName) throws SimulationException {
      if (!stateName.equals("x")) {
        throw new SimulationException("No such state");
      }
     
      return new TimeSeries1DImpl(new float[myConstantValues.length], myConstantValues, Units.UNK);
    }
View Full Code Here

      startThreads();

      Thread.currentThread().setPriority(oldPriority);
    }
    catch(Exception e) {
      throw new SimulationException(e);
    }
   
    if(myCollectTimings){
      stepInterval = new Date().getTime() - stepInterval;
      myAverageTimePerStep = (myAverageTimePerStep * myNumSteps + stepInterval) / (myNumSteps + 1);
View Full Code Here

    float[] values = new float[origins.length];
   
    for (int i = 0; i < origins.length; i++) {
      InstantaneousOutput o = origins[i].getValues();
      if ( !(o instanceof RealOutput) ) {
        throw new SimulationException("Some of the Node Origins are not producing real-valued output");
      }
      if ( !o.getUnits().equals(units) ) {
        throw new SimulationException("Some of the Node Origins are producing outputs with non-matching units");
      }
     
      values[i] = ((RealOutput) o).getValues()[0];
    }
   
View Full Code Here

    boolean[] values = new boolean[origins.length];
   
    for (int i = 0; i < origins.length; i++) {
      InstantaneousOutput o = origins[i].getValues();
      if ( !(o instanceof SpikeOutput) ) {
        throw new SimulationException("Some of the Node Origins are not producing spiking output");
      }
      if ( !o.getUnits().equals(units) ) {
        throw new SimulationException("Some of the Node Origins are producing outputs with non-matching units");
      }
     
      values[i] = ((SpikeOutput) o).getValues()[0];
    }
   
View Full Code Here

TOP

Related Classes of ca.nengo.model.SimulationException

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.