/*
 *  correlospinmatrix_detector.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/>.
 *
 */


/* simple example of usage for the
   correlospinmatrix detector
*/

modeldict begin

/sg1 /spike_generator Create def
/sg2 /spike_generator Create def
/sg3 /spike_generator Create def

/csd /correlospinmatrix_detector Create def
/sd /spike_detector << /to_screen true >> Create def

csd << /N_channels 3 /tau_max 10. /delta_tau 1.0 >> SetStatus

sg1 << /spike_times [10. 10. 16.] >> SetStatus  % binary pulse starting at 10. ending at 16.
sg2 << /spike_times [15. 15. 20.] >> SetStatus  % binary pulse starting at 15. ending at 20.

sg1 GetStatus info

sg1 sd << /receptor_type 0 >> Connect

% one final event needed so that last down transition will be detected
sg3 << /spike_times [25.] >> SetStatus


sg1 csd << /receptor_type 0 >> Connect
sg2 csd << /receptor_type 1 >> Connect
sg3 csd << /receptor_type 2 >> Connect

100. Simulate

csd GetStatus /count_covariance get ==

modeldict end
