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

A BasicHypercube that contains only one utility, and no variables. More...

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

Public Member Functions

 ScalarBasicHypercube ()
 Empty constructor.
 ScalarBasicHypercube (U utility, U infeasibleUtil)
 Constructor.
void writeExternal (ObjectOutput out) throws IOException
void readExternal (ObjectInput in) throws IOException, ClassNotFoundException
long getNumberOfSolutions ()
 Always returns 1.
getUtility (V[] variables_values)
 Ignores the input and always returns the utility of this scalar hypercube.
getUtility (String[] variables_names, V[] variables_values)
 Ignores the inputs and always returns the utility of this scalar hypercube.
getUtility (long index)
 Always returns the single utility value of this scalar hypercube.
Class< U > getClassOfU ()
boolean setUtility (V[] variables_values, U utility)
 Ignores variables_values, and sets its single utility to utility.
void setUtility (long index, U utility)
 Ignores index and sets this scalar hypercube's utility to utility.
String[] getVariables ()
 Returns the names of the variables of the hypercube.
int getNumberOfVariables ()
 Always returns 0.
String getVariable (int index)
 Always returns null.
void renameVariable (String oldName, String newName)
 Does nothing.
BasicHypercube< V, U > renameAllVars (String[] newVarNames)
int getIndex (String variable)
 Always returns -1.
V[][] getDomains ()
 Always returns null.
V[] getDomain (String variable)
 Always returns null.
V[] getDomain (int index)
 Always returns null.
V[] getDomain (String variable, int index)
 Always returns null.
void setDomain (String var, V[] dom)
 Does nothing.
String toString ()
String prettyPrint (U unused)
void augment (V[] variables_values)
void augment (V[] variables_values, U utility_value)
ScalarBasicHypercube< V, U > changeVariablesOrder (String[] variables_order)
 Returns a clone.
boolean equivalent (BasicUtilitySolutionSpace< V, U > space)
Iterator< V, U > iterator ()
Iterator< V, U > iterator (String[] variables)
Iterator< V, U > iterator (String[] variables, V[][] domains, V[] assignment)
SparseIterator< V, U > sparseIter ()
SparseIterator< V, U > sparseIter (String[] variables)
SparseIterator< V, U > sparseIter (String[] variables, V[][] domains, V[] assignment)
boolean isIncludedIn (BasicUtilitySolutionSpace< V, U > space)
SolutionSpace< V > join (SolutionSpace< V > space, String[] total_variables)
SolutionSpace< V > join (SolutionSpace< V > space)
 Computes the join of this solutionSpace with the input solutionSpace.
SolutionSpace< V > join (SolutionSpace< V >[] spaces, String[] total_variables_order)
 Returns a SolutionSpace object obtained by joining the SolutionSpace for which this method is called and the SolutionSpaces present in the array of SolutionSpaces given to this method as a parameter.
BasicUtilitySolutionSpace< V, U > slice (String var, V val)
 Slices this hypercube over a single variable-value assignment.
ScalarBasicHypercube< V, U > slice (String[] variables_names, V[][] sub_domains)
 Returns a clone.
BasicUtilitySolutionSpace< V, U > slice (V[] variables_values)
 Return a slice of this hypercube.
BasicHypercube< V, U > compose (String[] vars, BasicUtilitySolutionSpace< V, ArrayList< V > > substitution)
 Returns a constant hypercube.
boolean equals (Object o)
ScalarBasicHypercube< V, U > clone ()
getDefaultUtility ()
void setDefaultUtility (U utility)
Public Member Functions inherited from frodo2.solutionSpaces.hypercube.BasicHypercube< V, U >
 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.

Package Functions

void setStepsHashmaps ()
 Does nothing.
Package Functions inherited from frodo2.solutionSpaces.hypercube.BasicHypercube< V, U >
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.

Private Attributes

utility
 The utility of this scalar hypercube.

Additional Inherited Members

Static Public Member Functions inherited from frodo2.solutionSpaces.hypercube.BasicHypercube< V, U >
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 Member Functions inherited from frodo2.solutionSpaces.hypercube.BasicHypercube< V, U >
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.
Protected Attributes inherited from frodo2.solutionSpaces.hypercube.BasicHypercube< V, U >
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
Static Package Functions inherited from frodo2.solutionSpaces.hypercube.BasicHypercube< V, U >
 [static initializer]

Detailed Description

A BasicHypercube that contains only one utility, and no variables.

Author
Thomas Leaute
Parameters
<V>the type used for the variable values
<U>the type used for the utility values
Todo
Test this class

Constructor & Destructor Documentation

