NlpTools API
Class

NlpTools\Random\Generators\FromFile

class FromFile implements GeneratorInterface

Return floats from a file.

A useful generator for debugging algorithms
with random numbers from different platforms or different generation
algorithms.

Methods

__construct(string $f)

Construct a FromFile generator

float generate()

Generates a pseudo-random number with uniform distribution in the interval [0,1)

Details

at line 18
public __construct(string $f)

Construct a FromFile generator

Parameters

string $f A file name to read from

at line 32
public float generate()

Generates a pseudo-random number with uniform distribution in the interval [0,1)

Return Value

float A random float in the range (0,1)