public class DiscretizingMaskedHashableStateFactory extends SimpleHashableStateFactory
HashableState
objects that computes hash codes and tests
for State
equality by discretizing real-valued attributes and by masking (ignoring)
either state variables and/or OOState
clasees. For more information
on how discretization is performed, see the DiscretizingHashableStateFactory
class documentation and for more information on how
masking is performed see the MaskedHashableStateFactory
class
documentation.
This class extends SimpleHashableStateFactory
, which means it can be toggled to
to be object identifier/name independent or dependent and can be set to use HashableState
instances that cache their hash code or not. See the SimpleHashableStateFactory
class documentation for more information on those features.
identifierIndependent
Constructor and Description |
---|
DiscretizingMaskedHashableStateFactory(boolean identifierIndependent,
double defaultMultiple)
Initializes with non hash code caching and object class or attribute masks
|
DiscretizingMaskedHashableStateFactory(boolean identifierIndependent,
double defaultMultiple,
boolean maskNamesAreForVariables,
java.lang.String... masks)
Initializes with a specified attribute or object class mask.
|
DiscretizingMaskedHashableStateFactory(double defaultMultiple)
Initializes with object identifier independence, no hash code caching and object class or attribute masks.
|
Modifier and Type | Method and Description |
---|---|
void |
addFloorDiscretizingMultipleFor(java.lang.Object key,
double nearestMultipleValue)
Sets the multiple to use for discretization for the given key.
|
HashableState |
hashState(State s)
Turns
State s into a HashableState |
void |
setDefaultFloorDiscretizingMultiple(double defaultMultiple)
Sets the default multiple to use for continuous values that do not have specific multiples set
for them.
|
objectIdentifierIndependent
public DiscretizingMaskedHashableStateFactory(double defaultMultiple)
defaultMultiple
- The default multiple to use for any continuous variables that have not been specifically set. The default is 1.0, which
corresponds to integer floor discretization.public DiscretizingMaskedHashableStateFactory(boolean identifierIndependent, double defaultMultiple)
identifierIndependent
- if true then state evaluations are object identifier independent; if false then dependent.defaultMultiple
- The default multiple to use for any continuous variables that have not been specifically set. The default is 1.0, which
corresponds to integer floor discretization.public DiscretizingMaskedHashableStateFactory(boolean identifierIndependent, double defaultMultiple, boolean maskNamesAreForVariables, java.lang.String... masks)
identifierIndependent
- if true then state evaluations are object identifier independent; if false then dependent.defaultMultiple
- The default multiple to use for any continuous attributes that have not been specifically set.maskNamesAreForVariables
- whether the specified masks are masks for variables or object classes. True for variables, false for object classes.masks
- the names of the variable keys or object classes that will be masked (ignored from state hashing and equality checks)public void addFloorDiscretizingMultipleFor(java.lang.Object key, double nearestMultipleValue)
key
- the name of the state variable key whose discretization multiple is being set.nearestMultipleValue
- the multiple to which values are floored.public void setDefaultFloorDiscretizingMultiple(double defaultMultiple)
defaultMultiple
- the default multiple to which values are flooredpublic HashableState hashState(State s)
HashableStateFactory
State
s into a HashableState
hashState
in interface HashableStateFactory
hashState
in class SimpleHashableStateFactory
s
- the input State
to transform.HashableState
.