Examples of PassthroughTermination


Examples of ca.nengo.model.impl.PassthroughNode.PassthroughTermination

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

    PassthroughTermination result = new PassthroughTermination(this, name, transform);
    myTerminations.put(name, result);
    return result;
  }
View Full Code Here

Examples of ca.nengo.model.impl.PassthroughNode.PassthroughTermination

      else {
        // TODO: Test with spiking outputs?
        float[] values = new float[myDimension];
        Iterator<PassthroughTermination> it = myTerminations.values().iterator();
        while (it.hasNext()) {
          PassthroughTermination termination = it.next();
          InstantaneousOutput io = termination.getValues();
          if (io instanceof RealOutput) {
            values = MU.sum(values, ((RealOutput) io).getValues());
          } else if (io instanceof SpikeOutput) {
            boolean[] spikes = ((SpikeOutput) io).getValues();
            for (int i = 0; i < spikes.length; i++) {
              if (spikes[i]) {
                              values[i] += 1f/(endTime - startTime);
                          }
            }
          } else if (io == null) {
            throw new SimulationException("Null input to Termination " + termination.getName());
          } else {
            throw new SimulationException("Output type unknown: " + io.getClass().getName());
          }
        }
        // Send values over the socket.
View Full Code Here

Examples of ca.nengo.model.impl.PassthroughNode.PassthroughTermination

       
        if (myOrigin != null)
          result.myOrigin = myOrigin.clone(result);
        result.myTerminations = new HashMap<String, PassthroughTermination>(10);
        for (PassthroughTermination oldTerm : myTerminations.values()) {
          PassthroughTermination newTerm = oldTerm.clone(result);
          result.myTerminations.put(newTerm.getName(), newTerm);
        }
 
        result.myListeners = new ArrayList<Listener>(2);
       
        // Note: Cloning a SocketUDPNode is weird, because it copies all of the pre-existing socket values
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.