|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectdasher.CDasherComponent
dasher.CAutoSpeedControl
public class CAutoSpeedControl
AutoSpeedControl is responsible for adaptively tuning Dasher's maximum speed by observing user actions whilst dashing.
At present it is only used by DefaultFilter.
Its mode of action essentially involves observing how 'eratically' the user is behaving, something quantised by the angle they tend to move at compared to due East (in a left-to-right configuration).
A more scientific description can be found in dasher/Doc/speedcontrol.tex in the original Dasher source distribution, available from www.dasher.org.uk
| Field Summary | |
|---|---|
protected double |
m_dBitrate
Current maximum speed. |
protected double |
m_dChange1
Fractional changes to speed which can be used to control speed. |
protected double |
m_dChange2
Fractional changes to speed which can be used to control speed. |
protected double |
m_dChange3
Fractional changes to speed which can be used to control speed. |
protected double |
m_dChange4
Fractional changes to speed which can be used to control speed. |
protected java.util.LinkedList<java.lang.Double> |
m_dequeAngles
List of the previous angles observed. |
protected double |
m_dMinRadius
Variables for adaptive radius calculations |
protected double |
m_dMinRRate
Controls rate at which MinRadius is adapted; higher means slower. |
protected double |
m_dSampleOffset
TODO Find out what this does |
protected double |
m_dSampleScale
TODO Find out what this does |
protected double |
m_dSensitivity
Currently unused; may be used to tune the sensitivity of auto speed-control in the future. |
protected double |
m_dSigma1
Variables for adaptive radius calculations |
protected double |
m_dSigma2
Variables for adaptive radius calculations |
protected double |
m_dSpeedMax
Maximum and minimum speed limits |
protected double |
m_dSpeedMin
Maximum and minimum speed limits |
protected double |
m_dTier1
Critical points in user's movement angle variance. |
protected double |
m_dTier2
Critical points in user's movement angle variance. |
protected double |
m_dTier3
Critical points in user's movement angle variance. |
protected double |
m_dTier4
Critical points in user's movement angle variance. |
protected int |
m_nSpeedCounter
How many samples have been taken to date |
protected int |
m_nSpeedSamples
Maximum number of samples to take |
| Fields inherited from class dasher.CDasherComponent |
|---|
m_EventHandler, m_SettingsStore |
| Constructor Summary | |
|---|---|
CAutoSpeedControl(CEventHandler EventHandler,
CSettingsStore SettingsStore,
double dFrameRate)
Creates a new speed controller configured with a sample size appropriate to the reported frame rate. |
|
| Method Summary | |
|---|---|
protected double |
round(double dVal)
Rounds a double to the nearest integer without casting to an integer type. |
void |
SpeedControl(long iDasherX,
long iDasherY,
double dFrameRate,
CDasherView View)
AUTOMATIC SPEED CONTROL, CEH 7/05: Analyse variance of angle mouse position makes with +ve x-axis in Dasher-space. |
protected double |
UpdateBitrate()
Updates the current dasher speed according to the current variance in the user's angle of attack. |
protected double |
UpdateMinRadius()
Finds adaptive minimum radius for auto-speed control. |
protected int |
UpdateSampleSize(double dFrameRate)
Determines the number of speed samples to take into account, based on the current frame rate and the user's movement rate. |
void |
UpdateSigmas(double r,
double dFrameRate)
Updates VARIANCES of two populations of mixture-of-2-centred-Gaussians model! |
protected double |
Variance()
Finds the variance in the user's angle of movement. |
| Methods inherited from class dasher.CDasherComponent |
|---|
GetBoolParameter, GetLongParameter, GetParameterName, GetParameterType, GetStringParameter, HandleEvent, InsertEvent, SetBoolParameter, SetLongParameter, SetStringParameter, UnregisterComponent |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected double m_dBitrate
protected double m_dSampleScale
protected double m_dSampleOffset
protected int m_nSpeedCounter
protected int m_nSpeedSamples
protected double m_dSpeedMax
protected double m_dSpeedMin
protected double m_dTier1
protected double m_dTier2
protected double m_dTier3
protected double m_dTier4
protected double m_dChange1
Tier 4 represents the greatest change, so we must have 1 < 2 < 3 < 4.
protected double m_dChange2
Tier 4 represents the greatest change, so we must have 1 < 2 < 3 < 4.
protected double m_dChange3
Tier 4 represents the greatest change, so we must have 1 < 2 < 3 < 4.
protected double m_dChange4
Tier 4 represents the greatest change, so we must have 1 < 2 < 3 < 4.
protected double m_dMinRRate
protected double m_dSensitivity
protected java.util.LinkedList<java.lang.Double> m_dequeAngles
protected double m_dSigma1
protected double m_dSigma2
protected double m_dMinRadius
| Constructor Detail |
|---|
public CAutoSpeedControl(CEventHandler EventHandler,
CSettingsStore SettingsStore,
double dFrameRate)
EventHandler - Event handler to dispatch and received events.SettingsStore - Settings store to retrieve and set settings.dFrameRate - Initial frame rate, in FPS.| Method Detail |
|---|
protected double UpdateBitrate()
Also caps the new speed at SpeedMin and SpeedMax.
protected double Variance()
protected int UpdateSampleSize(double dFrameRate)
dFrameRate - Current frame rate
protected double UpdateMinRadius()
public void UpdateSigmas(double r,
double dFrameRate)
r - Current minimum radiusdFrameRate - Current Dasher frame rate in FPS
public void SpeedControl(long iDasherX,
long iDasherY,
double dFrameRate,
CDasherView View)
SpeedControl alters the LP_MAX_BITRATE parameter to reflect the perceived user's need.
iDasherX - User's current mouse position in Dasher co-ordinatesiDasherY - User's current mouse position in Dasher co-ordinatesdFrameRate - Current Dasher frame rate in FPSView - Current DasherView, used to ascertain the user's true
mouse position.protected double round(double dVal)
dVal - Value to round
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||