| Overview | Group | Tree | Graph | Deprecated | Index | Concepts |

You can use objects of this class to create a search with a random element. You can create any number of instances of this class; these instances ensure reproducible results in multithreaded applications, where the use of a single source for random numbers creates problems.
| Method Summary | |
|---|---|
public void | end() |
public IloEnv | getEnv() const |
public IloNum | getFloat() const |
public IloRandomI * | getImpl() const |
public IloInt | getInt(IloInt n) const |
public const char * | getName() const |
public IloAny | getObject() const |
public | IloRandom() |
public | IloRandom(const IloEnv env, IloInt seed=0) |
public | IloRandom(IloRandomI * impl) |
public | IloRandom(const IloRandom & rand) |
public void | reSeed(IloInt seed) |
public void | setLocation(const char * fileName, int lineNumber) const |
public void | setName(const char * name) const |
public void | setObject(IloAny obj) const |
| Method Detail |
|---|
This constructor creates a random number generator; it is initially an empty handle. You must assign this handle before you use its member functions.
This constructor creates an object that generates random numbers. You can seed the
generator by supplying a value for the integer argument seed.
This constructor creates a handle object (an instance of the class
IloRandom) from a pointer to an implementation object (an instance of the
class IloRandomI).
This constructor creates a handle object from a reference to a random number
generator. After execution, both the newly constructed handle and rand
point to the same implementation object.
This member function releases all memory used by the random number generator. After a call to this member function, you should not use the generator again.
This member function returns the environment associated with the implementation class of the invoking generator.
This member function returns a floating-point number drawn uniformly from the
interval [0..1).
This member function returns the implementation object of the invoking handle.
This member function returns an integer drawn uniformly from the interval
[0..n).
This member function returns a character string specifying the name of the invoking object (if there is one).
This member function returns the object associated with the invoking object (if there is one). Normally, an associated object contains user data pertinent to the invoking object.
This member function re-seeds the random number generator with seed.
This member function stores the source code location (as a file name and line number) in the invoking object. Recommended arguments are the macros __FILE__ and __LINE__. The supplied location can be used for debugging. In particular CP Optimizer may include the location in error messages and in model dumps.
Note that the string pointed to by fileName argument is not copied. Therefore the pointer must be valid during the whole lifespan of the object.
Instead of using this function directly, it may be simpler to use macros
ILOSETLOCATION and
ILOADD.
This member function assigns name
to the invoking object.
When called on an already extracted extractable, notifications will be sent to the engine. When possible, this method should be called before the model is extracted.
This member function associates obj with the
invoking object. The member function getObject accesses
this associated object afterward. Normally, obj contains
user data pertinent to the invoking object.