Skip to content

Commit

Permalink
Merge branch 'master' into parrot-multiport
Browse files Browse the repository at this point in the history
* master:
  Import GetStatus/SetStatus from the info component, where they were moved in a3ec4d4.
  Fix the stop condition of process_static_analysis.
  Added explanation for recursive import code.
  Moved Get/SetStatus from node to info component of HL API.
  Added information on steps to execute after creating the release tarball.
  Validate parameter values in setters of tsodyks synapses
  Added empty __init__.py to make the lib directory a module.
  Split Python high-level API into multiple files and made loading of the submodules dynamic
  Tsodyks synapse model with common properties
  • Loading branch information
seeholza committed Nov 3, 2015
2 parents 1ffea5e + 5c6535f commit 3d8da20
Show file tree
Hide file tree
Showing 23 changed files with 2,239 additions and 1,565 deletions.
9 changes: 9 additions & 0 deletions extras/create_release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -106,3 +106,12 @@ rm -rf $nest_blddir
echo ""
echo "Done."
echo ""

if ( "$tag" != "" ) then
echo "Now, please do the following:"
echo " * Update the version number and release date on Wikipedia:"
echo " https://en.wikipedia.org/wiki/NEST_%28software%29"
echo " * Add the release notes and tarball to the release on GitHub:"
echo " https://github.com/nest/nest-simulator/releases/tag/$tag"
echo ""
endif
2 changes: 1 addition & 1 deletion extras/parse_travis_log.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ def process_static_analysis(f, line):
if line.startswith('+echo Static analysis on file '):
return res

if line.startswith('+format_error_files='):
if line.startswith('+rm -rf ./cppcheck'):
return res

if line.startswith(' - vera++ for '):
Expand Down
1 change: 1 addition & 0 deletions models/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ libmodelsmodule_la_SOURCES= \
step_current_generator.h step_current_generator.cpp\
tsodyks2_connection.h\
tsodyks_connection.h\
tsodyks_connection_hom.h tsodyks_connection_hom.cpp\
volume_transmitter.h volume_transmitter.cpp\
spike_dilutor.h spike_dilutor.cpp

Expand Down
11 changes: 11 additions & 0 deletions models/modelsmodule.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@
#include "cont_delay_connection.h"
#include "cont_delay_connection_impl.h"
#include "tsodyks_connection.h"
#include "tsodyks_connection_hom.h"
#include "tsodyks2_connection.h"
#include "quantal_stp_connection.h"
#include "quantal_stp_connection_impl.h"
Expand Down Expand Up @@ -396,6 +397,16 @@ ModelsModule::init( SLIInterpreter* )
net_, "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
*/
register_connection_model< TsodyksConnectionHom< TargetIdentifierPtrRport > >(
net_, "tsodyks_synapse_hom" );
register_connection_model< TsodyksConnectionHom< TargetIdentifierIndex > >(
net_, "tsodyks_synapse_hom_hpc" );


