/** @see ca.nengo.model.plasticity.ShortTermPlastic#getSTPDynamics() */ public DynamicalSystem getSTPDynamics() { try { return mySTPDynamicsTemplate == null ? null : mySTPDynamicsTemplate.clone(); } catch (CloneNotSupportedException e) { throw new RuntimeException(e); } }
/** * @see * ca.nengo.model.plasticity.ShortTermPlastic#setSTPDynamics(ca.nengo.dynamics.DynamicalSystem) */ public void setSTPDynamics(DynamicalSystem dynamics) { if (dynamics == null) { mySTPDynamics = new DynamicalSystem[myNodes.length]; } else { if (dynamics.getInputDimension() != 1 || dynamics.getOutputDimension() != 1) { throw new IllegalArgumentException( "Short-term-plasticity dynamics must be single-input-single-output"); } mySTPDynamics = new DynamicalSystem[myNodes.length]; try { mySTPDynamicsTemplate = dynamics.clone(); for (int i = 0; i < mySTPDynamics.length; i++) { mySTPDynamics[i] = mySTPDynamicsTemplate.clone(); } } catch (CloneNotSupportedException e) { throw new RuntimeException(e); } } }