Package cern.jet.random.engine

Examples of cern.jet.random.engine.MersenneTwister


                               + num.format(chiSq(ids.count(id), expected)) + "\t"
                               + prct.format((ids.count(id) - expected) / expected));
            chiSq += chiSq(ids.count(id), expected);
        }
        System.out.println("X^2 = " + chiSq);
        ChiSquare dist = new ChiSquare(df, new MersenneTwister());
        // p-value is ~= prob of seeing this distribution from fair router
        double pValue = 1.0 - dist.cdf(chiSq);
        System.out.println("p-value = " + pValue);
        assertTrue("Non-uniform load distribution detected.", pValue >= 0.05);
    }
View Full Code Here


    public void intervalsComplete() {
        runSimulation();
    }

    protected void runSimulation() {
        u = new MersenneTwister();
        super.runSimulation();
    }
View Full Code Here

    }

    private static final boolean USE_RATIO = true;
    private void runSimulation() {
        long start = System.currentTimeMillis();
        RandomEngine random = new MersenneTwister();

        int sampleCount = Settings.getInt("ev.simulationSize", BOOTSTRAP_SIZE);
        if (USE_RATIO && indivDates == null) {
            double factor = Math.exp(0.75 * Math.log(randomObjects.size()));
            sampleCount = (int) (sampleCount / factor);
View Full Code Here

        rational = Math.sqrt((s*s*(1 + (s*s/2))) / n);
        base = logmean + s*s/2;
    }

    private double[] generateBootstrapSamples() {
        RandomEngine u = new MersenneTwister();
        Normal normal = new Normal(0, 1, u);
        ChiSquare chisquare = new ChiSquare(numSamples-1, u);
        int bootstrapSize = Settings.getInt("logCI.bootstrapSize", 2000);
        double[] samples = new double[bootstrapSize];
        for (int i = bootstrapSize;   i-- > 0; )
View Full Code Here

    }
    // LOGGING ->

    this.seed = seed;
    generators = new HashMap<String, RandomEngine>();
    generators.put(null, new MersenneTwister(seed));
   
    distributions = new HashMap<String, AbstractDistribution>();

    if (logger.isDebugEnabled()) {
      distributions.put(UNIFORM_DEFAULT, new UUniformDistributionController(generators.get(null)));
View Full Code Here

        + " and invalidate all distributions and general generator!");
    // LOGGING ->

    this.seed = seed;
    invalidateDistributions();
    generators.put(null, new MersenneTwister(seed));
    if (logger.isDebugEnabled()) {
      distributions.put(UNIFORM_DEFAULT, new UUniformDistributionController(generators.get(null)));
    } else {
      distributions.put(UNIFORM_DEFAULT, new Uniform(generators.get(null)));
    }
View Full Code Here

    if(!(argForward > 0 && argForward < 1) || !(argBackward > 0 && argBackward <= 1))
      throw new IllegalArgumentException("invalid scopes for backwards or forwards");
    visited = new HashSet<DeterministicVertex>();
    machine = new DirectedSparseGraph();
    vertices = new ArrayList<DeterministicVertex>();
    generator  = new MersenneTwister(seed);
    boolGenerator = new Random(seed);
    synchronized(AbstractLearnerGraph.syncObj)
    {
      DeterministicVertex v=new DeterministicVertex(new VertexID(VertexID.VertKind.NEUTRAL,0));
      annotateVertex(v);
View Full Code Here

    if(!(argForward > 0 && argForward < 1) || !(argBackward > 0 && argBackward <= 1))
      throw new IllegalArgumentException("invalid scopes for backwards or forwards");
    visited = new HashSet<CmpVertex>();
    machine = new LearnerGraphND(Configuration.getDefaultConfiguration().copy());
    vertices = new ArrayList<CmpVertex>();
    generator  = new MersenneTwister(seed);
    this.alphabet = alphabetArg;
    boolGenerator = new Random(seed);
    CmpVertex v= AbstractLearnerGraph.generateNewCmpVertex(new VertexID(VertexID.VertKind.NEUTRAL,0), Configuration.getDefaultConfiguration())//new ();
    annotateVertex(v);
    vertices.add(v);// permits v to be chosen as a target, creating self-loops
View Full Code Here

    if(!(argForward > 0 && argForward < 1) || !(argBackward > 0 && argBackward <= 1))
      throw new IllegalArgumentException("invalid scopes for backwards or forwards");
    visited = new HashSet<CmpVertex>();
    machine = new LearnerGraphND(Configuration.getDefaultConfiguration());
    vertices = new ArrayList<CmpVertex>();
    generator  = new MersenneTwister(seed);
    this.alphabet = alphabet;
    boolGenerator = new Random(seed);
    CmpVertex v= AbstractLearnerGraph.generateNewCmpVertex(new VertexID(VertexID.VertKind.NEUTRAL,0), Configuration.getDefaultConfiguration())//new ();
    annotateVertex(v);
    vertices.add(v);// permits v to be chosen as a target, creating self-loops
View Full Code Here

    if(!(argForward > 0 && argForward < 1) || !(argBackward > 0 && argBackward <= 1))
      throw new IllegalArgumentException("invalid scopes for backwards or forwards");
    visited = new HashSet<DeterministicVertex>();
    machine = new DirectedSparseGraph();
    vertices = new ArrayList<DeterministicVertex>();
    generator  = new MersenneTwister(seed);
    boolGenerator = new Random(seed);
    DeterministicVertex v=new DeterministicVertex(new VertexID(VertexID.VertKind.NEUTRAL,0));
    annotateVertex(v);
    machine.addVertex(v);
    vertices.add(v);// permits v to be chosen as a target, creating self-loops
View Full Code Here

TOP

Related Classes of cern.jet.random.engine.MersenneTwister

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.