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

The class representing a hypercube. More...

Inheritance diagram for frodo2.solutionSpaces.hypercube.Hypercube< V extends Addable< V >, U extends Addable< U > >:

Classes

class  NullHypercube
 Class representing a NULL hypercube. More...

Public Member Functions

 Hypercube ()
 Empty Hypercube constructor.
 Hypercube (String[] variables_order, V[][] variables_domains, Object[] utility_values, U infeasibleUtil)
 Construct a new Hypercube with provided variables names, the domains of this variables and the utility values.
 Hypercube (String[] variables_order, V[][] variables_domains, U[] utility_values, U infeasibleUtil)
 Construct a new Hypercube with provided variables names, the domains of these variables and the utility values.
 Hypercube (String name, String[] variables_order, V[][] variables_domains, U[] utility_values, U infeasibleUtil)
 Construct a new Hypercube with provided variables names, the domains of these variables and the utility values.
 Hypercube (String[] variables_order, V[][] variables_domains, U[] utility_values, U infeasibleUtil, ProblemInterface< V, U > problem)
 Construct a new Hypercube with provided variables names, the domains of these variables and the utility values.
 Hypercube (String file)
 Construct a new Hypercube with the variables names, the domains of this variables and the utility values stored in the provided XML file.
void saveAsXML (String file)
 Creates an XML file from the hypercube.
getUtility (String[] variables_names, V[] variables_values)
getUtility (Map< String, V > assignments)
UtilitySolutionSpace< V, U > join (UtilitySolutionSpace< V, U > space, boolean addition, boolean minNCCCs)
 Computes the join of this hypercube with the input hypercube.
UtilitySolutionSpace< V, U > join (UtilitySolutionSpace< V, U > space, String[] total_variables)
UtilitySolutionSpace< V, U > join (UtilitySolutionSpace< V, U > space)
UtilitySolutionSpace< V, U > joinMinNCCCs (UtilitySolutionSpace< V, U > space)
UtilitySolutionSpace< V, U > join (UtilitySolutionSpace< V, U >[] spaces)
UtilitySolutionSpace< V, U > joinMinNCCCs (UtilitySolutionSpace< V, U >[] spaces)
UtilitySolutionSpace< V, U > multiply (UtilitySolutionSpace< V, U > space, String[] total_variables)
UtilitySolutionSpace< V, U > multiply (UtilitySolutionSpace< V, U > space)
UtilitySolutionSpace< V, U > multiply (UtilitySolutionSpace< V, U >[] spaces)
Hypercube< V, U > slice (String[] variables_names, V[][] sub_domains)
Hypercube< V, U > slice (String[] variables_names, V[] values)
Hypercube< V, U > slice (String var, V[] subDomain)
Hypercube< V, U > slice (String var, V val)
Hypercube< V, U > slice (V[] variables_values)
UtilitySolutionSpace< V, U > applyJoin (UtilitySolutionSpace< V, U > space, String[] total_variables)
 Joins this hypercube with the provided hypercube if the utility values array is big enough, this hypercube is modified into the new hypercube, otherwise a new hypercube is created.
UtilitySolutionSpace< V, U > applyJoin (UtilitySolutionSpace< V, U > space)
 joins this hypercube with the provided hypercube by using applyJoin method
ProjOutput< V, U > consensus (final String varOut, final Map< String, UtilitySolutionSpace< V, U > > distributions, final boolean maximum)
ProjOutput< V, U > consensusAllSols (String varOut, Map< String, UtilitySolutionSpace< V, U > > distributions, boolean maximum)
ProjOutput< V, U > consensusExpect (final String varOut, final Map< String, UtilitySolutionSpace< V, U > > distributions, final boolean maximum)
ProjOutput< V, U > consensusAllSolsExpect (String varOut, Map< String, UtilitySolutionSpace< V, U > > distributions, boolean maximum)
UtilitySolutionSpace.ProjOutput< V, U > project (String[] varsOut, final boolean maximum)
 Returns a Hypercube obtained by projecting some of the variables of the hypercube.
UtilitySolutionSpace< V, U > blindProject (String varOut, boolean maximize)
UtilitySolutionSpace< V, U > blindProject (String[] varsOut, boolean maximize)
blindProjectAll (final boolean maximize)
Hypercube< V, U > min (String var)
Hypercube< V, U > max (String var)
UtilitySolutionSpace.ProjOutput< V, U > project (String variable_name, boolean maximum)
 Returns a Hypercube obtained by projecting the input variable out of the hypercube.
UtilitySolutionSpace.ProjOutput< V, U > project (int number_to_project, boolean maximum)
 Returns a hypercube obtained by projecting out from this hypercube the last number_to_project variables of the hypercube.
ProjOutput< V, U > projectAll (boolean maximum)
ProjOutput< V, U > projectAll (boolean maximum, String[] varsOut)
UtilitySolutionSpace.ProjOutput< V, U > applyProject (String[] variables_names, final boolean maximum)
 Returns a Hypercube obtained by projecting some of the variables of the hypercube this version of project does not create a new hypercube but directly modifies the current utility array.
Hypercube< V, U > split (U threshold, boolean maximum)
 Returns a Hypercube containing variables values corresponding to utility values bigger than the provided threshold.
