Class EmgRandomGenerator

java.lang.Object
org.eclipse.epsilon.emg.random.EmgRandomGenerator
All Implemented Interfaces:
org.apache.commons.math3.random.RandomGenerator, IEmgRandomGenerator<IEmgRandomGenerator.DefaultCharacterSet>

public class EmgRandomGenerator extends Object implements IEmgRandomGenerator<IEmgRandomGenerator.DefaultCharacterSet>
The simplest implementation of the RandomAttributeGenerator interface. All attributes are generated as strings. It is the responsibility of the calling class/method to do the appropriate conversion. This classes uses the Apache Commons Math RandomDataGenerator.
  • Nested Class Summary

    Nested classes/interfaces inherited from interface org.eclipse.epsilon.emg.random.IEmgRandomGenerator

    IEmgRandomGenerator.DefaultCharacterSet, IEmgRandomGenerator.Distribution
  • Constructor Summary

    Constructors
    Constructor
    Description
    Instantiates a new emg random generator.
    EmgRandomGenerator(IEolContext context, long seed)
    Instantiates a new emg random generator.
  • Method Summary

    Modifier and Type
    Method
    Description
    org.apache.commons.math3.random.RandomDataGenerator
     
    getIndex(String listID, int size, Map<String,List<Integer>> sampleList)
     
    protected List<String>
    Gets the values from list.
    nextAddTo(int n, int m)
    Returns an array of n integers that addvar to m.
    double
    nextBinomialValue(int numberOfTrials, double probabilityOfSuccess)
    Generates a random value from the Binomial Distribution.
    boolean
     
    void
    nextBytes(byte[] bytes)
     
    nextCamelCaseString(int length, int minWordLength)
    Generates a random string of the given length using the specified character set formatted in CameCase format.
    nextCapitalisedString(String charSet, int length)
    Next capitalised string.
    double
    nextDobule(double upper)
    Returns a pseudorandom, uniformly distributed double value between 0 (inclusive) and the specified value (exclusive), drawn from this random attribute generator's sequence.
    double
    nextDobule(double lower, double upper)
    Returns a pseudorandom, uniformly distributed double value between lower and upper (endpoints included), drawn from this random attribute generator's sequence.
    double
     
    double
    nextExponentialValue(double mean)
    Generates a random value from the Exponential Distribution.
    float
     
    Returns a single object selected randomly from the Collection c using a uniform distribution.
    The listID must be the name of a parameter in the launch configuration.
    The listID must be the name of a parameter in the launch configuration.
    double
     
    nextHttpURI(boolean addPort, boolean addPath, boolean addQuery, boolean addFragment)
    Generates a random URI that complies to: http:[//host[:port]][/]path[?query][#fragment] The scheme is The host is generated from a random string and uses a top-level domain.
    int
     
    int
    nextInt(int n)
     
    int
    nextInteger(int upper)
    Returns a pseudorandom, uniformly distributed int value between 0 (inclusive) and the specified value (exclusive), drawn from this random attribute generator's sequence.
    int
    nextInteger(int lower, int upper)
    Returns a pseudorandom, uniformly distributed int value between lower and upper (endpoints included), drawn from this random attribute generator's sequence.
    long
     
    long
    nextLong(long upper)
    Returns a pseudorandom, uniformly distributed long value between 0 (inclusive) and the specified value (exclusive), drawn from this random attribute generator's sequence.
    long
    nextLong(long lower, long upper)
    Returns a pseudorandom, uniformly distributed long value between lower and upper (endpoints included), drawn from this random attribute generator's sequence.
    nextSample(String listID, int k)
    The listID must be the name of a parameter in the launch configuration.
    nextSample(Collection<?> c, int k)
    Returns an array of k objects selected randomly from the Collection c using a uniform distribution.
    nextString(String charSet, int length)
    Generates a random string of the given length using the specified character set.
    Generates a random URI.
    nextURI(boolean addPort, boolean addPath, boolean addQuery, boolean addFragment)
    Generates a random URI that complies to: scheme:[//[user:password@]host[:port]][/]path[?query][#fragment] The scheme is randomly selected from: http, ssh and ftp.
    double
    Returns the next pseudorandom, value from this random attribute generator's sequence.
    void
    setSeed(int seed)
     
    void
    setSeed(int[] seed)
     
    void
    setSeed(long seed)
     
    void
    useBinomialDistribution(int numberOfTrials, double probabilityOfSuccess)
    Use binomial distribution.
    void
    Use exponential distribution.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait