Package ca.nengo.model

Examples of ca.nengo.model.StructuralException


  /**
   * @see ca.nengo.model.Node#getOrigin(java.lang.String)
   */
  public Origin getOrigin(String name) throws StructuralException {
    throw new StructuralException("A LinkSegmentModel itself has no Origins (neural output arises from component SkeletalMuscles)");
  }
View Full Code Here


  /**
   * @see ca.nengo.model.Node#getTermination(java.lang.String)
   */
  public Termination getTermination(String name) throws StructuralException {
    throw new StructuralException("A LinkSegmentModel itself has no Terminations (neural input is to component SkeletalMuscles)");
  }
View Full Code Here

  public SkeletalMuscleImpl(String name, DynamicalSystem dynamics) throws StructuralException {
    myName = name;
    myTermination = makeTermination();

    if (dynamics.getInputDimension() != 2) {
            throw new StructuralException("Input dimension of dynamics must be 2 (activation; length)");
        }
    if (dynamics.getOutputDimension() != 1) {
            throw new StructuralException("Output dimension of dynamics must be 1 (force)");
        }
    myAFDynamics = dynamics;

    myIntegrator = new RK45Integrator();
  }
View Full Code Here

   */
  public Termination getTermination(String name) throws StructuralException {
    if (name.equals(SkeletalMuscle.EXCITATION_TERMINATION)) {
      return myTermination;
    } else {
      throw new StructuralException("Termination " + name + " does not exist");
    }
  }
View Full Code Here

    boolean successful = false;
    if (modifyModel) {

      try {
        if (getNodeParent().getNetworkParent() == null) {
          throw new StructuralException(
              "Can't create projection because termination is not within the scope of a Network");
        }

        getNodeParent().getNetworkParent().getModel().addProjection(source.getModel(),
            getModel());
View Full Code Here

   */
  public Object getValue(int index) throws StructuralException {
    try {
      return myValues.get(index);
    } catch (IndexOutOfBoundsException e) {
      throw new StructuralException("Value " + index + " doesn't exist", e);
    }
  }
View Full Code Here

  public void insert(int index, Object value) throws StructuralException {
    checkClass(value);
    try {
      myValues.add(value);         
    } catch (IndexOutOfBoundsException e) {
      throw new StructuralException("Value " + index + " doesn't exist", e);
    }
  }
View Full Code Here

   */
  public void remove(int index) throws StructuralException {
    try {
      myValues.remove(index);         
    } catch (IndexOutOfBoundsException e) {
      throw new StructuralException("Value " + index + " doesn't exist", e);
    }
  }
View Full Code Here

  public void setValue(int index, Object value) throws StructuralException {
    checkClass(value);
    try {
      myValues.set(index, value);         
    } catch (IndexOutOfBoundsException e) {
      throw new StructuralException("Value " + index + " doesn't exist", e);
    }
  }
View Full Code Here

    }
  }
 
  private void checkClass(Object value) throws StructuralException {
    if (!getType().isAssignableFrom(value.getClass())) {
      throw new StructuralException("Value must be of type " + getType()
          + " (was " + value.getClass().getName() + ")");
    }
  }
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.