/*
* test_random.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/>.
*
*/
/* BeginDocumentation
Name: testsuite::test_random - test use of random number distributions
Synopsis: (test_random.sli) run -> dies if assertion fails
Description:
The script shows the sequence of creating and seeding a random number generator,
creating specific random number distributions, and finally the drawing random numbers.
This is primarily a test of the syntax.
Author: Diesmann
FirstVersion: 100918
*/
/unittest (6688) require
/unittest using
{
rngdict /knuthlfg get 123456789 CreateRNG /rng Set
rng rdevdict /binomial get CreateRDV /bino Set
bino << /p 0.2 /n 10 >> SetStatus
rng rdevdict /normal get CreateRDV /gauss Set
bino 100000 RandomArray Mean 2.0 sub abs 1e-2 lt
gauss 100000 RandomArray Mean abs 1e-2 lt
and
}
assert_or_die