Skip to content

Commit 5cd8a81

Browse files
committed
Added example
Not quite a worked example yet … #37
1 parent 1c671b9 commit 5cd8a81

File tree

2 files changed

+84
-0
lines changed

2 files changed

+84
-0
lines changed
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
/*
2+
* Copyright 1990-2008, Mark Little, University of Newcastle upon Tyne
3+
* and others contributors as indicated
4+
* by the @authors tag. All rights reserved.
5+
* See the copyright.txt in the distribution for a
6+
* full listing of individual contributors.
7+
* This copyrighted material is made available to anyone wishing to use,
8+
* modify, copy, or redistribute it subject to the terms and conditions
9+
* of the GNU Lesser General Public License, v. 2.1.
10+
* This program is distributed in the hope that it will be useful, but WITHOUT A
11+
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
12+
* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
13+
* You should have received a copy of the GNU Lesser General Public License,
14+
* v.2.1 along with this distribution; if not, write to the Free Software
15+
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
16+
* MA 02110-1301, USA.
17+
*
18+
* (C) 1990-2008,
19+
*/
20+
21+
package org.javasim.examples.stats;
22+
23+
import org.javasim.streams.NormalStream;
24+
import org.javasim.stats.Quantile;
25+
26+
public class Stats
27+
{
28+
public static void main (String[] args) throws Exception
29+
{
30+
NormalStream str = new NormalStream(100.0, 2.0);
31+
Quantile hist = new Quantile();
32+
33+
for (int i = 0; i < 20; i++)
34+
{
35+
hist.setValue(str.getNumber());
36+
}
37+
38+
System.out.println("NormalStream error: "+str.error());
39+
40+
hist.print();
41+
}
42+
}
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
/*
2+
* Copyright 1990-2008, Mark Little, University of Newcastle upon Tyne
3+
* and others contributors as indicated
4+
* by the @authors tag. All rights reserved.
5+
* See the copyright.txt in the distribution for a
6+
* full listing of individual contributors.
7+
* This copyrighted material is made available to anyone wishing to use,
8+
* modify, copy, or redistribute it subject to the terms and conditions
9+
* of the GNU Lesser General Public License, v. 2.1.
10+
* This program is distributed in the hope that it will be useful, but WITHOUT A
11+
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
12+
* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
13+
* You should have received a copy of the GNU Lesser General Public License,
14+
* v.2.1 along with this distribution; if not, write to the Free Software
15+
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
16+
* MA 02110-1301, USA.
17+
*
18+
* (C) 1990-2008,
19+
*/
20+
21+
package org.javasim.examples.stats;
22+
23+
import org.javasim.Simulation;
24+
25+
import org.junit.Test;
26+
27+
import static org.junit.Assert.*;
28+
29+
public class StatsExampleUnitTest
30+
{
31+
@Test
32+
public void test ()
33+
{
34+
try
35+
{
36+
Stats.main(null);
37+
}
38+
catch (final Throwable ex)
39+
{
40+
}
41+
}
42+
}

0 commit comments

Comments
 (0)