UtilitySolutionSpace< V, U > expectation (Map< String, UtilitySolutionSpace< V, U > > distributions)
ProjOutput< V, U > projExpectMonotone (final String varOut, Map< String, UtilitySolutionSpace< V, U > > distributions, final boolean maximum)
Map< V, Double > sample (int nbrSamples)
Hypercube< V, U > changeVariablesOrder (String[] variables_order)
boolean equals (Object o)
 Checks if this hypercube equals the one provided as a parameter (including the order of variables).
Hypercube< V, U > clone ()
Hypercube< V, U > resolve ()
Hypercube< V, U > resolve (boolean unused)
Hypercube< V, U > toHypercube ()
boolean isIncludedIn (UtilitySolutionSpace< V, U > space)
SolutionSpace< V > join (SolutionSpace< V > space, String[] total_variables)
UtilitySolutionSpace< V, U > compose (String[] varsOut, BasicUtilitySolutionSpace< V, ArrayList< V > > substitution)
UtilitySolutionSpace.IteratorBestFirst< V, U > iteratorBestFirst (boolean maximize)
UtilitySolutionSpace.Iterator< V, U > iterator ()
UtilitySolutionSpace.SparseIterator< V, U > sparseIter ()
UtilitySolutionSpace.Iterator< V, U > iterator (String[] order)
UtilitySolutionSpace.SparseIterator< V, U > sparseIter (String[] order)
UtilitySolutionSpace.Iterator< V, U > iterator (String[] variables, V[][] domains)
UtilitySolutionSpace.SparseIterator< V, U > sparseIter (String[] variables, V[][] domains)
UtilitySolutionSpace.Iterator< V, U > iterator (String[] variables, V[][] domains, V[] assignment)
UtilitySolutionSpace.SparseIterator< V, U > sparseIter (String[] variables, V[][] domains, V[] assignment)
UtilitySolutionSpace.IteratorBestFirst< V, U > iteratorBestFirst (boolean maximize, String[] fixedVariables, V[] fixedValues)
UtilitySolutionSpace< V, U > rescale (U add, U multiply)
Public Member Functions inherited from frodo2.solutionSpaces.hypercube.HypercubeLimited< V, U, U >
 HypercubeLimited ()
 Empty constructor.
HypercubeLimited< V, U, UL > resolve ()
HypercubeLimited< V, U, UL > clone ()
UtilitySolutionSpaceLimited< V, U, UL > joinMinNCCCs (UtilitySolutionSpace< V, U > space)
UtilitySolutionSpaceLimited< V, U, UL > join (UtilitySolutionSpace< V, U > space)
UtilitySolutionSpaceLimited< V, U, UL > blindProject (String varOut, boolean maximize)
UL blindProjectAll (final boolean maximize)
UtilitySolutionSpaceLimited< V, U, UL > min (String variable)
UtilitySolutionSpaceLimited< V, U, UL > max (String variable)
HypercubeLimited< V, U, UL > slice (String var, V val)
Public Member Functions inherited from frodo2.solutionSpaces.UtilitySolutionSpaceLimited< V, U, U >
UtilitySolutionSpaceLimited< V, U, UL > join (UtilitySolutionSpace< V, U > space)
 Binary join operation.
UtilitySolutionSpaceLimited< V, U, UL > joinMinNCCCs (UtilitySolutionSpace< V, U > space)
 A version of the join method that minimizes the utility lookups in the caller space and the input space.
UtilitySolutionSpaceLimited< V, U, UL > blindProject (String varOut, boolean maximize)
 Projects out the input variable without computing the corresponding optimal assignments.
UL blindProjectAll (boolean maximize)
 Projects out all variables without computing the corresponding optimal assignments.
UtilitySolutionSpaceLimited< V, U, UL > min (String variable)
 Project out a variable by minimizing over it, without computing the argmin.
UtilitySolutionSpaceLimited< V, U, UL > max (String variable)
 Project out a variable by maximizing over it, without computing the argmax.
UtilitySolutionSpaceLimited< V, U, UL > slice (String var, V val)
UtilitySolutionSpaceLimited< V, U, UL > resolve ()

Static Public Member Functions

static String[] union (String[] list1, String[] list2)
 Computes the union of two lists, perserving the order when possible.

Protected Member Functions

 Hypercube (String[] variables_order, V[][] variables_domains, U[] utility_values, HashMap< V, Integer >[] steps_hashmaps)
 Construct a new Hypercube with provided variables names, the domains of these variables and the utility values.
UtilitySolutionSpace< V, U > join (UtilitySolutionSpace< V, U > utilitySpace, String[] outputVars, final boolean addition, final boolean minNCCCs)
 Returns a Hypercube object obtained by joining this hypercube with the one provided as a parameter.
UtilitySolutionSpace< V, U > join (UtilitySolutionSpace< V, U >[] spaces, final boolean addition, final boolean minNCCCs)
 The join method.
ProjOutput< V, U > consensus (final String varOut, final Map< String, UtilitySolutionSpace< V, U > > distributions, final boolean maximum, final boolean allSolutions, final boolean expect)
 A projection operation that uses the consensus approach.
ScalarHypercube< V, U > scalarHypercube (U utility)
Hypercube< V, U > newInstance (String name, String[] new_variables, V[][] new_domains, U[] new_values, U infeasibleUtil)
UtilitySolutionSpace.Iterator< V, U > newIter (String[] variables, V[][] domains, V[] assignment, U skippedUtil)
Protected Member Functions inherited from frodo2.solutionSpaces.hypercube.HypercubeLimited< V, U, U >
void writeUtilities (ObjectOutput out) throws IOException
void readUtilities (ObjectInput in) throws ClassNotFoundException, IOException, InvocationTargetException, NoSuchMethodException
HypercubeLimited< V, U, UL > newInstance (String name, String[] new_variables, V[][] new_domains, UL[] new_values, UL infeasibleUtil)
HypercubeLimited< V, U, UL > scalarHypercube (UL utility)

