FRODO Version 2.19.1
An open-source framework for Distributed Constraint Optimization (DCOP)
Loading...
Searching...
No Matches
frodo2.algorithms.duct.SearchNode< V extends Addable< V > > Class Template Reference

Convenience class to store information associated to a specific state. More...

Public Member Functions

 SearchNode (int numberOfValues, boolean maximize, boolean ignore_inf)
 Constructor.
void initSampling (UtilitySolutionSpace< V, AddableReal > space, AddableReal infeasibleUtility, String[] contextVariables, V[] context, V[] domain)
 Finds the first feasible local solution, given the current context.
void visited (Bound< V > b)
 Method called whenever the state is sampled.
int solveLocalProblem (UtilitySolutionSpace< V, AddableReal > space, AddableReal infeasibleUtility, String[] contextVariables, V[] context, V[] domain)
 Finds the next feasible local solution.
AddableReal storeCost (int valueIndex, AddableReal costSample, AddableReal infeasibleUtility, final boolean maximize)
 Stores the sum of the costs reported by the children for this particular state.
double convergenceBound (int index, double delta)
 With probablity 1- delta the error between the real value and the estimated value lies in.
String toString (double delta)
int getRandomUnknowLocal (UtilitySolutionSpace< V, AddableReal > space, AddableReal infeasibleUtility, String[] contextVariables, V[] context, V[] domain)
 Method to randomly pick a value that has not been sampled yet.

Public Attributes

AddableReal[] localCosts
 For each domain value, the local costs assocated to it.
ArrayList< Integer > unknowLocalSolutions
 List of local solutions that have not yet been sampled.
int nbrFeasibleLocalSolutions
 Counts the number of local infeasible solutions.
boolean feasible
 true when the local problem has at least one feasible solution, false otherwise
int numberOfValues
 the size of the domain
double[] averageUtil
 For each domain value, the average utility received so far.
double[] bestUtil
 The best util received so far.
double[] bounds
 For each domain value, the current bound.
int[] actionFrequencies
 For each posible domain values, the number of times it has been selected.
int frequencie
 The number of times the corresponding state has been visited.
double maxValue
 The value woth the currently best utility.
double maxBound
 The value with the currently highest upper bound.
int maxValueIndex
 The index of the currently best value.
int maxBoundIndex
 The index of the currently highest bound.

Protected Attributes

final boolean IGNORE_INF
 when true, infeasible values should always be ignored, when false the should be sampled once
boolean random
 true when not all domain values have been sampled, and false otherwise
int lastVisited
 Last value visited.

Package Functions

String arrayToString (Object[] arr, int highlight)
 Method for printing an array, highlighting the entry at highlight.
String arrayToString (double[] arr, int highlight)
 Method for printing an array, highlighting the entry at highlight.

Package Attributes

ArrayList< Integer > samplingOrder = new ArrayList<Integer>()
 The sampling order.

Detailed Description

Convenience class to store information associated to a specific state.

Author
Brammert Ottens, 29 aug. 2011
Parameters
<V>type used for domain values

Constructor & Destructor Documentation

◆ SearchNode()

frodo2.algorithms.duct.SearchNode< V extends Addable< V > >.SearchNode ( int numberOfValues,
boolean maximize,
boolean ignore_inf )

Constructor.

Parameters
numberOfValuesthe domain size of the variable
maximizetrue when maximizing, and false otherwise
ignore_inftrue when infeasible utilities should be totally ignored, false otherwise

References actionFrequencies, averageUtil, bestUtil, bounds, feasible, IGNORE_INF, localCosts, numberOfValues, and random.

Member Function Documentation

◆ arrayToString() [1/2]

String frodo2.algorithms.duct.SearchNode< V extends Addable< V > >.arrayToString ( double[] arr,
int highlight )
package

Method for printing an array, highlighting the entry at highlight.

Author
Brammert Ottens, Oct 31, 2011
Parameters
arrthe array to be printed
highlightthe index to be highlighted
Returns
string representation of the array

◆ arrayToString() [2/2]

String frodo2.algorithms.duct.SearchNode< V extends Addable< V > >.arrayToString ( Object[] arr,
int highlight )
package

Method for printing an array, highlighting the entry at highlight.

Author
Brammert Ottens, Oct 31, 2011
Parameters
arrthe array to be printed
highlightthe index to be highlighted
Returns
string representation of the array

Referenced by toString().

◆ convergenceBound()

double frodo2.algorithms.duct.SearchNode< V extends Addable< V > >.convergenceBound ( int index,
double delta )

◆ getRandomUnknowLocal()

int frodo2.algorithms.duct.SearchNode< V extends Addable< V > >.getRandomUnknowLocal ( UtilitySolutionSpace< V, AddableReal > space,
AddableReal infeasibleUtility,
String[] contextVariables,
V[] context,
V[] domain )

Method to randomly pick a value that has not been sampled yet.

