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

Distributed algorithm to compute one variable linear ordering per connected component in the constraint graph. More...

Inheritance diagram for frodo2.algorithms.varOrdering.linear.LinearOrdering< V extends Addable< V >, U extends Addable< U > >:

Classes

interface  Heuristic
 Variable ordering heuristic. More...
class  MaxWidthMinDom
 A heuristic that maximizes the number of neighbors already in the order, breaking ties by minimizing the domain size, and then by variable name. More...
class  ComponentInfo
 All relevant information about a connected component of the constraint graph. More...

Public Member Functions

 LinearOrdering (Element parameters, DCOPProblemInterface< V, U > problem)
 The constructor called in "statistics gatherer" mode.
 LinearOrdering (DCOPProblemInterface< V, U > problem, Element parameters)
 Constructor.
void reset ()
void getStatsFromQueue (Queue queue)
void setQueue (Queue queue)
void setSilent (boolean silent)
Collection< MessageTypegetMsgTypes ()
void notifyIn (Message msg)
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 MessageType START_MSG_TYPE = AgentInterface.START_AGENT
 The type of the message telling the module to start.

Static Package Attributes

static final MessageType REQUEST_MSG_TYPE = new MessageType ("VarOrdering", "LinearOrdering", "NextVarRequest")
 The type of the messages sent to request proposals for the next variable to put in the order.
static final MessageType PROPOSAL_MSG_TYPE = new MessageType ("VarOrdering", "LinearOrdering", "NextVarProposal")
 The type of the messages containing a proposal for the next variable to put in the order.
static final MessageType NEXT_VAR_MSG_TYPE = new MessageType ("VarOrdering", "LinearOrdering", "NextVarChosen")
 The type of the messages notifying an agent that one of its variable is next in the order.

Private Member Functions

void init ()
 Parses the problem.
void printOrder ()
 Prints the variable order in DOT format.

Private Attributes

Queue queue
 This module's queue.
boolean silent = false
 Whether the stats gatherer should display the resulting linear order.
String dotRendererClass
 Renderer to display DOT code.
DCOPProblemInterface< V, U > problem
 The problem.
boolean started = false
 Whether the module has already started the algorithm.
int countdown
 The number of my variables for which I have not yet received the output of VariableElection.
HashMap< Comparable<?>, ComponentInfocompInfos
 The information about each connected component in the constraint graph.
String myID
 This agent's name.
Set< String > allAgents
 The set of all agents in the problem.
ArrayList< RequestMsgpendingMsgs
 A list of pending requests.
Heuristic< IntIntStringTupleheuristic
 The heuristic.
Map< String, Set< String > > agentNeighborhoods
 For each internal variable, its list of agent neighbors.
Map< String, String > owners
 The owner of each variable I know.
HashMap< String, Comparable<?> > componentIDs
 The component ID for this agent's variables and all their neighbors.
Map< String, ? extends Collection< String > > neighborhoods
 For each internal variable, its list of neighbors.

Static Private Attributes

static final MessageType TEMP_OUTPUT_MSG_TYPE = new MessageType ("VarOrdering", "LinearOrdering", "VarOrderNoSpace")
 The type of the message notifying the agent of the chosen ordering, excluding the spaces.

Detailed Description

Distributed algorithm to compute one variable linear ordering per connected component in the constraint graph.

The algorithm is initiated by the variable(s) chosen by VariableElection. At each iteration, the current variable prompts all agents for their best proposals for the next variable.

Parameters
<V>the type used for variable values
<U>the type used for utility values
Warning
Requires that each agent know the identity of all other agents in the problem.
Todo
Write a dedicated unit test.
Author
Thomas Leaute

Constructor & Destructor Documentation

◆ LinearOrdering() [1/2]

frodo2.algorithms.varOrdering.linear.LinearOrdering< V extends Addable< V >, U extends Addable< U > >.LinearOrdering ( Element parameters,
DCOPProblemInterface< V, U > problem )

The constructor called in "statistics gatherer" mode.

Parameters
problemthe overall problem
parametersthe description of what statistics should be reported (currently unused)

References problem.

◆ LinearOrdering() [2/2]

frodo2.algorithms.varOrdering.linear.LinearOrdering< V extends Addable< V >, U extends Addable< U > >.LinearOrdering ( DCOPProblemInterface< V, U > problem,
Element parameters )

Constructor.

Parameters
problemthis agent's problem
parametersthe parameters for LinearOrdering

References problem.

Member Function Documentation

◆ getMsgTypes()

◆ getStatsFromQueue()

◆ init()

◆ notifyIn()

◆ printOrder()

void frodo2.algorithms.varOrdering.linear.LinearOrdering< V extends Addable< V >, U extends Addable< U > >.printOrder ( )
private

Prints the variable order in DOT format.

References dotRendererClass, and problem.

◆ reset()

◆ setQueue()

void frodo2.algorithms.varOrdering.linear.LinearOrdering< V extends Addable< V >, U extends Addable< U > >.setQueue ( Queue queue)

◆ setSilent()

Member Data Documentation

◆ agentNeighborhoods

Map< String, Set<String> > frodo2.algorithms.varOrdering.linear.LinearOrdering< V extends Addable< V >, U extends Addable< U > >.agentNeighborhoods
private

