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

Classes

class  VariableInfo
 Convenience class to hold variable information. More...
class  State
 Convenience class to store a context. More...

Public Member Functions

 Sampling (Element parameters, DCOPProblemInterface< V, AddableReal > problem)
 Constructor for the stats reporter.
 Sampling (DCOPProblemInterface< V, AddableReal > problem, Element parameters)
 Constructor.
void notifyIn (Message msg)
AddableReal getFinalBound ()
void setQueue (Queue queue)
Collection< MessageTypegetMsgTypes ()
void getStatsFromQueue (Queue queue)
void setSilent (boolean silent)
void reset ()
Public Member Functions inherited from frodo2.communication.IncomingMsgPolicyInterface< T >
default void notifyIn (Message msg, Object toAgent)
 Notifies the listener of an incoming message.

Static Public Attributes

static final MessageType VALUE_MSG_TYPE = new MessageType ("DUCT", "Sampling", "value")
 The type of a VALUE message.
static final MessageType VALUE_FIN_MSG_TYPE = new MessageType ("DUCT", "Sampling", "value_fin")
 The type of a VALUE message.
static final MessageType COST_MSG_TYPE = new MessageType ("DUCT", "Sampling", "cost")
 The type of a COST message.
static final MessageType OUTPUT_MSG_TYPE = new MessageType ("DUCT", "Sampling", "Output")
 The type of the output message.
static final MessageType BOUND_MSG_TYPE = new MessageType ("DUCT", "Sampling", "final_bound")
 The type of the final bound statistics message.

Protected Member Functions

VariableInfo newVariableInfo (String variableID, V[] domain, String parent, List< String > children)
void reportValue (VariableInfo varInfo, boolean finished)
 Method used to report the value to all children and pseudo children.
void init ()
 Initialization method called when the start message is received.

Protected Attributes

final boolean IGNORE_INF
 When true, infeasible utilities should be ignored.
boolean started
 true when the start message has been received, and false otherwise
final boolean maximize
 true when maximizing, and false when minimizing
boolean reportStats = true
 Whether to report stats.
HashMap< String, VariableInfoinfos
 For each variable the available information.
Queue queue
 The queue the listener is connected to.
Map< String, String > owners
 For each variable, the name of the owner.
DCOPProblemInterface< V, AddableRealproblem
 The agent's problem.
int numberOfActiveVariables
 The number of variables that have not yet finished.
double error
 If the error bound is smaller than error, we stop.
double delta
 The delta that is used to calculate the error bound.
Class< SamplingProcedure< V > > samplingClass
 Class of the sampling methods.
Class< TerminationCondition< V > > terminationClass
 Class of the termination method.
Class< Bound< V > > boundClass
 Class of the bound method.
AddableReal infeasibleUtility
 Utility of an infeasible solution.
AddableReal penalty
 penalty used to replace an infeasible solution
AddableReal scalingFactor
 The factor by which all utilities are scaled down.
AddableReal finalBound
 The final bound on the solution quality.

Detailed Description

Author
Brammert Ottens, 7 jul. 2011
Parameters
<V>type used for domain values

Constructor & Destructor Documentation

◆ Sampling() [1/2]

frodo2.algorithms.duct.Sampling< V extends Addable< V > >.Sampling ( Element parameters,
DCOPProblemInterface< V, AddableReal > problem )

Constructor for the stats reporter.

Parameters
parameterslisteners parameters (not used for the moment)
problemproblem description

References problem.

Referenced by Sampling().

◆ Sampling() [2/2]

frodo2.algorithms.duct.Sampling< V extends Addable< V > >.Sampling ( DCOPProblemInterface< V, AddableReal > problem,
Element parameters )

Constructor.

Parameters
problemproblem description
parameterslisteners parameters (not used for the moment)

References frodo2.algorithms.duct.VALUEmsg< V extends Addable< V > >.DOMAIN_VALUE, maximize, problem, and Sampling().

Here is the call graph for this function:

Member Function Documentation

◆ getFinalBound()

AddableReal frodo2.algorithms.duct.Sampling< V extends Addable< V > >.getFinalBound ( )
Author
Brammert Ottens, Dec 29, 2011
Returns
the final bound on the solution quality

◆ getMsgTypes()

◆ getStatsFromQueue()

◆ init()

void frodo2.algorithms.duct.Sampling< V extends Addable< V > >.init ( )
protected

Initialization method called when the start message is received.

Author
Brammert Ottens, 7 jul. 2011

References infos, owners, and problem.

Referenced by notifyIn().

◆ newVariableInfo()

VariableInfo frodo2.algorithms.duct.Sampling< V extends Addable< V > >.newVariableInfo ( String variableID,
V[] domain,
String parent,
List< String > children )
protected
Author
Brammert Ottens, 16 sep. 2011
Parameters
variableIDthe name of the variable
domainthe domain of the variable
parentthe parent of the variable
childrenlist of the children of the variable
Returns
a VariableInfo object