◆ ScalarBasicHypercube() [1/2]

Empty constructor.

Referenced by changeVariablesOrder(), clone(), equals(), and slice().

◆ ScalarBasicHypercube() [2/2]

frodo2.solutionSpaces.hypercube.ScalarBasicHypercube< V extends Addable< V >, U extends Serializable >.ScalarBasicHypercube ( U utility,
U infeasibleUtil )

Constructor.

Parameters
utilitythe utility of the scalar hypercube
infeasibleUtil-INF if we are maximizing, +INF if we are minimizing

References frodo2.solutionSpaces.hypercube.BasicHypercube< V, U >.infeasibleUtil, and utility.

Member Function Documentation

◆ augment() [1/2]

void frodo2.solutionSpaces.hypercube.ScalarBasicHypercube< V extends Addable< V >, U extends Serializable >.augment ( V[] variables_values)
See also
BasicHypercube#augment(Addable[])
Todo
Auto-generated method stub

◆ augment() [2/2]

void frodo2.solutionSpaces.hypercube.ScalarBasicHypercube< V extends Addable< V >, U extends Serializable >.augment ( V[] variables_values,
U utility_value )
See also
BasicHypercube.augment(Addable[], java.io.Serializable)
Todo
Auto-generated method stub

◆ changeVariablesOrder()

ScalarBasicHypercube< V, U > frodo2.solutionSpaces.hypercube.ScalarBasicHypercube< V extends Addable< V >, U extends Serializable >.changeVariablesOrder ( String[] variables_order)

Returns a clone.

See also
BasicHypercube.changeVariablesOrder(java.lang.String[])

References clone(), and ScalarBasicHypercube().

Here is the call graph for this function:

◆ clone()

◆ compose()

◆ equals()

boolean frodo2.solutionSpaces.hypercube.ScalarBasicHypercube< V extends Addable< V >, U extends Serializable >.equals ( Object o)
See also
BasicHypercube.equals(java.lang.Object)

References getUtility(), frodo2.solutionSpaces.hypercube.BasicHypercube< V, U >.incrNCCCs(), ScalarBasicHypercube(), and utility.

Referenced by equivalent().

Here is the call graph for this function:

◆ equivalent()

boolean frodo2.solutionSpaces.hypercube.ScalarBasicHypercube< V extends Addable< V >, U extends Serializable >.equivalent ( BasicUtilitySolutionSpace< V, U > space)
See also
BasicHypercube#equivalent(BasicUtilitySolutionSpace)

References equals().

Here is the call graph for this function:

◆ getClassOfU()

Class< U > frodo2.solutionSpaces.hypercube.ScalarBasicHypercube< V extends Addable< V >, U extends Serializable >.getClassOfU ( )

◆ getDefaultUtility()

U frodo2.solutionSpaces.hypercube.ScalarBasicHypercube< V extends Addable< V >, U extends Serializable >.getDefaultUtility ( )
See also
BasicHypercube.getDefaultUtility()
Todo
Auto-generated method stub

◆ getDomain() [1/3]

V[] frodo2.solutionSpaces.hypercube.ScalarBasicHypercube< V extends Addable< V >, U extends Serializable >.getDomain ( int index)

Always returns null.

See also
BasicHypercube.getDomain(int)

◆ getDomain() [2/3]

V[] frodo2.solutionSpaces.hypercube.ScalarBasicHypercube< V extends Addable< V >, U extends Serializable >.getDomain ( String variable)

Always returns null.

See also
BasicHypercube.getDomain(java.lang.String)

◆ getDomain() [3/3]

V[] frodo2.solutionSpaces.hypercube.ScalarBasicHypercube< V extends Addable< V >, U extends Serializable >.getDomain ( String variable,
int index )

Always returns null.

See also
BasicHypercube.getDomain(java.lang.String, int)

◆ getDomains()

V[][] frodo2.solutionSpaces.hypercube.ScalarBasicHypercube< V extends Addable< V >, U extends Serializable >.getDomains ( )

Always returns null.

See also
BasicHypercube.getDomains()

◆ getIndex()

int frodo2.solutionSpaces.hypercube.ScalarBasicHypercube< V extends Addable< V >, U extends Serializable >.getIndex ( String variable)

Always returns -1.

See also
BasicHypercube.getIndex(java.lang.String)

◆ getNumberOfSolutions()

long frodo2.solutionSpaces.hypercube.ScalarBasicHypercube< V extends Addable< V >, U extends Serializable >.getNumberOfSolutions ( )

Always returns 1.

See also
BasicHypercube.getNumberOfSolutions()

◆ getNumberOfVariables()

