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

The leaf node of a tree. More...

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

Public Member Functions

 LeafNode ()
 Empty constructor.
 LeafNode (int counter, int[] powersOf2)
 A constructor.
 LeafNode (int counter, U util, int[] powersOf2)
 A constructor.
void setUbSum (int sum)
calculateUB (U[] upperBoundsSum, final boolean maximize)
calculateUBTest (U[] upperBoundsSum)
void updateLeafNoUB (Good<?, U > g, U utilityDelta, int sender, int[] powersOf2, final boolean maximize)
void setInfeasable (U infeasibleUtil)
void updateLeafWithUB (Good<?, U > g, U utilityDelta, int sender, U[] upperBoundSums, int[] powersOf2, boolean compatibleAssignmentReceived, final boolean maximize)
boolean utilCandidate (U maxUtil, final boolean maximize)
boolean ubCandidate (U maxUB, final boolean maximize)
getUtil ()
void setUtil (U util)
 Set the utility of this leaf node.
getUB ()
void setUB (U UB)
 Set the upper bound on the utility of this leaf node.
boolean hasUtil ()
boolean isUpToDate ()
void setUpToDate (boolean upToDate)
 Set whether the utility is up to date.
Public Member Functions inherited from frodo2.algorithms.odpop.goodsTree.InnerNodeTreeFullDomain.Node< U >
 Node ()
 A constructor.
Node< U > makeDummyCopy ()
 Method used when creating a dummy part of the tree.
boolean isAlive ()
void setAlive (boolean alive)
 Change the alive status of this node.
boolean utilCandidate (U maxUtil, final boolean maximize)
boolean ubCandidate (U maxUB, boolean maximize)
getUtil ()
getUB ()
boolean hasUtil ()
boolean hasUB ()
boolean recalculateUtil ()

Static Public Member Functions

static int fromBooleanArrayToInt (boolean[] chosen, int[] powersOf2)
 Given a boolean array, representing a boolean value, this method calculates the corresponding integer value.

Public Attributes

int counter
 Number of children that have not yet reported a value for the current assignment.
boolean[] updateUB
 for each child, it stores whether a good has been received or not
Public Attributes inherited from frodo2.algorithms.odpop.goodsTree.InnerNodeTreeFullDomain.Node< U >
boolean alive
 False if this node leads to a path that has been deleted.

Protected Attributes

util
 Contains the sum of the received utilities for this leaf.
UB
 Contains the last upper bound to have been calculated.
boolean upToDate
 true when the upperbound is still greater than the utility value, and false otherwise.
int ubSum
 The index to the sum of all upperbounds.

Package Functions

public< L extends frodo2.algorithms.odpop.goodsTree.InnerNodeTreeFullDomain.Node< U > > L newInstance (int confirmedCounter, int[] powersOf2)
public< L extends frodo2.algorithms.odpop.goodsTree.InnerNodeTreeFullDomain.Node< U > > L newInstance (int confirmedCounter, U util, int[] powersOf2)
Package Functions inherited from frodo2.algorithms.odpop.goodsTree.InnerNodeTreeFullDomain.Node< U >
public< L extends Node< U > > L newInstance (int confirmedCounter, int[] powersOf2)
 Create a new instance of the leaf node.

Detailed Description

The leaf node of a tree.

Author
brammert
Parameters
<U>the type used to represent a utility value

Constructor & Destructor Documentation

◆ LeafNode() [1/3]

◆ LeafNode() [2/3]

frodo2.algorithms.odpop.goodsTree.InnerNodeTreeFullDomain.LeafNode< U extends Addable< U > >.LeafNode ( int counter,
int[] powersOf2 )

A constructor.

Parameters
counterthe number of assignments to be received
powersOf2precomputed powers of 2

References counter, ubSum, updateUB, and upToDate.

◆ LeafNode() [3/3]

frodo2.algorithms.odpop.goodsTree.InnerNodeTreeFullDomain.LeafNode< U extends Addable< U > >.LeafNode ( int counter,
U util,
int[] powersOf2 )

A constructor.

Parameters
counterthe number of assignments to be received
utilthe already receive utility
powersOf2precomputed powers of 2

References counter, UB, ubSum, updateUB, upToDate, and util.

Member Function Documentation

◆ calculateUB()

U frodo2.algorithms.odpop.goodsTree.InnerNodeTreeFullDomain.LeafNode< U extends Addable< U > >.calculateUB ( U[] upperBoundsSum,
final boolean maximize )
Author
Brammert Ottens, 25 feb 2010
Parameters
upperBoundsSumprecomputed sums of the upperbounds
maximizewhen true we are maximizing, when false we are minimizing
Returns
the upperbound

References counter, ubSum, upToDate, and util.

