public class DiscreteMaskHashingFactory extends DiscreteStateHashFactory
DiscreteStateHashFactory
(which this class extends) this class computes unique hash codes for states
based on attributes that the client specifies to use. However, unlike the superclass, this class also performs
state equality checks using only the attributes specified for each class. This is often a useful abstraction
for components like options whose policies are invariant to attributes specifying properties like ultimate task goal locations.Modifier and Type | Class and Description |
---|---|
class |
DiscreteMaskHashingFactory.DiscreteMaskHashTuple |
DiscreteStateHashFactory.DiscreteStateHashTuple
Modifier and Type | Field and Description |
---|---|
protected java.util.Map<java.lang.String,java.util.List<Attribute>> |
attributesForEquality |
attributesForHashCode
Constructor and Description |
---|
DiscreteMaskHashingFactory()
Initializes this hashing factory to compute hash codes and equality checks with all attributes of all object classes.
|
DiscreteMaskHashingFactory(java.util.Map<java.lang.String,java.util.List<Attribute>> attributesForHashCode)
Initializes this hashing factory to hash and equality check on only the attributes for the specified classes in the provided map
|
Modifier and Type | Method and Description |
---|---|
StateHashTuple |
hashState(State s) |
addAttributeForClass, setAttributesForClass, setAttributesForHashCode
protected java.util.Map<java.lang.String,java.util.List<Attribute>> attributesForEquality
public DiscreteMaskHashingFactory()
public DiscreteMaskHashingFactory(java.util.Map<java.lang.String,java.util.List<Attribute>> attributesForHashCode)
attributesForHashCode
- a map from object class names to the attributes that should be used in the hash calculation and equality check for those object classes.public StateHashTuple hashState(State s)
hashState
in interface StateHashFactory
hashState
in class DiscreteStateHashFactory