|
FRODO Version 2.19.1
An open-source framework for Distributed Constraint Optimization (DCOP)
|
Convenience class to hold variable information. More...
Public Member Functions | |
| VariableInfo (String variableID, V[] domain, String parent, List< String > children, Class< SamplingProcedure< V > > samplingClass, Class< TerminationCondition< V > > terminationClass) | |
| Constructor. | |
| boolean | storeCOSTmsg (COSTmsg msg) |
| void | setSize (long size) |
| void | setSeparator (Set< String > separator) |
| V | solveSingleton (boolean maximize) |
| Solve the local problem of a singleton variable. | |
| boolean | finishedSampling (double error, double delta) |
| boolean | sample () |
| Method used to sample the values of the variable. | |
| boolean | setContext (String sender, String[] variables, V[] values) |
| Method used to update the context after a VALUE message has been received. | |
| AddableReal | solveLeaf () |
| Solve the local problem of a leaf, given the context. | |
| VALUEmsg< V > | getNewValueMessage (String child, boolean finished) |
| Message | getCostMessage () |
| String | getParent () |
| void | storeConstraint (UtilitySolutionSpace< V, AddableReal > space) |
| Makes this variable responsible for this constraint. | |
| List< String > | getChildren () |
| SolutionCollector.AssignmentMessage< V > | getAssignmentMessage (V value) |
| SolutionCollector.AssignmentMessage< V > | getAssignmentMessage (String var, V value) |
| AddableReal | getFinalBound () |
| String | toString () |
Protected Member Functions | |
| SearchNode< V > | createNode (int domainSize, boolean maximize, boolean IGNORE_INF) |
| Method to create search node. | |
Protected Attributes | |
| String | variableID |
| The name of the variable. | |
| V[] | domain |
| The domain of the variable. | |
| int | domainSize |
| The size of the domain. | |
| String | parent |
| The parent of the variable. | |
| final boolean | leaf |
true when the variable is a leaf node, and false otherwise | |
| boolean | parentFinished |
true when the parent finished sampling | |
| int | nbrChildren |
| The number of children of this variable. | |
| long | size |
| The maximal number of nodes below any node of this variable. | |
| int | contextSize |
| The size of the context. | |
| V[] | context |
| The current value assignment of all agents in the separator. | |
| HashMap< String, Integer > | contextPointer |
| For each context variable, the position in the context array. | |
| String[] | contextVariables |
| The context variables. | |
| V | currentValue |
| The currently sampled value. | |
| int | currentValueIndex |
| The index of the current value. | |
| UtilitySolutionSpace< V, AddableReal > | space |
| The local problem of the variable. | |
| SamplingProcedure< V > | sampler |
| The sampler used. | |
| SearchNode< V > | node |
| The distribution corresponding to the current context. | |
| HashMap< State< V >, SearchNode< V > > | distributions |
| For each possible context value seen, the collected information. | |
| AddableReal | reportedSample |
| sum of all samples reported by the children for the current context | |
| Message | nextCostMsg |
| The next cost message to be sent. | |
| int | costMessagesReceived |
| The number of COST messages received as a reply on the last VALUE message. | |
| ArrayList< VALUEmsg< V > > | toBeProcessed |
| List of to be processed value messages. | |
| AddableReal | penalty |
| penalty used to replace an infeasible solution | |
| boolean | receivedNormalize |
true when normalization is finished for this variable, and false otherwise | |
Private Attributes | |
| List< String > | children |
| The list of children. | |
| TerminationCondition< V > | termination |
| The termination condition used. | |
| Bound< V > | bound |
| The bound used for sampling. | |
Convenience class to hold variable information.
| frodo2.algorithms.duct.Sampling< V extends Addable< V > >.VariableInfo.VariableInfo | ( | String | variableID, |
| V[] | domain, | ||
| String | parent, | ||
| List< String > | children, | ||
| Class< SamplingProcedure< V > > | samplingClass, | ||
| Class< TerminationCondition< V > > | terminationClass ) |
Constructor.
| variableID | the name of the variable |
| domain | the domain of the variable |
| parent | the parent of the variable |
| children | list of the children of the variable |
| samplingClass | the class of the sampling method |
| terminationClass | the class of the termination condition |
References children, domain, nbrChildren, parent, frodo2.algorithms.duct.Sampling< V extends Addable< V > >.samplingClass, frodo2.algorithms.duct.Sampling< V extends Addable< V > >.terminationClass, and variableID.
|
protected |
Method to create search node.
| domainSize | the size of the domain |
| maximize | true when maximizing, and false otherwise |
| IGNORE_INF | true when infeasible utilities are to be ignored, and false otherwise |
References domainSize, frodo2.algorithms.duct.Sampling< V extends Addable< V > >.IGNORE_INF, and frodo2.algorithms.duct.Sampling< V extends Addable< V > >.maximize.
Referenced by setContext().
| boolean frodo2.algorithms.duct.Sampling< V extends Addable< V > >.VariableInfo.finishedSampling | ( | double | error, |
| double | delta ) |
| error | the intended error |
| delta | the delta that determines the probability |
true when enough samples have been received, false otherwise References frodo2.algorithms.duct.Sampling< V extends Addable< V > >.delta, domain, frodo2.algorithms.duct.Sampling< V extends Addable< V > >.error, frodo2.algorithms.duct.Sampling< V extends Addable< V > >.maximize, node, and termination.
Referenced by frodo2.algorithms.duct.Sampling< V extends Addable< V > >.notifyIn().
| SolutionCollector.AssignmentMessage< V > frodo2.algorithms.duct.Sampling< V extends Addable< V > >.VariableInfo.getAssignmentMessage | ( | String | var, |
| V | value ) |
| var | the variable for which the assignment is reported |
| value | the value of the assignment |
value | SolutionCollector.AssignmentMessage< V > frodo2.algorithms.duct.Sampling< V extends Addable< V > >.VariableInfo.getAssignmentMessage | ( | V | value | ) |
| value | the value of the assignment |
value References variableID.
Referenced by frodo2.algorithms.duct.Sampling< V extends Addable< V > >.notifyIn().
| List< String > frodo2.algorithms.duct.Sampling< V extends Addable< V > >.VariableInfo.getChildren | ( | ) |
References children.
Referenced by frodo2.algorithms.duct.Sampling< V extends Addable< V > >.reportValue().
| Message frodo2.algorithms.duct.Sampling< V extends Addable< V > >.VariableInfo.getCostMessage | ( | ) |
Referenced by frodo2.algorithms.duct.Sampling< V extends Addable< V > >.notifyIn().
| AddableReal frodo2.algorithms.duct.Sampling< V extends Addable< V > >.VariableInfo.getFinalBound | ( | ) |
References frodo2.algorithms.duct.Sampling< V extends Addable< V > >.delta, node, and frodo2.algorithms.duct.Sampling< V extends Addable< V > >.scalingFactor.
Referenced by frodo2.algorithms.duct.Sampling< V extends Addable< V > >.notifyIn().
| VALUEmsg< V > frodo2.algorithms.duct.Sampling< V extends Addable< V > >.VariableInfo.getNewValueMessage | ( | String | child, |
| boolean | finished ) |
| child | the child for which the VALUE message is meant |
| finished | true when the variable is ready with sampling, and false otherwise |
References frodo2.algorithms.duct.Sampling< V extends Addable< V > >.VALUE_FIN_MSG_TYPE, frodo2.algorithms.duct.Sampling< V extends Addable< V > >.VALUE_MSG_TYPE, and variableID.
Referenced by frodo2.algorithms.duct.Sampling< V extends Addable< V > >.reportValue().
| String frodo2.algorithms.duct.Sampling< V extends Addable< V > >.VariableInfo.getParent | ( | ) |
Referenced by frodo2.algorithms.duct.Sampling< V extends Addable< V > >.notifyIn().
| boolean frodo2.algorithms.duct.Sampling< V extends Addable< V > >.VariableInfo.sample | ( | ) |
Method used to sample the values of the variable.
Based on the context, and a give probability distribution this method chooses a value for variablID and stores it in context
true when the current local problem is feasible, false otherwise References bound, context, contextVariables, currentValue, currentValueIndex, domain, frodo2.algorithms.duct.Sampling< V extends Addable< V > >.infeasibleUtility, node, sampler, and space.
Referenced by frodo2.algorithms.duct.Sampling< V extends Addable< V > >.notifyIn().
| boolean frodo2.algorithms.duct.Sampling< V extends Addable< V > >.VariableInfo.setContext | ( | String | sender, |
| String[] | variables, | ||
| V[] | values ) |
Method used to update the context after a VALUE message has been received.
| sender | the sender of the VALUE message |
| variables | the reported variables |
| values | the context as reported by the parent |
always returns true References context, contextPointer, contextVariables, createNode(), distributions, domain, domainSize, frodo2.algorithms.duct.Sampling< V extends Addable< V > >.IGNORE_INF, frodo2.algorithms.duct.Sampling< V extends Addable< V > >.infeasibleUtility, frodo2.algorithms.duct.SearchNode< V extends Addable< V > >.initSampling(), leaf, frodo2.algorithms.duct.Sampling< V extends Addable< V > >.maximize, node, and space.
Referenced by frodo2.algorithms.duct.Sampling< V extends Addable< V > >.notifyIn(), frodo2.algorithms.duct.SamplingChild< V extends Addable< V > >.notifyIn(), and frodo2.algorithms.duct.SamplingChildSearch< V extends Addable< V > >.notifyIn().

