@glandais/vcyclist-engine 5.1.0 → 6.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -41,10 +41,10 @@
41
41
  var ElevationGainPreset_DEM_getInstance = kotlin_io_github_glandais_gpx.$_$.c;
42
42
  var initMetadataForObject = kotlin_kotlin.$_$.a7;
43
43
  var getBooleanHashCode = kotlin_kotlin.$_$.p6;
44
+ var isFinite = kotlin_kotlin.$_$.ma;
44
45
  var IllegalArgumentException_init_$Create$ = kotlin_kotlin.$_$.a2;
45
46
  var Unit_instance = kotlin_kotlin.$_$.g1;
46
47
  var ElevationGainOptions = kotlin_io_github_glandais_gpx.$_$.y;
47
- var isFinite = kotlin_kotlin.$_$.ma;
48
48
  var CoroutineImpl = kotlin_kotlin.$_$.d5;
49
49
  var PointPerDistance_instance = kotlin_io_github_glandais_gpx.$_$.o;
50
50
  var ElevationStep_instance = kotlin_io_github_glandais_gpx.$_$.l;
@@ -59,11 +59,11 @@
59
59
  var enumEntries = kotlin_kotlin.$_$.f5;
60
60
  var Enum = kotlin_kotlin.$_$.t9;
61
61
  var noWhenBranchMatchedException = kotlin_kotlin.$_$.qa;
62
- var ArrayList_init_$Create$_0 = kotlin_kotlin.$_$.j1;
63
62
  var last = kotlin_kotlin.$_$.q3;
64
63
  var toIntArray = kotlin_kotlin.$_$.f4;
65
64
  var sortedWith = kotlin_kotlin.$_$.b4;
66
65
  var toMutableList = kotlin_kotlin.$_$.j4;
66
+ var ArrayList_init_$Create$_0 = kotlin_kotlin.$_$.j1;
67
67
  var first = kotlin_kotlin.$_$.j3;
68
68
  var removeAll = kotlin_kotlin.$_$.w3;
69
69
  var numberRangeToNumber = kotlin_kotlin.$_$.f7;
@@ -78,6 +78,7 @@
78
78
  var until = kotlin_kotlin.$_$.z7;
79
79
  var Pair = kotlin_kotlin.$_$.z9;
80
80
  var listOf = kotlin_kotlin.$_$.r3;
81
+ var initMetadataForInterface = kotlin_kotlin.$_$.y6;
81
82
  var Default_getInstance = kotlin_kotlin.$_$.b1;
82
83
  var equals_0 = kotlin_kotlin.$_$.p8;
83
84
  var isNaN_0 = kotlin_kotlin.$_$.oa;
@@ -119,7 +120,7 @@
119
120
  var pathsToGpxDocument = kotlin_io_github_glandais_gpx.$_$.s;
120
121
  var toGpxDocument = kotlin_io_github_glandais_gpx.$_$.u;
121
122
  var GlobalScope_instance = kotlin_org_jetbrains_kotlinx_kotlinx_coroutines_core.$_$.a;
122
- var promise = kotlin_org_jetbrains_kotlinx_kotlinx_coroutines_core.$_$.j;
123
+ var promise = kotlin_org_jetbrains_kotlinx_kotlinx_coroutines_core.$_$.l;
123
124
  var Companion_getInstance_0 = kotlin_io_github_glandais_gpx.$_$.n;
124
125
  var IllegalStateException_init_$Create$ = kotlin_kotlin.$_$.c2;
125
126
  var CsvOptions = kotlin_io_github_glandais_gpx.$_$.w;
@@ -142,7 +143,7 @@
142
143
  var ElevationProviderConfig = kotlin_io_github_glandais_elevation.$_$.d;
143
144
  var sorted = kotlin_kotlin.$_$.c4;
144
145
  var THROW_CCE = kotlin_kotlin.$_$.ca;
145
- var CoroutineScope = kotlin_org_jetbrains_kotlinx_kotlinx_coroutines_core.$_$.h;
146
+ var CoroutineScope = kotlin_org_jetbrains_kotlinx_kotlinx_coroutines_core.$_$.j;
146
147
  var initMetadataForLambda = kotlin_kotlin.$_$.z6;