int frodo2.solutionSpaces.hypercube.ScalarBasicHypercube< V extends Addable< V >, U extends Serializable >.getNumberOfVariables ( )

Always returns 0.

See also
BasicHypercube.getNumberOfVariables()

◆ getUtility() [1/3]

U frodo2.solutionSpaces.hypercube.ScalarBasicHypercube< V extends Addable< V >, U extends Serializable >.getUtility ( long index)

Always returns the single utility value of this scalar hypercube.

See also
BasicHypercube.getUtility(long)

References frodo2.solutionSpaces.hypercube.BasicHypercube< V, U >.incrNCCCs().

Here is the call graph for this function:

◆ getUtility() [2/3]

U frodo2.solutionSpaces.hypercube.ScalarBasicHypercube< V extends Addable< V >, U extends Serializable >.getUtility ( String[] variables_names,
V[] variables_values )

Ignores the inputs and always returns the utility of this scalar hypercube.

See also
BasicHypercube.getUtility(java.lang.String[], Addable[])

References frodo2.solutionSpaces.hypercube.BasicHypercube< V, U >.incrNCCCs().

Here is the call graph for this function:

◆ getUtility() [3/3]

U frodo2.solutionSpaces.hypercube.ScalarBasicHypercube< V extends Addable< V >, U extends Serializable >.getUtility ( V[] variables_values)

Ignores the input and always returns the utility of this scalar hypercube.

See also
BasicHypercube#getUtility(Addable[])

References frodo2.solutionSpaces.hypercube.BasicHypercube< V, U >.incrNCCCs().

Referenced by equals().

Here is the call graph for this function:

◆ getVariable()

String frodo2.solutionSpaces.hypercube.ScalarBasicHypercube< V extends Addable< V >, U extends Serializable >.getVariable ( int index)

Always returns null.

See also
BasicHypercube.getVariable(int)

◆ getVariables()

String[] frodo2.solutionSpaces.hypercube.ScalarBasicHypercube< V extends Addable< V >, U extends Serializable >.getVariables ( )

Returns the names of the variables of the hypercube.

Returns
String array containing the names of the variables of the hypercube

◆ isIncludedIn()

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

◆ iterator() [1/3]

◆ iterator() [2/3]

◆ iterator() [3/3]

◆ join() [1/3]

SolutionSpace< V > frodo2.solutionSpaces.hypercube.ScalarBasicHypercube< V extends Addable< V >, U extends Serializable >.join ( SolutionSpace< V > space)

Computes the join of this solutionSpace with the input solutionSpace.

Order of variables is chosen as it fits.

Todo
Auto-generated method stub

◆ join() [2/3]

SolutionSpace< V > frodo2.solutionSpaces.hypercube.ScalarBasicHypercube< V extends Addable< V >, U extends Serializable >.join ( SolutionSpace< V > space,
String[] total_variables )
See also
BasicHypercube.join(SolutionSpace, java.lang.String[])
Todo
Auto-generated method stub

◆ join() [3/3]

SolutionSpace< V > frodo2.solutionSpaces.hypercube.ScalarBasicHypercube< V extends Addable< V >, U extends Serializable >.join ( SolutionSpace< V >[] spaces,
String[] total_variables_order )

Returns a SolutionSpace object obtained by joining the SolutionSpace for which this method is called and the SolutionSpaces present in the array of SolutionSpaces given to this method as a parameter.

Parameters
spacesan array of the solutionSpaces to be added to this solutionSpace
total_variables_orderthe order of the variables in all solutionSpaces
Returns
SolutionSpace object obtained by joining this SolutionSpace with all the SolutionSpaces in the array of SolutionSpaces Originally this function in the hypercubes assumes that order is not conflicting.
Todo
Auto-generated method stub

◆ prettyPrint()

String frodo2.solutionSpaces.hypercube.ScalarBasicHypercube< V extends Addable< V >, U extends Serializable >.prettyPrint ( U unused)
See also
BasicHypercube.prettyPrint(java.io.Serializable)

References toString().

Here is the call graph for this function:

◆ readExternal()

void frodo2.solutionSpaces.hypercube.ScalarBasicHypercube< V extends Addable< V >, U extends Serializable >.readExternal ( ObjectInput in) throws IOException, ClassNotFoundException
See also
java.io.Externalizable#readExternal(java.io.ObjectInput)

References readExternal().

Referenced by readExternal().

Here is the call graph for this function:

◆ renameAllVars()

BasicHypercube< V, U > frodo2.solutionSpaces.hypercube.ScalarBasicHypercube< V extends Addable< V >, U extends Serializable >.renameAllVars ( String[] newVarNames)

