|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnars.entity.BudgetValue
public class BudgetValue
A triple of priority (current), durability (decay), and quality (long-term average).
Field Summary | |
---|---|
protected ShortFloat |
durability
The percent of priority to be kept in a constant period |
private static char |
MARK
The charactor that marks the two ends of a budget value |
protected ShortFloat |
priority
The relative share of time resource to be allocated |
protected ShortFloat |
quality
The overall (context-independent) evaluation |
private static char |
SEPARATOR
The charactor that separates the factors in a budget value |
Constructor Summary | |
---|---|
BudgetValue()
Default constructor |
|
BudgetValue(BudgetValue v)
Cloning constructor |
|
BudgetValue(float p,
float d,
float q)
Constructor with initialization |
Method Summary | |
---|---|
boolean |
aboveThreshold()
Whether the budget should get any processing at all |
java.lang.Object |
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 |
float |
getDurability()
Get durability value |
float |
getPriority()
Get priority value |
float |
getQuality()
Get quality value |
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 v)
Change durability value |
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] |
java.lang.String |
toString()
Fully display the BudgetValue |
java.lang.String |
toString2()
Briefly display the BudgetValue |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
private static final char MARK
private static final char SEPARATOR
protected ShortFloat priority
protected ShortFloat durability
protected ShortFloat quality
Constructor Detail |
---|
public BudgetValue()
public BudgetValue(float p, float d, float q)
p
- Initial priorityd
- Initial durabilityq
- Initial qualitypublic BudgetValue(BudgetValue v)
v
- Budget value to be clonedMethod Detail |
---|
public java.lang.Object clone()
clone
in class java.lang.Object
public float getPriority()
public void setPriority(float v)
v
- The new prioritypublic void incPriority(float v)
v
- The increasing percentpublic void decPriority(float v)
v
- The decreasing percentpublic float getDurability()
public void setDurability(float v)
v
- 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 float summary()
public boolean aboveThreshold()
to be revised to depend on how busy the system is
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String toString2()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |