Class ArtificialGamePosition.Settings
java.lang.Object
gametree.ArtificialGamePosition.Settings
- All Implemented Interfaces:
Serializable
- Enclosing class:
ArtificialGamePosition
A class that stores the settings for a
ArtificialGamePosition tree. All nodes
in the tree hold a reference to the same ArtificialGamePosition.Settings object that was used to
initialise the tree.- Version:
- 1.0
- Author:
- Pascal Anema
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionfinal booleanWhether or not this tree is an adversarial game tree.final doubleParameter r, relevance chance, only relevant when the growth factorgis greater than 1.final doubleParameter g, growth factor, always> 0, typically>= 1, dictates how much child bounds may maximally diverge from their parents' bounds in a single generation, as a factor of the parent's range:|Upper - Lower|.final longInitial range R at the root node of this tree.final longThe pseudo-random number generator seed of the first node in the tree (S₀).final booleanNot a tree generation parameter, but an implementation-specific one.final intParameter k, number of values,>=2, denotes the number of valueskthat are generated to build the upper and lower bounds of each child node.final intParameter b, the branching factor or width of the tree,>=2, denotes the number of children nodes that each non-terminal node in the game-tree has. -
Constructor Summary
ConstructorsConstructorDescriptionSettings(boolean adversarial, long initial_seed, int width, long initial_range, int num_alts, double growth_factor, double force_relevance_chance) Initialises the artificial game tree settings with the provided parameter values.Settings(boolean adversarial, long initial_seed, int width, long initial_range, int num_alts, double growth_factor, double force_relevance_chance, boolean memory_saver) Initialises the artificial game tree settings with the provided parameter values. -
Method Summary
Modifier and TypeMethodDescriptiongetTree()Creates a newArtificialGamePositionobject representing a unique tree defined by the parameters set in thisArtificialGamePosition.Settingsobject.toString()
-
Field Details
-
adversarial
public final boolean adversarialWhether or not this tree is an adversarial game tree. Iftrue, nodes alternate between maximising and minimising nodes (starting at maximising). Iffalse, all nodes are maximising nodes. Adversarial game trees depict games with two opposing players. Non-adversarial game trees depict games with only one player (or multiple co-operating players). -
initial_seed
public final long initial_seedThe pseudo-random number generator seed of the first node in the tree (S₀). Dictates the unique generation of the entire tree. A tree with the same settings, including the same initial seed, will always have the same structure no matter the order of expansion/exploration. -
width
public final int widthParameter b, the branching factor or width of the tree,>=2, denotes the number of children nodes that each non-terminal node in the game-tree has. -
initial_range
public final long initial_rangeInitial range R at the root node of this tree. The root node will start with lower- and upper-bounds0andinitial_range. Has to be greater than0for the tree to be non-trivial. -
num_alts
public final int num_altsParameter k, number of values,>=2, denotes the number of valueskthat are generated to build the upper and lower bounds of each child node. To generate children bounds, we randomly samplekvalues from a uniform distribution between some outer bound determined by the parent and the growth factor. The upper bound is taken to be the maximum of thesekvalues, whereas the lower bound is the minimum. -
growth_factor
public final double growth_factorParameter g, growth factor, always> 0, typically>= 1, dictates how much child bounds may maximally diverge from their parents' bounds in a single generation, as a factor of the parent's range:|Upper - Lower|. Forg=1, all children values are bound by the optimistic and pessimistic values of their parents. Forg>1children may have bounds greater than their parents. Forg < 1children bounds are always smaller than their parents' bounds. -
force_relevance_chance
public final double force_relevance_chanceParameter r, relevance chance, only relevant when the growth factorgis greater than 1. Enforces that, for a fractionrof child nodes of each parent, the child bound overlaps with the parent bound. Such that either the upper or lower bound is forced to be generated within the parent bound, depending on whether the node is minimising or maximising respectively. -
memory_saver
public final boolean memory_saverNot a tree generation parameter, but an implementation-specific one. Iftrue, only the last 64 bits of the names of nodes are stored. This has no effect on the regular functions of the tree, nor on its distribution. But it disables random access for this tree, as well as losing information of node heritage after only a short number of ancestors (depending on the branching factorwidth). The benefit is significantly reduced memory usage, especially for very deep trees. Iffalse, nodes are stored as usual.
-
-
Constructor Details
-
Settings
public Settings(boolean adversarial, long initial_seed, int width, long initial_range, int num_alts, double growth_factor, double force_relevance_chance, boolean memory_saver) Initialises the artificial game tree settings with the provided parameter values.- Parameters:
adversarial-adversarial, denotes whether this tree is an adversarial tree or notinitial_seed-initial_seed, denotes a unique tree generation sequencewidth-width, has to be greater than or equal to 2initial_range-initial_range, has to be greater than 0num_alts-num_alts, has to be greater than or equal to 2growth_factor-growth_factor, has to be greater than 0force_relevance_chance-force_relevance_chance, has to be greater than or equal to 0 and smaller than or equal to 1memory_saver-memory_saver, denotes whether the implementation-specific memory saver is used
-
Settings
public Settings(boolean adversarial, long initial_seed, int width, long initial_range, int num_alts, double growth_factor, double force_relevance_chance) Initialises the artificial game tree settings with the provided parameter values.This constructor uses a default value of
truefor thememory_saverparameter.- Parameters:
adversarial-initial_seed-width-initial_range-num_alts-growth_factor-force_relevance_chance-
-
-
Method Details
-
getTree
Creates a newArtificialGamePositionobject representing a unique tree defined by the parameters set in thisArtificialGamePosition.Settingsobject.- Returns:
- A new artificial game tree based on the parameters of this object.
-
toString
-