/*
 *  test_event_proxies_issue-696_sender.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/>.
 *
 */

(unittest) run
/unittest using

statusdict/have_music :: not { exit_test_gracefully } if

M_ERROR setverbosity

10 /N_THREADS Set
11 /N_NEURONS Set

0 << /local_num_threads N_THREADS /resolution 0.1 >> SetStatus

/subnet Create /SNG Set
SNG ChangeSubnet
/spike_generator N_NEURONS Create pop
0 ChangeSubnet
SNG GetGlobalNodes /generators Set

/subnet Create /PNG Set
PNG ChangeSubnet
/parrot_neuron N_NEURONS Create pop
0 ChangeSubnet
PNG GetGlobalNodes /neurons Set
generators
{
    /i Set /sg Set
    sg << /spike_times [0.1 0.2 0.3] >> SetStatus
    sg neurons i get << /delay 0.1 >> Connect
}
forallindexed

/music_event_out_proxy Create /meop Set
meop << /port_name (out) >> SetStatus

neurons
{
    /channel Set
    /n Set
    n meop << /music_channel channel >> Connect
}
forallindexed

1 Simulate