◆ renameVariable()

void frodo2.solutionSpaces.hypercube.ScalarBasicHypercube< V extends Addable< V >, U extends Serializable >.renameVariable ( String oldName,
String newName )

◆ setDefaultUtility()

void frodo2.solutionSpaces.hypercube.ScalarBasicHypercube< V extends Addable< V >, U extends Serializable >.setDefaultUtility ( U utility)
See also
BasicHypercube.setDefaultUtility(java.io.Serializable)
Todo
Auto-generated method stub

References utility.

◆ setDomain()

void frodo2.solutionSpaces.hypercube.ScalarBasicHypercube< V extends Addable< V >, U extends Serializable >.setDomain ( String var,
V[] dom )

Does nothing.

See also
BasicHypercube#setDomain(String, Addable[])

◆ setStepsHashmaps()

void frodo2.solutionSpaces.hypercube.ScalarBasicHypercube< V extends Addable< V >, U extends Serializable >.setStepsHashmaps ( )
package

Does nothing.

See also
BasicHypercube.setStepsHashmaps()

◆ setUtility() [1/2]

void frodo2.solutionSpaces.hypercube.ScalarBasicHypercube< V extends Addable< V >, U extends Serializable >.setUtility ( long index,
U utility )

Ignores index and sets this scalar hypercube's utility to utility.

See also
BasicHypercube.setUtility(long, java.io.Serializable)

References utility.

◆ setUtility() [2/2]

boolean frodo2.solutionSpaces.hypercube.ScalarBasicHypercube< V extends Addable< V >, U extends Serializable >.setUtility ( V[] variables_values,
U utility )

Ignores variables_values, and sets its single utility to utility.

See also
BasicHypercube.setUtility(Addable[], java.io.Serializable)

References utility.

◆ slice() [1/3]

BasicUtilitySolutionSpace< V, U > frodo2.solutionSpaces.hypercube.ScalarBasicHypercube< V extends Addable< V >, U extends Serializable >.slice ( String var,
V val )

Slices this hypercube over a single variable-value assignment.

Parameters
varthe variable to be assigned a value
valthe value to assign to the variable
Returns
the hypercube resulting from this slice
Todo
implement it

◆ slice() [2/3]

ScalarBasicHypercube< V, U > frodo2.solutionSpaces.hypercube.ScalarBasicHypercube< V extends Addable< V >, U extends Serializable >.slice ( String[] variables_names,
V sub_domains[][] )

Returns a clone.

See also
BasicHypercube.slice(java.lang.String[], Addable[][])

References clone(), and ScalarBasicHypercube().

Here is the call graph for this function:

◆ slice() [3/3]

BasicUtilitySolutionSpace< V, U > frodo2.solutionSpaces.hypercube.ScalarBasicHypercube< V extends Addable< V >, U extends Serializable >.slice ( V[] variables_values)

Return a slice of this hypercube.

Parameters
variables_valuesarray containing values of the last variables of the hypercube
Returns
Hypercube object obtained by associating fixed values to the last variables of the hypercube. the number of this variables depends on the length of the provided array of variables values
Todo
implement it.

◆ sparseIter() [1/3]

SparseIterator< V, U > frodo2.solutionSpaces.hypercube.ScalarBasicHypercube< V extends Addable< V >, U extends Serializable >.sparseIter ( )

◆ sparseIter() [2/3]

◆ sparseIter() [3/3]

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

◆ toString()

String frodo2.solutionSpaces.hypercube.ScalarBasicHypercube< V extends Addable< V >, U extends Serializable >.toString ( )
See also
BasicHypercube.toString()

References utility.

Referenced by prettyPrint().

◆ writeExternal()

void frodo2.solutionSpaces.hypercube.ScalarBasicHypercube< V extends Addable< V >, U extends Serializable >.writeExternal ( ObjectOutput out) throws IOException
See also
java.io.Externalizable#writeExternal(java.io.ObjectOutput)

References frodo2.solutionSpaces.hypercube.BasicHypercube< V, U >.incrNCCCs(), frodo2.solutionSpaces.hypercube.BasicHypercube< V, U >.infeasibleUtil, and frodo2.solutionSpaces.hypercube.BasicHypercube< V, U >.name.

Here is the call graph for this function:

Member Data Documentation

◆ utility

U frodo2.solutionSpaces.hypercube.ScalarBasicHypercube< V extends Addable< V >, U extends Serializable >.utility
private

The utility of this scalar hypercube.

Referenced by equals(), ScalarBasicHypercube(), setDefaultUtility(), setUtility(), setUtility(), and toString().


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