Detailed Description

The class representing a hypercube.

Author
Ouaret Nacereddine, Thomas Leaute, Radoslaw Szymanek, Stephane Rabie, Brammert Ottens
Parameters
<V>type used for the variable values
<U>type used for the utility values
Todo
When a method makes assumptions on the input parameters (for instance, the order of the variables), use asserts to check if these assumptions hold and document them in the method Doxygen comment.

Constructor & Destructor Documentation

◆ Hypercube() [1/7]

◆ Hypercube() [2/7]

frodo2.solutionSpaces.hypercube.Hypercube< V extends Addable< V >, U extends Addable< U > >.Hypercube ( String[] variables_order,
V variables_domains[][],
U[] utility_values,
HashMap< V, Integer >[] steps_hashmaps )
protected

Construct a new Hypercube with provided variables names, the domains of these variables and the utility values.

Parameters
variables_orderthe array containing the variables names ordered according to their order in the hypercube
variables_domainsthe domains of the variables contained in the variables_order array and ordered in the same order.
utility_valuesthe utility values contained in a one-dimensional array. there should be a utility value for each possible combination of values that the variables may take.
steps_hashmapssteps allowing faster access to utilities of a given assignment.
Warning
variables_domains parameter needs to be sorted in ascending order.
utility_values needs to be properly ordered, the first utility corresponds to the assignment in which each variable is assigned its first value.

References Hypercube().

Here is the call graph for this function:

◆ Hypercube() [3/7]

frodo2.solutionSpaces.hypercube.Hypercube< V extends Addable< V >, U extends Addable< U > >.Hypercube ( String[] variables_order,
V variables_domains[][],
Object[] utility_values,
U infeasibleUtil )

Construct a new Hypercube with provided variables names, the domains of this variables and the utility values.

Parameters
variables_orderthe array containing the variables names ordered according to their order in the hypercube
variables_domainsthe domains of the variables contained in the variables_order array and ordered in the same order.
utility_valuesthe utility values contained in a multi-dimensional array. there should be a utility value for each possible combination of values that the variables may take.
infeasibleUtil-INF if we are maximizing, +INF if we are minimizing
Todo
Test this constructor.
Bug
Extract the type used for utility values from the multi-dimensional array utility_values

References Hypercube().

Here is the call graph for this function:

◆ Hypercube() [4/7]

frodo2.solutionSpaces.hypercube.Hypercube< V extends Addable< V >, U extends Addable< U > >.Hypercube ( String[] variables_order,
V variables_domains[][],
U[] utility_values,
U infeasibleUtil )

Construct a new Hypercube with provided variables names, the domains of these variables and the utility values.

Parameters
variables_orderthe array containing the variables names ordered according to their order in the hypercube
variables_domainsthe domains of the variables contained in the variables_order array and ordered in the same order.
utility_valuesthe utility values contained in a one-dimensional array. there should be a utility value for each possible combination of values that the variables may take.
infeasibleUtil-INF if we are maximizing, +INF if we are minimizing
Warning
variables_domains parameter needs to be sorted in ascending order.
utility_values needs to be properly ordered, the first utility corresponds to the assignment in which each variable is assigned its first value.

◆ Hypercube() [5/7]

frodo2.solutionSpaces.hypercube.Hypercube< V extends Addable< V >, U extends Addable< U > >.Hypercube ( String name,
String[] variables_order,
V variables_domains[][],
U[] utility_values,
U infeasibleUtil )

Construct a new Hypercube with provided variables names, the domains of these variables and the utility values.

Parameters
namethe name of the Hypercube
variables_orderthe array containing the variables names ordered according to their order in the hypercube
variables_domainsthe domains of the variables contained in the variables_order array and ordered in the same order.
utility_valuesthe utility values contained in a one-dimensional array. there should be a utility value for each possible combination of values that the variables may take.
infeasibleUtil-INF if we are maximizing, +INF if we are minimizing
Warning
variables_domains parameter needs to be sorted in ascending order.
utility_values needs to be properly ordered, the first utility corresponds to the assignment in which each variable is assigned its first value.

◆ Hypercube() [6/7]

frodo2.solutionSpaces.hypercube.Hypercube< V extends Addable< V >, U extends Addable< U > >.Hypercube ( String[] variables_order,
V variables_domains[][],
U[] utility_values,
U infeasibleUtil,
ProblemInterface< V, U > problem )

Construct a new Hypercube with provided variables names, the domains of these variables and the utility values.

Parameters
variables_orderthe array containing the variables names ordered according to their order in the hypercube
variables_domainsthe domains of the variables contained in the variables_order array and ordered in the same order.
utility_valuesthe utility values contained in a one-dimensional array. there should be a utility value for each possible combination of values that the variables may take.
infeasibleUtil-INF if we are maximizing, +INF if we are minimizing
problemthe problem to be notified of constraint checks
Warning
variables_domains parameter needs to be sorted in ascending order.
utility_values needs to be properly ordered, the first utility corresponds to the assignment in which each variable is assigned its first value.

◆ Hypercube() [7/7]

frodo2.solutionSpaces.hypercube.Hypercube< V extends Addable< V >, U extends Addable< U > >.Hypercube ( String file)

Construct a new Hypercube with the variables names, the domains of this variables and the utility values stored in the provided XML file.

Parameters
filethe name of the XML file containing the needed information. the file name may also contain the path to that XML file
Todo
We apparently cannot use Array.newInstance here because the file format allows different value types for different variables
Todo
Actually, the file doesn't say whether it should be -INF or +INF

References Hypercube().

Here is the call graph for this function:

Member Function Documentation

◆ applyJoin() [1/2]

UtilitySolutionSpace< V, U > frodo2.solutionSpaces.hypercube.Hypercube< V extends Addable< V >, U extends Addable< U > >.applyJoin ( UtilitySolutionSpace< V, U > space)

joins this hypercube with the provided hypercube by using applyJoin method

Parameters
spacehypercube to join this one with
Returns
the join of the two hypercubes
Note
Depending on the respective sizes of the caller and the input spaces, this method will modify one or the other (it will modify the bigger one).

References applyJoin(), Hypercube(), and union().

Here is the call graph for this function:

◆ applyJoin() [2/2]

UtilitySolutionSpace< V, U > frodo2.solutionSpaces.hypercube.Hypercube< V extends Addable< V >, U extends Addable< U > >.applyJoin ( UtilitySolutionSpace< V, U > space,
String[] total_variables )

Joins this hypercube with the provided hypercube if the utility values array is big enough, this hypercube is modified into the new hypercube, otherwise a new hypercube is created.

Note
no assumption on the variables order in the two hypercubes is made, but the variables order in the new hypercube is fixed, ie. the first variables will necessarily be the variables present only in the provided variables, then the variables present in this hypercube
Parameters
spacethe hypercube to join this one with
total_variablesthe list of variables of the two hypercubes
Returns
the join of the two hypercubes

References applyJoin(), Hypercube(), and frodo2.solutionSpaces.hypercube.Hypercube< V extends Addable< V >, U extends Addable< U > >.NullHypercube< V extends Addable< V >, U extends Addable< U > >.NULL.

Referenced by applyJoin(), applyJoin(), and frodo2.solutionSpaces.hypercube.tests.HypercubeTest.testApplyJoinRandom().

Here is the call graph for this function:

◆ applyProject()

UtilitySolutionSpace.ProjOutput< V, U > frodo2.solutionSpaces.hypercube.Hypercube< V extends Addable< V >, U extends Addable< U > >.applyProject ( String[] variables_names,
final boolean maximum )

Returns a Hypercube obtained by projecting some of the variables of the hypercube this version of project does not create a new hypercube but directly modifies the current utility array.

Parameters
variables_namesthe variables that should be removed from this hypercube
maximumboolean object indicating whether to use the maximum or the minumum
Returns
a ProjOutput object with the modifies hypercube

References applyProject(), clone(), and frodo2.solutionSpaces.hypercube.Hypercube< V extends Addable< V >, U extends Addable< U > >.NullHypercube< V extends Addable< V >, U extends Addable< U > >.NULL.

Referenced by applyProject(), and frodo2.solutionSpaces.hypercube.tests.HypercubeTest.testApplyProjectRandom().

Here is the call graph for this function:

◆ blindProject() [1/2]

UtilitySolutionSpace< V, U > frodo2.solutionSpaces.hypercube.Hypercube< V extends Addable< V >, U extends Addable< U > >.blindProject ( String varOut,
boolean maximize )
See also
HypercubeLimited.blindProject(java.lang.String, boolean)

Implements frodo2.solutionSpaces.UtilitySolutionSpace< V extends Addable< V >, U extends Addable< U > >.

References blindProject().

Referenced by blindProject().

Here is the call graph for this function:

◆ blindProject() [2/2]

UtilitySolutionSpace< V, U > frodo2.solutionSpaces.hypercube.Hypercube< V extends Addable< V >, U extends Addable< U > >.blindProject ( String[] varsOut,
boolean maximize )
See also
HypercubeLimited.blindProject(java.lang.String[], boolean)

Implements frodo2.solutionSpaces.UtilitySolutionSpace< V extends Addable< V >, U extends Addable< U > >.

References blindProjectAll().

Here is the call graph for this function:

◆ blindProjectAll()

U frodo2.solutionSpaces.hypercube.Hypercube< V extends Addable< V >, U extends Addable< U > >.blindProjectAll ( final boolean maximize)

◆ changeVariablesOrder()

◆ clone()

◆ compose()

◆ consensus() [1/2]

ProjOutput< V, U > frodo2.solutionSpaces.hypercube.Hypercube< V extends Addable< V >, U extends Addable< U > >.consensus ( final String varOut,
final Map< String, UtilitySolutionSpace< V, U > > distributions,
final boolean maximum )

◆ consensus() [2/2]

ProjOutput< V, U > frodo2.solutionSpaces.hypercube.Hypercube< V extends Addable< V >, U extends Addable< U > >.consensus ( final String varOut,
final Map< String, UtilitySolutionSpace< V, U > > distributions,
final boolean maximum,
final boolean allSolutions,
final boolean expect )
protected

A projection operation that uses the consensus approach.

