org.jwarp.util.recycle
Class GaussianController
java.lang.Object
|
+--org.jwarp.util.recycle.GaussianController
- All Implemented Interfaces:
- IController
- public class GaussianController
- extends java.lang.Object
- implements IController
This is an adaptive controller based on a statistical analysis of
the level transitions. The optimal level is derived from
the variance of the transitions using the following equation:
adaptiveLevel = bias + factor * standardDeviation
where the standard deviation signifies the variability of level
around its average.
This class creates a convergence of the system Container-Controller
to a point in which the average level tends to its standard deviation.
This creates a negative feedback that stabilizes the system.
NOTE: This class is only experimental and it is meant to show only a more
complex implementation of a Controller. The routines
that calculate the statistical parameters this class uses to determine
the level use heavy calculations and should be used only when a
very precise adaptivity is required.
- Author:
- Anatole Tresch
|
Method Summary |
boolean |
canAddObject(IRecyclable object)
Evaluates the room for the object to recycle basing this
decision to the optimum level estrapolated from the
level history. |
void |
objectAdded()
Writes on the memory of this controller incrementing the level. |
void |
objectRemoved()
Writes on the memory of this controller decrementing the level. |
| Methods inherited from class java.lang.Object |
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
GaussianController
public GaussianController()
objectAdded
public void objectAdded()
- Writes on the memory of this controller incrementing the level.
- Specified by:
objectAdded in interface IController
objectRemoved
public void objectRemoved()
- Writes on the memory of this controller decrementing the level.
- Specified by:
objectRemoved in interface IController
canAddObject
public boolean canAddObject(IRecyclable object)
- Evaluates the room for the object to recycle basing this
decision to the optimum level estrapolated from the
level history.
- Specified by:
canAddObject in interface IController