Record Class RouteFactorCalibration
- Record Components:
overall- the catalogue-wide fitbyRegionPair- the per-region-pair fits, keyedAMER/EMEA(names sorted); only pairs with enough data appearpairsExcluded- measured pairs left out of the fit (floor belowMIN_FLOOR_MS, or no coordinates)
For every measured pair the ratio measured round trip / great-circle fibre floor is
taken (the floor is SpeedOfLightLatency.roundTrip() over the haversine distance). The
factor is the median of those ratios, which a few unusual routes cannot drag
around. Pairs whose floor is below MIN_FLOOR_MS are left out of the fit: over a few
hundred kilometres fixed equipment and handoff delay dominate and the ratio says nothing about
routing. A factor is fitted for the whole catalogue and, separately, for every region pair
(for example AMER/EMEA) with at least MIN_PAIRS_PER_REGION_PAIR usable pairs;
a region pair with fewer falls back to the overall factor.
With no usable measured pair at all the calibration is uncalibrated(): it uses
DEFAULT_FACTOR, a single live observation (Fabric SV↔DC 65.8 ms against a
37.6 ms floor, 2026-11-11), and says so in describe().
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordOne fitted factor.static final recordOne Fabric-measured metro pair. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final doubleThe factor used when nothing can be fitted: Fabric measured SV↔DC at 65.8 ms round trip on 2026-11-11 against a 37.6 ms straight-fibre floor (3,843 km), a ratio of 1.75.static final doublePairs whose straight-fibre round-trip floor is below this (about 200 km) are not used to fit.static final intFewest usable pairs a region pair needs for its own factor. -
Constructor Summary
ConstructorsConstructorDescriptionRouteFactorCalibration(RouteFactorCalibration.Fit overall, Map<String, RouteFactorCalibration.Fit> byRegionPair, int pairsExcluded) Makes the map immutable and ordered. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of thebyRegionPairrecord component.describe()final booleanIndicates whether some other object is "equal to" this one.doubleestimateRoundTripMs(double distanceKm, Region a, Region b) Estimates a round trip from distance with the calibrated factor.static RouteFactorCalibrationFits the factor from measured pairs.final inthashCode()Returns a hash code value for this object.booleanoverall()Returns the value of theoverallrecord component.intReturns the value of thepairsExcludedrecord component.static StringregionPairKey(Region a, Region b) final StringtoString()Returns a string representation of this record class.static RouteFactorCalibration
-
Field Details
-
DEFAULT_FACTOR
public static final double DEFAULT_FACTORThe factor used when nothing can be fitted: Fabric measured SV↔DC at 65.8 ms round trip on 2026-11-11 against a 37.6 ms straight-fibre floor (3,843 km), a ratio of 1.75.- See Also:
-
MIN_PAIRS_PER_REGION_PAIR
public static final int MIN_PAIRS_PER_REGION_PAIRFewest usable pairs a region pair needs for its own factor.- See Also:
-
MIN_FLOOR_MS
public static final double MIN_FLOOR_MSPairs whose straight-fibre round-trip floor is below this (about 200 km) are not used to fit.- See Also:
-
-
Constructor Details
-
RouteFactorCalibration
public RouteFactorCalibration(RouteFactorCalibration.Fit overall, Map<String, RouteFactorCalibration.Fit> byRegionPair, int pairsExcluded) Makes the map immutable and ordered.
-
-
Method Details
-
uncalibrated
- Returns:
- the calibration used when no measured pair is available:
DEFAULT_FACTOR
-
fit
Fits the factor from measured pairs. Each pair should appear once (not once per direction).- Parameters:
pairs- the measured pairs; non-finite or non-positive figures are ignored- Returns:
- the calibration;
uncalibrated()(with the exclusion count) when no pair is usable
-
fitFor
- Parameters:
a- one region; may benullb- the other region; may benull- Returns:
- the fit used for a pair of metros in these regions: the region pair's own fit when there is one, otherwise the overall fit
-
estimateRoundTripMs
Estimates a round trip from distance with the calibrated factor.- Parameters:
distanceKm- great-circle distance, km (finite)a- region of one end; may benullb- region of the other end; may benull- Returns:
- the estimated round trip in ms
-
isCalibrated
public boolean isCalibrated()- Returns:
truewhen the factor came from measured pairs rather thanDEFAULT_FACTOR
-
describe
- Returns:
- one sentence stating the factor, what it was fitted from, and any per-region-pair factors
-
regionPairKey
- Parameters:
a- one regionb- the other region- Returns:
- the key
byRegionPair()uses: the two names sorted and joined with/
-
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
overall
-
byRegionPair
Returns the value of thebyRegionPairrecord component.- Returns:
- the value of the
byRegionPairrecord component
-
pairsExcluded
public int pairsExcluded()Returns the value of thepairsExcludedrecord component.- Returns:
- the value of the
pairsExcludedrecord component
-