org.optaplanner.core.impl.heuristic.selector.common.nearby

## Class BlockDistributionNearbyRandom

- java.lang.Object
- - org.optaplanner.core.impl.heuristic.selector.common.nearby.BlockDistributionNearbyRandom

- All Implemented Interfaces:
    NearbyRandom

      public class BlockDistributionNearbyRandom
      extends Object
      implements NearbyRandom

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected int` | `sizeMaximum`
    `protected int` | `sizeMinimum`
    `protected double` | `sizeRatio`
    `protected double` | `uniformDistributionProbability`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `BlockDistributionNearbyRandom(int sizeMinimum, int sizeMaximum, double sizeRatio, double uniformDistributionProbability)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `int` | `getOverallSizeMaximum()` Used to limit the RAM memory size of the nearby distance matrix.
    `int` | `nextInt(Random random, int nearbySize)`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### sizeMinimum

          protected final int sizeMinimum

    - #### sizeMaximum

          protected final int sizeMaximum

    - #### sizeRatio

          protected final double sizeRatio

    - #### uniformDistributionProbability

          protected final double uniformDistributionProbability

  - ### Constructor Detail

    - #### BlockDistributionNearbyRandom

          public BlockDistributionNearbyRandom(int sizeMinimum,
                                               int sizeMaximum,
                                               double sizeRatio,
                                               double uniformDistributionProbability)

  - ### Method Detail

    - #### nextInt

          public int nextInt(Random random,
                             int nearbySize)

      Specified by:
        `nextInt` in interface `NearbyRandom`
      Parameters:
        `random` - never null
        `nearbySize` - never negative. The number of available values to select from. Normally this is the size of the value range for a non-chained variable and the size of the value range (= size of the entity list) minus 1 for a chained variable.
      Returns:
        `0 <= x < nearbySize`

    - #### getOverallSizeMaximum

          public int getOverallSizeMaximum()

      Description copied from interface: `NearbyRandom`
      Used to limit the RAM memory size of the nearby distance matrix.
      Specified by:
        `getOverallSizeMaximum` in interface `NearbyRandom`
      Returns:
        one more than the maximum number that `NearbyRandom.nextInt(Random, int)` can return, `Integer.MAX_VALUE` if there is none

Copyright © 2006–2021 JBoss by Red Hat. All rights reserved.