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

Classes

interface  PreprocessingHeuristic
 This interface is used to implement the different heuristics for obtaining lower bounds. More...
class  SimpleHeuristic
 This simple heuristic sets all lower bounds to zero, and should be used when running the original adopt. More...
class  DP0
 Implementation of the DP0 heuristic. More...
class  DP1
 Implementation of the DP1 heuristic. More...
class  DP2
 Implementation of the DP2 heuristic. More...

Public Member Functions

 Preprocessing (Element e, DCOPProblemInterface< Val, U > problem)
 Constructor in stats gatherer mode.
 Preprocessing (ArrayList< String > variables, HashMap< String, Val[]> domains, String heuristicsName, U zeroObject) throws Exception
 Constructor.
 Preprocessing (DCOPProblemInterface< Val, U > problem, String heuristicsName) throws Exception
 Constructor.
 Preprocessing (DCOPProblemInterface< Val, U > problem, Element parameters) throws Exception
 Constructor from XML descriptions.
void reset ()
UtilitySolutionSpace< Val, U > createUtilitySpace (String[] variables, U utility)
 Convenience method to used to create a UtilitySpace<Val, U> and fill it with the value utility.
void getStatsFromQueue (Queue queue)
HashMap< String, UtilitySolutionSpace< Val, U > > getReportedHeuristics ()
 Returns the reported heuristics.
void setSilent (boolean silent)
Collection< MessageTypegetMsgTypes ()
void notifyIn (Message msg)
void setQueue (Queue queue)
Public Member Functions inherited from frodo2.communication.IncomingMsgPolicyInterface< T >
default void notifyIn (Message msg, Object toAgent)
 Notifies the listener of an incoming message.

Public Attributes

HashMap< String, UtilitySolutionSpace< Val, U > > reportedHeuristics
 Container for the reported heuristics.

Static Public Attributes

static MessageType START_MSG_TYPE = AgentInterface.START_AGENT
 The type of the message telling the module to start.
static final MessageType HEURISTICS_MSG_TYPE = new MessageType ("ADOPT", "Preprocessing", "Heuristics")
 The type of message containing the heuristics.
static final MessageType HEURISTICS_STAT_MSG_TYPE = new MessageType ("ADOPT", "Preprocessing", "Heuristics stats")
 The type of the heuristics stats message.

Private Member Functions

void init ()
 Parses the problem.
void setHeuristics (String heuristicName) throws ClassNotFoundException, InstantiationException, IllegalAccessException
 Helper function to set the heuristics used for preprocessing.

Private Attributes

boolean reportStats = true
 Whether to report stats.
ArrayList< String > variables = new ArrayList<String> ()
 A list of variables this agent owns.
HashMap< String, Val[]> domains
 A list of domains of each of the variables.
PreprocessingHeuristic< Val, U > heuristic
 The heuristic that is used to generate the lower bounds.
zeroObject
 used to create the null value
Queue queue
 The agent's queue.
DCOPProblemInterface< Val, U > problem
 The agent's problem.
Map< String, String > owners = new HashMap<String, String> ()
 For each known variable, the name of the agent that owns it.
boolean started = false
 Whether the algorithm has been started.

Detailed Description

Author
Brammert Ottens
Parameters
<Val>type used for variable values
<U>type used for utility values

The preprocessing listener computes heuristics for the lower bounds used by adopt. Currently, it implements the following heuristics:

  • trivial heuristic: set every lb to 0

Constructor & Destructor Documentation

◆ Preprocessing() [1/4]

frodo2.algorithms.adopt.Preprocessing< Val extends Addable< Val >, U extends Addable< U > >.Preprocessing ( Element e,
DCOPProblemInterface< Val, U > problem )

Constructor in stats gatherer mode.

Parameters
problemnot used at this time
enot used at this time

References problem, and reportedHeuristics.

