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

A Hypercube whose utilities are AddableLimited's. More...

Inheritance diagram for frodo2.solutionSpaces.hypercube.HypercubeLimited< V extends Addable< V >, U extends Addable< U >, UL extends AddableLimited< U, UL >:

Public Member Functions

 HypercubeLimited ()
 Empty constructor.
 HypercubeLimited (String[] variablesOrder, V[][] variablesDomains, UL[] utilityValues, UL infeasibleUtil)
 Constructor.
 HypercubeLimited (String name, String[] variablesOrder, V[][] variablesDomains, UL[] utilityValues, UL infeasibleUtil)
 Constructor.
 HypercubeLimited (String[] variablesOrder, V[][] variablesDomains, UL[] utilityValues, UL infeasibleUtil, ProblemInterface< V, U > problem)
 Constructor.
HypercubeLimited< V, U, UL > resolve ()
HypercubeLimited< V, U, UL > resolve (boolean unused)
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 > join (UtilitySolutionSpace< V, U > space, final boolean minNCCCs)
 The join operation.
UtilitySolutionSpaceLimited< V, U, UL > blindProject (String varOut, boolean maximize)
UtilitySolutionSpaceLimited< V, U, UL > blindProject (String[] varsOut, final 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.hypercube.BasicHypercube< V, UL >
 BasicHypercube (String[] variables_order, V[][] variables_domains, U[] utility_values, U infeasibleUtil)
 Construct a new BasicHypercube with provided variables names, the domains of these variables and the utility values.
void writeExternal (ObjectOutput out) throws IOException
void readExternal (ObjectInput in) throws IOException, ClassNotFoundException
void setProblem (ProblemInterface< V, ?> problem)
boolean countsCCs ()
long getNumberOfSolutions ()
 Returns the number of utility values in the hypercube.
getUtility (V[] variables_values)
getUtilityValueSameOrder (String[] variables_names, V[] variables_values)
 Returns an object representing the utility value corresponding to the provided variables values.
Class< U > getClassOfU ()
boolean setUtility (V[] variables_values, U utility)
 Sets the utility value corresponding to a given assignment to variables.
String[] getVariables ()
 Returns the names of the variables of the hypercube.
int getNumberOfVariables ()
 Returns the number of variables in the hypercube.
String getVariable (int index)
 Returns the variable corresponding to the provided index.
void renameVariable (String oldName, String newName)
BasicHypercube< V, U > renameAllVars (String[] newVarNames)
int getIndex (String variable)
 Return the index of the input variable in this hypercube.
V[][] getDomains ()
 Returns the array containing the domains of the variables.
V[] getDomain (String variable)
 Returns an array all the possible values that the variable provided as a parameter can take in this hypercube.
void setDomain (String var, V[] dom)
String toString ()
String prettyPrint (U ignoredUtil)
boolean isNull ()
 Check if this hypercube is the NULL hypercube.
void augment (V[] variables_values, U utility_value)
BasicHypercube< V, U > changeVariablesOrder (String[] variables_order)
 Return a new BasicHypercube by changing the order of the variables of the hypercube.
void applyChangeVariablesOrder (String[] variables_order)
 Changes the variable order of the hypercube by reordering the current utility array.
BasicHypercube< V, U > applyAugment (String[] new_variables, V[][] new_domains)
 Augments the hypercube by adding new variables at the beginning of its variables list.
boolean equivalent (final BasicUtilitySolutionSpace< V, U > space)
boolean isIncludedIn (BasicUtilitySolutionSpace< V, U > space)
Iterator< V, U > iterator ()
SparseIterator< V, U > sparseIter ()
SolutionSpace< V > join (SolutionSpace< V > space, String[] total_variables)
BasicHypercube< V, U > slice (String[] variables_names, V[][] sub_domains)
 Return a slice of this hypercube.
BasicHypercube< V, U > applySlice (String[] variables_names, V[][] sub_domains)
 Return a slice of this hypercube this version of slice does not create a new hypercube but directly modifies the current utility array.
boolean equals (Object o)
int hashCode ()
BasicHypercube< V, U > clone ()
BasicHypercube< V, U > resolve ()
BasicUtilitySolutionSpace< V, U > compose (final String[] varsOut, final BasicUtilitySolutionSpace< V, ArrayList< V > > subst)
 The composition operation.
boolean orderedDomains ()
 checks that the domains of the hypercube are ordered
getDefaultUtility ()
void setDefaultUtility (U utility)
void setInfeasibleUtility (U utility)
boolean knows (Class<?> spaceClass)
String getName ()
void setName (String name)
String getRelationName ()
void setRelationName (String name)
String getOwner ()
void setOwner (String owner)
 Sets the owner.
Public Member Functions inherited from frodo2.solutionSpaces.BasicUtilitySolutionSpace< V, UL >
BasicUtilitySolutionSpace< V, U > clone ()
BasicUtilitySolutionSpace< V, U > resolve ()
String prettyPrint (U ignoredUtil)
 A human-friendly version of toString().
getUtility (V[] variables_values)
 Returns an object representing the utility value corresponding to the provided variables values representing a solution.
Class< U > getClassOfU ()
boolean setUtility (V[] variables_values, U utility)
 Sets the utility value corresponding to a given assignment to variables.
void setDefaultUtility (U utility)
 Sets the default utility value.
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 > compose (String[] vars, BasicUtilitySolutionSpace< V, ArrayList< V > > substitution)
 Substitutes some of the variables in this utility space with functions.
SparseIterator< V, U > sparseIter ()
Iterator< V, U > iterator ()

Protected Member Functions

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)
Protected Member Functions inherited from frodo2.solutionSpaces.hypercube.BasicHypercube< V, UL >
void writeUtilities (ObjectOutput out) throws IOException
 Serializes the utilities.
