Interface Generator.Width
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
The generator type specifically used for generating the variable branching factor
at each node of a
VariantAGP artificial game tree.-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Generator.WidthA default generator which always returns the maximum branching factor. -
Method Summary
-
Field Details
-
FIXED
A default generator which always returns the maximum branching factor.
-
-
Method Details
-
generate
Generates a random branching factor for one node given the provided parameters.If it is desired to produce fewer than the minimum allowed number of children, to terminate the tree at this node, then it is advised to instead program this into the
Generator.Boundsgenerator. The correct termination of nodes should occur when their lower and upper bounds are equal, and thus should not occur when this is not the case. The Generator.Width generator is only ever called on nodes which are not already terminal nodes, so they should have at least 1 child.- Parameters:
r- The random number generator to use, this should be the only source of randomness in any implementation of this method.min_allowed- The minimum allowed output, this is the minimum branching factor, typically 1. The output should not be below this value.max_allowed- The maximum allowed output, this is the maximum branching factor. The output should not be above this value, or risk unpredictable seed overlapping behaviour.current_depth- The depth of the current node, for which this generator returns the number of children to generate.- Returns:
- The number of children to generate for this node.
-