| void frodo2.algorithms.duct.Sampling< V extends Addable< V > >.VariableInfo.setSeparator | ( | Set< String > | separator | ) |
| separator | the separator of the variable |
References contextPointer, contextSize, contextVariables, domain, setSeparator(), and variableID.
Referenced by frodo2.algorithms.duct.Sampling< V extends Addable< V > >.notifyIn(), and setSeparator().

| void frodo2.algorithms.duct.Sampling< V extends Addable< V > >.VariableInfo.setSize | ( | long | size | ) |
| size | the maximal number of nodes below any node of this variable |
References frodo2.algorithms.duct.Sampling< V extends Addable< V > >.boundClass, and size.
Referenced by frodo2.algorithms.duct.Sampling< V extends Addable< V > >.notifyIn(), frodo2.algorithms.duct.SamplingChild< V extends Addable< V > >.notifyIn(), and frodo2.algorithms.duct.SamplingChildSearch< V extends Addable< V > >.notifyIn().
| AddableReal frodo2.algorithms.duct.Sampling< V extends Addable< V > >.VariableInfo.solveLeaf | ( | ) |
Solve the local problem of a leaf, given the context.
References frodo2.solutionSpaces.AddableReal.compareTo(), context, contextSize, contextVariables, currentValue, domain, domainSize, frodo2.algorithms.duct.Sampling< V extends Addable< V > >.infeasibleUtility, leaf, frodo2.algorithms.duct.Sampling< V extends Addable< V > >.maximize, penalty, and space.
Referenced by frodo2.algorithms.duct.Sampling< V extends Addable< V > >.notifyIn().

