@woosh/meep-engine 2.118.4 → 2.118.6

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.
Files changed (149) hide show
  1. package/build/meep.cjs +520 -479
  2. package/build/meep.min.js +1 -1
  3. package/build/meep.module.js +520 -479
  4. package/package.json +4 -4
  5. package/src/core/binary/BitSet.d.ts +0 -5
  6. package/src/core/binary/BitSet.d.ts.map +1 -1
  7. package/src/core/binary/BitSet.js +2 -10
  8. package/src/core/binary/base64/Base64.d.ts.map +1 -0
  9. package/src/core/binary/largest_common_alignment_uint32.d.ts.map +1 -0
  10. package/src/core/{collection/array/typed → binary}/largest_common_alignment_uint32.js +1 -1
  11. package/src/core/collection/CuckooFilter.d.ts +34 -8
  12. package/src/core/collection/CuckooFilter.d.ts.map +1 -1
  13. package/src/core/collection/CuckooFilter.js +29 -1
  14. package/src/core/collection/array/typed/array_buffer_copy.d.ts.map +1 -1
  15. package/src/core/collection/array/typed/array_buffer_copy.js +3 -1
  16. package/src/core/collection/array/typed/is_array_buffer_equals.js +1 -1
  17. package/src/core/collection/array/typed/is_typed_array_equals.js +1 -1
  18. package/src/core/collection/map/HashMap.js +7 -7
  19. package/src/core/geom/2d/aabb/AABB2.d.ts.map +1 -1
  20. package/src/core/geom/2d/aabb/AABB2.js +43 -22
  21. package/src/core/geom/2d/aabb/aabb2_compute_center_from_multiple.d.ts.map +1 -1
  22. package/src/core/geom/2d/aabb/aabb2_compute_center_from_multiple.js +6 -1
  23. package/src/core/geom/2d/quad-tree/QuadTreeDatum.d.ts +3 -5
  24. package/src/core/geom/2d/quad-tree/QuadTreeDatum.d.ts.map +1 -1
  25. package/src/core/geom/2d/quad-tree/QuadTreeDatum.js +9 -19
  26. package/src/core/geom/2d/rectangle_to_aabb.d.ts +8 -0
  27. package/src/core/geom/2d/rectangle_to_aabb.d.ts.map +1 -0
  28. package/src/core/geom/2d/rectangle_to_aabb.js +29 -0
  29. package/src/core/geom/3d/tetrahedra/TetrahedralMesh.js +1 -1
  30. package/src/core/graph/graph_compute_distance_matrix.d.ts +1 -1
  31. package/src/core/graph/graph_compute_distance_matrix.d.ts.map +1 -1
  32. package/src/core/graph/graph_compute_distance_matrix.js +1 -1
  33. package/src/core/graph/graph_compute_laplacian_matrix.d.ts +1 -1
  34. package/src/core/graph/graph_compute_laplacian_matrix.d.ts.map +1 -1
  35. package/src/core/graph/graph_compute_laplacian_matrix.js +1 -1
  36. package/src/core/graph/layout/CircleLayout.js +2 -2
  37. package/src/core/graph/layout/box/BoxLayouter.d.ts.map +1 -1
  38. package/src/core/graph/layout/box/BoxLayouter.js +11 -5
  39. package/src/core/graph/layout/box/aabb2_force_into_container.d.ts +7 -0
  40. package/src/core/graph/layout/box/aabb2_force_into_container.d.ts.map +1 -0
  41. package/src/core/graph/layout/box/aabb2_force_into_container.js +56 -0
  42. package/src/core/graph/layout/box/applyCentralGravityAABB2.d.ts.map +1 -1
  43. package/src/core/graph/layout/box/applyCentralGravityAABB2.js +2 -8
  44. package/src/core/graph/layout/box/forceIntoBox.d.ts +4 -2
  45. package/src/core/graph/layout/box/forceIntoBox.d.ts.map +1 -1
  46. package/src/core/graph/layout/box/forceIntoBox.js +5 -31
  47. package/src/core/graph/layout/box/position_box_next_to_box.d.ts +10 -0
  48. package/src/core/graph/layout/box/position_box_next_to_box.d.ts.map +1 -0
  49. package/src/core/graph/layout/box/position_box_next_to_box.js +218 -0
  50. package/src/core/graph/layout/box/pullBoxTowardsPoint.d.ts.map +1 -1
  51. package/src/core/graph/layout/box/pullBoxTowardsPoint.js +8 -3
  52. package/src/core/graph/layout/box/resolveAABB2Overlap.d.ts +2 -2
  53. package/src/core/graph/layout/box/resolveAABB2Overlap.d.ts.map +1 -1
  54. package/src/core/graph/layout/box/resolveAABB2Overlap.js +12 -4
  55. package/src/core/graph/layout/box/resolveBoxOverlapUsingForce.d.ts +1 -0
  56. package/src/core/graph/layout/box/resolveBoxOverlapUsingForce.d.ts.map +1 -1
  57. package/src/core/graph/layout/box/resolveBoxOverlapUsingForce.js +1 -0
  58. package/src/core/math/hash/squirrel3.d.ts +1 -0
  59. package/src/core/math/hash/squirrel3.d.ts.map +1 -1
  60. package/src/core/math/hash/squirrel3.js +1 -0
  61. package/src/core/math/matrix/SquareMatrix.d.ts.map +1 -0
  62. package/src/core/{graph → math/matrix}/SquareMatrix.js +3 -3
  63. package/src/core/math/random/seededRandom_MersenneTwister.d.ts +7 -0
  64. package/src/core/math/random/seededRandom_MersenneTwister.d.ts.map +1 -0
  65. package/src/core/math/random/{seededRandomMersenneTwister.js → seededRandom_MersenneTwister.js} +4 -2
  66. package/src/core/math/spline/cubicCurve.d.ts +3 -8
  67. package/src/core/math/spline/cubicCurve.d.ts.map +1 -1
  68. package/src/core/math/spline/cubicCurve.js +4 -32
  69. package/src/core/model/reactive/js/compileReactiveToJS.d.ts.map +1 -1
  70. package/src/core/model/reactive/js/compileReactiveToJS.js +56 -1
  71. package/src/core/model/reactive/model/terminal/ReactiveReference.d.ts.map +1 -1
  72. package/src/core/model/reactive/model/terminal/ReactiveReference.js +2 -2
  73. package/src/core/model/reactive/trigger/ReactiveTrigger.d.ts +2 -2
  74. package/src/core/model/reactive/trigger/ReactiveTrigger.d.ts.map +1 -1
  75. package/src/core/model/reactive/trigger/ReactiveTrigger.js +1 -1
  76. package/src/core/process/BaseProcess.d.ts.map +1 -1
  77. package/src/core/process/BaseProcess.js +8 -7
  78. package/src/core/process/SimpleLifecycle.d.ts +5 -0
  79. package/src/core/process/SimpleLifecycle.d.ts.map +1 -1
  80. package/src/core/process/SimpleLifecycle.js +8 -0
  81. package/src/core/process/task/Task.js +1 -1
  82. package/src/engine/animation/clip/AnimationClip.d.ts.map +1 -1
  83. package/src/engine/animation/clip/AnimationClip.js +50 -8
  84. package/src/engine/animation/clip/AnimationClipBinding.js +1 -1
  85. package/src/engine/animation/clip/AnimationTrack.d.ts +11 -1
  86. package/src/engine/animation/clip/AnimationTrack.d.ts.map +1 -1
  87. package/src/engine/animation/clip/AnimationTrack.js +50 -7
  88. package/src/engine/animation/curve/binding/BoundPlainNumericPropertyWriter.d.ts +8 -0
  89. package/src/engine/animation/curve/binding/BoundPlainNumericPropertyWriter.d.ts.map +1 -0
  90. package/src/engine/animation/curve/binding/BoundPlainNumericPropertyWriter.js +16 -0
  91. package/src/engine/ecs/terrain/ecs/Terrain.d.ts.map +1 -1
  92. package/src/engine/ecs/terrain/ecs/splat/SplatMapping.d.ts.map +1 -1
  93. package/src/engine/ecs/terrain/ecs/splat/SplatMapping.js +6 -6
  94. package/src/engine/graphics/texture/sampler/Sampler2D.js +1 -1
  95. package/src/engine/intelligence/optimization/optimize_cyclic_sequence_pairwise.d.ts +12 -0
  96. package/src/engine/intelligence/optimization/optimize_cyclic_sequence_pairwise.d.ts.map +1 -0
  97. package/src/engine/intelligence/optimization/optimize_cyclic_sequence_pairwise.js +90 -0
  98. package/src/generation/filtering/numeric/complex/CellFilterSimplexNoise.d.ts +3 -3
  99. package/src/generation/filtering/numeric/complex/CellFilterSimplexNoise.d.ts.map +1 -1
  100. package/src/generation/filtering/numeric/complex/CellFilterSimplexNoise.js +6 -6
  101. package/src/generation/grid/generation/discrete/GridTaskCellularAutomata.d.ts.map +1 -1
  102. package/src/generation/grid/generation/discrete/GridTaskCellularAutomata.js +35 -31
  103. package/src/generation/grid/generation/grid/GridTaskAddNodesFixed.d.ts.map +1 -1
  104. package/src/generation/grid/generation/grid/GridTaskAddNodesFixed.js +8 -11
  105. package/src/generation/grid/generation/road/RoadConnectionNetwork.d.ts +6 -2
  106. package/src/generation/grid/generation/road/RoadConnectionNetwork.d.ts.map +1 -1
  107. package/src/generation/grid/generation/road/RoadConnectionNetwork.js +36 -30
  108. package/src/generation/placement/action/GridCellAction.js +1 -1
  109. package/src/generation/theme/AreaTheme.d.ts.map +1 -1
  110. package/src/generation/theme/AreaTheme.js +0 -1
  111. package/src/generation/theme/TerrainLayerRule.d.ts.map +1 -1
  112. package/src/generation/theme/TerrainLayerRule.js +2 -1
  113. package/src/generation/theme/TerrainLayerRuleAggregator.d.ts +5 -1
  114. package/src/generation/theme/TerrainLayerRuleAggregator.d.ts.map +1 -1
  115. package/src/generation/theme/TerrainLayerRuleAggregator.js +7 -2
  116. package/src/generation/theme/ThemeEngine.d.ts +2 -2
  117. package/src/generation/theme/ThemeEngine.d.ts.map +1 -1
  118. package/src/generation/theme/ThemeEngine.js +1 -4
  119. package/src/generation/theme/cell/CellProcessingRule.d.ts.map +1 -1
  120. package/src/generation/theme/cell/CellProcessingRule.js +10 -13
  121. package/src/generation/theme/cell/CellProcessingRuleSet.d.ts.map +1 -1
  122. package/src/generation/theme/cell/CellProcessingRuleSet.js +6 -7
  123. package/src/view/SVG.d.ts.map +1 -1
  124. package/src/view/SVG.js +0 -15
  125. package/src/view/html_element_to_aabb.d.ts +8 -0
  126. package/src/view/html_element_to_aabb.d.ts.map +1 -0
  127. package/src/view/html_element_to_aabb.js +29 -0
  128. package/src/view/tooltip/TooltipManager.d.ts.map +1 -1
  129. package/src/view/tooltip/TooltipManager.js +7 -9
  130. package/src/view/tooltip/TooltipView.d.ts +0 -1
  131. package/src/view/tooltip/TooltipView.d.ts.map +1 -1
  132. package/src/view/tooltip/TooltipView.js +10 -280
  133. package/src/view/tooltip/gml/TooltipParser.d.ts.map +1 -1
  134. package/src/view/tooltip/gml/TooltipParser.js +1 -13
  135. package/src/core/binary/Base64.d.ts.map +0 -1
  136. package/src/core/collection/array/typed/largest_common_alignment_uint32.d.ts.map +0 -1
  137. package/src/core/graph/SquareMatrix.d.ts.map +0 -1
  138. package/src/core/math/random/MersenneTwister.d.ts +0 -19
  139. package/src/core/math/random/MersenneTwister.d.ts.map +0 -1
  140. package/src/core/math/random/MersenneTwister.js +0 -212
  141. package/src/core/math/random/seededRandomMersenneTwister.d.ts +0 -7
  142. package/src/core/math/random/seededRandomMersenneTwister.d.ts.map +0 -1
  143. package/src/engine/simulation/DormandPrince.d.ts +0 -19
  144. package/src/engine/simulation/DormandPrince.d.ts.map +0 -1
  145. package/src/engine/simulation/DormandPrince.js +0 -242
  146. /package/src/core/binary/{Base64.d.ts → base64/Base64.d.ts} +0 -0
  147. /package/src/core/binary/{Base64.js → base64/Base64.js} +0 -0
  148. /package/src/core/{collection/array/typed → binary}/largest_common_alignment_uint32.d.ts +0 -0
  149. /package/src/core/{graph → math/matrix}/SquareMatrix.d.ts +0 -0
