LTNumberRangeUniform:
The LTNumberRangeUniform node is designed to randomize a parameter using a uniform distribution, which means it generates a random floating-point number that is equally likely to fall anywhere between a specified minimum and maximum value. This node is particularly useful in scenarios where you need to introduce variability or randomness into a parameter, ensuring that each possible value within the defined range has an equal chance of being selected. By leveraging a uniform distribution, this node can help create more dynamic and varied outputs, which can be beneficial in artistic applications where unpredictability and diversity are desired. The node's functionality is encapsulated in the param_range_uniform method, which takes in a seed value to ensure reproducibility of the randomization process, allowing for consistent results across different runs if the same seed is used.
LTNumberRangeUniform Input Parameters:
min_value
The min_value parameter defines the lower bound of the range from which the random number will be generated. It determines the smallest possible value that can be selected by the node. The parameter accepts floating-point numbers with a default value of 0.0, and it can range from -1,000,000 to 1,000,000. Adjusting this parameter allows you to control the starting point of the randomization range, which can significantly impact the variability and scope of the generated outputs.
max_value
The max_value parameter sets the upper bound of the range for the random number generation. It specifies the largest possible value that can be selected by the node. Like min_value, this parameter accepts floating-point numbers and has a default value of 1.0, with a permissible range from -1,000,000 to 1,000,000. By modifying this parameter, you can control the endpoint of the randomization range, influencing the extent and diversity of the generated values.
seed
The seed parameter is an integer that initializes the random number generator, ensuring that the sequence of random numbers is reproducible. This means that using the same seed value will produce the same sequence of random numbers, which is crucial for consistency in applications where repeatability is important. The default value is 0, and it can range from 0 to 0xffffffffffffffff. This parameter is particularly useful when you need to recreate specific randomization results for testing or iterative design processes.
LTNumberRangeUniform Output Parameters:
FLOAT
The FLOAT output is the primary result of the node, representing the randomly generated floating-point number within the specified range. This output is crucial as it provides the actual value that can be used in subsequent processes or nodes, allowing for dynamic and varied input into your artistic or computational workflows.
INT
The INT output is the integer representation of the generated floating-point number. This output is useful when you need a whole number for further processing or when integrating with systems that require integer inputs. It provides a straightforward way to convert the random float into an integer, ensuring compatibility with various applications.
STRING
The STRING output is a string representation of the generated floating-point number, rounded to five decimal places. This output is particularly helpful for logging, debugging, or displaying the generated value in a human-readable format. It allows you to easily document or communicate the results of the randomization process.
LTNumberRangeUniform Usage Tips:
- To ensure consistent results across different runs, use the same seed value when you want to reproduce specific randomization outcomes.
- Adjust the
min_valueandmax_valueparameters to control the range and variability of the generated numbers, tailoring the randomness to suit your specific artistic or computational needs.
LTNumberRangeUniform Common Errors and Solutions:
ValueError: min_value must be less than max_value
- Explanation: This error occurs when the
min_valueis set to a value greater than or equal tomax_value, which is not allowed as it would result in an invalid range. - Solution: Ensure that
min_valueis always less thanmax_valueto define a valid range for random number generation.
TypeError: Seed must be an integer
- Explanation: This error arises when a non-integer value is provided for the
seedparameter, which requires an integer input. - Solution: Verify that the
seedparameter is set to an integer value to ensure proper initialization of the random number generator.
