Serializable
, Cloneable
TruthFunctions.EternalizedTruthValue
public class TruthValue extends Object implements Cloneable, Serializable
Modifier and Type | Field | Description |
---|---|---|
private boolean |
analytic |
Whether the truth value is derived from a definition
|
private double |
confidence |
confidence factor of the truth value
|
private static char |
DELIMITER |
character that marks the two ends of a truth value
|
private float |
frequency |
frequency factor of the truth value
|
private Parameters |
narParameters |
|
private static char |
SEPARATOR |
character that separates the factors in a truth value
|
(package private) static Term |
Truth_FALSE |
|
(package private) static Term |
Truth_TRUE |
|
(package private) static Term |
Truth_UNSURE |
Constructor | Description |
---|---|
TruthValue(float f,
double c,
boolean isAnalytic,
Parameters narParameters) |
Constructor
|
TruthValue(float f,
double c,
Parameters narParameters) |
Constructor
|
TruthValue(TruthValue v) |
Constructor with a TruthValue to clone
|
TruthValue(Parameters narParameters) |
Modifier and Type | Method | Description |
---|---|---|
StringBuilder |
appendString(StringBuilder sb,
boolean external) |
A simplified String representation of a TruthValue
|
TruthValue |
clone() |
|
boolean |
equals(Object that) |
Compare two truth values
|
static TruthValue |
fromWordTerm(Parameters narParameters,
Term term) |
|
boolean |
getAnalytic() |
|
double |
getConfidence() |
returns the confidence value
|
float |
getExpDifAbs(TruthValue t) |
Calculate the absolute difference of the expectation value and that of a
given truth value
|
float |
getExpectation() |
Calculate the expectation value of the truth value
|
float |
getFrequency() |
returns the frequency value
|
int |
hashCode() |
The hash code of a TruthValue
|
static boolean |
isEqual(double a,
double b,
double epsilon) |
|
boolean |
isNegative() |
Check if the truth value is negative
|
TruthValue |
mulConfidence(float mul) |
|
CharSequence |
name() |
|
TruthValue |
set(float frequency,
double confidence) |
|
void |
setAnalytic() |
Set it to analytic truth
|
TruthValue |
setAnalytic(boolean a) |
|
TruthValue |
setConfidence(double c) |
|
TruthValue |
setFrequency(float f) |
|
String |
toString() |
Returns a String representation of a TruthValue, as used internally by the system
|
CharSequence |
toStringExternal() |
output representation
|
Term |
toWordTerm() |
static final Term Truth_TRUE
static final Term Truth_FALSE
static final Term Truth_UNSURE
private static final char DELIMITER
private static final char SEPARATOR
private float frequency
private double confidence
private boolean analytic
private Parameters narParameters
public TruthValue(Parameters narParameters)
narParameters
- parameters of the reasonerpublic TruthValue(float f, double c, Parameters narParameters)
f
- frequency valuec
- confidence valuenarParameters
- parameters of the reasonerpublic TruthValue(float f, double c, boolean isAnalytic, Parameters narParameters)
f
- frequency valuec
- confidence valueisAnalytic
- is the truth value an analytic one?narParameters
- parameters of the reasonerpublic TruthValue(TruthValue v)
v
- truth value to be clonedpublic float getFrequency()
public double getConfidence()
public TruthValue setFrequency(float f)
public TruthValue setConfidence(double c)
public TruthValue mulConfidence(float mul)
public boolean getAnalytic()
public void setAnalytic()
public float getExpectation()
public float getExpDifAbs(TruthValue t)
t
- given valuepublic boolean isNegative()
public static boolean isEqual(double a, double b, double epsilon)
public boolean equals(Object that)
public int hashCode()
public TruthValue clone()
public TruthValue setAnalytic(boolean a)
public StringBuilder appendString(StringBuilder sb, boolean external)
public CharSequence name()
public CharSequence toStringExternal()
public String toString()
public Term toWordTerm()
public static TruthValue fromWordTerm(Parameters narParameters, Term term)
public TruthValue set(float frequency, double confidence)
Copyright © 2020 OpenNARS. All rights reserved.