edu.memphis.ccrg.lida.framework.strategies
Class LinearDecayStrategy
java.lang.Object
edu.memphis.ccrg.lida.framework.strategies.StrategyImpl
edu.memphis.ccrg.lida.framework.strategies.LinearDecayStrategy
- All Implemented Interfaces:
- Initializable, DecayStrategy, Strategy, java.io.Serializable
public class LinearDecayStrategy
- extends StrategyImpl
- implements DecayStrategy
Basic DecayStrategy
governed by a linear curve.
- See Also:
- Serialized Form
Method Summary |
double |
decay(double currentActivation,
long ticks,
java.util.Map<java.lang.String,? extends java.lang.Object> params)
|
double |
decay(double currentActivation,
long ticks,
java.lang.Object... params)
Decays the current activation according to some internal decay function. |
void |
init()
This is a convenience method to initialize this Object. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
LinearDecayStrategy
public LinearDecayStrategy()
- Creates a new instance of LinearCurve. Values for slope and intercept are
set to the default ones.
init
public void init()
- Description copied from interface:
Initializable
- This is a convenience method to initialize this Object. It is called from init(Map parameters).
Subclasses can overwrite this method in order to initialize this Object. But make sure to call super.init();
at the beginning of the implementation of this method.
- Specified by:
init
in interface Initializable
- Overrides:
init
in class StrategyImpl
decay
public double decay(double currentActivation,
long ticks,
java.lang.Object... params)
- Description copied from interface:
DecayStrategy
- Decays the current activation according to some internal decay function.
- Specified by:
decay
in interface DecayStrategy
- Parameters:
currentActivation
- activation of the entity before decay.ticks
- The number of ticks to decay.params
- optional parameters
- Returns:
- new activation
decay
public double decay(double currentActivation,
long ticks,
java.util.Map<java.lang.String,? extends java.lang.Object> params)
- Specified by:
decay
in interface DecayStrategy
- Parameters:
currentActivation
- activation of the entity before decay.ticks
- how much time has passed since last decayparams
- parameters
- Returns:
- new activation amount