void readUtilities (ObjectInput in) throws ClassNotFoundException, IOException, InvocationTargetException, NoSuchMethodException
 Deserializes the utilities.
void setNumberOfSolutions (int new_number_of_utilities)
 Modifies the number of utility values in the hypercube (in case the utility array is bigger then the actual number of elements).
void incrNCCCs (long incr)
 Increments the number of constraint checks.
int getIndexOfUtilityValue (V[] variables_values)
 Returns the index of the utility value corresponding to the provided variables values.
Iterator< V, U > newIter (String[] variables, V[][] domains, V[] assignment, final U skippedUtil)
 Creates a new iterator for this space.
BasicHypercube< V, U > newInstance (String name, String[] new_variables, V[][] new_domains, U[] new_values, U infeasibleUtil)
 Creates a new instance of a BasicHypercube.
BasicHypercube< V, U > scalarHypercube (U utility)
 Creates a new instance of a ScalarBasicHypercube.
boolean contains (String[] variables_names)
 Checks if this hypercube contains the provided variables.
boolean notEmptyDomains (V[][] domains)
 Checks that there is no empty domain in an array of domains.
boolean consistentOrder (BasicHypercube< V, U >[] hypercubes)
 Checks that the variables order is consistent in all hypercubes.

Additional Inherited Members

Static Public Member Functions inherited from frodo2.solutionSpaces.hypercube.BasicHypercube< V, UL >
static< T > T[] sub (T[] array1, T[] array2)
 Computes the subtraction of two arrays.
static< V extends Addable< V > V[] intersection (V[] array1, V[] array2)
 Computes the intersection between two arrays.
Protected Attributes inherited from frodo2.solutionSpaces.hypercube.BasicHypercube< V, UL >
String[] variables
 The names of the variables of the hypercube ordered according to their order in the hypercube.
V[][] domains
 The domains of the variables of the hypercube.
transient Class< V > classOfV
 The class of V.
transient V[] assignment
 An array of size variables.length that can be reused, instead of creating a new array each time we need one.
U[] values
 The utility values.
ProblemInterface< V, ?> problem
 The problem that should be notified of constraint checks.
int number_of_utility_values
 The actual number of utilities values in the array.
transient HashMap< V, Integer >[] steps_hashmaps
 For each variable, a hashmap that maps every value in the domain of this variable to a step in the utility values array.
String name
 The name of this space, if any.
infeasibleUtil
 -INF if we are maximizing, +INF if we are minimizing
Package Functions inherited from frodo2.solutionSpaces.hypercube.BasicHypercube< V, UL >
void setStepsHashmaps ()
 Based on the hypercube parameters this method fills the steps Hashmap that maps each variable of the hypercube to another Hashmaps that maps each possible value of this variable to a step in the utility values array.
Static Package Functions inherited from frodo2.solutionSpaces.hypercube.BasicHypercube< V, UL >
 [static initializer]

Detailed Description

A Hypercube whose utilities are AddableLimited's.

Author
Thomas Leaute, Eric Zbinden
Parameters
<V>the type used for variable values
<U>the type used for Addable utilities
<UL>the type used for AddableLimited utilities

Constructor & Destructor Documentation

◆ HypercubeLimited() [1/4]

frodo2.solutionSpaces.hypercube.HypercubeLimited< V extends Addable< V >, U extends Addable< U >, UL extends AddableLimited< U, UL >.HypercubeLimited ( )

Empty constructor.

Referenced by clone(), newInstance(), resolve(), resolve(), scalarHypercube(), and slice().

◆ HypercubeLimited() [2/4]

frodo2.solutionSpaces.hypercube.HypercubeLimited< V extends Addable< V >, U extends Addable< U >, UL extends AddableLimited< U, UL >.HypercubeLimited ( String[] variablesOrder,
V variablesDomains[][],
UL[] utilityValues,
UL infeasibleUtil )

Constructor.

Parameters
variablesOrderthe array containing the variables names ordered according to their order in the hypercube
variablesDomainsthe domains of the variables contained in the variables_order array and ordered in the same order.
utilityValuesthe 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

References frodo2.solutionSpaces.hypercube.BasicHypercube< V, UL >.infeasibleUtil.

◆ HypercubeLimited() [3/4]

frodo2.solutionSpaces.hypercube.HypercubeLimited< V extends Addable< V >, U extends Addable< U >, UL extends AddableLimited< U, UL >.HypercubeLimited ( String name,
String[] variablesOrder,
V variablesDomains[][],
UL[] utilityValues,
UL infeasibleUtil )

Constructor.

Parameters
namethe name of this HypercubeLimited
variablesOrderthe array containing the variables names ordered according to their order in the hypercube
variablesDomainsthe domains of the variables contained in the variables_order array and ordered in the same order.
utilityValuesthe 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

References frodo2.solutionSpaces.hypercube.BasicHypercube< V, UL >.infeasibleUtil, and frodo2.solutionSpaces.hypercube.BasicHypercube< V, UL >.name.

◆ HypercubeLimited() [4/4]

frodo2.solutionSpaces.hypercube.HypercubeLimited< V extends Addable< V >, U extends Addable< U >, UL extends AddableLimited< U, UL >.HypercubeLimited ( String[] variablesOrder,
V variablesDomains[][],
UL[] utilityValues,
UL infeasibleUtil,
ProblemInterface< V, U > problem )

Constructor.

Parameters
variablesOrderthe array containing the variables names ordered according to their order in the hypercube
variablesDomainsthe domains of the variables contained in the variables_order array and ordered in the same order.
utilityValuesthe 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

References frodo2.solutionSpaces.hypercube.BasicHypercube< V, UL >.infeasibleUtil, and frodo2.solutionSpaces.hypercube.BasicHypercube< V, UL >.problem.

Member Function Documentation

◆ blindProject() [1/2]

