clarion.system
Class GoalSelectionModule

java.lang.Object
  extended by clarion.system.GoalSelectionModule

public class GoalSelectionModule
extends java.lang.Object

This class implements a goal selection module within CLARION.

Usage:

This module can be optionally added to the MCS if the user wishes to have the MCS handle goal setting. This module uses an implicit module to determine the goal activation level. The user can decide, during initialization, the implicit module they wish to use.

If this module is initialized without specifying an implicit module to use, the GoalSelectionEquation will be used.

Version:
6.0.5
Author:
Nick Wilson

Field Summary
private  AbstractImplicitModule GoalSelectionImplicitModule
          The implicit representation used for goal selection.
private  GoalStructure GS
          The goal structure.
 StochasticSelector Selector
          The stochastic selector for goal selection.
 
Constructor Summary
GoalSelectionModule(AbstractImplicitModule im)
          Initializes the goal selection module given the specified implicit module.
GoalSelectionModule(java.util.Collection<DriveStrength> RelevantDrives, java.util.Collection<Goal> Goals)
          Initializes the goal selection module to use the goal selection equation.
 
Method Summary
 void attachGoalStructure(GoalStructure gs)
          Attaches the specified goal structure to this module.
 AbstractImplicitModule getImplicitModule()
          Gets the implicit module used by this module.
 void setGoal(DriveStrengthCollection DriveStrengths, long TimeStamp)
          Selects a goal from all of the possible goals tied to the output layer of implicit module in this module using the specified collection of drive strengths.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

GoalSelectionImplicitModule

private AbstractImplicitModule GoalSelectionImplicitModule
The implicit representation used for goal selection.


GS

private GoalStructure GS
The goal structure.


Selector

public StochasticSelector Selector
The stochastic selector for goal selection.

Constructor Detail

GoalSelectionModule

public GoalSelectionModule(java.util.Collection<DriveStrength> RelevantDrives,
                           java.util.Collection<Goal> Goals)
Initializes the goal selection module to use the goal selection equation. The goal selection equation will select from the specified goals using the specified drive strengths.

Parameters:
RelevantDrives - The drive strengths for relevant drives used to make goal selections.
Goals - The goals from which to select.

GoalSelectionModule

public GoalSelectionModule(AbstractImplicitModule im)
                    throws InvalidFormatException
Initializes the goal selection module given the specified implicit module.

Note that the specified implicit module MUST have output chunks each of which is a possible goals in the goal structure.

The goal selection implicit module will only select over the possible goals that are specified as an output chunk on the output of the specified implicit module.

If the goal selection implicit module contains any output nodes that are of a type other than Goal, this constructor will throw an exception.

Parameters:
im - The goal selection implicit module to set for this module.
Throws:
InvalidFormatException - If the output layer contains nodes of a type other than Goal.
Method Detail

setGoal

public void setGoal(DriveStrengthCollection DriveStrengths,
                    long TimeStamp)
Selects a goal from all of the possible goals tied to the output layer of implicit module in this module using the specified collection of drive strengths.

If a new goal is selected that is different than the currently chosen goal then the currently chosen goal is removed from the goal structure and the new goal is set as the currently chosen goal. If the goal structure has not been initialized or does not contain any possible goals, this method does nothing.

Parameters:
DriveStrengths - The drive strengths of relevant drives.
TimeStamp - The current time stamp.

getImplicitModule

public AbstractImplicitModule getImplicitModule()
Gets the implicit module used by this module. This method is primarily meant for internal purposes. It should NOT be used outside of the CLARION Library for purposes other than reporting the internal state.

Returns:
The implicit module of this module.

attachGoalStructure

public void attachGoalStructure(GoalStructure gs)
Attaches the specified goal structure to this module.

Parameters:
gs - The goal structure.