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

A StatsReporter that collects the generic solution to a DCOP. More...

Inheritance diagram for frodo2.algorithms.SolutionCollector< V extends Addable< V >, U extends Addable< U > >:

Classes

class  AssignmentsMessage
 A message holding assignments to variables. More...
class  AssignmentMessage
 A message holding an assignment to a variable. More...

Public Member Functions

Map< String, V > getSolution ()
getUtility ()
long getFinalTime ()
 SolutionCollector (DCOPProblemInterface< V, U > problem, Element params)
 Constructor for the module added to the agents' queues.
 SolutionCollector (Element params, DCOPProblemInterface< V, U > problem)
 Constructor in StatsReporter mode.
void notifyIn (Message msg)
void setQueue (Queue queue)
ArrayList< 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 ASSIGNMENTS_MSG_TYPE = new MessageType ("SolutionCollector", "VariableValueAssignments")
 The type of the messages containing assignments to variables.
static final MessageType ASSIGNMENT_MSG_TYPE = new MessageType ("SolutionCollector", "VariableValueAssignment")
 The type of the messages containing an assignment to a variable.

Protected Attributes

boolean maximize = true
 true if we are maximizing utility, false if we are minimizing cost

Private Attributes

Queue queue
 The queue form which this module collects solution messages.
boolean silent
 Whether this module should print out its solution.
DCOPProblemInterface< V, U > problem
 The problem.
HashMap< String, V > solution
 For each variable, its reported value.
utility
 The true utility of the reported solution.
Long finalTime
 The time at which the final solution was reported.

Detailed Description

A StatsReporter that collects the generic solution to a DCOP.

Author
Thomas Leaute
Parameters
<V>type used for variable values
<U>type used for utility values

Constructor & Destructor Documentation

◆ SolutionCollector() [1/2]

frodo2.algorithms.SolutionCollector< V extends Addable< V >, U extends Addable< U > >.SolutionCollector ( DCOPProblemInterface< V, U > problem,
Element params )

Constructor for the module added to the agents' queues.

Parameters
problemproblem instance
paramsmodule parameters
Note
This is unused, since this module will not take part in the algorithm execution

References problem.

Referenced by notifyIn().

◆ SolutionCollector() [2/2]

frodo2.algorithms.SolutionCollector< V extends Addable< V >, U extends Addable< U > >.SolutionCollector ( Element params,
DCOPProblemInterface< V, U > problem )

Constructor in StatsReporter mode.

Parameters
paramsmodule parameters
problemproblem instance

References problem.

Member Function Documentation

◆ getFinalTime()

◆ getMsgTypes()

ArrayList< MessageType > frodo2.algorithms.SolutionCollector< V extends Addable< V >, U extends Addable< U > >.getMsgTypes ( )
See also
StatsReporter.getMsgTypes()
Returns
an empty list, since this module does not participate in algorithm execution

Implements frodo2.communication.MessageListener< T >.

◆ getSolution()

◆ getStatsFromQueue()

◆ getUtility()

◆ notifyIn()

◆ reset()

void frodo2.algorithms.SolutionCollector< V extends Addable< V >, U extends Addable< U > >.reset ( )

◆ setQueue()

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

◆ setSilent()

Member Data Documentation

◆ ASSIGNMENT_MSG_TYPE

◆ ASSIGNMENTS_MSG_TYPE

◆ finalTime

Long frodo2.algorithms.SolutionCollector< V extends Addable< V >, U extends Addable< U > >.finalTime
private

The time at which the final solution was reported.

◆ maximize

boolean frodo2.algorithms.SolutionCollector< V extends Addable< V >, U extends Addable< U > >.maximize = true
protected

true if we are maximizing utility, false if we are minimizing cost

◆ problem

DCOPProblemInterface<V, U> frodo2.algorithms.SolutionCollector< V extends Addable< V >, U extends Addable< U > >.problem
private

The problem.

Referenced by SolutionCollector(), and SolutionCollector().

◆ queue

Queue frodo2.algorithms.SolutionCollector< V extends Addable< V >, U extends Addable< U > >.queue
private

The queue form which this module collects solution messages.

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

◆ silent

boolean frodo2.algorithms.SolutionCollector< V extends Addable< V >, U extends Addable< U > >.silent
private

Whether this module should print out its solution.

Referenced by setSilent().

◆ solution

HashMap<String, V> frodo2.algorithms.SolutionCollector< V extends Addable< V >, U extends Addable< U > >.solution
private

For each variable, its reported value.

Referenced by notifyIn().

◆ utility

U frodo2.algorithms.SolutionCollector< V extends Addable< V >, U extends Addable< U > >.utility
private

The true utility of the reported solution.

Referenced by getUtility().


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