◆ blindProject() [2/2]

◆ blindProjectAll()

◆ clone()

HypercubeLimited< V, U, UL > frodo2.solutionSpaces.hypercube.HypercubeLimited< V extends Addable< V >, U extends Addable< U >, UL extends AddableLimited< U, UL >.clone ( )
See also
BasicHypercube.clone()

References clone(), and HypercubeLimited().

Referenced by blindProject(), and clone().

Here is the call graph for this function:

◆ join() [1/2]

UtilitySolutionSpaceLimited< V, U, UL > frodo2.solutionSpaces.hypercube.HypercubeLimited< V extends Addable< V >, U extends Addable< U >, UL extends AddableLimited< U, UL >.join ( UtilitySolutionSpace< V, U > space)
See also
UtilitySolutionSpaceLimited#join(UtilitySolutionSpace)

Implements frodo2.solutionSpaces.UtilitySolutionSpaceLimited< V extends Addable< V >, U extends Addable< U >, UL extends AddableLimited< U, UL >.

References join().

Referenced by join(), join(), and joinMinNCCCs().

Here is the call graph for this function:

◆ join() [2/2]

◆ joinMinNCCCs()

UtilitySolutionSpaceLimited< V, U, UL > frodo2.solutionSpaces.hypercube.HypercubeLimited< V extends Addable< V >, U extends Addable< U >, UL extends AddableLimited< U, UL >.joinMinNCCCs ( UtilitySolutionSpace< V, U > space)
See also
UtilitySolutionSpaceLimited#joinMinNCCCs(UtilitySolutionSpace)

Implements frodo2.solutionSpaces.UtilitySolutionSpaceLimited< V extends Addable< V >, U extends Addable< U >, UL extends AddableLimited< U, UL >.

References join().

Here is the call graph for this function:

◆ max()

◆ min()

◆ newInstance()

HypercubeLimited< V, U, UL > frodo2.solutionSpaces.hypercube.HypercubeLimited< V extends Addable< V >, U extends Addable< U >, UL extends AddableLimited< U, UL >.newInstance ( String name,
String[] new_variables,
V new_domains[][],
UL[] new_values,
UL infeasibleUtil )
protected
See also
BasicHypercube#newInstance(String, String[], Addable[][], Serializable[], Serializable)

References HypercubeLimited(), frodo2.solutionSpaces.hypercube.BasicHypercube< V, UL >.infeasibleUtil, and frodo2.solutionSpaces.hypercube.BasicHypercube< V, UL >.name.

Referenced by blindProject(), and join().

Here is the call graph for this function:

◆ readUtilities()

void frodo2.solutionSpaces.hypercube.HypercubeLimited< V extends Addable< V >, U extends Addable< U >, UL extends AddableLimited< U, UL >.readUtilities ( ObjectInput in) throws ClassNotFoundException, IOException, InvocationTargetException, NoSuchMethodException
protected

◆ resolve() [1/2]

◆ resolve() [2/2]

◆ scalarHypercube()

HypercubeLimited< V, U, UL > frodo2.solutionSpaces.hypercube.HypercubeLimited< V extends Addable< V >, U extends Addable< U >, UL extends AddableLimited< U, UL >.scalarHypercube ( UL utility)
protected
See also
BasicHypercube#scalarHypercube(Serializable)

References frodo2.solutionSpaces.hypercube.BasicHypercube< V, UL >.assignment, HypercubeLimited(), and frodo2.solutionSpaces.hypercube.BasicHypercube< V, UL >.infeasibleUtil.

Referenced by blindProject().

Here is the call graph for this function:

◆ slice()

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

Implements frodo2.solutionSpaces.UtilitySolutionSpaceLimited< V extends Addable< V >, U extends Addable< U >, UL extends AddableLimited< U, UL >.

References HypercubeLimited(), and slice().

Referenced by slice().

Here is the call graph for this function:

◆ writeUtilities()


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