For each internal variable, its list of agent neighbors.

Referenced by notifyIn().

◆ allAgents

Set<String> frodo2.algorithms.varOrdering.linear.LinearOrdering< V extends Addable< V >, U extends Addable< U > >.allAgents
private

The set of all agents in the problem.

◆ compInfos

HashMap<Comparable<?>, ComponentInfo> frodo2.algorithms.varOrdering.linear.LinearOrdering< V extends Addable< V >, U extends Addable< U > >.compInfos
private

The information about each connected component in the constraint graph.

◆ componentIDs

HashMap< String, Comparable<?> > frodo2.algorithms.varOrdering.linear.LinearOrdering< V extends Addable< V >, U extends Addable< U > >.componentIDs
private

The component ID for this agent's variables and all their neighbors.

◆ countdown

int frodo2.algorithms.varOrdering.linear.LinearOrdering< V extends Addable< V >, U extends Addable< U > >.countdown
private

The number of my variables for which I have not yet received the output of VariableElection.

◆ dotRendererClass

String frodo2.algorithms.varOrdering.linear.LinearOrdering< V extends Addable< V >, U extends Addable< U > >.dotRendererClass
private

Renderer to display DOT code.

Referenced by printOrder().

◆ heuristic

The heuristic.

◆ myID

String frodo2.algorithms.varOrdering.linear.LinearOrdering< V extends Addable< V >, U extends Addable< U > >.myID
private

This agent's name.

◆ neighborhoods

Map<String, ? extends Collection<String> > frodo2.algorithms.varOrdering.linear.LinearOrdering< V extends Addable< V >, U extends Addable< U > >.neighborhoods
private

For each internal variable, its list of neighbors.

◆ NEXT_VAR_MSG_TYPE

final MessageType frodo2.algorithms.varOrdering.linear.LinearOrdering< V extends Addable< V >, U extends Addable< U > >.NEXT_VAR_MSG_TYPE = new MessageType ("VarOrdering", "LinearOrdering", "NextVarChosen")
staticpackage

The type of the messages notifying an agent that one of its variable is next in the order.

Referenced by getMsgTypes(), frodo2.algorithms.varOrdering.linear.NextVarMsg.NextVarMsg(), and frodo2.algorithms.varOrdering.linear.NextVarMsg.NextVarMsg().

◆ owners

Map<String, String> frodo2.algorithms.varOrdering.linear.LinearOrdering< V extends Addable< V >, U extends Addable< U > >.owners
private

The owner of each variable I know.

◆ pendingMsgs

ArrayList<RequestMsg> frodo2.algorithms.varOrdering.linear.LinearOrdering< V extends Addable< V >, U extends Addable< U > >.pendingMsgs
private

A list of pending requests.

◆ problem

DCOPProblemInterface<V, U> frodo2.algorithms.varOrdering.linear.LinearOrdering< V extends Addable< V >, U extends Addable< U > >.problem
private

The problem.

Referenced by LinearOrdering(), LinearOrdering(), and printOrder().

◆ PROPOSAL_MSG_TYPE

final MessageType frodo2.algorithms.varOrdering.linear.LinearOrdering< V extends Addable< V >, U extends Addable< U > >.PROPOSAL_MSG_TYPE = new MessageType ("VarOrdering", "LinearOrdering", "NextVarProposal")
staticpackage

◆ queue

Queue frodo2.algorithms.varOrdering.linear.LinearOrdering< V extends Addable< V >, U extends Addable< U > >.queue
private

This module's queue.

Referenced by getStatsFromQueue(), and setQueue().

◆ REQUEST_MSG_TYPE

final MessageType frodo2.algorithms.varOrdering.linear.LinearOrdering< V extends Addable< V >, U extends Addable< U > >.REQUEST_MSG_TYPE = new MessageType ("VarOrdering", "LinearOrdering", "NextVarRequest")
staticpackage

The type of the messages sent to request proposals for the next variable to put in the order.

Referenced by getMsgTypes(), frodo2.algorithms.varOrdering.linear.RequestMsg.RequestMsg(), and frodo2.algorithms.varOrdering.linear.RequestMsg.RequestMsg().

◆ silent

boolean frodo2.algorithms.varOrdering.linear.LinearOrdering< V extends Addable< V >, U extends Addable< U > >.silent = false
private

Whether the stats gatherer should display the resulting linear order.

Referenced by setSilent().

◆ START_MSG_TYPE

The type of the message telling the module to start.

Referenced by getMsgTypes().

◆ started

boolean frodo2.algorithms.varOrdering.linear.LinearOrdering< V extends Addable< V >, U extends Addable< U > >.started = false
private

Whether the module has already started the algorithm.

◆ TEMP_OUTPUT_MSG_TYPE

final MessageType frodo2.algorithms.varOrdering.linear.LinearOrdering< V extends Addable< V >, U extends Addable< U > >.TEMP_OUTPUT_MSG_TYPE = new MessageType ("VarOrdering", "LinearOrdering", "VarOrderNoSpace")
staticprivate

The type of the message notifying the agent of the chosen ordering, excluding the spaces.

Referenced by getMsgTypes(), and notifyIn().


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