147
148
  var constructCallableReference = kotlin_kotlin.$_$.k6;
148
149
  var setOf_0 = kotlin_kotlin.$_$.a4;
@@ -176,8 +177,11 @@
176
177
  initMetadataForObject(ClimbDetector, 'ClimbDetector');
177
178
  initMetadataForObject(AeroPowerProvider, 'AeroPowerProvider');
178
179
  initMetadataForObject(AeroProviderConstant, 'AeroProviderConstant');
180
+ function onDelivered(pointIndex, powerW) {
181
+ }
182
+ initMetadataForInterface(CyclistPowerProvider, 'CyclistPowerProvider');
179
183
  initMetadataForCompanion(Companion_6);
180
- initMetadataForClass(CyclistPowerProviderBase, 'CyclistPowerProviderBase');
184
+ initMetadataForClass(CyclistPowerProviderBase, 'CyclistPowerProviderBase', VOID, VOID, [CyclistPowerProvider]);
181
185
  initMetadataForCompanion(Companion_7);
182
186
  initMetadataForClass(PowerModel, 'PowerModel', VOID, Enum);
183
187
  initMetadataForClass(CyclistPowerSpec, 'CyclistPowerSpec', CyclistPowerSpec);
@@ -191,10 +195,10 @@
191
195
  initMetadataForClass(PowerProviderCriticalPower, 'PowerProviderCriticalPower', VOID, CyclistPowerProviderBase);
192
196
  initMetadataForCompanion(Companion_9);
193
197
  initMetadataForClass(PowerProviderDurability, 'PowerProviderDurability', VOID, CyclistPowerProviderBase);
194
- initMetadataForObject(PowerProviderFromData, 'PowerProviderFromData');
195
- initMetadataForClass(PowerProviderSlewLimited, 'PowerProviderSlewLimited');
198
+ initMetadataForObject(PowerProviderFromData, 'PowerProviderFromData', VOID, VOID, [CyclistPowerProvider]);
199
+ initMetadataForClass(PowerProviderSlewLimited, 'PowerProviderSlewLimited', VOID, VOID, [CyclistPowerProvider]);
196
200
  initMetadataForCompanion(Companion_10);
197
- initMetadataForClass(PowerProviderTerrainPacing, 'PowerProviderTerrainPacing');
201
+ initMetadataForClass(PowerProviderTerrainPacing, 'PowerProviderTerrainPacing', VOID, VOID, [CyclistPowerProvider]);
198
202
  initMetadataForObject(RhoProviderDefault, 'RhoProviderDefault');
199
203
  initMetadataForObject(RhoProviderEstimate, 'RhoProviderEstimate');
200
204
  initMetadataForObject(RollingResistancePowerProvider, 'RollingResistancePowerProvider');
@@ -367,16 +371,16 @@
367
371
  protoOf(CoursePhysics).get_bike_wojgoa_k$ = function () {
368
372
  return this.course_1.bike_1;
369
373
  };