| V frodo2.algorithms.duct.Sampling< V extends Addable< V > >.VariableInfo.solveSingleton | ( | boolean | maximize | ) |
Solve the local problem of a singleton variable.
| maximize | true when maximizing, and false otherwise |
References children, frodo2.solutionSpaces.UtilitySolutionSpace< V extends Addable< V >, U extends Addable< U > >.ProjOutput< V extends Addable< V >, U extends Addable< U > >.getAssignments(), frodo2.solutionSpaces.BasicUtilitySolutionSpace< V extends Addable< V >, U extends Serializable >.getUtility(), frodo2.algorithms.duct.Sampling< V extends Addable< V > >.maximize, parent, and space.
Referenced by frodo2.algorithms.duct.Sampling< V extends Addable< V > >.notifyIn().

| void frodo2.algorithms.duct.Sampling< V extends Addable< V > >.VariableInfo.storeConstraint | ( | UtilitySolutionSpace< V, AddableReal > | space | ) |
Makes this variable responsible for this constraint.
| space | the constraint |
References frodo2.solutionSpaces.UtilitySolutionSpace< V extends Addable< V >, U extends Addable< U > >.join(), and space.
Referenced by frodo2.algorithms.duct.Sampling< V extends Addable< V > >.notifyIn().

| boolean frodo2.algorithms.duct.Sampling< V extends Addable< V > >.VariableInfo.storeCOSTmsg | ( | COSTmsg | msg | ) |
| msg | the message to be stored |
true when enough cost messages have been received, false otherwise References frodo2.algorithms.duct.COSTmsg.getCost(), frodo2.algorithms.duct.Sampling< V extends Addable< V > >.infeasibleUtility, frodo2.algorithms.duct.Sampling< V extends Addable< V > >.maximize, nbrChildren, nextCostMsg, node, parent, penalty, reportedSample, and sampler.
Referenced by frodo2.algorithms.duct.Sampling< V extends Addable< V > >.notifyIn().

