Skip to content

Commit

Permalink
update NEST data types for v3.6
Browse files Browse the repository at this point in the history
  • Loading branch information
C.A.P. Linssen committed Sep 26, 2023
1 parent 565a17f commit 91eb990
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 10 deletions.
36 changes: 26 additions & 10 deletions pyNN/nest/extensions/simple_stochastic_synapse.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

// Includes from nestkernel:
#include "connection.h"
#include "kernel_manager.h"


/* BeginUserDocs: synapse, short-term plasticity
Expand Down Expand Up @@ -47,17 +48,17 @@ namespace pynn
template < typename targetidentifierT >
class simple_stochastic_synapse : public nest::Connection< targetidentifierT >
{
private:
double weight_; //!< Synaptic weight
double p_; //!< Probability of spike transmission

public:
//! Type to use for representing common synapse properties
typedef nest::CommonSynapseProperties CommonPropertiesType;

//! Shortcut for base class
typedef nest::Connection< targetidentifierT > ConnectionBase;

static constexpr ConnectionModelProperties properties = ConnectionModelProperties::HAS_DELAY
| ConnectionModelProperties::IS_PRIMARY | ConnectionModelProperties::SUPPORTS_HPC
| ConnectionModelProperties::SUPPORTS_LBL;

/**
* Default Constructor.
* Sets default values for all parameters. Needed by GenericConnectorModel.
Expand All @@ -74,6 +75,21 @@ class simple_stochastic_synapse : public nest::Connection< targetidentifierT >
{
}

/**
* Copy constructor from a property object.
* Needs to be defined properly in order for GenericConnector to work.
*/
simple_stochastic_synapse( const simple_stochastic_synapse& rhs ) = default;
simple_stochastic_synapse& operator=( const simple_stochastic_synapse& rhs ) = default;

// Explicitly declare all methods inherited from the dependent base
// ConnectionBase. This avoids explicit name prefixes in all places these
// functions are used. Since ConnectionBase depends on the template parameter,
// they are not automatically found in the base class.
using nest::ConnectionBase::get_delay_steps;
using nest::ConnectionBase::get_rport;
using nest::ConnectionBase::get_target;

/**
* Helper class defining which types of events can be transmitted.
*
Expand All @@ -99,12 +115,6 @@ class simple_stochastic_synapse : public nest::Connection< targetidentifierT >
{
return nest::invalid_port;
}

size_t
handles_test_event( nest::DSSpikeEvent&, size_t )
{
return nest::invalid_port;
}
};

/**
Expand Down Expand Up @@ -162,8 +172,14 @@ class simple_stochastic_synapse : public nest::Connection< targetidentifierT >
{
weight_ = w;
}

private:
double weight_; //!< Synaptic weight
double p_; //!< Probability of spike transmission
};

template < typename targetidentifierT >
constexpr ConnectionModelProperties simple_stochastic_synapse< targetidentifierT >::properties;

template < typename targetidentifierT >
inline void
Expand Down
6 changes: 6 additions & 0 deletions pyNN/nest/extensions/stochastic_stp_synapse.h
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,10 @@ class stochastic_stp_synapse : public nest::Connection< targetidentifierT >
typedef nest::CommonSynapseProperties CommonPropertiesType;
typedef nest::Connection< targetidentifierT > ConnectionBase;

static constexpr ConnectionModelProperties properties = ConnectionModelProperties::HAS_DELAY
| ConnectionModelProperties::IS_PRIMARY | ConnectionModelProperties::SUPPORTS_HPC
| ConnectionModelProperties::SUPPORTS_LBL;

/**
* Default Constructor.
* Sets default values for all parameters. Needed by GenericConnectorModel.
Expand Down Expand Up @@ -144,6 +148,8 @@ class stochastic_stp_synapse : public nest::Connection< targetidentifierT >
double t_lastspike_; //!< Time point of last spike emitted
};

template < typename targetidentifierT >
constexpr ConnectionModelProperties stochastic_stp_synapse< targetidentifierT >::properties;

/**
* Send an event to the receiver of this connection.
Expand Down

0 comments on commit 91eb990

Please sign in to comment.