ch.tatool.core.element.handler.score
Class DefaultPointsAndLevelHandler

java.lang.Object
  extended by ch.tatool.core.element.AbstractPropertyHolder
      extended by ch.tatool.core.element.NodeImpl
          extended by ch.tatool.core.element.handler.score.AbstractPointsAndLevelHandler
              extended by ch.tatool.core.element.handler.score.DefaultPointsAndLevelHandler
All Implemented Interfaces:
PointsAndLevelHandler, PropertyHolder, Node, ExecutionPhaseListener

public class DefaultPointsAndLevelHandler
extends AbstractPointsAndLevelHandler

Default implementation of a score and level handler. Checks for the performance after all n trials

Author:
Andre Locher

Nested Class Summary
 
Nested classes/interfaces inherited from interface ch.tatool.core.element.handler.score.PointsAndLevelHandler
PointsAndLevelHandler.LevelListener, PointsAndLevelHandler.PointAdaptor
 
Field Summary
static String PROPERTY_LEVEL_COUNTER
           
static String PROPERTY_LEVEL_MAXPOINTS
           
static String PROPERTY_LEVEL_PERFORMANCE
           
static String PROPERTY_LEVEL_TOTALPOINTS
           
 
Fields inherited from class ch.tatool.core.element.handler.score.AbstractPointsAndLevelHandler
startLevel, startMaxPoints, startMinPoints, startPoints, ZERO_POINTS
 
Constructor Summary
DefaultPointsAndLevelHandler()
           
 
Method Summary
protected  int checkLevelChange(ExecutionContext context, int currentLevel)
          Overwrite to implement a different level/points logic.
 HashMap<Integer,Integer> getLevelData()
           
 double getMaxThreshold()
           
 double getMinThreshold()
           
 HashMap<Integer,Integer> getPerformanceData()
           
 int getSampleSize()
           
 void initializeAlgorithm(ExecutionContext event)
          Initializes the algorithm with the values of the DB.
protected  void initializeHandler(ExecutionContext context)
          Initializes the algorithm with the values of the DB at session start
 void setMaxThreshold(double maxThreshold)
           
 void setMinThreshold(double minThreshold)
           
 void setSampleSize(int sampleSize)
           
 
Methods inherited from class ch.tatool.core.element.handler.score.AbstractPointsAndLevelHandler
getDescription, informLevelChangeListeners, processExecutionPhase, processLevel, processPoints, setDescription, updateStatusRegion, updateTotals
 
Methods inherited from class ch.tatool.core.element.NodeImpl
assignParent, assignParent, assignParents, getId, getLocalId, getParent, setId, setLocalId, setParent
 
Methods inherited from class ch.tatool.core.element.AbstractPropertyHolder
clearProperties, getKeys, getProperty, removeProperty, setProperty
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface ch.tatool.element.Node
getParent, setParent
 
Methods inherited from interface ch.tatool.data.PropertyHolder
clearProperties, getId, getKeys, getProperty, removeProperty, setProperty
 

Field Detail

PROPERTY_LEVEL_COUNTER

public static final String PROPERTY_LEVEL_COUNTER
See Also:
Constant Field Values

PROPERTY_LEVEL_PERFORMANCE

public static final String PROPERTY_LEVEL_PERFORMANCE
See Also:
Constant Field Values

PROPERTY_LEVEL_TOTALPOINTS

public static final String PROPERTY_LEVEL_TOTALPOINTS
See Also:
Constant Field Values

PROPERTY_LEVEL_MAXPOINTS

public static final String PROPERTY_LEVEL_MAXPOINTS
See Also:
Constant Field Values
Constructor Detail

DefaultPointsAndLevelHandler

public DefaultPointsAndLevelHandler()
Method Detail

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

getPerformanceData

public HashMap<Integer,Integer> getPerformanceData()

getLevelData

public HashMap<Integer,Integer> getLevelData()

getMaxThreshold

public double getMaxThreshold()

setMaxThreshold

public void setMaxThreshold(double maxThreshold)

getMinThreshold

public double getMinThreshold()

setMinThreshold

public void setMinThreshold(double minThreshold)

getSampleSize

public int getSampleSize()

setSampleSize

public void setSampleSize(int sampleSize)


Copyright © 2012. All Rights Reserved.