| String frodo2.algorithms.duct.Sampling< V extends Addable< V > >.VariableInfo.toString | ( | ) |
References contextSize, frodo2.algorithms.duct.Sampling< V extends Addable< V > >.delta, node, and variableID.
|
private |
The bound used for sampling.
Referenced by sample().
|
private |
The list of children.
Referenced by getChildren(), solveSingleton(), and VariableInfo().
|
protected |
The current value assignment of all agents in the separator.
Referenced by sample(), setContext(), and solveLeaf().
|
protected |
For each context variable, the position in the context array.
Referenced by setContext(), and setSeparator().
|
protected |
The size of the context.
Referenced by setSeparator(), solveLeaf(), and toString().
|
protected |
The context variables.
Referenced by sample(), setContext(), setSeparator(), and solveLeaf().
|
protected |
The number of COST messages received as a reply on the last VALUE message.
|
protected |
The currently sampled value.
Referenced by frodo2.algorithms.duct.Sampling< V extends Addable< V > >.notifyIn(), sample(), and solveLeaf().
|
protected |
The index of the current value.
Referenced by sample().
|
protected |
For each possible context value seen, the collected information.
Referenced by setContext().
|
protected |
The domain of the variable.
Referenced by finishedSampling(), sample(), setContext(), setSeparator(), solveLeaf(), and VariableInfo().
|
protected |
The size of the domain.
Referenced by createNode(), setContext(), and solveLeaf().
|
protected |
true when the variable is a leaf node, and false otherwise
Referenced by frodo2.algorithms.duct.Sampling< V extends Addable< V > >.notifyIn(), setContext(), and solveLeaf().
|
protected |
The number of children of this variable.
Referenced by storeCOSTmsg(), and VariableInfo().
|
protected |
The next cost message to be sent.
Referenced by storeCOSTmsg().
|
protected |
The distribution corresponding to the current context.
Referenced by finishedSampling(), getFinalBound(), sample(), setContext(), storeCOSTmsg(), and toString().
|
protected |
The parent of the variable.
Referenced by frodo2.algorithms.duct.Sampling< V extends Addable< V > >.notifyIn(), solveSingleton(), storeCOSTmsg(), and VariableInfo().
|
protected |
true when the parent finished sampling
Referenced by frodo2.algorithms.duct.Sampling< V extends Addable< V > >.notifyIn().
|
protected |
penalty used to replace an infeasible solution
Referenced by frodo2.algorithms.duct.Sampling< V extends Addable< V > >.notifyIn(), solveLeaf(), and storeCOSTmsg().
|
protected |
true when normalization is finished for this variable, and false otherwise
Referenced by frodo2.algorithms.duct.Sampling< V extends Addable< V > >.notifyIn().
|
protected |
sum of all samples reported by the children for the current context
Referenced by storeCOSTmsg().
|
protected |
The sampler used.
Referenced by sample(), and storeCOSTmsg().
|
protected |
The maximal number of nodes below any node of this variable.
Referenced by setSize().
|
protected |
The local problem of the variable.
Referenced by sample(), setContext(), solveLeaf(), solveSingleton(), and storeConstraint().
|
private |
The termination condition used.
Referenced by finishedSampling().
|
protected |
List of to be processed value messages.
Referenced by frodo2.algorithms.duct.Sampling< V extends Addable< V > >.notifyIn().
|
protected |
The name of the variable.
Referenced by getAssignmentMessage(), getNewValueMessage(), frodo2.algorithms.duct.Sampling< V extends Addable< V > >.notifyIn(), setSeparator(), toString(), and VariableInfo().