/* BeginDocumentation
Name: tsodyks2_synapse_hpc - Variant of tsodyks2_synapse with low memory consumption.
SeeAlso: synapsedict, tsodyks2_synapse, static_synapse_hpc
Expand Down
12 changes: 12 additions & 0 deletions models/tsodyks2_connection.h
Original file line number Diff line number Diff line change
Expand Up @@ -255,9 +255,21 @@ Tsodyks2Connection< targetidentifierT >::set_status( const DictionaryDatum& d, C
updateValue< double_t >( d, names::weight, weight_ );

updateValue< double_t >( d, names::dU, U_ );
if ( U_ > 1.0 || U_ < 0.0 )
throw BadProperty( "U must be in [0,1]." );

updateValue< double_t >( d, names::u, u_ );
if ( u_ > 1.0 || u_ < 0.0 )
throw BadProperty( "u must be in [0,1]." );

updateValue< double_t >( d, names::tau_rec, tau_rec_ );
if ( tau_rec_ <= 0.0 )
throw BadProperty( "tau_rec must be > 0." );

updateValue< double_t >( d, names::tau_fac, tau_fac_ );
if ( tau_fac_ < 0.0 )
throw BadProperty( "tau_fac must be >= 0." );

updateValue< double_t >( d, names::x, x_ );
}

Expand Down
13 changes: 11 additions & 2 deletions models/tsodyks_connection.h
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,6 @@ TsodyksConnection< targetidentifierT >::send( Event& e,
double_t Pyy = std::exp( -h / tau_psc_ );
double_t Pzz = std::exp( -h / tau_rec_ );

// double_t Pzy = (Pyy - Pzz) * tau_rec_ / (tau_psc_ - tau_rec_);
double_t Pxy = ( ( Pzz - 1.0 ) * tau_rec_ - ( Pyy - 1.0 ) * tau_psc_ ) / ( tau_psc_ - tau_rec_ );
double_t Pxz = 1.0 - Pzz;

Expand All @@ -231,7 +230,6 @@ TsodyksConnection< targetidentifierT >::send( Event& e,

u_ *= Puu;
x_ += Pxy * y_ + Pxz * z;
// z = Pzz * z_ + Pzy * y_;
y_ *= Pyy;

// delta function u
Expand Down Expand Up @@ -318,9 +316,20 @@ TsodyksConnection< targetidentifierT >::set_status( const DictionaryDatum& d, Co
updateValue< double_t >( d, names::weight, weight_ );

updateValue< double_t >( d, "U", U_ );
if ( U_ > 1.0 || U_ < 0.0 )
throw BadProperty( "U must be in [0,1]." );

updateValue< double_t >( d, "tau_psc", tau_psc_ );
if ( tau_psc_ <= 0.0 )
throw BadProperty( "tau_psc must be > 0." );

updateValue< double_t >( d, "tau_rec", tau_rec_ );
if ( tau_rec_ <= 0.0 )
throw BadProperty( "tau_rec must be > 0." );

updateValue< double_t >( d, "tau_fac", tau_fac_ );
if ( tau_fac_ < 0.0 )
throw BadProperty( "tau_fac must be >= 0." );

updateValue< double_t >( d, "u", u_ );
}
Expand Down
76 changes: 76 additions & 0 deletions models/tsodyks_connection_hom.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
/*
* tsodyks_connection_hom.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/>.
*
*/

#include "tsodyks_connection_hom.h"
#include "network.h"
#include "connector_model.h"

namespace nest
{

//
// Implementation of class TsodyksHomCommonProperties.
//

TsodyksHomCommonProperties::TsodyksHomCommonProperties()
: CommonPropertiesHomW()
, tau_psc_( 3.0 )
, tau_fac_( 0.0 )
, tau_rec_( 800.0 )
, U_( 0.5 )
{
}

void
TsodyksHomCommonProperties::get_status( DictionaryDatum& d ) const
{
CommonPropertiesHomW::get_status( d );

def< double_t >( d, "U", U_ );
def< double_t >( d, "tau_psc", tau_psc_ );
def< double_t >( d, "tau_rec", tau_rec_ );
def< double_t >( d, "tau_fac", tau_fac_ );
}

void
TsodyksHomCommonProperties::set_status( const DictionaryDatum& d, ConnectorModel& cm )
{
CommonPropertiesHomW::set_status( d, cm );

updateValue< double_t >( d, "U", U_ );
if ( U_ > 1.0 || U_ < 0.0 )
throw BadProperty( "U must be in [0,1]." );

updateValue< double_t >( d, "tau_psc", tau_psc_ );
if ( tau_psc_ <= 0.0 )
throw BadProperty( "tau_psc must be > 0." );

updateValue< double_t >( d, "tau_rec", tau_rec_ );
if ( tau_rec_ <= 0.0 )
throw BadProperty( "tau_rec must be > 0." );

updateValue< double_t >( d, "tau_fac", tau_fac_ );
if ( tau_fac_ < 0.0 )
throw BadProperty( "tau_fac must be >= 0." );
}

} // of namespace nest
Loading

0 comments on commit 3d8da20

Please sign in to comment.