Package cnslab.cnsnetwork

Examples of cnslab.cnsnetwork.MiNiNeuron


    public void  testNeuronAccessorMethods ( )
    ////////////////////////////////////////////////////////////////////////
    {
      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

      // interface Neuron accessor methods

      // VSICLIFNeuron is not a sensory neuron

      assertFalse ( neuron.isSensory ( ) );

      final double [ ]  currents = neuron.getCurr ( 0 );

      assertNotNull ( currents );

      assertEquals ( para.DECAY_SYNAPSE.length + para.DECAY_SPIKE.length, currents.length );     

      // Initially the currents should be zero.

      for ( int i = 0; i < currents.length; i++ )
      {
        assertEquals ( currents [ i ] 0 , 1e-15 );
      }

      // The membrane voltage should be within the bounds determined
      // by its initial jitter.

      final double  membraneVoltage = neuron.getMemV ( 0 );

      assertTrue ( membraneVoltage > para.ini_mem
        && membraneVoltage < para.ini_mem + para.ini_memVar );

      final boolean  record = neuron.getRecord ( );

      assertFalse ( record );

      final long  targetHost = neuron.getTHost ( );

      assertEquals ( 0, targetHost );

      final double  timeOfNextFire = neuron.getTimeOfNextFire ( );

      assertEquals ( -1, timeOfNextFire, 0 );

      final boolean  realFire = neuron.realFire ( );

      assertFalse ( realFire );
    }
View Full Code Here


    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);
      }
    }
View Full Code Here

TOP

Related Classes of cnslab.cnsnetwork.MiNiNeuron

Copyright © 2018 www.massapicom. 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.