|
FRODO Version 2.19.1
An open-source framework for Distributed Constraint Optimization (DCOP)
|
This class is designed to store GOODs received by a node from its children, and is used in the O-DPOP algorithm. More...

Classes | |
| class | IntArrayWrapper |
| The IntArrayWrapper is used as a key for (partial) assignments. More... | |
Public Member Functions | |
| InnerNodeTree (String ownVariable, Val[] ownVariableDomain, List< UtilitySolutionSpace< Val, U > > spaces, U zero, int numberOfChildren, U infeasibleUtil, boolean maximize, boolean collectStats) | |
| A constructor. | |
| InnerNodeTree (String ownVariable, Val[] ownVariableDomain, UtilitySolutionSpace< Val, U > space, int numberOfChildren, U zero, L leafNodeInstance, U infeasibleUtil, boolean maximize, boolean collectStats) | |
| A constructor. | |
| InnerNodeTree (String ownVariable, Val[] ownVariableDomain, List< UtilitySolutionSpace< Val, U > > spaces, int numberOfChildren, U zero, L leafNodeInstance, U infeasibleUtil, boolean maximize, boolean collectStats) | |
| A constructor. | |
| boolean | add (Good< Val, U > g, int sender, HashMap< String, Val[]> domains) |
| Adds a good to the tree. | |
| Good< Val, U > | getAmax () |
| void | getBestAssignmentForOwnVariable (HashMap< String, Val > contextMap) |
| String[] | getChildSeparatorReportingOrder (int child) |
| Returns the variables in the childs separator in the order it reported them. | |
| int | getChildSeparatorSize (int child) |
| HashMap< String, Val > | getChildValues (HashMap< String, Val > parentContext, int child) |
| Given a map that maps variables to values, this method returns the values belonging to the variables in a child's separator. | |
| int[] | getFinalDomainSize () |
| Val[][] | getDomains () |
| boolean | hasFullInfo () |
| boolean | hasMore () |
| boolean | isValuationSufficient () |
| boolean | knowsVariable (String variable) |
| boolean | notEnoughInfo () |
| void | removeAMax () |
| void | setChildrenSeparator (int child, String[] variables) |
| Initializes the separator of a child. | |
| boolean | stillToSend () |
| boolean | setChildDone (int child) |
| If a child has send a DONE message, the upper bound should be set to -infinity. | |
| String | toString () |
| Method used for debugging purposes. | |
| IntArrayWrapper | createIntArrayWrapper (int[] array) |
| IntArrayWrapper | createIntArrayWrapper (int size) |
| boolean | checkLeaf (L leaf, IntArrayWrapper currentPath, boolean checkUB, U utility, int sender) |
| Method to check that the utility and UB are consistent with the available information. | |
| boolean | compareWithHypercube (UtilitySolutionSpace< Val, U > h) |
| Method to check the initialization of the tree. | |
| boolean | pathExists (Val[] values) |
| boolean | UBexists (InnerNode< U, L > currentNode, int depth) |
| Test to see whether a leafnode used as upperbound actually exists, i.e. | |
| boolean | Utilexists (InnerNode< U, L > currentNode, int depth) |
| Checks whether the maxUtil of a node actually exists. | |
| int | treeSize () |
| Wrapper around treeSize(int, int, Node). | |
| void | setFinalDomainSize (String[] variables, int[] domainSize) |
| Public Member Functions inherited from frodo2.algorithms.odpop.goodsTree.GoodsTree< Val extends Addable< Val >, U extends Addable< U >, L extends Node< U > > | |
| GoodsTree (String ownVariable, Val[] ownVariableDomain, UtilitySolutionSpace< Val, U > space, U zero, int numberOfChildren, U infeasibleUtil, boolean maximize, boolean collectStats) | |
| A constructor. | |
| GoodsTree (String ownVariable, Val[] ownVariableDomain, List< UtilitySolutionSpace< Val, U > > spaces, U zero, int numberOfChildren, U infeasibleUtil, boolean maximize, boolean collectStats) | |
| A constructor. | |
| double | getTreeFillPercentage () |
| long | getNumberOfDummies () |
| double | getDummiesFillPercentage () |
| boolean | greaterThanOrEqual (U u1, U u2) |
| Compares two values. | |
| boolean | greaterThan (U u1, U u2) |
| Compares two values. | |
| U | getMaximalCut () |
| long | getNumberOfGoodsSent () |
| long | getSizeOfSpace () |
Protected Member Functions | |
| InnerNodeTree (String ownVariable, Val[] ownVariableDomain, UtilitySolutionSpace< Val, U > space, U zero, int numberOfChildren, U infeasibleUtil, boolean maximize, boolean collectStats) | |
| A constructor. | |
| InnerNodeTree (L leafNodeInstance, String ownVariable, Val[] ownVariableDomain, UtilitySolutionSpace< Val, U > space, U zero, int numberOfChildren, U infeasibleUtil, boolean maximize, boolean collectStats) | |
| A dummy constructor to be used by extending classes. | |
| InnerNodeTree (L leafNodeInstance, String ownVariable, Val[] ownVariableDomain, List< UtilitySolutionSpace< Val, U > > spaces, U zero, int numberOfChildren, U infeasibleUtil, boolean maximize, boolean collectStats) | |
| A dummy constructor to be used by extending classes. | |
| int[] | addNewVariable (String[] allVariables, HashMap< String, Val > newVariables, HashMap< String, Val[]> newDomains, int sender) |
| This method adds new variables to the data structure. | |
| boolean | addVariableToTree (int nbrNewVariables, IntArrayWrapper currentPath, int[] indexPath, int depth, InnerNode< U, L > oldRoot, InnerNode< U, L > currentNode, boolean possibleInconsistencies, boolean onIndexPath, int sender) |
| This method is called when variables are received. | |
| InnerNode< U, L > | createInnerNode (int numberOfChildren) |
| Create an inner node with a specified number of children. | |
| InnerNode< U, L > | createInnerNode (Node< U >[] children) |
| Create an inner node with the specified number of children. | |
| L | createLeaf (IntArrayWrapper currentPath, Good< Val, U > g, int child, final boolean withUB) |
| Method to create a new leaf node. | |
| L | createLeaf (IntArrayWrapper currentPath, final boolean withUB) |
| Method to create a new leaf node. | |
| InnerNode< U, L > | createPathNoUB (int depth, IntArrayWrapper currentPath, int[] partialPath, boolean real, Good< Val, U > g, int sender) |
| Given a partial path, this method creates the path in the tree. | |
| void | finalDomainSizeReceiver () |
| logs the reception of a domain size info message | |
| int[] | getOwnVariableOptions (Val[] assignments) |
| Given the assignment of variables in its separator, this method returns the utility for all domain elements of the own variable. | |
| U | getOwnVariableOptions (int[] path, int[] optimalPath, U maxUtil, int depth, InnerNode< U, L > currentNode) |
| Given a possibly partial path, this method finds the maximal utility any option can provide. | |
| U | getUtilityLocalProblem (IntArrayWrapper currentPath) |
| Given an assignment to all the variables, represented as a path in the tree, this method returns the utility given by the variable's local problem. | |
| void | init (int numberOfChildren, U zero) |
| Initialize all the variables of the tree. | |
| void | initializeUpperBoundSums () |
| Initializes both the sum of bounds array and the powersOf2 array. | |
| U | initiateBounds (InnerNode< U, L > currentNode, IntArrayWrapper currentPath, int depth, boolean onLocalPath, Good< Val, U > g, int sender) |
| This method instantiates the upper bounds. | |
| boolean | localPathAlive (int depth, InnerNode< U, L > currentNode) |
| Used to check whether the local path chosen is still alive For debuggin purposes only. | |
| boolean | pathAlive (int[] path, int depth, InnerNode< U, L > currentNode) |
| Method to check whether the (possibly) partial path is alive, i.e. | |
| void | updatePath (int depth, IntArrayWrapper currentPath, int[] partialPath, InnerNode< U, L > currentNode, Good< Val, U > g, U utilityDelta, int sender, boolean onLocalPath, final boolean withUB) |
| This method walks trough the tree according to the given partial path and finds all leaf nodes that correspond to assignments that are compatible with the good to be added. | |
| void | updateLocalProblem () |
| void | updateUpperBoundSums (int child, U oldBound, U newBound) |
| Updates the upperBoundSums array given the child that has changed its bound, the old bound and the new bound. | |
| boolean | upperBoundChangesUtil (InnerNode< U, L > node, U UB) |
| U | recalculateUB (int depth, InnerNode< U, L > currentNodeUncast, U UBtoBeat, boolean recalculateUtil, boolean recalculateUB) |
| This method recalculates the upper bound for a particular node. | |
| void | removeInconsistencies (InnerNode< U, L > currentNode, int depth, IntArrayWrapper currentPath) |
| This method checks whether any of the leafnodes have become infeasible due to the addition of a new variable. | |
| boolean | removePath (int depth, InnerNode< U, L > currentNode, boolean onLocalPath) |
| This method finds the leaf node corresponding to the current best assignment, removes all its children and sets its parent node to a dead node. | |
| IntArrayWrapper | toKey (Val[] values, String[] variables, int sender) |
| Takes a good received by a child and transforms the assignment to a key. | |
| boolean | checkTree (int depth, InnerNode< U, L > currentNode, IntArrayWrapper currentPath, boolean UB, boolean checkLeafs, boolean checkSupport, boolean checkUtil) |
| This method checks the tree on the following properties. | |
| boolean | hasSupport (IntArrayWrapper currentPath) |
| Method to check whether a particular leaf node has support, i.e. | |
| boolean | setOldUB () |
| Used to set the old upperbound. | |
| Protected Member Functions inherited from frodo2.algorithms.odpop.goodsTree.GoodsTree< Val extends Addable< Val >, U extends Addable< U >, L extends Node< U > > | |
| void | solveLocalProblem () |
| Method used to solve the local problem and create an ordered list of all feasible assignments. | |
| void | countLeafNode () |
| Method used to count the number of leaf nodes created (includes the dummy nodes). | |
| void | countLeafNode (boolean real) |
| Method used to count the number of leaf nodes created (includes the dummy nodes). | |
| void | countGoodsProduced () |
| Count rhe number of goods produced. | |
Protected Attributes | |
| HashMap< String, Integer > | variableToDepth |
| links a variable to its depth in the tree. | |
| HashMap< String, HashMap< Val, Integer > > | valuePointers |
| Used to determine to which child a variable value corresponds to. | |
| int[] | domainSize |
| Stores, for a level in the tree, the size of the domain of the corresponding variable. | |
| int[] | finalDomainSize |
| Stores the final sizes of the domains of all the variables. | |
| int[] | branchingFactor |
| For every level of the tree, it stores the branching factor. | |
| boolean[][] | childrenVariables |
| Stores which variables are in a child's separator. | |
| String[][] | childrenVariablesReportingOrder |
| For each child it stores the order in which the variables are reported. | |
| int[] | separatorSizePerChild |
| Stores the number of reported variables per child. | |
| boolean[] | ownVariables |
| Stores which are this variable's neighbours. | |
| ArrayList< HashMap< IntArrayWrapper, U > > | goodsReceived |
| For each child a map that stores the utilities received from children. | |
| boolean | storeReceivedGoods = true |
| If domain or variable information is incomplete received goods must be stored, otherwise they can be discarded after processing. | |
| boolean | hasLocalProblem |
true when this variable has a local problem, and false otherwise | |
| U | optimalLocalUtility |
| The optimal utility of the local problem. | |
| int[] | optimalLocalPath |
| The path of the currently optimal local solution. | |
| U | localUpperBound |
| The upperbound on all the completely unseen assignments. | |
| U[] | upperBounds |
| For each child it stores that last confirmed utility received. | |
| U[] | upperBoundSums |
| For every combination of children, this array contains the sum of upperBounds belonging to the selected children. | |
| int | maxNumberLocalProblemOccurences |
| The total number of times a solution to a local problem can be used in the separator problem. | |
| int[] | powersOf2 |
| Pre-calculated powers of 2. | |
| int | upperBoundIsInfiniteCounter |
| Counts the number of children that have already sent at least one confirmed good. | |
| int | upperBoundIsMinInfiniteCounter |
| COunts the number of children that have already reported a minInfinite value. | |
| HashMap< String, ArrayList< Val > > | domains |
| The variable domains, where the position in the ArrayList denotes which child corresponds to the value. | |
| int | numberOfChildren |
| The number of children of the variable. | |
| InnerNode< U, L > | root |
| The root of the tree. | |
| boolean | fullInfo |
| True when the information on the final domain size is complete. | |
| int | fullInfoCounter |
| Counts the number of children from which one still needs to receive domain information. | |
| boolean | stillToSend = true |
| True if the domain information has not been requested yet. | |
| L | leafNodeInstance |
| An instance of a leaf node, used to create new instances. | |
| U | oldUB |
| Stores the UB as it was before a new good has been received. | |
| int | localCounter |
| The number of times the currently best local solution has NOT been used in the tree, i.e. | |
| String[][] | unpackedVariablesPerChild |
| Per child the unpacked variables (different from the reported variables). | |
| HashMap< String, Val[]> | toBeProcessedDomains |
Domains still to be added to domains. | |
| Protected Attributes inherited from frodo2.algorithms.odpop.goodsTree.GoodsTree< Val extends Addable< Val >, U extends Addable< U >, L extends Node< U > > | |
| UtilitySolutionSpace< Val, U > | localProblem |
| The list of spaces this variable is responsible for. | |
| int | numberOfLocalVariables |
| The number of local variables in the local problem. | |
| IteratorBestFirst< Val, U > | localProblemIterator |
| Iterator that returns solutions to the local problem in a best first order. | |
| final U | infeasibleUtil |
| The -infinite utility. | |
| final U | zero |
| The zero utility. | |
| int | numberOfSpaces |
| The number of spaces that together comprise the local problem. | |
| Class<?> | domainElementClass |
| domain element used for reflection | |
| int | numberOfVariables |
| The number of variables in the local problem. | |
| String[] | depthToVariable |
| Links a level in the tree with its corresponding variable. | |
| String | ownVariable |
| The variable that controls this LeafNodeTree. | |
| int | depthFinalVariable |
| The depth of the last variable in the tree. | |
| Val[] | ownVarDomain |
The domain of ownVariable. | |
| String[] | outsideVariables |
| The variables as they should be communicated with the outside world. | |
| int[] | valuesToBeRemoved |
| Contains the indices of the values that need to be removed from the assigment before being send upwards. | |
| int | depthOfFirstToBeRemovedVariables |
| All variables below this depth must be removed when sending a good. | |
| HashMap< String, Integer > | outsideVariablesMapping |
| A mapping from outside variables to inside variables. | |
| final boolean | maximize |
true when we are maximizing, and false otherwise | |
| long | totalSeparatorSpaceSize = 1 |
| The size of the separator space. | |
Static Protected Attributes | |
| static final long | serialVersionUID = 4206985864919963001L |
| Used for serialization. | |
Private Member Functions | |
| InnerNode< U, L > | createPathWithUB (int depth, IntArrayWrapper currentPath, int[] partialPath, boolean real, Good< Val, U > g, int sender) |
| Given a partial path, this method creates the path in the tree. | |
| InnerNode< U, L > | fillTree (InnerNode< U, L > example, int depth, IntArrayWrapper currentPath, boolean onLocalPath, final boolean withUB, boolean onPartialPath, int[] partialPath, Good< Val, U > g, int sender, boolean ex) |
| Fills a part of the tree that has been created by the reception of a new domain value. | |
| boolean | checkUpperBoundSums (int child, U newBound) |
| Method to check the precomputation of the upper bound sums. | |
| boolean | compareWithHypercube (int depth, Val[] currentPath, InnerNode< U, L > currentNode, UtilitySolutionSpace< Val, U > h) |
| Method to check the initialization of the tree. | |
| U | findMaxUB (int depth, InnerNode< U, L > currentNode) |
| Method to find the maximal upper bound in the tree. | |
| int | treeSize (int depth, int visited, Node< U > currentNode) |
| Counts the number of leaves in the tree. | |
| String | generateAssignments (int depth, int[] currentPath, InnerNode< U, L > currentNode) |
| Used to print thte contents of the tree. | |
Additional Inherited Members | |
| Public Attributes inherited from frodo2.algorithms.odpop.goodsTree.GoodsTree< Val extends Addable< Val >, U extends Addable< U >, L extends Node< U > > | |
| final boolean | COLLECT_STATISTICS |
true when statistics should be collected, and false otherwise | |
This class is designed to store GOODs received by a node from its children, and is used in the O-DPOP algorithm.
A GOOD contains an assignment to a set of variables, and a utility. A GOOD is identified by its assignment, and in this class the GOODs are ordered using a tree based on these assignments.
The basic functionality of this class is to either add a received GOOD to the tree, or to obtain the assignment that has the highest utility.
| <Val> | type used for variable values |
| <U> | type used for utility values |
| <L> | type used for the leaf node |
|
protected |
A constructor.
| ownVariable | The variable that owns this tree |
| ownVariableDomain | The domain of ownVariable |
| space | The space controlled by this tree |
| zero | The zero utility |
| numberOfChildren | The number of children of this tree |
| infeasibleUtil | The infeasible utility |
| maximize | when true we are maximizing, when false we are minimizing |
| collectStats | true when statistics should be collected, and false otherwise |
References frodo2.algorithms.odpop.goodsTree.GoodsTree< Val extends Addable< Val >, U extends Addable< U >, L extends Node< U > >.infeasibleUtil, frodo2.algorithms.odpop.goodsTree.GoodsTree< Val extends Addable< Val >, U extends Addable< U >, L extends Node< U > >.maximize, numberOfChildren, frodo2.algorithms.odpop.goodsTree.GoodsTree< Val extends Addable< Val >, U extends Addable< U >, L extends Node< U > >.ownVariable, and frodo2.algorithms.odpop.goodsTree.GoodsTree< Val extends Addable< Val >, U extends Addable< U >, L extends Node< U > >.zero.
| frodo2.algorithms.odpop.goodsTree.InnerNodeTreeFullDomain.InnerNodeTree< Val extends Addable< Val >, U extends Addable< U >, L extends LeafNode< U > >.InnerNodeTree | ( | String | ownVariable, |
| Val[] | ownVariableDomain, | ||
| List< UtilitySolutionSpace< Val, U > > | spaces, | ||
| U | zero, | ||
| int | numberOfChildren, | ||
| U | infeasibleUtil, | ||
| boolean | maximize, | ||
| boolean | collectStats ) |
A constructor.
| ownVariable | The variable that owns this tree |
| ownVariableDomain | The domain of ownVariable |
| spaces | The space controlled by this tree |
| zero | The zero utility |
| numberOfChildren | The number of children of this tree |
| infeasibleUtil | The infeasible utility |
| maximize | when true we are maximizing, when false we are minimizing |
| collectStats | true when statistics should be collected, and false otherwise |
References frodo2.algorithms.odpop.goodsTree.GoodsTree< Val extends Addable< Val >, U extends Addable< U >, L extends Node< U > >.infeasibleUtil, frodo2.algorithms.odpop.goodsTree.GoodsTree< Val extends Addable< Val >, U extends Addable< U >, L extends Node< U > >.maximize, numberOfChildren, frodo2.algorithms.odpop.goodsTree.GoodsTree< Val extends Addable< Val >, U extends Addable< U >, L extends Node< U > >.ownVariable, and frodo2.algorithms.odpop.goodsTree.GoodsTree< Val extends Addable< Val >, U extends Addable< U >, L extends Node< U > >.zero.
|
protected |
A dummy constructor to be used by extending classes.
| leafNodeInstance | an instance of the leaf node class |
| ownVariable | The variable that owns this tree |
| ownVariableDomain | The domain of ownVariable |
| space | The local problem |
| zero | The zero utility |
| numberOfChildren | The number of children of this tree |
| infeasibleUtil | The infeasible utility |
| maximize | when true we are maximizing, when false we are minimizing |
| collectStats | true when statistics should be collected, and false otherwise |
References frodo2.algorithms.odpop.goodsTree.GoodsTree< Val extends Addable< Val >, U extends Addable< U >, L extends Node< U > >.infeasibleUtil, leafNodeInstance, frodo2.algorithms.odpop.goodsTree.GoodsTree< Val extends Addable< Val >, U extends Addable< U >, L extends Node< U > >.localProblem, frodo2.algorithms.odpop.goodsTree.GoodsTree< Val extends Addable< Val >, U extends Addable< U >, L extends Node< U > >.maximize, numberOfChildren, frodo2.algorithms.odpop.goodsTree.GoodsTree< Val extends Addable< Val >, U extends Addable< U >, L extends Node< U > >.ownVariable, and frodo2.algorithms.odpop.goodsTree.GoodsTree< Val extends Addable< Val >, U extends Addable< U >, L extends Node< U > >.zero.
|
protected |
A dummy constructor to be used by extending classes.
| leafNodeInstance | an instance of the leaf node class |
| ownVariable | The variable that owns this tree |
| ownVariableDomain | The domain of ownVariable |
| spaces | The local problem |
| zero | The zero utility |
| numberOfChildren | The number of children of this tree |
| infeasibleUtil | The infeasible utility |
| maximize | when true we are maximizing, when false we are minimizing |
| collectStats | true when statistics should be collected, and false otherwise |
References frodo2.algorithms.odpop.goodsTree.GoodsTree< Val extends Addable< Val >, U extends Addable< U >, L extends Node< U > >.infeasibleUtil, leafNodeInstance, frodo2.algorithms.odpop.goodsTree.GoodsTree< Val extends Addable< Val >, U extends Addable< U >, L extends Node< U > >.localProblem, frodo2.algorithms.odpop.goodsTree.GoodsTree< Val extends Addable< Val >, U extends Addable< U >, L extends Node< U > >.maximize, numberOfChildren, frodo2.algorithms.odpop.goodsTree.GoodsTree< Val extends Addable< Val >, U extends Addable< U >, L extends Node< U > >.ownVariable, and frodo2.algorithms.odpop.goodsTree.GoodsTree< Val extends Addable< Val >, U extends Addable< U >, L extends Node< U > >.zero.
| frodo2.algorithms.odpop.goodsTree.InnerNodeTreeFullDomain.InnerNodeTree< Val extends Addable< Val >, U extends Addable< U >, L extends LeafNode< U > >.InnerNodeTree | ( | String | ownVariable, |
| Val[] | ownVariableDomain, | ||
| UtilitySolutionSpace< Val, U > | space, | ||
| int | numberOfChildren, | ||
| U | zero, | ||
| L | leafNodeInstance, | ||
| U | infeasibleUtil, | ||
| boolean | maximize, | ||
| boolean | collectStats ) |
A constructor.
| ownVariable | The variable ID |
| ownVariableDomain | The domain of ownVariable |
| space | The hypercube representing the local problem |
| numberOfChildren | The number of children |
| zero | The zero utility |
| leafNodeInstance | an instance of the leaf node class |
| infeasibleUtil | The infeasible utility |
| maximize | when true we are maximizing, when false we are minimizing |
| collectStats | true when statistics should be collected, and false otherwise |
References createInnerNode(), domainSize, fullInfo, hasLocalProblem, frodo2.algorithms.odpop.goodsTree.GoodsTree< Val extends Addable< Val >, U extends Addable< U >, L extends Node< U > >.infeasibleUtil, init(), leafNodeInstance, frodo2.algorithms.odpop.goodsTree.GoodsTree< Val extends Addable< Val >, U extends Addable< U >, L extends Node< U > >.localProblem, frodo2.algorithms.odpop.goodsTree.GoodsTree< Val extends Addable< Val >, U extends Addable< U >, L extends Node< U > >.maximize, numberOfChildren, frodo2.algorithms.odpop.goodsTree.GoodsTree< Val extends Addable< Val >, U extends Addable< U >, L extends Node< U > >.ownVariable, root, frodo2.algorithms.odpop.goodsTree.GoodsTree< Val extends Addable< Val >, U extends Addable< U >, L extends Node< U > >.solveLocalProblem(), updateLocalProblem(), and frodo2.algorithms.odpop.goodsTree.GoodsTree< Val extends Addable< Val >, U extends Addable< U >, L extends Node< U > >.zero.

