clarion.system
Class Goal

java.lang.Object
  extended by java.util.AbstractMap<K,V>
      extended by java.util.HashMap<K,V>
          extended by java.util.LinkedHashMap<java.lang.Object,Dimension>
              extended by clarion.system.DimensionValueCollection
                  extended by clarion.system.AbstractChunk
                      extended by clarion.system.AbstractOutputChunk
                          extended by clarion.system.Goal
All Implemented Interfaces:
InterfaceStochasticallySelectable, InterfaceTracksTime, java.io.Serializable, java.lang.Cloneable, java.util.Map<java.lang.Object,Dimension>

public class Goal
extends AbstractOutputChunk

This class implements a goal within CLARION. It extends the AbstractOutputChunk class.

Usage:

A goal acts as a directive within CLARION providing both internal instruction for the subsystems within CLARION as well as aiding more directly (e.g. as input into the ACS).

If a goal is activated, then all dimension-value pairs in the goal are also activated. Goals are not required to have dimension-value pairs. However, if you do not specify any dimension-value pairs, the goal cannot be used as input for the subsystems (mainly the ACS).

Note that the dimensions of a goal should have different IDs than the dimensions in the sensory information space otherwise conflicts will arise on the bottom level of the ACS. If a goal has a dimension that has the same ID as a dimension in the sensory information space, then if the goal is activated, the dimension with the same ID in the sensory information space will also be activated. The CLARION library has been implemented in this fashion to prevent the system from crashing in the event that this circumstance occurs.

Version:
6.0.4
Author:
Nick Wilson
See Also:
Serialized Form

Field Summary
private  int hash
          The hash for this object.
private  java.util.LinkedHashMap<java.lang.Object,Value> Relevance
          The relevance of the drives to this goal.
private static long serialVersionUID
           
private  java.util.LinkedHashMap<java.lang.Object,Goal> SubGoals
          The sub goals related to this goal.
 
Fields inherited from class clarion.system.AbstractOutputChunk
C, D, FULL_ACTIVATION_LEVEL, GLOBAL_C, GLOBAL_D, GLOBAL_FULL_ACTIVATION_LEVEL, GLOBAL_INITIAL_BLA, GLOBAL_MINIMUM_ACTIVATION_THRESHOLD, GLOBAL_PERSISTENCE, INITIAL_BLA, MINIMUM_ACTIVATION_THRESHOLD, PERSISTENCE
 
Constructor Summary
Goal(java.lang.Object id)
          Initializes the goal with the ID specified.
Goal(java.lang.Object id, java.util.Collection<? extends Dimension> dims)
          Initializes the goal with the specified ID and dimensions.
Goal(java.lang.Object id, java.util.Map<? extends java.lang.Object,? extends Dimension> dims)
          Initializes the goal with the specified ID and map of dimensions.
 