References samplingClass, and terminationClass.

Referenced by notifyIn().

◆ notifyIn()

void frodo2.algorithms.duct.Sampling< V extends Addable< V > >.notifyIn ( Message msg)
See also
frodo2.communication.IncomingMsgPolicyInterface.notifyIn(frodo2.communication.Message)

Implements frodo2.communication.IncomingMsgPolicyInterface< T >.

References frodo2.algorithms.AgentInterface< V extends Addable< V > >.AGENT_FINISHED, BOUND_MSG_TYPE, COST_MSG_TYPE, frodo2.algorithms.duct.Sampling< V extends Addable< V > >.VariableInfo.currentValue, delta, frodo2.communication.MessageType.equals(), error, finalBound, frodo2.algorithms.duct.Sampling< V extends Addable< V > >.VariableInfo.finishedSampling(), frodo2.algorithms.duct.Sampling< V extends Addable< V > >.VariableInfo.getAssignmentMessage(), frodo2.algorithms.varOrdering.dfs.DFSgeneration< V extends Addable< V >, U extends Addable< U > >.DFSview< V extends Addable< V >, U extends Addable< U > >.getChildren(), frodo2.algorithms.duct.Sampling< V extends Addable< V > >.VariableInfo.getCostMessage(), frodo2.algorithms.duct.BoundStatsMsg.getFinalBound(), frodo2.algorithms.duct.Sampling< V extends Addable< V > >.VariableInfo.getFinalBound(), frodo2.algorithms.duct.Sampling< V extends Addable< V > >.VariableInfo.getParent(), frodo2.algorithms.varOrdering.dfs.DFSgeneration< V extends Addable< V >, U extends Addable< U > >.DFSview< V extends Addable< V >, U extends Addable< U > >.getParent(), frodo2.algorithms.duct.COSTmsg.getReceiver(), frodo2.algorithms.duct.VALUEmsg< V extends Addable< V > >.getReceiver(), frodo2.algorithms.duct.OUTmsg< V extends Addable< V > >.getScalingFactor(), frodo2.algorithms.duct.VALUEmsg< V extends Addable< V > >.getSender(), frodo2.algorithms.duct.OUTmsg< V extends Addable< V > >.getSeparators(), frodo2.algorithms.duct.OUTmsg< V extends Addable< V > >.getSize(), frodo2.algorithms.duct.OUTmsg< V extends Addable< V > >.getSpaces(), frodo2.communication.Message.getType(), frodo2.algorithms.duct.VALUEmsg< V extends Addable< V > >.getValues(), frodo2.algorithms.duct.OUTmsg< V extends Addable< V > >.getVariable(), frodo2.algorithms.duct.VALUEmsg< V extends Addable< V > >.getVariables(), infos, init(), frodo2.algorithms.duct.Sampling< V extends Addable< V > >.VariableInfo.leaf, maximize, newVariableInfo(), frodo2.algorithms.duct.Normalize< V extends Addable< V > >.OUT_MSG_TYPE, frodo2.algorithms.varOrdering.dfs.DFSgeneration< V extends Addable< V >, U extends Addable< U > >.OUTPUT_MSG_TYPE, owners, frodo2.algorithms.duct.Sampling< V extends Addable< V > >.VariableInfo.parent, frodo2.algorithms.duct.Sampling< V extends Addable< V > >.VariableInfo.parentFinished, penalty, frodo2.algorithms.duct.Sampling< V extends Addable< V > >.VariableInfo.penalty, problem, queue, frodo2.algorithms.duct.Sampling< V extends Addable< V > >.VariableInfo.receivedNormalize, reportValue(), frodo2.algorithms.duct.Sampling< V extends Addable< V > >.VariableInfo.sample(), scalingFactor, frodo2.algorithms.duct.Sampling< V extends Addable< V > >.VariableInfo.setContext(), frodo2.algorithms.duct.Sampling< V extends Addable< V > >.VariableInfo.setSeparator(), frodo2.algorithms.duct.Sampling< V extends Addable< V > >.VariableInfo.setSize(), frodo2.algorithms.duct.Sampling< V extends Addable< V > >.VariableInfo.solveLeaf(), frodo2.algorithms.duct.Sampling< V extends Addable< V > >.VariableInfo.solveSingleton(), started, frodo2.algorithms.AgentInterface< V extends Addable< V > >.STATS_MONITOR, frodo2.algorithms.duct.Sampling< V extends Addable< V > >.VariableInfo.storeConstraint(), frodo2.algorithms.duct.Sampling< V extends Addable< V > >.VariableInfo.storeCOSTmsg(), frodo2.algorithms.duct.Sampling< V extends Addable< V > >.VariableInfo.toBeProcessed, VALUE_FIN_MSG_TYPE, VALUE_MSG_TYPE, and frodo2.algorithms.duct.Sampling< V extends Addable< V > >.VariableInfo.variableID.

