nars.entity
Class TemporalValue

java.lang.Object
  extended by nars.entity.TemporalValue

public class TemporalValue
extends java.lang.Object

Temporal information, in terms of the internal clock of the system. In an Implication or Equivalence, the value indicates the interval from the first event to the second. In a Conjunction, the value can only be 0 (parallel) or 1 (suquential). In a Sentence, the value indicates the interval from when the sentence is created to when the event happens.


Field Summary
private  int delta
           
 
Constructor Summary
TemporalValue(int t)
          Constructor, with a given number
TemporalValue(java.lang.String s)
          Constructor, with a String representation
 
Method Summary
static boolean closer(TemporalValue t1, TemporalValue t2, TemporalValue t)
          Check if the first temporal valie is closer to the given time than the second
static boolean equal(TemporalValue t1, TemporalValue t2)
          Check if two temporal values have the same content
 int getDelta()
          Directly report the time difference
static TemporalValue getReverse(TemporalValue t)
          Get the reverse temporal difference of a given one
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

delta

private int delta
Constructor Detail

TemporalValue

public TemporalValue(int t)
Constructor, with a given number

Parameters:
t - The temporal difference of the item

TemporalValue

public TemporalValue(java.lang.String s)
Constructor, with a String representation

Parameters:
s - The temporal difference of the item as a String
Method Detail

getDelta

public int getDelta()
Directly report the time difference

Returns:
The delta value

getReverse

public static TemporalValue getReverse(TemporalValue t)
Get the reverse temporal difference of a given one

Parameters:
t - The given temporal value
Returns:
The reverse temporal value

equal

public static boolean equal(TemporalValue t1,
                            TemporalValue t2)
Check if two temporal values have the same content

Parameters:
t1 - The first temporal value
t2 - The second temporal value
Returns:
If the two dicuate the same temporal relation

closer

public static boolean closer(TemporalValue t1,
                             TemporalValue t2,
                             TemporalValue t)
Check if the first temporal valie is closer to the given time than the second

Parameters:
t1 - The first temporal value
t2 - The second temporal value
t - The target temporal value
Returns:
If the first is closer to the target