| frodo2.algorithms.odpop.goodsTree.InnerNodeTreeFullDomain.InnerNodeTree< Val extends Addable< Val >, U extends Addable< U >, L extends LeafNode< U > >.InnerNodeTree | ( | String | ownVariable, |
| Val[] | ownVariableDomain, | ||
| List< UtilitySolutionSpace< Val, U > > | spaces, | ||
| int | numberOfChildren, | ||
| U | zero, | ||
| L | leafNodeInstance, | ||
| U | infeasibleUtil, | ||
| boolean | maximize, | ||
| boolean | collectStats ) |
A constructor.
| ownVariable | The variable ID |
| ownVariableDomain | The domain of ownVariable |
| spaces | The hypercubes representing the local problem |
| numberOfChildren | The number of children |
| zero | The zero utility |
| leafNodeInstance | an instance of the leaf node class |
| infeasibleUtil | The infeasible utility |
| maximize | when true we are maximizing, when false we are minimizing |
| collectStats | true when statistics should be collected, and false otherwise |
References createInnerNode(), domainSize, fullInfo, hasLocalProblem, frodo2.algorithms.odpop.goodsTree.GoodsTree< Val extends Addable< Val >, U extends Addable< U >, L extends Node< U > >.infeasibleUtil, init(), leafNodeInstance, frodo2.algorithms.odpop.goodsTree.GoodsTree< Val extends Addable< Val >, U extends Addable< U >, L extends Node< U > >.localProblem, frodo2.algorithms.odpop.goodsTree.GoodsTree< Val extends Addable< Val >, U extends Addable< U >, L extends Node< U > >.maximize, numberOfChildren, frodo2.algorithms.odpop.goodsTree.GoodsTree< Val extends Addable< Val >, U extends Addable< U >, L extends Node< U > >.numberOfVariables, frodo2.algorithms.odpop.goodsTree.GoodsTree< Val extends Addable< Val >, U extends Addable< U >, L extends Node< U > >.ownVariable, root, frodo2.algorithms.odpop.goodsTree.GoodsTree< Val extends Addable< Val >, U extends Addable< U >, L extends Node< U > >.solveLocalProblem(), updateLocalProblem(), and frodo2.algorithms.odpop.goodsTree.GoodsTree< Val extends Addable< Val >, U extends Addable< U >, L extends Node< U > >.zero.

