ch.tatool.core.element.handler.score
Class AdaptiveScoreAndLevelHandler
java.lang.Object
ch.tatool.core.element.AbstractPropertyHolder
ch.tatool.core.element.NodeImpl
ch.tatool.core.element.handler.score.AbstractPointsAndLevelHandler
ch.tatool.core.element.handler.score.AdaptiveScoreAndLevelHandler
- All Implemented Interfaces:
- PointsAndLevelHandler, PropertyHolder, Node, ExecutionPhaseListener
public class AdaptiveScoreAndLevelHandler
- extends AbstractPointsAndLevelHandler
Adaptive Score and Level Algorithm
The score and level algorithm adapts itself to the performance of the user.
After a given interval of trials the algorithm sets a benchmark according to
the performance of the user. This benchmark will then be used to compare to
the actual performance after the next interval of trials. Given the user
beats his own benchmark, a level-up will be triggered and a new benchmark
will be set. If the user can't beat his own benchmark, he has to continue
trying.
- Author:
- Andre Locher
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
PROPERTY_BENCHMARK
public static final String PROPERTY_BENCHMARK
- See Also:
- Constant Field Values
PROPERTY_BENCHMARK_COUNTER
public static final String PROPERTY_BENCHMARK_COUNTER
- See Also:
- Constant Field Values
PROPERTY_PERFORMANCE
public static final String PROPERTY_PERFORMANCE
- See Also:
- Constant Field Values
PROPERTY_TOTALPOINTS
public static final String PROPERTY_TOTALPOINTS
- See Also:
- Constant Field Values
PROPERTY_MAXPOINTS
public static final String PROPERTY_MAXPOINTS
- See Also:
- Constant Field Values
RESET
public static final int RESET
- See Also:
- Constant Field Values
INCREASE
public static final int INCREASE
- See Also:
- Constant Field Values
REDUCE
public static final int REDUCE
- See Also:
- Constant Field Values
ADAPT
public static final int ADAPT
- See Also:
- Constant Field Values
AdaptiveScoreAndLevelHandler
public AdaptiveScoreAndLevelHandler()
initializeHandler
protected void initializeHandler(ExecutionContext context)
- Initializes the algorithm with the values of the DB at session start
- Specified by:
initializeHandler in class AbstractPointsAndLevelHandler
initializeAlgorithm
public void initializeAlgorithm(ExecutionContext event)
- Initializes the algorithm with the values of the DB.
checkLevelChange
protected int checkLevelChange(ExecutionContext context,
int currentLevel)
- Description copied from class:
AbstractPointsAndLevelHandler
- Overwrite to implement a different level/points logic.
Default logic simply uses += level = > +- 100.
- Specified by:
checkLevelChange in class AbstractPointsAndLevelHandler
- Returns:
- the new level. This can be the old level value
getBenchmarkSampleSize
public int getBenchmarkSampleSize()
setBenchmarkSampleSize
public void setBenchmarkSampleSize(int benchmarkSampleSize)
getBenchmarkRaise
public double getBenchmarkRaise()
setBenchmarkRaise
public void setBenchmarkRaise(double benchmarkRaise)
getMinBenchmark
public double getMinBenchmark()
setMinBenchmark
public void setMinBenchmark(double minBenchmark)
getMaxBenchmark
public double getMaxBenchmark()
setMaxBenchmark
public void setMaxBenchmark(double maxBenchmark)
getNumRetriesTimer
public int getNumRetriesTimer()
setNumRetriesTimer
public void setNumRetriesTimer(int numRetriesTimer)
getNumRetriesBenchmark
public int getNumRetriesBenchmark()
setNumRetriesBenchmark
public void setNumRetriesBenchmark(int numRetriesBenchmark)
Copyright © 2012. All Rights Reserved.