Class IBS
- All Implemented Interfaces:
CLOProvider
- Author:
- Christoph Hauert
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enum
Enumeration of possible events in focal population.static interface
Modules that offer individual based simulation models must implement this interface.static enum
Types of species updates (only relevant for multi-species models): none no migration D diffusive migration (exchange of neighbors) B birth-death migration (fit migrates, random death). d death-birth migration (random death, fit migrates).static enum
Schedules for resetting individual payoffs/fitness: onchange Reset when changing trait (only after updating from reference model with a different trait) onupdate Reset when updating from reference individual (not necessarily a change in trait) ephemeral Determine payoffs/fitness calculated only for updatingstatic class
The class managing the settings for statistics mode. -
Field Summary
FieldsModifier and TypeFieldDescriptionfinal CLOption
Command line option to set whether player scores from interactions are accumulated or averaged (default).final CLOption
Command line option to enable consistency checks.final CLOption
Command line option to set the fraction of links to add.final CLOption
Command line option to set the competition geometry.final CLOption
Command line option to set the interaction geometry.final CLOption
Command line option to set the fraction of links to rewire.final CLOption
Command line option to set whether players interact with all their neighbours or a random subsample.final CLOption
Command line option to set the migration types and probabilities of players.final CLOption
Command line option to set the method for choosing references/models among the neighbours of a player for updating their strategy.final CLOption
Command line option to set method for resetting the scores of individuals.(package private) IBSPopulation
Pointer to focal species for debugging.protected RNGDistribution.Geometric
Geometric (exponential) waiting time distribution for optimizations of homogeneous populations.protected RNGDistribution
The random number generator to display states with ephemeral payoffs.(package private) boolean
Flag to indicate whether the population updates are synchronous.private int
Index for turn-based-selection to determine which species to pick next.boolean
true
if optimizations for homogeneous populations requested.protected IBSPopulation
Short-cut tospecies.get(0).getIBSPopulation()
for single species models;null
in multi-species models.protected double
Keeps track of the elapsed time, taking into account the fitness of the population.Type of species update (multi-species models only).(package private) IBS.Statistics
The settings for statistics mode.Fields inherited from class Model
cloSamples, cloTimeRelax, cloTimeStep, cloTimeStop, connect, converged, engine, fixData, isMultispecies, isRelaxing, logger, mode, nSamples, nSpecies, nStatisticsFailed, nStatisticsSamples, rng, species, statisticsSampleNew, time, timeRelax, timeStep, timeStop, type
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
check()
Check consistency of parameters and adjust if necessary (and possible).void
collectCLO
(CLOParser parser) All providers of command line options must implement this method to collect their options.void
Perform single debug step in models that allow it.void
encodeState
(StringBuilder plist) Encode the state of the model in aplist
inspiredXML
string.Gets a formatted string summarizing the elapsed time.<T> void
getFitnessData
(int id, T[] colors, ColorMap.Gradient1D<T> colorMap) Translates fitness data into colors using ColorMapcolorMap
.void
getFitnessHistogramData
(int id, double[][] bins) Generates a histogram of fitness data and returns the result in the provided arraybins
.getFitnessNameAt
(int id, int idx) Gets the fitness at locationidx
for species with IDid
as a formatted string.(package private) IBSPopulation
getIBSPopulation
(int id) Helper routine to retrieve theIBSPopulation
associated with module withid
.void
getInitialTraits
(double[] init) Collect and return initial trait values for all species.void
getInitialTraits
(int id, double[] init) Return initial trait values for species with IDid
.int
getInteractionsAt
(int id, int idx) Gets the number of interactions at locationidx
for species with IDid
.double
getMaxFitness
(int id) Calculates and returns the absolute fitness maximum.double
getMaxScore
(int id) Returns the maximum score that individuals of species with IDid
can achieve in this model.boolean
getMeanFitness
(double[] mean) Gets the mean fitness values for traits in all species.boolean
getMeanFitness
(int id, double[] mean) Gets the mean fitness values for species with IDid
.boolean
getMeanTraits
(double[] mean) Collect and return mean trait values for all species.boolean
getMeanTraits
(int id, double[] mean) Return mean trait values for species with IDid
.double
getMinFitness
(int id) Calculates and returns the absolute fitness minimum.double
getMinScore
(int id) Returns the minimum score that individuals of species with IDid
can achieve in this model.int
getNMean()
Return the number of mean values for this model including all species (for traits or fitness).int
getNMean
(int id) Return the number of mean trait values for species with IDid
.double
Gets the elapsed time in real time units.getScoreNameAt
(int id, int idx) Gets the score at locationidx
for species with IDid
as a formatted string.Get species update type.Returns status message from model.getTagNameAt
(int id, int idx) Gets formatted tag of individual at locationidx
for species with IDid
.<T> void
getTraitData
(int id, T[] colors, ColorMap<T> colorMap) Gets the trait data for species with IDid
and translates them into colors using thecolorMap
.getTraitNameAt
(int id, int idx) Gets the formatted trait names at locationidx
for species with IDid
.boolean
ibsStep
(double stepDt) Advances the IBS model by a step of sizestepDt
.void
init()
Milestone: Initialize this modelvoid
init
(boolean soft) Initializes the IBS model.void
load()
Milestone: Load this model and allocate resources (if applicable).boolean
mouseHitNode
(int id, int hit, boolean alt) Used by GUI to interact with Model.boolean
next()
Advance model by one step.boolean
Checks if debugging single steps is supported.boolean
Check if the current model settings permit sample statistics.boolean
Check if the current model settings permit update statistics.protected IBS.Event
pickEvent
(IBSPopulation pop) Pick type of next event in focal population.Pick focal population according to the selected scheme.private IBSPopulation
pickFocalSpeciesFitness
(double wScoreTot) Pick species to update with a probability proportional to the total fitness of the species weighted by its update rate.private IBSPopulation
pickFocalSpeciesSize
(double wPopTot) Pick species to update with a probability proportional to the size of the species weighted by its update rate.private IBSPopulation
Pick species for sequential updates, i.e.double
random01()
Random number from interval [0, 1) with 32bit resolution.int
random0n
(int n) random integer number from interval[0, n)
.void
reset()
Milestone: Reset this modelboolean
restoreState
(Plist plist) Restore the state encoded in theplist
inspiredmap
ofkey, value
-pairs.void
unload()
Milestone: Unload this model and free resources (if applicable).void
update()
Update this model.Methods inherited from class Model
getFixationData, getLogger, getMeanFitnessAt, getMeanName, getMeanNames, getMeanTraitAt, getMode, getNextHalt, getNSamples, getNSpecies, getNStatisticsFailed, getNStatisticsSamples, getSpecies, getTime, getTimeRelax, getTimeStep, getTimeStop, getType, hasConverged, initStatisticsFailed, initStatisticsSample, isConnected, isContinuous, isDE, isIBS, isODE, isPDE, isRelaxing, isSDE, isTimeReversed, isType, permitsMode, permitsTimeReversal, readStatisticsSample, relax, requestMode, resetStatisticsSample, setInitialTraits, setInitialTraits, setMode, setNSamples, setTimeRelax, setTimeReversed, setTimeStep, setTimeStop, useScheduling
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface CLOProvider
adjustCLO
-
Field Details
-
ephrng
The random number generator to display states with ephemeral payoffs. In order to ensure reproducibility of results this cannot be the same random number generator as for running the simulations.- See Also:
-
distrMutation
Geometric (exponential) waiting time distribution for optimizations of homogeneous populations.- See Also:
-
population
Short-cut tospecies.get(0).getIBSPopulation()
for single species models;null
in multi-species models. Convenience field. -
realtime
protected double realtimeKeeps track of the elapsed time, taking into account the fitness of the population. For example, less time passes between reproductive events in populations with high fitness, while more time passes in low fitness populations because there are fewer reproduction events per unit time. If individual scores can be negativerealtime
is set toDouble#POSITIVE_INFINITY
to indicate that the measure is meaningless.Note: Requires non-negative individual scores.
-
optimizeHomo
public boolean optimizeHomotrue
if optimizations for homogeneous populations requested.Note:
- optimizations can be requested with the command line option
--optimize
, seeIBSD.cloOptimize
. - currently restricted to discrete strategies where homogeneous population
states can be skipped by deterministically introducing new mutant after an
geometrically (exponentially) distributed waiting time (see
IBSD
). - requires small mutation rates.
- does not work for variable population sizes.
- optimizations can be requested with the command line option
-
isSynchronous
boolean isSynchronousFlag to indicate whether the population updates are synchronous. In multi-species models this requires that all species are updated synchronously. Helper variable foribsStep(double)
.- See Also:
-
debugFocalSpecies
IBSPopulation debugFocalSpeciesPointer to focal species for debugging. -
speciesUpdate
Type of species update (multi-species models only). -
nextSpeciesIdx
private int nextSpeciesIdxIndex for turn-based-selection to determine which species to pick next. Simply cycles through species array. -
cloAccumulatedScores
Command line option to set whether player scores from interactions are accumulated or averaged (default).Note: Accumulated scores can be tricky because they are essentially unbounded... On regular structures the two variants merely amount to a rescaling of the selection strength.
- See Also:
-
cloScoringType
Command line option to set method for resetting the scores of individuals.- See Also:
-
cloInteractions
Command line option to set whether players interact with all their neighbours or a random subsample. -
cloReferences
Command line option to set the method for choosing references/models among the neighbours of a player for updating their strategy. -
cloMigration
Command line option to set the migration types and probabilities of players. -
cloGeometryInteraction
Command line option to set the interaction geometry. This overrides theModule.cloGeometry
settings.- See Also:
-
cloGeometryCompetition
Command line option to set the competition geometry. This overrides theModule.cloGeometry
settings.- See Also:
-
cloGeometryRewire
Command line option to set the fraction of links to rewire. If graph is undirected it is preserved and if graph is directed, rewiring is done for directed links (where undirected links count as two directed links), which potentially breaks undirected ones. -
cloGeometryAddwire
Command line option to set the fraction of links to add. If graph is undirected only undirected links are added and if graph is directed only directed links are added. -
cloConsistency
Command line option to enable consistency checks. -
statisticsSettings
IBS.Statistics statisticsSettingsThe settings for statistics mode.
-
-
Constructor Details
-
IBS
Creates a population of individuals for IBS simulations.- Parameters:
engine
- the pacemaker for running the model
-
-
Method Details
-
permitsSampleStatistics
public boolean permitsSampleStatistics()Description copied from class:Model
Check if the current model settings permit sample statistics. Fixation probabilities and times are examples of statistics based on samples.- Overrides:
permitsSampleStatistics
in classModel
- Returns:
true
if sample statistics are permitted
-
permitsUpdateStatistics
public boolean permitsUpdateStatistics()Description copied from class:Model
Check if the current model settings permit update statistics. Sojourn times are an example of statistics based on updates.- Overrides:
permitsUpdateStatistics
in classModel
- Returns:
true
if update statistics are permitted
-
load
public void load()Milestone: Load this model and allocate resources (if applicable).Loads the IBS model and instantiates the
IBSPopulation
s representing the different species, if applicable. -
unload
public void unload()Description copied from class:Model
Milestone: Unload this model and free resources (if applicable). -
check
public boolean check()Description copied from class:Model
Check consistency of parameters and adjust if necessary (and possible). All issues and modifications should be reported throughlogger
. Some parameters can be adjusted while the model remains active or even while running, whereas others require a reset. An example of the former category is in general simple adjustments of payoffs, while an example of the latter category is a change of the population structure. -
reset
public void reset()Description copied from class:Model
Milestone: Reset this model -
init
public void init()Description copied from class:Model
Milestone: Initialize this model -
init
public void init(boolean soft) Initializes the IBS model.soft
initializations adjust parameters but do not touch the current state of the IBS population(s).Note: Method must be
public
because of subclasses inorg.evoludo.simulator
.- Parameters:
soft
- the flag to indicate whether this should be asoft
initialization.
-
update
public void update()Description copied from class:Model
Update this model. For example called after initialization and when parameters changed. -
next
public boolean next()Description copied from class:Model
Advance model by one step. The details of what happens during one step depends on the modelsType
as well as itsMode
.- Specified by:
next
in classModel
- Returns:
true
ifnext()
can be called again. Typicallyfalse
is returned if the model requires attention, such as the following conditions:- the model has converged
- the model turned monomorphic (stops only if requested)
- a statistics sample is available
- a preset time has been reached
- See Also:
-
ibsStep
public boolean ibsStep(double stepDt) Advances the IBS model by a step of sizestepDt
. The actual time increment may be shorter, e.g. upon reaching an absorbing state or homogeneous state, if requested.Note: the time increment returned is negative if the IBS converged/absorbed (individual based simulations cannot reverse time).
- Parameters:
stepDt
- the time increment requested for advancing the IBS model- Returns:
true
ifibsStep(double)
can be called again. Typicallyfalse
is returned if the simulation requires attention, such as the following conditions:- the population(s) have reached an absorbing state
- the population(s) turned monomorphic (stops only if requested)
- the population(s) went extinct
- See Also:
-
permitsDebugStep
public boolean permitsDebugStep()Description copied from class:Model
Checks if debugging single steps is supported. By default returnsfalse
. Only few models support debugging of single update steps.- Overrides:
permitsDebugStep
in classModel
- Returns:
true
if stepwise debuggin is permissible.
-
debugStep
public void debugStep()Description copied from class:Model
Perform single debug step in models that allow it. -
getIBSPopulation
Helper routine to retrieve theIBSPopulation
associated with module withid
.- Parameters:
id
- theid
of the module- Returns:
- the
IBSPopulation
-
getMinScore
public double getMinScore(int id) Description copied from class:Model
Returns the minimum score that individuals of species with IDid
can achieve in this model. Takes into account potential adjustments due to population structure and payoff accounting.- Specified by:
getMinScore
in classModel
- Parameters:
id
- the id of the population for multi-species models- Returns:
- the minimum score
- See Also:
-
getMaxScore
public double getMaxScore(int id) Description copied from class:Model
Returns the maximum score that individuals of species with IDid
can achieve in this model. Takes into account potential adjustments due to population structure and payoff accounting.- Specified by:
getMaxScore
in classModel
- Parameters:
id
- the id of the population for multi-species models- Returns:
- the maximum score
- See Also:
-
getMinFitness
public double getMinFitness(int id) Description copied from class:Model
Calculates and returns the absolute fitness minimum. This is important to- determine probabilities or rates for adopting the strategy of another player,
- optimize fitness based picking of individuals, and
- scaling graphical output.
- Specified by:
getMinFitness
in classModel
- Parameters:
id
- the id of the population for multi-species models- Returns:
- the minimum fitness
- See Also:
-
getMaxFitness
public double getMaxFitness(int id) Description copied from class:Model
Calculates and returns the absolute fitness maximum. This is important to- determine probabilities or rates for adopting the strategy of another player,
- optimize fitness based picking of individuals, and
- scaling graphical output.
- Specified by:
getMaxFitness
in classModel
- Parameters:
id
- the id of the population for multi-species models- Returns:
- the maximum fitness
- See Also:
-
getStatus
Description copied from class:Model
Returns status message from model. Typically this is a string summarizing the current state of the simulation. For example, models with discrete strategy sets (such as 2x2 games, seeTBT
) return the average frequencies of each strategy type in the population(s), seeIBSDPopulation
. Similarly, models with continuous strategies (such as continuous snowdrift games, seeCSD
) return the mean, minimum and maximum trait value(s) in the population(s), seeIBSMCPopulation
. The status message is displayed along the bottom of the GUI.Note: if the model runs into difficulties, problems should be reported through the logging mechanism. Messages with severity
Level.WARNING
or higher are displayed in the status of the GUI and override status messages returned here. -
getCounter
Description copied from class:Model
Gets a formatted string summarizing the elapsed time.- Overrides:
getCounter
in classModel
- Returns:
- elapsed time as string
-
getRealtime
public double getRealtime()Gets the elapsed time in real time units. The real time increments of microscopic updates depends on the fitness of the population. In populations with high fitness many events happen per unit time and hence the increments are smaller. In contrast in populations with low fitness fewer events happen and consequently more time elapses between subsequent events. By default no distinction between real time and generation time is made.- Returns:
- elapsed real time
-
getInitialTraits
public void getInitialTraits(double[] init) Description copied from class:Model
Collect and return initial trait values for all species.NOTE: this is a convenience method for multi-species modules to retrieve states efficiently for further processing or visualization.
- Specified by:
getInitialTraits
in classModel
- Parameters:
init
- the array for storing the initial trait values
-
getInitialTraits
public void getInitialTraits(int id, double[] init) Description copied from class:Model
Return initial trait values for species with IDid
.- Specified by:
getInitialTraits
in classModel
- Parameters:
id
- the species identifierinit
- the array for storing the initial trait values
-
getNMean
public int getNMean()Description copied from class:Model
Return the number of mean values for this model including all species (for traits or fitness). By default this returns the number of traits in the module. Models that report a different number of mean traits must override this method -
getNMean
public int getNMean(int id) Description copied from class:Model
Return the number of mean trait values for species with IDid
. -
getMeanTraits
public boolean getMeanTraits(double[] mean) Description copied from class:Model
Collect and return mean trait values for all species.NOTE: this is a convenience method for multi-species modules to retrieve states efficiently for further processing or visualization.
- Specified by:
getMeanTraits
in classModel
- Parameters:
mean
- the array for storing the mean trait values- Returns:
true
if this and previous data point should be connected, i.e. no reset had been requested in the mean time.
-
getMeanTraits
public boolean getMeanTraits(int id, double[] mean) Description copied from class:Model
Return mean trait values for species with IDid
.- Specified by:
getMeanTraits
in classModel
- Parameters:
id
- the species identifiermean
- the array for storing the mean trait values- Returns:
true
if this and the previous data point should be connected, i.e. no reset had been requested in the mean time.
-
getTraitNameAt
Description copied from class:Model
Gets the formatted trait names at locationidx
for species with IDid
. The formatting may include HTML tags. Used by GUI for example to show trait names in tooltips.Note: optional implementation. Currently makes sense only for IBS models and local dynamics in PDE models.
- Overrides:
getTraitNameAt
in classModel
- Parameters:
id
- the species identifieridx
- the index of the location- Returns:
- description of traits at
idx
-
getTraitData
Description copied from class:Model
Gets the trait data for species with IDid
and translates them into colors using thecolorMap
. The result is stored and returned incolors
. Used by GUI to visualize the current state of the model.- Specified by:
getTraitData
in classModel
- Type Parameters:
T
- color data type.Color
forPopGraph2D
andPopGraph2D
as well asMeshLambertMaterial
forPopGraph3D
- Parameters:
id
- the species identifiercolors
- the array for storing the colors for individualscolorMap
- the map for translating individual traits into colors
-
getMeanFitness
public boolean getMeanFitness(double[] mean) Description copied from class:Model
Gets the mean fitness values for traits in all species. The result is stored and returned inmean
. Used by GUI to visualize the current the state of the model.Note: this is a convenience method for multi-species modules to retrieve states efficiently for further processing or visualization.
- Specified by:
getMeanFitness
in classModel
- Parameters:
mean
- the array for storing the mean fitness values- Returns:
true
if this and the previous data point should be connected, i.e. no reset had been requested in the mean time.
-
getMeanFitness
public boolean getMeanFitness(int id, double[] mean) Description copied from class:Model
Gets the mean fitness values for species with IDid
. The result is stored and returned inmean
. Used by GUI to visualize local dynamics atidx
.- Specified by:
getMeanFitness
in classModel
- Parameters:
id
- the species identifiermean
- the array for storing the mean fitness values- Returns:
true
if this and the previous data point should be connected, i.e. no reset had been requested in the mean time.
-
getFitnessNameAt
Description copied from class:Model
Gets the fitness at locationidx
for species with IDid
as a formatted string. The formatting may include HTML tags. Used by GUI for example to show fitness in tooltips.Note: optional implementation. Currently makes sense only for IBS and PDE models.
- Overrides:
getFitnessNameAt
in classModel
- Parameters:
id
- the species identifieridx
- the index of the location- Returns:
- the fitness as a formatted string
-
getScoreNameAt
Description copied from class:Model
Gets the score at locationidx
for species with IDid
as a formatted string. The formatting may include HTML tags. Used by GUI for example to show scores in tooltips.Note: optional implementation. Currently makes sense only for IBS and PDE models.
- Overrides:
getScoreNameAt
in classModel
- Parameters:
id
- the species identifieridx
- the index of the location- Returns:
- the score as a formatted string
-
getFitnessData
Description copied from class:Model
Translates fitness data into colors using ColorMapcolorMap
. Used by GUI to visualize current state of model.- Specified by:
getFitnessData
in classModel
- Type Parameters:
T
- color data type.Color
forPopGraph2D
andPopGraph2D
as well asMeshLambertMaterial
forPopGraph3D
- Parameters:
id
- the species identifiercolors
- the array for storing color valuescolorMap
- the map to use for translating traits to colors
-
getFitnessHistogramData
public void getFitnessHistogramData(int id, double[][] bins) Description copied from class:Model
Generates a histogram of fitness data and returns the result in the provided arraybins
. For Discrete modules a fitness histogram is returned for each trait separately. For Continuous modules there is, in general, only a single fitness dimension.- Specified by:
getFitnessHistogramData
in classModel
- Parameters:
id
- the species identifierbins
- the array for storing histogram. For Discrete modules this is always one dimensional
-
getTagNameAt
Gets formatted tag of individual at locationidx
for species with IDid
. The formatting may include HTML tags. Used by GUI for example to show tags in tooltips. Opportunity to track ancestry through tags.Note: optional implementation. Currently makes sense only for IBS models.
- Parameters:
id
- the species identifieridx
- the index of the location- Returns:
- the formatted tag
-
getInteractionsAt
public int getInteractionsAt(int id, int idx) Gets the number of interactions at locationidx
for species with IDid
. Used by GUI for example to show interaction counts in tooltips.Note: optional implementation. Currently makes sense only for IBS models.
- Parameters:
id
- the species identifieridx
- the index of the location- Returns:
- the interaction count
-
mouseHitNode
public boolean mouseHitNode(int id, int hit, boolean alt) Used by GUI to interact with Model. Called whenever a mouse click/tap was registered by a node.- Parameters:
id
- the species identifierhit
- the index of the node hit by mousealt
-true
ifAlt
-key pressed- Returns:
false
if no actions taken
-
getSpeciesUpdate
Get species update type.- Returns:
- the species update type
-
pickFocalSpecies
Pick focal population according to the selected scheme.- Returns:
- the focal population
- See Also:
-
pickFocalSpeciesSize
Pick species to update with a probability proportional to the size of the species weighted by its update rate.- Parameters:
wPopTot
- the sum of the population sizes weighted by the corresponding species' update rate- Returns:
- the focal population
- See Also:
-
pickFocalSpeciesFitness
Pick species to update with a probability proportional to the total fitness of the species weighted by its update rate.- Parameters:
wScoreTot
- the sum of the population sizes weighted by the corresponding species' update rate- Returns:
- the focal population
- See Also:
-
pickFocalSpeciesTurns
Pick species for sequential updates, i.e. pick one population after another for updating.- Returns:
- focal population
-
pickEvent
Pick type of next event in focal population.- Parameters:
pop
- the focal population- Returns:
- the next event
-
collectCLO
Description copied from interface:CLOProvider
All providers of command line options must implement this method to collect their options.Each command line option is (uniquely) identified by it's name (see
CLOption.getName()
), which corresponds to the long version of the option. If an attempt is made to add an option with a name that already exists, theparser
issues a warning and ignores the option. Thus, in general, implementing subclasses should first register their options and callsuper.collectCLO(CLOParser)
at the end such that subclasses are able to override command line options specified in a parental class.Override this method in subclasses to add further command line options. Subclasses must make sure that they include a call to super.
- Specified by:
collectCLO
in interfaceCLOProvider
- Overrides:
collectCLO
in classModel
- Parameters:
parser
- the reference to parser that manages command line options- See Also:
-
encodeState
Description copied from class:Model
Encode the state of the model in aplist
inspiredXML
string. This allows to save the state and restore later with the exact same results as when continuing to run the model. This even allows to switch from JRE to GWT or back and obtain identical results!- Specified by:
encodeState
in classModel
- Parameters:
plist
- theStringBuilder
to write the encoded state to- See Also:
-
restoreState
Description copied from class:Model
Restore the state encoded in theplist
inspiredmap
ofkey, value
-pairs.- Specified by:
restoreState
in classModel
- Parameters:
plist
- the map ofkey, value
-pairs- Returns:
true
if successful- See Also:
-
random0n
public int random0n(int n) random integer number from interval[0, n)
.- Parameters:
n
- the upper limit of interval (exclusive)- Returns:
- the random integer number in
[0, n)
.
-
random01
public double random01()Random number from interval [0, 1) with 32bit resolution. This is the default.- Returns:
- the random number in
[0, 1)
.
-