| boolean frodo2.algorithms.odpop.goodsTree.InnerNodeTreeFullDomain.InnerNodeTree< Val extends Addable< Val >, U extends Addable< U >, L extends LeafNode< U > >.add | ( | Good< Val, U > | g, |
| int | sender, | ||
| HashMap< String, Val[]> | domains ) |
Adds a good to the tree.
| g | the good to be added |
| sender | the child that reported the good |
| domains | reported domains |
true when a new variable has been added, and false otherwise Reimplemented from frodo2.algorithms.odpop.goodsTree.GoodsTree< Val extends Addable< Val >, U extends Addable< U >, L extends Node< U > >.
References addNewVariable(), addVariableToTree(), branchingFactor, checkTree(), childrenVariables, createInnerNode(), domains, frodo2.algorithms.odpop.goodsTree.InnerNodeTreeFullDomain.InnerNodeTree< Val extends Addable< Val >, U extends Addable< U >, L extends LeafNode< U > >.IntArrayWrapper.getPartialAssignment(), frodo2.algorithms.odpop.Good< Val extends Addable< Val >, U extends Addable< U > >.getUtility(), frodo2.algorithms.odpop.Good< Val extends Addable< Val >, U extends Addable< U > >.getValues(), frodo2.algorithms.odpop.Good< Val extends Addable< Val >, U extends Addable< U > >.getVariables(), goodsReceived, frodo2.algorithms.odpop.goodsTree.GoodsTree< Val extends Addable< Val >, U extends Addable< U >, L extends Node< U > >.greaterThanOrEqual(), frodo2.algorithms.odpop.goodsTree.GoodsTree< Val extends Addable< Val >, U extends Addable< U >, L extends Node< U > >.infeasibleUtil, initializeUpperBoundSums(), initiateBounds(), localCounter, numberOfChildren, frodo2.algorithms.odpop.goodsTree.GoodsTree< Val extends Addable< Val >, U extends Addable< U >, L extends Node< U > >.numberOfVariables, oldUB, root, separatorSizePerChild, setOldUB(), toKey(), updatePath(), updateUpperBoundSums(), upperBoundIsInfiniteCounter, upperBounds, valuePointers, variableToDepth, and frodo2.algorithms.odpop.goodsTree.GoodsTree< Val extends Addable< Val >, U extends Addable< U >, L extends Node< U > >.zero.

|
protected |
This method adds new variables to the data structure.
| allVariables | The current variables |
| newVariables | The variables to be added |
| newDomains | The received domain values |
| sender | The child that reported the variables |
References branchingFactor, childrenVariables, frodo2.algorithms.odpop.goodsTree.GoodsTree< Val extends Addable< Val >, U extends Addable< U >, L extends Node< U > >.depthFinalVariable, frodo2.algorithms.odpop.goodsTree.GoodsTree< Val extends Addable< Val >, U extends Addable< U >, L extends Node< U > >.depthOfFirstToBeRemovedVariables, frodo2.algorithms.odpop.goodsTree.GoodsTree< Val extends Addable< Val >, U extends Addable< U >, L extends Node< U > >.depthToVariable, domains, domainSize, finalDomainSize, finalDomainSizeReceiver(), hasLocalProblem, localCounter, numberOfChildren, frodo2.algorithms.odpop.goodsTree.GoodsTree< Val extends Addable< Val >, U extends Addable< U >, L extends Node< U > >.numberOfVariables, optimalLocalPath, frodo2.algorithms.odpop.goodsTree.GoodsTree< Val extends Addable< Val >, U extends Addable< U >, L extends Node< U > >.outsideVariables, ownVariables, valuePointers, and variableToDepth.
Referenced by add().

|
protected |
This method is called when variables are received.
The new variables are placed at the root
| nbrNewVariables | The number of variables to add |
| currentPath | The path currently taken through the tree |
| indexPath | The partial path defined by the new variables |
| depth | The current depth |
| oldRoot | The old root |
| currentNode | The current node |
| possibleInconsistencies | true when the reception of a new variable can make certain solutions infeasible |
| onIndexPath | true when still following the index path |
| sender | The sender of the good |
true when a node has been added to the tree References addVariableToTree(), branchingFactor, createInnerNode(), createIntArrayWrapper(), fillTree(), frodo2.algorithms.odpop.goodsTree.InnerNodeTreeFullDomain.InnerNode< U extends Addable< U >, L extends LeafNode< U > >.getUtil(), frodo2.algorithms.odpop.goodsTree.InnerNodeTreeFullDomain.InnerNodeTree< Val extends Addable< Val >, U extends Addable< U >, L extends LeafNode< U > >.IntArrayWrapper.getValue(), frodo2.algorithms.odpop.goodsTree.GoodsTree< Val extends Addable< Val >, U extends Addable< U >, L extends Node< U > >.maximize, frodo2.algorithms.odpop.goodsTree.GoodsTree< Val extends Addable< Val >, U extends Addable< U >, L extends Node< U > >.numberOfVariables, removeInconsistencies(), frodo2.algorithms.odpop.goodsTree.InnerNodeTreeFullDomain.InnerNode< U extends Addable< U >, L extends LeafNode< U > >.setChild(), frodo2.algorithms.odpop.goodsTree.InnerNodeTreeFullDomain.InnerNode< U extends Addable< U >, L extends LeafNode< U > >.setUtil(), frodo2.algorithms.odpop.goodsTree.InnerNodeTreeFullDomain.InnerNodeTree< Val extends Addable< Val >, U extends Addable< U >, L extends LeafNode< U > >.IntArrayWrapper.setValue(), and frodo2.algorithms.odpop.goodsTree.InnerNodeTreeFullDomain.InnerNode< U extends Addable< U >, L extends LeafNode< U > >.utilCandidate().
Referenced by add(), and addVariableToTree().

| boolean frodo2.algorithms.odpop.goodsTree.InnerNodeTreeFullDomain.InnerNodeTree< Val extends Addable< Val >, U extends Addable< U >, L extends LeafNode< U > >.checkLeaf | ( | L | leaf, |
| IntArrayWrapper | currentPath, | ||
| boolean | checkUB, | ||
| U | utility, | ||
| int | sender ) |
Method to check that the utility and UB are consistent with the available information.
The utility should match exactly, but because UBs are only recomputed when necessary, and then should only decrease by such a recomputation, the stored UB should be at least as high as the real UB
| leaf | the leaf to be checked |
| currentPath | the path to this leaf |
| checkUB | true when the UB must be checked |
| utility | the utility reported by the sender |
| sender | the sender of the good |
References childrenVariables, frodo2.algorithms.odpop.goodsTree.InnerNodeTreeFullDomain.InnerNodeTree< Val extends Addable< Val >, U extends Addable< U >, L extends LeafNode< U > >.IntArrayWrapper.getPartialAssignment(), getUtilityLocalProblem(), goodsReceived, frodo2.algorithms.odpop.goodsTree.GoodsTree< Val extends Addable< Val >, U extends Addable< U >, L extends Node< U > >.greaterThanOrEqual(), frodo2.algorithms.odpop.goodsTree.GoodsTree< Val extends Addable< Val >, U extends Addable< U >, L extends Node< U > >.infeasibleUtil, numberOfChildren, oldUB, upperBounds, and frodo2.algorithms.odpop.goodsTree.GoodsTree< Val extends Addable< Val >, U extends Addable< U >, L extends Node< U > >.zero.
Referenced by createLeaf(), createLeaf(), createPathWithUB(), and fillTree().

|
protected |
This method checks the tree on the following properties.
| depth | the current depth |
| currentNode | the current node being visited |
| currentPath | the current path taken |
| UB | the current UB |
| checkLeafs | true when the leaves are to be checked |
| checkSupport | check whether existing leaf nodes actually have support |
| checkUtil | true when utility values should be checked |
References branchingFactor, and checkTree().
Referenced by add(), checkTree(), fillTree(), and initiateBounds().

|
private |
Method to check the precomputation of the upper bound sums.
| child | the child that reported a new bound |
| newBound | the new bound |
true References checkUpperBoundSums(), numberOfChildren, upperBounds, upperBoundSums, and frodo2.algorithms.odpop.goodsTree.GoodsTree< Val extends Addable< Val >, U extends Addable< U >, L extends Node< U > >.zero.
Referenced by checkUpperBoundSums(), and updateUpperBoundSums().

|
private |
Method to check the initialization of the tree.
| depth | the current depth |
| currentPath | the current path |
| currentNode | the current node |
| h | the hypercube to compare with |
References branchingFactor, compareWithHypercube(), frodo2.algorithms.odpop.goodsTree.GoodsTree< Val extends Addable< Val >, U extends Addable< U >, L extends Node< U > >.depthFinalVariable, frodo2.algorithms.odpop.goodsTree.GoodsTree< Val extends Addable< Val >, U extends Addable< U >, L extends Node< U > >.depthToVariable, domains, and frodo2.algorithms.odpop.goodsTree.InnerNodeTreeFullDomain.InnerNode< U extends Addable< U >, L extends LeafNode< U > >.getChild().

| boolean frodo2.algorithms.odpop.goodsTree.InnerNodeTreeFullDomain.InnerNodeTree< Val extends Addable< Val >, U extends Addable< U >, L extends LeafNode< U > >.compareWithHypercube | ( | UtilitySolutionSpace< Val, U > | h | ) |
Method to check the initialization of the tree.
| h | the hypercube to compare with |
References compareWithHypercube(), frodo2.algorithms.odpop.goodsTree.GoodsTree< Val extends Addable< Val >, U extends Addable< U >, L extends Node< U > >.depthToVariable, domains, frodo2.algorithms.odpop.goodsTree.GoodsTree< Val extends Addable< Val >, U extends Addable< U >, L extends Node< U > >.numberOfVariables, and root.
Referenced by compareWithHypercube(), and compareWithHypercube().

|
protected |
Create an inner node with a specified number of children.
| numberOfChildren | the number of children this innernode should have |
References numberOfChildren.
Referenced by add(), addVariableToTree(), createPathNoUB(), createPathWithUB(), fillTree(), InnerNodeTree(), and InnerNodeTree().
|
protected |
Create an inner node with the specified number of children.
| children | an array of child nodes |
| IntArrayWrapper frodo2.algorithms.odpop.goodsTree.InnerNodeTreeFullDomain.InnerNodeTree< Val extends Addable< Val >, U extends Addable< U >, L extends LeafNode< U > >.createIntArrayWrapper | ( | int | size | ) |
| size | the size of an array |
size | IntArrayWrapper frodo2.algorithms.odpop.goodsTree.InnerNodeTreeFullDomain.InnerNodeTree< Val extends Addable< Val >, U extends Addable< U >, L extends LeafNode< U > >.createIntArrayWrapper | ( | int[] | array | ) |
| array | an array to be wrapped |
Referenced by addVariableToTree(), and toKey().
|
protected |
Method to create a new leaf node.
| currentPath | The path to the leaf |
| withUB | true when the upper bound must be set |
References frodo2.solutionSpaces.AddableDelayed< T extends Addable< T > >.addDelayed(), checkLeaf(), childrenVariables, frodo2.algorithms.odpop.goodsTree.GoodsTree< Val extends Addable< Val >, U extends Addable< U >, L extends Node< U > >.COLLECT_STATISTICS, frodo2.algorithms.odpop.goodsTree.GoodsTree< Val extends Addable< Val >, U extends Addable< U >, L extends Node< U > >.countLeafNode(), frodo2.algorithms.odpop.goodsTree.InnerNodeTreeFullDomain.LeafNode< U extends Addable< U > >.fromBooleanArrayToInt(), frodo2.algorithms.odpop.goodsTree.InnerNodeTreeFullDomain.InnerNodeTree< Val extends Addable< Val >, U extends Addable< U >, L extends LeafNode< U > >.IntArrayWrapper.getPartialAssignment(), getUtilityLocalProblem(), goodsReceived, hasSupport(), frodo2.algorithms.odpop.goodsTree.GoodsTree< Val extends Addable< Val >, U extends Addable< U >, L extends Node< U > >.infeasibleUtil, leafNodeInstance, numberOfChildren, powersOf2, frodo2.solutionSpaces.AddableDelayed< T extends Addable< T > >.resolve(), and upperBoundSums.

|
protected |
Method to create a new leaf node.
| currentPath | The path to the leaf |
| g | the received good |
| child | the child that reported it |
| withUB | true when the upper bound must be set |
References frodo2.solutionSpaces.AddableDelayed< T extends Addable< T > >.addDelayed(), checkLeaf(), childrenVariables, frodo2.algorithms.odpop.goodsTree.GoodsTree< Val extends Addable< Val >, U extends Addable< U >, L extends Node< U > >.COLLECT_STATISTICS, frodo2.algorithms.odpop.goodsTree.GoodsTree< Val extends Addable< Val >, U extends Addable< U >, L extends Node< U > >.countLeafNode(), frodo2.algorithms.odpop.goodsTree.InnerNodeTreeFullDomain.LeafNode< U extends Addable< U > >.fromBooleanArrayToInt(), frodo2.algorithms.odpop.goodsTree.InnerNodeTreeFullDomain.InnerNodeTree< Val extends Addable< Val >, U extends Addable< U >, L extends LeafNode< U > >.IntArrayWrapper.getPartialAssignment(), frodo2.algorithms.odpop.Good< Val extends Addable< Val >, U extends Addable< U > >.getUtility(), getUtilityLocalProblem(), goodsReceived, hasSupport(), frodo2.algorithms.odpop.goodsTree.GoodsTree< Val extends Addable< Val >, U extends Addable< U >, L extends Node< U > >.infeasibleUtil, leafNodeInstance, numberOfChildren, powersOf2, frodo2.solutionSpaces.AddableDelayed< T extends Addable< T > >.resolve(), and upperBoundSums.
Referenced by createPathNoUB(), createPathWithUB(), and fillTree().

|
protected |
Given a partial path, this method creates the path in the tree.
This method should only be called after domain information is complete!
| depth | the current depth |
| currentPath | the path taken |
| partialPath | the partial path defined by the received good |
| real | true when we are on a real path, and false otherwise |
| g | the received good |
| sender | the sender of the good |
References branchingFactor, createInnerNode(), createLeaf(), createPathNoUB(), frodo2.algorithms.odpop.goodsTree.GoodsTree< Val extends Addable< Val >, U extends Addable< U >, L extends Node< U > >.depthFinalVariable, frodo2.algorithms.odpop.goodsTree.GoodsTree< Val extends Addable< Val >, U extends Addable< U >, L extends Node< U > >.depthToVariable, domains, frodo2.algorithms.odpop.goodsTree.InnerNodeTreeFullDomain.InnerNode< U extends Addable< U >, L extends LeafNode< U > >.getMaxChild(), frodo2.algorithms.odpop.goodsTree.InnerNodeTreeFullDomain.Node< U extends Addable< U > >.getUtil(), frodo2.algorithms.odpop.goodsTree.GoodsTree< Val extends Addable< Val >, U extends Addable< U >, L extends Node< U > >.maximize, frodo2.algorithms.odpop.goodsTree.InnerNodeTreeFullDomain.InnerNode< U extends Addable< U >, L extends LeafNode< U > >.setChild(), frodo2.algorithms.odpop.goodsTree.InnerNodeTreeFullDomain.InnerNode< U extends Addable< U >, L extends LeafNode< U > >.setUtil(), frodo2.algorithms.odpop.goodsTree.InnerNodeTreeFullDomain.InnerNodeTree< Val extends Addable< Val >, U extends Addable< U >, L extends LeafNode< U > >.IntArrayWrapper.setValue(), and frodo2.algorithms.odpop.goodsTree.InnerNodeTreeFullDomain.Node< U extends Addable< U > >.utilCandidate().
Referenced by createPathNoUB().

|
private |
Given a partial path, this method creates the path in the tree.
This method should only be called after domain information is complete!
| depth | the current depth |
| currentPath | the path taking in the tree |
| partialPath | the partial path defined by the received good |
| real | true when we are on a real path, and false otherwise |
| g | the received good |
| sender | the sender of the good |
References branchingFactor, checkLeaf(), createInnerNode(), createLeaf(), createPathWithUB(), frodo2.algorithms.odpop.goodsTree.GoodsTree< Val extends Addable< Val >, U extends Addable< U >, L extends Node< U > >.depthFinalVariable, frodo2.algorithms.odpop.goodsTree.GoodsTree< Val extends Addable< Val >, U extends Addable< U >, L extends Node< U > >.depthToVariable, domains, frodo2.algorithms.odpop.goodsTree.InnerNodeTreeFullDomain.InnerNode< U extends Addable< U >, L extends LeafNode< U > >.getMaxChild(), frodo2.algorithms.odpop.goodsTree.InnerNodeTreeFullDomain.InnerNode< U extends Addable< U >, L extends LeafNode< U > >.getUB(), frodo2.algorithms.odpop.goodsTree.InnerNodeTreeFullDomain.InnerNode< U extends Addable< U >, L extends LeafNode< U > >.getUtil(), frodo2.algorithms.odpop.Good< Val extends Addable< Val >, U extends Addable< U > >.getUtility(), frodo2.algorithms.odpop.goodsTree.GoodsTree< Val extends Addable< Val >, U extends Addable< U >, L extends Node< U > >.maximize, frodo2.algorithms.odpop.goodsTree.InnerNodeTreeFullDomain.InnerNode< U extends Addable< U >, L extends LeafNode< U > >.setChild(), frodo2.algorithms.odpop.goodsTree.InnerNodeTreeFullDomain.InnerNode< U extends Addable< U >, L extends LeafNode< U > >.setUB(), frodo2.algorithms.odpop.goodsTree.InnerNodeTreeFullDomain.InnerNode< U extends Addable< U >, L extends LeafNode< U > >.setUtil(), frodo2.algorithms.odpop.goodsTree.InnerNodeTreeFullDomain.InnerNodeTree< Val extends Addable< Val >, U extends Addable< U >, L extends LeafNode< U > >.IntArrayWrapper.setValue(), frodo2.algorithms.odpop.goodsTree.InnerNodeTreeFullDomain.InnerNode< U extends Addable< U >, L extends LeafNode< U > >.ubCandidate(), and frodo2.algorithms.odpop.goodsTree.InnerNodeTreeFullDomain.InnerNode< U extends Addable< U >, L extends LeafNode< U > >.utilCandidate().
Referenced by createPathWithUB().

