org.apache.java.recycle
Class GaussianController
java.lang.Object
|
+--org.apache.java.recycle.GaussianController
- public class GaussianController
- extends java.lang.Object
- implements Controller
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.
Method Summary |
void |
down()
Writes on the memory of this controller decrementing the level. |
boolean |
isThereRoomFor(Recyclable object)
Evaluates the room for the object to recycle basing this
decision to the optimum level estrapolated from the
level history. |
void |
up()
Writes on the memory of this controller incrementing the level. |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
GaussianController
public GaussianController()
up
public void up()
- Writes on the memory of this controller incrementing the level.
- Specified by:
- up in interface Controller
down
public void down()
- Writes on the memory of this controller decrementing the level.
- Specified by:
- down in interface Controller
isThereRoomFor
public boolean isThereRoomFor(Recyclable object)
- Evaluates the room for the object to recycle basing this
decision to the optimum level estrapolated from the
level history.
- Specified by:
- isThereRoomFor in interface Controller