Method Summary
 void activateGoal()
          Activates the goal by setting all of the dimension-values in the goal to the full activation threshold.
 Goal clone()
          Clones the goal (including all of it's dimensions).
 void deactivateGoal()
          Deactivates the goal by setting all of the dimension-values in the goal to the minimum activation threshold.
 Value getRelevance(java.lang.Object ID)
          Gets the relevance to the goal of the drive with the specified ID.
 java.util.Collection<Goal> getSubGoals()
          Gets sub goals of this goal.
 int hashCode()
           
 Dimension put(java.lang.Object key, Dimension dim)
          Puts the dimension into the goal as long as the dimension is not already in the goal.
 void putAll(java.util.Map<? extends java.lang.Object,? extends Dimension> map)
          Puts all of the dimensions in the map into the goal as long as the dimensions are not already in the goal.
 void setRelevances(java.util.Collection<Value> Rel)
          Sets the relevance to this goal for the drives with IDs equal to the values in the specified collection.
 void setSubGoals(java.util.Collection<Goal> subs)
          Sets the sub goals for this goal.
 
Methods inherited from class clarion.system.AbstractOutputChunk
addTimeStamp, adjustSelectionMeasure, getActivation, getBLA, getBLSelectionMeasure, getFinalSelectionMeasure, getTLSelectionMeasure, resetActivation, setActivation, setBLSelectionMeasure, setFinalSelectionMeasure, setTLSelectionMeasure
 
Methods inherited from class clarion.system.AbstractChunk
equals, equalsID, getID, toString
 
Methods inherited from class clarion.system.DimensionValueCollection
containsKeys, getNumDVPairs, getValueCollection, size
 
Methods inherited from class java.util.LinkedHashMap
clear, containsValue, get, removeEldestEntry
 
Methods inherited from class java.util.HashMap
containsKey, entrySet, isEmpty, keySet, remove, values
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.Map
containsKey, entrySet, isEmpty, keySet, remove, values
 

Field Detail

serialVersionUID

private static final long serialVersionUID
See Also:
Constant Field Values

hash

private int hash
The hash for this object. When this item is cloned, so is this hash.


Relevance

private java.util.LinkedHashMap<java.lang.Object,Value> Relevance
The relevance of the drives to this goal.


SubGoals

private java.util.LinkedHashMap<java.lang.Object,Goal> SubGoals
The sub goals related to this goal. If this goal is activate then all sub goals are also activated.

Constructor Detail

Goal

public Goal(java.lang.Object id)
Initializes the goal with the ID specified.

Parameters:
id - The ID of the goal.

Goal

public Goal(java.lang.Object id,
            java.util.Collection<? extends Dimension> dims)
Initializes the goal with the specified ID and dimensions.

Parameters:
id - The ID of the goal.
dims - The dimensions for the goal.

Goal

public Goal(java.lang.Object id,
            java.util.Map<? extends java.lang.Object,? extends Dimension> dims)
Initializes the goal with the specified ID and map of dimensions.

Parameters:
id - The ID of the goal.
dims - The map of dimensions for the goal.
Method Detail

put

public Dimension put(java.lang.Object key,
                     Dimension dim)
              throws java.lang.IllegalArgumentException
Puts the dimension into the goal as long as the dimension is not already in the goal. This method also sets the activations of all of the values in the dimension to the minimum activation threshold (i.e. to the off position). If the dimension is already in the goal, this method throws an exception. If the specified key is not the ID of the specified dimension, this method throws an exception.

Specified by:
put in interface java.util.Map<java.lang.Object,Dimension>
Overrides:
put in class DimensionValueCollection
Parameters:
key - The key with which the specified dimension is to be associated. This MUST be the ID of the specified dimension.
dim - The dimension to add to the goal.
Returns:
The result of putting the dimension in the goal. This will always return null (meaning the dimension did not previously exist in the map). This is because you are not allowed to put a dimension into a goal that already contains that dimension.
Throws:
java.lang.IllegalArgumentException - If the dimension is already in the goal or the specified key is not the ID of the specified dimension.

putAll

public void putAll(java.util.Map<? extends java.lang.Object,? extends Dimension> map)
Puts all of the dimensions in the map into the goal as long as the dimensions are not already in the goal. This method also sets the activations of the values in all of the dimensions to the minimum activation threshold (i.e. to the off position).

Specified by:
putAll in interface java.util.Map<java.lang.Object,Dimension>
Overrides:
putAll in class DimensionValueCollection
Parameters:
map - The map of dimensions to add.

getRelevance

public Value getRelevance(java.lang.Object ID)
Gets the relevance to the goal of the drive with the specified ID. If the drive is not affiliated with this goal, this method returns null.

Parameters:
ID - The ID of the drive whose relevance you wish to get.
Returns:
The relevance of the drive to the goal. Null if the drive is not affiliated with this goal.

setRelevances

public void setRelevances(java.util.Collection<Value> Rel)
Sets the relevance to this goal for the drives with IDs equal to the values in the specified collection.

Relevances are specified as a collection of values where the value ID is equal to the ID of a relevant drive. Only those drives whose relevance has been specified will be considered as being relevant to this goal.

Parameters:
Rel - A collection of relevances.

getSubGoals

public java.util.Collection<Goal> getSubGoals()
Gets sub goals of this goal. The collection returned is unmodifiable and is meant for reporting the internal state only.

Returns:
An unmodifiable collection of the subgoals for this goal.

setSubGoals

public void setSubGoals(java.util.Collection<Goal> subs)
Sets the sub goals for this goal. This method should ONLY be run during initialization.

Parameters:
subs - The array of sub goals.

activateGoal

public void activateGoal()
Activates the goal by setting all of the dimension-values in the goal to the full activation threshold.


deactivateGoal

public void deactivateGoal()
Deactivates the goal by setting all of the dimension-values in the goal to the minimum activation threshold.


hashCode

public int hashCode()
Specified by:
hashCode in interface java.util.Map<java.lang.Object,Dimension>
Overrides:
hashCode in class DimensionValueCollection

clone

public Goal clone()
Clones the goal (including all of it's dimensions).

Specified by:
clone in class AbstractOutputChunk
Returns:
A copy of the goal.