|
private |
Fills a part of the tree that has been created by the reception of a new domain value.
| example | the example that is to be copied |
| depth | the current depth |
| currentPath | the current path taken through the tree. Is only up to date up to depth |
| onLocalPath | true when we are still following the path of the currently best local solution |
| withUB | true when the UB must be instatiated as well |
| onPartialPath | true then the followed path is the same as the path defined by the received good |
| partialPath | the path defined by the received good |
| g | the received good |
| sender | the sender of the good |
| ex |
References branchingFactor, frodo2.algorithms.odpop.goodsTree.InnerNodeTreeFullDomain.InnerNode< U extends Addable< U >, L extends LeafNode< U > >.check2(), checkLeaf(), checkTree(), createInnerNode(), createLeaf(), frodo2.algorithms.odpop.goodsTree.GoodsTree< Val extends Addable< Val >, U extends Addable< U >, L extends Node< U > >.depthFinalVariable, frodo2.algorithms.odpop.goodsTree.GoodsTree< Val extends Addable< Val >, U extends Addable< U >, L extends Node< U > >.depthToVariable, domains, fillTree(), frodo2.algorithms.odpop.goodsTree.InnerNodeTreeFullDomain.InnerNode< U extends Addable< U >, L extends LeafNode< U > >.getChild(), frodo2.algorithms.odpop.goodsTree.InnerNodeTreeFullDomain.InnerNode< U extends Addable< U >, L extends LeafNode< U > >.getMaxChild(), frodo2.algorithms.odpop.goodsTree.InnerNodeTreeFullDomain.InnerNode< U extends Addable< U >, L extends LeafNode< U > >.getUB(), frodo2.algorithms.odpop.goodsTree.InnerNodeTreeFullDomain.InnerNode< U extends Addable< U >, L extends LeafNode< U > >.getUtil(), frodo2.algorithms.odpop.goodsTree.GoodsTree< Val extends Addable< Val >, U extends Addable< U >, L extends Node< U > >.greaterThanOrEqual(), frodo2.algorithms.odpop.goodsTree.GoodsTree< Val extends Addable< Val >, U extends Addable< U >, L extends Node< U > >.maximize, oldUB, frodo2.algorithms.odpop.goodsTree.InnerNodeTreeFullDomain.InnerNode< U extends Addable< U >, L extends LeafNode< U > >.setChild(), frodo2.algorithms.odpop.goodsTree.InnerNodeTreeFullDomain.InnerNode< U extends Addable< U >, L extends LeafNode< U > >.setUB(), frodo2.algorithms.odpop.goodsTree.InnerNodeTreeFullDomain.InnerNode< U extends Addable< U >, L extends LeafNode< U > >.setUtil(), frodo2.algorithms.odpop.goodsTree.InnerNodeTreeFullDomain.InnerNode< U extends Addable< U >, L extends LeafNode< U > >.ubCandidate(), and frodo2.algorithms.odpop.goodsTree.InnerNodeTreeFullDomain.InnerNode< U extends Addable< U >, L extends LeafNode< U > >.utilCandidate().
Referenced by addVariableToTree(), and fillTree().

|
protected |
logs the reception of a domain size info message
References fullInfo, fullInfoCounter, frodo2.algorithms.odpop.goodsTree.GoodsTree< Val extends Addable< Val >, U extends Addable< U >, L extends Node< U > >.numberOfVariables, and frodo2.algorithms.odpop.goodsTree.GoodsTree< Val extends Addable< Val >, U extends Addable< U >, L extends Node< U > >.totalSeparatorSpaceSize.
Referenced by addNewVariable().
|
private |
Method to find the maximal upper bound in the tree.
Used for debugging.
| depth | the current depth |
| currentNode | the current node |
References branchingFactor, frodo2.algorithms.odpop.goodsTree.GoodsTree< Val extends Addable< Val >, U extends Addable< U >, L extends Node< U > >.depthFinalVariable, findMaxUB(), frodo2.algorithms.odpop.goodsTree.InnerNodeTreeFullDomain.InnerNode< U extends Addable< U >, L extends LeafNode< U > >.getChild(), frodo2.algorithms.odpop.goodsTree.GoodsTree< Val extends Addable< Val >, U extends Addable< U >, L extends Node< U > >.greaterThanOrEqual(), frodo2.algorithms.odpop.goodsTree.GoodsTree< Val extends Addable< Val >, U extends Addable< U >, L extends Node< U > >.infeasibleUtil, frodo2.algorithms.odpop.goodsTree.InnerNodeTreeFullDomain.Node< U extends Addable< U > >.isAlive(), and upperBoundSums.
Referenced by findMaxUB().

|
private |
Used to print thte contents of the tree.
| depth | the current depth in the tree |
| currentPath | the path taken through the tree |
| currentNode | the curent node being visited |
References branchingFactor, frodo2.algorithms.odpop.goodsTree.GoodsTree< Val extends Addable< Val >, U extends Addable< U >, L extends Node< U > >.depthFinalVariable, frodo2.algorithms.odpop.goodsTree.GoodsTree< Val extends Addable< Val >, U extends Addable< U >, L extends Node< U > >.depthToVariable, domains, domainSize, generateAssignments(), and frodo2.algorithms.odpop.goodsTree.InnerNodeTreeFullDomain.InnerNode< U extends Addable< U >, L extends LeafNode< U > >.getChild().
Referenced by generateAssignments(), and toString().

| Good< Val, U > frodo2.algorithms.odpop.goodsTree.InnerNodeTreeFullDomain.InnerNodeTree< Val extends Addable< Val >, U extends Addable< U >, L extends LeafNode< U > >.getAmax | ( | ) |
Reimplemented from frodo2.algorithms.odpop.goodsTree.GoodsTree< Val extends Addable< Val >, U extends Addable< U >, L extends Node< U > >.
References branchingFactor, frodo2.algorithms.odpop.goodsTree.GoodsTree< Val extends Addable< Val >, U extends Addable< U >, L extends Node< U > >.depthOfFirstToBeRemovedVariables, frodo2.algorithms.odpop.goodsTree.GoodsTree< Val extends Addable< Val >, U extends Addable< U >, L extends Node< U > >.depthToVariable, frodo2.algorithms.odpop.goodsTree.GoodsTree< Val extends Addable< Val >, U extends Addable< U >, L extends Node< U > >.domainElementClass, domains, domainSize, getAmax(), frodo2.algorithms.odpop.goodsTree.InnerNodeTreeFullDomain.InnerNode< U extends Addable< U >, L extends LeafNode< U > >.getChild(), frodo2.algorithms.odpop.goodsTree.InnerNodeTreeFullDomain.InnerNode< U extends Addable< U >, L extends LeafNode< U > >.getMaxChild(), frodo2.algorithms.odpop.goodsTree.GoodsTree< Val extends Addable< Val >, U extends Addable< U >, L extends Node< U > >.greaterThan(), frodo2.algorithms.odpop.goodsTree.GoodsTree< Val extends Addable< Val >, U extends Addable< U >, L extends Node< U > >.greaterThanOrEqual(), hasLocalProblem, frodo2.algorithms.odpop.goodsTree.GoodsTree< Val extends Addable< Val >, U extends Addable< U >, L extends Node< U > >.infeasibleUtil, localUpperBound, frodo2.algorithms.odpop.goodsTree.GoodsTree< Val extends Addable< Val >, U extends Addable< U >, L extends Node< U > >.numberOfVariables, frodo2.algorithms.odpop.goodsTree.GoodsTree< Val extends Addable< Val >, U extends Addable< U >, L extends Node< U > >.outsideVariables, root, and upperBoundSums.
Referenced by getAmax().

| void frodo2.algorithms.odpop.goodsTree.InnerNodeTreeFullDomain.InnerNodeTree< Val extends Addable< Val >, U extends Addable< U >, L extends LeafNode< U > >.getBestAssignmentForOwnVariable | ( | HashMap< String, Val > | contextMap | ) |
Reimplemented from frodo2.algorithms.odpop.goodsTree.GoodsTree< Val extends Addable< Val >, U extends Addable< U >, L extends Node< U > >.
References frodo2.algorithms.odpop.goodsTree.GoodsTree< Val extends Addable< Val >, U extends Addable< U >, L extends Node< U > >.depthFinalVariable, frodo2.algorithms.odpop.goodsTree.GoodsTree< Val extends Addable< Val >, U extends Addable< U >, L extends Node< U > >.depthToVariable, getOwnVariableOptions(), frodo2.algorithms.odpop.goodsTree.GoodsTree< Val extends Addable< Val >, U extends Addable< U >, L extends Node< U > >.numberOfVariables, and variableToDepth.

| String[] frodo2.algorithms.odpop.goodsTree.InnerNodeTreeFullDomain.InnerNodeTree< Val extends Addable< Val >, U extends Addable< U >, L extends LeafNode< U > >.getChildSeparatorReportingOrder | ( | int | child | ) |
Returns the variables in the childs separator in the order it reported them.
| child | the child who's separator we want to know |
Reimplemented from frodo2.algorithms.odpop.goodsTree.GoodsTree< Val extends Addable< Val >, U extends Addable< U >, L extends Node< U > >.
References childrenVariablesReportingOrder.
| int frodo2.algorithms.odpop.goodsTree.InnerNodeTreeFullDomain.InnerNodeTree< Val extends Addable< Val >, U extends Addable< U >, L extends LeafNode< U > >.getChildSeparatorSize | ( | int | child | ) |
| child | the child who's separator size is requested |
| HashMap< String, Val > frodo2.algorithms.odpop.goodsTree.InnerNodeTreeFullDomain.InnerNodeTree< Val extends Addable< Val >, U extends Addable< U >, L extends LeafNode< U > >.getChildValues | ( | HashMap< String, Val > | parentContext, |
| int | child ) |
Given a map that maps variables to values, this method returns the values belonging to the variables in a child's separator.
| parentContext | the value map |
| child | the child for who we want to know the separator values |
Reimplemented from frodo2.algorithms.odpop.goodsTree.GoodsTree< Val extends Addable< Val >, U extends Addable< U >, L extends Node< U > >.
References childrenVariablesReportingOrder.
| Val[][] frodo2.algorithms.odpop.goodsTree.InnerNodeTreeFullDomain.InnerNodeTree< Val extends Addable< Val >, U extends Addable< U >, L extends LeafNode< U > >.getDomains | ( | ) |
Reimplemented from frodo2.algorithms.odpop.goodsTree.GoodsTree< Val extends Addable< Val >, U extends Addable< U >, L extends Node< U > >.
References frodo2.algorithms.odpop.goodsTree.GoodsTree< Val extends Addable< Val >, U extends Addable< U >, L extends Node< U > >.depthToVariable, domains, getDomains(), and frodo2.algorithms.odpop.goodsTree.GoodsTree< Val extends Addable< Val >, U extends Addable< U >, L extends Node< U > >.numberOfVariables.
Referenced by getDomains().

