/*
 *  test_weight_delay_free.sli
 *
 *  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/>.
 *
 */

% to be run before run_test.sli

% this tests checks if weights and delays can be set to
% arbitrary values within the limits set by resolution
%
% It creates a grid with a single row and uses linear functions for weights and delays
% Expected weights are 1., 0.98, 0.96, 0.94, 0.92, 0.90, 0.88, 0.86, 0.84, 0.82
% Expected delays with resolution 0.04 are 1.0 0.96 0.96 0.92 0.92 0.88 0.84

[ -4.5 4.5 1.0 ] Range
{ 0.0 2 arraystore } Map /pos Set

/layer << /positions pos
          /extent [10. 1.]
          /center [0. 0.]
          /edge_wrap true
          /elements /iaf_neuron
        >> def

/src_layer layer def
/tgt_layer layer def

/conns << /connection_type (divergent)
          /mask    << /rectangular << /lower_left [ -0.5 -0.5 ] /upper_right [ 9.5 0.5 ] >> >>
          /weights << /linear << /c 1.0 /a -0.02 >> >>
          /delays  << /linear << /c 1.0 /a -0.02 >> >>
       >> def

% required to make sure that resolution goes into userdict
userdict begin
  /resolution 0.04 def
end

