assertSpikesCloseToRate(sg, current[2], 10);
}
public void testRunPrecise() throws SimulationException {
LIFSpikeGenerator sg = new LIFSpikeGenerator(0.001f, 0.02f, 0.002f);
assertSpikesCloseToRate(sg, 1.46335061f, 1, SimulationMode.DEFAULT);
assertSpikesCloseToRate(sg, 1.46335061f, 1, SimulationMode.PRECISE);
assertSpikesCloseToRate(sg, 4.80514111f, 10, SimulationMode.DEFAULT);
assertSpikesCloseToRate(sg, 4.80514111f, 4, SimulationMode.PRECISE);
float maxTimeStep = .0005f;
float[] current = new float[]{0f, 2f, 5f};
float[] tauRC = new float[]{0.01f, .02f};
float[] tauRef = new float[]{.001f, .002f};
sg = new LIFSpikeGenerator(maxTimeStep, tauRC[0], tauRef[0]);
//assertSpikesCloseToRate(sg, current[0], 1, SimulationMode.PRECISE);
assertSpikesCloseToRate(sg, current[1], 2, SimulationMode.PRECISE);
assertSpikesCloseToRate(sg, current[2], 5, SimulationMode.PRECISE);
sg = new LIFSpikeGenerator(maxTimeStep, tauRC[0], tauRef[1]);
assertSpikesCloseToRate(sg, current[0], 1, SimulationMode.PRECISE);
assertSpikesCloseToRate(sg, current[1], 3, SimulationMode.PRECISE);
assertSpikesCloseToRate(sg, current[2], 3, SimulationMode.PRECISE);
sg = new LIFSpikeGenerator(maxTimeStep, tauRC[1], tauRef[0]);
assertSpikesCloseToRate(sg, current[0], 1, SimulationMode.PRECISE);
assertSpikesCloseToRate(sg, current[1], 1, SimulationMode.PRECISE);
assertSpikesCloseToRate(sg, current[2], 2, SimulationMode.PRECISE);
sg = new LIFSpikeGenerator(maxTimeStep, tauRC[1], tauRef[1]);
assertSpikesCloseToRate(sg, current[0], 1, SimulationMode.PRECISE);
assertSpikesCloseToRate(sg, current[1], 1, SimulationMode.PRECISE);
assertSpikesCloseToRate(sg, current[2], 2, SimulationMode.PRECISE);