Here is the call graph for this function:

◆ reportValue()

void frodo2.algorithms.duct.Sampling< V extends Addable< V > >.reportValue ( VariableInfo varInfo,
boolean finished )
protected

Method used to report the value to all children and pseudo children.

Author
Brammert Ottens, 7 jul. 2011
Parameters
varInfothe variable information object
finishedtrue when the variable is ready with sampling, and false otherwise

References frodo2.algorithms.duct.Sampling< V extends Addable< V > >.VariableInfo.getChildren(), frodo2.algorithms.duct.Sampling< V extends Addable< V > >.VariableInfo.getNewValueMessage(), owners, and queue.

Referenced by notifyIn().

Here is the call graph for this function:

◆ reset()

◆ setQueue()

◆ setSilent()

void frodo2.algorithms.duct.Sampling< V extends Addable< V > >.setSilent ( boolean silent)

Member Data Documentation

◆ BOUND_MSG_TYPE

final MessageType frodo2.algorithms.duct.Sampling< V extends Addable< V > >.BOUND_MSG_TYPE = new MessageType ("DUCT", "Sampling", "final_bound")
static

The type of the final bound statistics message.

Referenced by frodo2.algorithms.duct.BoundStatsMsg.BoundStatsMsg(), getStatsFromQueue(), and notifyIn().

◆ boundClass

Class<Bound<V> > frodo2.algorithms.duct.Sampling< V extends Addable< V > >.boundClass
protected

◆ COST_MSG_TYPE

final MessageType frodo2.algorithms.duct.Sampling< V extends Addable< V > >.COST_MSG_TYPE = new MessageType ("DUCT", "Sampling", "cost")
static

◆ delta

◆ error

double frodo2.algorithms.duct.Sampling< V extends Addable< V > >.error
protected

If the error bound is smaller than error, we stop.

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

◆ finalBound

AddableReal frodo2.algorithms.duct.Sampling< V extends Addable< V > >.finalBound
protected

The final bound on the solution quality.

Referenced by notifyIn().

◆ IGNORE_INF

◆ infeasibleUtility

◆ infos

HashMap<String, VariableInfo> frodo2.algorithms.duct.Sampling< V extends Addable< V > >.infos
protected

For each variable the available information.

Referenced by init(), and notifyIn().

◆ maximize

◆ numberOfActiveVariables

int frodo2.algorithms.duct.Sampling< V extends Addable< V > >.numberOfActiveVariables
protected

The number of variables that have not yet finished.

◆ OUTPUT_MSG_TYPE

final MessageType frodo2.algorithms.duct.Sampling< V extends Addable< V > >.OUTPUT_MSG_TYPE = new MessageType ("DUCT", "Sampling", "Output")
static

The type of the output message.

◆ owners

Map<String, String> frodo2.algorithms.duct.Sampling< V extends Addable< V > >.owners
protected

For each variable, the name of the owner.

Referenced by init(), notifyIn(), and reportValue().

◆ penalty

AddableReal frodo2.algorithms.duct.Sampling< V extends Addable< V > >.penalty
protected

penalty used to replace an infeasible solution

Referenced by notifyIn().

◆ problem

The agent's problem.

Referenced by init(), notifyIn(), Sampling(), and Sampling().

◆ queue

Queue frodo2.algorithms.duct.Sampling< V extends Addable< V > >.queue
protected

The queue the listener is connected to.

Referenced by getStatsFromQueue(), notifyIn(), reportValue(), and setQueue().

◆ reportStats

boolean frodo2.algorithms.duct.Sampling< V extends Addable< V > >.reportStats = true
protected

Whether to report stats.

◆ samplingClass

Class<SamplingProcedure<V> > frodo2.algorithms.duct.Sampling< V extends Addable< V > >.samplingClass
protected

◆ scalingFactor

AddableReal frodo2.algorithms.duct.Sampling< V extends Addable< V > >.scalingFactor
protected

The factor by which all utilities are scaled down.

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

◆ started

boolean frodo2.algorithms.duct.Sampling< V extends Addable< V > >.started
protected

true when the start message has been received, and false otherwise

Referenced by notifyIn().

◆ terminationClass

Class<TerminationCondition<V> > frodo2.algorithms.duct.Sampling< V extends Addable< V > >.terminationClass
protected

◆ VALUE_FIN_MSG_TYPE

final MessageType frodo2.algorithms.duct.Sampling< V extends Addable< V > >.VALUE_FIN_MSG_TYPE = new MessageType ("DUCT", "Sampling", "value_fin")
static

◆ VALUE_MSG_TYPE

final MessageType frodo2.algorithms.duct.Sampling< V extends Addable< V > >.VALUE_MSG_TYPE = new MessageType ("DUCT", "Sampling", "value")
static

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