Parameters
varOutthe variable that is projected out
distributionsfor each random variable, its weighted samples/probability distribution
maximumtrue if we should maximize the utility; false if it should be minimized
allSolutionsif true, use the revised consensus algorithm that considers all optimal solutions to each scenario
expectwhether to compose the consenus operation with the expectation operation
Returns
a ProjOutput object that represents the pair resulting space - conditional optimal assignments
Todo
Test when the distributions and the caller do not agree on the domains.
Bug
Can be 0 even if the true utility of the current solution is worse

References clone(), compose(), consensus(), expectation(), Hypercube(), iterator(), frodo2.solutionSpaces.hypercube.Hypercube< V extends Addable< V >, U extends Addable< U > >.NullHypercube< V extends Addable< V >, U extends Addable< U > >.NULL, and project().

Here is the call graph for this function:

◆ consensusAllSols()

ProjOutput< V, U > frodo2.solutionSpaces.hypercube.Hypercube< V extends Addable< V >, U extends Addable< U > >.consensusAllSols ( String varOut,
Map< String, UtilitySolutionSpace< V, U > > distributions,
boolean maximum )

◆ consensusAllSolsExpect()

ProjOutput< V, U > frodo2.solutionSpaces.hypercube.Hypercube< V extends Addable< V >, U extends Addable< U > >.consensusAllSolsExpect ( String varOut,
Map< String, UtilitySolutionSpace< V, U > > distributions,
boolean maximum )
See also
UtilitySolutionSpace.consensusAllSolsExpect(java.lang.String, java.util.Map, boolean)

Implements frodo2.solutionSpaces.UtilitySolutionSpace< V extends Addable< V >, U extends Addable< U > >.

References consensus().

Here is the call graph for this function:

◆ consensusExpect()

ProjOutput< V, U > frodo2.solutionSpaces.hypercube.Hypercube< V extends Addable< V >, U extends Addable< U > >.consensusExpect ( final String varOut,
final Map< String, UtilitySolutionSpace< V, U > > distributions,
final boolean maximum )

◆ equals()

◆ expectation()

◆ getUtility() [1/2]

U frodo2.solutionSpaces.hypercube.Hypercube< V extends Addable< V >, U extends Addable< U > >.getUtility ( Map< String, V > assignments)
See also
BasicHypercube.getUtility(java.util.Map)

◆ getUtility() [2/2]

◆ isIncludedIn()

boolean frodo2.solutionSpaces.hypercube.Hypercube< V extends Addable< V >, U extends Addable< U > >.isIncludedIn ( UtilitySolutionSpace< V, U > space)
See also
UtilitySolutionSpace#isIncludedIn(UtilitySolutionSpace)
Todo
Auto-generated method stub

Implements frodo2.solutionSpaces.UtilitySolutionSpace< V extends Addable< V >, U extends Addable< U > >.

◆ iterator() [1/4]

◆ iterator() [2/4]

UtilitySolutionSpace.Iterator< V, U > frodo2.solutionSpaces.hypercube.Hypercube< V extends Addable< V >, U extends Addable< U > >.iterator ( String[] order)

◆ iterator() [3/4]

UtilitySolutionSpace.Iterator< V, U > frodo2.solutionSpaces.hypercube.Hypercube< V extends Addable< V >, U extends Addable< U > >.iterator ( String[] variables,
V domains[][] )

◆ iterator() [4/4]

UtilitySolutionSpace.Iterator< V, U > frodo2.solutionSpaces.hypercube.Hypercube< V extends Addable< V >, U extends Addable< U > >.iterator ( String[] variables,
V domains[][],
V[] assignment )

◆ iteratorBestFirst() [1/2]

◆ iteratorBestFirst() [2/2]

UtilitySolutionSpace.IteratorBestFirst< V, U > frodo2.solutionSpaces.hypercube.Hypercube< V extends Addable< V >, U extends Addable< U > >.iteratorBestFirst ( boolean maximize,
String[] fixedVariables,
V[] fixedValues )

◆ join() [1/7]

SolutionSpace< V > frodo2.solutionSpaces.hypercube.Hypercube< V extends Addable< V >, U extends Addable< U > >.join ( SolutionSpace< V > space,
String[] total_variables )
See also
BasicHypercube.join(SolutionSpace, java.lang.String[])
Todo
Implement join if space is not UtilitySolutionSpace

References join().

Here is the call graph for this function:

◆ join() [2/7]

UtilitySolutionSpace< V, U > frodo2.solutionSpaces.hypercube.Hypercube< V extends Addable< V >, U extends Addable< U > >.join ( UtilitySolutionSpace< V, U > space)

◆ join() [3/7]

UtilitySolutionSpace< V, U > frodo2.solutionSpaces.hypercube.Hypercube< V extends Addable< V >, U extends Addable< U > >.join ( UtilitySolutionSpace< V, U > space,
boolean addition,
boolean minNCCCs )

Computes the join of this hypercube with the input hypercube.

Parameters
spaceinput hypercube
additiontrue if utilities should be added, false if they should be multiplied
minNCCCswhether to optimize runtime or NCCC count
Returns
join of the two hypercubes
Note
The variable order used is the one returned by the union() method.
See also
Hypercube.union(String[], String[])
Author
Thomas Leaute

References join(), and union().

Here is the call graph for this function:

◆ join() [4/7]

◆ join() [5/7]

UtilitySolutionSpace< V, U > frodo2.solutionSpaces.hypercube.Hypercube< V extends Addable< V >, U extends Addable< U > >.join ( UtilitySolutionSpace< V, U > utilitySpace,
String[] outputVars,
final boolean addition,
final boolean minNCCCs )
protected

