|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectclarion.system.Value
public class Value
This class implements a value within CLARION. It implements the cloneable and comparable interfaces.
Usage:
The value class is used to define the possible values of a dimension. It is a somewhat meaningless
object unless it is defined within a dimension. A coupling of a dimension and a value together is
called a dimension-value pair and is the base unit in CLARION for representing information.
Examples of dimension-value pairs:
It is required that you specify a way of identifying the value (eg. name, number, etc) when you initialize this class. Once this ID has been set, it cannot be changed. This ID is used as the key for this value when it is placed inside a dimension.
The activation of a value is 0 by default and (although not required) is usually set to
either 0 (the value is not activated) or 1 (the value is activated).
This class contains both global (static) and local constants. The default is to use the local constants. If you want to change any of the global constants, you need to do so before any instances of this class are initialized.
Field Summary | |
---|---|
protected double |
Activation
The activation of the value. |
double |
ACTIVATION_MATCH_EPSILON
How close two activations must be in order to be considered equal. |
double |
FULL_ACTIVATION_THRESHOLD
The threshold a dimension-value pair must be activated to in order to be considered fully activated. |
static double |
GLOBAL_ACTIVATION_EPSILON
How close two activations must be in order to be considered equal. |
static double |
GLOBAL_FULL_ACTIVATION_THRESHOLD
The threshold a dimension-value pair must be activated to in order to be considered fully activated. |
static double |
GLOBAL_MINIMUM_ACTIVATION_THRESHOLD
The minimum threshold a dimension-value pair activation must be above to be considered activated. |
protected int |
hash
The hash for this object. |
protected java.lang.Object |
ID
Identifies the value. |
double |
MINIMUM_ACTIVATION_THRESHOLD
The minimum threshold a dimension-value pair activation must be above to be considered activated. |
Constructor Summary | |
---|---|
Value(java.lang.Object id)
Initializes the value with the minimum activation and sets the ID to the object specified. |
|
Value(java.lang.Object id,
double act)
Initializes the value with the activation and ID specified. |
Method Summary | |
---|---|
Value |
clone()
Clones the value. |
int |
compareTo(Value val)
Compares the activation of this value to the specified value. |
boolean |
equals(java.lang.Object val)
Checks to see if the specified object is a value and if the ID and activation of the specified value is the same as this value. |
boolean |
equalsID(java.lang.Object val)
Checks to see if the specified value has the same ID as this value. |
double |
getActivation()
Gets the activation level for this value. |
java.lang.Object |
getID()
Gets the ID of this value. |
int |
hashCode()
|
boolean |
isActivated()
Checks to see if the activation of the value is greater than the minimum activation threshold. |
boolean |
isFullyActivated()
Checks to see if the activation of the value is greater than or equal to the full activation threshold. |
void |
resetActivation()
Resets the activation. |
void |
setActivation(double act)
Sets the activation level for this value. |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected java.lang.Object ID
protected int hash
protected double Activation
public static double GLOBAL_MINIMUM_ACTIVATION_THRESHOLD
public static double GLOBAL_FULL_ACTIVATION_THRESHOLD
public static double GLOBAL_ACTIVATION_EPSILON
public double MINIMUM_ACTIVATION_THRESHOLD
public double FULL_ACTIVATION_THRESHOLD
public double ACTIVATION_MATCH_EPSILON
Constructor Detail |
---|
public Value(java.lang.Object id)
id
- The ID of the value.public Value(java.lang.Object id, double act)
id
- The ID of the value.act
- The activation level.Method Detail |
---|
public java.lang.Object getID()
public double getActivation()
public void setActivation(double act)
act
- The activation level to set.public void resetActivation()
public boolean isActivated()
public boolean isFullyActivated()
public boolean equalsID(java.lang.Object val)
val
- The value whose ID you want to compare to this value's ID.
public boolean equals(java.lang.Object val)
equals
in class java.lang.Object
val
- The object to compare to this value.
public int hashCode()
hashCode
in class java.lang.Object
public Value clone()
clone
in class java.lang.Object
public int compareTo(Value val) throws java.lang.ClassCastException
compareTo
in interface java.lang.Comparable<Value>
val
- The value to compare.
java.lang.ClassCastException
- if the specified value does not have the same ID as this value.public java.lang.String toString()
toString
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |