Function PGASetRandomDeterministic
Defined in File random.c
Function Documentation
-
void PGASetRandomDeterministic(PGAContext *ctx, int flag)
Set flag that a deterministic random seed should be used in parallel processes.
Description
By default each parallel MPI process uses its own random number generator. So when using random numbers in evaluation or hillclimbing the random numbers we get are not reproduceable because it is a stochastic process which parallel process evaluates which individual. When this function is called we set a flag that uses a second random number generator which is deterministically re-seeded from the rank-0 process for each evaluation. The net effect is that hillclimbing runs (or evaluations that depend on random numbers) can be made deterministic (when using the PGAPack random number generator) when running again with the same random seed.
Example
PGAContext *ctx; ... PGASetRandomDeterministic (ctx, PGA_TRUE);
- Parameters:
ctx – context variable
flag – boolean flag
- Returns:
None