Package ca.nengo.model

Examples of ca.nengo.model.StructuralException


    public Termination addDecodedTermination(String name, float[][] matrix, float[] tfNumerator, float[] tfDenominator,
            float passthrough, boolean isModulatory) throws StructuralException {

      for(Termination t : getTerminations()) {
          if(t.getName().equals(name))
            throw new StructuralException("The ensemble already contains a termination named " + name);
        }

        LTISystem dynamics = CanonicalModel.getRealization(tfNumerator, tfDenominator, passthrough);

        Matrix A = new Matrix(MU.convert(dynamics.getA(0f)));
View Full Code Here


            fireVisibleChangeEvent();

            return result;
        }

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

            fireVisibleChangeEvent();

            return result;
        }

        throw new StructuralException("Origin " + name +
                " does not exist or not a DecodedOrigin");
    }
View Full Code Here

  /**
   * @see ca.nengo.model.Network#addNode(ca.nengo.model.Node)
   */
  public void addNode(Node node) throws StructuralException {
    if (myNodeMap.containsKey(node.getName())) {
      throw new StructuralException("This Network already contains a Node named " + node.getName());
    }

    myNodeMap.put(node.getName(), node);
    node.addChangeListener(this);

View Full Code Here

  public void changed(Event e) throws StructuralException {
    if (e instanceof VisiblyMutable.NameChangeEvent) {
      VisiblyMutable.NameChangeEvent ne = (VisiblyMutable.NameChangeEvent) e;

      if (myNodeMap.containsKey(ne.getNewName()) && !ne.getNewName().equals(ne.getOldName())) {
        throw new StructuralException("This Network already contains a Node named " + ne.getNewName());
      }

      /*
       * Only do the swap if the name has changed.
       * Otherwise, the node will be dereferenced from the map.
View Full Code Here

  /**
   * @see ca.nengo.model.Network#getNode(java.lang.String)
   */
  public Node getNode(String name) throws StructuralException {
    if (!myNodeMap.containsKey(name)) {
      throw new StructuralException("No Node named " + name + " in this Network");
    }
    return myNodeMap.get(name);
  }
View Full Code Here

//      VisiblyMutableUtils.nodeRemoved(this, node, myListeners);
     
      getSimulator().initialize(this);
      fireVisibleChangeEvent();
    } else {
      throw new StructuralException("No Node named " + name + " in this Network");
    }
  }
View Full Code Here

  /**
   * @see ca.nengo.model.Network#addProjection(ca.nengo.model.Origin, ca.nengo.model.Termination)
   */
  public Projection addProjection(Origin origin, Termination termination) throws StructuralException {
    if (myProjectionMap.containsKey(termination)) {
      throw new StructuralException("There is already an Origin connected to the specified Termination");
    } else if (origin.getDimensions() != termination.getDimensions()) {
      throw new StructuralException("Can't connect Origin of dimension " + origin.getDimensions()
          + " to Termination of dimension " + termination.getDimensions());
    } else {
      Projection result = new ProjectionImpl(origin, termination, this);
      myProjectionMap.put(termination, result);
      getSimulator().initialize(this);
View Full Code Here

      Projection p = myProjectionMap.get(termination);
      p.getTermination().reset(false);
     
      myProjectionMap.remove(termination);
    } else {
      throw new StructuralException("The Network contains no Projection ending on the specified Termination");
    }

    getSimulator().initialize(this);
    fireVisibleChangeEvent();
  }
View Full Code Here

  /**
   * @see ca.nengo.model.Network#hideOrigin(java.lang.String)
   */
  public void hideOrigin(String name) throws StructuralException {
    if(myExposedOrigins.get(name) == null) {
            throw new StructuralException("No origin named " + name + " exists");
        }

    OrderedExposedOrigins.remove(myExposedOrigins.get(name));
    OriginWrapper originWr = (OriginWrapper)myExposedOrigins.remove(name);

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.