Returns a Hypercube object obtained by joining this hypercube with the one provided as a parameter.

Parameters
utilitySpacethe hypercube to join this one with
outputVarsthe desired order in the output hypercube
additiontrue if utilities should be added, false if they should be multiplied
minNCCCswhether to optimize runtime or NCCC count
Returns
Hypercube object obtained by joining this hypercube with the one provided as a parameter
Warning
Assumes that each variable in outputVars is contained in either of the two hypercubes.
Author
Thomas Leaute

References Hypercube(), iterator(), frodo2.solutionSpaces.UtilitySolutionSpace< V extends Addable< V >, U extends Addable< U > >.iterator(), join(), newInstance(), frodo2.solutionSpaces.hypercube.Hypercube< V extends Addable< V >, U extends Addable< U > >.NullHypercube< V extends Addable< V >, U extends Addable< U > >.newInstance(), frodo2.solutionSpaces.hypercube.Hypercube< V extends Addable< V >, U extends Addable< U > >.NullHypercube< V extends Addable< V >, U extends Addable< U > >.NULL, and union().

Referenced by join(), join(), join(), join(), join(), join(), join(), joinMinNCCCs(), joinMinNCCCs(), multiply(), multiply(), multiply(), frodo2.solutionSpaces.hypercube.tests.HypercubeTest.testApplyJoinRandom(), frodo2.solutionSpaces.hypercube.tests.HypercubeTest.testJoinRandom(), frodo2.solutionSpaces.hypercube.tests.HypercubeTest.testProjectionRandom(), frodo2.solutionSpaces.hypercube.tests.HypercubeTest.testSliceRandom(), and frodo2.solutionSpaces.hypercube.tests.HypercubeTest.testSmartJoinRandom().

Here is the call graph for this function:

◆ join() [6/7]

UtilitySolutionSpace< V, U > frodo2.solutionSpaces.hypercube.Hypercube< V extends Addable< V >, U extends Addable< U > >.join ( UtilitySolutionSpace< V, U >[] spaces)
See also
UtilitySolutionSpace#join(UtilitySolutionSpace[])

Implements frodo2.solutionSpaces.UtilitySolutionSpace< V extends Addable< V >, U extends Addable< U > >.

References join().

Here is the call graph for this function:

◆ join() [7/7]

UtilitySolutionSpace< V, U > frodo2.solutionSpaces.hypercube.Hypercube< V extends Addable< V >, U extends Addable< U > >.join ( UtilitySolutionSpace< V, U >[] spaces,
final boolean addition,
final boolean minNCCCs )
protected

The join method.

Parameters
spacesinput spaces
additiontrue if utilities should be added, false if they should be multiplied
minNCCCswhether to optimize runtime or NCCC count
Returns
the joint hypercube

References Hypercube(), iterator(), frodo2.solutionSpaces.UtilitySolutionSpace< V extends Addable< V >, U extends Addable< U > >.iterator(), join(), frodo2.solutionSpaces.UtilitySolutionSpace< V extends Addable< V >, U extends Addable< U > >.join(), and newInstance().

Here is the call graph for this function:

◆ joinMinNCCCs() [1/2]

UtilitySolutionSpace< V, U > frodo2.solutionSpaces.hypercube.Hypercube< V extends Addable< V >, U extends Addable< U > >.joinMinNCCCs ( UtilitySolutionSpace< V, U > space)
See also
UtilitySolutionSpace#joinMinNCCCs(UtilitySolutionSpace)

Implements frodo2.solutionSpaces.UtilitySolutionSpace< V extends Addable< V >, U extends Addable< U > >.

References join(), and frodo2.solutionSpaces.UtilitySolutionSpace< V extends Addable< V >, U extends Addable< U > >.join().

Here is the call graph for this function:

◆ joinMinNCCCs() [2/2]

UtilitySolutionSpace< V, U > frodo2.solutionSpaces.hypercube.Hypercube< V extends Addable< V >, U extends Addable< U > >.joinMinNCCCs ( UtilitySolutionSpace< V, U >[] spaces)
See also
UtilitySolutionSpace#joinMinNCCCs(UtilitySolutionSpace[])

Implements frodo2.solutionSpaces.UtilitySolutionSpace< V extends Addable< V >, U extends Addable< U > >.

References join(), and resolve().

Here is the call graph for this function:

◆ max()

Hypercube< V, U > frodo2.solutionSpaces.hypercube.Hypercube< V extends Addable< V >, U extends Addable< U > >.max ( String var)
See also
HypercubeLimited.max(java.lang.String)

Implements frodo2.solutionSpaces.UtilitySolutionSpace< V extends Addable< V >, U extends Addable< U > >.

References Hypercube(), and max().

Referenced by max().

Here is the call graph for this function:

◆ min()

Hypercube< V, U > frodo2.solutionSpaces.hypercube.Hypercube< V extends Addable< V >, U extends Addable< U > >.min ( String var)
See also
HypercubeLimited.min(java.lang.String)

Implements frodo2.solutionSpaces.UtilitySolutionSpace< V extends Addable< V >, U extends Addable< U > >.

References Hypercube(), and min().

Referenced by min().

Here is the call graph for this function:

◆ multiply() [1/3]

