[
https://issues.apache.org/jira/browse/RNG-127?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17314820#comment-17314820
]
Alex Herbert commented on RNG-127:
----------------------------------
{quote}Do you propose that we have...
{quote}
This ticket is used to track future implications of the functionality that will
be created in the JDK. The functionality is not yet fixed as it is scheduled
for an EA (Early Access) release that can be subject to change.
>From an overview of the API it would appear that extending the primary
>interface would be compatible:
{code:java}
UniformRandomProvider extends RandomGenerator
{code}
However extending the other interfaces for jumping is a change in functionality
to include the separation of copy and jump and to allow returning a generator
at the same functional level regarding jump lengths.
The current Commons RNG API for jumping is designed with the intention that a
jumpable RNG is a generator of RNGs. This is functionally similar to an
infinite stream provided by the JDK API (but without all the associated
functionality of streams).
{quote}Backport which functionality?
{quote}
Anything useful...
The jump and leap API has a method to obtain the distance moved along the
period of the generator.
There is also a RandomGeneratorFactory class that is used to create
RandomGenerators. This loads available algorithms using a service provider API.
All available factories can be streamed and interrogated for their
functionality for example the size of the period and their number of bits of
state. This is information added to the Javadoc of some of the commons RNG
implementations but it is not available at runtime.
The ability to interrogate the RNG properties at runtime is important when
dynamically loading RNGs. However when using a static library such as Commons
RNG the decisions on which RNG to use are (mostly) made at compile time. In
this case the provision of information on the RNG at runtime is less important.
> Assess future compatibility with JEP 356: Enhanced Pseudo-Random Number
> Generators
> -----------------------------------------------------------------------------------
>
> Key: RNG-127
> URL: https://issues.apache.org/jira/browse/RNG-127
> Project: Commons RNG
> Issue Type: Task
> Components: client-api
> Affects Versions: 1.3
> Reporter: Alex Herbert
> Priority: Minor
>
> JEP 356 specifies an enhancement to the random number generators. This is
> targeted to JDK 17.
> [JEP 356: Enhanced Pseudo-Random Number
> Generators|https://openjdk.java.net/jeps/356]
> The enhancement will add interfaces to the JDK for random number generation:
> * SplittableRandomGenerator extends RandomGenerator and also provides
> methods named split and splits. Splittability allows the user to spawn a new
> RandomGenerator from an existing RandomGenerator that will generally produce
> statistically independent results.
> * JumpableRandomGenerator extends RandomGenerator and also provides
> methods named jump and jumps. Jumpability allows a user to jump ahead a
> moderate number of draws.
> * LeapableRandomGenerator extends RandomGenerator and also provides
> methods named leap and leaps. Leapability allows a user to jump ahead a
> large number of draws.
> * ArbitrarilyJumpableRandomGenerator extends LeapableRandomGenerator and
> also provides additional variations of jump and jumps that allow an arbitrary
> jump distance to be specified.
> The specification describes the development of abstract classes that would
> allow different algorithms to be easily implemented by developers and used
> with a Java application through a common interface. This would replicate the
> functionality of the Common RNG API and core modules within the JDK.
> The JDK interfaces should be compared with the current client API in Commons
> RNG with the aim to assess:
> # Compatibility
> # Potential to back-port functionality
> JEP 356 also mentions the implementation of the LXM family of RNGs and a
> change to the algorithm used by SplittableRandom to address two weaknesses
> identified in 2016. These could be included in the current codebase pending
> license compatibility checks.
>
--
This message was sent by Atlassian Jira
(v8.3.4#803005)