Package ca.nengo.model

Examples of ca.nengo.model.StructuralException


  private static void checkSameDimension(Termination[] terminations, String name) throws StructuralException {
    int dim = terminations[0].getDimensions();
    for (int i = 1; i < terminations.length; i++) {
      if (terminations[i].getDimensions() != dim) {
        throw new StructuralException("All Terminations " + name + " must have the same dimension");
      }
    }
  }
View Full Code Here


      } catch (StructuralException e) {
        //roll back changes
        for (int j = 0; j < i; j++) {
          myNodeTerminations[j].setTau(oldValues[j]);
        }
        throw new StructuralException(e);
      }
    }
  }
View Full Code Here

  /**
   * @see ca.nengo.model.ExpandableNode#addTermination(java.lang.String, float[][], float, boolean)
   */
    public Termination addTermination(String name, float[][] weights, float tauPSC, boolean modulatory) throws StructuralException {
      if ( !(mySynapticIntegrator instanceof ExpandableSynapticIntegrator) ) {
      throw new StructuralException("Underlying SynapticIntegrator is not expandable");
    }
    if (weights.length != 1) {
      throw new StructuralException("Weights matrix must have one row (has " + weights.length + ")");
    }

    fireVisibleChangeEvent();
   
    return mySynapticIntegrator.addTermination(name, weights[0], tauPSC, modulatory);
View Full Code Here

    return mySynapticIntegrator.addTermination(name, weights[0], tauPSC, modulatory);
  }
   
    public Termination addDelayedTermination(String name, float[][] weights, float tauPSC, float delay, boolean modulatory) throws StructuralException {
      if ( !(mySynapticIntegrator instanceof LinearSynapticIntegrator) ) {
      throw new StructuralException("Underlying SynapticIntegrator is not a LinearSynapticIntegrator");
    }
    if (weights.length != 1) {
      throw new StructuralException("Weights matrix must have one row (has " + weights.length + ")");
    }

    fireVisibleChangeEvent();
   
    return ((LinearSynapticIntegrator)mySynapticIntegrator).addTermination(name, weights[0], tauPSC, delay, modulatory);
View Full Code Here

  /**
   * @see ca.nengo.model.ExpandableNode#removeTermination(java.lang.String)
   */
    public Termination removeTermination(String name) throws StructuralException {
    if ( !(mySynapticIntegrator instanceof ExpandableSynapticIntegrator) ) {
      throw new StructuralException("Underlying SynapticIntegrator is not expandable");
    }

    fireVisibleChangeEvent();
   
    return mySynapticIntegrator.removeTermination(name);
View Full Code Here

            Origin result = myOrigins.remove(name);

            fireVisibleChangeEvent();
            return result;
        }
        throw new StructuralException("Origin " + name + " does not exist");
    }
View Full Code Here

            fireVisibleChangeEvent();
            return result;
        }

        throw new StructuralException("Termination " + name + " does not exist");
    }
View Full Code Here

     * @throws StructuralException if Origin is not set
     *
     */
    public void setOriginState(String name, InstantaneousOutput state, float time) throws StructuralException {
        if (myOriginName == null) {
            throw new StructuralException("Origin name not set in PESTermination");
        }

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

        if (myOutput == null) {
View Full Code Here

    protected static void updateRaw(final float[] raw, final InstantaneousOutput state, final float integrationTime) throws StructuralException {
        if (state instanceof RealOutput) {
            float[] values = ((RealOutput) state).getValues();
            if (values.length != raw.length) {
                throw new StructuralException("State is length "
                        + values.length + "; should be " + raw.length);
            }
            for (int i = 0; i < values.length; i++) {
                raw[i] = values[i];
            }
        } else if (state instanceof SpikeOutput) {
            boolean[] values = ((SpikeOutput) state).getValues();
            if (values.length != raw.length) {
                throw new StructuralException("State is length "
                        + values.length + "; should be " + raw.length);
            }
            for (int i = 0; i < values.length; i++) {
                raw[i] = values[i] ? integrationTime : 0.0f;
            }
View Full Code Here

     * @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 hPESTermination");
        }

        if (myFilteredInput == null || myFilteredOutput == null) {
          return;
        }
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.