UtilitySolutionSpace< V, U > frodo2.solutionSpaces.hypercube.Hypercube< V extends Addable< V >, U extends Addable< U > >.multiply ( UtilitySolutionSpace< V, U > space)
See also
UtilitySolutionSpace#multiply(UtilitySolutionSpace)

Implements frodo2.solutionSpaces.UtilitySolutionSpace< V extends Addable< V >, U extends Addable< U > >.

References join(), and frodo2.solutionSpaces.UtilitySolutionSpace< V extends Addable< V >, U extends Addable< U > >.multiply().

Here is the call graph for this function:

◆ multiply() [2/3]

◆ multiply() [3/3]

UtilitySolutionSpace< V, U > frodo2.solutionSpaces.hypercube.Hypercube< V extends Addable< V >, U extends Addable< U > >.multiply ( UtilitySolutionSpace< V, U >[] spaces)
See also
UtilitySolutionSpace#multiply(UtilitySolutionSpace[])

Implements frodo2.solutionSpaces.UtilitySolutionSpace< V extends Addable< V >, U extends Addable< U > >.

References join().

Here is the call graph for this function:

◆ newInstance()

Hypercube< V, U > frodo2.solutionSpaces.hypercube.Hypercube< V extends Addable< V >, U extends Addable< U > >.newInstance ( String name,
String[] new_variables,
V new_domains[][],
U[] new_values,
U infeasibleUtil )
protected

◆ newIter()

UtilitySolutionSpace.Iterator< V, U > frodo2.solutionSpaces.hypercube.Hypercube< V extends Addable< V >, U extends Addable< U > >.newIter ( String[] variables,
V domains[][],
V[] assignment,
U skippedUtil )
protected
See also
BasicHypercube.newIter(java.lang.String[], Addable[][], Addable[], Serializable)

◆ project() [1/3]

UtilitySolutionSpace.ProjOutput< V, U > frodo2.solutionSpaces.hypercube.Hypercube< V extends Addable< V >, U extends Addable< U > >.project ( int number_to_project,
boolean maximum )

Returns a hypercube obtained by projecting out from this hypercube the last number_to_project variables of the hypercube.

Parameters
number_to_projectnumber of the varibles of the hypercube to project out
maximumindicates wether to take the maximum or minimum among the utility values that will be mapped into the the same utility value in the new hypercube
Returns
a ProjOutput object
Todo
Implement an on-the-fly version of this method.

Implements frodo2.solutionSpaces.UtilitySolutionSpace< V extends Addable< V >, U extends Addable< U > >.

References clone(), frodo2.solutionSpaces.hypercube.Hypercube< V extends Addable< V >, U extends Addable< U > >.NullHypercube< V extends Addable< V >, U extends Addable< U > >.NULL, project(), and projectAll().

Here is the call graph for this function:

◆ project() [2/3]

UtilitySolutionSpace.ProjOutput< V, U > frodo2.solutionSpaces.hypercube.Hypercube< V extends Addable< V >, U extends Addable< U > >.project ( String variable_name,
boolean maximum )

Returns a Hypercube obtained by projecting the input variable out of the hypercube.

Parameters
variable_namethe variable that should have been removed in the resulting hypercube
maximumindicates whether one should take the maximum (true) or the minimum (false)
Returns
a ProjOutput object
Todo
Implement an on-the-fly version of argProject().

Implements frodo2.solutionSpaces.UtilitySolutionSpace< V extends Addable< V >, U extends Addable< U > >.

References clone(), frodo2.solutionSpaces.hypercube.Hypercube< V extends Addable< V >, U extends Addable< U > >.NullHypercube< V extends Addable< V >, U extends Addable< U > >.NULL, and project().

Here is the call graph for this function:

◆ project() [3/3]

UtilitySolutionSpace.ProjOutput< V, U > frodo2.solutionSpaces.hypercube.Hypercube< V extends Addable< V >, U extends Addable< U > >.project ( String[] varsOut,
final boolean maximum )

◆ projectAll() [1/2]

ProjOutput< V, U > frodo2.solutionSpaces.hypercube.Hypercube< V extends Addable< V >, U extends Addable< U > >.projectAll ( boolean maximum)

◆ projectAll() [2/2]

ProjOutput< V, U > frodo2.solutionSpaces.hypercube.Hypercube< V extends Addable< V >, U extends Addable< U > >.projectAll ( boolean maximum,
String[] varsOut )

◆ projExpectMonotone()

◆ rescale()

◆ resolve() [1/2]

Hypercube< V, U > frodo2.solutionSpaces.hypercube.Hypercube< V extends Addable< V >, U extends Addable< U > >.resolve ( )

◆ resolve() [2/2]

Hypercube< V, U > frodo2.solutionSpaces.hypercube.Hypercube< V extends Addable< V >, U extends Addable< U > >.resolve ( boolean unused)

◆ sample()

Map< V, Double > frodo2.solutionSpaces.hypercube.Hypercube< V extends Addable< V >, U extends Addable< U > >.sample ( int nbrSamples)
See also
UtilitySolutionSpace.sample(int)
Warning
Assumes that the hypercube contains a single variable, and that utilities sum up to 1.0.

Implements frodo2.solutionSpaces.UtilitySolutionSpace< V extends Addable< V >, U extends Addable< U > >.

Referenced by frodo2.solutionSpaces.hypercube.tests.HypercubeTest.testSample().

◆ saveAsXML()

