Class SpeedManagerPingMapperImpl
java.lang.Object
com.biglybt.core.speedmanager.impl.SpeedManagerPingMapperImpl
- All Implemented Interfaces:
SpeedManagerPingMapper
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static classprivate static classprivate static class -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate intprivate static final intprivate intprivate Fileprivate LinkedListprivate LinkedListprivate intprivate int(package private) static final intprivate final intprivate final Stringprivate intprivate SpeedManagerPingMapperImpl.pingValue[]private final int[]private intprivate LinkedList(package private) static final int(package private) static final int(package private) static final int(package private) static final intprivate static final intprivate static final intprivate final SpeedManagerImplprivate intprivate final booleanprivate final boolean(package private) static final int(package private) static final int(package private) static final intprivate final int[]private final int[] -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedSpeedManagerPingMapperImpl(SpeedManagerImpl _speed_manager, String _name, int _entries, boolean _variance, boolean _transient) -
Method Summary
Modifier and TypeMethodDescriptionprotected voidaddPing(long _x, long _y, int rtt, boolean re_base) protected SpeedManagerPingMapperImpl.regionaddPingSupport(int x, int y, int rtt, int metric) protected voidaddSpeed(long x, long y) protected voidaddSpeedSupport(int x, int y) protected SpeedManagerLimitEstimateadjustForPersistence(SpeedManagerPingMapperImpl.limitEstimate estimate, SpeedManagerPingMapperImpl.limitEstimate best_good, SpeedManagerPingMapperImpl.limitEstimate last_bad, boolean persistent) protected voidcheckCapacityDecrease(boolean is_up, SpeedManagerPingMapperImpl.limitEstimate capacity, LinkedList bads) protected doubleconvertMetricToRating(int metric) voiddestroy()protected voidgenerateEvidence(IndentWriter writer) double+1 : good -1 : bad >-1 invalid input: '<'+1 : relative goodness/badnessgetEstimatedDownloadLimit(boolean persistent) protected SpeedManagerPingMapperImpl.limitEstimategetEstimatedLimit(boolean up) getEstimatedUploadLimit(boolean persistent) int[][]protected StringgetLimitStr(List limits, boolean short_form) protected StringgetLimitString(List limits) getName()protected SpeedManagerPingMapperImpl.limitEstimateprotected StringgetZones()protected voidinit()booleanisActive()protected voidloadHistory(File file) protected SpeedManagerPingMapperImpl.limitEstimateprotected LinkedListloadLimits(Map map, String name) protected voidstatic voidprotected voidreset()protected voidprotected Mapprotected voidsaveLimits(Map map, String name, List limits) voidsetEstimatedDownloadCapacityBytesPerSec(long bytes_per_sec, float estimate_type) voidsetEstimatedUploadCapacityBytesPerSec(long bytes_per_sec, float estimate_type) protected void
-
Field Details
-
VARIANCE_GOOD_VALUE
static final int VARIANCE_GOOD_VALUE- See Also:
-
VARIANCE_BAD_VALUE
static final int VARIANCE_BAD_VALUE- See Also:
-
VARIANCE_MAX
static final int VARIANCE_MAX- See Also:
-
RTT_BAD_MIN
static final int RTT_BAD_MIN- See Also:
-
RTT_BAD_MAX
static final int RTT_BAD_MAX- See Also:
-
RTT_MAX
static final int RTT_MAX- See Also:
-
MAX_BAD_LIMIT_HISTORY
static final int MAX_BAD_LIMIT_HISTORY- See Also:
-
SPEED_DIVISOR
static final int SPEED_DIVISOR- See Also:
-
SPEED_HISTORY_PERIOD
private static final int SPEED_HISTORY_PERIOD- See Also:
-
SPEED_HISTORY_COUNT
private static final int SPEED_HISTORY_COUNT- See Also:
-
speed_manager
-
name
-
variance
private final boolean variance -
trans
private final boolean trans -
ping_count
private int ping_count -
pings
-
max_pings
private final int max_pings -
prev_ping
-
x_speeds
private final int[] x_speeds -
y_speeds
private final int[] y_speeds -
speeds_next
private int speeds_next -
regions
-
last_x
private int last_x -
last_y
private int last_y -
recent_metrics
private final int[] recent_metrics -
recent_metrics_next
private int recent_metrics_next -
up_estimate
-
down_estimate
-
last_bad_ups
-
last_bad_downs
-
BAD_PROGRESS_COUNTDOWN
private static final int BAD_PROGRESS_COUNTDOWN- See Also:
-
last_bad_up
-
bad_up_in_progress_count
private int bad_up_in_progress_count -
last_bad_down
-
bad_down_in_progress_count
private int bad_down_in_progress_count -
best_good_up
-
best_good_down
-
up_capacity
-
down_capacity
-
history_file
-
-
Constructor Details
-
SpeedManagerPingMapperImpl
protected SpeedManagerPingMapperImpl(SpeedManagerImpl _speed_manager, String _name, int _entries, boolean _variance, boolean _transient)
-
-
Method Details
-
init
protected void init() -
loadHistory
-
saveHistory
protected void saveHistory() -
loadLimits
-
loadLimit
-
saveLimits
-
saveLimit
-
isActive
public boolean isActive()- Specified by:
isActivein interfaceSpeedManagerPingMapper
-
getNullLimit
-
getLimitString
-
log
-
getName
- Specified by:
getNamein interfaceSpeedManagerPingMapper
-
addSpeed
protected void addSpeed(long x, long y) -
addSpeedSupport
protected void addSpeedSupport(int x, int y) -
addPing
protected void addPing(long _x, long _y, int rtt, boolean re_base) -
addPingSupport
-
getHistory
public int[][] getHistory()- Specified by:
getHistoryin interfaceSpeedManagerPingMapper
-
getZones
- Specified by:
getZonesin interfaceSpeedManagerPingMapper
-
getEstimatedUploadLimit
- Specified by:
getEstimatedUploadLimitin interfaceSpeedManagerPingMapper
-
getEstimatedDownloadLimit
- Specified by:
getEstimatedDownloadLimitin interfaceSpeedManagerPingMapper
-
getLastBadUploadLimit
- Specified by:
getLastBadUploadLimitin interfaceSpeedManagerPingMapper
-
getLastBadDownloadLimit
- Specified by:
getLastBadDownloadLimitin interfaceSpeedManagerPingMapper
-
getBadUploadHistory
- Specified by:
getBadUploadHistoryin interfaceSpeedManagerPingMapper
-
getBadDownloadHistory
- Specified by:
getBadDownloadHistoryin interfaceSpeedManagerPingMapper
-
adjustForPersistence
protected SpeedManagerLimitEstimate adjustForPersistence(SpeedManagerPingMapperImpl.limitEstimate estimate, SpeedManagerPingMapperImpl.limitEstimate best_good, SpeedManagerPingMapperImpl.limitEstimate last_bad, boolean persistent) -
updateLimitEstimates
protected void updateLimitEstimates() -
checkCapacityDecrease
protected void checkCapacityDecrease(boolean is_up, SpeedManagerPingMapperImpl.limitEstimate capacity, LinkedList bads) -
getEstimatedLimit
-
getCurrentMetricRating
public double getCurrentMetricRating()Description copied from interface:SpeedManagerPingMapper+1 : good -1 : bad >-1 invalid input: '<'+1 : relative goodness/badness- Specified by:
getCurrentMetricRatingin interfaceSpeedManagerPingMapper- Returns:
-
getEstimatedUploadCapacityBytesPerSec
-
setEstimatedDownloadCapacityBytesPerSec
public void setEstimatedDownloadCapacityBytesPerSec(long bytes_per_sec, float estimate_type) -
getEstimatedDownloadCapacityBytesPerSec
-
setEstimatedUploadCapacityBytesPerSec
public void setEstimatedUploadCapacityBytesPerSec(long bytes_per_sec, float estimate_type) -
reset
protected void reset() -
convertMetricToRating
protected double convertMetricToRating(int metric) -
getLimitStr
-
getShortString
-
generateEvidence
-
destroy
public void destroy()- Specified by:
destroyin interfaceSpeedManagerPingMapper
-
main
-