Parameters
spacethe space owned by the variable
infeasibleUtilitythe infeasible utility
contextVariablesthe variables in the separator
contextthe current context (variable assignment)
domainthe domain of the variable
Returns
an index of an unsampled, feasible solution, or -1 if no such value exists

References frodo2.solutionSpaces.AddableReal.add(), and unknowLocalSolutions.

Referenced by initSampling(), and solveLocalProblem().

Here is the call graph for this function:

◆ initSampling()

void frodo2.algorithms.duct.SearchNode< V extends Addable< V > >.initSampling ( UtilitySolutionSpace< V, AddableReal > space,
AddableReal infeasibleUtility,
String[] contextVariables,
V[] context,
V[] domain )

Finds the first feasible local solution, given the current context.

Author
Brammert Ottens, Oct 24, 2011
Parameters
spacethe local space
infeasibleUtilitythe infeasible utility
contextVariablesthe context variables
contextthe context
domainthe variable domain

References getRandomUnknowLocal(), and lastVisited.

Referenced by frodo2.algorithms.duct.Sampling< V extends Addable< V > >.VariableInfo.setContext(), and frodo2.algorithms.duct.SamplingPruning< V extends Addable< V > >.VariableInfo.setContext().

Here is the call graph for this function:

◆ solveLocalProblem()

int frodo2.algorithms.duct.SearchNode< V extends Addable< V > >.solveLocalProblem ( UtilitySolutionSpace< V, AddableReal > space,
AddableReal infeasibleUtility,
String[] contextVariables,
V[] context,
V[] domain )

Finds the next feasible local solution.

Author
Brammert Ottens, Oct 24, 2011
Parameters
spacethe local space
infeasibleUtilitythe infeasible utility
contextVariablesthe context variables
contextthe context
domainthe variable domain
Returns
the last visited feasible local solution

References getRandomUnknowLocal(), lastVisited, and unknowLocalSolutions.

Here is the call graph for this function:

◆ storeCost()

AddableReal frodo2.algorithms.duct.SearchNode< V extends Addable< V > >.storeCost ( int valueIndex,
AddableReal costSample,
AddableReal infeasibleUtility,
final boolean maximize )

Stores the sum of the costs reported by the children for this particular state.

Author
Brammert Ottens, 24 aug. 2011
Parameters
valueIndexthe index of the sampled value
costSamplethe sum of the costs reported by the children
infeasibleUtilityutility of infeasible assignments
maximizetrue when maximizing, and false otherwise
Returns
the sum of the reported and local cost

References actionFrequencies, averageUtil, bestUtil, frodo2.solutionSpaces.AddableReal.doubleValue(), localCosts, and random.

Here is the call graph for this function:

◆ toString()

String frodo2.algorithms.duct.SearchNode< V extends Addable< V > >.toString ( double delta)
Author
Brammert Ottens, 18 okt. 2011
Parameters
deltathe delta
Returns
string representation of the object, used for debugging purposses

References actionFrequencies, arrayToString(), averageUtil, bestUtil, convergenceBound(), frodo2.solutionSpaces.AddableReal.doubleValue(), localCosts, maxBoundIndex, maxValueIndex, numberOfValues, and random.

Here is the call graph for this function:

◆ visited()

void frodo2.algorithms.duct.SearchNode< V extends Addable< V > >.visited ( Bound< V > b)

Method called whenever the state is sampled.

Author
Brammert Ottens, 24 aug. 2011
Parameters
bthe type of bound used

References bounds, frequencie, numberOfValues, and frodo2.algorithms.duct.bound.Bound< V extends Addable< V > >.sampleBound().

Here is the call graph for this function:

Member Data Documentation

◆ actionFrequencies

◆ averageUtil

◆ bestUtil

◆ bounds

◆ feasible

◆ frequencie

◆ IGNORE_INF

final boolean frodo2.algorithms.duct.SearchNode< V extends Addable< V > >.IGNORE_INF
protected

when true, infeasible values should always be ignored, when false the should be sampled once

Referenced by SearchNode().

◆ lastVisited

int frodo2.algorithms.duct.SearchNode< V extends Addable< V > >.lastVisited
protected

Last value visited.

Referenced by initSampling(), and solveLocalProblem().

◆ localCosts

◆ maxBound

◆ maxBoundIndex

◆ maxValue

◆ maxValueIndex

◆ nbrFeasibleLocalSolutions

◆ numberOfValues

◆ random

boolean frodo2.algorithms.duct.SearchNode< V extends Addable< V > >.random
protected

true when not all domain values have been sampled, and false otherwise

Referenced by SearchNode(), storeCost(), and toString().

◆ samplingOrder

ArrayList<Integer> frodo2.algorithms.duct.SearchNode< V extends Addable< V > >.samplingOrder = new ArrayList<Integer>()
package

The sampling order.

◆ unknowLocalSolutions

ArrayList<Integer> frodo2.algorithms.duct.SearchNode< V extends Addable< V > >.unknowLocalSolutions

List of local solutions that have not yet been sampled.

Referenced by getRandomUnknowLocal(), and solveLocalProblem().


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