@Namespace(value="ale::stella") @NoOffset @Properties(inherit=ale.class) public class Random extends Pointer
Pointer.CustomDeallocator, Pointer.Deallocator, Pointer.NativeDeallocator, Pointer.ReferenceCounter
Constructor and Description |
---|
Random()
Create a new random number generator
|
Random(long size)
Native array allocator.
|
Random(Pointer p)
Pointer cast constructor.
|
Modifier and Type | Method and Description |
---|---|
Random |
getPointer(long i) |
boolean |
loadState(Deserializer in)
Deserializes the RNG state.
|
int |
next()
Answer the next random number from the random number generator
|
double |
nextDouble()
Answer the next random number between 0 and 1 from the random number generator
|
Random |
position(long position) |
boolean |
saveState(Serializer out)
Serializes the RNG state.
|
void |
seed(int value)
Class method which allows you to set the seed that'll be used
for created new instances of this class
|
address, asBuffer, asByteBuffer, availablePhysicalBytes, calloc, capacity, capacity, close, deallocate, deallocate, deallocateReferences, deallocator, deallocator, equals, fill, formatBytes, free, getDirectBufferAddress, getPointer, getPointer, getPointer, hashCode, interruptDeallocatorThread, isNull, isNull, limit, limit, malloc, maxBytes, maxPhysicalBytes, memchr, memcmp, memcpy, memmove, memset, offsetAddress, offsetof, offsetof, parseBytes, physicalBytes, physicalBytesInaccurate, position, put, realloc, referenceCount, releaseReference, retainReference, setNull, sizeof, sizeof, toString, totalBytes, totalCount, totalPhysicalBytes, withDeallocator, zero
public Random(Pointer p)
Pointer(Pointer)
.public Random(long size)
Pointer.position(long)
.public Random()
public Random getPointer(long i)
getPointer
in class Pointer
public void seed(@Cast(value="uint32_t") int value)
value
- The value to seed the random number generator with@Cast(value="uint32_t") public int next()
public double nextDouble()
@Cast(value="bool") public boolean saveState(@ByRef Serializer out)
@Cast(value="bool") public boolean loadState(@ByRef Deserializer in)
Copyright © 2022. All rights reserved.