Пример #1
0
int Random<T_PRNG>::Rand(const char* const src_name, const unsigned src_line, const unsigned obj_id, const int max)
{
    history_[numInvocations_ % history_.size()] = RandomEntry(numInvocations_, max, rng_, src_name, src_line, obj_id);
    ++numInvocations_;

    return calcRandValue(rng_, max);
}
Пример #2
0
/**
 *  Erzeugt eine Zufallszahl.
 *
 *  @param[in] max @p max-1 ist die maximale Zufallszahl welche geliefert werden soll.
 *
 *  @return liefert eine Zufallszahl.
 *
 *  @author OLiver
 */
int Random::Rand(const char* const src_name, const unsigned src_line, const unsigned obj_id, const int max)
{
    rngState_ = GetNextState(rngState_, max);

    async_log[counter % async_log.size()] = RandomEntry(counter, max, rngState_, src_name, src_line, obj_id);
    ++counter;

    return GetValueFromState(rngState_, max);
}