FRODO Version 2.19.1
An open-source framework for Distributed Constraint Optimization (DCOP)
Loading...
Searching...
No Matches
frodo2.algorithms.odpop.goodsTree.InnerNodeTreeFullDomain.InnerNodeTree< Val extends Addable< Val >, U extends Addable< U >, L extends LeafNode< U > > Class Template Reference

This class is designed to store GOODs received by a node from its children, and is used in the O-DPOP algorithm. More...

Inheritance diagram for frodo2.algorithms.odpop.goodsTree.InnerNodeTreeFullDomain.InnerNodeTree< Val extends Addable< Val >, U extends Addable< U >, L extends LeafNode< U > >:

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.
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.
createLeaf (IntArrayWrapper currentPath, Good< Val, U > g, int child, final boolean withUB)
 Method to create a new leaf node.
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.
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.
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.
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)
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
optimalLocalUtility
 The optimal utility of the local problem.
int[] optimalLocalPath
 The path of the currently optimal local solution.
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.
leafNodeInstance
 An instance of a leaf node, used to create new instances.
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.
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

Detailed Description

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.

Author
Brammert
Parameters
<Val>type used for variable values
<U>type used for utility values
<L>type used for the leaf node
Todo
write Unit test for this class

Constructor & Destructor Documentation

◆ InnerNodeTree() [1/6]

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,
U zero,
int numberOfChildren,
U infeasibleUtil,
boolean maximize,
boolean collectStats )
protected

A constructor.

Parameters
ownVariableThe variable that owns this tree
ownVariableDomainThe domain of ownVariable
spaceThe space controlled by this tree
zeroThe zero utility
numberOfChildrenThe number of children of this tree
infeasibleUtilThe infeasible utility
maximizewhen true we are maximizing, when false we are minimizing
collectStatstrue 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.

◆ InnerNodeTree() [2/6]

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.

Parameters
ownVariableThe variable that owns this tree
ownVariableDomainThe domain of ownVariable
spacesThe space controlled by this tree
zeroThe zero utility
numberOfChildrenThe number of children of this tree
infeasibleUtilThe infeasible utility
maximizewhen true we are maximizing, when false we are minimizing
collectStatstrue 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.

◆ InnerNodeTree() [3/6]

frodo2.algorithms.odpop.goodsTree.InnerNodeTreeFullDomain.InnerNodeTree< Val extends Addable< Val >, U extends Addable< U >, L extends LeafNode< U > >.InnerNodeTree ( L leafNodeInstance,
String ownVariable,
Val[] ownVariableDomain,
UtilitySolutionSpace< Val, U > space,
U zero,
int numberOfChildren,
U infeasibleUtil,
boolean maximize,
boolean collectStats )
protected

A dummy constructor to be used by extending classes.

Parameters
leafNodeInstancean instance of the leaf node class
ownVariableThe variable that owns this tree
ownVariableDomainThe domain of ownVariable
spaceThe local problem
zeroThe zero utility
numberOfChildrenThe number of children of this tree
infeasibleUtilThe infeasible utility
maximizewhen true we are maximizing, when false we are minimizing
collectStatstrue 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.

◆ InnerNodeTree() [4/6]

frodo2.algorithms.odpop.goodsTree.InnerNodeTreeFullDomain.InnerNodeTree< Val extends Addable< Val >, U extends Addable< U >, L extends LeafNode< U > >.InnerNodeTree ( L leafNodeInstance,
String ownVariable,
Val[] ownVariableDomain,
List< UtilitySolutionSpace< Val, U > > spaces,
U zero,
int numberOfChildren,
U infeasibleUtil,
boolean maximize,
boolean collectStats )
protected

A dummy constructor to be used by extending classes.

Parameters
leafNodeInstancean instance of the leaf node class
ownVariableThe variable that owns this tree
ownVariableDomainThe domain of ownVariable
spacesThe local problem
zeroThe zero utility
numberOfChildrenThe number of children of this tree
infeasibleUtilThe infeasible utility
maximizewhen true we are maximizing, when false we are minimizing
collectStatstrue 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.

◆ InnerNodeTree() [5/6]

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.

Warning
we assume that the agent's own variable is put in the end of variables_order
Parameters
ownVariableThe variable ID
ownVariableDomainThe domain of ownVariable
spaceThe hypercube representing the local problem
numberOfChildrenThe number of children
zeroThe zero utility
leafNodeInstancean instance of the leaf node class
infeasibleUtilThe infeasible utility
maximizewhen true we are maximizing, when false we are minimizing
collectStatstrue 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.

