/** @see ca.nengo.model.Resettable#reset(boolean) */ public void reset(boolean randomize) { float time = (myOutput == null) ? 0 : myOutput.getTime(); myOutput = new RealOutputImpl(new float[myFunctions.length], Units.UNK, time); if (myNoise != null) { myNoise.reset(randomize); } if (myNoises != null) { for (Noise myNoise2 : myNoises) { myNoise2.reset(randomize); } } mySTPHistory = new float[myNodes.length]; }
public DecodedOrigin clone(Node node) throws CloneNotSupportedException { if (!(node instanceof DecodableEnsemble)) { throw new CloneNotSupportedException("Error cloning DecodedOrigin: Invalid node type"); } try { DecodableEnsemble de = (DecodableEnsemble) node; DecodedOrigin result = (DecodedOrigin) super.clone(); result.setDecoders(MU.clone(myDecoders)); Function[] functions = new Function[myFunctions.length]; for (int i = 0; i < functions.length; i++) { functions[i] = myFunctions[i].clone(); } result.myFunctions = functions; result.myNodeOrigin = myNodeOrigin; result.myNodes = de.getNodes(); result.myNode = de; result.myOutput = (RealOutput) myOutput.clone(); if (myNoise != null) { result.setNoise(myNoise.clone()); } result.setMode(myMode); return result; } catch (CloneNotSupportedException e) { throw new CloneNotSupportedException("Error cloning DecodedOrigin: " + e.getMessage()); } }
/** @param noise New output noise model (defaults to no noise) */ public void setNoise(Noise noise) { myNoise = noise; myNoises = new Noise[getDimensions()]; for (int i = 0; i < myNoises.length; i++) { myNoises[i] = myNoise.clone(); } }