edu.memphis.ccrg.lida.actionselection
Class BehaviorImpl

java.lang.Object
  extended by edu.memphis.ccrg.lida.framework.shared.activation.ActivatibleImpl
      extended by edu.memphis.ccrg.lida.actionselection.BehaviorImpl
All Implemented Interfaces:
Behavior, Activatible, java.io.Serializable

public class BehaviorImpl
extends ActivatibleImpl
implements Behavior

Basic implementation of Behavior

Author:
Ryan J McCall
See Also:
Serialized Form

Field Summary
 
Fields inherited from interface edu.memphis.ccrg.lida.framework.shared.activation.Activatible
DEFAULT_ACTIVATIBLE_REMOVAL_THRESHOLD, DEFAULT_ACTIVATION
 
Constructor Summary
BehaviorImpl()
          Default constructor
BehaviorImpl(Action action)
           
 
Method Summary
 boolean addContextCondition(Node condition)
          Adds the context condition.
 boolean addToAddingList(Node addResult)
          Adds the to adding list.
 boolean addToDeletingList(Node deleteResult)
          Adds the to deleting list.
 boolean containsAddingItem(Node addItem)
          Contains adding item.
 boolean containsContextCondition(Node contextCondition)
          Contains context condition.
 boolean containsDeletingItem(Node deleteItem)
          Contains deleting item.
 void deactivateAllContextConditions()
          deactivates all context conditions.
 void deactiveContextCondition(Node condition)
          Deactive context condition.
 void decay(long ticks)
          decay the current activation using the decay strategy.
 boolean equals(java.lang.Object o)
           
 Action getAction()
          Gets action.
 NodeStructure getAddingList()
          Gets adding list.
 double getAddingListCount()
          Gets adding list count.
 NodeStructure getContext()
          Gets context
 java.util.Collection<Node> getContextNodes()
          Gets context nodes.
 java.lang.String getContextNodeType()
          Gets context node type.
 int getContextSize()
          Gets context size.
 NodeStructure getDeletingList()
          Gets deleting list.
 double getDeletingListCount()
          Gets deleting list count.
 Scheme getGeneratingScheme()
          Gets generating scheme.
 long getId()
          Gets id.
 java.lang.String getLabel()
          Gets label.
 double getResultSize()
          Gets result size.
 int getUnsatisfiedContextCount()
          Gets unsatisfied context count.
 int hashCode()
           
 boolean isAllContextConditionsSatisfied()
          Returns true if all context conditions are satisfied.
 boolean isContextConditionSatisfied(Node prop)
          Returns true if supplied condition is satisfied.
 void setAction(Action action)
          Sets action
 void setContextNodeType(java.lang.String nodeType)
          Sets context node type.
 void setGeneratingScheme(Scheme s)
          Sets generating scheme.
 void setLabel(java.lang.String label)
          Sets label.
 java.lang.String toString()
           
 void updateAddingCondition(Node broadcastNode)
          Update adding condition.
 void updateContextCondition(Node broadcastCondition)
          marks supplied condition as present.
 void updateDeletingCondition(Node broadcastNode)
          Update deleting condition.
 
Methods inherited from class edu.memphis.ccrg.lida.framework.shared.activation.ActivatibleImpl
excite, getActivatibleRemovalThreshold, getActivation, getDecayStrategy, getExciteStrategy, getTotalActivation, isRemovable, setActivatibleRemovalThreshold, setActivation, setDecayStrategy, setExciteStrategy
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface edu.memphis.ccrg.lida.framework.shared.activation.Activatible
excite, getActivatibleRemovalThreshold, getActivation, getDecayStrategy, getExciteStrategy, getTotalActivation, isRemovable, setActivatibleRemovalThreshold, setActivation, setDecayStrategy, setExciteStrategy
 

Constructor Detail

BehaviorImpl

public BehaviorImpl()
Default constructor


BehaviorImpl

public BehaviorImpl(Action action)
Parameters:
action - Action
Method Detail

deactivateAllContextConditions

public void deactivateAllContextConditions()
Description copied from interface: Behavior
deactivates all context conditions.

Specified by:
deactivateAllContextConditions in interface Behavior

setAction

public void setAction(Action action)
Description copied from interface: Behavior
Sets action

Specified by:
setAction in interface Behavior
Parameters:
action - Action this behavior contains

isContextConditionSatisfied

public boolean isContextConditionSatisfied(Node prop)
Description copied from interface: Behavior
Returns true if supplied condition is satisfied.

Specified by:
isContextConditionSatisfied in interface Behavior
Parameters:
prop - Node
Returns:
true, if is context condition satisfied

isAllContextConditionsSatisfied

public boolean isAllContextConditionsSatisfied()
Description copied from interface: Behavior
Returns true if all context conditions are satisfied.

Specified by:
isAllContextConditionsSatisfied in interface Behavior
Returns:
true, if is all context conditions satisfied

updateContextCondition

public void updateContextCondition(Node broadcastCondition)
Description copied from interface: Behavior
marks supplied condition as present.

Specified by:
updateContextCondition in interface Behavior
Parameters:
broadcastCondition - the condition

updateAddingCondition

public void updateAddingCondition(Node broadcastNode)
Description copied from interface: Behavior
Update adding condition.

Specified by:
updateAddingCondition in interface Behavior
Parameters:
broadcastNode - the broadcast node

updateDeletingCondition

