Class SpeedManagerPingMapperImpl
java.lang.Object
com.biglybt.core.speedmanager.impl.SpeedManagerPingMapperImpl
- All Implemented Interfaces:
SpeedManagerPingMapper
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static class
private static class
private static class
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate int
private static final int
private int
private File
private LinkedList
private LinkedList
private int
private int
(package private) static final int
private final int
private final String
private int
private SpeedManagerPingMapperImpl.pingValue[]
private final int[]
private int
private LinkedList
(package private) static final int
(package private) static final int
(package private) static final int
(package private) static final int
private static final int
private static final int
private final SpeedManagerImpl
private int
private final boolean
private final boolean
(package private) static final int
(package private) static final int
(package private) static final int
private final int[]
private final int[]
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
SpeedManagerPingMapperImpl
(SpeedManagerImpl _speed_manager, String _name, int _entries, boolean _variance, boolean _transient) -
Method Summary
Modifier and TypeMethodDescriptionprotected void
addPing
(int x, int y, int rtt, boolean re_base) protected SpeedManagerPingMapperImpl.region
addPingSupport
(int x, int y, int rtt, int metric) protected void
addSpeed
(int x, int y) protected void
addSpeedSupport
(int x, int y) protected SpeedManagerLimitEstimate
adjustForPersistence
(SpeedManagerPingMapperImpl.limitEstimate estimate, SpeedManagerPingMapperImpl.limitEstimate best_good, SpeedManagerPingMapperImpl.limitEstimate last_bad, boolean persistent) protected void
checkCapacityDecrease
(boolean is_up, SpeedManagerPingMapperImpl.limitEstimate capacity, LinkedList bads) protected double
convertMetricToRating
(int metric) void
destroy()
protected void
generateEvidence
(IndentWriter writer) double
+1 : good -1 : bad >-1 invalid input: '<'+1 : relative goodness/badnessgetEstimatedDownloadLimit
(boolean persistent) protected SpeedManagerPingMapperImpl.limitEstimate
getEstimatedLimit
(boolean up) getEstimatedUploadLimit
(boolean persistent) int[][]
protected String
getLimitStr
(List limits, boolean short_form) protected String
getLimitString
(List limits) getName()
protected SpeedManagerPingMapperImpl.limitEstimate
protected String
getZones()
protected void
init()
boolean
isActive()
protected void
loadHistory
(File file) protected SpeedManagerPingMapperImpl.limitEstimate
protected LinkedList
loadLimits
(Map map, String name) protected void
static void
protected void
reset()
protected void
protected Map
protected void
saveLimits
(Map map, String name, List limits) void
setEstimatedDownloadCapacityBytesPerSec
(int bytes_per_sec, float estimate_type) void
setEstimatedUploadCapacityBytesPerSec
(int 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:
isActive
in interfaceSpeedManagerPingMapper
-
getNullLimit
-
getLimitString
-
log
-
getName
- Specified by:
getName
in interfaceSpeedManagerPingMapper
-
addSpeed
protected void addSpeed(int x, int y) -
addSpeedSupport
protected void addSpeedSupport(int x, int y) -
addPing
protected void addPing(int x, int y, int rtt, boolean re_base) -
addPingSupport
-
getHistory
public int[][] getHistory()- Specified by:
getHistory
in interfaceSpeedManagerPingMapper
-
getZones
- Specified by:
getZones
in interfaceSpeedManagerPingMapper
-
getEstimatedUploadLimit
- Specified by:
getEstimatedUploadLimit
in interfaceSpeedManagerPingMapper
-
getEstimatedDownloadLimit
- Specified by:
getEstimatedDownloadLimit
in interfaceSpeedManagerPingMapper
-
getLastBadUploadLimit
- Specified by:
getLastBadUploadLimit
in interfaceSpeedManagerPingMapper
-
getLastBadDownloadLimit
- Specified by:
getLastBadDownloadLimit
in interfaceSpeedManagerPingMapper
-
getBadUploadHistory
- Specified by:
getBadUploadHistory
in interfaceSpeedManagerPingMapper
-
getBadDownloadHistory
- Specified by:
getBadDownloadHistory
in 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:
getCurrentMetricRating
in interfaceSpeedManagerPingMapper
- Returns:
-
getEstimatedUploadCapacityBytesPerSec
-
setEstimatedDownloadCapacityBytesPerSec
public void setEstimatedDownloadCapacityBytesPerSec(int bytes_per_sec, float estimate_type) -
getEstimatedDownloadCapacityBytesPerSec
-
setEstimatedUploadCapacityBytesPerSec
public void setEstimatedUploadCapacityBytesPerSec(int 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:
destroy
in interfaceSpeedManagerPingMapper
-
main
-