void frodo2.solutionSpaces.hypercube.Hypercube< V extends Addable< V >, U extends Addable< U > >.saveAsXML ( String file)

Creates an XML file from the hypercube.

Parameters
filethe name of the XML file in which the hypercube will be saved

References getUtility(), frodo2.output, and saveAsXML().

Referenced by saveAsXML(), and frodo2.solutionSpaces.hypercube.tests.HypercubeTest.testSaveAsXMLRandom().

Here is the call graph for this function:

◆ scalarHypercube()

ScalarHypercube< V, U > frodo2.solutionSpaces.hypercube.Hypercube< V extends Addable< V >, U extends Addable< U > >.scalarHypercube ( U utility)
protected
See also
BasicHypercube.scalarHypercube(java.io.Serializable)

Referenced by projExpectMonotone().

◆ slice() [1/5]

Hypercube< V, U > frodo2.solutionSpaces.hypercube.Hypercube< V extends Addable< V >, U extends Addable< U > >.slice ( String var,
V val )
See also
BasicHypercube#slice(String, Addable)

Implements frodo2.solutionSpaces.UtilitySolutionSpace< V extends Addable< V >, U extends Addable< U > >.

References Hypercube(), and slice().

Here is the call graph for this function:

◆ slice() [2/5]

Hypercube< V, U > frodo2.solutionSpaces.hypercube.Hypercube< V extends Addable< V >, U extends Addable< U > >.slice ( String var,
V[] subDomain )
See also
BasicHypercube#slice(String, Addable[])

Implements frodo2.solutionSpaces.UtilitySolutionSpace< V extends Addable< V >, U extends Addable< U > >.

References Hypercube(), and slice().

Here is the call graph for this function:

◆ slice() [3/5]

Hypercube< V, U > frodo2.solutionSpaces.hypercube.Hypercube< V extends Addable< V >, U extends Addable< U > >.slice ( String[] variables_names,
V[] values )
See also
BasicHypercube.slice(java.lang.String[], Addable[])

Implements frodo2.solutionSpaces.UtilitySolutionSpace< V extends Addable< V >, U extends Addable< U > >.

References Hypercube(), and slice().

Here is the call graph for this function:

◆ slice() [4/5]

◆ slice() [5/5]

Hypercube< V, U > frodo2.solutionSpaces.hypercube.Hypercube< V extends Addable< V >, U extends Addable< U > >.slice ( V[] variables_values)
See also
BasicHypercube#slice(Addable[])

Implements frodo2.solutionSpaces.UtilitySolutionSpace< V extends Addable< V >, U extends Addable< U > >.

References Hypercube(), and slice().

Here is the call graph for this function:

◆ sparseIter() [1/4]

◆ sparseIter() [2/4]

UtilitySolutionSpace.SparseIterator< V, U > frodo2.solutionSpaces.hypercube.Hypercube< V extends Addable< V >, U extends Addable< U > >.sparseIter ( String[] order)

◆ sparseIter() [3/4]

UtilitySolutionSpace.SparseIterator< V, U > frodo2.solutionSpaces.hypercube.Hypercube< V extends Addable< V >, U extends Addable< U > >.sparseIter ( String[] variables,
V domains[][] )

◆ sparseIter() [4/4]

UtilitySolutionSpace.SparseIterator< V, U > frodo2.solutionSpaces.hypercube.Hypercube< V extends Addable< V >, U extends Addable< U > >.sparseIter ( String[] variables,
V domains[][],
V[] assignment )

◆ split()

Hypercube< V, U > frodo2.solutionSpaces.hypercube.Hypercube< V extends Addable< V >, U extends Addable< U > >.split ( U threshold,
boolean maximum )

Returns a Hypercube containing variables values corresponding to utility values bigger than the provided threshold.

Parameters
thresholdthe threshold
maximumboolean
Returns
Hypercube object obtained by removing utility values less than the threshold from the this hypercube

Implements frodo2.solutionSpaces.UtilitySolutionSpace< V extends Addable< V >, U extends Addable< U > >.

References getUtility(), Hypercube(), frodo2.java, frodo2.solutionSpaces.hypercube.Hypercube< V extends Addable< V >, U extends Addable< U > >.NullHypercube< V extends Addable< V >, U extends Addable< U > >.NULL, and split().

Referenced by split(), and frodo2.solutionSpaces.hypercube.tests.HypercubeTest.testSplittingRandom().

Here is the call graph for this function:

◆ toHypercube()

Hypercube< V, U > frodo2.solutionSpaces.hypercube.Hypercube< V extends Addable< V >, U extends Addable< U > >.toHypercube ( )

◆ union()

String[] frodo2.solutionSpaces.hypercube.Hypercube< V extends Addable< V >, U extends Addable< U > >.union ( String[] list1,
String[] list2 )
static

Computes the union of two lists, perserving the order when possible.

Parameters
list1first list
list2second list
Returns
the union of the two lists
Note
When the two lists disaggree on the order, list1 wins. When the two lists don't care, list2's elements have the priority.
Author
Thomas Leaute

Referenced by applyJoin(), join(), join(), frodo2.solutionSpaces.hypercube.HypercubeLimited< V extends Addable< V >, U extends Addable< U >, UL extends AddableLimited< U, UL >.join(), frodo2.solutionSpaces.vehiclerouting.VehicleRoutingSpace< U extends Addable< U > >.join(), and frodo2.solutionSpaces.hypercube.tests.HypercubeTest.testUnion().


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