| int[] frodo2.algorithms.odpop.goodsTree.InnerNodeTreeFullDomain.InnerNodeTree< Val extends Addable< Val >, U extends Addable< U >, L extends LeafNode< U > >.getFinalDomainSize | ( | ) |
Reimplemented from frodo2.algorithms.odpop.goodsTree.GoodsTree< Val extends Addable< Val >, U extends Addable< U >, L extends Node< U > >.
References frodo2.algorithms.odpop.goodsTree.GoodsTree< Val extends Addable< Val >, U extends Addable< U >, L extends Node< U > >.depthOfFirstToBeRemovedVariables, finalDomainSize, and stillToSend.
|
protected |
Given a possibly partial path, this method finds the maximal utility any option can provide.
| path | the (possibly partial) path to be followed |
| optimalPath | the path trough the tree that leads to the optimal leafnode |
| maxUtil | the opimal utility |
| depth | the current depth |
| currentNode | the current node |
References frodo2.algorithms.odpop.goodsTree.GoodsTree< Val extends Addable< Val >, U extends Addable< U >, L extends Node< U > >.depthFinalVariable, domainSize, frodo2.algorithms.odpop.goodsTree.InnerNodeTreeFullDomain.InnerNode< U extends Addable< U >, L extends LeafNode< U > >.getChild(), getOwnVariableOptions(), and frodo2.algorithms.odpop.goodsTree.GoodsTree< Val extends Addable< Val >, U extends Addable< U >, L extends Node< U > >.greaterThan().

|
protected |
Given the assignment of variables in its separator, this method returns the utility for all domain elements of the own variable.
| assignments | collection of assignments of variables in the separator |
References frodo2.algorithms.odpop.goodsTree.GoodsTree< Val extends Addable< Val >, U extends Addable< U >, L extends Node< U > >.depthFinalVariable, frodo2.algorithms.odpop.goodsTree.GoodsTree< Val extends Addable< Val >, U extends Addable< U >, L extends Node< U > >.depthToVariable, getOwnVariableOptions(), frodo2.algorithms.odpop.goodsTree.GoodsTree< Val extends Addable< Val >, U extends Addable< U >, L extends Node< U > >.infeasibleUtil, frodo2.algorithms.odpop.goodsTree.GoodsTree< Val extends Addable< Val >, U extends Addable< U >, L extends Node< U > >.numberOfVariables, root, and valuePointers.
Referenced by getBestAssignmentForOwnVariable(), getOwnVariableOptions(), and getOwnVariableOptions().

|
protected |
Given an assignment to all the variables, represented as a path in the tree, this method returns the utility given by the variable's local problem.
| currentPath | the variable assignment |
References frodo2.algorithms.odpop.goodsTree.GoodsTree< Val extends Addable< Val >, U extends Addable< U >, L extends Node< U > >.depthToVariable, frodo2.algorithms.odpop.goodsTree.GoodsTree< Val extends Addable< Val >, U extends Addable< U >, L extends Node< U > >.domainElementClass, domains, getUtilityLocalProblem(), hasLocalProblem, frodo2.algorithms.odpop.goodsTree.GoodsTree< Val extends Addable< Val >, U extends Addable< U >, L extends Node< U > >.localProblem, frodo2.algorithms.odpop.goodsTree.GoodsTree< Val extends Addable< Val >, U extends Addable< U >, L extends Node< U > >.numberOfVariables, and frodo2.algorithms.odpop.goodsTree.GoodsTree< Val extends Addable< Val >, U extends Addable< U >, L extends Node< U > >.zero.
Referenced by checkLeaf(), createLeaf(), createLeaf(), getUtilityLocalProblem(), hasSupport(), and removeInconsistencies().

| boolean frodo2.algorithms.odpop.goodsTree.InnerNodeTreeFullDomain.InnerNodeTree< Val extends Addable< Val >, U extends Addable< U >, L extends LeafNode< U > >.hasFullInfo | ( | ) |
| boolean frodo2.algorithms.odpop.goodsTree.InnerNodeTreeFullDomain.InnerNodeTree< Val extends Addable< Val >, U extends Addable< U >, L extends LeafNode< U > >.hasMore | ( | ) |
|
protected |
Method to check whether a particular leaf node has support, i.e.
some child has reported an assignment compatible with currentPath
| currentPath | the path that leads to the leaf |
References childrenVariables, frodo2.algorithms.odpop.goodsTree.InnerNodeTreeFullDomain.InnerNodeTree< Val extends Addable< Val >, U extends Addable< U >, L extends LeafNode< U > >.IntArrayWrapper.getPartialAssignment(), getUtilityLocalProblem(), goodsReceived, hasSupport(), frodo2.algorithms.odpop.goodsTree.GoodsTree< Val extends Addable< Val >, U extends Addable< U >, L extends Node< U > >.infeasibleUtil, numberOfChildren, and storeReceivedGoods.
Referenced by createLeaf(), createLeaf(), and hasSupport().

|
protected |
Initialize all the variables of the tree.
| numberOfChildren | The number of children |
| zero | The zero utility |
References branchingFactor, childrenVariables, childrenVariablesReportingOrder, frodo2.algorithms.odpop.goodsTree.GoodsTree< Val extends Addable< Val >, U extends Addable< U >, L extends Node< U > >.depthFinalVariable, frodo2.algorithms.odpop.goodsTree.GoodsTree< Val extends Addable< Val >, U extends Addable< U >, L extends Node< U > >.depthToVariable, domains, domainSize, finalDomainSize, fullInfoCounter, goodsReceived, init(), localCounter, frodo2.algorithms.odpop.goodsTree.GoodsTree< Val extends Addable< Val >, U extends Addable< U >, L extends Node< U > >.localProblem, maxNumberLocalProblemOccurences, numberOfChildren, frodo2.algorithms.odpop.goodsTree.GoodsTree< Val extends Addable< Val >, U extends Addable< U >, L extends Node< U > >.numberOfVariables, frodo2.algorithms.odpop.goodsTree.GoodsTree< Val extends Addable< Val >, U extends Addable< U >, L extends Node< U > >.ownVarDomain, frodo2.algorithms.odpop.goodsTree.GoodsTree< Val extends Addable< Val >, U extends Addable< U >, L extends Node< U > >.ownVariable, ownVariables, powersOf2, separatorSizePerChild, toBeProcessedDomains, unpackedVariablesPerChild, upperBoundIsInfiniteCounter, upperBoundIsMinInfiniteCounter, upperBounds, valuePointers, variableToDepth, and frodo2.algorithms.odpop.goodsTree.GoodsTree< Val extends Addable< Val >, U extends Addable< U >, L extends Node< U > >.zero.
Referenced by init(), InnerNodeTree(), and InnerNodeTree().

|
protected |
Initializes both the sum of bounds array and the powersOf2 array.
References frodo2.solutionSpaces.AddableDelayed< T extends Addable< T > >.addDelayed(), hasLocalProblem, initializeUpperBoundSums(), localUpperBound, numberOfChildren, optimalLocalUtility, frodo2.solutionSpaces.AddableDelayed< T extends Addable< T > >.resolve(), upperBounds, upperBoundSums, and frodo2.algorithms.odpop.goodsTree.GoodsTree< Val extends Addable< Val >, U extends Addable< U >, L extends Node< U > >.zero.
Referenced by add(), and initializeUpperBoundSums().

|
protected |
This method instantiates the upper bounds.
| currentNode | the node currently being visited |
| currentPath | the path taken |
| depth | the current depth |
| onLocalPath | true when we are still following the path of the currently best local solution |
| g | the received good |
| sender | the sender of the good |
References branchingFactor, checkTree(), frodo2.algorithms.odpop.goodsTree.GoodsTree< Val extends Addable< Val >, U extends Addable< U >, L extends Node< U > >.depthFinalVariable, frodo2.algorithms.odpop.goodsTree.GoodsTree< Val extends Addable< Val >, U extends Addable< U >, L extends Node< U > >.depthToVariable, domains, frodo2.algorithms.odpop.goodsTree.InnerNodeTreeFullDomain.InnerNode< U extends Addable< U >, L extends LeafNode< U > >.getChild(), frodo2.algorithms.odpop.goodsTree.InnerNodeTreeFullDomain.InnerNode< U extends Addable< U >, L extends LeafNode< U > >.getUtil(), initiateBounds(), frodo2.algorithms.odpop.goodsTree.GoodsTree< Val extends Addable< Val >, U extends Addable< U >, L extends Node< U > >.maximize, optimalLocalPath, frodo2.algorithms.odpop.goodsTree.InnerNodeTreeFullDomain.InnerNode< U extends Addable< U >, L extends LeafNode< U > >.ubCandidate(), upperBoundSums, and frodo2.algorithms.odpop.goodsTree.InnerNodeTreeFullDomain.InnerNode< U extends Addable< U >, L extends LeafNode< U > >.utilCandidate().
Referenced by add(), and initiateBounds().

| boolean frodo2.algorithms.odpop.goodsTree.InnerNodeTreeFullDomain.InnerNodeTree< Val extends Addable< Val >, U extends Addable< U >, L extends LeafNode< U > >.isValuationSufficient | ( | ) |
Reimplemented from frodo2.algorithms.odpop.goodsTree.GoodsTree< Val extends Addable< Val >, U extends Addable< U >, L extends Node< U > >.
References frodo2.algorithms.odpop.goodsTree.GoodsTree< Val extends Addable< Val >, U extends Addable< U >, L extends Node< U > >.greaterThan(), frodo2.algorithms.odpop.goodsTree.GoodsTree< Val extends Addable< Val >, U extends Addable< U >, L extends Node< U > >.greaterThanOrEqual(), hasLocalProblem, frodo2.algorithms.odpop.goodsTree.GoodsTree< Val extends Addable< Val >, U extends Addable< U >, L extends Node< U > >.infeasibleUtil, localUpperBound, and root.

| boolean frodo2.algorithms.odpop.goodsTree.InnerNodeTreeFullDomain.InnerNodeTree< Val extends Addable< Val >, U extends Addable< U >, L extends LeafNode< U > >.knowsVariable | ( | String | variable | ) |
Reimplemented from frodo2.algorithms.odpop.goodsTree.GoodsTree< Val extends Addable< Val >, U extends Addable< U >, L extends Node< U > >.
References variableToDepth.
|
protected |
Used to check whether the local path chosen is still alive For debuggin purposes only.
| depth | The current depth |
| currentNode | The current node being visisted |
true when the current locally optimal solution is still allowed References frodo2.algorithms.odpop.goodsTree.GoodsTree< Val extends Addable< Val >, U extends Addable< U >, L extends Node< U > >.depthFinalVariable, and localPathAlive().
Referenced by localPathAlive().

| boolean frodo2.algorithms.odpop.goodsTree.InnerNodeTreeFullDomain.InnerNodeTree< Val extends Addable< Val >, U extends Addable< U >, L extends LeafNode< U > >.notEnoughInfo | ( | ) |
|
protected |
Method to check whether the (possibly) partial path is alive, i.e.
all inner nodes on the path either are alive or do not exists
| path | the path to be checked |
| depth | the current depth |
| currentNode | the currently visited node |
true when the path is alive or does not exist, and false otherwise References frodo2.algorithms.odpop.goodsTree.GoodsTree< Val extends Addable< Val >, U extends Addable< U >, L extends Node< U > >.depthFinalVariable, and pathAlive().
Referenced by pathAlive(), removeAMax(), and updateLocalProblem().

| boolean frodo2.algorithms.odpop.goodsTree.InnerNodeTreeFullDomain.InnerNodeTree< Val extends Addable< Val >, U extends Addable< U >, L extends LeafNode< U > >.pathExists | ( | Val[] | values | ) |
Reimplemented from frodo2.algorithms.odpop.goodsTree.GoodsTree< Val extends Addable< Val >, U extends Addable< U >, L extends Node< U > >.
References frodo2.algorithms.odpop.goodsTree.GoodsTree< Val extends Addable< Val >, U extends Addable< U >, L extends Node< U > >.depthToVariable, frodo2.algorithms.odpop.goodsTree.GoodsTree< Val extends Addable< Val >, U extends Addable< U >, L extends Node< U > >.numberOfVariables, pathExists(), root, and valuePointers.
Referenced by pathExists().

