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

This module is a preprocessing module that normalizes all utilities to between 0 and 1. More...

Inheritance diagram for frodo2.algorithms.duct.Normalize< V extends Addable< V > >:

Public Member Functions

 Normalize (DCOPProblemInterface< V, AddableReal > problem, Element parameters)
 Constructor.
 Normalize (DCOPProblemInterface< V, AddableReal > problem, Element parameters, boolean reportSpaces)
 Constructor used for debugging.
void notifyIn (Message msg)
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 BOUND_MSG_TYPE = new MessageType ("DUCT", "Normalize", "bounding")
 Type of the message used for bound detection.
static final MessageType NORM_MSG_TYPE = new MessageType ("DUCT", "Normalize", "normalizing")
 Type of the message used for normalization.
static final MessageType OUT_MSG_TYPE = new MessageType ("DUCT", "Normalize", "output")
 Type of the output message of this module.
static final MessageType STATS_MSG_TYPE = new MessageType ("DUCT", "Normalize", "stats")
 Type of the statistics message.

Protected Member Functions

void normalize (String var, int index, AddableReal divide, ArrayList< UtilitySolutionSpace< V, AddableReal > > spaces)
 Method to perform the normalization of the spaces owned by a variable.
void init ()
 Initialization function, called when the first message is received.

Protected Attributes

DCOPProblemInterface< V, AddableRealproblem
 The local problem.
Map< String, String > owners
 Maps variables to the agents that own them.
boolean started
 true when the init() method has been called, and false otherwise
Queue queue
 The queue.
HashMap< String, Integer > variablePointer
 Maps variable names to positions in an array.
int[] numberOfMessagesToReceive
 For each variable, the number of children + 1 (the DFS message).
int[] numberOfMessagesReceived
 For each variable, the number of messages received.
int[] numberOfSpaces
 For each variable the number of spaces it owns.
String[] parents
 For each variable, the parent.
List< String >[] children
 For each variable the children in the DFS tree.
HashMap< String, AddableReallowerBounds
 For each variable, the lower bound is stored here.
HashMap< String, AddableRealupperBounds
 For each variable, the upper bound is stored here.
HashMap< String, Long > sizes
 The domain size of each variable.
HashMap< String, Set< String > > separators
 For each variable, its separator.
HashMap< String, ArrayList< UtilitySolutionSpace< V, AddableReal > > > spaces
 For each variable, the spaces that it owns.
HashMap< String, ArrayList< AddableReal > > minLists
 For each space the minimal value.
final boolean reportSpaces
 When true, the spaces are reported, and false otherwise.
AddableReal infeasibleUtil
 The value of an infeasibleUtility.
AddableReal divide
 The scaling factor.
AddableReal penalty
 The penalty used to replace an infeasible value.
boolean reportStats = true
 Whether to report stats.

Detailed Description

This module is a preprocessing module that normalizes all utilities to between 0 and 1.

It first does bound detection via a bottom up inference procedure, after which a top-down normalization is performed

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

Constructor & Destructor Documentation

◆ Normalize() [1/2]

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

Constructor.

Parameters
problemthe local problem of the agent
parametersthe parameters of the module
Todo
check whether the utility class is actually AddableReal

References frodo2.solutionSpaces.AddableReal.fromString(), penalty, problem, and reportSpaces.

Here is the call graph for this function:

◆ Normalize() [2/2]

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

Constructor used for debugging.

Parameters
problemthe local problem of the agent
parametersthe parameters of the module
reportSpacestrue when the spaces should be reported to the statsreporter, and false otherwise
Todo
check whether the utility class is actually AddableReal

References problem, and reportSpaces.

Member Function Documentation

◆ getMsgTypes()

◆ getStatsFromQueue()

void frodo2.algorithms.duct.Normalize< V extends Addable< V > >.getStatsFromQueue ( Queue queue)

◆ init()

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

Initialization function, called when the first message is received.

Author
Brammert Ottens, 17 aug. 2011

References children, init(), lowerBounds, minLists, numberOfMessagesReceived, numberOfMessagesToReceive, numberOfSpaces, owners, parents, problem, separators, sizes, spaces, started, upperBounds, and variablePointer.

Referenced by init(), and notifyIn().

Here is the call graph for this function:

◆ normalize()

void frodo2.algorithms.duct.Normalize< V extends Addable< V > >.normalize ( String var,
int index,
AddableReal divide,
ArrayList< UtilitySolutionSpace< V, AddableReal > > spaces )
protected

Method to perform the normalization of the spaces owned by a variable.

Author
Brammert Ottens, 17 aug. 2011
Parameters
varthe variable who's spaces should be normalized
indexthe index of the variable
dividethe scaling
spacesthe spaces owned by var

References children, divide, frodo2.solutionSpaces.AddableReal.flipSign(), minLists, owners, penalty, queue, and spaces.

Referenced by notifyIn().

Here is the call graph for this function:

◆ notifyIn()

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

Implements frodo2.communication.IncomingMsgPolicyInterface< T >.

