|
FRODO Version 2.19.1
An open-source framework for Distributed Constraint Optimization (DCOP)
|
A basic hypercube that stores one utility per combination of assigments to variables. More...

Public Member Functions | |
| 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. | |
| BasicHypercube (String name, 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. | |
| BasicHypercube (String[] variables_order, V[][] variables_domains, U[] utility_values, U infeasibleUtil, ProblemInterface< V, ?> problem) | |
| Construct a new BasicHypercube with provided variables names, the domains of these variables and the utility values. | |
| BasicHypercube () | |
| Empty constructor that does nothing. | |
| 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. | |
| U | getUtility (V[] variables_values) |
| U | getUtility (String[] variables_names, V[] variables_values) |
| U | getUtility (Map< String, V > assignments) |
| U | getUtilityValueSameOrder (String[] variables_names, V[] variables_values) |
| Returns an object representing the utility value corresponding to the provided variables values. | |
| U | getUtility (long 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) |
| 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. | |
| V[] | getDomain (int index) |
| Returns the domain of the variable that corresponds to the provided index. | |
| V[] | getDomain (String variable, int index) |
Returns the variable's domain if index is the variables index in the array of variables order. | |
| 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 () |
| Iterator< V, U > | iterator (String[] order) |
| SparseIterator< V, U > | sparseIter (String[] order) |
| Iterator< V, U > | iterator (String[] variables, V[][] domains) |
| SparseIterator< V, U > | sparseIter (String[] variables, V[][] domains) |
| Iterator< V, U > | iterator (String[] variables, V[][] domains, V[] assignment) |
| SparseIterator< V, U > | sparseIter (String[] variables, V[][] domains, V[] assignment) |
| void | augment (V[] variables_values) |
| SolutionSpace< V > | join (SolutionSpace< V > space, String[] total_variables) |
| SolutionSpace< V > | join (SolutionSpace< V > space) |
| 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. | |
| SolutionSpace< V > | join (SolutionSpace< V >[] spaces) |
| 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 () |
| BasicHypercube< V, U > | resolve (boolean unused) |
| BasicUtilitySolutionSpace< V, U > | slice (String[] variables_names, V[] values) |
| BasicUtilitySolutionSpace< V, U > | slice (String var, V[] subDomain) |
| BasicUtilitySolutionSpace< V, U > | slice (String var, V val) |
| Slices this hypercube over a single variable-value assignment. | |
| BasicUtilitySolutionSpace< V, U > | slice (V[] variables_values) |
| Return a slice of this hypercube. | |
| 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 | |
| U | 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.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 () |
Static Public Member Functions | |
| 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 | |
| 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. | |
| SparseIterator< V, U > | sparseIter (U inf) |
| Creates a sparse iterator that skips a specific utility. | |
| Iterator< V, U > | newIter (String[] variables, V[][] domains, V[] assignment, final U skippedUtil) |
| Creates a new iterator for this space. | |
| BasicHypercube< V, U > | slice (String[] remainingVars, V[][] remainingDoms, V[][] iterDoms, long nbrRemainingUtils, Class<?> domClass) |
| Slice method used internally. | |
| 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 | contains (String[] variables_names, V[][] variables_domains) |
| If any of the input variables is in this hypercube, check that the corresponding input domain is a subset of this variable's domain. | |
| 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. | |
| boolean | consistentOrder (String[] variables1) |
| Checks that input variable order is consistent with the order in this hypercube. | |
Protected Attributes | |
| 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. | |
| U | infeasibleUtil |
| -INF if we are maximizing, +INF if we are minimizing | |
Package Functions | |
| 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. | |
| void | setStepsHashmaps (String[] variables2, V[][] domains2, int number_of_utility_values2) |
| Fills the step hashMap of the hypercube. | |
Static Package Functions | |
| [static initializer] | |
Private Member Functions | |
| U | getUtilityNoNCCCs (V[] variables_values) |
| Returns the utility of the input assignment, without incrementing the NCCC counter. | |
| void | fillVariablesValues (V[] variables_values, int index, int[] steps) |
| Computes the variable assignments corresponding to a given utility value. | |
| Iterator< V, U > | iterator (String[] variables, V[][] domains, V[] assignment, final U skippedUtil) |
| Returns an iterator. | |
Private Attributes | |
| String | relationName = "" |
| The name of the underlying relation. | |
| String | owner = null |
| The owner of this space. | |
Static Private Attributes | |
| static int | lastID = -1 |
| The last ID used to instantiate a BasicHypercube. | |
| static HashSet< Class<?> > | knownSpaces |
| The types of spaces that we know how to handle. | |
A basic hypercube that stores one utility per combination of assigments to variables.
The difference with its subclass Hypercube is that a BasicHypercube can contain utilities that are not Addable. The consequence is that BasicHypercube does not provide any method that requires adding or comparing utilities.
| <V> | the type used for variable values |
| <U> | the type used for utility values |
| frodo2.solutionSpaces.hypercube.BasicHypercube< V extends Addable< V >, U extends Serializable >.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.
| variables_order | the array containing the variables names ordered according to their order in the hypercube |
| variables_domains | the domains of the variables contained in the variables_order array and ordered in the same order. |
| utility_values | the 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 infeasibleUtil.
Referenced by [static initializer](), applyAugment(), applySlice(), BasicHypercube(), changeVariablesOrder(), clone(), consistentOrder(), newInstance(), renameAllVars(), resolve(), resolve(), scalarHypercube(), slice(), and slice().
| frodo2.solutionSpaces.hypercube.BasicHypercube< V extends Addable< V >, U extends Serializable >.BasicHypercube | ( | String | name, |
| 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.
| name | the name of the BasicHypercube |
| variables_order | the array containing the variables names ordered according to their order in the hypercube |
| variables_domains | the domains of the variables contained in the variables_order array and ordered in the same order. |
| utility_values | the 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 infeasibleUtil, and name.
| frodo2.solutionSpaces.hypercube.BasicHypercube< V extends Addable< V >, U extends Serializable >.BasicHypercube | ( | String[] | variables_order, |
| V | variables_domains[][], | ||
| U[] | utility_values, | ||
| U | infeasibleUtil, | ||
| ProblemInterface< V, ?> | problem ) |
Construct a new BasicHypercube with provided variables names, the domains of these variables and the utility values.
| variables_order | the array containing the variables names ordered according to their order in the hypercube |
| variables_domains | the domains of the variables contained in the variables_order array and ordered in the same order. |
| utility_values | the 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 |
| problem | the problem to be notified of constraint checks |
References BasicHypercube(), infeasibleUtil, lastID, problem, setStepsHashmaps(), and values.

| frodo2.solutionSpaces.hypercube.BasicHypercube< V extends Addable< V >, U extends Serializable >.BasicHypercube | ( | ) |
Empty constructor that does nothing.
|
staticpackage |
| BasicHypercube< V, U > frodo2.solutionSpaces.hypercube.BasicHypercube< V extends Addable< V >, U extends Serializable >.applyAugment | ( | String[] | new_variables, |
| V | new_domains[][] ) |
Augments the hypercube by adding new variables at the beginning of its variables list.
| new_variables | new variables to augment the hypercube |
| new_domains | domains of the new variables |
References applyAugment(), BasicHypercube(), domains, number_of_utility_values, values, and variables.
Referenced by applyAugment().

| void frodo2.solutionSpaces.hypercube.BasicHypercube< V extends Addable< V >, U extends Serializable >.applyChangeVariablesOrder | ( | String[] | variables_order | ) |
Changes the variable order of the hypercube by reordering the current utility array.
| variables_order | the new variables order |
already_reordered.remove(i)
References applyChangeVariablesOrder(), domains, fillVariablesValues(), getIndexOfUtilityValue(), number_of_utility_values, setStepsHashmaps(), steps_hashmaps, sub(), values, and variables.
Referenced by applyChangeVariablesOrder().

| BasicHypercube< V, U > frodo2.solutionSpaces.hypercube.BasicHypercube< V extends Addable< V >, U extends Serializable >.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.
| variables_names | the variables to slice |
| sub_domains | the domains of the slice |
References applySlice(), BasicHypercube(), consistentOrder(), contains(), domains, equals(), getIndexOfUtilityValue(), getUtility(), notEmptyDomains(), scalarHypercube(), setNumberOfSolutions(), setStepsHashmaps(), values, and variables.
Referenced by applySlice().

| void frodo2.solutionSpaces.hypercube.BasicHypercube< V extends Addable< V >, U extends Serializable >.augment | ( | V[] | variables_values | ) |
| void frodo2.solutionSpaces.hypercube.BasicHypercube< V extends Addable< V >, U extends Serializable >.augment | ( | V[] | variables_values, |
| U | utility_value ) |
Implements frodo2.solutionSpaces.BasicUtilitySolutionSpace< V extends Addable< V >, U extends Serializable >.
| BasicHypercube< V, U > frodo2.solutionSpaces.hypercube.BasicHypercube< V extends Addable< V >, U extends Serializable >.changeVariablesOrder | ( | String[] | variables_order | ) |
Return a new BasicHypercube by changing the order of the variables of the hypercube.
| variables_order | the new order of the variables |
Implements frodo2.solutionSpaces.BasicUtilitySolutionSpace< V extends Addable< V >, U extends Serializable >.
References BasicHypercube(), changeVariablesOrder(), domains, getUtilityNoNCCCs(), newInstance(), number_of_utility_values, sub(), and variables.
Referenced by changeVariablesOrder(), and frodo2.solutionSpaces.hypercube.tests.HypercubeTest.testCompose().

| BasicHypercube< V, U > frodo2.solutionSpaces.hypercube.BasicHypercube< V extends Addable< V >, U extends Serializable >.clone | ( | ) |
Implements frodo2.solutionSpaces.BasicUtilitySolutionSpace< V extends Addable< V >, U extends Serializable >.
References BasicHypercube(), clone(), domains, newInstance(), values, and variables.
Referenced by clone(), and resolve().

| BasicUtilitySolutionSpace< V, U > frodo2.solutionSpaces.hypercube.BasicHypercube< V extends Addable< V >, U extends Serializable >.compose | ( | final String[] | varsOut, |
| final BasicUtilitySolutionSpace< V, ArrayList< V > > | subst ) |
The composition operation.
Implements frodo2.solutionSpaces.BasicUtilitySolutionSpace< V extends Addable< V >, U extends Serializable >.
References assignment, classOfV, compose(), getClassOfU(), getDomain(), getUtility(), getVariables(), frodo2.solutionSpaces.SolutionSpace< V extends Addable< V > >.Iterator< V >.hasNext(), newInstance(), frodo2.solutionSpaces.hypercube.Hypercube< V extends Addable< V >, U extends Addable< U > >.NullHypercube< V extends Addable< V >, U extends Addable< U > >.NULL, scalarHypercube(), and sub().
Referenced by compose().

|
protected |
Checks that the variables order is consistent in all hypercubes.
| hypercubes | space whose variables order is checked |
References BasicHypercube(), consistentOrder(), and variables.
Referenced by applySlice(), and consistentOrder().

|
protected |
Checks that input variable order is consistent with the order in this hypercube.
| variables1 | variable order |
References variables.
|
protected |
Checks if this hypercube contains the provided variables.
| variables_names | array of variables |
References variables.
Referenced by applySlice(), and slice().
|
protected |
If any of the input variables is in this hypercube, check that the corresponding input domain is a subset of this variable's domain.
| variables_names | array of variables |
| variables_domains | array of variables domains |
true iff any input variable that is contained in the hypercube has a slicing domain that is a subset of its original domain References getDomain(), and variables.

| boolean frodo2.solutionSpaces.hypercube.BasicHypercube< V extends Addable< V >, U extends Serializable >.countsCCs | ( | ) |
| boolean frodo2.solutionSpaces.hypercube.BasicHypercube< V extends Addable< V >, U extends Serializable >.equals | ( | Object | o | ) |
References equivalent(), and frodo2.solutionSpaces.SolutionSpace< V extends Addable< V > >.getVariables().
Referenced by applySlice(), getDomain(), and getIndex().

| boolean frodo2.solutionSpaces.hypercube.BasicHypercube< V extends Addable< V >, U extends Serializable >.equivalent | ( | final BasicUtilitySolutionSpace< V, U > | space | ) |
Implements frodo2.solutionSpaces.BasicUtilitySolutionSpace< V extends Addable< V >, U extends Serializable >.
References frodo2.solutionSpaces.SolutionSpace< V extends Addable< V > >.getDomain(), frodo2.solutionSpaces.SolutionSpace< V extends Addable< V > >.getNumberOfVariables(), frodo2.solutionSpaces.SolutionSpace< V extends Addable< V > >.Iterator< V >.hasNext(), frodo2.solutionSpaces.BasicUtilitySolutionSpace< V extends Addable< V >, U extends Serializable >.iterator(), iterator(), and frodo2.solutionSpaces.BasicUtilitySolutionSpace< V extends Addable< V >, U extends Serializable >.SparseIterator< V, U >.nextUtility().
Referenced by equals(), and frodo2.solutionSpaces.hypercube.tests.HypercubeTest.testCompose().

|
private |
Computes the variable assignments corresponding to a given utility value.
| variables_values | the array to be filled |
| index | index of the value in the utility array |
| steps | array storing the step for each variable |
References domains, and variables.
Referenced by applyChangeVariablesOrder().
| Class< U > frodo2.solutionSpaces.hypercube.BasicHypercube< V extends Addable< V >, U extends Serializable >.getClassOfU | ( | ) |
Implements frodo2.solutionSpaces.BasicUtilitySolutionSpace< V extends Addable< V >, U extends Serializable >.
References getClassOfU().
Referenced by compose(), and getClassOfU().

| U frodo2.solutionSpaces.hypercube.BasicHypercube< V extends Addable< V >, U extends Serializable >.getDefaultUtility | ( | ) |
Implements frodo2.solutionSpaces.BasicUtilitySolutionSpace< V extends Addable< V >, U extends Serializable >.
| V[] frodo2.solutionSpaces.hypercube.BasicHypercube< V extends Addable< V >, U extends Serializable >.getDomain | ( | int | index | ) |
| V[] frodo2.solutionSpaces.hypercube.BasicHypercube< V extends Addable< V >, U extends Serializable >.getDomain | ( | String | variable | ) |
Returns an array all the possible values that the variable provided as a parameter can take in this hypercube.
| variable | the name of the variable |
References domains, and variables.
Referenced by compose(), contains(), iterator(), and frodo2.solutionSpaces.hypercube.tests.HypercubeTest.testCompose().
| V[] frodo2.solutionSpaces.hypercube.BasicHypercube< V extends Addable< V >, U extends Serializable >.getDomain | ( | String | variable, |
| int | index ) |
Returns the variable's domain if index is the variables index in the array of variables order.
| variable | the name of the variable |
| index | the index of the variable |
References domains, equals(), and variables.

| V[][] frodo2.solutionSpaces.hypercube.BasicHypercube< V extends Addable< V >, U extends Serializable >.getDomains | ( | ) |
Returns the array containing the domains of the variables.
References domains.
Referenced by sparseIter().
| int frodo2.solutionSpaces.hypercube.BasicHypercube< V extends Addable< V >, U extends Serializable >.getIndex | ( | String | variable | ) |
Return the index of the input variable in this hypercube.
| variable | the name of the variable |
References equals(), and variables.
Referenced by renameVariable(), and setDomain().

|
protected |
Returns the index of the utility value corresponding to the provided variables values.
| variables_values | the variables values |
References steps_hashmaps, and variables.
Referenced by applyChangeVariablesOrder(), applySlice(), getUtility(), getUtilityNoNCCCs(), and setUtility().
| String frodo2.solutionSpaces.hypercube.BasicHypercube< V extends Addable< V >, U extends Serializable >.getName | ( | ) |
References name.
| long frodo2.solutionSpaces.hypercube.BasicHypercube< V extends Addable< V >, U extends Serializable >.getNumberOfSolutions | ( | ) |
Returns the number of utility values in the hypercube.
References number_of_utility_values.
| int frodo2.solutionSpaces.hypercube.BasicHypercube< V extends Addable< V >, U extends Serializable >.getNumberOfVariables | ( | ) |
Returns the number of variables in the hypercube.
References variables.
Referenced by frodo2.solutionSpaces.hypercube.ScalarBasicHypercube< V extends Addable< V >, U extends Serializable >.compose(), frodo2.solutionSpaces.hypercube.ScalarHypercube< V extends Addable< V >, U extends Addable< U > >.compose(), and frodo2.solutionSpaces.hypercube.tests.HypercubeTest.testCompose().
| String frodo2.solutionSpaces.hypercube.BasicHypercube< V extends Addable< V >, U extends Serializable >.getOwner | ( | ) |
References owner.
| String frodo2.solutionSpaces.hypercube.BasicHypercube< V extends Addable< V >, U extends Serializable >.getRelationName | ( | ) |
References relationName.
| U frodo2.solutionSpaces.hypercube.BasicHypercube< V extends Addable< V >, U extends Serializable >.getUtility | ( | long | index | ) |
Implements frodo2.solutionSpaces.BasicUtilitySolutionSpace< V extends Addable< V >, U extends Serializable >.
References incrNCCCs(), and values.

| U frodo2.solutionSpaces.hypercube.BasicHypercube< V extends Addable< V >, U extends Serializable >.getUtility | ( | Map< String, V > | assignments | ) |
null if not all variables in the space are assigned values Implements frodo2.solutionSpaces.BasicUtilitySolutionSpace< V extends Addable< V >, U extends Serializable >.
References getUtility().

| U frodo2.solutionSpaces.hypercube.BasicHypercube< V extends Addable< V >, U extends Serializable >.getUtility | ( | String[] | variables_names, |
| V[] | variables_values ) |
null if not all variables in the space are assigned values Implements frodo2.solutionSpaces.BasicUtilitySolutionSpace< V extends Addable< V >, U extends Serializable >.
References getUtility(), and variables.

| U frodo2.solutionSpaces.hypercube.BasicHypercube< V extends Addable< V >, U extends Serializable >.getUtility | ( | V[] | variables_values | ) |
Implements frodo2.solutionSpaces.BasicUtilitySolutionSpace< V extends Addable< V >, U extends Serializable >.
References getIndexOfUtilityValue(), incrNCCCs(), and values.
Referenced by applySlice(), compose(), getUtility(), getUtility(), getUtilityValueSameOrder(), slice(), frodo2.solutionSpaces.hypercube.tests.HypercubeTest.testCompose(), and frodo2.solutionSpaces.hypercube.tests.HypercubeTest.verifyProjection().

|
private |
Returns the utility of the input assignment, without incrementing the NCCC counter.
| variables_values | assignment |
References getIndexOfUtilityValue(), and values.
Referenced by changeVariablesOrder().

| U frodo2.solutionSpaces.hypercube.BasicHypercube< V extends Addable< V >, U extends Serializable >.getUtilityValueSameOrder | ( | String[] | variables_names, |
| V[] | variables_values ) |
Returns an object representing the utility value corresponding to the provided variables values.
This method assumes that the order of the variables in the input array of variables is consistent with the order used in the hypercube.
| variables_names | the names of the variables |
| variables_values | the values of the variables |
null if no utility variable was found. References getUtility(), and variables.

| String frodo2.solutionSpaces.hypercube.BasicHypercube< V extends Addable< V >, U extends Serializable >.getVariable | ( | int | index | ) |
Returns the variable corresponding to the provided index.
| index | index of the variable in this hypercube |
References variables.
| String[] frodo2.solutionSpaces.hypercube.BasicHypercube< V extends Addable< V >, U extends Serializable >.getVariables | ( | ) |
Returns the names of the variables of the hypercube.
References variables.
Referenced by compose(), sparseIter(), and frodo2.solutionSpaces.hypercube.tests.HypercubeTest.testCompose().
| int frodo2.solutionSpaces.hypercube.BasicHypercube< V extends Addable< V >, U extends Serializable >.hashCode | ( | ) |
References hashCode(), and name.
Referenced by hashCode().

|
protected |
Increments the number of constraint checks.
| incr | the increment |
References problem.
Referenced by frodo2.solutionSpaces.hypercube.BasicHypercubeIter< V extends Addable< V >, U extends Serializable >.getCurrentUtility(), getUtility(), getUtility(), frodo2.solutionSpaces.hypercube.BasicHypercubeIter< V extends Addable< V >, U extends Serializable >.nextSolution(), frodo2.solutionSpaces.hypercube.BasicHypercubeIter< V extends Addable< V >, U extends Serializable >.nextUtility(), resolve(), and writeUtilities().
|
static |
Computes the intersection between two arrays.
| <V> | the type of the entries in the arrays |
| array1 | the first array |
| array2 | the second array |
null (NOT an empty array) if the intersection is empty References intersection().
Referenced by intersection(), iterator(), and frodo2.solutionSpaces.JaCoP.JaCoPutilSpace< V extends Addable< V > >.iterator().

| boolean frodo2.solutionSpaces.hypercube.BasicHypercube< V extends Addable< V >, U extends Serializable >.isIncludedIn | ( | BasicUtilitySolutionSpace< V, U > | space | ) |
Implements frodo2.solutionSpaces.BasicUtilitySolutionSpace< V extends Addable< V >, U extends Serializable >.
| boolean frodo2.solutionSpaces.hypercube.BasicHypercube< V extends Addable< V >, U extends Serializable >.isNull | ( | ) |
Check if this hypercube is the NULL hypercube.
| Iterator< V, U > frodo2.solutionSpaces.hypercube.BasicHypercube< V extends Addable< V >, U extends Serializable >.iterator | ( | ) |
Implements frodo2.solutionSpaces.BasicUtilitySolutionSpace< V extends Addable< V >, U extends Serializable >.
References newIter().
Referenced by equivalent(), iterator(), iterator(), iterator(), slice(), sparseIter(), and sparseIter().

| Iterator< V, U > frodo2.solutionSpaces.hypercube.BasicHypercube< V extends Addable< V >, U extends Serializable >.iterator | ( | String[] | order | ) |
Implements frodo2.solutionSpaces.BasicUtilitySolutionSpace< V extends Addable< V >, U extends Serializable >.
References newIter().

| Iterator< V, U > frodo2.solutionSpaces.hypercube.BasicHypercube< V extends Addable< V >, U extends Serializable >.iterator | ( | String[] | variables, |
| V | domains[][] ) |
Implements frodo2.solutionSpaces.BasicUtilitySolutionSpace< V extends Addable< V >, U extends Serializable >.
References domains, iterator(), and variables.

| Iterator< V, U > frodo2.solutionSpaces.hypercube.BasicHypercube< V extends Addable< V >, U extends Serializable >.iterator | ( | String[] | variables, |
| V | domains[][], | ||
| V[] | assignment ) |
Implements frodo2.solutionSpaces.BasicUtilitySolutionSpace< V extends Addable< V >, U extends Serializable >.
References assignment, domains, iterator(), and variables.

|
private |
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() |
| skippedUtil | The utility value that the sparse iterator should skip (if any) |
References assignment, domains, getDomain(), intersection(), iterator(), newIter(), and variables.

| SolutionSpace< V > frodo2.solutionSpaces.hypercube.BasicHypercube< V extends Addable< V >, U extends Serializable >.join | ( | SolutionSpace< V > | space | ) |
| SolutionSpace< V > frodo2.solutionSpaces.hypercube.BasicHypercube< V extends Addable< V >, U extends Serializable >.join | ( | SolutionSpace< V > | space, |
| String[] | total_variables ) |
| SolutionSpace< V > frodo2.solutionSpaces.hypercube.BasicHypercube< V extends Addable< V >, U extends Serializable >.join | ( | SolutionSpace< V >[] | spaces | ) |
| SolutionSpace< V > frodo2.solutionSpaces.hypercube.BasicHypercube< 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.
| spaces | an array of the solutionSpaces to be added to this solutionSpace |
| total_variables_order | the order of the variables in all solutionSpaces |
| boolean frodo2.solutionSpaces.hypercube.BasicHypercube< V extends Addable< V >, U extends Serializable >.knows | ( | Class<?> | spaceClass | ) |
References knownSpaces.
|
protected |
Creates a new instance of a BasicHypercube.
| name | the name of the new BasicHypercube |
| new_variables | list of variables |
| new_domains | list of domains |
| new_values | array of utility values |
| infeasibleUtil | -INF if we are maximizing, +INF if we are minimizing |
References BasicHypercube(), infeasibleUtil, and name.
Referenced by changeVariablesOrder(), clone(), compose(), renameAllVars(), and slice().

|
protected |
Creates a new iterator for this space.
| 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() |
| skippedUtil | A utility value that should be skipped (if null, nothing is skipped) |
References assignment, domains, and variables.
Referenced by iterator(), iterator(), iterator(), sparseIter(), and sparseIter().
|
protected |
Checks that there is no empty domain in an array of domains.
| domains | array containing domains |
References domains.
Referenced by applySlice(), and slice().
| boolean frodo2.solutionSpaces.hypercube.BasicHypercube< V extends Addable< V >, U extends Serializable >.orderedDomains | ( | ) |
| String frodo2.solutionSpaces.hypercube.BasicHypercube< V extends Addable< V >, U extends Serializable >.prettyPrint | ( | U | ignoredUtil | ) |
Implements frodo2.solutionSpaces.BasicUtilitySolutionSpace< V extends Addable< V >, U extends Serializable >.
References frodo2.solutionSpaces.SolutionSpace< V extends Addable< V > >.SparseIterator< V >.getCurrentSolution(), frodo2.solutionSpaces.BasicUtilitySolutionSpace< V extends Addable< V >, U extends Serializable >.SparseIterator< V, U >.nextUtility(), and sparseIter().

| void frodo2.solutionSpaces.hypercube.BasicHypercube< V extends Addable< V >, U extends Serializable >.readExternal | ( | ObjectInput | in | ) | throws IOException, ClassNotFoundException |
References readExternal(), readUtilities(), and setStepsHashmaps().
Referenced by readExternal().

|
protected |
Deserializes the utilities.
| in | the input stream |
| ClassNotFoundException | should never happen |
| IOException | if an I/O error occurs |
| InvocationTargetException | when failing to instantiate instances of the utility class |
| NoSuchMethodException | when failing to instantiate instances of the utility class |
References readUtilities().
Referenced by readExternal(), and readUtilities().

| BasicHypercube< V, U > frodo2.solutionSpaces.hypercube.BasicHypercube< V extends Addable< V >, U extends Serializable >.renameAllVars | ( | String[] | newVarNames | ) |
References BasicHypercube(), domains, infeasibleUtil, newInstance(), setProblem(), and values.

| void frodo2.solutionSpaces.hypercube.BasicHypercube< V extends Addable< V >, U extends Serializable >.renameVariable | ( | String | oldName, |
| String | newName ) |
| BasicHypercube< V, U > frodo2.solutionSpaces.hypercube.BasicHypercube< V extends Addable< V >, U extends Serializable >.resolve | ( | ) |
Implements frodo2.solutionSpaces.BasicUtilitySolutionSpace< V extends Addable< V >, U extends Serializable >.
References BasicHypercube(), and resolve().
Referenced by resolve().

| BasicHypercube< V, U > frodo2.solutionSpaces.hypercube.BasicHypercube< V extends Addable< V >, U extends Serializable >.resolve | ( | boolean | unused | ) |
Implements frodo2.solutionSpaces.BasicUtilitySolutionSpace< V extends Addable< V >, U extends Serializable >.
References BasicHypercube(), clone(), getNumberOfSolutions(), and incrNCCCs().

|
protected |
Creates a new instance of a ScalarBasicHypercube.
| utility | the utility of the scalar hypercube |
References BasicHypercube().
Referenced by applySlice(), compose(), and slice().

| void frodo2.solutionSpaces.hypercube.BasicHypercube< V extends Addable< V >, U extends Serializable >.setDefaultUtility | ( | U | utility | ) |
Implements frodo2.solutionSpaces.BasicUtilitySolutionSpace< V extends Addable< V >, U extends Serializable >.
| void frodo2.solutionSpaces.hypercube.BasicHypercube< V extends Addable< V >, U extends Serializable >.setDomain | ( | String | var, |
| V[] | dom ) |
References getIndex().

| void frodo2.solutionSpaces.hypercube.BasicHypercube< V extends Addable< V >, U extends Serializable >.setInfeasibleUtility | ( | U | utility | ) |
Implements frodo2.solutionSpaces.BasicUtilitySolutionSpace< V extends Addable< V >, U extends Serializable >.
| void frodo2.solutionSpaces.hypercube.BasicHypercube< V extends Addable< V >, U extends Serializable >.setName | ( | String | name | ) |
References name.
|
protected |
Modifies the number of utility values in the hypercube (in case the utility array is bigger then the actual number of elements).
| new_number_of_utilities | new number of utilities of the hypercube |
References number_of_utility_values.
Referenced by applySlice().
| void frodo2.solutionSpaces.hypercube.BasicHypercube< V extends Addable< V >, U extends Serializable >.setOwner | ( | String | owner | ) |
| void frodo2.solutionSpaces.hypercube.BasicHypercube< V extends Addable< V >, U extends Serializable >.setProblem | ( | ProblemInterface< V, ?> | problem | ) |
References problem.
Referenced by renameAllVars().
| void frodo2.solutionSpaces.hypercube.BasicHypercube< V extends Addable< V >, U extends Serializable >.setRelationName | ( | String | name | ) |
References name.
|
package |
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.
References setStepsHashmaps().
Referenced by applyChangeVariablesOrder(), applySlice(), BasicHypercube(), readExternal(), setStepsHashmaps(), and setStepsHashmaps().

|
package |
Fills the step hashMap of the hypercube.
| variables2 | list of variables |
| domains2 | list of domains |
| number_of_utility_values2 | number of utility values |
References setStepsHashmaps(), and steps_hashmaps.

| void frodo2.solutionSpaces.hypercube.BasicHypercube< V extends Addable< V >, U extends Serializable >.setUtility | ( | long | index, |
| U | utility ) |
Implements frodo2.solutionSpaces.BasicUtilitySolutionSpace< V extends Addable< V >, U extends Serializable >.
| boolean frodo2.solutionSpaces.hypercube.BasicHypercube< 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 hypercube |
| utility | the new utility value |
Implements frodo2.solutionSpaces.BasicUtilitySolutionSpace< V extends Addable< V >, U extends Serializable >.
References getIndexOfUtilityValue(), and values.
Referenced by frodo2.solutionSpaces.vehiclerouting.VehicleRoutingSpace< U extends Addable< U > >.project().

| BasicUtilitySolutionSpace< V, U > frodo2.solutionSpaces.hypercube.BasicHypercube< V extends Addable< V >, U extends Serializable >.slice | ( | String | var, |
| V | val ) |
Slices this hypercube over a single variable-value assignment.
| var | the variable to be assigned a value |
| val | the value to assign to the variable |
Implements frodo2.solutionSpaces.BasicUtilitySolutionSpace< V extends Addable< V >, U extends Serializable >.
References slice().

| BasicUtilitySolutionSpace< V, U > frodo2.solutionSpaces.hypercube.BasicHypercube< V extends Addable< V >, U extends Serializable >.slice | ( | String | var, |
| V[] | subDomain ) |
Implements frodo2.solutionSpaces.BasicUtilitySolutionSpace< V extends Addable< V >, U extends Serializable >.
References slice().

|
protected |
Slice method used internally.
| remainingVars | the remaining variables |
| remainingDoms | the domains of the remaining variables |
| iterDoms | the domain slices for this space's variables |
| nbrRemainingUtils | the number of remaining utilities |
| domClass | the class of V[] |
References BasicHypercube(), iterator(), newInstance(), frodo2.solutionSpaces.BasicUtilitySolutionSpace< V extends Addable< V >, U extends Serializable >.SparseIterator< V, U >.nextUtility(), and slice().

| BasicUtilitySolutionSpace< V, U > frodo2.solutionSpaces.hypercube.BasicHypercube< V extends Addable< V >, U extends Serializable >.slice | ( | String[] | variables_names, |
| V[] | values ) |
Implements frodo2.solutionSpaces.BasicUtilitySolutionSpace< V extends Addable< V >, U extends Serializable >.
References slice(), and values.

| BasicHypercube< V, U > frodo2.solutionSpaces.hypercube.BasicHypercube< V extends Addable< V >, U extends Serializable >.slice | ( | String[] | variables_names, |
| V | sub_domains[][] ) |
Return a slice of this hypercube.
| variables_names | the variables to slice |
| sub_domains | the domains of the slice |
Implements frodo2.solutionSpaces.BasicUtilitySolutionSpace< V extends Addable< V >, U extends Serializable >.
References BasicHypercube(), contains(), getNumberOfSolutions(), getUtility(), notEmptyDomains(), scalarHypercube(), and slice().
Referenced by slice(), slice(), slice(), slice(), slice(), and slice().

| BasicUtilitySolutionSpace< V, U > frodo2.solutionSpaces.hypercube.BasicHypercube< V extends Addable< V >, U extends Serializable >.slice | ( | V[] | variables_values | ) |
Return a slice of this hypercube.
| variables_values | array containing values of the last variables of the hypercube |
Implements frodo2.solutionSpaces.BasicUtilitySolutionSpace< V extends Addable< V >, U extends Serializable >.
References domains, number_of_utility_values, slice(), steps_hashmaps, and variables.

| SparseIterator< V, U > frodo2.solutionSpaces.hypercube.BasicHypercube< V extends Addable< V >, U extends Serializable >.sparseIter | ( | ) |
Implements frodo2.solutionSpaces.BasicUtilitySolutionSpace< V extends Addable< V >, U extends Serializable >.
References sparseIter().
Referenced by prettyPrint(), and sparseIter().

| SparseIterator< V, U > frodo2.solutionSpaces.hypercube.BasicHypercube< V extends Addable< V >, U extends Serializable >.sparseIter | ( | String[] | order | ) |
Implements frodo2.solutionSpaces.BasicUtilitySolutionSpace< V extends Addable< V >, U extends Serializable >.
References newIter().

| SparseIterator< V, U > frodo2.solutionSpaces.hypercube.BasicHypercube< V extends Addable< V >, U extends Serializable >.sparseIter | ( | String[] | variables, |
| V | domains[][] ) |
Implements frodo2.solutionSpaces.BasicUtilitySolutionSpace< V extends Addable< V >, U extends Serializable >.
References domains, iterator(), and variables.

| SparseIterator< V, U > frodo2.solutionSpaces.hypercube.BasicHypercube< V extends Addable< V >, U extends Serializable >.sparseIter | ( | String[] | variables, |
| V | domains[][], | ||
| V[] | assignment ) |
Implements frodo2.solutionSpaces.BasicUtilitySolutionSpace< V extends Addable< V >, U extends Serializable >.
References assignment, domains, iterator(), and variables.

|
protected |
Creates a sparse iterator that skips a specific utility.
| inf | the utility to skip |
References getDomains(), getVariables(), and newIter().

|
static |
Computes the subtraction of two arrays.
| <T> | the arrays' component type |
| array1 | the first array |
| array2 | the second array |
References sub().
Referenced by applyChangeVariablesOrder(), changeVariablesOrder(), compose(), and sub().

| String frodo2.solutionSpaces.hypercube.BasicHypercube< V extends Addable< V >, U extends Serializable >.toString | ( | ) |
| void frodo2.solutionSpaces.hypercube.BasicHypercube< V extends Addable< V >, U extends Serializable >.writeExternal | ( | ObjectOutput | out | ) | throws IOException |
References writeUtilities().

|
protected |
Serializes the utilities.
| out | the output stream |
| IOException | if an I/O error occurs |
References incrNCCCs().
Referenced by writeExternal().

|
protected |
An array of size variables.length that can be reused, instead of creating a new array each time we need one.
Referenced by compose(), iterator(), iterator(), newIter(), and sparseIter().
|
protected |
The class of V.
Referenced by compose().
|
protected |
The domains of the variables of the hypercube.
Referenced by applyAugment(), applyChangeVariablesOrder(), applySlice(), changeVariablesOrder(), clone(), frodo2.solutionSpaces.hypercube.ScalarBasicHypercube< V extends Addable< V >, U extends Serializable >.compose(), frodo2.solutionSpaces.hypercube.ScalarHypercube< V extends Addable< V >, U extends Addable< U > >.compose(), fillVariablesValues(), getDomain(), getDomain(), getDomain(), getDomains(), iterator(), iterator(), iterator(), newIter(), notEmptyDomains(), orderedDomains(), renameAllVars(), slice(), sparseIter(), sparseIter(), and toString().
|
protected |
-INF if we are maximizing, +INF if we are minimizing
Referenced by BasicHypercube(), BasicHypercube(), BasicHypercube(), newInstance(), and renameAllVars().
|
staticprivate |
The types of spaces that we know how to handle.
Referenced by [static initializer](), and knows().
|
staticprivate |
The last ID used to instantiate a BasicHypercube.
Referenced by BasicHypercube().
|
protected |
The name of this space, if any.
Referenced by BasicHypercube(), getName(), hashCode(), newInstance(), setName(), and setRelationName().
|
protected |
The actual number of utilities values in the array.
Referenced by applyAugment(), applyChangeVariablesOrder(), changeVariablesOrder(), frodo2.solutionSpaces.hypercube.ScalarBasicHypercube< V extends Addable< V >, U extends Serializable >.compose(), getNumberOfSolutions(), setNumberOfSolutions(), and slice().
|
private |
The owner of this space.
Referenced by getOwner(), and setOwner().
|
protected |
The problem that should be notified of constraint checks.
Referenced by BasicHypercube(), incrNCCCs(), and setProblem().
|
private |
The name of the underlying relation.
Referenced by getRelationName().
|
protected |
For each variable, a hashmap that maps every value in the domain of this variable to a step in the utility values array.
This is used to speed up access to the utility value of a given combination of variable-value assignments, by avoiding to recompute the position of that utility value in the utility array from scratch every time.
Referenced by applyChangeVariablesOrder(), getIndexOfUtilityValue(), setStepsHashmaps(), and slice().
|
protected |
The utility values.
Referenced by applyAugment(), applyChangeVariablesOrder(), applySlice(), BasicHypercube(), clone(), frodo2.solutionSpaces.hypercube.ScalarBasicHypercube< V extends Addable< V >, U extends Serializable >.compose(), frodo2.solutionSpaces.hypercube.ScalarHypercube< V extends Addable< V >, U extends Addable< U > >.compose(), getUtility(), getUtility(), getUtilityNoNCCCs(), renameAllVars(), setUtility(), slice(), and toString().
|
protected |
The names of the variables of the hypercube ordered according to their order in the hypercube.
Referenced by applyAugment(), applyChangeVariablesOrder(), applySlice(), changeVariablesOrder(), clone(), frodo2.solutionSpaces.hypercube.ScalarBasicHypercube< V extends Addable< V >, U extends Serializable >.compose(), frodo2.solutionSpaces.hypercube.ScalarHypercube< V extends Addable< V >, U extends Addable< U > >.compose(), consistentOrder(), consistentOrder(), contains(), contains(), fillVariablesValues(), getDomain(), getDomain(), getDomain(), getIndex(), getIndexOfUtilityValue(), getNumberOfVariables(), getUtility(), getUtilityValueSameOrder(), getVariable(), getVariables(), iterator(), iterator(), iterator(), newIter(), orderedDomains(), slice(), sparseIter(), sparseIter(), and toString().