Class Range


  • public class Range
    extends Module
    A modifier module to map a value from one range to another.

    For example: 0.5 (-1 < x < 1) -> 0.75 (0 < x < 1)

    Source Modules
    This module requires one source module.
    • Field Detail

      • DEFAULT_CURRENT_LOWER_BOUND

        public static final double DEFAULT_CURRENT_LOWER_BOUND
        See Also:
        Constant Field Values
      • DEFAULT_CURRENT_UPPER_BOUND

        public static final double DEFAULT_CURRENT_UPPER_BOUND
        See Also:
        Constant Field Values
      • DEFAULT_NEW_LOWER_BOUND

        public static final double DEFAULT_NEW_LOWER_BOUND
        See Also:
        Constant Field Values
      • DEFAULT_NEW_UPPER_BOUND

        public static final double DEFAULT_NEW_UPPER_BOUND
        See Also:
        Constant Field Values
    • Constructor Detail

      • Range

        public Range()
      • Range

        public Range​(Module source)
        Create a new Range module with the source modules pre-configured.
        Parameters:
        source - the input module
    • Method Detail

      • getCurrentLowerBound

        public double getCurrentLowerBound()
      • getCurrentUpperBound

        public double getCurrentUpperBound()
      • getNewLowerBound

        public double getNewLowerBound()
      • getNewUpperBound

        public double getNewUpperBound()
      • setBounds

        public void setBounds​(double currentLower,
                              double currentUpper,
                              double newLower,
                              double newUpper)
        Configure bounds for range module
        Parameters:
        currentLower - current lower bound
        currentUpper - current upper bound
        newLower - new lower bound
        newUpper - new upper bound
      • getValue

        public double getValue​(double x,
                               double y,
                               double z)
        Description copied from class: Module
        Generates an output value given the coordinates of the specified input value.

        All source modules required by this module must have been connected with the Module.setSourceModule(int, Module) method. If these source modules are not connected, this method will throw a NoModuleException.

        To determine the number of source modules required by this noise module, call the Module.getSourceModuleCount() method.

        Specified by:
        getValue in class Module
        Parameters:
        x - the x coordinate of the input value
        y - the y coordinate of the input value
        z - the z coordinate of the input value
        Returns:
        the output value