Serializable
, Cloneable
public class BudgetValue extends Object implements Cloneable, Serializable
Modifier and Type | Field | Description |
---|---|---|
private float |
durability |
The percent of priority to be kept in a constant period; All priority
values "decay" over time, though at different rates.
|
private long |
lastForgetTime |
time at which this budget was last forgotten, for calculating accurate memory decay rates
|
private static char |
MARK |
character that marks the two ends of a budget value
|
private Parameters |
narParameters |
|
private float |
priority |
relative share of time resource to be allocated
|
private float |
quality |
overall (context-independent) evaluation
|
private static char |
SEPARATOR |
character that separates the factors in a budget value
|
Constructor | Description |
---|---|
BudgetValue(float p,
float d,
float q,
Parameters narParameters) |
Constructor with initialization
|
BudgetValue(float p,
float d,
TruthValue qualityFromTruth,
Parameters narParameters) |
|
BudgetValue(BudgetValue v) |
Cloning constructor
|
Modifier and Type | Method | Description |
---|---|---|
boolean |
aboveThreshold() |
Whether the budget should get any processing at all
|
void |
andPriority(float v) |
AND's (multiplies) priority with another value
|
BudgetValue |
clone() |
Cloning method
|
void |
decDurability(float v) |
Decrease durability value by a percentage of the remaining range
|
void |
decPriority(float v) |
Decrease priority value by a percentage of the remaining range
|
void |
decQuality(float v) |
Decrease quality value by a percentage of the remaining range
|
boolean |
equalsByPrecision(Object that) |
|
float |
getDurability() |
Get durability value
|
long |
getLastForgetTime() |
|
float |
getPriority() |
Get priority value
|
float |
getQuality() |
Get quality value
|
boolean |
greaterThan(BudgetValue rhs) |
|
void |
incDurability(float v) |
Increase durability value by a percentage of the remaining range
|
void |
incPriority(float v) |
Increase priority value by a percentage of the remaining range
|
void |
incQuality(float v) |
Increase quality value by a percentage of the remaining range
|
void |
merge(BudgetValue that) |
Merge one BudgetValue into another
|
void |
setDurability(float d) |
Change durability value
|
long |
setLastForgetTime(long currentTime) |
computes the period and sets the current time to the period
|
void |
setPriority(float v) |
Change priority value
|
void |
setQuality(float v) |
Change quality value
|
float |
summary() |
To summarize a BudgetValue into a single number in [0, 1]
|
String |
toString() |
Fully display the BudgetValue
|
String |
toStringExternal() |
Briefly display the BudgetValue
|
private static final char MARK
private static final char SEPARATOR
private float priority
private float durability
private float quality
private long lastForgetTime
private Parameters narParameters
public BudgetValue(float p, float d, TruthValue qualityFromTruth, Parameters narParameters)
public BudgetValue(float p, float d, float q, Parameters narParameters)
p
- Initial priorityd
- Initial durabilityq
- Initial qualitypublic BudgetValue(BudgetValue v)
v
- Budget value to be clonedpublic BudgetValue clone()
public float getPriority()
public final void setPriority(float v)
v
- The new prioritypublic void incPriority(float v)
v
- The increasing percentpublic void andPriority(float v)
public void decPriority(float v)
v
- The decreasing percentpublic float getDurability()
public void setDurability(float d)
d
- The new durabilitypublic void incDurability(float v)
v
- The increasing percentpublic void decDurability(float v)
v
- The decreasing percentpublic float getQuality()
public void setQuality(float v)
v
- The new qualitypublic void incQuality(float v)
v
- The increasing percentpublic void decQuality(float v)
v
- The decreasing percentpublic void merge(BudgetValue that)
that
- The other Budgetpublic boolean greaterThan(BudgetValue rhs)
rhs
- compared truth valuepublic float summary()
public boolean equalsByPrecision(Object that)
public boolean aboveThreshold()
to be revised to depend on how busy the system is
public String toString()
public String toStringExternal()
public long setLastForgetTime(long currentTime)
public long getLastForgetTime()
Copyright © 2020 OpenNARS. All rights reserved.