public void updateDeletingCondition(Node broadcastNode)
Description copied from interface: Behavior
Update deleting condition.

Specified by:
updateDeletingCondition in interface Behavior
Parameters:
broadcastNode - the broadcast node

deactiveContextCondition

public void deactiveContextCondition(Node condition)
Description copied from interface: Behavior
Deactive context condition.

Specified by:
deactiveContextCondition in interface Behavior
Parameters:
condition - the condition

addContextCondition

public boolean addContextCondition(Node condition)
Description copied from interface: Behavior
Adds the context condition.

Specified by:
addContextCondition in interface Behavior
Parameters:
condition - the condition
Returns:
true, if successful

addToAddingList

public boolean addToAddingList(Node addResult)
Description copied from interface: Behavior
Adds the to adding list.

Specified by:
addToAddingList in interface Behavior
Parameters:
addResult - the condition
Returns:
true, if successful

addToDeletingList

public boolean addToDeletingList(Node deleteResult)
Description copied from interface: Behavior
Adds the to deleting list.

Specified by:
addToDeletingList in interface Behavior
Parameters:
deleteResult - the delete condition
Returns:
true, if successful

getContextNodes

public java.util.Collection<Node> getContextNodes()
Description copied from interface: Behavior
Gets context nodes.

Specified by:
getContextNodes in interface Behavior
Returns:
the context's nodes

getAddingList

public NodeStructure getAddingList()
Description copied from interface: Behavior
Gets adding list.

Specified by:
getAddingList in interface Behavior
Returns:
the adding list

getDeletingList

public NodeStructure getDeletingList()
Description copied from interface: Behavior
Gets deleting list.

Specified by:
getDeletingList in interface Behavior
Returns:
the deleting list

getContextSize

public int getContextSize()
Description copied from interface: Behavior
Gets context size.

Specified by:
getContextSize in interface Behavior
Returns:
the context size

getAddingListCount

public double getAddingListCount()
Description copied from interface: Behavior
Gets adding list count.

Specified by:
getAddingListCount in interface Behavior
Returns:
the adding list count

getDeletingListCount

public double getDeletingListCount()
Description copied from interface: Behavior
Gets deleting list count.

Specified by:
getDeletingListCount in interface Behavior
Returns:
the deleting list count

getAction

public Action getAction()
Description copied from interface: Behavior
Gets action.

Specified by:
getAction in interface Behavior
Returns:
the Action this behavior contains

getId

public long getId()
Description copied from interface: Behavior
Gets id.

Specified by:
getId in interface Behavior
Returns:
the id

getLabel

public java.lang.String getLabel()
Description copied from interface: Behavior
Gets label.

Specified by:
getLabel in interface Behavior
Returns:
the label

equals

public boolean equals(java.lang.Object o)
Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

decay

public void decay(long ticks)
Description copied from interface: Activatible
decay the current activation using the decay strategy. The decay depends on the time since the last decaying. It is indicated by the parameter ticks.

Specified by:
decay in interface Activatible
Overrides:
decay in class ActivatibleImpl
Parameters:
ticks - the number of ticks to decay

setContextNodeType

public void setContextNodeType(java.lang.String nodeType)
Description copied from interface: Behavior
Sets context node type.

Specified by:
setContextNodeType in interface Behavior
Parameters:
nodeType - the new context node type

getContextNodeType

public java.lang.String getContextNodeType()
Description copied from interface: Behavior
Gets context node type.

Specified by:
getContextNodeType in interface Behavior
Returns:
the context node type

containsContextCondition

public boolean containsContextCondition(Node contextCondition)
Description copied from interface: Behavior
Contains context condition.

Specified by:
containsContextCondition in interface Behavior
Parameters:
contextCondition - the common node
Returns:
true, if successful

containsAddingItem

public boolean containsAddingItem(Node addItem)
Description copied from interface: Behavior
Contains adding item.

Specified by:
containsAddingItem in interface Behavior
Parameters:
addItem - the common node
Returns:
true, if successful

containsDeletingItem

public boolean containsDeletingItem(Node deleteItem)
Description copied from interface: Behavior
Contains deleting item.

Specified by:
containsDeletingItem in interface Behavior
Parameters:
deleteItem - the common node
Returns:
true, if successful

setLabel

public void setLabel(java.lang.String label)
Description copied from interface: Behavior
Sets label.

Specified by:
setLabel in interface Behavior
Parameters:
label - the new label

getGeneratingScheme

public Scheme getGeneratingScheme()
Description copied from interface: Behavior
Gets generating scheme.

Specified by:
getGeneratingScheme in interface Behavior
Returns:
the generating scheme

setGeneratingScheme

public void setGeneratingScheme(Scheme s)
Description copied from interface: Behavior
Sets generating scheme.

Specified by:
setGeneratingScheme in interface Behavior
Parameters:
s - the new generating scheme

getResultSize

public double getResultSize()
Description copied from interface: Behavior
Gets result size.

Specified by:
getResultSize in interface Behavior
Returns:
the result size

getUnsatisfiedContextCount

public int getUnsatisfiedContextCount()
Description copied from interface: Behavior
Gets unsatisfied context count.

Specified by:
getUnsatisfiedContextCount in interface Behavior
Returns:
the unsatisfied context count

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

getContext

public NodeStructure getContext()
Description copied from interface: Behavior
Gets context

Specified by:
getContext in interface Behavior
Returns:
NodeStructure that is the context