nars.entity
Class TaskLink

java.lang.Object
  extended by nars.entity.BudgetValue
      extended by nars.entity.Item
          extended by nars.entity.TermLink
              extended by nars.entity.TaskLink
All Implemented Interfaces:
java.lang.Cloneable

public class TaskLink
extends TermLink

Reference to a Task.

The reason to separate a Task and a TaskLink is that the same Task can be linked from multiple Concepts, with different BudgetValue.


Field Summary
private  java.util.ArrayList<java.lang.String> record
          Remember the TermLinks that has been used recently with this TaskLink
private  Task targetTask
          The Task linked.
 
Fields inherited from class nars.entity.TermLink
COMPONENT, COMPONENT_CONDITION, COMPONENT_STATEMENT, COMPOUND, COMPOUND_CONDITION, COMPOUND_STATEMENT, index, SELF, TRANSFORM, type
 
Fields inherited from class nars.entity.Item
key
 
Fields inherited from class nars.entity.BudgetValue
durability, priority, quality
 
Constructor Summary
TaskLink(Task t, TermLink template, BudgetValue v)
          Constructor
 
Method Summary
(package private)  java.util.ArrayList<java.lang.String> getRecord()
          Get the TermLink record
 Task getTargetTask()
          Get the target Task
 void merge(Item that)
          Merge one TaskLink into another
 boolean novel(TermLink termLink)
          To check whether a TaskLink should use a TermLink, return false if they interacted recently
 
Methods inherited from class nars.entity.TermLink
getIndex, getIndices, getTarget, getType, setKey, toString, toString2
 
Methods inherited from class nars.entity.Item
getBudget, getKey
 
Methods inherited from class nars.entity.BudgetValue
aboveThreshold, clone, decDurability, decPriority, decQuality, getDurability, getPriority, getQuality, incDurability, incPriority, incQuality, merge, setDurability, setPriority, setQuality, summary
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

targetTask

private Task targetTask
The Task linked. The "target" field in TermLink is not used here.


record

private java.util.ArrayList<java.lang.String> record
Remember the TermLinks that has been used recently with this TaskLink

Constructor Detail

TaskLink

public TaskLink(Task t,
                TermLink template,
                BudgetValue v)
Constructor

only called in Memory.continuedProcess

Parameters:
t - The target Task
template - The TermLink template
v - The budget
Method Detail

getTargetTask

public Task getTargetTask()
Get the target Task

Returns:
The linked Task

getRecord

java.util.ArrayList<java.lang.String> getRecord()
Get the TermLink record

Returns:
The list of TermLinks recently used

merge

public void merge(Item that)
Merge one TaskLink into another

Parameters:
that - The other TaskLink

novel

public boolean novel(TermLink termLink)
To check whether a TaskLink should use a TermLink, return false if they interacted recently

called in TermLinkBag only

Parameters:
termLink - The TermLink to be checked
Returns:
Whether they are novel to each other