Here is the call graph for this function:

◆ InnerNodeTree() [6/6]

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.

Warning
we assume that the agents own variable is put in the end of variables_order
Parameters
ownVariableThe variable ID
ownVariableDomainThe domain of ownVariable
spacesThe hypercubes representing the local problem
numberOfChildrenThe number of children
zeroThe zero utility
leafNodeInstancean instance of the leaf node class
infeasibleUtilThe infeasible utility
maximizewhen true we are maximizing, when false we are minimizing
collectStatstrue 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.

Here is the call graph for this function:

Member Function Documentation

◆ add()

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.

Author
Brammert Ottens, 10 nov 2009
Parameters
gthe good to be added
senderthe child that reported the good
domainsreported domains
Returns
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.

Here is the call graph for this function:

◆ addNewVariable()

int[] frodo2.algorithms.odpop.goodsTree.InnerNodeTreeFullDomain.InnerNodeTree< Val extends Addable< Val >, U extends Addable< U >, L extends LeafNode< U > >.addNewVariable ( String[] allVariables,
HashMap< String, Val > newVariables,
HashMap< String, Val[]> newDomains,
int sender )
protected

◆ addVariableToTree()

boolean frodo2.algorithms.odpop.goodsTree.InnerNodeTreeFullDomain.InnerNodeTree< Val extends Addable< Val >, U extends Addable< U >, L extends LeafNode< U > >.addVariableToTree ( int nbrNewVariables,
IntArrayWrapper currentPath,
int[] indexPath,
int depth,
InnerNode< U, L > oldRoot,
InnerNode< U, L > currentNode,
boolean possibleInconsistencies,
boolean onIndexPath,
int sender )
protected

This method is called when variables are received.

The new variables are placed at the root

Parameters
nbrNewVariablesThe number of variables to add
currentPathThe path currently taken through the tree
indexPathThe partial path defined by the new variables
depthThe current depth
oldRootThe old root
currentNodeThe current node
possibleInconsistenciestrue when the reception of a new variable can make certain solutions infeasible
onIndexPathtrue when still following the index path
senderThe sender of the good
Returns
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().

Here is the call graph for this function:

◆ checkLeaf()

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

Parameters
leafthe leaf to be checked
currentPaththe path to this leaf
checkUBtrue when the UB must be checked
utilitythe utility reported by the sender
senderthe sender of the good
Returns
always returns true

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().

Here is the call graph for this function:

◆ checkTree()

boolean frodo2.algorithms.odpop.goodsTree.InnerNodeTreeFullDomain.InnerNodeTree< Val extends Addable< Val >, U extends Addable< U >, L extends LeafNode< U > >.checkTree ( int depth,
InnerNode< U, L > currentNode,
IntArrayWrapper currentPath,
boolean UB,
boolean checkLeafs,
boolean checkSupport,
boolean checkUtil )
protected

This method checks the tree on the following properties.

  • the UB is properly propagated
  • the utility is properly propagated
  • every leaf node with support is present
  • no UB is greater than the old upper bound
Parameters
depththe current depth
currentNodethe current node being visited
currentPaththe current path taken
UBthe current UB
checkLeafstrue when the leaves are to be checked
checkSupportcheck whether existing leaf nodes actually have support
checkUtiltrue when utility values should be checked
Returns
always returns true

References branchingFactor, and checkTree().

Referenced by add(), checkTree(), fillTree(), and initiateBounds().

Here is the call graph for this function:

◆ checkUpperBoundSums()

boolean frodo2.algorithms.odpop.goodsTree.InnerNodeTreeFullDomain.InnerNodeTree< Val extends Addable< Val >, U extends Addable< U >, L extends LeafNode< U > >.checkUpperBoundSums ( int child,
U newBound )
private

Method to check the precomputation of the upper bound sums.

Author
Brammert Ottens, 26 jun 2009
Parameters
childthe child that reported a new bound
newBoundthe new bound
Returns
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().

Here is the call graph for this function:

◆ compareWithHypercube() [1/2]

boolean frodo2.algorithms.odpop.goodsTree.InnerNodeTreeFullDomain.InnerNodeTree< Val extends Addable< Val >, U extends Addable< U >, L extends LeafNode< U > >.compareWithHypercube ( int depth,
Val[] currentPath,
InnerNode< U, L > currentNode,
UtilitySolutionSpace< Val, U > h )
private

◆ compareWithHypercube() [2/2]

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.

Parameters
hthe hypercube to compare with
Returns
true when this tree matches the hypercube
Bug
Never used!

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().

Here is the call graph for this function:

◆ createInnerNode() [1/2]

InnerNode< U, L > frodo2.algorithms.odpop.goodsTree.InnerNodeTreeFullDomain.InnerNodeTree< Val extends Addable< Val >, U extends Addable< U >, L extends LeafNode< U > >.createInnerNode ( int numberOfChildren)
protected

Create an inner node with a specified number of children.

Author
Brammert Ottens, 22 apr 2010
Parameters
numberOfChildrenthe number of children this innernode should have
Returns
an InnerNode

References numberOfChildren.

Referenced by add(), addVariableToTree(), createPathNoUB(), createPathWithUB(), fillTree(), InnerNodeTree(), and InnerNodeTree().

◆ createInnerNode() [2/2]

InnerNode< U, L > frodo2.algorithms.odpop.goodsTree.InnerNodeTreeFullDomain.InnerNodeTree< Val extends Addable< Val >, U extends Addable< U >, L extends LeafNode< U > >.createInnerNode ( Node< U >[] children)
protected

Create an inner node with the specified number of children.

Author
Brammert Ottens, 22 apr 2010
Parameters
childrenan array of child nodes
Returns
an InnerNode

◆ createIntArrayWrapper() [1/2]

IntArrayWrapper frodo2.algorithms.odpop.goodsTree.InnerNodeTreeFullDomain.InnerNodeTree< Val extends Addable< Val >, U extends Addable< U >, L extends LeafNode< U > >.createIntArrayWrapper ( int size)
Author
Brammert Ottens, 22 apr 2010
Parameters
sizethe size of an array
Returns
a wrapper around an array with size size

◆ createIntArrayWrapper() [2/2]

IntArrayWrapper frodo2.algorithms.odpop.goodsTree.InnerNodeTreeFullDomain.InnerNodeTree< Val extends Addable< Val >, U extends Addable< U >, L extends LeafNode< U > >.createIntArrayWrapper ( int[] array)
Author
Brammert Ottens, 22 apr 2010
Parameters
arrayan array to be wrapped
Returns
a wrapper around the array

Referenced by addVariableToTree(), and toKey().

◆ createLeaf() [1/2]

◆ createLeaf() [2/2]

L frodo2.algorithms.odpop.goodsTree.InnerNodeTreeFullDomain.InnerNodeTree< Val extends Addable< Val >, U extends Addable< U >, L extends LeafNode< U > >.createLeaf ( IntArrayWrapper currentPath,
Good< Val, U > g,
int child,
final boolean withUB )
protected

◆ createPathNoUB()

InnerNode< U, L > frodo2.algorithms.odpop.goodsTree.InnerNodeTreeFullDomain.InnerNodeTree< Val extends Addable< Val >, U extends Addable< U >, L extends LeafNode< U > >.createPathNoUB ( int depth,
IntArrayWrapper currentPath,
int[] partialPath,
boolean real,
Good< Val, U > g,
int sender )
protected

Given a partial path, this method creates the path in the tree.

This method should only be called after domain information is complete!

Parameters
depththe current depth
currentPaththe path taken
partialPaththe partial path defined by the received good
realtrue when we are on a real path, and false otherwise
gthe received good
senderthe sender of the good
Returns
a new InnerNode

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().

Here is the call graph for this function:

◆ createPathWithUB()

InnerNode< U, L > frodo2.algorithms.odpop.goodsTree.InnerNodeTreeFullDomain.InnerNodeTree< Val extends Addable< Val >, U extends Addable< U >, L extends LeafNode< U > >.createPathWithUB ( int depth,
IntArrayWrapper currentPath,
int[] partialPath,
boolean real,
Good< Val, U > g,
int sender )
private

Given a partial path, this method creates the path in the tree.

This method should only be called after domain information is complete!

Parameters
depththe current depth
currentPaththe path taking in the tree
partialPaththe partial path defined by the received good
realtrue when we are on a real path, and false otherwise
gthe received good
senderthe sender of the good
Returns
a new InnerNode

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().

Here is the call graph for this function:

◆ fillTree()

InnerNode< U, L > frodo2.algorithms.odpop.goodsTree.InnerNodeTreeFullDomain.InnerNodeTree< Val extends Addable< Val >, U extends Addable< U >, L extends LeafNode< U > >.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 )
private

Fills a part of the tree that has been created by the reception of a new domain value.

Author
Brammert Ottens, 30 sep 2009
Parameters
examplethe example that is to be copied
depththe current depth
currentPaththe current path taken through the tree. Is only up to date up to depth
onLocalPathtrue when we are still following the path of the currently best local solution
withUBtrue when the UB must be instatiated as well
onPartialPathtrue then the followed path is the same as the path defined by the received good
partialPaththe path defined by the received good
gthe received good
senderthe sender of the good
ex
Todo
Returns
a new node

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().