References frodo2.solutionSpaces.AddableReal.add(), BOUND_MSG_TYPE, children, divide, frodo2.communication.MessageType.equals(), frodo2.solutionSpaces.AddableReal.equals(), frodo2.algorithms.varOrdering.dfs.DFSgeneration< V extends Addable< V >, U extends Addable< U > >.DFSview< V extends Addable< V >, U extends Addable< U > >.getAllPseudoChildren(), 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.BOUNDmsg.getCounter(), frodo2.algorithms.duct.NORMmsg.getDivide(), frodo2.algorithms.duct.BOUNDmsg.getLowerBound(), 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.varOrdering.dfs.DFSgeneration< V extends Addable< V >, U extends Addable< U > >.DFSview< V extends Addable< V >, U extends Addable< U > >.getPseudoParents(), frodo2.algorithms.duct.BOUNDmsg.getReceiver(), frodo2.algorithms.duct.NORMmsg.getReceiver(), frodo2.algorithms.duct.BOUNDmsg.getSeperator(), frodo2.algorithms.duct.BOUNDmsg.getSize(), frodo2.solutionSpaces.DCOPProblemInterface< V extends Addable< V >, U extends Addable< U > >.getSolutionSpaces(), frodo2.communication.Message.getType(), frodo2.algorithms.duct.BOUNDmsg.getUpperBound(), init(), lowerBounds, frodo2.solutionSpaces.AddableReal.max(), minLists, NORM_MSG_TYPE, normalize(), numberOfMessagesReceived, numberOfMessagesToReceive, numberOfSpaces, frodo2.algorithms.varOrdering.dfs.DFSgeneration< V extends Addable< V >, U extends Addable< U > >.OUTPUT_MSG_TYPE, owners, parents, penalty, problem, queue, separators, sizes, spaces, started, frodo2.algorithms.AgentInterface< V extends Addable< V > >.STATS_MONITOR, STATS_MSG_TYPE, frodo2.solutionSpaces.AddableReal.subtract(), upperBounds, and variablePointer.

Here is the call graph for this function:

◆ reset()

◆ setQueue()

◆ setSilent()

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

Member Data Documentation

◆ BOUND_MSG_TYPE

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

Type of the message used for bound detection.

Referenced by getMsgTypes(), and notifyIn().

◆ children

List<String> [] frodo2.algorithms.duct.Normalize< V extends Addable< V > >.children
protected

For each variable the children in the DFS tree.

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

◆ divide

AddableReal frodo2.algorithms.duct.Normalize< V extends Addable< V > >.divide
protected

The scaling factor.

Referenced by normalize(), and notifyIn().

◆ infeasibleUtil

AddableReal frodo2.algorithms.duct.Normalize< V extends Addable< V > >.infeasibleUtil
protected

The value of an infeasibleUtility.

◆ lowerBounds

HashMap<String, AddableReal> frodo2.algorithms.duct.Normalize< V extends Addable< V > >.lowerBounds
protected

For each variable, the lower bound is stored here.

Referenced by init(), and notifyIn().

◆ minLists

HashMap<String, ArrayList<AddableReal> > frodo2.algorithms.duct.Normalize< V extends Addable< V > >.minLists
protected

For each space the minimal value.

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

◆ NORM_MSG_TYPE

final MessageType frodo2.algorithms.duct.Normalize< V extends Addable< V > >.NORM_MSG_TYPE = new MessageType ("DUCT", "Normalize", "normalizing")
static

Type of the message used for normalization.

Referenced by getMsgTypes(), frodo2.algorithms.duct.NORMmsg.NORMmsg(), and notifyIn().

◆ numberOfMessagesReceived

int [] frodo2.algorithms.duct.Normalize< V extends Addable< V > >.numberOfMessagesReceived
protected

For each variable, the number of messages received.

Referenced by init(), and notifyIn().

◆ numberOfMessagesToReceive

int [] frodo2.algorithms.duct.Normalize< V extends Addable< V > >.numberOfMessagesToReceive
protected

For each variable, the number of children + 1 (the DFS message).

Referenced by init(), and notifyIn().

◆ numberOfSpaces

int [] frodo2.algorithms.duct.Normalize< V extends Addable< V > >.numberOfSpaces
protected

For each variable the number of spaces it owns.

Referenced by init(), and notifyIn().

◆ OUT_MSG_TYPE

◆ owners

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

Maps variables to the agents that own them.

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

◆ parents

String [] frodo2.algorithms.duct.Normalize< V extends Addable< V > >.parents
protected

For each variable, the parent.

Referenced by init(), and notifyIn().

◆ penalty

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

The penalty used to replace an infeasible value.

Referenced by Normalize(), normalize(), and notifyIn().

◆ problem

The local problem.

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

◆ queue

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

The queue.

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

◆ reportSpaces

final boolean frodo2.algorithms.duct.Normalize< V extends Addable< V > >.reportSpaces
protected

When true, the spaces are reported, and false otherwise.

Referenced by Normalize(), and Normalize().

◆ reportStats

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

Whether to report stats.

◆ separators

HashMap<String, Set<String> > frodo2.algorithms.duct.Normalize< V extends Addable< V > >.separators
protected

For each variable, its separator.

Referenced by init(), and notifyIn().

◆ sizes

HashMap<String, Long> frodo2.algorithms.duct.Normalize< V extends Addable< V > >.sizes
protected

The domain size of each variable.

Referenced by init(), and notifyIn().

◆ spaces

HashMap<String, ArrayList<UtilitySolutionSpace<V, AddableReal> > > frodo2.algorithms.duct.Normalize< V extends Addable< V > >.spaces
protected

For each variable, the spaces that it owns.

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

◆ started

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

true when the init() method has been called, and false otherwise

Referenced by init(), and notifyIn().

◆ STATS_MSG_TYPE

final MessageType frodo2.algorithms.duct.Normalize< V extends Addable< V > >.STATS_MSG_TYPE = new MessageType ("DUCT", "Normalize", "stats")
static

Type of the statistics message.

Referenced by notifyIn().

◆ upperBounds

HashMap<String, AddableReal> frodo2.algorithms.duct.Normalize< V extends Addable< V > >.upperBounds
protected

For each variable, the upper bound is stored here.

Referenced by init(), and notifyIn().

◆ variablePointer

HashMap<String, Integer> frodo2.algorithms.duct.Normalize< V extends Addable< V > >.variablePointer
protected

Maps variable names to positions in an array.

Referenced by init(), and notifyIn().


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