1/* 2 * ticket-673.sli 3 * 4 * This file is part of NEST. 5 * 6 * Copyright (C) 2004 The NEST Initiative 7 * 8 * NEST is free software: you can redistribute it and/or modify 9 * it under the terms of the GNU General Public License as published by 10 * the Free Software Foundation, either version 2 of the License, or 11 * (at your option) any later version. 12 * 13 * NEST is distributed in the hope that it will be useful, 14 * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 * GNU General Public License for more details. 17 * 18 * You should have received a copy of the GNU General Public License 19 * along with NEST. If not, see <http://www.gnu.org/licenses/>. 20 * 21 */ 22 23/** @BeginDocumentation 24 25Name: testsuite::ticket-673 - Precise models are inconsistent with 26respect to whether 1 time step is an acceptable refractory time 27 28Synopsis: (ticket-673) run -> NEST exits if test fails 29 30Description: 31Test whether precise models can handle t_ref==simulation resolution 32 33Author: Susanne Kunkel, 2013-01-23 34 */ 35 36(unittest) run 37/unittest using 38 39M_ERROR setverbosity 40 41% model t_ref run_sim -> time of 2nd spike 42/run_sim 43{ 44 /tref Set 45 ResetKernel 46 << /resolution 0.1 >> SetKernelStatus 47 << /I_e 1000. /t_ref tref >> Create /n Set 48 /spike_recorder Create /sr Set 49 n sr Connect 50 20. Simulate 51 sr /events get /times get 1 get 52} 53def 54 55/models [ 56 /iaf_psc_alpha_ps 57 /iaf_psc_delta_ps 58 /iaf_psc_exp_ps 59] def 60 61% for all models: 62% run the simulation with t_ref=1.0 ms 63% run the simulation with t_ref=0.1 ms 64% check that the second spike is shifted by 0.9 ms 65/dt 1.0 0.1 sub def 66{ 67 models { dup 1.0 run_sim exch 0.1 run_sim sub dt sub abs 1e-15 leq } Map 68 true exch { and } Fold 69} assert_or_die 70 71endusing 72