|
protected |
This method recalculates the upper bound for a particular node.
If the upper bound of this node is already up to date nothing happens. If not, the method searches further down the tree to find the actual current upper bound
| depth | the current depth |
| currentNodeUncast | the node that is currently visited |
| UBtoBeat | the UB that needs to be beat |
| recalculateUtil | true when the recalculation of the utility can make a difference higher up |
| recalculateUB | true when the recalculation of the upperbound can make a difference higher up |
References frodo2.algorithms.odpop.goodsTree.InnerNodeTreeFullDomain.InnerNode< U extends Addable< U >, L extends LeafNode< U > >.getMaxUB(), frodo2.algorithms.odpop.goodsTree.GoodsTree< Val extends Addable< Val >, U extends Addable< U >, L extends Node< U > >.infeasibleUtil, frodo2.algorithms.odpop.goodsTree.InnerNodeTreeFullDomain.Node< U extends Addable< U > >.isAlive(), recalculateUB(), and frodo2.algorithms.odpop.goodsTree.InnerNodeTreeFullDomain.InnerNode< U extends Addable< U >, L extends LeafNode< U > >.recalculateUtil().
Referenced by recalculateUB(), removePath(), and setChildDone().

| void frodo2.algorithms.odpop.goodsTree.InnerNodeTreeFullDomain.InnerNodeTree< Val extends Addable< Val >, U extends Addable< U >, L extends LeafNode< U > >.removeAMax | ( | ) |
Reimplemented from frodo2.algorithms.odpop.goodsTree.GoodsTree< Val extends Addable< Val >, U extends Addable< U >, L extends Node< U > >.
References hasLocalProblem, frodo2.algorithms.odpop.goodsTree.GoodsTree< Val extends Addable< Val >, U extends Addable< U >, L extends Node< U > >.infeasibleUtil, localCounter, localUpperBound, maxNumberLocalProblemOccurences, pathAlive(), removePath(), root, and updateLocalProblem().

|
protected |
This method checks whether any of the leafnodes have become infeasible due to the addition of a new variable.
| currentNode | the currently visited node |
| depth | the depth of this node |
| currentPath | the path take through the tree to get here |
References branchingFactor, frodo2.algorithms.odpop.goodsTree.GoodsTree< Val extends Addable< Val >, U extends Addable< U >, L extends Node< U > >.depthFinalVariable, frodo2.algorithms.odpop.goodsTree.InnerNodeTreeFullDomain.InnerNode< U extends Addable< U >, L extends LeafNode< U > >.getChild(), frodo2.algorithms.odpop.goodsTree.InnerNodeTreeFullDomain.InnerNode< U extends Addable< U >, L extends LeafNode< U > >.getUtil(), getUtilityLocalProblem(), frodo2.algorithms.odpop.goodsTree.GoodsTree< Val extends Addable< Val >, U extends Addable< U >, L extends Node< U > >.infeasibleUtil, frodo2.algorithms.odpop.goodsTree.GoodsTree< Val extends Addable< Val >, U extends Addable< U >, L extends Node< U > >.maximize, removeInconsistencies(), and frodo2.algorithms.odpop.goodsTree.InnerNodeTreeFullDomain.InnerNode< U extends Addable< U >, L extends LeafNode< U > >.utilCandidate().
Referenced by addVariableToTree(), and removeInconsistencies().

|
protected |
This method finds the leaf node corresponding to the current best assignment, removes all its children and sets its parent node to a dead node.
| depth | the current depth |
| currentNode | the current node being visited |
| onLocalPath | true when we are still following the path of the currently best local solution |
true when the local path has been removed References frodo2.algorithms.odpop.goodsTree.GoodsTree< Val extends Addable< Val >, U extends Addable< U >, L extends Node< U > >.depthOfFirstToBeRemovedVariables, frodo2.algorithms.odpop.goodsTree.GoodsTree< Val extends Addable< Val >, U extends Addable< U >, L extends Node< U > >.depthToVariable, domains, frodo2.algorithms.odpop.goodsTree.InnerNodeTreeFullDomain.InnerNode< U extends Addable< U >, L extends LeafNode< U > >.getChild(), frodo2.algorithms.odpop.goodsTree.InnerNodeTreeFullDomain.InnerNode< U extends Addable< U >, L extends LeafNode< U > >.getUtil(), frodo2.algorithms.odpop.goodsTree.InnerNodeTreeFullDomain.Node< U extends Addable< U > >.isAlive(), localCounter, frodo2.algorithms.odpop.goodsTree.GoodsTree< Val extends Addable< Val >, U extends Addable< U >, L extends Node< U > >.maximize, maxNumberLocalProblemOccurences, optimalLocalPath, recalculateUB(), removePath(), frodo2.algorithms.odpop.goodsTree.InnerNodeTreeFullDomain.InnerNode< U extends Addable< U >, L extends LeafNode< U > >.ubCandidate(), UBexists(), frodo2.algorithms.odpop.goodsTree.InnerNodeTreeFullDomain.InnerNode< U extends Addable< U >, L extends LeafNode< U > >.utilCandidate(), and Utilexists().
Referenced by removeAMax(), and removePath().

| boolean frodo2.algorithms.odpop.goodsTree.InnerNodeTreeFullDomain.InnerNodeTree< Val extends Addable< Val >, U extends Addable< U >, L extends LeafNode< U > >.setChildDone | ( | int | child | ) |
If a child has send a DONE message, the upper bound should be set to -infinity.
| child | the child that sent the DONE message |
true when the remaining local problem became infeasible, and false otherwise Reimplemented from frodo2.algorithms.odpop.goodsTree.GoodsTree< Val extends Addable< Val >, U extends Addable< U >, L extends Node< U > >.
References frodo2.algorithms.odpop.goodsTree.InnerNodeTreeFullDomain.LeafNode< U extends Addable< U > >.calculateUB(), frodo2.algorithms.odpop.goodsTree.InnerNodeTreeFullDomain.LeafNode< U extends Addable< U > >.getUB(), frodo2.algorithms.odpop.goodsTree.GoodsTree< Val extends Addable< Val >, U extends Addable< U >, L extends Node< U > >.greaterThan(), frodo2.algorithms.odpop.goodsTree.GoodsTree< Val extends Addable< Val >, U extends Addable< U >, L extends Node< U > >.infeasibleUtil, frodo2.algorithms.odpop.goodsTree.GoodsTree< Val extends Addable< Val >, U extends Addable< U >, L extends Node< U > >.maximize, recalculateUB(), root, and updateUpperBoundSums().

| void frodo2.algorithms.odpop.goodsTree.InnerNodeTreeFullDomain.InnerNodeTree< Val extends Addable< Val >, U extends Addable< U >, L extends LeafNode< U > >.setChildrenSeparator | ( | int | child, |
| String[] | variables ) |
Initializes the separator of a child.
This method should only be called when one receives the first message from a particular child. After that, the process of adding new variables should take care of the rest.
| child | the child whose separator must be set |
| variables | the variables in its separator |
Reimplemented from frodo2.algorithms.odpop.goodsTree.GoodsTree< Val extends Addable< Val >, U extends Addable< U >, L extends Node< U > >.
References childrenVariablesReportingOrder.
| void frodo2.algorithms.odpop.goodsTree.InnerNodeTreeFullDomain.InnerNodeTree< Val extends Addable< Val >, U extends Addable< U >, L extends LeafNode< U > >.setFinalDomainSize | ( | String[] | variables, |
| int[] | domainSize ) |
Reimplemented from frodo2.algorithms.odpop.goodsTree.GoodsTree< Val extends Addable< Val >, U extends Addable< U >, L extends Node< U > >.
References domainSize.
|
protected |
Used to set the old upperbound.
true References frodo2.algorithms.odpop.goodsTree.GoodsTree< Val extends Addable< Val >, U extends Addable< U >, L extends Node< U > >.greaterThan(), hasLocalProblem, frodo2.algorithms.odpop.goodsTree.GoodsTree< Val extends Addable< Val >, U extends Addable< U >, L extends Node< U > >.infeasibleUtil, localUpperBound, frodo2.algorithms.odpop.goodsTree.GoodsTree< Val extends Addable< Val >, U extends Addable< U >, L extends Node< U > >.maximize, oldUB, root, and upperBoundSums.
Referenced by add().

| boolean frodo2.algorithms.odpop.goodsTree.InnerNodeTreeFullDomain.InnerNodeTree< Val extends Addable< Val >, U extends Addable< U >, L extends LeafNode< U > >.stillToSend | ( | ) |
|
protected |
Takes a good received by a child and transforms the assignment to a key.
| values | the values reported by the child |
| variables | the variables reported by the child |
| sender | the child that send the good |
References createIntArrayWrapper(), frodo2.algorithms.odpop.goodsTree.GoodsTree< Val extends Addable< Val >, U extends Addable< U >, L extends Node< U > >.numberOfVariables, valuePointers, and variableToDepth.
Referenced by add().

| String frodo2.algorithms.odpop.goodsTree.InnerNodeTreeFullDomain.InnerNodeTree< Val extends Addable< Val >, U extends Addable< U >, L extends LeafNode< U > >.toString | ( | ) |
Method used for debugging purposes.
It prints the state of the tree
References frodo2.algorithms.odpop.goodsTree.GoodsTree< Val extends Addable< Val >, U extends Addable< U >, L extends Node< U > >.depthOfFirstToBeRemovedVariables, frodo2.algorithms.odpop.goodsTree.GoodsTree< Val extends Addable< Val >, U extends Addable< U >, L extends Node< U > >.depthToVariable, generateAssignments(), goodsReceived, numberOfChildren, frodo2.algorithms.odpop.goodsTree.GoodsTree< Val extends Addable< Val >, U extends Addable< U >, L extends Node< U > >.numberOfVariables, optimalLocalPath, and root.

| int frodo2.algorithms.odpop.goodsTree.InnerNodeTreeFullDomain.InnerNodeTree< Val extends Addable< Val >, U extends Addable< U >, L extends LeafNode< U > >.treeSize | ( | ) |
Wrapper around treeSize(int, int, Node).
References root, and treeSize().
Referenced by treeSize(), and treeSize().

|
private |
Counts the number of leaves in the tree.
| depth | the current depth |
| visited | the number of leaves visited |
| currentNode | the currently visited node |
References frodo2.algorithms.odpop.goodsTree.GoodsTree< Val extends Addable< Val >, U extends Addable< U >, L extends Node< U > >.infeasibleUtil, frodo2.algorithms.odpop.goodsTree.GoodsTree< Val extends Addable< Val >, U extends Addable< U >, L extends Node< U > >.numberOfVariables, and treeSize().