Here is the call graph for this function:

◆ finalDomainSizeReceiver()

◆ findMaxUB()

◆ generateAssignments()

String frodo2.algorithms.odpop.goodsTree.InnerNodeTreeFullDomain.InnerNodeTree< Val extends Addable< Val >, U extends Addable< U >, L extends LeafNode< U > >.generateAssignments ( int depth,
int[] currentPath,
InnerNode< U, L > currentNode )
private

Used to print thte contents of the tree.

Author
Brammert Ottens, 25 feb 2010
Parameters
depththe current depth in the tree
currentPaththe path taken through the tree
currentNodethe curent node being visited
Returns
a string representation of the contents of the tree

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().

Here is the call graph for this function:

◆ getAmax()

Good< Val, U > frodo2.algorithms.odpop.goodsTree.InnerNodeTreeFullDomain.InnerNodeTree< Val extends Addable< Val >, U extends Addable< U >, L extends LeafNode< U > >.getAmax ( )
See also
frodo2.algorithms.odpop.goodsTree.GoodsTree.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().

Here is the call graph for this function:

◆ getBestAssignmentForOwnVariable()

◆ getChildSeparatorReportingOrder()

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.

Author
Brammert Ottens, 19 aug 2009
Parameters
childthe child who's separator we want to know
Returns
the separator variables of the child

Reimplemented from frodo2.algorithms.odpop.goodsTree.GoodsTree< Val extends Addable< Val >, U extends Addable< U >, L extends Node< U > >.

References childrenVariablesReportingOrder.

◆ getChildSeparatorSize()

int frodo2.algorithms.odpop.goodsTree.InnerNodeTreeFullDomain.InnerNodeTree< Val extends Addable< Val >, U extends Addable< U >, L extends LeafNode< U > >.getChildSeparatorSize ( int child)
Author
Brammert Ottens, 8 sep 2009
Parameters
childthe child who's separator size is requested
Returns
the separator size of the child

◆ getChildValues()

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.

Author
Brammert Ottens, 19 aug 2009
Parameters
parentContextthe value map
childthe child for who we want to know the separator values
Returns
an array containing the values of the child's separator variables

Reimplemented from frodo2.algorithms.odpop.goodsTree.GoodsTree< Val extends Addable< Val >, U extends Addable< U >, L extends Node< U > >.

References childrenVariablesReportingOrder.

◆ getDomains()

◆ getFinalDomainSize()

◆ getOwnVariableOptions() [1/2]

U frodo2.algorithms.odpop.goodsTree.InnerNodeTreeFullDomain.InnerNodeTree< Val extends Addable< Val >, U extends Addable< U >, L extends LeafNode< U > >.getOwnVariableOptions ( int[] path,
int[] optimalPath,
U maxUtil,
int depth,
InnerNode< U, L > currentNode )
protected

Given a possibly partial path, this method finds the maximal utility any option can provide.

Todo
also look at other things than max
Parameters
paththe (possibly partial) path to be followed
optimalPaththe path trough the tree that leads to the optimal leafnode
maxUtilthe opimal utility
depththe current depth
currentNodethe current node
Returns
for every option a utility

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().

Here is the call graph for this function:

◆ getOwnVariableOptions() [2/2]

◆ getUtilityLocalProblem()

◆ hasFullInfo()

◆ hasMore()

◆ hasSupport()

boolean frodo2.algorithms.odpop.goodsTree.InnerNodeTreeFullDomain.InnerNodeTree< Val extends Addable< Val >, U extends Addable< U >, L extends LeafNode< U > >.hasSupport ( IntArrayWrapper currentPath)
protected

Method to check whether a particular leaf node has support, i.e.

some child has reported an assignment compatible with currentPath

Parameters
currentPaththe path that leads to the leaf
Returns
true if the path has support and false otherwise

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().

Here is the call graph for this function:

◆ init()

void frodo2.algorithms.odpop.goodsTree.InnerNodeTreeFullDomain.InnerNodeTree< Val extends Addable< Val >, U extends Addable< U >, L extends LeafNode< U > >.init ( int numberOfChildren,
U zero )
protected

Initialize all the variables of the tree.

Parameters
numberOfChildrenThe number of children
zeroThe 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().

Here is the call graph for this function:

◆ initializeUpperBoundSums()

◆ initiateBounds()