Referenced by frodo2.algorithms.odpop.goodsTree.InnerNodeTreeFullDomain.InnerNodeTree< Val extends Addable< Val >, U extends Addable< U >, L extends LeafNode< U > >.setChildDone(), and updateLeafWithUB().

◆ calculateUBTest()

U frodo2.algorithms.odpop.goodsTree.InnerNodeTreeFullDomain.LeafNode< U extends Addable< U > >.calculateUBTest ( U[] upperBoundsSum)
Author
Brammert Ottens, 25 feb 2010
Parameters
upperBoundsSumprecomputed sums of the upperbounds
Returns
the upperbound

References counter, ubSum, and util.

◆ fromBooleanArrayToInt()

◆ getUB()

◆ getUtil()

◆ hasUtil()

◆ isUpToDate()

Author
Brammert Ottens, 22 apr 2010
Returns
true when the utility is nor greate than the upper bound, and false otherwise

◆ newInstance() [1/2]

◆ newInstance() [2/2]

◆ setInfeasable()

void frodo2.algorithms.odpop.goodsTree.InnerNodeTreeFullDomain.LeafNode< U extends Addable< U > >.setInfeasable ( U infeasibleUtil)
Author
Brammert Ottens, 30 apr 2010
Parameters
infeasibleUtilthe infeasible utility

References util.

◆ setUB()

◆ setUbSum()

◆ setUpToDate()

◆ setUtil()

◆ ubCandidate()

boolean frodo2.algorithms.odpop.goodsTree.InnerNodeTreeFullDomain.LeafNode< U extends Addable< U > >.ubCandidate ( U maxUB,
final boolean maximize )
Parameters
maxUBthe maximal upper bound found so far
maximizetrue if we are maximizing utility
See also
frodo2.algorithms.odpop.goodsTree.InnerNodeTreeFullDomain.Node.ubCandidate(frodo2.solutionSpaces.Addable, boolean)

References UB.

◆ updateLeafNoUB()

void frodo2.algorithms.odpop.goodsTree.InnerNodeTreeFullDomain.LeafNode< U extends Addable< U > >.updateLeafNoUB ( Good<?, U > g,
U utilityDelta,
int sender,
int[] powersOf2,
final boolean maximize )
Author
Brammert Ottens, 25 feb 2010
Parameters
gthe good that initiated the update
utilityDeltathe difference between the reported util and the previous util
senderthe sender of the good
powersOf2precomputed powers of 2
maximizewhen true we are maximizing, when false we are minimizing

References counter, fromBooleanArrayToInt(), frodo2.algorithms.odpop.Good< Val extends Addable< Val >, U extends Addable< U > >.getUtility(), ubSum, updateUB, and util.

Here is the call graph for this function:

◆ updateLeafWithUB()

void frodo2.algorithms.odpop.goodsTree.InnerNodeTreeFullDomain.LeafNode< U extends Addable< U > >.updateLeafWithUB ( Good<?, U > g,
U utilityDelta,
int sender,
U[] upperBoundSums,
int[] powersOf2,
boolean compatibleAssignmentReceived,
final boolean maximize )
Author
Brammert Ottens, 25 feb 2010
Parameters
gthe good that initiated the update
utilityDeltathe difference between the reported util and the previous util
senderthe sender of the good
upperBoundSumsthe sums of the upperbounds
powersOf2precomputed powers of 2
compatibleAssignmentReceivedtrue when an assignment compatible to this assignment has been received
maximizewhen true we are maximizing, when false we are minimizing

References calculateUB(), counter, fromBooleanArrayToInt(), frodo2.algorithms.odpop.Good< Val extends Addable< Val >, U extends Addable< U > >.getUtility(), UB, ubSum, updateUB, and util.

Here is the call graph for this function:

◆ utilCandidate()

Member Data Documentation

◆ counter

◆ UB

Contains the last upper bound to have been calculated.

Referenced by getUB(), LeafNode(), setUB(), ubCandidate(), and updateLeafWithUB().

◆ ubSum

The index to the sum of all upperbounds.

Referenced by calculateUB(), calculateUBTest(), LeafNode(), LeafNode(), updateLeafNoUB(), and updateLeafWithUB().

◆ updateUB

◆ upToDate

true when the upperbound is still greater than the utility value, and false otherwise.

This can occur when the UB is -infinity

Referenced by calculateUB(), LeafNode(), LeafNode(), and setUpToDate().

◆ util

Contains the sum of the received utilities for this leaf.

Used for recalculating the upper bound

Referenced by calculateUB(), calculateUBTest(), getUtil(), hasUtil(), LeafNode(), newInstance(), setInfeasable(), setUtil(), updateLeafNoUB(), updateLeafWithUB(), and utilCandidate().


The documentation for this class was generated from the following file:
  • src/frodo2/algorithms/odpop/goodsTree/InnerNodeTreeFullDomain/LeafNode.java