Le lun. 31 mai 2021 à 02:07, Gilles Sadowski <[email protected]> a écrit :
>
> Hello.
>
> Halton and Sobol sequences have been implemented in the "random"
> package. From Wikipedia[1]:
> ---CUT---
> Low-discrepancy sequences are also called quasirandom sequences,
> due to their common use as a replacement of uniformly distributed
> random numbers. The "quasi" modifier is used to denote more clearly
> that the values of a low-discrepancy sequence are neither random nor
> pseudorandom.
> ---CUT---
>
> TL;DR;
> I propose to create an interface "LowDiscrepancySequence" to properly
> represents the concept (as opposed to "RandomVectorGenerator").
In current "master", interface "RandomVectorGenerator" is not used
anymore; I'll remove it.
The new (untested) API would be:
---CUT---
public interface LowDiscrepancySequence extends Supplier<double[]> {
/**
* Creates a copy of the LowDiscrepancySequence and then advances
* the state of the current instance. The copy is returned.
*
* @param jump How far to jump from the current state.
* @return a copy of this instance.
*/
LowDiscrepancySequence jump(int jump);
}
public class SobolSequence implements LowDiscrepancySequence { /* ... */ }
public class HaltonSequence implements LowDiscrepancySequence { /* ... */ }
---CUT---
TBD (through reading about the subject): Is this interface common to
all such algorithms? [Is "jump" always defined? Should its argument
rather be a "long"?]
>From an usage POV, I don't see the purpose of the "skipTo" and
"getNextIndex" methods.
By the way, Javadoc for "skipTo" mandates that the arg be positive,
but no check is performed; and the code produces a result (expected
or not?).
Another improvement for "SobolGenerator" would be to move the IO
to a factory/builder class (that would also cache the data it reads from
the "resource" file).
Regards,
Gilles
>
> [1] https://en.wikipedia.org/wiki/Low-discrepancy_sequence
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]