U frodo2.algorithms.odpop.goodsTree.InnerNodeTreeFullDomain.InnerNodeTree< Val extends Addable< Val >, U extends Addable< U >, L extends LeafNode< U > >.initiateBounds ( InnerNode< U, L > currentNode,
IntArrayWrapper currentPath,
int depth,
boolean onLocalPath,
Good< Val, U > g,
int sender )
protected

◆ isValuationSufficient()

◆ knowsVariable()

◆ localPathAlive()

boolean frodo2.algorithms.odpop.goodsTree.InnerNodeTreeFullDomain.InnerNodeTree< Val extends Addable< Val >, U extends Addable< U >, L extends LeafNode< U > >.localPathAlive ( int depth,
InnerNode< U, L > currentNode )
protected

Used to check whether the local path chosen is still alive For debuggin purposes only.

Author
Brammert Ottens, 16 nov 2009
Parameters
depthThe current depth
currentNodeThe current node being visisted
Returns
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().

Here is the call graph for this function:

◆ notEnoughInfo()

◆ pathAlive()

boolean frodo2.algorithms.odpop.goodsTree.InnerNodeTreeFullDomain.InnerNodeTree< Val extends Addable< Val >, U extends Addable< U >, L extends LeafNode< U > >.pathAlive ( int[] path,
int depth,
InnerNode< U, L > currentNode )
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

Author
Brammert Ottens, 12 nov 2009
Parameters
paththe path to be checked
depththe current depth
currentNodethe currently visited node
Returns
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().

Here is the call graph for this function:

◆ pathExists()

◆ recalculateUB()

U frodo2.algorithms.odpop.goodsTree.InnerNodeTreeFullDomain.InnerNodeTree< Val extends Addable< Val >, U extends Addable< U >, L extends LeafNode< U > >.recalculateUB ( int depth,
InnerNode< U, L > currentNodeUncast,
U UBtoBeat,
boolean recalculateUtil,
boolean recalculateUB )
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

Parameters
depththe current depth
currentNodeUncastthe node that is currently visited
UBtoBeatthe UB that needs to be beat
recalculateUtiltrue when the recalculation of the utility can make a difference higher up
recalculateUBtrue when the recalculation of the upperbound can make a difference higher up
Returns
the new upper bound for currentNode

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().

Here is the call graph for this function:

◆ removeAMax()

◆ removeInconsistencies()

void frodo2.algorithms.odpop.goodsTree.InnerNodeTreeFullDomain.InnerNodeTree< Val extends Addable< Val >, U extends Addable< U >, L extends LeafNode< U > >.removeInconsistencies ( InnerNode< U, L > currentNode,
int depth,
IntArrayWrapper currentPath )
protected

◆ removePath()

boolean frodo2.algorithms.odpop.goodsTree.InnerNodeTreeFullDomain.InnerNodeTree< Val extends Addable< Val >, U extends Addable< U >, L extends LeafNode< U > >.removePath ( int depth,
InnerNode< U, L > currentNode,
boolean onLocalPath )
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.

Parameters
depththe current depth
currentNodethe current node being visited
onLocalPathtrue when we are still following the path of the currently best local solution
Returns
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().

Here is the call graph for this function:

◆ setChildDone()

◆ setChildrenSeparator()

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.

Parameters
childthe child whose separator must be set
variablesthe 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.

◆ setFinalDomainSize()

void frodo2.algorithms.odpop.goodsTree.InnerNodeTreeFullDomain.InnerNodeTree< Val extends Addable< Val >, U extends Addable< U >, L extends LeafNode< U > >.setFinalDomainSize ( String[] variables,
int[] domainSize )

◆ setOldUB()

◆ stillToSend()

◆ toKey()

IntArrayWrapper frodo2.algorithms.odpop.goodsTree.InnerNodeTreeFullDomain.InnerNodeTree< Val extends Addable< Val >, U extends Addable< U >, L extends LeafNode< U > >.toKey ( Val[] values,
String[] variables,
int sender )
protected

Takes a good received by a child and transforms the assignment to a key.

Parameters
valuesthe values reported by the child
variablesthe variables reported by the child
senderthe child that send the good
Returns
The key corresponding to the assignment of 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().

Here is the call graph for this function:

◆ toString()

◆ treeSize() [1/2]

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).

Returns
the number of leaves in the tree

References root, and treeSize().

Referenced by treeSize(), and treeSize().

Here is the call graph for this function:

◆ treeSize() [2/2]

int frodo2.algorithms.odpop.goodsTree.InnerNodeTreeFullDomain.InnerNodeTree< Val extends Addable< Val >, U extends Addable< U >, L extends LeafNode< U > >.treeSize ( int depth,
int visited,
Node< U > currentNode )
private