@@ -1,12 +1,10 @@
1
- import View from "../View.js";
1
+ import { rectangle_to_aabb } from "../../core/geom/2d/rectangle_to_aabb.js";
2
2
  import Vector2 from "../../core/geom/Vector2.js";
3
- import AABB2 from "../../core/geom/2d/aabb/AABB2.js";
3
+ import { position_box_next_to_box } from "../../core/graph/layout/box/position_box_next_to_box.js";
4
4
  import { CompassArrowView } from "../elements/CompassArrowView.js";
5
5
  import EmptyView from "../elements/EmptyView.js";
6
- import { forceIntoBox } from "../../core/graph/layout/box/forceIntoBox.js";
7
- import { pullBoxTowardsPoint } from "../../core/graph/layout/box/pullBoxTowardsPoint.js";
8
- import { resolveAABB2Overlap } from "../../core/graph/layout/box/resolveAABB2Overlap.js";
9
- import { EPSILON } from "../../core/math/EPSILON.js";
6
+ import { html_element_to_aabb } from "../html_element_to_aabb.js";
7
+ import View from "../View.js";
10
8
 
11
9
 
12
10
  class TooltipView extends View {
@@ -51,7 +49,7 @@ class TooltipView extends View {
51
49
  * @param {AABB2} bounds
52
50
  */
53
51
  layout(bounds) {
54
- const tipBox = element2aabb(this.contentView.el);
52
+ const tipBox = html_element_to_aabb(this.contentView.el);
55
53
 
56
54
  const SPACING = 16;
57
55
 
@@ -65,17 +63,17 @@ class TooltipView extends View {
65
63
 
66
64
  const tipTarget = tip.target;
67
65
 
68
- const target = rectangle2aabb(tipTarget);
66
+ const target = rectangle_to_aabb(tipTarget);
69
67
 
70
- const box = positionBoxNextToBox(tipBox, target, bounds);
68
+ const box = position_box_next_to_box(tipBox, target, bounds);
71
69
 
72
70
  box.shrink(SPACING);
73
71
 
74
72
  const compass = this.compass;
75
73
 
76
- function setCompas() {
74
+ function setCompass() {
77
75
 
78
- const targetCenter = new Vector2(target.midX(), target.midY());
76
+ const targetCenter = target.getCenter();
79
77
 
80
78
  const tipPoint = new Vector2();
81
79
 
@@ -86,279 +84,11 @@ class TooltipView extends View {
86
84
  compass.position.copy(tipPoint)._add(-box.x0, -box.y0);
87
85
  }
88
86
 
89
- setCompas();
87
+ setCompass();
90
88
 
91
89
  this.position.set(box.x0, box.y0)
92
90
  }
93
91
  }
94
92
 
95
93
 
96
- /**
97
- *
98
- * @param {Element} el
99
- * @returns {AABB2}
100
- */
101
- function element2aabb(el) {
102
- const clientRect = el.getBoundingClientRect();
103
-
104
- let x0 = clientRect.left;
105
- let y0 = clientRect.top;
106
- let x1 = clientRect.right;
107
- let y1 = clientRect.bottom;
108
-
109
- // sanitize bounds
110
-
111
- if (Number.isNaN(x1)) {
112
- x1 = x0;
113
- }
114
-
115
- if (Number.isNaN(y1)) {
116
- y1 = y0;
117
- }
118
-
119
- // write bounds
120
-
121
- return new AABB2(x0, y0, x1, y1);
122
- }
123
-
124
- /**
125
- *
126
- * @param {Rectangle} rect
127
- * @returns {AABB2}
128
- */
129
- function rectangle2aabb(rect) {
130
- const position = rect.position;
131
-
132
- const x0 = position.x;
133
- const y0 = position.y;
134
-
135
- const size = rect.size;
136
-
137
- let x1 = x0;
138
- let y1 = y0;
139
-
140
- // sanitize bounds
141
- if (size.x > 0) {
142
- x1 += size.x;
143
- }
144
-
145
- if (size.y > 0) {
146
- y1 += size.y;
147
- }
148
-
149
- return new AABB2(x0, y0, x1, y1);
150
- }
151
-
152
- /**
153
- *
154
- * @param {AABB2} box
155
- * @param {AABB2} target
156
- * @param {AABB2} bounds
157
- * @returns {Vector2}
158
- */
159
- function computeInitialPlacement(box, target, bounds) {
160
- /**
161
- * list of preferred directions, ordered. First direction is higher priority than the next, last is lowest priority
162
- * @type {Vector2[]}
163
- */
164
- const preferredDirections = [
165
- Vector2.up,
166
- Vector2.right,
167
- Vector2.down,
168
- Vector2.left
169
- ];
170
-
171
- const targetCenter = new Vector2(target.midX(), target.midY());
172
-
173
- const targetH = target.getHeight();
174
- const targetW = target.getWidth();
175
-
176
- const targetDiagonal = Math.sqrt(targetH * targetH + targetW * targetW);
177
-
178
- const boxWidth = box.getWidth();
179
- const boxHeight = box.getHeight();
180
-
181
- const boxWidth_2 = boxWidth / 2;
182
- const boxHeight_2 = boxHeight / 2;
183
-
184
- const intersectionPoint = new Vector2();
185
-
186
- const placements = preferredDirections.map(function (direction) {
187
- //invert Y axis, screen-space direction is Down(+) and Up(-)
188
- const viewportDirection = direction.clone()._multiply(1, -1);
189
-
190
- const pointOutside = viewportDirection.clone();
191
- //scale vector to be larger than the box diagonal so it would intersect the boundary when placed in the middle
192
- pointOutside.multiplyScalar(targetDiagonal + 1);
193
- //move vector to the middle od the box
194
- pointOutside.add(targetCenter);
195
-
196
- target.lineIntersectionPoint(targetCenter, pointOutside, intersectionPoint);
197
-
198
- //align placement to the opposite edge of the box
199
- const offset = new Vector2(boxWidth_2, boxHeight_2);
200
-
201
- offset.multiply(viewportDirection);
202
-
203
- offset._sub(boxWidth_2, boxHeight_2);
204
-
205
- offset.add(intersectionPoint);
206
-
207
- return offset;
208
- });
209
-
210
- /**
211
- *
212
- * @param {Vector2} placement
213
- * @returns {number}
214
- */
215
- function computePlacementScore(placement) {
216
- //find space for the tip between bounds and the target
217
- const availableSpace = new AABB2();
218
-
219
- const px0 = placement.x;
220
- const px1 = px0 + boxWidth;
221
- const py0 = placement.y;
222
- const py1 = py0 + boxHeight;
223
-
224
- if (px1 <= target.x0) {
225
- //left
226
- availableSpace.set(
227
- bounds.x0,
228
- bounds.y0,
229
- target.x0,
230
- bounds.y1
231
- );
232
- } else if (px0 >= target.x1) {
233
- //right
234
- availableSpace.set(
235
- target.x1,
236
- bounds.y0,
237
- bounds.x1,
238
- bounds.y1
239
- );
240
- } else if (py1 <= target.y0) {
241
- //up
242
- availableSpace.set(
243
- bounds.x0,
244
- bounds.y0,
245
- bounds.x1,
246
- target.y0
247
- );
248
- } else if (py0 >= target.y1) {
249
- //bottom
250
- availableSpace.set(
251
- bounds.x0,
252
- target.y1,
253
- bounds.x1,
254
- bounds.y1
255
- );
256
- } else {
257
- //tip is inside, no arbitration
258
- }
259
-
260
- let score = 0;
261
-
262
- const availableWidth = availableSpace.getWidth();
263
- const availableHeight = availableSpace.getHeight();
264
-
265
- const spareWidth = availableWidth - boxWidth;
266
- const spareHeight = availableHeight - boxHeight;
267
-
268
- if (spareHeight < 0) {
269
- score--;
270
- }
271
-
272
- if (spareWidth < 0) {
273
- score--;
274
- }
275
-
276
- return score;
277
- }
278
-
279
- //score placements
280
- const scores = placements.map(computePlacementScore);
281
-
282
- //find best placement
283
- let bestIndex = 0;
284
- let bestScore = scores[0];
285
-
286
- for (let i = 1; i < scores.length; i++) {
287
- const score = scores[i];
288
-
289
- if (score > bestScore + EPSILON) {
290
- bestScore = score;
291
- bestIndex = i;
292
- }
293
- }
294
-
295
- return placements[bestIndex];
296
- }
297
-
298
-
299
- /**
300
- *
301
- * @param {AABB2} box
302
- * @param {AABB2} target
303
- * @param {AABB2} bounds
304
- */
305
- function positionBoxNextToBox(box, target, bounds) {
306
- const b = box.clone();
307
- const t = target.clone();
308
-
309
- //center box inside the bounds
310
- const y0 = (bounds.getHeight() + b.getHeight()) / 2;
311
- const x0 = (bounds.getWidth() + b.getWidth()) / 2;
312
- b.set(x0, y0, x0 + b.getWidth(), y0 + b.getHeight());
313
-
314
-
315
- const targetCenter = new Vector2(t.midX(), t.midY());
316
-
317
- t.locked = true;
318
-
319
- function touch() {
320
-
321
- const bC = new Vector2(b.midX(), b.midY());
322
-
323
- const bE = new Vector2();
324
- const tE = new Vector2();
325
-
326
-
327
- t.lineIntersectionPoint(bC, targetCenter, tE);
328
- const delta = new Vector2();
329
-
330
- if (b.lineIntersectionPoint(bC, targetCenter, bE)) {
331
- delta.copy(tE).sub(bE);
332
- } else {
333
- delta.copy(tE).sub(bC);
334
- }
335
-
336
- b.move(delta.x, delta.y);
337
- }
338
-
339
-
340
- const initialPosition = computeInitialPlacement(b, t, bounds);
341
- //set bounds to initial position
342
- b.set(initialPosition.x, initialPosition.y, initialPosition.x + b.getWidth(), initialPosition.y + b.getHeight());
343
-
344
- // touch();
345
-
346
- function step() {
347
- //pull
348
- pullBoxTowardsPoint(b, initialPosition.x + b.getWidth() / 2, initialPosition.y + b.getHeight() / 2, 0.1);
349
-
350
- resolveAABB2Overlap([b, t], 10);
351
-
352
- forceIntoBox(bounds, [b]);
353
- }
354
-
355
- for (let i = 0; i < 5; i++) {
356
- step();
357
- }
358
-
359
- box.copy(b);
360
-
361
- return box;
362
- }
363
-
364
94
  export default TooltipView;
@@ -1 +1 @@
1
- {"version":3,"file":"TooltipParser.d.ts","sourceRoot":"","sources":["../../../../../src/view/tooltip/gml/TooltipParser.js"],"names":[],"mappings":"AAOA;IAkBI;;;;OAIG;IACH,YAHW,MAAM,GACJ,OAAO,CAkBnB;;CACJ"}
1
+ {"version":3,"file":"TooltipParser.d.ts","sourceRoot":"","sources":["../../../../../src/view/tooltip/gml/TooltipParser.js"],"names":[],"mappings":"AAOA;IAkBI;;;;OAIG;IACH,YAHW,MAAM,GACJ,OAAO,CAMnB;;CACJ"}
@@ -30,19 +30,7 @@ export class TooltipParser {
30
30
  */
31
31
  parse(code) {
32
32
 
33
- const existing = this.#cache.get(code);
33
+ return this.#cache.getOrCompute(code, parseTooltipString);
34
34
 
35
- if (existing !== null) {
36
- // result is cached, reuse
37
- return existing;
38
- }
39
-
40
- // no cached result, parse
41
- const tokens = parseTooltipString(code);
42
-
43
- // cache result
44
- this.#cache.put(code, tokens);
45
-
46
- return tokens;
47
35
  }
48
36
  }
@@ -1 +0,0 @@
1
- {"version":3,"file":"Base64.d.ts","sourceRoot":"","sources":["../../../../src/core/binary/Base64.js"],"names":[],"mappings":"AAgOA;IACI;;;;OAIG;IACH,qBAHW,WAAW,GACT,MAAM,CAOlB;IAED;;;;OAIG;IACH,qBAHW,MAAM,GACJ,WAAW,CAUvB;CACJ"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"largest_common_alignment_uint32.d.ts","sourceRoot":"","sources":["../../../../../../src/core/collection/array/typed/largest_common_alignment_uint32.js"],"names":[],"mappings":"AAEA;;;;;;GAMG;AACH,0DALW,MAAM,YACN,MAAM,eACN,MAAM,GACJ,MAAM,CAoBlB"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"SquareMatrix.d.ts","sourceRoot":"","sources":["../../../../src/core/graph/SquareMatrix.js"],"names":[],"mappings":"AAIA;IACI;;;;OAIG;IACH,kBAHW,MAAM,QACN,iBAAe,MAAM,EA2B/B;IAhBG;;;OAGG;IACH,MAFU,MAAM,CAEA;IAEhB;;;OAGG;IACH,qBAAgB;IAEhB;;OAEG;IACH,MAFU,MAAM,EAAE,CAEqB;IAG3C,gBAEC;IAED,qBAEC;IAED,oBAEC;IAED,mBAEC;IAED;;;OAGG;IACH,gBAFW,YAAY,QAItB;IAED;;;;OAIG;IACH,oBAHW,YAAY,KACZ,YAAY,QAiBtB;IAED;;OAEG;IACH,eAMC;IAED;;OAEG;IACH,cAEC;IAED;;OAEG;IACH,YAMC;IAED;;;OAGG;IACH,YAFW,YAAY,QAMtB;IAED;;;OAGG;IACH,SAFY,YAAY,CAQvB;IAED;;OAEG;IACH,kBAcC;IAED;;;OAGG;IACH,eAFW,MAAM,EAAE,QAIlB;IAED;;;;OAIG;IACH,sBAHW,MAAM,EAAE,WACR,MAAM,YAMhB;IAED;;;;;OAKG;IACH,wBAJW,MAAM,gBACN,MAAM,SACN,MAAM,QAYhB;IAED;;;;;OAKG;IACH,wBAJW,MAAM,gBACN,MAAM,GACL,MAAM,CAWjB;IAED;;;OAGG;IACH,qBAFW,MAAM,EAAE,GAAC,YAAY,GAAC,YAAY,QAU5C;CACJ"}
@@ -1,19 +0,0 @@
1
- export class MersenneTwister {
2
- constructor(seed?: number);
3
- N: number;
4
- M: number;
5
- MATRIX_A: number;
6
- UPPER_MASK: number;
7
- LOWER_MASK: number;
8
- mt: any[];
9
- mti: number;
10
- init_genrand(s: any): void;
11
- init_by_array(init_key: any, key_length: any): void;
12
- genrand_int32(): number;
13
- genrand_int31(): number;
14
- genrand_real1(): number;
15
- random(): number;
16
- genrand_real3(): number;
17
- genrand_res53(): number;
18
- }
19
- //# sourceMappingURL=MersenneTwister.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"MersenneTwister.d.ts","sourceRoot":"","sources":["../../../../../src/core/math/random/MersenneTwister.js"],"names":[],"mappings":"AA8DA;IACI,2BAkBC;IAfG,UAAY;IACZ,UAAY;IACZ,iBAA0B;IAE1B,mBAA4B;IAE5B,mBAA4B;IAG5B,UAA2B;IAE3B,YAAqB;IAOzB,2BAaC;IAOD,oDAqCC;IAGD,wBAmCC;IAGD,wBAEC;IAGD,wBAGC;IAGD,iBAGC;IAGD,wBAGC;IAGD,wBAGC;CACJ"}
@@ -1,212 +0,0 @@
1
- /*
2
- I've wrapped Makoto Matsumoto and Takuji Nishimura's code in a namespace
3
- so it's better encapsulated. Now you can have multiple random number generators
4
- and they won't stomp all over eachother's state.
5
-
6
- If you want to use this as a substitute for Math.random(), use the random()
7
- method like so:
8
-
9
- var m = new MersenneTwister();
10
- var randomNumber = m.random();
11
-
12
- You can also call the other genrand_{foo}() methods on the instance.
13
- If you want to use a specific seed in order to get a repeatable random
14
- sequence, pass an integer into the constructor:
15
- var m = new MersenneTwister(123);
16
- and that will always produce the same random sequence.
17
- Sean McCullough (banksean@gmail.com)
18
- */
19
-
20
- /*
21
- A C-program for MT19937, with initialization improved 2002/1/26.
22
- Coded by Takuji Nishimura and Makoto Matsumoto.
23
-
24
- Before using, initialize the state by using init_genrand(seed)
25
- or init_by_array(init_key, key_length).
26
-
27
- Copyright (C) 1997 - 2002, Makoto Matsumoto and Takuji Nishimura,
28
- All rights reserved.
29
-
30
- Redistribution and use in source and binary forms, with or without
31
- modification, are permitted provided that the following conditions
32
- are met:
33
-
34
- 1. Redistributions of source code must retain the above copyright
35
- notice, this list of conditions and the following disclaimer.
36
-
37
- 2. Redistributions in binary form must reproduce the above copyright
38
- notice, this list of conditions and the following disclaimer in the
39
- documentation and/or other materials provided with the distribution.
40
-
41
- 3. The names of its contributors may not be used to endorse or promote
42
- products derived from this software without specific prior written
43
- permission.
44
-
45
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
46
- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
47
- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
48
- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
49
- CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
50
- EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
51
- PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
52
- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
53
- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
54
- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
55
- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
56
-
57
-
58
- Any feedback is very welcome.
59
- http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/emt.html
60
- email: m-mat @ math.sci.hiroshima-u.ac.jp (remove space)
61
- */
62
-
63
- export class MersenneTwister {
64
- constructor(seed = new Date().getTime()) {
65
-
66
- /* Period parameters */
67
- this.N = 624;
68
- this.M = 397;
69
- this.MATRIX_A = 0x9908b0df;
70
- /* constant vector a */
71
- this.UPPER_MASK = 0x80000000;
72
- /* most significant w-r bits */
73
- this.LOWER_MASK = 0x7fffffff;
74
- /* least significant r bits */
75
-
76
- this.mt = new Array(this.N);
77
- /* the array for the state vector */
78
- this.mti = this.N + 1;
79
- /* mti==N+1 means mt[N] is not initialized */
80
-
81
- this.init_genrand(seed);
82
- }
83
-
84
- /* initializes mt[N] with a seed */
85
- init_genrand(s) {
86
- this.mt[0] = s >>> 0;
87
- for (this.mti = 1; this.mti < this.N; this.mti++) {
88
- const s = this.mt[this.mti - 1] ^ (this.mt[this.mti - 1] >>> 30);
89
- this.mt[this.mti] = (((((s & 0xffff0000) >>> 16) * 1812433253) << 16) + (s & 0x0000ffff) * 1812433253)
90
- + this.mti;
91
- /* See Knuth TAOCP Vol2. 3rd Ed. P.106 for multiplier. */
92
- /* In the previous versions, MSBs of the seed affect */
93
- /* only MSBs of the array mt[]. */
94
- /* 2002/01/09 modified by Makoto Matsumoto */
95
- this.mt[this.mti] >>>= 0;
96
- /* for >32 bit machines */
97
- }
98
- }
99
-
100
- /* initialize by an array with array-length */
101
- /* init_key is the array for initializing keys */
102
- /* key_length is its length */
103
-
104
- /* slight change for C++, 2004/2/26 */
105
- init_by_array(init_key, key_length) {
106
- let i, j, k;
107
- this.init_genrand(19650218);
108
- i = 1;
109
- j = 0;
110
- k = (this.N > key_length ? this.N : key_length);
111
- for (; k; k--) {
112
- const s = this.mt[i - 1] ^ (this.mt[i - 1] >>> 30)
113
- this.mt[i] = (this.mt[i] ^ (((((s & 0xffff0000) >>> 16) * 1664525) << 16) + ((s & 0x0000ffff) * 1664525)))
114
- + init_key[j] + j;
115
- /* non linear */
116
- this.mt[i] >>>= 0;
117
- /* for WORDSIZE > 32 machines */
118
- i++;
119
- j++;
120
- if (i >= this.N) {
121
- this.mt[0] = this.mt[this.N - 1];
122
- i = 1;
123
- }
124
- if (j >= key_length) j = 0;
125
- }
126
- for (k = this.N - 1; k; k--) {
127
- const s = this.mt[i - 1] ^ (this.mt[i - 1] >>> 30);
128
- this.mt[i] = (this.mt[i] ^ (((((s & 0xffff0000) >>> 16) * 1566083941) << 16) + (s & 0x0000ffff) * 1566083941))
129
- - i;
130
- /* non linear */
131
- this.mt[i] >>>= 0;
132
- /* for WORDSIZE > 32 machines */
133
- i++;
134
- if (i >= this.N) {
135
- this.mt[0] = this.mt[this.N - 1];
136
- i = 1;
137
- }
138
- }
139
-
140
- this.mt[0] = 0x80000000;
141
- /* MSB is 1; assuring non-zero initial array */
142
- }
143
-
144
- /* generates a random number on [0,0xffffffff]-interval */
145
- genrand_int32() {
146
- let y;
147
- const mag01 = new Array(0x0, this.MATRIX_A);
148
- /* mag01[x] = x * MATRIX_A for x=0,1 */
149
-
150
- if (this.mti >= this.N) { /* generate N words at one time */
151
- let kk;
152
-
153
- if (this.mti === this.N + 1) /* if init_genrand() has not been called, */
154
- this.init_genrand(5489);
155
- /* a default initial seed is used */
156
-
157
- for (kk = 0; kk < this.N - this.M; kk++) {
158
- y = (this.mt[kk] & this.UPPER_MASK) | (this.mt[kk + 1] & this.LOWER_MASK);
159
- this.mt[kk] = this.mt[kk + this.M] ^ (y >>> 1) ^ mag01[y & 0x1];
160
- }
161
- for (; kk < this.N - 1; kk++) {
162
- y = (this.mt[kk] & this.UPPER_MASK) | (this.mt[kk + 1] & this.LOWER_MASK);
163
- this.mt[kk] = this.mt[kk + (this.M - this.N)] ^ (y >>> 1) ^ mag01[y & 0x1];
164
- }
165
- y = (this.mt[this.N - 1] & this.UPPER_MASK) | (this.mt[0] & this.LOWER_MASK);
166
- this.mt[this.N - 1] = this.mt[this.M - 1] ^ (y >>> 1) ^ mag01[y & 0x1];
167
-
168
- this.mti = 0;
169
- }
170
-
171
- y = this.mt[this.mti++];
172
-
173
- /* Tempering */
174
- y ^= (y >>> 11);
175
- y ^= (y << 7) & 0x9d2c5680;
176
- y ^= (y << 15) & 0xefc60000;
177
- y ^= (y >>> 18);
178
-
179
- return y >>> 0;
180
- }
181
-
182
- /* generates a random number on [0,0x7fffffff]-interval */
183
- genrand_int31() {
184
- return (this.genrand_int32() >>> 1);
185
- }
186
-
187
- /* generates a random number on [0,1]-real-interval */
188
- genrand_real1() {
189
- return this.genrand_int32() * (1.0 / 4294967295.0);
190
- /* divided by 2^32-1 */
191
- }
192
-
193
- /* generates a random number on [0,1)-real-interval */
194
- random() {
195
- return this.genrand_int32() * (1.0 / 4294967296.0);
196
- /* divided by 2^32 */
197
- }
198
-
199
- /* generates a random number on (0,1)-real-interval */
200
- genrand_real3() {
201
- return (this.genrand_int32() + 0.5) * (1.0 / 4294967296.0);
202
- /* divided by 2^32 */
203
- }
204
-
205
- /* generates a random number on [0,1) with 53-bit resolution*/
206
- genrand_res53() {
207
- const a = this.genrand_int32() >>> 5, b = this.genrand_int32() >>> 6;
208
- return (a * 67108864.0 + b) * (1.0 / 9007199254740992.0);
209
- }
210
- }
211
-
212
- /* These real versions are due to Isaku Wada, 2002/01/09 added */
@@ -1,7 +0,0 @@
1
- /**
2
- * https://gist.github.com/banksean/300494
3
- * @param {number} seed
4
- * @returns {function():number} RNG
5
- */
6
- export function seededRandomMersenneTwister(seed: number): () => number;
7
- //# sourceMappingURL=seededRandomMersenneTwister.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"seededRandomMersenneTwister.d.ts","sourceRoot":"","sources":["../../../../../src/core/math/random/seededRandomMersenneTwister.js"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,kDAHW,MAAM,SACO,MAAM,CAiF7B"}
@@ -1,19 +0,0 @@
1
- export class StepResult {
2
- step: number;
3
- yDelta: number;
4
- error: number;
5
- iterations: number;
6
- }
7
- /**
8
- *
9
- * @param {function(x:number, y:number):number} fxy derivative function
10
- * @param {number} x value of X
11
- * @param {number} y value of Y
12
- * @param {number} suggestedStepSize Suggested step size
13
- * @param {number} tolerance tolerable error size
14
- * @param {number} maxIterations maximum number of iterations allowed to find step
15
- * @param {StepResult} result
16
- * @returns {boolean} true if result is found, false otherwise
17
- */
18
- export function computeStepSize(fxy: any, x: number, y: number, suggestedStepSize: number, tolerance: number, maxIterations: number, result: StepResult): boolean;
19
- //# sourceMappingURL=DormandPrince.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"DormandPrince.d.ts","sourceRoot":"","sources":["../../../../src/engine/simulation/DormandPrince.js"],"names":[],"mappings":"AAoGA;IACQ,aAAS;IACT,eAAW;IACX,cAAU;IACV,mBAAe;CACtB;AAED;;;;;;;;;;GAUG;AACH,6CARW,MAAM,KACN,MAAM,qBACN,MAAM,aACN,MAAM,iBACN,MAAM,UACN,UAAU,GACR,OAAO,CAwCnB"}