Referenced by frodo2.algorithms.adopt.Preprocessing< Val extends Addable< Val >, U extends Addable< U > >.DP0< Val extends Addable< Val >, U extends Addable< U > >.DP0(), frodo2.algorithms.adopt.Preprocessing< Val extends Addable< Val >, U extends Addable< U > >.DP1< Val extends Addable< Val >, U extends Addable< U > >.DP1(), frodo2.algorithms.adopt.Preprocessing< Val extends Addable< Val >, U extends Addable< U > >.DP2< Val extends Addable< Val >, U extends Addable< U > >.DP2(), frodo2.algorithms.adopt.Preprocessing< Val extends Addable< Val >, U extends Addable< U > >.DP0< Val extends Addable< Val >, U extends Addable< U > >.getVariableInfo(), frodo2.algorithms.adopt.Preprocessing< Val extends Addable< Val >, U extends Addable< U > >.DP1< Val extends Addable< Val >, U extends Addable< U > >.getVariableInfo(), frodo2.algorithms.adopt.Preprocessing< Val extends Addable< Val >, U extends Addable< U > >.DP2< Val extends Addable< Val >, U extends Addable< U > >.getVariableInfo(), frodo2.algorithms.adopt.Preprocessing< Val extends Addable< Val >, U extends Addable< U > >.SimpleHeuristic< Val extends Addable< Val >, U extends Addable< U > >.getVariableInfo(), setHeuristics(), frodo2.algorithms.adopt.Preprocessing< Val extends Addable< Val >, U extends Addable< U > >.SimpleHeuristic< Val extends Addable< Val >, U extends Addable< U > >.SimpleHeuristic(), and frodo2.algorithms.adopt.Preprocessing< Val extends Addable< Val >, U extends Addable< U > >.PreprocessingHeuristic< Val extends Addable< Val >, U extends Addable< U > >.VariableInfo< Val extends Addable< Val >, U extends Addable< U > >.VariableInfo().

◆ Preprocessing() [2/4]

frodo2.algorithms.adopt.Preprocessing< Val extends Addable< Val >, U extends Addable< U > >.Preprocessing ( ArrayList< String > variables,
HashMap< String, Val[]> domains,
String heuristicsName,
U zeroObject ) throws Exception

Constructor.

Parameters
variablesthe variables
domainsthe domains
heuristicsNamename of the heuristics class used
zeroObjectthe zero utility
Exceptions
Exceptionif an error occurs

References domains, setHeuristics(), variables, and zeroObject.

Here is the call graph for this function:

◆ Preprocessing() [3/4]

frodo2.algorithms.adopt.Preprocessing< Val extends Addable< Val >, U extends Addable< U > >.Preprocessing ( DCOPProblemInterface< Val, U > problem,
String heuristicsName ) throws Exception

Constructor.

Parameters
problemthe agent's problem
heuristicsNamename of the heuristic class used
Exceptions
Exceptionif an error occurs

References problem, and setHeuristics().

Here is the call graph for this function:

◆ Preprocessing() [4/4]

frodo2.algorithms.adopt.Preprocessing< Val extends Addable< Val >, U extends Addable< U > >.Preprocessing ( DCOPProblemInterface< Val, U > problem,
Element parameters ) throws Exception

Constructor from XML descriptions.

Parameters
problemdescription of the problem
parametersdescription of the parameters of Preprocessing
Exceptions
Exceptionif an error occurs

References problem, setHeuristics(), and zeroObject.

Here is the call graph for this function:

Member Function Documentation

◆ createUtilitySpace()

UtilitySolutionSpace< Val, U > frodo2.algorithms.adopt.Preprocessing< Val extends Addable< Val >, U extends Addable< U > >.createUtilitySpace ( String[] variables,
U utility )

Convenience method to used to create a UtilitySpace<Val, U> and fill it with the value utility.

Author
Brammert Ottens, 19 mei 2009
Parameters
variablesthe variable for which the space must be created
utilitythe utility to be used
Returns
a UtilitySpace over variable var with all utilities set to utility

References createUtilitySpace(), domains, and variables.

Referenced by createUtilitySpace(), and frodo2.algorithms.adopt.Preprocessing< Val extends Addable< Val >, U extends Addable< U > >.PreprocessingHeuristic< Val extends Addable< Val >, U extends Addable< U > >.VariableInfo< Val extends Addable< Val >, U extends Addable< U > >.VariableInfo().

Here is the call graph for this function:

◆ getMsgTypes()

◆ getReportedHeuristics()

HashMap< String, UtilitySolutionSpace< Val, U > > frodo2.algorithms.adopt.Preprocessing< Val extends Addable< Val >, U extends Addable< U > >.getReportedHeuristics ( )

Returns the reported heuristics.

Author
Brammert Ottens, 22 jun 2009
Returns
the reported heuristics

Referenced by frodo2.algorithms.adopt.test.ADOPTagentTest< V extends Addable< V >, U extends Addable< U > >.testRandom().

◆ getStatsFromQueue()