Counts the number of leaves in the tree.

Parameters
depththe current depth
visitedthe number of leaves visited
currentNodethe currently visited node
Returns
the number of leaves in the tree

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().

Here is the call graph for this function:

◆ UBexists()

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

Author
Brammert Ottens, 5 okt 2009
Parameters
currentNodethe current node in the tree being visited
depththe current depth
Returns
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().

Here is the call graph for this function:

◆ updateLocalProblem()

◆ updatePath()

void frodo2.algorithms.odpop.goodsTree.InnerNodeTreeFullDomain.InnerNodeTree< Val extends Addable< Val >, U extends Addable< U >, L extends LeafNode< U > >.updatePath ( int depth,
IntArrayWrapper currentPath,
int[] partialPath,
InnerNode< U, L > currentNode,
Good< Val, U > g,
U utilityDelta,
int sender,
boolean onLocalPath,
final boolean withUB )
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.

Parameters
depthThe current depth
currentPathThe current path
partialPathThe path dictated by the received good
currentNodeThe current node
gthe utility reported
utilityDeltaThe difference with the previously reported utility for the assignment belonging to the partial path
senderThe sender of the good
onLocalPathtrue when we are still following the path of the currently best local solution
withUBtrue 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().

Here is the call graph for this function:

◆ updateUpperBoundSums()

void frodo2.algorithms.odpop.goodsTree.InnerNodeTreeFullDomain.InnerNodeTree< Val extends Addable< Val >, U extends Addable< U >, L extends LeafNode< U > >.updateUpperBoundSums ( int child,
U oldBound,
U newBound )
protected

Updates the upperBoundSums array given the child that has changed its bound, the old bound and the new bound.

Author
Brammert Ottens, 25 jun 2009
Parameters
childThe child whose bound has changed
oldBoundThe old bound
newBoundThe 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().

Here is the call graph for this function:

◆ upperBoundChangesUtil()

boolean frodo2.algorithms.odpop.goodsTree.InnerNodeTreeFullDomain.InnerNodeTree< Val extends Addable< Val >, U extends Addable< U >, L extends LeafNode< U > >.upperBoundChangesUtil ( InnerNode< U, L > node,
U UB )
protected
Author
Brammert Ottens, 22 apr 2010
Parameters
nodethe node to be checked
UBits newly calculated upper bound
Returns
true when UB equals minInfinte

References frodo2.algorithms.odpop.goodsTree.GoodsTree< Val extends Addable< Val >, U extends Addable< U >, L extends Node< U > >.infeasibleUtil.

◆ Utilexists()

Member Data Documentation

◆ branchingFactor

◆ childrenVariables

boolean [][] frodo2.algorithms.odpop.goodsTree.InnerNodeTreeFullDomain.InnerNodeTree< Val extends Addable< Val >, U extends Addable< U >, L extends LeafNode< U > >.childrenVariables
protected

Stores which variables are in a child's separator.

Referenced by add(), addNewVariable(), checkLeaf(), createLeaf(), createLeaf(), hasSupport(), and init().

◆ childrenVariablesReportingOrder

String [][] frodo2.algorithms.odpop.goodsTree.InnerNodeTreeFullDomain.InnerNodeTree< Val extends Addable< Val >, U extends Addable< U >, L extends LeafNode< U > >.childrenVariablesReportingOrder
protected

For each child it stores the order in which the variables are reported.

Referenced by getChildSeparatorReportingOrder(), getChildValues(), init(), and setChildrenSeparator().

◆ domains

HashMap<String, ArrayList<Val> > frodo2.algorithms.odpop.goodsTree.InnerNodeTreeFullDomain.InnerNodeTree< Val extends Addable< Val >, U extends Addable< U >, L extends LeafNode< U > >.domains
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().

◆ domainSize

int [] frodo2.algorithms.odpop.goodsTree.InnerNodeTreeFullDomain.InnerNodeTree< Val extends Addable< Val >, U extends Addable< U >, L extends LeafNode< U > >.domainSize
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().

◆ finalDomainSize

int [] frodo2.algorithms.odpop.goodsTree.InnerNodeTreeFullDomain.InnerNodeTree< Val extends Addable< Val >, U extends Addable< U >, L extends LeafNode< U > >.finalDomainSize
protected

Stores the final sizes of the domains of all the variables.

Referenced by addNewVariable(), getFinalDomainSize(), and init().

◆ fullInfo

