Exemplo n.º 1
0
  /**
   * @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");
    }

    if (origin.getDimensions() != termination.getDimensions()) {
      throw new StructuralException(
          "Can't connect Origin of dimension "
              + origin.getDimensions()
              + " to Termination of dimension "
              + termination.getDimensions());
    }

    Projection result = new ProjectionImpl(origin, termination, this);
    myProjectionMap.put(termination, result);
    getSimulator().initialize(this);
    fireVisibleChangeEvent();

    return result;
  }
Exemplo n.º 2
0
 public int getDimensions() {
   return myWrapped.getDimensions();
 }