Ejemplo n.º 1
0
DictionaryDatum
Node::get_status_dict_()
{
  return DictionaryDatum( new Dictionary );
}
Ejemplo n.º 2
0
void
ModelsModule::init( SLIInterpreter* )
{
  kernel().model_manager.register_node_model< iaf_neuron >( "iaf_neuron" );
  kernel().model_manager.register_node_model< iaf_chs_2007 >( "iaf_chs_2007" );
  kernel().model_manager.register_node_model< iaf_psc_alpha >(
    "iaf_psc_alpha" );
  kernel().model_manager.register_node_model< iaf_psc_alpha_multisynapse >(
    "iaf_psc_alpha_multisynapse" );
  kernel().model_manager.register_node_model< iaf_psc_delta >(
    "iaf_psc_delta" );
  kernel().model_manager.register_node_model< iaf_psc_exp >( "iaf_psc_exp" );
  kernel().model_manager.register_node_model< iaf_psc_exp_multisynapse >(
    "iaf_psc_exp_multisynapse" );
  kernel().model_manager.register_node_model< iaf_tum_2000 >( "iaf_tum_2000" );
  kernel().model_manager.register_node_model< amat2_psc_exp >(
    "amat2_psc_exp" );
  kernel().model_manager.register_node_model< mat2_psc_exp >( "mat2_psc_exp" );
  kernel().model_manager.register_node_model< parrot_neuron >(
    "parrot_neuron" );
  kernel().model_manager.register_node_model< pp_psc_delta >( "pp_psc_delta" );
  kernel().model_manager.register_node_model< pp_pop_psc_delta >(
    "pp_pop_psc_delta" );
  kernel().model_manager.register_node_model< gif_psc_exp >( "gif_psc_exp" );
  kernel().model_manager.register_node_model< gif_psc_exp_multisynapse >(
    "gif_psc_exp_multisynapse" );

  kernel().model_manager.register_node_model< ac_generator >( "ac_generator" );
  kernel().model_manager.register_node_model< dc_generator >( "dc_generator" );

  kernel().model_manager.register_node_model< spike_generator >(
    "spike_generator" );
  kernel().model_manager.register_node_model< poisson_generator >(
    "poisson_generator" );
  kernel().model_manager.register_node_model< pulsepacket_generator >(
    "pulsepacket_generator" );
  kernel().model_manager.register_node_model< noise_generator >(
    "noise_generator" );
  kernel().model_manager.register_node_model< step_current_generator >(
    "step_current_generator" );
  kernel().model_manager.register_node_model< mip_generator >(
    "mip_generator" );
  kernel().model_manager.register_node_model< sinusoidal_poisson_generator >(
    "sinusoidal_poisson_generator" );
  kernel().model_manager.register_node_model< ppd_sup_generator >(
    "ppd_sup_generator" );
  kernel().model_manager.register_node_model< gamma_sup_generator >(
    "gamma_sup_generator" );
  kernel().model_manager.register_node_model< ginzburg_neuron >(
    "ginzburg_neuron" );
  kernel().model_manager.register_node_model< mcculloch_pitts_neuron >(
    "mcculloch_pitts_neuron" );

  kernel().model_manager.register_node_model< izhikevich >( "izhikevich" );
  kernel().model_manager.register_node_model< spike_dilutor >(
    "spike_dilutor" );

  kernel().model_manager.register_node_model< spike_detector >(
    "spike_detector" );
  kernel().model_manager.register_node_model< spin_detector >(
    "spin_detector" );
  kernel().model_manager.register_node_model< Multimeter >( "multimeter" );
  kernel().model_manager.register_node_model< correlation_detector >(
    "correlation_detector" );
  kernel().model_manager.register_node_model< correlomatrix_detector >(
    "correlomatrix_detector" );
  kernel().model_manager.register_node_model< correlospinmatrix_detector >(
    "correlospinmatrix_detector" );
  kernel().model_manager.register_node_model< volume_transmitter >(
    "volume_transmitter" );

  // Create voltmeter as a multimeter pre-configured to record V_m.
  /*BeginDocumentation
  Name: voltmeter - Device to record membrane potential from neurons.
  Synopsis: voltmeter Create

  Description:
  A voltmeter records the membrane potential (V_m) of connected nodes
  to memory, file or stdout.

  By default, voltmeters record values once per ms. Set the parameter
  /interval to change this. The recording interval cannot be smaller
  than the resolution.

  Results are returned in the /events entry of the status dictionary,
  which contains membrane potential as vector /V_m and pertaining
  times as vector /times and node GIDs as /senders, if /withtime and
  /withgid are set, respectively.

  Accumulator mode:
  Voltmeter can operate in accumulator mode. In this case, values for all
  recorded variables are added across all recorded nodes (but kept separate in
  time). This can be useful to record average membrane potential in a
  population.

  To activate accumulator mode, either set /to_accumulator to true, or set
  /record_to [ /accumulator ].  In accumulator mode, you cannot record to file,
  to memory, to screen, with GID or with weight. You must activate accumulator
  mode before simulating. Accumulator data is never written to file. You must
  extract it from the device using GetStatus.

  Remarks:
   - The voltmeter model is implemented as a multimeter preconfigured to
     record /V_m.
   - The set of variables to record and the recording interval must be set
     BEFORE the voltmeter is connected to any node, and cannot be changed
     afterwards.
   - A voltmeter cannot be frozen.
   - If you record with voltmeter in accumulator mode and some of the nodes
     you record from are frozen and others are not, data will only be collected
     from the unfrozen nodes. Most likely, this will lead to confusing results,
     so you should not use voltmeter with frozen nodes.

  Parameters:
       The following parameter can be set in the status dictionary:
       interval     double - Recording interval in ms

  Examples:
  SLI ] /iaf_cond_alpha Create /n Set
  SLI ] /voltmeter Create /vm Set
  SLI ] vm << /interval 0.5 >> SetStatus
  SLI ] vm n Connect
  SLI ] 10 Simulate
  SLI ] vm /events get info
  --------------------------------------------------
  Name                     Type                Value
  --------------------------------------------------
  senders                  intvectortype       <intvectortype>
  times                    doublevectortype    <doublevectortype>
  V_m                      doublevectortype    <doublevectortype>
  --------------------------------------------------
  Total number of entries: 3


  Sends: DataLoggingRequest

  SeeAlso: Device, RecordingDevice, multimeter
  */
  DictionaryDatum vmdict = DictionaryDatum( new Dictionary );
  ArrayDatum ad;
  ad.push_back( LiteralDatum( names::V_m.toString() ) );
  ( *vmdict )[ names::record_from ] = ad;
  const Name name = "voltmeter";
  kernel().model_manager.register_preconf_node_model< Multimeter >(
    name, vmdict, false );

#ifdef HAVE_GSL
  kernel().model_manager.register_node_model< iaf_chxk_2008 >(
    "iaf_chxk_2008" );
  kernel().model_manager.register_node_model< iaf_cond_alpha >(
    "iaf_cond_alpha" );
  kernel().model_manager.register_node_model< iaf_cond_exp >( "iaf_cond_exp" );

  kernel().model_manager.register_node_model< iaf_cond_exp_sfa_rr >(
    "iaf_cond_exp_sfa_rr" );
  kernel().model_manager.register_node_model< iaf_cond_alpha_mc >(
    "iaf_cond_alpha_mc" );
  kernel().model_manager.register_node_model< iaf_cond_alpha_mc_fixedca >(
    "iaf_cond_alpha_mc_fixedca" );
  kernel().model_manager.register_node_model< iaf_cond_alpha_mc_kinetics >(
    "iaf_cond_alpha_mc_kinetics" );

  kernel().model_manager.register_node_model< hh_psc_alpha >( "hh_psc_alpha" );
  kernel().model_manager.register_node_model< hh_psc_alpha_gap >(
    "hh_psc_alpha_gap" );
  kernel().model_manager.register_node_model< hh_cond_exp_traub >(
    "hh_cond_exp_traub" );
  kernel().model_manager.register_node_model< sinusoidal_gamma_generator >(
    "sinusoidal_gamma_generator" );
  kernel().model_manager.register_node_model< gif_cond_exp >( "gif_cond_exp" );
  kernel().model_manager.register_node_model< gif_cond_exp_multisynapse >(
    "gif_cond_exp_multisynapse" );
#endif

#ifdef HAVE_GSL
  kernel().model_manager.register_node_model< aeif_cond_alpha >(
    "aeif_cond_alpha" );
  kernel().model_manager.register_node_model< aeif_cond_exp >(
    "aeif_cond_exp" );
  kernel().model_manager.register_node_model< ht_neuron >( "ht_neuron" );
  kernel().model_manager.register_node_model< aeif_cond_beta_multisynapse >(
    "aeif_cond_beta_multisynapse" );

#endif
  // This version of the AdEx model does not depend on GSL.
  kernel().model_manager.register_node_model< aeif_cond_alpha_RK5 >(
    "aeif_cond_alpha_RK5" );
  kernel().model_manager.register_node_model< aeif_cond_alpha_multisynapse >(
    "aeif_cond_alpha_multisynapse" );

#ifdef HAVE_MUSIC
  //// proxies for inter-application communication using MUSIC
  kernel().model_manager.register_node_model< music_event_in_proxy >(
    "music_event_in_proxy" );
  kernel().model_manager.register_node_model< music_event_out_proxy >(
    "music_event_out_proxy" );
  kernel().model_manager.register_node_model< music_cont_in_proxy >(
    "music_cont_in_proxy" );
  kernel().model_manager.register_node_model< music_message_in_proxy >(
    "music_message_in_proxy" );
#endif

  // register synapses

  /* BeginDocumentation
     Name: static_synapse_hpc - Variant of static_synapse with low memory
     consumption.

     Description:
     hpc synapses store the target neuron in form of a 2 Byte index instead of
     an 8 Byte pointer. This limits the number of thread local neurons to
     65,536. No support for different receptor types. Otherwise identical to
     static_synapse.

     SeeAlso: synapsedict, static_synapse
  */
  kernel()
    .model_manager
    .register_connection_model< StaticConnection< TargetIdentifierPtrRport > >(
      "static_synapse" );
  kernel()
    .model_manager
    .register_connection_model< StaticConnection< TargetIdentifierIndex > >(
      "static_synapse_hpc" );


  /* BeginDocumentation
     Name: static_synapse_hom_w_hpc - Variant of static_synapse_hom_w with low
     memory consumption.
     SeeAlso: synapsedict, static_synapse_hom_w, static_synapse_hpc
  */
  kernel()
    .model_manager
    .register_connection_model< StaticConnectionHomW< TargetIdentifierPtrRport > >(
      "static_synapse_hom_w" );
  kernel()
    .model_manager
    .register_connection_model< StaticConnectionHomW< TargetIdentifierIndex > >(
      "static_synapse_hom_w_hpc" );

  /* BeginDocumentation
     Name: gap_junction - Connection model for gap junctions.
     SeeAlso: synapsedict
  */
  kernel()
    .model_manager
    .register_secondary_connection_model< GapJunction< TargetIdentifierPtrRport > >(
      "gap_junction", false );

  /* BeginDocumentation
     Name: stdp_synapse_hpc - Variant of stdp_synapse with low memory
     consumption.
     SeeAlso: synapsedict, stdp_synapse, static_synapse_hpc
  */
  kernel()
    .model_manager
    .register_connection_model< STDPConnection< TargetIdentifierPtrRport > >(
      "stdp_synapse" );
  kernel()
    .model_manager
    .register_connection_model< STDPConnection< TargetIdentifierIndex > >(
      "stdp_synapse_hpc" );


  /* BeginDocumentation
     Name: stdp_pl_synapse_hom_hpc - Variant of stdp_pl_synapse_hom with low
     memory consumption.
     SeeAlso: synapsedict, stdp_pl_synapse_hom, static_synapse_hpc
  */
  kernel()
    .model_manager
    .register_connection_model< STDPPLConnectionHom< TargetIdentifierPtrRport > >(
      "stdp_pl_synapse_hom" );
  kernel()
    .model_manager
    .register_connection_model< STDPPLConnectionHom< TargetIdentifierIndex > >(
      "stdp_pl_synapse_hom_hpc" );


  /* BeginDocumentation
     Name: stdp_triplet_synapse_hpc - Variant of stdp_triplet_synapse with low
     memory consumption.
     SeeAlso: synapsedict, stdp_synapse, static_synapse_hpc
  */
  kernel()
    .model_manager
    .register_connection_model< STDPTripletConnection< TargetIdentifierPtrRport > >(
      "stdp_triplet_synapse" );
  kernel()
    .model_manager
    .register_connection_model< STDPTripletConnection< TargetIdentifierIndex > >(
      "stdp_triplet_synapse_hpc" );


  /* BeginDocumentation
     Name: quantal_stp_synapse_hpc - Variant of quantal_stp_synapse with low
     memory consumption.
     SeeAlso: synapsedict, quantal_stp_synapse, static_synapse_hpc
  */
  kernel()
    .model_manager
    .register_connection_model< Quantal_StpConnection< TargetIdentifierPtrRport > >(
      "quantal_stp_synapse" );
  kernel()
    .model_manager
    .register_connection_model< Quantal_StpConnection< TargetIdentifierIndex > >(
      "quantal_stp_synapse_hpc" );


  /* BeginDocumentation
     Name: stdp_synapse_hom_hpc - Variant of quantal_stp_synapse with low memory
     consumption.
     SeeAlso: synapsedict, stdp_synapse_hom, static_synapse_hpc
  */
  kernel()
    .model_manager
    .register_connection_model< STDPConnectionHom< TargetIdentifierPtrRport > >(
      "stdp_synapse_hom" );
  kernel()
    .model_manager
    .register_connection_model< STDPConnectionHom< TargetIdentifierIndex > >(
      "stdp_synapse_hom_hpc" );


  /* BeginDocumentation
     Name: stdp_facetshw_synapse_hom_hpc - Variant of stdp_facetshw_synapse_hom
     with low memory consumption.
     SeeAlso: synapsedict, stdp_facetshw_synapse_hom, static_synapse_hpc
  */
  kernel()
    .model_manager
    .register_connection_model< STDPFACETSHWConnectionHom< TargetIdentifierPtrRport > >(
      "stdp_facetshw_synapse_hom" );
  kernel()
    .model_manager
    .register_connection_model< STDPFACETSHWConnectionHom< TargetIdentifierIndex > >(
      "stdp_facetshw_synapse_hom_hpc" );


  /* BeginDocumentation
     Name: cont_delay_synapse_hpc - Variant of cont_delay_synapse with low
     memory consumption.
     SeeAlso: synapsedict, cont_delay_synapse, static_synapse_hpc
  */
  kernel()
    .model_manager
    .register_connection_model< ContDelayConnection< TargetIdentifierPtrRport > >(
      "cont_delay_synapse" );
  kernel()
    .model_manager
    .register_connection_model< ContDelayConnection< TargetIdentifierIndex > >(
      "cont_delay_synapse_hpc" );


  /* BeginDocumentation
     Name: tsodyks_synapse_hpc - Variant of tsodyks_synapse with low memory
     consumption.
     SeeAlso: synapsedict, tsodyks_synapse, static_synapse_hpc
  */
  kernel()
    .model_manager
    .register_connection_model< TsodyksConnection< TargetIdentifierPtrRport > >(
      "tsodyks_synapse" );
  kernel()
    .model_manager
    .register_connection_model< TsodyksConnection< TargetIdentifierIndex > >(
      "tsodyks_synapse_hpc" );


  /* BeginDocumentation
     Name: tsodyks_synapse_hom_hpc - Variant of tsodyks_synapse_hom with low
     memory consumption.
     SeeAlso: synapsedict, tsodyks_synapse_hom, static_synapse_hpc
  */
  kernel()
    .model_manager
    .register_connection_model< TsodyksConnectionHom< TargetIdentifierPtrRport > >(
      "tsodyks_synapse_hom" );
  kernel()
    .model_manager
    .register_connection_model< TsodyksConnectionHom< TargetIdentifierIndex > >(
      "tsodyks_synapse_hom_hpc" );


  /* BeginDocumentation
     Name: tsodyks2_synapse_hpc - Variant of tsodyks2_synapse with low memory
     consumption.
     SeeAlso: synapsedict, tsodyks2_synapse, static_synapse_hpc
  */
  kernel()
    .model_manager
    .register_connection_model< Tsodyks2Connection< TargetIdentifierPtrRport > >(
      "tsodyks2_synapse" );
  kernel()
    .model_manager
    .register_connection_model< Tsodyks2Connection< TargetIdentifierIndex > >(
      "tsodyks2_synapse_hpc" );


  /* BeginDocumentation
     Name: ht_synapse_hpc - Variant of ht_synapse with low memory consumption.
     SeeAlso: synapsedict, ht_synapse, static_synapse_hpc
  */
  kernel()
    .model_manager
    .register_connection_model< HTConnection< TargetIdentifierPtrRport > >(
      "ht_synapse" );
  kernel()
    .model_manager
    .register_connection_model< HTConnection< TargetIdentifierIndex > >(
      "ht_synapse_hpc" );


  /* BeginDocumentation
     Name: stdp_dopamine_synapse_hpc - Variant of stdp_dopamine_synapse with low
     memory consumption.
     SeeAlso: synapsedict, stdp_dopamine_synapse, static_synapse_hpc
  */
  kernel()
    .model_manager
    .register_connection_model< STDPDopaConnection< TargetIdentifierPtrRport > >(
      "stdp_dopamine_synapse" );
  kernel()
    .model_manager
    .register_connection_model< STDPDopaConnection< TargetIdentifierIndex > >(
      "stdp_dopamine_synapse_hpc" );

  /* BeginDocumentation
     Name: vogels_sprekeler_synapse_hpc - Variant of vogels_sprekeler_synapse
     with low memory
     consumption.
     SeeAlso: synapsedict, vogels_sprekeler_synapse
  */
  kernel()
    .model_manager
    .register_connection_model< VogelsSprekelerConnection< TargetIdentifierPtrRport > >(
      "vogels_sprekeler_synapse" );
  kernel()
    .model_manager
    .register_connection_model< VogelsSprekelerConnection< TargetIdentifierIndex > >(
      "vogels_sprekeler_synapse_hpc" );
}
Ejemplo n.º 3
0
void
RandomNumbers::init( SLIInterpreter* i )
{
  RngType.settypename( "rngtype" );
  RngType.setdefaultaction( SLIInterpreter::datatypefunction );

  RngFactoryType.settypename( "rngfactorytype" );
  RngFactoryType.setdefaultaction( SLIInterpreter::datatypefunction );

  RdvType.settypename( "rdvtype" );
  RdvType.setdefaultaction( SLIInterpreter::datatypefunction );
  RdvFactoryType.settypename( "rdvfactorytype" );
  RdvFactoryType.setdefaultaction( SLIInterpreter::datatypefunction );

  if ( rngdict_ || rdvdict_ )
    throw DynamicModuleManagementError( "RandomNumbers module has been initialized previously." );

  // create random number generator type dictionary
  rngdict_ = new Dictionary();
  assert( rngdict_ );
  i->def( "rngdict", DictionaryDatum( rngdict_ ) );

  // add built-in rngs
  register_rng_< librandom::KnuthLFG >( "knuthlfg", *rngdict_ );
  register_rng_< librandom::MT19937 >( "MT19937", *rngdict_ );

  // let GslRandomGen add all of the GSL rngs
  librandom::GslRandomGen::add_gsl_rngs( *rngdict_ );

  // create random deviate generator dictionary
  rdvdict_ = new Dictionary();
  assert( rdvdict_ );
  i->def( "rdevdict", DictionaryDatum( rdvdict_ ) );

  register_rdv_< librandom::BinomialRandomDev >( "binomial", *rdvdict_ );
  register_rdv_< librandom::ClippedRedrawDiscreteRandomDev< librandom::BinomialRandomDev > >(
    "binomial_clipped", *rdvdict_ );
  register_rdv_< librandom::ClippedToBoundaryDiscreteRandomDev< librandom::BinomialRandomDev > >(
    "binomial_clipped_to_boundary", *rdvdict_ );
  register_rdv_< librandom::PoissonRandomDev >( "poisson", *rdvdict_ );
  register_rdv_< librandom::ClippedRedrawDiscreteRandomDev< librandom::PoissonRandomDev > >(
    "poisson_clipped", *rdvdict_ );
  register_rdv_< librandom::ClippedToBoundaryDiscreteRandomDev< librandom::PoissonRandomDev > >(
    "poisson_clipped_to_boundary", *rdvdict_ );
  register_rdv_< librandom::UniformRandomDev >( "uniform", *rdvdict_ );
  register_rdv_< librandom::UniformIntRandomDev >( "uniform_int", *rdvdict_ );

  register_rdv_< librandom::NormalRandomDev >( "normal", *rdvdict_ );
  register_rdv_< librandom::ClippedRedrawContinuousRandomDev< librandom::NormalRandomDev > >(
    "normal_clipped", *rdvdict_ );
  register_rdv_< librandom::ClippedToBoundaryContinuousRandomDev< librandom::NormalRandomDev > >(
    "normal_clipped_to_boundary", *rdvdict_ );
  register_rdv_< librandom::LognormalRandomDev >( "lognormal", *rdvdict_ );
  register_rdv_< librandom::ClippedRedrawContinuousRandomDev< librandom::LognormalRandomDev > >(
    "lognormal_clipped", *rdvdict_ );
  register_rdv_< librandom::ClippedToBoundaryContinuousRandomDev< librandom::LognormalRandomDev > >(
    "lognormal_clipped_to_boundary", *rdvdict_ );

  register_rdv_< librandom::ExpRandomDev >( "exponential", *rdvdict_ );
  register_rdv_< librandom::ClippedRedrawContinuousRandomDev< librandom::ExpRandomDev > >(
    "exponential_clipped", *rdvdict_ );
  register_rdv_< librandom::ClippedToBoundaryContinuousRandomDev< librandom::ExpRandomDev > >(
    "exponential_clipped_to_boundary", *rdvdict_ );
  register_rdv_< librandom::GammaRandomDev >( "gamma", *rdvdict_ );
  register_rdv_< librandom::ClippedRedrawContinuousRandomDev< librandom::GammaRandomDev > >(
    "gamma_clipped", *rdvdict_ );
  register_rdv_< librandom::ClippedToBoundaryContinuousRandomDev< librandom::GammaRandomDev > >(
    "gamma_clipped_to_boundary", *rdvdict_ );

#ifdef HAVE_GSL
  register_rdv_< librandom::GSL_BinomialRandomDev >( "gsl_binomial", *rdvdict_ );
#endif

  // create function
  i->createcommand( "CreateRNG_gt_i", &createrngfunction );
  i->createcommand( "CreateRDV_g_vf", &createrdvfunction );

  i->createcommand( "SetStatus_v", &setstatus_vdfunction );
  i->createcommand( "GetStatus_v", &getstatus_vfunction );

  // access functions
  i->createcommand( "seed_g_i", &seedfunction );
  i->createcommand( "irand_g_i", &irandfunction );
  i->createcommand( "drand_g", &drandfunction );

  i->createcommand( "RandomArray_v_i", &randomarrayfunction );
  i->createcommand( "Random_i", &randomfunction );
}
Ejemplo n.º 4
0
void
nest::sli_neuron::init_state_( const Node& proto )
{
  const sli_neuron& pr = downcast< sli_neuron >( proto );
  state_ = DictionaryDatum( new Dictionary( *pr.state_ ) );
}