Package ca.nengo.model.neuron.impl

Examples of ca.nengo.model.neuron.impl.LIFSpikeGenerator.run()


    TimeSeries history = sg.getHistory("V");
    assertTrue(history instanceof TimeSeries1D);
    assertEquals(0, history.getTimes().length);
    assertEquals(0, history.getValues().length);
   
    sg.run(new float[]{0f, .002f}, new float[]{1f, 1f});
    history = sg.getHistory("V");
    assertEquals(4, history.getTimes().length);
    assertEquals(4, history.getValues().length);
    assertTrue(history.getTimes()[1] > history.getTimes()[0]);
    assertTrue(history.getValues()[1][0] > history.getValues()[0][0]);
View Full Code Here


   * Test method for 'ca.bpt.cn.model.impl.LIFSpikeGenerator.reset(boolean)'
   */
  public void testReset() throws SimulationException {
    float initialVoltage = .2f;
    LIFSpikeGenerator sg = new LIFSpikeGenerator(.0005f, .02f, .002f, initialVoltage);
    sg.run(new float[]{0f, .005f}, new float[]{1f, 1f});
    float[] voltage1 = ((TimeSeries1D) sg.getHistory("V")).getValues1D();

    sg.run(new float[]{0f, .005f}, new float[]{1f, 1f});
    float[] voltage2 = ((TimeSeries1D) sg.getHistory("V")).getValues1D();
   
View Full Code Here

    float initialVoltage = .2f;
    LIFSpikeGenerator sg = new LIFSpikeGenerator(.0005f, .02f, .002f, initialVoltage);
    sg.run(new float[]{0f, .005f}, new float[]{1f, 1f});
    float[] voltage1 = ((TimeSeries1D) sg.getHistory("V")).getValues1D();

    sg.run(new float[]{0f, .005f}, new float[]{1f, 1f});
    float[] voltage2 = ((TimeSeries1D) sg.getHistory("V")).getValues1D();
   
    sg.reset(false);
   
    sg.run(new float[]{0f, .005f}, new float[]{1f, 1f});
View Full Code Here

    sg.run(new float[]{0f, .005f}, new float[]{1f, 1f});
    float[] voltage2 = ((TimeSeries1D) sg.getHistory("V")).getValues1D();
   
    sg.reset(false);
   
    sg.run(new float[]{0f, .005f}, new float[]{1f, 1f});
    float[] voltage3 = ((TimeSeries1D) sg.getHistory("V")).getValues1D();
   
    assertBetween(voltage1[0], .2f, .23f);
    assertBetween(voltage2[0], .37f, .4f);
    assertBetween(voltage3[0], .2f, .23f);
View Full Code Here

    float[] tauRC = new float[]{0.01f, .02f};
    float[] tauRef = new float[]{.001f, .002f};

    LIFSpikeGenerator sg = new LIFSpikeGenerator(maxTimeStep, tauRC[0], tauRef[0]);
    sg.setMode(SimulationMode.CONSTANT_RATE);
    assertBetween(((RealOutput) sg.run(new float[1], new float[]{current[0]})).getValues()[0], -.001f, .001f);
    assertBetween(((RealOutput) sg.run(new float[1], new float[]{current[1]})).getValues()[0], 126f, 127f);
    assertBetween(((RealOutput) sg.run(new float[1], new float[]{current[2]})).getValues()[0], 309f, 310f);
       
    sg = new LIFSpikeGenerator(maxTimeStep, tauRC[0], tauRef[1]);
    sg.setMode(SimulationMode.CONSTANT_RATE);
View Full Code Here

    float[] tauRef = new float[]{.001f, .002f};

    LIFSpikeGenerator sg = new LIFSpikeGenerator(maxTimeStep, tauRC[0], tauRef[0]);
    sg.setMode(SimulationMode.CONSTANT_RATE);
    assertBetween(((RealOutput) sg.run(new float[1], new float[]{current[0]})).getValues()[0], -.001f, .001f);
    assertBetween(((RealOutput) sg.run(new float[1], new float[]{current[1]})).getValues()[0], 126f, 127f);
    assertBetween(((RealOutput) sg.run(new float[1], new float[]{current[2]})).getValues()[0], 309f, 310f);
       
    sg = new LIFSpikeGenerator(maxTimeStep, tauRC[0], tauRef[1]);
    sg.setMode(SimulationMode.CONSTANT_RATE);
    assertBetween(((RealOutput) sg.run(new float[1], new float[]{current[0]})).getValues()[0], -.001f, .001f);
View Full Code Here

    LIFSpikeGenerator sg = new LIFSpikeGenerator(maxTimeStep, tauRC[0], tauRef[0]);
    sg.setMode(SimulationMode.CONSTANT_RATE);
    assertBetween(((RealOutput) sg.run(new float[1], new float[]{current[0]})).getValues()[0], -.001f, .001f);
    assertBetween(((RealOutput) sg.run(new float[1], new float[]{current[1]})).getValues()[0], 126f, 127f);
    assertBetween(((RealOutput) sg.run(new float[1], new float[]{current[2]})).getValues()[0], 309f, 310f);
       
    sg = new LIFSpikeGenerator(maxTimeStep, tauRC[0], tauRef[1]);
    sg.setMode(SimulationMode.CONSTANT_RATE);
    assertBetween(((RealOutput) sg.run(new float[1], new float[]{current[0]})).getValues()[0], -.001f, .001f);
    assertBetween(((RealOutput) sg.run(new float[1], new float[]{current[1]})).getValues()[0], 111f, 112f);
View Full Code Here

    assertBetween(((RealOutput) sg.run(new float[1], new float[]{current[1]})).getValues()[0], 126f, 127f);
    assertBetween(((RealOutput) sg.run(new float[1], new float[]{current[2]})).getValues()[0], 309f, 310f);
       
    sg = new LIFSpikeGenerator(maxTimeStep, tauRC[0], tauRef[1]);
    sg.setMode(SimulationMode.CONSTANT_RATE);
    assertBetween(((RealOutput) sg.run(new float[1], new float[]{current[0]})).getValues()[0], -.001f, .001f);
    assertBetween(((RealOutput) sg.run(new float[1], new float[]{current[1]})).getValues()[0], 111f, 112f);
    assertBetween(((RealOutput) sg.run(new float[1], new float[]{current[2]})).getValues()[0], 236f, 237f);
       
    sg = new LIFSpikeGenerator(maxTimeStep, tauRC[1], tauRef[0]);
    sg.setMode(SimulationMode.CONSTANT_RATE);
View Full Code Here

    assertBetween(((RealOutput) sg.run(new float[1], new float[]{current[2]})).getValues()[0], 309f, 310f);
       
    sg = new LIFSpikeGenerator(maxTimeStep, tauRC[0], tauRef[1]);
    sg.setMode(SimulationMode.CONSTANT_RATE);
    assertBetween(((RealOutput) sg.run(new float[1], new float[]{current[0]})).getValues()[0], -.001f, .001f);
    assertBetween(((RealOutput) sg.run(new float[1], new float[]{current[1]})).getValues()[0], 111f, 112f);
    assertBetween(((RealOutput) sg.run(new float[1], new float[]{current[2]})).getValues()[0], 236f, 237f);
       
    sg = new LIFSpikeGenerator(maxTimeStep, tauRC[1], tauRef[0]);
    sg.setMode(SimulationMode.CONSTANT_RATE);
    assertBetween(((RealOutput) sg.run(new float[1], new float[]{current[0]})).getValues()[0], -.001f, .001f);
View Full Code Here

       
    sg = new LIFSpikeGenerator(maxTimeStep, tauRC[0], tauRef[1]);
    sg.setMode(SimulationMode.CONSTANT_RATE);
    assertBetween(((RealOutput) sg.run(new float[1], new float[]{current[0]})).getValues()[0], -.001f, .001f);
    assertBetween(((RealOutput) sg.run(new float[1], new float[]{current[1]})).getValues()[0], 111f, 112f);
    assertBetween(((RealOutput) sg.run(new float[1], new float[]{current[2]})).getValues()[0], 236f, 237f);
       
    sg = new LIFSpikeGenerator(maxTimeStep, tauRC[1], tauRef[0]);
    sg.setMode(SimulationMode.CONSTANT_RATE);
    assertBetween(((RealOutput) sg.run(new float[1], new float[]{current[0]})).getValues()[0], -.001f, .001f);
    assertBetween(((RealOutput) sg.run(new float[1], new float[]{current[1]})).getValues()[0], 67f, 68f);
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.