|
FRODO Version 2.19.1
An open-source framework for Distributed Constraint Optimization (DCOP)
|
This interface defines common functionalities in all utility solution spaces. More...

Classes | |
| interface | SparseIterator |
| A BasicUtilitySolutionSpace iterator that skips infeasible solutions. More... | |
| interface | Iterator |
| A BasicUtilitySolutionSpace iterator that doest NOT skip infeasible solutions. More... | |
Public Member Functions | |
| BasicUtilitySolutionSpace< V, U > | clone () |
| BasicUtilitySolutionSpace< V, U > | resolve () |
| BasicUtilitySolutionSpace< V, U > | resolve (boolean sparse) |
| String | prettyPrint (U ignoredUtil) |
| A human-friendly version of toString(). | |
| U | getUtility (V[] variables_values) |
| Returns an object representing the utility value corresponding to the provided variables values representing a solution. | |
| U | getUtility (String[] variables_names, V[] variables_values) |
| Returns an object representing the utility value corresponding to the provided variables values representing a solution. | |
| U | getUtility (Map< String, V > assignments) |
| Returns the utility corresponding to the input assignments. | |
| U | getUtility (long index) |
| Returns the utility value corresponding to the solution at the provided index. | |
| Class< U > | getClassOfU () |
| boolean | setUtility (V[] variables_values, U utility) |
| Sets the utility value corresponding to a given assignment to variables. | |
| void | setUtility (long index, U utility) |
| Sets the utility value for the solution at the provided index. | |
| void | setDefaultUtility (U utility) |
| Sets the default utility value. | |
| U | getDefaultUtility () |
| void | setInfeasibleUtility (U utility) |
| Sets the utility associated with infeasible solutions. | |
| void | augment (V[] variables_values, U utility_value) |
| Augments this BasicUtilitySolutionSpace with a new combination of variables values associated with a given utility. | |
| boolean | equivalent (BasicUtilitySolutionSpace< V, U > space) |
| Returns whether the input BasicUtilitySolutionSpace represents the same space as this BasicUtilitySolutionSpace. | |
| boolean | isIncludedIn (BasicUtilitySolutionSpace< V, U > space) |
| Checks if this BasicUtilitySolutionSpace is included in the provided BasicUtilitySolutionSpace. | |
| BasicUtilitySolutionSpace< V, U > | changeVariablesOrder (String[] variables_order) |
| Returns a new BasicUtilitySolutionSpace by changing the order of the variables of this BasicUtilitySolutionSpace. | |
| BasicUtilitySolutionSpace< V, U > | slice (String[] variables_names, V[][] sub_domains) |
| Returns a slice of this BasicUtilitySolutionSpace. | |
| BasicUtilitySolutionSpace< V, U > | slice (String[] variables_names, V[] values) |
| Returns a slice of this BasicUtilitySolutionSpace. | |
| BasicUtilitySolutionSpace< V, U > | slice (String var, V[] subDomain) |
| Slices this SolutionSpace over a single variable. | |
| BasicUtilitySolutionSpace< V, U > | slice (String var, V val) |
| Slices this BasicUtilitySolutionSpace over a single variable-value assignment. | |
| BasicUtilitySolutionSpace< V, U > | slice (V[] variables_values) |
| Returns a slice of this solution space. | |
| BasicUtilitySolutionSpace< V, U > | compose (String[] vars, BasicUtilitySolutionSpace< V, ArrayList< V > > substitution) |
| Substitutes some of the variables in this utility space with functions. | |
| SparseIterator< V, U > | sparseIter () |
| SparseIterator< V, U > | sparseIter (String[] order) |
| SparseIterator< V, U > | sparseIter (String[] variables, V[][] domains) |
| Returns a sparse iterator. | |
| SparseIterator< V, U > | sparseIter (String[] variables, V[][] domains, V[] assignment) |
| Returns a sparse iterator. | |
| Iterator< V, U > | iterator () |
| Iterator< V, U > | iterator (String[] order) |
| Iterator< V, U > | iterator (String[] variables, V[][] domains) |
| Returns an iterator. | |
| Iterator< V, U > | iterator (String[] variables, V[][] domains, V[] assignment) |
| Returns an iterator. | |
| Public Member Functions inherited from frodo2.solutionSpaces.SolutionSpace< V > | |
| void | setProblem (ProblemInterface< V, ?> problem) |
| Sets the problem that should be notified of constraint checks. | |
| boolean | countsCCs () |
| String | getName () |
| void | setName (String name) |
| Sets the name of this space. | |
| String | getRelationName () |
| void | setRelationName (String name) |
| Sets the name of the underlying relation for this space. | |
| String | getOwner () |
| void | setOwner (String owner) |
| Sets the owner. | |
| long | getNumberOfSolutions () |
| Returns the number of solutions in the SolutionSpace. | |
| String[] | getVariables () |
| Returns the internal order of variables used within the SolutionSpace. | |
| int | getNumberOfVariables () |
| Returns the number of variables in the SolutionSpace. | |
| String | getVariable (int index) |
| Returns the variable corresponding to the provided index. | |
| void | renameVariable (String oldName, String newName) |
| Renames a variable. | |
| SolutionSpace< V > | renameAllVars (String[] newVarNames) |
| Creates a shallow clone of this space, with different variable names. | |
| int | getIndex (String variable) |
| Returns the index of the input variable in this SolutionSpace. | |
| V[][] | getDomains () |
| Returns the array containing the domains of the variables. | |
| V[] | getDomain (String variable) |
| Returns an array of all possible values that the variable provided as a parameter can take in this SolutionSpace. | |
| void | setDomain (String var, V[] dom) |
| Sets the domain of a variable. | |
| void | augment (V[] variables_values) |
| Augments the SolutionSpace with a new combination of variable values which constitutes a new solution. | |
| SolutionSpace< V > | slice (String[] variables_names, V[][] sub_domains) |
| Returns a slice of this SolutionSpace. | |
| boolean | knows (Class<?> spaceClass) |
| Returns whether this space knows how to handle other spaces of the input class. | |
| SolutionSpace< V > | join (SolutionSpace< V > space, String[] total_variables) |
| Returns a SolutionSpace object obtained by joining this SolutionSpace object with the one provided as a parameter. | |
| boolean | equals (Object o) |
| Checks for equality. | |
| SolutionSpace< V > | clone () |
| SolutionSpace< V > | resolve () |
| SparseIterator< V > | sparseIter () |
| Iterator< V > | iterator () |
This interface defines common functionalities in all utility solution spaces.
A utility solution space is a solution space in which each solution has an associated value, called "utility".
| <V> | the type used for variable values |
| <U> | the type used for utility values |
| void frodo2.solutionSpaces.BasicUtilitySolutionSpace< V extends Addable< V >, U extends Serializable >.augment | ( | V[] | variables_values, |
| U | utility_value ) |
Augments this BasicUtilitySolutionSpace with a new combination of variables values associated with a given utility.
| variables_values | assignments to the variables |
| utility_value | corresponding utility value |
Implemented in frodo2.solutionSpaces.hypercube.BasicHypercube< V extends Addable< V >, U extends Serializable >.
| BasicUtilitySolutionSpace< V, U > frodo2.solutionSpaces.BasicUtilitySolutionSpace< V extends Addable< V >, U extends Serializable >.changeVariablesOrder | ( | String[] | variables_order | ) |
Returns a new BasicUtilitySolutionSpace by changing the order of the variables of this BasicUtilitySolutionSpace.
| variables_order | the new order of the variables |
Implemented in frodo2.solutionSpaces.hypercube.BasicHypercube< V extends Addable< V >, U extends Serializable >, and frodo2.solutionSpaces.JaCoP.JaCoPoptAssignments.
Referenced by frodo2.algorithms.dpop.stochastic.test.ExpectedUTILtest.Listener.checkOutput(), and frodo2.solutionSpaces.hypercube.tests.HypercubeTest.testCompose().
| BasicUtilitySolutionSpace< V, U > frodo2.solutionSpaces.BasicUtilitySolutionSpace< V extends Addable< V >, U extends Serializable >.clone | ( | ) |
| BasicUtilitySolutionSpace< V, U > frodo2.solutionSpaces.BasicUtilitySolutionSpace< V extends Addable< V >, U extends Serializable >.compose | ( | String[] | vars, |
| BasicUtilitySolutionSpace< V, ArrayList< V > > | substitution ) |
Substitutes some of the variables in this utility space with functions.
This operation is indeed a composition of spaces: if f is this utility space, and g is the input space, then this operation computes f o g.
| vars | the variables to be substituted |
| substitution | the new values for the substituted variables, as a function of some other variables |
Implemented in frodo2.solutionSpaces.hypercube.BasicHypercube< V extends Addable< V >, U extends Serializable >.
Referenced by frodo2.algorithms.dpop.param.ParamVALUE< Val extends Addable< Val > >.computeOptValAndSendVALUEmsgs().
| boolean frodo2.solutionSpaces.BasicUtilitySolutionSpace< V extends Addable< V >, U extends Serializable >.equivalent | ( | BasicUtilitySolutionSpace< V, U > | space | ) |
Returns whether the input BasicUtilitySolutionSpace represents the same space as this BasicUtilitySolutionSpace.
| space | the BasicUtilitySolutionSpace to be tested for equivalence |
Implemented in frodo2.solutionSpaces.hypercube.BasicHypercube< V extends Addable< V >, U extends Serializable >.
| Class< U > frodo2.solutionSpaces.BasicUtilitySolutionSpace< V extends Addable< V >, U extends Serializable >.getClassOfU | ( | ) |
Implemented in frodo2.solutionSpaces.hypercube.BasicHypercube< V extends Addable< V >, U extends Serializable >, and frodo2.solutionSpaces.JaCoP.JaCoPoptAssignments.
| U frodo2.solutionSpaces.BasicUtilitySolutionSpace< V extends Addable< V >, U extends Serializable >.getDefaultUtility | ( | ) |
Implemented in frodo2.solutionSpaces.hypercube.BasicHypercube< V extends Addable< V >, U extends Serializable >, and frodo2.solutionSpaces.JaCoP.JaCoPoptAssignments.
| U frodo2.solutionSpaces.BasicUtilitySolutionSpace< V extends Addable< V >, U extends Serializable >.getUtility | ( | long | index | ) |
Returns the utility value corresponding to the solution at the provided index.
It uses the internal order of the solutions in the solution space.
| index | index of the solution in the internal representation of solutions |
null if this solution does not exist Implemented in frodo2.solutionSpaces.hypercube.BasicHypercube< V extends Addable< V >, U extends Serializable >, and frodo2.solutionSpaces.JaCoP.JaCoPoptAssignments.
| U frodo2.solutionSpaces.BasicUtilitySolutionSpace< V extends Addable< V >, U extends Serializable >.getUtility | ( | Map< String, V > | assignments | ) |
Returns the utility corresponding to the input assignments.
| assignments | an association of values to variables |
Implemented in frodo2.solutionSpaces.hypercube.BasicHypercube< V extends Addable< V >, U extends Serializable >.
| U frodo2.solutionSpaces.BasicUtilitySolutionSpace< V extends Addable< V >, U extends Serializable >.getUtility | ( | String[] | variables_names, |
| V[] | variables_values ) |
Returns an object representing the utility value corresponding to the provided variables values representing a solution.
| variables_names | the names of the variables |
| variables_values | the values of the variables |
Implemented in frodo2.solutionSpaces.hypercube.BasicHypercube< V extends Addable< V >, U extends Serializable >.
| U frodo2.solutionSpaces.BasicUtilitySolutionSpace< V extends Addable< V >, U extends Serializable >.getUtility | ( | V[] | variables_values | ) |
Returns an object representing the utility value corresponding to the provided variables values representing a solution.
This assumes the values are given in the same order as the variables in the BasicUtilitySolutionSpace.
| variables_values | the values of the variables |
Implemented in frodo2.solutionSpaces.hypercube.BasicHypercube< V extends Addable< V >, U extends Serializable >.
Referenced by frodo2.algorithms.dpop.stochastic.test.ExpectedUTILtest.Listener.checkOutput(), frodo2.algorithms.dpop.privacy.EncryptedUTIL< V extends Addable< V >, U extends Addable< U >, E extends AddableLimited< U, E >.findOptimalValueForIsolatedVar(), frodo2.algorithms.mpc_discsp.MPC_DisCSP4< V extends Addable< V > >.init(), frodo2.algorithms.dpop.privacy.EncryptedUTIL< V extends Addable< V >, U extends Addable< U >, E extends AddableLimited< U, E >.VariableInfo.minFromTo(), frodo2.algorithms.dpop.param.ParamVALUE< Val extends Addable< Val > >.sendVALUEmessage(), frodo2.algorithms.duct.Sampling< V extends Addable< V > >.VariableInfo.solveSingleton(), frodo2.solutionSpaces.hypercube.tests.HypercubeTest.testCompose(), and frodo2.solutionSpaces.hypercube.tests.HypercubeTest.testConsensusWeighted().
| boolean frodo2.solutionSpaces.BasicUtilitySolutionSpace< V extends Addable< V >, U extends Serializable >.isIncludedIn | ( | BasicUtilitySolutionSpace< V, U > | space | ) |
Checks if this BasicUtilitySolutionSpace is included in the provided BasicUtilitySolutionSpace.
"Inclusion" means that both spaces contain the same variables, and all assignments in this BasicUtilitySolutionSpace appear with the same utility values in the input BasicUtilitySolutionSpace.
| space | BasicUtilitySolutionSpace object |
true if this BasicUtilitySolutionSpace is included in the provided BasicUtilitySolutionSpace object, and false otherwise Implemented in frodo2.solutionSpaces.hypercube.BasicHypercube< V extends Addable< V >, U extends Serializable >.
| Iterator< V, U > frodo2.solutionSpaces.BasicUtilitySolutionSpace< V extends Addable< V >, U extends Serializable >.iterator | ( | ) |
Implemented in frodo2.solutionSpaces.hypercube.BasicHypercube< V extends Addable< V >, U extends Serializable >, and frodo2.solutionSpaces.JaCoP.JaCoPoptAssignments.
Referenced by frodo2.solutionSpaces.hypercube.BasicHypercube< V extends Addable< V >, U extends Serializable >.equivalent(), frodo2.solutionSpaces.JaCoP.JaCoPutilSpace< V extends Addable< V > >.equivalent(), and frodo2.solutionSpaces.hypercube.HypercubeLimited< V extends Addable< V >, U extends Addable< U >, UL extends AddableLimited< U, UL >.join().
| Iterator< V, U > frodo2.solutionSpaces.BasicUtilitySolutionSpace< V extends Addable< V >, U extends Serializable >.iterator | ( | String[] | order | ) |
Implemented in frodo2.solutionSpaces.hypercube.BasicHypercube< V extends Addable< V >, U extends Serializable >, and frodo2.solutionSpaces.JaCoP.JaCoPoptAssignments.
| Iterator< V, U > frodo2.solutionSpaces.BasicUtilitySolutionSpace< V extends Addable< V >, U extends Serializable >.iterator | ( | String[] | variables, |
| V | domains[][] ) |
Returns an iterator.
| variables | The variables to iterate over, which may contain variables not in the space, but must contain all variables in the space |
| domains | The domains of the variables over which to iterate |
Implemented in frodo2.solutionSpaces.hypercube.BasicHypercube< V extends Addable< V >, U extends Serializable >.
| Iterator< V, U > frodo2.solutionSpaces.BasicUtilitySolutionSpace< V extends Addable< V >, U extends Serializable >.iterator | ( | String[] | variables, |
| V | domains[][], | ||
| V[] | assignment ) |
Returns an iterator.
| variables | The variables to iterate over |
| domains | The domains of the variables over which to iterate |
| assignment | An array that will be used as the output of nextSolution() |
Implemented in frodo2.solutionSpaces.hypercube.BasicHypercube< V extends Addable< V >, U extends Serializable >.
| String frodo2.solutionSpaces.BasicUtilitySolutionSpace< V extends Addable< V >, U extends Serializable >.prettyPrint | ( | U | ignoredUtil | ) |
A human-friendly version of toString().
| ignoredUtil | do not display solutions with this utility |
Implemented in frodo2.solutionSpaces.hypercube.BasicHypercube< V extends Addable< V >, U extends Serializable >.
| BasicUtilitySolutionSpace< V, U > frodo2.solutionSpaces.BasicUtilitySolutionSpace< V extends Addable< V >, U extends Serializable >.resolve | ( | ) |
Implemented in frodo2.solutionSpaces.hypercube.BasicHypercube< V extends Addable< V >, U extends Serializable >, and frodo2.solutionSpaces.JaCoP.JaCoPoptAssignments.
| BasicUtilitySolutionSpace< V, U > frodo2.solutionSpaces.BasicUtilitySolutionSpace< V extends Addable< V >, U extends Serializable >.resolve | ( | boolean | sparse | ) |
| void frodo2.solutionSpaces.BasicUtilitySolutionSpace< V extends Addable< V >, U extends Serializable >.setDefaultUtility | ( | U | utility | ) |
Sets the default utility value.
The default utility value is the one that is used when augmenting the BasicUtilitySolutionSpace with a new solution without specifying the utility of this solution.
| utility | the new default utility |
Implemented in frodo2.solutionSpaces.hypercube.BasicHypercube< V extends Addable< V >, U extends Serializable >.
| void frodo2.solutionSpaces.BasicUtilitySolutionSpace< V extends Addable< V >, U extends Serializable >.setInfeasibleUtility | ( | U | utility | ) |
Sets the utility associated with infeasible solutions.
| utility | the infeasible utility |
Implemented in frodo2.solutionSpaces.hypercube.BasicHypercube< V extends Addable< V >, U extends Serializable >.
| void frodo2.solutionSpaces.BasicUtilitySolutionSpace< V extends Addable< V >, U extends Serializable >.setUtility | ( | long | index, |
| U | utility ) |
Sets the utility value for the solution at the provided index.
| index | index of the solution |
| utility | new utility |
Implemented in frodo2.solutionSpaces.hypercube.BasicHypercube< V extends Addable< V >, U extends Serializable >.
| boolean frodo2.solutionSpaces.BasicUtilitySolutionSpace< V extends Addable< V >, U extends Serializable >.setUtility | ( | V[] | variables_values, |
| U | utility ) |
Sets the utility value corresponding to a given assignment to variables.
| variables_values | values for the variables, in the same order as in the BasicUtilitySolutionSpace |
| utility | the new utility value |
false is returned if the BasicUtilitySolutionSpace does not allow the given assignments to the variables. Implemented in frodo2.solutionSpaces.hypercube.BasicHypercube< V extends Addable< V >, U extends Serializable >.
Referenced by frodo2.algorithms.dpop.param.ParamVALUE< Val extends Addable< Val > >.sendVALUEmessage().
| BasicUtilitySolutionSpace< V, U > frodo2.solutionSpaces.BasicUtilitySolutionSpace< V extends Addable< V >, U extends Serializable >.slice | ( | String | var, |
| V | val ) |
Slices this BasicUtilitySolutionSpace over a single variable-value assignment.
Implemented in frodo2.solutionSpaces.hypercube.BasicHypercube< V extends Addable< V >, U extends Serializable >.
| BasicUtilitySolutionSpace< V, U > frodo2.solutionSpaces.BasicUtilitySolutionSpace< V extends Addable< V >, U extends Serializable >.slice | ( | String | var, |
| V[] | subDomain ) |
Slices this SolutionSpace over a single variable.
Implemented in frodo2.solutionSpaces.hypercube.BasicHypercube< V extends Addable< V >, U extends Serializable >.
| BasicUtilitySolutionSpace< V, U > frodo2.solutionSpaces.BasicUtilitySolutionSpace< V extends Addable< V >, U extends Serializable >.slice | ( | String[] | variables_names, |
| V[] | values ) |
Returns a slice of this BasicUtilitySolutionSpace.
Implemented in frodo2.solutionSpaces.hypercube.BasicHypercube< V extends Addable< V >, U extends Serializable >.
| BasicUtilitySolutionSpace< V, U > frodo2.solutionSpaces.BasicUtilitySolutionSpace< V extends Addable< V >, U extends Serializable >.slice | ( | String[] | variables_names, |
| V | sub_domains[][] ) |
Returns a slice of this BasicUtilitySolutionSpace.
Implemented in frodo2.solutionSpaces.hypercube.BasicHypercube< V extends Addable< V >, U extends Serializable >.
Referenced by frodo2.solutionSpaces.hypercube.tests.HypercubeTest.testConsensusWeighted().
| BasicUtilitySolutionSpace< V, U > frodo2.solutionSpaces.BasicUtilitySolutionSpace< V extends Addable< V >, U extends Serializable >.slice | ( | V[] | variables_values | ) |
Returns a slice of this solution space.
Implemented in frodo2.solutionSpaces.hypercube.BasicHypercube< V extends Addable< V >, U extends Serializable >.
| SparseIterator< V, U > frodo2.solutionSpaces.BasicUtilitySolutionSpace< V extends Addable< V >, U extends Serializable >.sparseIter | ( | ) |
| SparseIterator< V, U > frodo2.solutionSpaces.BasicUtilitySolutionSpace< V extends Addable< V >, U extends Serializable >.sparseIter | ( | String[] | order | ) |
Implemented in frodo2.solutionSpaces.hypercube.BasicHypercube< V extends Addable< V >, U extends Serializable >, and frodo2.solutionSpaces.JaCoP.JaCoPoptAssignments.
| SparseIterator< V, U > frodo2.solutionSpaces.BasicUtilitySolutionSpace< V extends Addable< V >, U extends Serializable >.sparseIter | ( | String[] | variables, |
| V | domains[][] ) |
Returns a sparse iterator.
| variables | The variables to iterate over, which may contain variables not in the space, but must contain all variables in the space |
| domains | The domains of the variables over which to iterate |
Implemented in frodo2.solutionSpaces.hypercube.BasicHypercube< V extends Addable< V >, U extends Serializable >.
| SparseIterator< V, U > frodo2.solutionSpaces.BasicUtilitySolutionSpace< V extends Addable< V >, U extends Serializable >.sparseIter | ( | String[] | variables, |
| V | domains[][], | ||
| V[] | assignment ) |
Returns a sparse iterator.
| variables | The variables to iterate over |
| domains | The domains of the variables over which to iterate |
| assignment | An array that will be used as the output of nextSolution() |
Implemented in frodo2.solutionSpaces.hypercube.BasicHypercube< V extends Addable< V >, U extends Serializable >.