clarion.acs.gs
Class GoalStack

java.lang.Object
  extended byclarion.acs.gs.GoalStack
All Implemented Interfaces:
GoalStructure

public class GoalStack
extends java.lang.Object
implements GoalStructure


Field Summary
protected  int curActiveGoalIdx
          current active goal index.
protected  StochasticDecider decider
          used for selecting active goal.
protected  Global global
          global settings.
protected  GoalChunk[] goalItems
          the goal items.
protected  short[][] goalReps
          representations of all of the possible goals.
protected  int gsActionMadeMode
          GS action by top level only or by both.
protected  short[] gsParamDVs
          d-v info of parameter dimensions.
protected  int netIdx
          net index.
protected  double P_EXT
          coordination of external vs goal actions.
protected  double P_GS
          coordination of external vs goal actions.
protected  int size_gc
          size of goal chunk, actually the # of parameter dims.
protected  int size_gs
          size of goal structure.
protected  java.util.Stack stack
          stack for goals.
protected  TaskClarion taskClarion
          task-specific clarion settings.
 
Constructor Summary
GoalStack(Global g)
          constructor.
 
Method Summary
 boolean actionNoGoal()
          routine of no-goal-action.
 boolean actionReset(int idx)
          'reset' action.
 boolean actionSet(int idx)
          'set' action.
 int getActiveGoal()
          Returns the currently active goal in terms of goal index.
 GoalChunk getActiveItem()
          Returns the currently active goal item in terms of a chunk.
 int getSize()
          Returns the number of goals in this goal stack.
 void goalFinished(boolean popFlag)
          routine when a goal is completed, no automatic goal pop.
 boolean isEmpty()
          Returns if this goal stack is empty or not.
 void updateState(double[] state)
          Updates current goal state as input to GSNet.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

global

protected Global global
global settings.


taskClarion

protected TaskClarion taskClarion
task-specific clarion settings.


netIdx

protected int netIdx
net index.


curActiveGoalIdx

protected int curActiveGoalIdx
current active goal index.


goalReps

protected short[][] goalReps
representations of all of the possible goals.


gsParamDVs

protected short[] gsParamDVs
d-v info of parameter dimensions.


size_gc

protected int size_gc
size of goal chunk, actually the # of parameter dims.


size_gs

protected int size_gs
size of goal structure.


gsActionMadeMode

protected int gsActionMadeMode
GS action by top level only or by both.


P_GS

protected double P_GS
coordination of external vs goal actions.


P_EXT

protected double P_EXT
coordination of external vs goal actions.


goalItems

protected GoalChunk[] goalItems
the goal items.


stack

protected java.util.Stack stack
stack for goals.


decider

protected StochasticDecider decider
used for selecting active goal.

Constructor Detail

GoalStack

public GoalStack(Global g)
constructor.

Parameters:
g - the global settings.
Method Detail

isEmpty

public boolean isEmpty()
Returns if this goal stack is empty or not.

Specified by:
isEmpty in interface GoalStructure

getSize

public int getSize()
Returns the number of goals in this goal stack.

Specified by:
getSize in interface GoalStructure

getActiveGoal

public int getActiveGoal()
Returns the currently active goal in terms of goal index.

Specified by:
getActiveGoal in interface GoalStructure

getActiveItem

public GoalChunk getActiveItem()
Returns the currently active goal item in terms of a chunk.

Specified by:
getActiveItem in interface GoalStructure

actionSet

public boolean actionSet(int idx)
'set' action. in goal stack, it is a push action.

Specified by:
actionSet in interface GoalStructure
Parameters:
idx - the index of a goal.

actionReset

public boolean actionReset(int idx)
'reset' action. in goal stack, it is a pop action.

Specified by:
actionReset in interface GoalStructure
Parameters:
idx - the index of a goal.

actionNoGoal

public boolean actionNoGoal()
routine of no-goal-action.

Specified by:
actionNoGoal in interface GoalStructure

goalFinished

public void goalFinished(boolean popFlag)
routine when a goal is completed, no automatic goal pop.

Specified by:
goalFinished in interface GoalStructure
Parameters:
popFlag - indicate a pop action is done or not.

updateState

public void updateState(double[] state)
Updates current goal state as input to GSNet.

Specified by:
updateState in interface GoalStructure
Parameters:
state - current state to update.