Serializable, TLink<Task>public class TaskLink extends Item<Task> implements TLink<Task>, Serializable
The reason to separate a Task and a TaskLink is that the same Task can be linked from multiple Concepts, with different BudgetValue. TaskLinks are unique according to the Task they reference
| Modifier and Type | Class | Description |
|---|---|---|
static class |
TaskLink.Recording |
Item.ItemPriorityComparator<E extends Item>, Item.StringKeyItem| Modifier and Type | Field | Description |
|---|---|---|
int |
hash |
|
short[] |
index |
The index of the component in the component list of the compound, may have up to 4 levels
|
private int |
recordLength |
|
Deque<TaskLink.Recording> |
records |
The usage record
|
Task |
targetTask |
The Task linked.
|
short |
type |
The type of link, one of the above
|
| Constructor | Description |
|---|---|
TaskLink(Task t,
TermLink template,
BudgetValue v,
int recordLength) |
Constructor
|
| Modifier and Type | Method | Description |
|---|---|---|
boolean |
equals(Object obj) |
|
short |
getIndex(int i) |
Get one index by level
|
Task |
getTarget() |
Get the target Task
|
Term |
getTerm() |
|
int |
hashCode() |
|
Task |
name() |
Get the current key
|
boolean |
novel(TermLink termLink,
long currentTime,
Parameters narParameters) |
To check whether a TaskLink should use a TermLink, return false if they
interacted recently
|
boolean |
novel(TermLink termLink,
long currentTime,
Parameters narParameters,
boolean transformTask) |
|
String |
toString() |
Return a String representation of the Item
|
String |
toStringBrief() |
decDurability, decPriority, getBudget, getDurability, getPriority, getPrioritySum, getQuality, incDurability, incPriority, merge, setDurability, setPriority, setQuality, toStringExternal, toStringExternal2, toStringLongclone, finalize, getClass, notify, notifyAll, wait, wait, waitgetPrioritypublic final Task targetTask
private final int recordLength
public int hash
public final Deque<TaskLink.Recording> records
public final short type
public final short[] index
public TaskLink(Task t, TermLink template, BudgetValue v, int recordLength)
only called in Memory.continuedProcess
t - The target Tasktemplate - The TermLink templatev - The budgetpublic final short getIndex(int i)
public boolean novel(TermLink termLink, long currentTime, Parameters narParameters)
called in TermLinkBag only
termLink - The TermLink to be checkedcurrentTime - The current timepublic boolean novel(TermLink termLink, long currentTime, Parameters narParameters, boolean transformTask)
public String toString()
Itempublic String toStringBrief()
public Task getTarget()
public Term getTerm()
Copyright © 2020 OpenNARS. All rights reserved.