View Javadoc
1   /*
2    * Licensed to the Apache Software Foundation (ASF) under one or more
3    * contributor license agreements.  See the NOTICE file distributed with
4    * this work for additional information regarding copyright ownership.
5    * The ASF licenses this file to You under the Apache License, Version 2.0
6    * (the "License"); you may not use this file except in compliance with
7    * the License.  You may obtain a copy of the License at
8    *
9    *      http://www.apache.org/licenses/LICENSE-2.0
10   *
11   * Unless required by applicable law or agreed to in writing, software
12   * distributed under the License is distributed on an "AS IS" BASIS,
13   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14   * See the License for the specific language governing permissions and
15   * limitations under the License.
16   */
17  package org.apache.commons.rng.examples.stress;
18  
19  import java.util.List;
20  import java.util.ArrayList;
21  import java.util.Iterator;
22  
23  import org.apache.commons.rng.UniformRandomProvider;
24  import org.apache.commons.rng.simple.RandomSource;
25  
26  /**
27   * List of generators.
28   */
29  public class GeneratorsList implements Iterable<UniformRandomProvider> {
30      /** List. */
31      private final List<UniformRandomProvider> list = new ArrayList<UniformRandomProvider>();
32  
33      /**
34       * Creates list.
35       */
36      public GeneratorsList() {
37          list.add(RandomSource.create(RandomSource.JDK));
38          list.add(RandomSource.create(RandomSource.MT));
39          list.add(RandomSource.create(RandomSource.WELL_512_A));
40          list.add(RandomSource.create(RandomSource.WELL_1024_A));
41          list.add(RandomSource.create(RandomSource.WELL_19937_A));
42          list.add(RandomSource.create(RandomSource.WELL_19937_C));
43          list.add(RandomSource.create(RandomSource.WELL_44497_A));
44          list.add(RandomSource.create(RandomSource.WELL_44497_B));
45          list.add(RandomSource.create(RandomSource.ISAAC));
46          list.add(RandomSource.create(RandomSource.MT_64));
47          list.add(RandomSource.create(RandomSource.SPLIT_MIX_64));
48          list.add(RandomSource.create(RandomSource.XOR_SHIFT_1024_S));
49          list.add(RandomSource.create(RandomSource.TWO_CMRES));
50          list.add(RandomSource.create(RandomSource.MWC_256));
51          list.add(RandomSource.create(RandomSource.KISS));
52      }
53  
54      /** {@inheritDoc} */
55      @Override
56      public Iterator<UniformRandomProvider> iterator() {
57          return list.iterator();
58      }
59  }