boolean frodo2.algorithms.odpop.goodsTree.InnerNodeTreeFullDomain.InnerNodeTree< Val extends Addable< Val >, U extends Addable< U >, L extends LeafNode< U > >.fullInfo
protected

True when the information on the final domain size is complete.

Referenced by finalDomainSizeReceiver(), InnerNodeTree(), and InnerNodeTree().

◆ fullInfoCounter

int frodo2.algorithms.odpop.goodsTree.InnerNodeTreeFullDomain.InnerNodeTree< Val extends Addable< Val >, U extends Addable< U >, L extends LeafNode< U > >.fullInfoCounter
protected

Counts the number of children from which one still needs to receive domain information.

Referenced by finalDomainSizeReceiver(), and init().

◆ goodsReceived

ArrayList<HashMap<IntArrayWrapper, U> > frodo2.algorithms.odpop.goodsTree.InnerNodeTreeFullDomain.InnerNodeTree< Val extends Addable< Val >, U extends Addable< U >, L extends LeafNode< U > >.goodsReceived
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().

◆ hasLocalProblem

boolean frodo2.algorithms.odpop.goodsTree.InnerNodeTreeFullDomain.InnerNodeTree< Val extends Addable< Val >, U extends Addable< U >, L extends LeafNode< U > >.hasLocalProblem
protected

◆ leafNodeInstance

L frodo2.algorithms.odpop.goodsTree.InnerNodeTreeFullDomain.InnerNodeTree< Val extends Addable< Val >, U extends Addable< U >, L extends LeafNode< U > >.leafNodeInstance
protected

An instance of a leaf node, used to create new instances.

Referenced by createLeaf(), createLeaf(), InnerNodeTree(), InnerNodeTree(), InnerNodeTree(), and InnerNodeTree().

◆ localCounter

int frodo2.algorithms.odpop.goodsTree.InnerNodeTreeFullDomain.InnerNodeTree< Val extends Addable< Val >, U extends Addable< U >, L extends LeafNode< U > >.localCounter
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().

◆ localUpperBound

U frodo2.algorithms.odpop.goodsTree.InnerNodeTreeFullDomain.InnerNodeTree< Val extends Addable< Val >, U extends Addable< U >, L extends LeafNode< U > >.localUpperBound
protected

The upperbound on all the completely unseen assignments.

Referenced by getAmax(), initializeUpperBoundSums(), isValuationSufficient(), removeAMax(), setOldUB(), updateLocalProblem(), and updateUpperBoundSums().

◆ maxNumberLocalProblemOccurences

int frodo2.algorithms.odpop.goodsTree.InnerNodeTreeFullDomain.InnerNodeTree< Val extends Addable< Val >, U extends Addable< U >, L extends LeafNode< U > >.maxNumberLocalProblemOccurences
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().

◆ numberOfChildren

◆ oldUB

U frodo2.algorithms.odpop.goodsTree.InnerNodeTreeFullDomain.InnerNodeTree< Val extends Addable< Val >, U extends Addable< U >, L extends LeafNode< U > >.oldUB
protected

Stores the UB as it was before a new good has been received.

Referenced by add(), checkLeaf(), fillTree(), and setOldUB().

◆ optimalLocalPath

int [] frodo2.algorithms.odpop.goodsTree.InnerNodeTreeFullDomain.InnerNodeTree< Val extends Addable< Val >, U extends Addable< U >, L extends LeafNode< U > >.optimalLocalPath
protected

The path of the currently optimal local solution.

Referenced by addNewVariable(), initiateBounds(), removePath(), toString(), and updateLocalProblem().

◆ optimalLocalUtility

U frodo2.algorithms.odpop.goodsTree.InnerNodeTreeFullDomain.InnerNodeTree< Val extends Addable< Val >, U extends Addable< U >, L extends LeafNode< U > >.optimalLocalUtility
protected

The optimal utility of the local problem.

Referenced by initializeUpperBoundSums(), updateLocalProblem(), and updateUpperBoundSums().

◆ ownVariables

boolean [] frodo2.algorithms.odpop.goodsTree.InnerNodeTreeFullDomain.InnerNodeTree< Val extends Addable< Val >, U extends Addable< U >, L extends LeafNode< U > >.ownVariables
protected

Stores which are this variable's neighbours.

Referenced by addNewVariable(), and init().

◆ powersOf2

int [] frodo2.algorithms.odpop.goodsTree.InnerNodeTreeFullDomain.InnerNodeTree< Val extends Addable< Val >, U extends Addable< U >, L extends LeafNode< U > >.powersOf2
protected

Pre-calculated powers of 2.