| boolean frodo2.algorithms.odpop.goodsTree.InnerNodeTreeFullDomain.InnerNodeTree< Val extends Addable< Val >, U extends Addable< U >, L extends LeafNode< U > >.UBexists | ( | InnerNode< U, L > | currentNode, |
| int | depth ) |
Test to see whether a leafnode used as upperbound actually exists, i.e.
to check whether the UB is correctly being updated
| currentNode | the current node in the tree being visited |
| depth | the current depth |
true when the leafnode exists, and false otherwise References branchingFactor, frodo2.algorithms.odpop.goodsTree.GoodsTree< Val extends Addable< Val >, U extends Addable< U >, L extends Node< U > >.depthFinalVariable, frodo2.algorithms.odpop.goodsTree.InnerNodeTreeFullDomain.InnerNode< U extends Addable< U >, L extends LeafNode< U > >.getChild(), frodo2.algorithms.odpop.goodsTree.InnerNodeTreeFullDomain.InnerNode< U extends Addable< U >, L extends LeafNode< U > >.getMaxUB(), frodo2.algorithms.odpop.goodsTree.InnerNodeTreeFullDomain.InnerNode< U extends Addable< U >, L extends LeafNode< U > >.hasUB(), and UBexists().
Referenced by removePath(), and UBexists().

|
protected |
References frodo2.algorithms.odpop.goodsTree.GoodsTree< Val extends Addable< Val >, U extends Addable< U >, L extends Node< U > >.depthToVariable, frodo2.algorithms.odpop.goodsTree.GoodsTree< Val extends Addable< Val >, U extends Addable< U >, L extends Node< U > >.infeasibleUtil, frodo2.algorithms.odpop.goodsTree.GoodsTree< Val extends Addable< Val >, U extends Addable< U >, L extends Node< U > >.localProblemIterator, localUpperBound, frodo2.algorithms.odpop.goodsTree.GoodsTree< Val extends Addable< Val >, U extends Addable< U >, L extends Node< U > >.numberOfLocalVariables, frodo2.algorithms.odpop.goodsTree.GoodsTree< Val extends Addable< Val >, U extends Addable< U >, L extends Node< U > >.numberOfVariables, optimalLocalPath, optimalLocalUtility, pathAlive(), root, upperBoundIsInfiniteCounter, upperBoundSums, and valuePointers.
Referenced by InnerNodeTree(), InnerNodeTree(), and removeAMax().

|
protected |
This method walks trough the tree according to the given partial path and finds all leaf nodes that correspond to assignments that are compatible with the good to be added.
| depth | The current depth |
| currentPath | The current path |
| partialPath | The path dictated by the received good |
| currentNode | The current node |
| g | the utility reported |
| utilityDelta | The difference with the previously reported utility for the assignment belonging to the partial path |
| sender | The sender of the good |
| onLocalPath | true when we are still following the path of the currently best local solution |
| withUB | true when the UB must be updated as well |
References frodo2.algorithms.odpop.goodsTree.GoodsTree< Val extends Addable< Val >, U extends Addable< U >, L extends Node< U > >.depthToVariable, domains, frodo2.algorithms.odpop.goodsTree.GoodsTree< Val extends Addable< Val >, U extends Addable< U >, L extends Node< U > >.infeasibleUtil, frodo2.algorithms.odpop.goodsTree.GoodsTree< Val extends Addable< Val >, U extends Addable< U >, L extends Node< U > >.maximize, updatePath(), and upperBoundSums.
Referenced by add(), and updatePath().

|
protected |
Updates the upperBoundSums array given the child that has changed its bound, the old bound and the new bound.
| child | The child whose bound has changed |
| oldBound | The old bound |
| newBound | The new bound |
References checkUpperBoundSums(), hasLocalProblem, frodo2.algorithms.odpop.goodsTree.GoodsTree< Val extends Addable< Val >, U extends Addable< U >, L extends Node< U > >.infeasibleUtil, localUpperBound, numberOfChildren, optimalLocalUtility, upperBoundSums, and frodo2.algorithms.odpop.goodsTree.GoodsTree< Val extends Addable< Val >, U extends Addable< U >, L extends Node< U > >.zero.
Referenced by add(), and setChildDone().

|
protected |
| node | the node to be checked |
| UB | its newly calculated upper bound |
true when UB equals minInfinte | boolean frodo2.algorithms.odpop.goodsTree.InnerNodeTreeFullDomain.InnerNodeTree< Val extends Addable< Val >, U extends Addable< U >, L extends LeafNode< U > >.Utilexists | ( | InnerNode< U, L > | currentNode, |
| int | depth ) |
Checks whether the maxUtil of a node actually exists.
| currentNode | the current node |
| depth | the current depth |
true when the util node exists, and false otherwise References branchingFactor, frodo2.algorithms.odpop.goodsTree.GoodsTree< Val extends Addable< Val >, U extends Addable< U >, L extends Node< U > >.depthFinalVariable, frodo2.algorithms.odpop.goodsTree.InnerNodeTreeFullDomain.InnerNode< U extends Addable< U >, L extends LeafNode< U > >.getChild(), frodo2.algorithms.odpop.goodsTree.InnerNodeTreeFullDomain.InnerNode< U extends Addable< U >, L extends LeafNode< U > >.getMaxUtil(), frodo2.algorithms.odpop.goodsTree.InnerNodeTreeFullDomain.InnerNode< U extends Addable< U >, L extends LeafNode< U > >.getUtil(), frodo2.algorithms.odpop.goodsTree.InnerNodeTreeFullDomain.LeafNode< U extends Addable< U > >.getUtil(), frodo2.algorithms.odpop.goodsTree.InnerNodeTreeFullDomain.InnerNode< U extends Addable< U >, L extends LeafNode< U > >.hasUtil(), and Utilexists().
Referenced by removePath(), and Utilexists().

|
protected |
For every level of the tree, it stores the branching factor.
Referenced by add(), addNewVariable(), addVariableToTree(), checkTree(), compareWithHypercube(), createPathNoUB(), createPathWithUB(), fillTree(), findMaxUB(), generateAssignments(), getAmax(), init(), initiateBounds(), removeInconsistencies(), UBexists(), and Utilexists().
|
protected |
Stores which variables are in a child's separator.
Referenced by add(), addNewVariable(), checkLeaf(), createLeaf(), createLeaf(), hasSupport(), and init().
|
protected |
For each child it stores the order in which the variables are reported.
Referenced by getChildSeparatorReportingOrder(), getChildValues(), init(), and setChildrenSeparator().
|
protected |
The variable domains, where the position in the ArrayList denotes which child corresponds to the value.
Referenced by add(), addNewVariable(), compareWithHypercube(), compareWithHypercube(), createPathNoUB(), createPathWithUB(), fillTree(), generateAssignments(), getAmax(), getDomains(), getUtilityLocalProblem(), init(), initiateBounds(), removePath(), and updatePath().
|
protected |
Stores, for a level in the tree, the size of the domain of the corresponding variable.
Referenced by addNewVariable(), generateAssignments(), getAmax(), getOwnVariableOptions(), init(), InnerNodeTree(), InnerNodeTree(), and setFinalDomainSize().
|
protected |
Stores the final sizes of the domains of all the variables.
Referenced by addNewVariable(), getFinalDomainSize(), and init().
|
protected |
True when the information on the final domain size is complete.
Referenced by finalDomainSizeReceiver(), InnerNodeTree(), and InnerNodeTree().
|
protected |
Counts the number of children from which one still needs to receive domain information.
Referenced by finalDomainSizeReceiver(), and init().
|
protected |
For each child a map that stores the utilities received from children.
This is needed due to the assumption that both domain and variable information can be incomplete
Referenced by add(), checkLeaf(), createLeaf(), createLeaf(), hasSupport(), init(), and toString().
|
protected |
true when this variable has a local problem, and false otherwise
Referenced by addNewVariable(), getAmax(), getUtilityLocalProblem(), initializeUpperBoundSums(), InnerNodeTree(), InnerNodeTree(), isValuationSufficient(), removeAMax(), setOldUB(), and updateUpperBoundSums().
|
protected |
An instance of a leaf node, used to create new instances.
Referenced by createLeaf(), createLeaf(), InnerNodeTree(), InnerNodeTree(), InnerNodeTree(), and InnerNodeTree().
|
protected |
The number of times the currently best local solution has NOT been used in the tree, i.e.
it counts down to 0
Referenced by add(), addNewVariable(), init(), removeAMax(), and removePath().
|
protected |
The upperbound on all the completely unseen assignments.
Referenced by getAmax(), initializeUpperBoundSums(), isValuationSufficient(), removeAMax(), setOldUB(), updateLocalProblem(), and updateUpperBoundSums().
|
protected |
The total number of times a solution to a local problem can be used in the separator problem.
Referenced by init(), removeAMax(), and removePath().
|
protected |
The number of children of the variable.
Referenced by add(), addNewVariable(), checkLeaf(), checkUpperBoundSums(), createInnerNode(), createLeaf(), createLeaf(), hasSupport(), init(), initializeUpperBoundSums(), InnerNodeTree(), InnerNodeTree(), InnerNodeTree(), InnerNodeTree(), InnerNodeTree(), InnerNodeTree(), toString(), and updateUpperBoundSums().
|
protected |
Stores the UB as it was before a new good has been received.
Referenced by add(), checkLeaf(), fillTree(), and setOldUB().
|
protected |
The path of the currently optimal local solution.
Referenced by addNewVariable(), initiateBounds(), removePath(), toString(), and updateLocalProblem().
|
protected |
The optimal utility of the local problem.
Referenced by initializeUpperBoundSums(), updateLocalProblem(), and updateUpperBoundSums().
|
protected |
Stores which are this variable's neighbours.
Referenced by addNewVariable(), and init().
|
protected |
Pre-calculated powers of 2.
Referenced by createLeaf(), createLeaf(), and init().
|
protected |
The root of the tree.
Referenced by add(), compareWithHypercube(), getAmax(), getOwnVariableOptions(), hasMore(), InnerNodeTree(), InnerNodeTree(), isValuationSufficient(), pathExists(), removeAMax(), setChildDone(), setOldUB(), toString(), treeSize(), and updateLocalProblem().
|
protected |
|
staticprotected |
Used for serialization.
|
protected |
True if the domain information has not been requested yet.
Referenced by getFinalDomainSize(), and stillToSend().
|
protected |
If domain or variable information is incomplete received goods must be stored, otherwise they can be discarded after processing.
Referenced by hasSupport().
|
protected |
Domains still to be added to domains.
Referenced by init().
|
protected |
Per child the unpacked variables (different from the reported variables).
Referenced by init().
|
protected |
Counts the number of children that have already sent at least one confirmed good.
Referenced by add(), init(), and updateLocalProblem().
|
protected |
COunts the number of children that have already reported a minInfinite value.
Referenced by init().
|
protected |
For each child it stores that last confirmed utility received.
Referenced by add(), checkLeaf(), checkUpperBoundSums(), init(), and initializeUpperBoundSums().
|
protected |
For every combination of children, this array contains the sum of upperBounds belonging to the selected children.
If there are n children, then this array contains n-1 elements (the empty set of children is 0)
Referenced by checkUpperBoundSums(), createLeaf(), createLeaf(), findMaxUB(), getAmax(), initializeUpperBoundSums(), initiateBounds(), setOldUB(), updateLocalProblem(), updatePath(), and updateUpperBoundSums().
|
protected |
Used to determine to which child a variable value corresponds to.
Referenced by add(), addNewVariable(), getOwnVariableOptions(), init(), pathExists(), toKey(), and updateLocalProblem().
|
protected |
links a variable to its depth in the tree.
Referenced by add(), addNewVariable(), getBestAssignmentForOwnVariable(), init(), knowsVariable(), and toKey().