|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectch.tatool.core.element.AbstractPropertyHolder
ch.tatool.core.element.NodeImpl
ch.tatool.core.element.handler.timeout.DefaultVisualTimeoutHandler
ch.tatool.core.element.handler.timeout.DefaultAdaptiveTimeoutHandler
public class DefaultAdaptiveTimeoutHandler
Timeout handler that individually adapts itself to the user by reducing and increasing the timeout duration. The interval of adaptation is given by the minDuration and maxDuration values. A level change resets the timeout duration.
| Field Summary |
|---|
| Fields inherited from class ch.tatool.core.element.handler.timeout.DefaultVisualTimeoutHandler |
|---|
durationProperty, PROPERTY_DURATION, PROPERTY_REACTION_TIME, reactionTimeProperty, timer |
| Constructor Summary | |
|---|---|
DefaultAdaptiveTimeoutHandler()
|
|
| Method Summary | |
|---|---|
void |
adaptTimeoutDuration(ExecutionContext event)
Individually adapts the timer. |
void |
decreaseTimeoutDuration(ExecutionContext event)
Reduces the timer by the factor f with a minimum of minDuration |
float |
getFactor()
|
double |
getInterpolatedValue(Long[] m,
double percentile)
Calculates the percentile of an array of longs. |
long |
getMaxTimerDuration()
|
long |
getMinTimerDuration()
|
double |
getPercentile()
|
double |
getPercentile(Long[] m,
double percentile)
TODO: NOT USED ANYMORE?! |
long |
getSamplesDuration(ExecutionContext event)
Gets the reaction time of the n last trials (n=maxSamples) and calculates the 3rd quartile |
int |
getTimerSampleSize()
|
void |
increaseTimeoutDuration(ExecutionContext event)
Increases the timer by the factor f with a maximum of maxDuration |
boolean |
isResetTimerDuration()
|
void |
processExecutionPhase(ExecutionContext event)
|
void |
resetTimeoutDuration(ExecutionContext event)
Sets the duration of the timer to maxDuration |
void |
setFactor(float factor)
|
void |
setMaxTimerDuration(long maxTimerDuration)
|
void |
setMinTimerDuration(long minTimerDuration)
|
void |
setPercentile(double percentile)
|
void |
setResetTimerDuration(boolean resetTimerDuration)
|
void |
setTimerSampleSize(int timerSampleSize)
|
| Methods inherited from class ch.tatool.core.element.handler.timeout.DefaultVisualTimeoutHandler |
|---|
cancelTimeout, getDefaultTimerDuration, getReactionTime, getTimerStartTimestamp, setDefaultTimerDuration, setReactionTime, startTimeout, timerElapsed |
| 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.core.element.handler.timeout.TimeoutHandler |
|---|
cancelTimeout, getDefaultTimerDuration, setDefaultTimerDuration, startTimeout |
| Methods inherited from interface ch.tatool.element.Node |
|---|
getParent, setParent |
| Methods inherited from interface ch.tatool.data.PropertyHolder |
|---|
clearProperties, getId, getKeys, getProperty, removeProperty, setProperty |
| Constructor Detail |
|---|
public DefaultAdaptiveTimeoutHandler()
| Method Detail |
|---|
public void processExecutionPhase(ExecutionContext event)
processExecutionPhase in interface ExecutionPhaseListenerprocessExecutionPhase in class DefaultVisualTimeoutHandlerpublic void adaptTimeoutDuration(ExecutionContext event)
adaptTimeoutDuration in interface AdaptiveTimeoutHandlerpublic long getSamplesDuration(ExecutionContext event)
public void resetTimeoutDuration(ExecutionContext event)
resetTimeoutDuration in interface AdaptiveTimeoutHandlerpublic void decreaseTimeoutDuration(ExecutionContext event)
decreaseTimeoutDuration in interface AdaptiveTimeoutHandlerpublic void increaseTimeoutDuration(ExecutionContext event)
increaseTimeoutDuration in interface AdaptiveTimeoutHandler
public double getInterpolatedValue(Long[] m,
double percentile)
m - has to be an ordered list
public double getPercentile(Long[] m,
double percentile)
public int getTimerSampleSize()
public void setTimerSampleSize(int timerSampleSize)
public double getPercentile()
public void setPercentile(double percentile)
public float getFactor()
public void setFactor(float factor)
public long getMinTimerDuration()
public void setMinTimerDuration(long minTimerDuration)
public long getMaxTimerDuration()
public void setMaxTimerDuration(long maxTimerDuration)
public boolean isResetTimerDuration()
public void setResetTimerDuration(boolean resetTimerDuration)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||