Referenced by createLeaf(), createLeaf(), and init().

◆ root

◆ separatorSizePerChild

int [] frodo2.algorithms.odpop.goodsTree.InnerNodeTreeFullDomain.InnerNodeTree< Val extends Addable< Val >, U extends Addable< U >, L extends LeafNode< U > >.separatorSizePerChild
protected

Stores the number of reported variables per child.

Referenced by add(), and init().

◆ serialVersionUID

final long frodo2.algorithms.odpop.goodsTree.InnerNodeTreeFullDomain.InnerNodeTree< Val extends Addable< Val >, U extends Addable< U >, L extends LeafNode< U > >.serialVersionUID = 4206985864919963001L
staticprotected

Used for serialization.

◆ stillToSend

boolean frodo2.algorithms.odpop.goodsTree.InnerNodeTreeFullDomain.InnerNodeTree< Val extends Addable< Val >, U extends Addable< U >, L extends LeafNode< U > >.stillToSend = true
protected

True if the domain information has not been requested yet.

Referenced by getFinalDomainSize(), and stillToSend().

◆ storeReceivedGoods

boolean frodo2.algorithms.odpop.goodsTree.InnerNodeTreeFullDomain.InnerNodeTree< Val extends Addable< Val >, U extends Addable< U >, L extends LeafNode< U > >.storeReceivedGoods = true
protected

If domain or variable information is incomplete received goods must be stored, otherwise they can be discarded after processing.

Referenced by hasSupport().

◆ toBeProcessedDomains

HashMap<String, Val[]> frodo2.algorithms.odpop.goodsTree.InnerNodeTreeFullDomain.InnerNodeTree< Val extends Addable< Val >, U extends Addable< U >, L extends LeafNode< U > >.toBeProcessedDomains
protected

Domains still to be added to domains.

Referenced by init().

◆ unpackedVariablesPerChild

String [][] frodo2.algorithms.odpop.goodsTree.InnerNodeTreeFullDomain.InnerNodeTree< Val extends Addable< Val >, U extends Addable< U >, L extends LeafNode< U > >.unpackedVariablesPerChild
protected

Per child the unpacked variables (different from the reported variables).

Referenced by init().

◆ upperBoundIsInfiniteCounter

int frodo2.algorithms.odpop.goodsTree.InnerNodeTreeFullDomain.InnerNodeTree< Val extends Addable< Val >, U extends Addable< U >, L extends LeafNode< U > >.upperBoundIsInfiniteCounter
protected

Counts the number of children that have already sent at least one confirmed good.

Referenced by add(), init(), and updateLocalProblem().

◆ upperBoundIsMinInfiniteCounter

int frodo2.algorithms.odpop.goodsTree.InnerNodeTreeFullDomain.InnerNodeTree< Val extends Addable< Val >, U extends Addable< U >, L extends LeafNode< U > >.upperBoundIsMinInfiniteCounter
protected

COunts the number of children that have already reported a minInfinite value.

Referenced by init().

◆ upperBounds

U [] frodo2.algorithms.odpop.goodsTree.InnerNodeTreeFullDomain.InnerNodeTree< Val extends Addable< Val >, U extends Addable< U >, L extends LeafNode< U > >.upperBounds
protected

For each child it stores that last confirmed utility received.

Referenced by add(), checkLeaf(), checkUpperBoundSums(), init(), and initializeUpperBoundSums().

◆ upperBoundSums

U [] frodo2.algorithms.odpop.goodsTree.InnerNodeTreeFullDomain.InnerNodeTree< Val extends Addable< Val >, U extends Addable< U >, L extends LeafNode< U > >.upperBoundSums
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().

◆ valuePointers

HashMap<String, HashMap<Val, Integer> > frodo2.algorithms.odpop.goodsTree.InnerNodeTreeFullDomain.InnerNodeTree< Val extends Addable< Val >, U extends Addable< U >, L extends LeafNode< U > >.valuePointers
protected

Used to determine to which child a variable value corresponds to.

Referenced by add(), addNewVariable(), getOwnVariableOptions(), init(), pathExists(), toKey(), and updateLocalProblem().

◆ variableToDepth

HashMap<String, Integer> frodo2.algorithms.odpop.goodsTree.InnerNodeTreeFullDomain.InnerNodeTree< Val extends Addable< Val >, U extends Addable< U >, L extends LeafNode< U > >.variableToDepth
protected

links a variable to its depth in the tree.

Referenced by add(), addNewVariable(), getBestAssignmentForOwnVariable(), init(), knowsVariable(), and toKey().


The documentation for this class was generated from the following file: