public void testNeuronLifecycleMethods ( )
////////////////////////////////////////////////////////////////////////
{
final MiNiNeuronPara para = ErnstTestLib.createTestMiNiNeuronPara ( );
final Neuron neuron = new MiNiNeuron ( para );
neuron.init (
1, // expId
1, // trialId
ErnstTestLib.createTestSeed ( ), // idum
ErnstTestLib.createTestNetwork ( ), // net
0 ); // id
final double [ ] currents0 = neuron.getCurr ( 0 );
assertNotNull ( currents0 );
// Initially the currents should be zero
assertEquals ( 0, currents0 [ 0 ], 0 );
assertEquals ( 0, currents0 [ 1 ], 0 );
final double membraneVoltage0 = neuron.getMemV ( 0 );
assertTrue ( membraneVoltage0 != 0 );
final double timeOfNextFire0 = neuron.getTimeOfNextFire ( );
LOGGER.debug ( "time of next fire ....: {}", timeOfNextFire0 );
LOGGER.debug ( "real fire? " + neuron.realFire());
assertEquals ( -1, timeOfNextFire0, 0 );
final double weight = 1e-9;
final Synapse synapse = MODEL_FACTORY.createSynapse (
0, // to
( byte ) 0, // type (0 = excitatory)
( float ) weight );
double timeOfNextFire = neuron.updateInput (
0, // time
synapse );
neuron.setTimeOfNextFire(timeOfNextFire);
for (int i = 0; i < 100; i++)
{
timeOfNextFire = neuron.updateFire();
LOGGER.debug ( "time of next fire ....: {}", timeOfNextFire );
LOGGER.debug ( "real fire? " + neuron.realFire());
neuron.setTimeOfNextFire(timeOfNextFire);
}
}