370
- protoOf(CoursePhysics).copy_ulppn1_k$ = function (course, rhoProvider, aeroProvider, windProvider, cyclistPowerProvider) {
374
+ protoOf(CoursePhysics).copy_753qsd_k$ = function (course, rhoProvider, aeroProvider, windProvider, cyclistPowerProvider) {
371
375
  return new CoursePhysics(course, rhoProvider, aeroProvider, windProvider, cyclistPowerProvider);
372
376
  };
373
- protoOf(CoursePhysics).copy$default_a3dskc_k$ = function (course, rhoProvider, aeroProvider, windProvider, cyclistPowerProvider, $super) {
377
+ protoOf(CoursePhysics).copy$default_f9apxw_k$ = function (course, rhoProvider, aeroProvider, windProvider, cyclistPowerProvider, $super) {
374
378
  course = course === VOID ? this.course_1 : course;
375
379
  rhoProvider = rhoProvider === VOID ? this.rhoProvider_1 : rhoProvider;
376
380
  aeroProvider = aeroProvider === VOID ? this.aeroProvider_1 : aeroProvider;
377
381
  windProvider = windProvider === VOID ? this.windProvider_1 : windProvider;
378
382
  cyclistPowerProvider = cyclistPowerProvider === VOID ? this.cyclistPowerProvider_1 : cyclistPowerProvider;
379
- return $super === VOID ? this.copy_ulppn1_k$(course, rhoProvider, aeroProvider, windProvider, cyclistPowerProvider) : $super.copy_ulppn1_k$.call(this, course, rhoProvider, aeroProvider, windProvider, cyclistPowerProvider);
383
+ return $super === VOID ? this.copy_753qsd_k$(course, rhoProvider, aeroProvider, windProvider, cyclistPowerProvider) : $super.copy_753qsd_k$.call(this, course, rhoProvider, aeroProvider, windProvider, cyclistPowerProvider);
380
384
  };
381
385
  protoOf(CoursePhysics).toString = function () {
382
386
  return 'CoursePhysics(course=' + this.course_1.toString() + ', rhoProvider=' + toString(this.rhoProvider_1) + ', aeroProvider=' + toString(this.aeroProvider_1) + ', windProvider=' + toString(this.windProvider_1) + ', cyclistPowerProvider=' + toString(this.cyclistPowerProvider_1) + ')';
@@ -561,13 +565,13 @@
561
565
  this.criticalPowerW_1 = criticalPowerW;
562
566
  this.wPrimeJ_1 = wPrimeJ;
563
567
  // Inline function 'kotlin.require' call
564
- if (!(this.criticalPowerW_1 > 0.0)) {
565
- var message = 'criticalPowerW must be > 0, got ' + this.criticalPowerW_1;
568
+ if (!(this.criticalPowerW_1 > 0.0 && isFinite(this.criticalPowerW_1))) {
569
+ var message = 'criticalPowerW must be finite and > 0, got ' + this.criticalPowerW_1;
566
570
  throw IllegalArgumentException_init_$Create$(toString(message));
567
571
  }
568
572
  // Inline function 'kotlin.require' call
569
- if (!(this.wPrimeJ_1 > 0.0)) {
570
- var message_0 = 'wPrimeJ must be > 0, got ' + this.wPrimeJ_1;
573
+ if (!(this.wPrimeJ_1 > 0.0 && isFinite(this.wPrimeJ_1))) {
574
+ var message_0 = 'wPrimeJ must be finite and > 0, got ' + this.wPrimeJ_1;
571
575
  throw IllegalArgumentException_init_$Create$(toString(message_0));
572
576
  }
573
577
  }
@@ -738,14 +742,14 @@
738
742
  PathCurvature_instance.compute_s9yd16_k$(this.path0__1, this.options_1.curvature_1);
739
743
  }
740
744
 
741
- var working = this.course_1.copy$default_a3dskc_k$(this.course_1.course_1.copy$default_mmxsnj_k$(this.path0__1));
745
+ var working = this.course_1.copy$default_f9apxw_k$(this.course_1.course_1.copy$default_mmxsnj_k$(this.path0__1));
742
746
  if (this.options_1.computeMaxSpeeds_1 || this.options_1.virtualizeTrack_1) {
743
747
  MaxSpeedComputer_instance.computeMaxSpeeds_jc4v4o_k$(working.course_1);
744
748
  }
745
749
 
746
750
  if (this.options_1.virtualizeTrack_1) {
747
751
  this.path0__1 = VirtualizeService_instance.virtualizeTrack_tp3afi_k$(working);
748
- working = working.copy$default_a3dskc_k$(working.course_1.copy$default_mmxsnj_k$(this.path0__1));
752
+ working = working.copy$default_f9apxw_k$(working.course_1.copy$default_mmxsnj_k$(this.path0__1));
749
753
  }
750
754
 
751
755
  if (this.options_1.computeOnePointPerSecond_1) {
@@ -920,7 +924,7 @@
920
924
  static_init();
921
925
  return RoadCondition_WET_instance;
922
926
  }
923
- function Climb(startIndex, endIndex, startDistanceM, endDistanceM, startElevationM, endElevationM, positiveElevationM, negativeElevationM, parts) {
927
+ function Climb(startIndex, endIndex, startDistanceM, endDistanceM, startElevationM, endElevationM, positiveElevationM, negativeElevationM, climbingDistanceM, parts) {
924
928
  this.startIndex_1 = startIndex;
925
929
  this.endIndex_1 = endIndex;
926
930
  this.startDistanceM_1 = startDistanceM;
@@ -929,6 +933,7 @@
929
933
  this.endElevationM_1 = endElevationM;
930
934
  this.positiveElevationM_1 = positiveElevationM;
931
935
  this.negativeElevationM_1 = negativeElevationM;
936
+ this.climbingDistanceM_1 = climbingDistanceM;
932
937
  this.parts_1 = parts;
933
938
  }
934
939
  protoOf(Climb).get_lengthM_2aqrzy_k$ = function () {
@@ -941,30 +946,10 @@
941
946
  return this.get_lengthM_2aqrzy_k$() === 0.0 ? 0.0 : this.get_elevationGainM_6kg9eu_k$() / this.get_lengthM_2aqrzy_k$();
942
947
  };
943
948
  protoOf(Climb).get_climbingGrade_olocdd_k$ = function () {
944
- // Inline function 'kotlin.collections.filter' call
945
- var tmp0 = this.parts_1;
946
- // Inline function 'kotlin.collections.filterTo' call
947
- var destination = ArrayList_init_$Create$_0();
948
- var _iterator__ex2g4s = tmp0.iterator_jk1svi_k$();
949
- while (_iterator__ex2g4s.hasNext_bitz1p_k$()) {
950
- var element = _iterator__ex2g4s.next_20eer_k$();
951
- if (element.get_elevationGainM_6kg9eu_k$() > 0) {
952
- destination.add_utx5q5_k$(element);
953
- }
954
- }
955
- // Inline function 'kotlin.collections.sumOf' call
956
- var sum = 0;
957
- var _iterator__ex2g4s_0 = destination.iterator_jk1svi_k$();
958
- while (_iterator__ex2g4s_0.hasNext_bitz1p_k$()) {
959
- var element_0 = _iterator__ex2g4s_0.next_20eer_k$();
960
- var tmp = sum;
961
- sum = tmp + element_0.get_lengthM_2aqrzy_k$();
962
- }
963
- var climbingLength = sum;
964
- return climbingLength === 0.0 ? 0.0 : this.positiveElevationM_1 / climbingLength;
949
+ return this.climbingDistanceM_1 === 0.0 ? 0.0 : this.positiveElevationM_1 / this.climbingDistanceM_1;
965
950
  };
966
951
  protoOf(Climb).toString = function () {
967
- return 'Climb(startIndex=' + this.startIndex_1 + ', endIndex=' + this.endIndex_1 + ', startDistanceM=' + this.startDistanceM_1 + ', endDistanceM=' + this.endDistanceM_1 + ', startElevationM=' + this.startElevationM_1 + ', endElevationM=' + this.endElevationM_1 + ', positiveElevationM=' + this.positiveElevationM_1 + ', negativeElevationM=' + this.negativeElevationM_1 + ', parts=' + toString(this.parts_1) + ')';
952
+ return 'Climb(startIndex=' + this.startIndex_1 + ', endIndex=' + this.endIndex_1 + ', startDistanceM=' + this.startDistanceM_1 + ', endDistanceM=' + this.endDistanceM_1 + ', startElevationM=' + this.startElevationM_1 + ', endElevationM=' + this.endElevationM_1 + ', positiveElevationM=' + this.positiveElevationM_1 + ', negativeElevationM=' + this.negativeElevationM_1 + ', climbingDistanceM=' + this.climbingDistanceM_1 + ', parts=' + toString(this.parts_1) + ')';
968
953
  };
969
954
  protoOf(Climb).hashCode = function () {
970
955
  var result = this.startIndex_1;
@@ -975,6 +960,7 @@
975
960
  result = imul(result, 31) + getNumberHashCode(this.endElevationM_1) | 0;
976
961
  result = imul(result, 31) + getNumberHashCode(this.positiveElevationM_1) | 0;
977
962
  result = imul(result, 31) + getNumberHashCode(this.negativeElevationM_1) | 0;
963
+ result = imul(result, 31) + getNumberHashCode(this.climbingDistanceM_1) | 0;
978
964
  result = imul(result, 31) + hashCode(this.parts_1) | 0;
979
965
  return result;
980
966
  };
@@ -999,6 +985,8 @@
999
985
  return false;
1000
986
  if (!equals(this.negativeElevationM_1, other.negativeElevationM_1))
1001
987
  return false;
988
+ if (!equals(this.climbingDistanceM_1, other.climbingDistanceM_1))
989
+ return false;
1002
990
  if (!equals(this.parts_1, other.parts_1))
1003
991
  return false;
1004
992
  return true;
@@ -1124,8 +1112,8 @@
1124
1112
  }
1125
1113
  tmp = tmp_2;
1126
1114
  } else {
1127
- var stride = ((path.size_1 + maxPoints | 0) - 1 | 0) / maxPoints | 0;
1128
- var kept = ArrayList_init_$Create$(maxPoints + 1 | 0);
1115
+ var stride = (((path.size_1 - 1 | 0) + maxPoints | 0) - 2 | 0) / (maxPoints - 1 | 0) | 0;
1116
+ var kept = ArrayList_init_$Create$(maxPoints);
1129
1117
  var i = 0;
1130
1118
  while (i < path.size_1) {
1131
1119
  kept.add_utx5q5_k$(i);
@@ -1202,7 +1190,7 @@
1202
1190
  var qualifies = gradePercent >= options.minGradePercent_1 && netElevation >= minClimbElevation && score >= bestScore && climbingGradePercent / gradePercent <= options.maxDiffRealGradeRatio_1;
1203
1191
  if (qualifies) {
1204
1192
  bestScore = score;
1205
- best = new Candidate(i, j, score, positiveElevation, negativeElevation);
1193
+ best = new Candidate(i, j, score, positiveElevation, negativeElevation, distClimbing);
1206
1194
  }
1207
1195
  }
1208
1196
  while (inductionVariable < last);
@@ -1229,7 +1217,7 @@
1229
1217
  return kept;
1230
1218
  }
1231
1219
  function toClimb($this, $receiver, path, profile) {
1232
- return new Climb(profile.sourceIndex_1[$receiver.startIndex_1], profile.sourceIndex_1[$receiver.endIndex_1], profile.distance_1[$receiver.startIndex_1], profile.distance_1[$receiver.endIndex_1], profile.elevation_1[$receiver.startIndex_1], profile.elevation_1[$receiver.endIndex_1], $receiver.positiveElevationM_1, $receiver.negativeElevationM_1, splitIntoParts($this, profile, $receiver.startIndex_1, $receiver.endIndex_1));
1220
+ return new Climb(profile.sourceIndex_1[$receiver.startIndex_1], profile.sourceIndex_1[$receiver.endIndex_1], profile.distance_1[$receiver.startIndex_1], profile.distance_1[$receiver.endIndex_1], profile.elevation_1[$receiver.startIndex_1], profile.elevation_1[$receiver.endIndex_1], $receiver.positiveElevationM_1, $receiver.negativeElevationM_1, $receiver.climbingDistanceM_1, splitIntoParts($this, profile, $receiver.startIndex_1, $receiver.endIndex_1));
1233
1221
  }
1234
1222
  function splitIntoParts($this, profile, startIndex, endIndex) {
1235
1223
  // Inline function 'kotlin.collections.map' call
@@ -1279,18 +1267,19 @@
1279
1267
  }
1280
1268
  return tmp$ret$3;
1281
1269
  }
1282
- function Candidate(startIndex, endIndex, score, positiveElevationM, negativeElevationM) {
1270
+ function Candidate(startIndex, endIndex, score, positiveElevationM, negativeElevationM, climbingDistanceM) {
1283
1271
  this.startIndex_1 = startIndex;
1284
1272
  this.endIndex_1 = endIndex;
1285
1273
  this.score_1 = score;
1286
1274
  this.positiveElevationM_1 = positiveElevationM;
1287
1275
  this.negativeElevationM_1 = negativeElevationM;
1276
+ this.climbingDistanceM_1 = climbingDistanceM;
1288
1277
  }
1289
1278
  protoOf(Candidate).overlaps_wp0rru_k$ = function (other) {
1290
1279
  return other.startIndex_1 <= this.startIndex_1 && this.startIndex_1 <= other.endIndex_1 || (other.startIndex_1 <= this.endIndex_1 && this.endIndex_1 <= other.endIndex_1) || (this.startIndex_1 <= other.startIndex_1 && other.endIndex_1 <= this.endIndex_1);
1291
1280
  };
1292
1281
  protoOf(Candidate).toString = function () {
1293
- return 'Candidate(startIndex=' + this.startIndex_1 + ', endIndex=' + this.endIndex_1 + ', score=' + this.score_1 + ', positiveElevationM=' + this.positiveElevationM_1 + ', negativeElevationM=' + this.negativeElevationM_1 + ')';
1282
+ return 'Candidate(startIndex=' + this.startIndex_1 + ', endIndex=' + this.endIndex_1 + ', score=' + this.score_1 + ', positiveElevationM=' + this.positiveElevationM_1 + ', negativeElevationM=' + this.negativeElevationM_1 + ', climbingDistanceM=' + this.climbingDistanceM_1 + ')';
1294
1283
  };
1295
1284
  protoOf(Candidate).hashCode = function () {
1296
1285
  var result = this.startIndex_1;
@@ -1298,6 +1287,7 @@
1298
1287
  result = imul(result, 31) + getNumberHashCode(this.score_1) | 0;
1299
1288
  result = imul(result, 31) + getNumberHashCode(this.positiveElevationM_1) | 0;
1300
1289
  result = imul(result, 31) + getNumberHashCode(this.negativeElevationM_1) | 0;
1290
+ result = imul(result, 31) + getNumberHashCode(this.climbingDistanceM_1) | 0;
1301
1291
  return result;
1302
1292
  };
1303
1293
  protoOf(Candidate).equals = function (other) {
@@ -1315,6 +1305,8 @@
1315
1305
  return false;
1316
1306
  if (!equals(this.negativeElevationM_1, other.negativeElevationM_1))
1317
1307
  return false;
1308
+ if (!equals(this.climbingDistanceM_1, other.climbingDistanceM_1))
1309
+ return false;
1318
1310
  return true;
1319
1311
  };
1320
1312
  function sam$kotlin_Comparator$0(function_0) {
@@ -1604,6 +1596,8 @@
1604
1596
  function AeroProviderConstant_getInstance() {
1605
1597
  return AeroProviderConstant_instance;
1606
1598
  }
1599
+ function CyclistPowerProvider() {
1600
+ }
1607
1601
  function Companion_6() {
1608
1602
  this.TOLERANCE_1 = 0.05;
1609
1603
  this.MAX_MULTIPLIER_1 = 3.0;
@@ -1909,15 +1903,25 @@
1909
1903
  // Inline function 'kotlin.math.min' call
1910
1904
  var b_3 = i + k | 0;
1911
1905
  var maxi = Math.min(tmp0_0, b_3);
1912
- var totalBearingChange = $this.normalizeAngleDiff_6gshzi_k$(path.bearing_fz5vxm_k$(maxi) - path.bearing_fz5vxm_k$(mini));
1906
+ var totalBearingChange = 0.0;
1907
+ var inductionVariable = mini;
1908
+ if (inductionVariable < maxi)
1909
+ do {
1910
+ var j = inductionVariable;
1911
+ inductionVariable = inductionVariable + 1 | 0;
1912
+ totalBearingChange = totalBearingChange + $this.normalizeAngleDiff_6gshzi_k$(path.bearing_fz5vxm_k$(j + 1 | 0) - path.bearing_fz5vxm_k$(j));
1913
+ }
1914
+ while (inductionVariable < maxi);
1913
1915
  var totalDistance = path.distance_5s4s77_k$(maxi) - path.distance_5s4s77_k$(mini);
1914
1916
  // Inline function 'kotlin.math.abs' call
1915
- if (Math.abs(totalBearingChange) < 0.001) {
1917
+ var x = totalBearingChange;
1918
+ if (Math.abs(x) < 0.001) {
1916
1919
  path.setRadius_p1cueq_k$(i, 200.0);
1917
1920
  return 200.0;
1918
1921
  }
1919
1922
  // Inline function 'kotlin.math.abs' call
1920
- var raw = totalDistance / Math.abs(totalBearingChange);
1923
+ var x_0 = totalBearingChange;
1924
+ var raw = totalDistance / Math.abs(x_0);
1921
1925
  // Inline function 'kotlin.math.min' call
1922
1926
  // Inline function 'kotlin.math.max' call
1923
1927
  var b_4 = Math.min(200.0, raw);
@@ -2010,6 +2014,7 @@
2010
2014
  var intent = course.cyclistPowerProvider_1.powerAt_ejucaq_k$(course, path, pointIndex);
2011
2015
  var muscular = this.pedalsClear_b5t5mh_k$(course, path, pointIndex) ? intent : 0.0;
2012
2016
  path.setPCyclistProvidedMuscular_aori9q_k$(pointIndex, muscular);
2017
+ course.cyclistPowerProvider_1.onDelivered_drn2rh_k$(pointIndex, muscular);
2013
2018
  var wheel = muscular * course.get_bike_wojgoa_k$().efficiency_1;
2014
2019
  path.setPCyclistProvidedWheel_ofsihz_k$(pointIndex, wheel);
2015
2020
  return wheel;
@@ -2193,6 +2198,10 @@
2193
2198
  this.lastPowerW_1 = rationed;
2194
2199
  return rationed;
2195
2200
  };
2201
+ protoOf(PowerProviderCriticalPower).onDelivered_drn2rh_k$ = function (pointIndex, powerW) {
2202
+ if (pointIndex === this.lastIndex_1 && isFinite(powerW))
2203
+ this.lastPowerW_1 = powerW;
2204
+ };
2196
2205
  protoOf(PowerProviderCriticalPower).ration_enbpy2_k$ = function (target) {
2197
2206
  if (target <= this.criticalPowerW_1)
2198
2207
  return target;
@@ -2319,8 +2328,10 @@
2319
2328
  if (pointIndex < this.lastIndex_1) {
2320
2329
  this.reset_5u6xz3_k$();
2321
2330
  }
2322
- if (pointIndex === this.lastIndex_1)
2331
+ if (pointIndex === this.lastIndex_1) {
2332
+ this.delegate_1.onDelivered_drn2rh_k$(pointIndex, this.lastPowerW_1);
2323
2333
  return this.lastPowerW_1;
2334
+ }
2324
2335
  var elapsedS = path.elapsed_7307rw_k$(pointIndex);
2325
2336
  var dtS = elapsedS - this.lastElapsedS_1;
2326
2337
  var tmp;
@@ -2343,8 +2354,12 @@
2343
2354
  this.lastElapsedS_1 = elapsedS;
2344
2355
  this.lastIndex_1 = pointIndex;
2345
2356
  this.lastPowerW_1 = limited;
2357
+ this.delegate_1.onDelivered_drn2rh_k$(pointIndex, limited);
2346
2358
  return limited;
2347
2359
  };
2360
+ protoOf(PowerProviderSlewLimited).onDelivered_drn2rh_k$ = function (pointIndex, powerW) {
2361
+ return this.delegate_1.onDelivered_drn2rh_k$(pointIndex, powerW);
2362
+ };
2348
2363
  protoOf(PowerProviderSlewLimited).reset_5u6xz3_k$ = function () {
2349
2364
  this.lastIndex_1 = -1;
2350
2365
  this.lastElapsedS_1 = 0.0;
@@ -2434,11 +2449,16 @@
2434
2449
  this.lastElapsedS_1 = elapsedS;
2435
2450
  this.lastIndex_1 = pointIndex;
2436
2451
  }
2437
- var delivered = target * this.multiplier_1 * this.energyCorrection_sm6t7b_k$(target);
2452
+ var ratio = coerceIn(this.multiplier_1 * this.energyCorrection_sm6t7b_k$(target), this.minMultiplier_1, this.maxMultiplier_1);
2453
+ var delivered = target * ratio;
2438
2454
  this.lastTargetW_1 = target;
2439
2455
  this.lastDeliveredW_1 = delivered;
2456
+ this.delegate_1.onDelivered_drn2rh_k$(pointIndex, delivered);
2440
2457
  return delivered;
2441
2458
  };
2459
+ protoOf(PowerProviderTerrainPacing).onDelivered_drn2rh_k$ = function (pointIndex, powerW) {
2460
+ return this.delegate_1.onDelivered_drn2rh_k$(pointIndex, powerW);
2461
+ };
2442
2462
  protoOf(PowerProviderTerrainPacing).energyCorrection_sm6t7b_k$ = function (target) {
2443
2463
  if (target <= 0.0)
2444
2464
  return 1.0;
@@ -2538,7 +2558,6 @@
2538
2558
  }
2539
2559
  }
2540
2560
  function VirtualizeService() {
2541
- this.MAX_ITERATIONS_1 = 100000;
2542
2561
  }
2543
2562
  protoOf(VirtualizeService).virtualizeTrack_tp3afi_k$ = function (course) {
2544
2563
  var input = course.get_path_wos8ry_k$();
@@ -2561,8 +2580,7 @@
2561
2580
  out.setSpeed_1slan1_k$(0, speed);
2562
2581
  out.setVirtSpeedCurrent_kvg8yv_k$(0, speed);
2563
2582
  var i = 1;
2564
- var iter = 0;
2565
- $l$loop_0: while (i < n) {
2583
+ $l$loop: while (i < n) {
2566
2584
  var dx = input.distance_5s4s77_k$(i) - input.distance_5s4s77_k$(i - 1 | 0);
2567
2585
  if (dx <= 0.0) {
2568
2586
  copyAllFields(this, input, i, out, i);
@@ -2573,7 +2591,7 @@
2573
2591
  out.setSpeed_1slan1_k$(i, speed);
2574
2592
  out.setVirtSpeedCurrent_kvg8yv_k$(i, speed);
2575
2593
  i = i + 1 | 0;
2576
- continue $l$loop_0;
2594
+ continue $l$loop;
2577
2595
  }
2578
2596
  var pSum = PowerComputer_instance.getNewPower_puvq9i_k$(course, out, i - 1 | 0, true);
2579
2597
  var dt = PowerComputer_instance.getDt_t0pcee_k$(pSum, mEq, speed, dx);
@@ -2593,10 +2611,6 @@
2593
2611
  out.setSpeed_1slan1_k$(i, speed);
2594
2612
  out.setVirtSpeedCurrent_kvg8yv_k$(i, speed);
2595
2613
  i = i + 1 | 0;
2596
- var _unary__edvuaz = iter;
2597
- iter = _unary__edvuaz + 1 | 0;
2598
- if (_unary__edvuaz > 100000)
2599
- break $l$loop_0;
2600
2614
  }
2601
2615
  var progression = out.get_indices_xelk8u_k$();
2602
2616
  var inductionVariable = progression.first_1;
@@ -5451,6 +5465,10 @@
5451
5465
  ENHANCE_OPTIONS_KEYS = setOf_0(['fixElevation', 'computeMaxSpeeds', 'virtualizeTrack', 'computeOnePointPerSecond', 'simplifyEnabled', 'simplifyToleranceM', 'simplifyZExaggeration', 'wPrimeBalanceEnabled', 'wPrimeBalanceCriticalPower', 'wPrimeBalanceWPrime', 'curvatureEnabled', 'racingLineEnabled', 'racingLineCorridor', 'racingLineRoadWidthM', 'elevationGainPreset', 'elevationGainThresholdM', 'elevationGainEnabled', 'elevationSmoothWindowM', 'demZoom']);
5452
5466
  }
5453
5467
  }
5468
+ //region block: post-declaration
5469
+ protoOf(CyclistPowerProviderBase).onDelivered_drn2rh_k$ = onDelivered;
5470
+ protoOf(PowerProviderFromData).onDelivered_drn2rh_k$ = onDelivered;
5471
+ //endregion
5454
5472
  //region block: init
5455
5473
  Enhancer_instance = new Enhancer();
5456
5474
  Companion_instance_7 = new Companion_5();