-
Notifications
You must be signed in to change notification settings - Fork 6
/
stdp_connection_alpha.cpp
101 lines (86 loc) · 2.56 KB
/
stdp_connection_alpha.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
/*
* stdp_connection_alpha.cpp
*
* This file is part of NEST.
*
* Copyright (C) 2004 The NEST Initiative
*
* NEST is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* NEST is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with NEST. If not, see <http://www.gnu.org/licenses/>.
*
*/
/*
Alberto Antonietti
Cerebellar PF-PC Plasticity with an exp. sin. Kernel LTP and LTD
*/
#include "stdp_connection_alpha.h"
// Includes from nestkernel:
#include "common_synapse_properties.h"
#include "connector_model.h"
#include "event.h"
#include "kernel_manager.h"
// Includes from sli:
#include "dictdatum.h"
namespace mynest
{
//
// Implementation of class STDPAlphaCommonProperties.
//
STDPAlphaCommonProperties::STDPAlphaCommonProperties()
: nest::CommonSynapseProperties()
, A_plus_( 1.0 )
, A_minus_( 1.5 )
, Wmin_( 0.0 )
, Wmax_( 200.0 )
, vtC_ ( 0 )
{
}
void
STDPAlphaCommonProperties::get_status( DictionaryDatum& d ) const
{
nest::CommonSynapseProperties::get_status( d );
if ( vtC_ != 0 )
{
def< long >( d, nest::names::vt, vtC_->get_gid() );
}
else
{
def< long >( d, nest::names::vt, -1 );
}
def< double >( d, nest::names::A_plus, A_plus_ );
def< double >( d, nest::names::A_minus, A_minus_ );
def< double >( d, nest::names::Wmin, Wmin_ );
def< double >( d, nest::names::Wmax, Wmax_ );
}
void
STDPAlphaCommonProperties::set_status( const DictionaryDatum& d,
nest::ConnectorModel& cm )
{
nest::CommonSynapseProperties::set_status( d, cm );
long vtgid;
if ( updateValue< long >( d, nest::names::vt, vtgid ) )
{
vtC_ = dynamic_cast< volume_transmitter_alberto* >( nest::kernel().node_manager.get_node(
vtgid, nest::kernel().vp_manager.get_thread_id() ) );
if ( vtC_ == 0 )
{
throw nest::BadProperty( "Dopamine source must be volume transmitter" );
}
}
updateValue< double >( d, nest::names::A_plus, A_plus_ );
updateValue< double >( d, nest::names::A_minus, A_minus_ );
updateValue< double >( d, nest::names::Wmin, Wmin_ );
updateValue< double >( d, nest::names::Wmax, Wmax_ );
}
} // End of namespace mynest