void frodo2.algorithms.adopt.Preprocessing< Val extends Addable< Val >, U extends Addable< U > >.getStatsFromQueue ( Queue queue)

◆ init()

void frodo2.algorithms.adopt.Preprocessing< Val extends Addable< Val >, U extends Addable< U > >.init ( )
private

Parses the problem.

References domains, heuristic, owners, problem, and variables.

Referenced by notifyIn().

◆ notifyIn()

◆ reset()

void frodo2.algorithms.adopt.Preprocessing< Val extends Addable< Val >, U extends Addable< U > >.reset ( )
See also
StatsReporter.reset()
Todo
Auto-generated method stub

Implements frodo2.algorithms.StatsReporter.

◆ setHeuristics()

void frodo2.algorithms.adopt.Preprocessing< Val extends Addable< Val >, U extends Addable< U > >.setHeuristics ( String heuristicName) throws ClassNotFoundException, InstantiationException, IllegalAccessException
private

Helper function to set the heuristics used for preprocessing.

Parameters
heuristicNamethe name of the heuristic class
Exceptions
ClassNotFoundExceptionif the heuristic class name is unknown
InstantiationExceptionif the heuristic class does not have an accessible nullary constructor
IllegalAccessExceptionif the heuristic class does not have an accessible nullary constructor

References Preprocessing(), and setHeuristics().

Referenced by Preprocessing(), Preprocessing(), Preprocessing(), and setHeuristics().

Here is the call graph for this function:

◆ setQueue()

void frodo2.algorithms.adopt.Preprocessing< Val extends Addable< Val >, U extends Addable< U > >.setQueue ( Queue queue)

◆ setSilent()

Member Data Documentation

◆ domains

HashMap<String, Val[]> frodo2.algorithms.adopt.Preprocessing< Val extends Addable< Val >, U extends Addable< U > >.domains
private

A list of domains of each of the variables.

Referenced by createUtilitySpace(), init(), and Preprocessing().

◆ heuristic

PreprocessingHeuristic<Val, U> frodo2.algorithms.adopt.Preprocessing< Val extends Addable< Val >, U extends Addable< U > >.heuristic
private

The heuristic that is used to generate the lower bounds.

Referenced by getMsgTypes(), and init().

◆ HEURISTICS_MSG_TYPE

◆ HEURISTICS_STAT_MSG_TYPE

final MessageType frodo2.algorithms.adopt.Preprocessing< Val extends Addable< Val >, U extends Addable< U > >.HEURISTICS_STAT_MSG_TYPE = new MessageType ("ADOPT", "Preprocessing", "Heuristics stats")
static

The type of the heuristics stats message.

Referenced by getStatsFromQueue(), and notifyIn().

◆ owners

Map<String, String> frodo2.algorithms.adopt.Preprocessing< Val extends Addable< Val >, U extends Addable< U > >.owners = new HashMap<String, String> ()
private

For each known variable, the name of the agent that owns it.

Referenced by init().

◆ problem

DCOPProblemInterface<Val, U> frodo2.algorithms.adopt.Preprocessing< Val extends Addable< Val >, U extends Addable< U > >.problem
private

The agent's problem.

Referenced by init(), Preprocessing(), Preprocessing(), and Preprocessing().

◆ queue

Queue frodo2.algorithms.adopt.Preprocessing< Val extends Addable< Val >, U extends Addable< U > >.queue
private

The agent's queue.

Referenced by getStatsFromQueue(), and setQueue().

◆ reportedHeuristics

HashMap<String, UtilitySolutionSpace<Val, U> > frodo2.algorithms.adopt.Preprocessing< Val extends Addable< Val >, U extends Addable< U > >.reportedHeuristics

Container for the reported heuristics.

Referenced by Preprocessing().

◆ reportStats

boolean frodo2.algorithms.adopt.Preprocessing< Val extends Addable< Val >, U extends Addable< U > >.reportStats = true
private

Whether to report stats.

◆ START_MSG_TYPE

MessageType frodo2.algorithms.adopt.Preprocessing< Val extends Addable< Val >, U extends Addable< U > >.START_MSG_TYPE = AgentInterface.START_AGENT
static

The type of the message telling the module to start.

Referenced by getMsgTypes().

◆ started

boolean frodo2.algorithms.adopt.Preprocessing< Val extends Addable< Val >, U extends Addable< U > >.started = false
private

Whether the algorithm has been started.

◆ variables

◆ zeroObject


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