Package ca.nengo.model

Examples of ca.nengo.model.StructuralException


     * @see ca.nengo.model.plasticity.impl.PlasticEnsembleTermination#updateTransform(float, int, int)
     */
    @Override
    public void updateTransform(float time, int start, int end) throws StructuralException {
        if (myModTermName == null || myOriginName == null) {
            throw new StructuralException("Origin name not set in PESTermination");
        }

        if (myLastTime < time) {
            this.updateInput();
            myLastTime = time;
View Full Code Here


     * @param time Current time
     * @throws StructuralException if modulatory termination does not exist
     */
    public void setModTerminationState(String name, InstantaneousOutput state, float time) throws StructuralException {
        if (myModTermName == null) {
            throw new StructuralException("Modulatory termination name not set in PESTermination");
        }

        if (!name.equals(myModTermName)) { return; }
       
        if (myModInput == null) {
View Full Code Here

    }

    @Override
    public void setOriginState(String name, InstantaneousOutput state, float time) throws StructuralException {
        if (myOriginName == null) {
            throw new StructuralException("Origin name not set in STDPTermination");
        }
        if (!(state instanceof SpikeOutput)) {
            throw new StructuralException("Origin must be Spiking in STDPTermination");
        }

        if (!name.equals(myOriginName)) { return; }

        updateHistory(myPostSpiking, myPostSpikeHistory, (SpikeOutput)state, time);
View Full Code Here

    private void updateInput(float time) throws StructuralException {
        InstantaneousOutput input = this.getInput();

        if (!(input instanceof SpikeOutput)) {
            throw new StructuralException("Termination must be Spiking in STDPTermination");
        }

        updateHistory(myPreSpiking, myPreSpikeHistory, (SpikeOutput)input, time);
    }
View Full Code Here

        if (index == 0) {
          Object o = ((SingleValuedProperty) parent).getValue();
          result = new Value(index, o);
        } else {
          ConfigExceptionHandler.handle(
              new StructuralException("SingleValuedProperty doesn't have child " + index),
              ConfigExceptionHandler.DEFAULT_BUG_MESSAGE, null);
        }
      }
    } catch (StructuralException e) {
      ConfigExceptionHandler.handle(e, ConfigExceptionHandler.DEFAULT_BUG_MESSAGE, null);
View Full Code Here

  /**
   * @see ca.nengo.model.neuron.ExpandableSynapticIntegrator#addTermination(java.lang.String, float[], float, boolean)
   */
  public Termination addTermination(String name, float[] weights, float tauPSC, boolean modulatory) throws StructuralException {
    if (myTerminations.containsKey(name)) {
      throw new StructuralException("This SynapticIntegrator already has a Termination named " + name);
    }

    LinearExponentialTermination result = new LinearExponentialTermination(myNode, name, weights, tauPSC);
    result.setModulatory(modulatory);
    myTerminations.put(name, result);
View Full Code Here

    return result;
  }
 
  public Termination addTermination(String name, float[] weights, float tauPSC, float delay, boolean modulatory) throws StructuralException {
    if (myTerminations.containsKey(name)) {
      throw new StructuralException("This SynapticIntegrator already has a Termination named " + name);
    }
   
    DelayedLinearExponentialTermination result = new DelayedLinearExponentialTermination(myNode, name,
        weights, tauPSC, (int)(delay/myMaxTimeStep));
    result.setModulatory(modulatory);
View Full Code Here

   */
  public void addNode(Node node) throws StructuralException {
    // Hack to get UI to update node removal
    super.addNode(node);
    super.removeNode(node.getName());
    throw new StructuralException("Nodes cannot be added to NetworkArrayImpl named " + this.getName());
  }
View Full Code Here

   * @see ca.nengo.model.ExpandableNode#addTermination(java.lang.String, float[][], float, boolean)
   */
    public synchronized Termination addTermination(String name, float[][] weights, PDF tauPSC, PDF delays, boolean modulatory) throws StructuralException {
      for(Termination t : getTerminations()) {
          if(t.getName().equals(name))
            throw new StructuralException("The ensemble already contains a termination named " + name);
        }
     
    if (myExpandableNodes.length != weights.length) {
      throw new StructuralException(weights.length + " sets of weights given for "
          + myExpandableNodes.length + " expandable nodes");
    }

    int dimension = weights[0].length;

    Termination[] components = new Termination[myExpandableNodes.length];
    for (int i = 0; i < myExpandableNodes.length; i++) {
      if (weights[i].length != dimension) {
        throw new StructuralException("Equal numbers of weights are needed for termination onto each node");
      }
     
      if(delays == null)
        components[i] = myExpandableNodes[i].addTermination(name, new float[][]{weights[i]}, tauPSC.sample()[0], modulatory);
      else {
        if(myExpandableNodes[i] instanceof ExpandableSpikingNeuron)
          components[i] = ((ExpandableSpikingNeuron)myExpandableNodes[i]).addDelayedTermination(name,
              new float[][]{weights[i]}, tauPSC.sample()[0], delays.sample()[0], modulatory);
        else
          throw new StructuralException("Cannot specify delays for non-ExpandableSpikingNeuron");
      }
    }

    EnsembleTermination result = new EnsembleTermination(this, name, components);
    myExpandedTerminations.put(name, result);
View Full Code Here

      fireVisibleChangeEvent();
      return result;
    } else if (getTermination(name) != null) {
      return super.removeTermination(name);
    }
    throw new StructuralException("Termination " + name + " does not exist");
  }
View Full Code Here

TOP

Related Classes of ca.nengo.model.StructuralException

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.