@mark1russell7/layout-contract 0.5.0 → 0.5.2
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.
- package/README.md +4 -4
- package/build/index.d.ts +46 -4
- package/build/index.d.ts.map +1 -1
- package/build/index.js +274 -15
- package/build/index.js.map +1 -1
- package/build/{measures-KWg_was6.d.ts → measures-COqcrCzv.d.ts} +8 -3
- package/build/measures-COqcrCzv.d.ts.map +1 -0
- package/build/text.d.ts +1 -1
- package/package.json +1 -1
- package/src/families.ts +56 -0
- package/src/geometry.ts +11 -0
- package/src/measures.ts +2 -0
- package/src/record.ts +7 -3
- package/src/rules.ts +104 -1
- package/src/space-walk.ts +63 -0
- package/src/strategy-space.ts +20 -14
- package/src/tolerance.ts +3 -0
- package/build/measures-KWg_was6.d.ts.map +0 -1
package/README.md
CHANGED
|
@@ -8,7 +8,7 @@ The package has one runtime dependency: `@mark1russell7/rigor-generators`, the h
|
|
|
8
8
|
|
|
9
9
|
| Part | Exports |
|
|
10
10
|
|---|---|
|
|
11
|
-
| Geometry | `Point`, `Rect`, `Region`, `Side`, `Sides`, `Margin`, `marginSides`, `grow`, `boundsOf`, `regionArea`, `translate`, `overlapOf`, `segmentsCross`, `pointSegmentDistance` |
|
|
11
|
+
| Geometry | `Point`, `Rect`, `Region`, `Side`, `Sides`, `Margin`, `marginSides`, `grow`, `boundsOf`, `regionArea`, `translate`, `overlapOf`, `segmentsCross`, `crossingPoint`, `pointSegmentDistance` |
|
|
12
12
|
| The shape kinds | `ShapeKind`, `SHAPE_KINDS`, `SHAPE_KIND_IDS`, `ShapeKindSpec`, `ShapeGeometry`, `DEFAULT_SHAPES`, `ShapeSupport`, `ShapeBound`, `RuleLevel`, `ShapeLevel`, `ShapeCheck`, `isShapeKind`, `shapeKindOf`, `shapeKindsOf`, `itemShapeOf`, `shapeKindProblem`, `shapesOf`, `ruleLevel`, `shapeLevel`, `shapeSupportProblems`, `boxArea`, `checkShapes` |
|
|
13
13
|
| The input `layout-input/1` | `LayoutInput`, `LayoutBox` (`Item` for the packer), `Port`, `portPoint`, `LayoutEdge`, `LayoutContainer`, `Obstacle`, `LayoutCell`, `LayoutGenerator`, `PairGap`, `canonicalInput` |
|
|
14
14
|
| The packer | `PackInput`, `PackLink`, `toPackInput`, `packLinks`, `Placement`, `PackOutput`, `StageTrace`, `applyPack` |
|
|
@@ -32,8 +32,8 @@ The package has one runtime dependency: `@mark1russell7/rigor-generators`, the h
|
|
|
32
32
|
| The option declarations | `OptionSchema`, `OptionDeclaration`, `AnyOption`, `NumberOption`, `BooleanOption`, `EnumOption`, `ValueOption`, `ListItem`, `NoDefault`, `DeclaredStrategy`, `listOptions`, `optionDefaults`, `checkOptions`, `clampOptions`, `sweepValues`, `sweepOf`, `sweepGrid`, `checkSchema` |
|
|
33
33
|
| The strategy catalog | `StrategyCatalog`, `StrategyCatalogSource`, `CatalogEntry`, `ParamRoute`, `StrategyMember`, `CatalogLimit`, `OutputRow`, `OutputEvidence`, `OutputGridClass`, `OutputGridCounts`, `StrategyCatalogSchema`, `STRATEGY_CATALOG_SCHEMA`, `STRATEGY_CATALOG_SCHEMAS`, `OUTPUT_GRID_PROPERTIES`, `OUTPUT_NEAR_WHOLE`, `OUTPUT_CLASS_MIN_INPUTS`, `NODE_POSITIONS_DIMENSION`, `outputGridClass`, `parseStrategyCatalog`, `writeStrategyCatalog`, `checkCatalog`, `catalogDefaults`, `catalogOptions`, `catalogChoices`, `catalogKey`, `decodeOptionValue`, `encodeOptionValue` |
|
|
34
34
|
| The turn | `turnBox`, `turnPort`, `turnMargin`, `turnRegion`, `turnSide`, `turnPoint` |
|
|
35
|
-
| The tolerances | `EPS`, `RECORD_EPS`, `RECORD_SCALE`, `Tolerance`, `DEFAULT_TOLERANCE` |
|
|
36
|
-
| The hard rules | `HARD_RULE_VERSION`, `shapesOverlap`, `circleOverlaps`, `circlesOutside`, `placedCircle`, `PlacedCircle`, `countOverlaps`, `countObstacleHits`, `regionHitsRect`, `rectInRegion`, `countOutside`, `ContainerTest`, `countPortsOffBorder`, `packHard`, `PackHard`, `PACK_HARD_RULES`, `placedRect`, `checkInput` |
|
|
35
|
+
| The tolerances | `EPS`, `EPS_STEPS`, `RECORD_EPS`, `RECORD_SCALE`, `Tolerance`, `DEFAULT_TOLERANCE` |
|
|
36
|
+
| The hard rules | `HARD_RULE_VERSION`, `shapesOverlap`, `circleOverlaps`, `circlesOutside`, `placedCircle`, `PlacedCircle`, `segmentThroughShape`, `countLinksThroughShapes`, `ShapeLink`, `countOverlaps`, `countObstacleHits`, `regionHitsRect`, `rectInRegion`, `countOutside`, `ContainerTest`, `countPortsOffBorder`, `packHard`, `PackHard`, `PACK_HARD_RULES`, `placedRect`, `checkInput` |
|
|
37
37
|
|
|
38
38
|
## The rules
|
|
39
39
|
|
|
@@ -74,7 +74,7 @@ The package has one runtime dependency: `@mark1russell7/rigor-generators`, the h
|
|
|
74
74
|
- **The verdict.** `verdict` compares two strategies on one measure, with the family as the unit. A verdict counts only when it holds for the mean of the family means and for the mean of the inputs.
|
|
75
75
|
- **The record.** A run writes one `layout-record/1` line of JSON Lines. The formats of the engines tell the fields. These rules are new in 0.3.0:
|
|
76
76
|
- `deterministic` is `true` when two runs with the same seed give the same output. A skipped record has `null`, because no run made a claim.
|
|
77
|
-
- A record without `skipped` has a boolean `deterministic
|
|
77
|
+
- A record without `skipped` has a boolean `deterministic`, or `null` when it has `oneRun: true` and the pair had no second run. `checkLayoutRecord` refuses `null` on each other record.
|
|
78
78
|
- An old skipped record has `deterministic: true`. `checkLayoutRecord` accepts it, and `parseLayoutRecord` gives `null` in its place.
|
|
79
79
|
- `env` gives the computer of the run: `node`, `os`, `arch`, `runner`, `cpu` and `cpus`. A timing record also gives `mode`, and it can give `context`.
|
|
80
80
|
- `env.mode` is the mode of the timing, for example `process` or `fresh` of `paired-time/1`. `env.context` is `ci` or `local`, with the Node flags.
|
package/build/index.d.ts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
import { $ as CorpusSplit, A as shapeKindsOf, At as
|
|
1
|
+
import { $ as CorpusSplit, A as shapeKindsOf, At as pointSegmentDistance, B as LayoutInput, C as checkShapes, Ct as Sides, D as ruleLevel, Dt as grow, E as itemShapeOf, Et as crossingPoint, F as LayoutBox, Ft as translate, G as PairGap, H as PackInput, I as LayoutCell, J as packLinks, K as Port, L as LayoutContainer, M as shapeSupportProblems, Mt as segmentsCross, N as shapesOf, Nt as toRect, O as shapeKindOf, Ot as marginSides, P as Item, Pt as toSizedRect, Q as CorpusEntry, R as LayoutEdge, S as boxArea, St as Side, T as isShapeKind, Tt as boundsOf, U as PackInputOptions, V as Obstacle, W as PackLink, X as toPackInput, Y as portPoint, Z as ClaimBreak, _ as ShapeKind, _t as Margin, a as MeasureSpec, at as SPLIT_SCHEMA, b as ShapeLimit, bt as Region, c as minEffectOf, ct as checkDeclared, d as SHAPE_KINDS, dt as declaredClaimOf, et as DeclaredClaim, f as SHAPE_KIND_IDS, ft as declaredCounts, g as ShapeInput, gt as splitFolds, h as ShapeGeometry, ht as splitFileName, i as JointMeasureId, it as FamilyCell, j as shapeLevel, jt as regionArea, k as shapeKindProblem, kt as overlapOf, l as DEFAULT_SHAPES, lt as checkSplit, m as ShapeCheck, mt as leaveOneSeedOut, n as JOINT_MEASURES, nt as FAMILY_ANY_KIND, o as Verdict, ot as SplitCorpus, p as ShapeBound, pt as familyOf, q as canonicalInput, r as JOINT_MOVED_MIN, rt as FamilyBy, s as compareMeasure, st as SplitFold, t as Direction, tt as Declares, u as RuleLevel, ut as corpusHashOf, v as ShapeKindSpec, vt as Point, w as inputShapeLevel, wt as SizedRect, x as ShapeSupport, xt as SIDES, y as ShapeLevel, yt as Rect, z as LayoutGenerator } from "./measures-COqcrCzv.js";
|
|
2
2
|
/** The epsilon for the float compares in an engine. */
|
|
3
3
|
export declare const EPS = 1e-6;
|
|
4
|
+
/** The count of `EPS` steps in one layout unit. It is the integer equal to `1 / EPS`. */
|
|
5
|
+
export declare const EPS_STEPS = 1e6;
|
|
4
6
|
/**
|
|
5
7
|
* The count of grid steps in one unit of a written file. A file rounds each number `v` to `Math.round(v * RECORD_SCALE) / RECORD_SCALE`.
|
|
6
8
|
* Use a multiplication by this value, not a division by `RECORD_EPS`. The two differ at some half steps.
|
|
@@ -94,7 +96,9 @@ export interface LayoutRecord {
|
|
|
94
96
|
readonly hardRule?: number;
|
|
95
97
|
/**
|
|
96
98
|
* The value is `true` when two runs with the same seed give the same positions.
|
|
97
|
-
* A skipped record has `null`, because no run made a claim.
|
|
99
|
+
* A skipped record has `null`, because no run made a claim.
|
|
100
|
+
* A record with `oneRun: true` can also have `null`: the pair had no second run to compare.
|
|
101
|
+
* Each other record has a boolean.
|
|
98
102
|
*/
|
|
99
103
|
readonly deterministic: boolean | null;
|
|
100
104
|
/** The id of the prediction that was written before the run. */
|
|
@@ -106,6 +110,7 @@ export interface LayoutRecord {
|
|
|
106
110
|
/**
|
|
107
111
|
* The value is `true` when a measure of the pair chose 1 timed repeat and no warm-up.
|
|
108
112
|
* Then `ms` is one time, so a time gate does not read this record.
|
|
113
|
+
* A bench that runs such a pair only once writes `deterministic: null`, and its record makes no claim on determinism.
|
|
109
114
|
*/
|
|
110
115
|
readonly oneRun?: boolean;
|
|
111
116
|
/** The wall budget of the pair of a strategy and an input, in milliseconds. */
|
|
@@ -161,7 +166,7 @@ export declare function hardRuleOf(record: Pick<LayoutRecord, "hardRule">): numb
|
|
|
161
166
|
/**
|
|
162
167
|
* This function gives the problems of one `layout-record/1` value. An empty list means a good record.
|
|
163
168
|
* A record that has `skipped` has `deterministic: null`. An old skipped record with a boolean is also correct.
|
|
164
|
-
* A record without `skipped` has a boolean
|
|
169
|
+
* A record without `skipped` has a boolean, or `null` when it has `oneRun: true`. The check accepts fields that the format does not know.
|
|
165
170
|
*/
|
|
166
171
|
export declare function checkLayoutRecord(value: unknown): string[];
|
|
167
172
|
/**
|
|
@@ -230,6 +235,25 @@ export interface ContainerTest {
|
|
|
230
235
|
* - Each other box does not count. The function throws a `RangeError` for a container that is not a circle.
|
|
231
236
|
*/
|
|
232
237
|
export declare function circlesOutside(input: LayoutInput, tolerance?: number): number;
|
|
238
|
+
/**
|
|
239
|
+
* This function tells if the segment `ab` goes through a placed box, by the rule of `Tolerance.through`.
|
|
240
|
+
* A part of the segment longer than `tolerance` is inside the shape made `tolerance` smaller.
|
|
241
|
+
*
|
|
242
|
+
* - A circle box reads its circle. Each other kind reads its bounding box, so on a polygon or a free shape the answer is an upper bound.
|
|
243
|
+
* - The margin of the box does not count. A box without a position gives `false`.
|
|
244
|
+
*/
|
|
245
|
+
export declare function segmentThroughShape(a: Point, b: Point, box: LayoutBox, tolerance?: number): boolean;
|
|
246
|
+
/** A route between two boxes: the ids of its ends and its points. `countLinksThroughShapes` reads it. */
|
|
247
|
+
export interface ShapeLink {
|
|
248
|
+
readonly source: string;
|
|
249
|
+
readonly target: string;
|
|
250
|
+
readonly points: readonly Point[];
|
|
251
|
+
}
|
|
252
|
+
/**
|
|
253
|
+
* This function counts the routes that go through a placed box that is not one of their two ends, by `segmentThroughShape`.
|
|
254
|
+
* A route counts once, also when it goes through more than one box.
|
|
255
|
+
*/
|
|
256
|
+
export declare function countLinksThroughShapes(boxes: readonly LayoutBox[], links: readonly ShapeLink[], tolerance?: number): number;
|
|
233
257
|
/**
|
|
234
258
|
* This function counts the placed boxes that go out of the container.
|
|
235
259
|
* Each box with its margin must stay inside the container made smaller by `inset`. Only the fixed sides of the size count. A shaped container counts as its bounding box.
|
|
@@ -783,6 +807,14 @@ export interface SampleOptions extends ShapeFilter {
|
|
|
783
807
|
readonly meta?: "skip" | "sample";
|
|
784
808
|
/** The largest count of option draws. The default is the larger value of 1000 and `100 * n`. */
|
|
785
809
|
readonly maxTries?: number;
|
|
810
|
+
/**
|
|
811
|
+
* How a point keeps the constraints. With `reject` (the default), a point that breaks a constraint draws again.
|
|
812
|
+
* With `walk`, a point draws its stages from the largest to the smallest. Each stage draws only from the options that keep the constraints with the stages before it.
|
|
813
|
+
* A space whose constraints reject most draws gets its sample with `walk`. The two values give different configs for one seed.
|
|
814
|
+
* A sample of `walk` is not uniform over the valid configs. Each option of the largest stage gets an equal share, whatever count of valid configs it has.
|
|
815
|
+
* Thus a mean over this sample is not a mean of the space.
|
|
816
|
+
*/
|
|
817
|
+
readonly draw?: "reject" | "walk";
|
|
786
818
|
}
|
|
787
819
|
/** The options of `enumerateSpace`. */
|
|
788
820
|
export type EnumerateOptions = GridOptions | SampleOptions;
|
|
@@ -837,6 +869,7 @@ export declare function spaceSize(space: StrategySpace, options: SpaceSizeOption
|
|
|
837
869
|
* - The mode `grid` gives each grid point without a meta option, in a stable order. Stages, options and values go in the order of the space.
|
|
838
870
|
* - The mode `sample` gives `n` configs of a seeded Latin hypercube. The options of a stage get equal strata, and each active param gets its own strata.
|
|
839
871
|
* - A sample draws again when a point breaks a constraint. After `maxTries` draws, it throws an `Error`. Two sampled configs can be equal.
|
|
872
|
+
* - With `draw: "walk"`, each stage draws only from the options that keep the constraints with the stages before it. The largest stage keeps its equal strata.
|
|
840
873
|
* - With `shapes`, only the options that support each kind of the list count. Without `shapes`, the result does not change.
|
|
841
874
|
* - A meta option with a `pool` gives only the entries of its pool. With `shapes`, only the entries whose members support each kind count.
|
|
842
875
|
* - A sample draws again when a point chooses a meta option without a member list. `spaceSize` gives such an option 0.
|
|
@@ -1643,11 +1676,20 @@ export declare const EDGES_STEP: CorpusStep;
|
|
|
1643
1676
|
* The step `edge-key` of `edgeKeyStep` (version 1), as a corpus step. It comes directly after `EDGES_STEP`. Its family part is `key-<edgeKey>`.
|
|
1644
1677
|
*/
|
|
1645
1678
|
export declare const EDGE_KEY_STEP: CorpusStep;
|
|
1679
|
+
/**
|
|
1680
|
+
* The shared family `circle-scattered`, version 1: circle items of random whole radii in a fixed container, with no obstacles and no edges.
|
|
1681
|
+
*
|
|
1682
|
+
* - The dimension `containerShape` takes `rect` or `circle`. One seed gives the same radii in the 2 containers, so a pair joins on the seed.
|
|
1683
|
+
* - The circles fill approximately half of the container, and the container is at least as large as the largest circle.
|
|
1684
|
+
* - The stream `items` gives each radius, from 8 to 40. The stream `container` gives the width of a rectangle over its side, from 0.80 to 1.25.
|
|
1685
|
+
* - The family has no margin and no gap. Each value comes from whole numbers and `Math.sqrt`, which each engine rounds correctly, so the family is `exact`.
|
|
1686
|
+
*/
|
|
1687
|
+
export declare const CIRCLE_SCATTERED: CorpusFamily<LayoutInput>;
|
|
1646
1688
|
/**
|
|
1647
1689
|
* The shared family `rect-scattered`, version 1: a fixed rectangle container, rectangle obstacles at random places and boxes without positions.
|
|
1648
1690
|
* It is the one copy of the generator of `docs/FORMAT.md` of `packing`. Its input is the input of `packing`, byte for byte.
|
|
1649
1691
|
* The steps `container`, `obstacles` and `boxes` each have a stream of `stepRandom`. Each value is a whole number, so the family is `exact`.
|
|
1650
1692
|
*/
|
|
1651
1693
|
export declare const RECT_SCATTERED: CorpusFamily<LayoutInput>;
|
|
1652
|
-
export { ClaimBreak, CorpusEntry, CorpusSplit, DEFAULT_SHAPES, DeclaredClaim, Declares, Direction, FAMILY_ANY_KIND, FamilyBy, FamilyCell, Item, JOINT_MEASURES, JOINT_MOVED_MIN, JointMeasureId, LayoutBox, LayoutCell, LayoutContainer, LayoutEdge, LayoutGenerator, LayoutInput, Margin, MeasureSpec, Obstacle, PackInput, PackInputOptions, PackLink, PairGap, Point, Port, Rect, Region, RuleLevel, SHAPE_KINDS, SHAPE_KIND_IDS, SIDES, SPLIT_SCHEMA, ShapeBound, ShapeCheck, ShapeGeometry, ShapeInput, ShapeKind, ShapeKindSpec, ShapeLevel, ShapeLimit, ShapeSupport, Side, Sides, SizedRect, SplitCorpus, SplitFold, Verdict, boundsOf, boxArea, canonicalInput, checkDeclared, checkShapes, checkSplit, compareMeasure, corpusHashOf, declaredClaimOf, declaredCounts, familyOf, grow, inputShapeLevel, isShapeKind, itemShapeOf, leaveOneSeedOut, marginSides, minEffectOf, overlapOf, packLinks, pointSegmentDistance, portPoint, regionArea, ruleLevel, segmentsCross, shapeKindOf, shapeKindProblem, shapeKindsOf, shapeLevel, shapeSupportProblems, shapesOf, splitFileName, splitFolds, toPackInput, toRect, toSizedRect, translate };
|
|
1694
|
+
export { ClaimBreak, CorpusEntry, CorpusSplit, DEFAULT_SHAPES, DeclaredClaim, Declares, Direction, FAMILY_ANY_KIND, FamilyBy, FamilyCell, Item, JOINT_MEASURES, JOINT_MOVED_MIN, JointMeasureId, LayoutBox, LayoutCell, LayoutContainer, LayoutEdge, LayoutGenerator, LayoutInput, Margin, MeasureSpec, Obstacle, PackInput, PackInputOptions, PackLink, PairGap, Point, Port, Rect, Region, RuleLevel, SHAPE_KINDS, SHAPE_KIND_IDS, SIDES, SPLIT_SCHEMA, ShapeBound, ShapeCheck, ShapeGeometry, ShapeInput, ShapeKind, ShapeKindSpec, ShapeLevel, ShapeLimit, ShapeSupport, Side, Sides, SizedRect, SplitCorpus, SplitFold, Verdict, boundsOf, boxArea, canonicalInput, checkDeclared, checkShapes, checkSplit, compareMeasure, corpusHashOf, crossingPoint, declaredClaimOf, declaredCounts, familyOf, grow, inputShapeLevel, isShapeKind, itemShapeOf, leaveOneSeedOut, marginSides, minEffectOf, overlapOf, packLinks, pointSegmentDistance, portPoint, regionArea, ruleLevel, segmentsCross, shapeKindOf, shapeKindProblem, shapeKindsOf, shapeLevel, shapeSupportProblems, shapesOf, splitFileName, splitFolds, toPackInput, toRect, toSizedRect, translate };
|
|
1653
1695
|
//# sourceMappingURL=index.d.ts.map
|
package/build/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","names":[],"sources":["../src/tolerance.ts","../src/output.ts","../src/record.ts","../src/rules.ts","../src/turn.ts","../src/balance.ts","../src/strategy.ts","../src/random.ts","../src/edges.ts","../src/hash.ts","../src/portfolio.ts","../src/strategy-space.ts","../src/strategy-options.ts","../src/strategy-catalog.ts","../src/verdict.ts","../src/families.ts"],"mappings":";;qBACa;;;;;qBAMA;;;;;qBAMA;;;;;iBAMI;;WAEN;;WAEA;;;;;;qBAOE,mBAAmB;;
|
|
1
|
+
{"version":3,"file":"index.d.ts","names":[],"sources":["../src/tolerance.ts","../src/output.ts","../src/record.ts","../src/rules.ts","../src/turn.ts","../src/balance.ts","../src/strategy.ts","../src/random.ts","../src/edges.ts","../src/hash.ts","../src/portfolio.ts","../src/strategy-space.ts","../src/strategy-options.ts","../src/strategy-catalog.ts","../src/verdict.ts","../src/families.ts"],"mappings":";;qBACa;;qBAGA;;;;;qBAMA;;;;;qBAMA;;;;;iBAMI;;WAEN;;WAEA;;;;;;qBAOE,mBAAmB;;iBC5Bf;WACN;WACA;WACA;WACA;;;iBAIM;WACN;WACA;WACA,WAAW,SAAS;;;iBAId;WACN,qBAAqB;;WAErB;;WAEA;aAAiB;aAAoB;;;WAErC;aAA2B;aAAqB;aAAoB;;WACpE,iBAAiB;;;;;;;wBAQZ,UAAU,OAAO,aAAa,QAAQ,aAAa;;YC/BvD;;iBAGK;WACN;WACA,OAAO;WACP;WACA;;WAEA,SAAS,SAAS;WAClB;;WAEA;;WAEA;WACA;WACA;WACA;WACA;;WAEA,kBAAkB;;WAElB,UAAU,SAAS;;WAEnB,MAAM,SAAS;;WAEf,YAAY,SAAS,QAAQ;;WAE7B;;;;;;;WAOA;;WAEA;;WAEA;;WAEA;;;;;;WAMA;;WAEA;;WAEA;;WAEA;;;;;WAKA;;WAEA,MAAM;;WAEN;WACA;;;;;;YAOC,WAAW,SAAS;;iBAGf;WACN;WACA;WACA;;WAEA;;WAEA;;WAEA;;WAEA;;WAEA;;;YAIC,WAAW,KAAK;;;;;wBAMZ,eAAe,OAAO,aAAa,KAAK,WAAW;;;;;wBAkDnD,WAAW,QAAQ,KAAK;;;;;;wBASxB,kBAAkB;;;;;;wBAmClB,kBAAkB,iBAAiB;;wBC5LnC,WAAW,KAAK,YAAY;;;;;;;qBAa/B;;iBAGI;WACN;WACA;WACA;;;wBAIK,aAAa,KAA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AAgB,aAAa"}
|
package/build/index.js
CHANGED
|
@@ -166,6 +166,19 @@ function opposite(p, q) {
|
|
|
166
166
|
function segmentsCross(a, b, c, d) {
|
|
167
167
|
return opposite(orient(c, d, a), orient(c, d, b)) && opposite(orient(a, b, c), orient(a, b, d));
|
|
168
168
|
}
|
|
169
|
+
/**
|
|
170
|
+
* This function gives the point where the segments `ab` and `cd` cross, or `undefined`.
|
|
171
|
+
* It gives a point exactly when `segmentsCross` is true, so a touch at an end and collinear segments give `undefined`.
|
|
172
|
+
*/
|
|
173
|
+
function crossingPoint(a, b, c, d) {
|
|
174
|
+
if (!segmentsCross(a, b, c, d)) return void 0;
|
|
175
|
+
const from = orient(c, d, a);
|
|
176
|
+
const t = from / (from - orient(c, d, b));
|
|
177
|
+
return {
|
|
178
|
+
x: a.x + t * (b.x - a.x),
|
|
179
|
+
y: a.y + t * (b.y - a.y)
|
|
180
|
+
};
|
|
181
|
+
}
|
|
169
182
|
/** This function gives the shortest distance from `p` to the segment `ab`. A segment of length 0 is the point `a`. */
|
|
170
183
|
function pointSegmentDistance(p, a, b) {
|
|
171
184
|
const dx = b.x - a.x;
|
|
@@ -402,6 +415,8 @@ function checkShapes(input, uses, options = {}) {
|
|
|
402
415
|
// src/tolerance.ts
|
|
403
416
|
/** The epsilon for the float compares in an engine. */
|
|
404
417
|
const EPS = 1e-6;
|
|
418
|
+
/** The count of `EPS` steps in one layout unit. It is the integer equal to `1 / EPS`. */
|
|
419
|
+
const EPS_STEPS = 1e6;
|
|
405
420
|
/**
|
|
406
421
|
* The count of grid steps in one unit of a written file. A file rounds each number `v` to `Math.round(v * RECORD_SCALE) / RECORD_SCALE`.
|
|
407
422
|
* Use a multiplication by this value, not a division by `RECORD_EPS`. The two differ at some half steps.
|
|
@@ -725,7 +740,7 @@ function hardRuleOf(record) {
|
|
|
725
740
|
/**
|
|
726
741
|
* This function gives the problems of one `layout-record/1` value. An empty list means a good record.
|
|
727
742
|
* A record that has `skipped` has `deterministic: null`. An old skipped record with a boolean is also correct.
|
|
728
|
-
* A record without `skipped` has a boolean
|
|
743
|
+
* A record without `skipped` has a boolean, or `null` when it has `oneRun: true`. The check accepts fields that the format does not know.
|
|
729
744
|
*/
|
|
730
745
|
function checkLayoutRecord(value) {
|
|
731
746
|
if (!isFields$1(value)) return ["the record is not an object"];
|
|
@@ -751,7 +766,8 @@ function checkLayoutRecord(value) {
|
|
|
751
766
|
if (v["env"] !== void 0) out.push(...envProblems(v["env"]));
|
|
752
767
|
const deterministic = v["deterministic"];
|
|
753
768
|
if (v["skipped"] === void 0) {
|
|
754
|
-
|
|
769
|
+
const noClaim = deterministic === null && v["oneRun"] === true;
|
|
770
|
+
if (typeof deterministic !== "boolean" && !noClaim) out.push("deterministic is not a boolean, and the record has no skipped");
|
|
755
771
|
} else if (deterministic !== null && typeof deterministic !== "boolean") out.push("deterministic of a skipped record is not null or a boolean");
|
|
756
772
|
return out;
|
|
757
773
|
}
|
|
@@ -975,6 +991,111 @@ function circlesOutside(input, tolerance = DEFAULT_TOLERANCE.overlap) {
|
|
|
975
991
|
}
|
|
976
992
|
return count;
|
|
977
993
|
}
|
|
994
|
+
/** This function gives the length of the part of the segment `ab` inside a circle. A radius of 0 or less gives 0. */
|
|
995
|
+
function partInCircle(a, b, cx, cy, r) {
|
|
996
|
+
if (r <= 0) return 0;
|
|
997
|
+
const dx = b.x - a.x;
|
|
998
|
+
const dy = b.y - a.y;
|
|
999
|
+
const fx = a.x - cx;
|
|
1000
|
+
const fy = a.y - cy;
|
|
1001
|
+
const l2 = dx * dx + dy * dy;
|
|
1002
|
+
if (l2 === 0) return 0;
|
|
1003
|
+
const half = fx * dx + fy * dy;
|
|
1004
|
+
const inner = half * half - l2 * (fx * fx + fy * fy - r * r);
|
|
1005
|
+
if (inner <= 0) return 0;
|
|
1006
|
+
const root = Math.sqrt(inner);
|
|
1007
|
+
const t0 = Math.max(0, (-half - root) / l2);
|
|
1008
|
+
const t1 = Math.min(1, (-half + root) / l2);
|
|
1009
|
+
return t1 > t0 ? (t1 - t0) * Math.sqrt(l2) : 0;
|
|
1010
|
+
}
|
|
1011
|
+
/** This function gives the length of the part of the segment `ab` inside the open box from (`x0`, `y0`) to (`x1`, `y1`). A box with no inside gives 0. */
|
|
1012
|
+
function partInBox(a, b, x0, y0, x1, y1) {
|
|
1013
|
+
if (x1 <= x0 || y1 <= y0) return 0;
|
|
1014
|
+
const dx = b.x - a.x;
|
|
1015
|
+
const dy = b.y - a.y;
|
|
1016
|
+
let t0 = 0;
|
|
1017
|
+
let t1 = 1;
|
|
1018
|
+
for (const [from, d, lo, hi] of [[
|
|
1019
|
+
a.x,
|
|
1020
|
+
dx,
|
|
1021
|
+
x0,
|
|
1022
|
+
x1
|
|
1023
|
+
], [
|
|
1024
|
+
a.y,
|
|
1025
|
+
dy,
|
|
1026
|
+
y0,
|
|
1027
|
+
y1
|
|
1028
|
+
]]) {
|
|
1029
|
+
if (d === 0) {
|
|
1030
|
+
if (from <= lo || from >= hi) return 0;
|
|
1031
|
+
continue;
|
|
1032
|
+
}
|
|
1033
|
+
const ta = (lo - from) / d;
|
|
1034
|
+
const tb = (hi - from) / d;
|
|
1035
|
+
t0 = Math.max(t0, Math.min(ta, tb));
|
|
1036
|
+
t1 = Math.min(t1, Math.max(ta, tb));
|
|
1037
|
+
if (t0 > t1) return 0;
|
|
1038
|
+
}
|
|
1039
|
+
return (t1 - t0) * Math.sqrt(dx * dx + dy * dy);
|
|
1040
|
+
}
|
|
1041
|
+
/**
|
|
1042
|
+
* This function tells if the segment `ab` goes through a placed box, by the rule of `Tolerance.through`.
|
|
1043
|
+
* A part of the segment longer than `tolerance` is inside the shape made `tolerance` smaller.
|
|
1044
|
+
*
|
|
1045
|
+
* - A circle box reads its circle. Each other kind reads its bounding box, so on a polygon or a free shape the answer is an upper bound.
|
|
1046
|
+
* - The margin of the box does not count. A box without a position gives `false`.
|
|
1047
|
+
*/
|
|
1048
|
+
function segmentThroughShape(a, b, box, tolerance = DEFAULT_TOLERANCE.through) {
|
|
1049
|
+
const disc = placedCircle(box);
|
|
1050
|
+
if (disc !== void 0) return partInCircle(a, b, disc.cx, disc.cy, disc.r - tolerance) > tolerance;
|
|
1051
|
+
const r = placedRect(box);
|
|
1052
|
+
if (r === void 0) return false;
|
|
1053
|
+
return partInBox(a, b, r.x + tolerance, r.y + tolerance, r.x + r.w - tolerance, r.y + r.h - tolerance) > tolerance;
|
|
1054
|
+
}
|
|
1055
|
+
/**
|
|
1056
|
+
* This function counts the routes that go through a placed box that is not one of their two ends, by `segmentThroughShape`.
|
|
1057
|
+
* A route counts once, also when it goes through more than one box.
|
|
1058
|
+
*/
|
|
1059
|
+
function countLinksThroughShapes(boxes, links, tolerance = DEFAULT_TOLERANCE.through) {
|
|
1060
|
+
const placed = boxes.flatMap((box) => {
|
|
1061
|
+
const r = placedRect(box);
|
|
1062
|
+
return r === void 0 ? [] : [{
|
|
1063
|
+
box,
|
|
1064
|
+
r
|
|
1065
|
+
}];
|
|
1066
|
+
});
|
|
1067
|
+
placed.sort((p, q) => p.r.x - q.r.x);
|
|
1068
|
+
const widest = placed.reduce((m, p) => Math.max(m, p.r.w), 0);
|
|
1069
|
+
const firstAt = (x) => {
|
|
1070
|
+
let lo = 0;
|
|
1071
|
+
let hi = placed.length;
|
|
1072
|
+
while (lo < hi) {
|
|
1073
|
+
const mid = lo + hi >>> 1;
|
|
1074
|
+
if (placed[mid].r.x < x) lo = mid + 1;
|
|
1075
|
+
else hi = mid;
|
|
1076
|
+
}
|
|
1077
|
+
return lo;
|
|
1078
|
+
};
|
|
1079
|
+
let count = 0;
|
|
1080
|
+
for (const link of links) {
|
|
1081
|
+
let hit = false;
|
|
1082
|
+
for (let i = 1; i < link.points.length && !hit; i++) {
|
|
1083
|
+
const a = link.points[i - 1];
|
|
1084
|
+
const b = link.points[i];
|
|
1085
|
+
const left = Math.min(a.x, b.x);
|
|
1086
|
+
const right = Math.max(a.x, b.x);
|
|
1087
|
+
const top = Math.min(a.y, b.y);
|
|
1088
|
+
const bottom = Math.max(a.y, b.y);
|
|
1089
|
+
for (let k = firstAt(left - widest); k < placed.length && placed[k].r.x < right && !hit; k++) {
|
|
1090
|
+
const { box, r } = placed[k];
|
|
1091
|
+
if (r.x + r.w <= left || r.y >= bottom || r.y + r.h <= top) continue;
|
|
1092
|
+
if (box.id !== link.source && box.id !== link.target && segmentThroughShape(a, b, box, tolerance)) hit = true;
|
|
1093
|
+
}
|
|
1094
|
+
}
|
|
1095
|
+
if (hit) count++;
|
|
1096
|
+
}
|
|
1097
|
+
return count;
|
|
1098
|
+
}
|
|
978
1099
|
/**
|
|
979
1100
|
* This function counts the placed boxes that go out of the container.
|
|
980
1101
|
* Each box with its margin must stay inside the container made smaller by `inset`. Only the fixed sides of the size count. A shaped container counts as its bounding box.
|
|
@@ -1416,6 +1537,15 @@ const JOINT_MEASURES = /* @__PURE__ */ Object.freeze([
|
|
|
1416
1537
|
role: "diagnostic",
|
|
1417
1538
|
shapes: BOUNDS_ONLY
|
|
1418
1539
|
},
|
|
1540
|
+
{
|
|
1541
|
+
id: "joint.route.length",
|
|
1542
|
+
unit: "layout units for each route",
|
|
1543
|
+
direction: "lower",
|
|
1544
|
+
min: 0,
|
|
1545
|
+
max: Infinity,
|
|
1546
|
+
role: "diagnostic",
|
|
1547
|
+
shapes: BOUNDS_ONLY
|
|
1548
|
+
},
|
|
1419
1549
|
{
|
|
1420
1550
|
id: "joint.ms",
|
|
1421
1551
|
unit: "milliseconds",
|
|
@@ -2773,6 +2903,48 @@ function leaveOneSeedOut(seeds) {
|
|
|
2773
2903
|
heldOut: [s]
|
|
2774
2904
|
}));
|
|
2775
2905
|
}
|
|
2906
|
+
// src/space-walk.ts
|
|
2907
|
+
const refMatches = (ref, choices) => (choices.get(ref.stage) ?? null) === ref.option;
|
|
2908
|
+
/** This function tells if the option choices keep a constraint. */
|
|
2909
|
+
function holds(c, choices) {
|
|
2910
|
+
if (!refMatches(c.if, choices)) return true;
|
|
2911
|
+
return "not" in c.then ? !refMatches(c.then.not, choices) : refMatches(c.then, choices);
|
|
2912
|
+
}
|
|
2913
|
+
const otherStage = (c) => "not" in c.then ? c.then.not.stage : c.then.stage;
|
|
2914
|
+
/** This function tells if an option of a stage keeps each constraint between that stage and the stages that a walk has fixed. */
|
|
2915
|
+
function fitsWalk(constraints, fixed, stage, id) {
|
|
2916
|
+
fixed.set(stage, id);
|
|
2917
|
+
const ok = constraints.every((c) => !fixed.has(c.if.stage === stage ? otherStage(c) : c.if.stage) || holds(c, fixed));
|
|
2918
|
+
fixed.delete(stage);
|
|
2919
|
+
return ok;
|
|
2920
|
+
}
|
|
2921
|
+
/** This function gives the plan of a walk. Stages of equal size keep the order of the space. */
|
|
2922
|
+
function walkPlan(stages, lists, constraints, n) {
|
|
2923
|
+
return {
|
|
2924
|
+
stages,
|
|
2925
|
+
lists,
|
|
2926
|
+
n,
|
|
2927
|
+
order: stages.map((_, k) => k).sort((a, b) => lists[b].length - lists[a].length || a - b),
|
|
2928
|
+
naming: stages.map((s) => constraints.filter((c) => c.if.stage === s.name || otherStage(c) === s.name))
|
|
2929
|
+
};
|
|
2930
|
+
}
|
|
2931
|
+
/**
|
|
2932
|
+
* This function gives the options of one point of a walk. It fixes the largest stage first. Thus that stage keeps its equal strata, and the constraints limit only the smaller stages.
|
|
2933
|
+
* The value `picks[k][i]` is the stratum of the stage `k` for the point `i`. A stage with no open option gets `null`, and the caller rejects that point.
|
|
2934
|
+
* The argument `fits` lets a test give a fault. The default is `fitsWalk`.
|
|
2935
|
+
*/
|
|
2936
|
+
function walkPoint(plan, picks, i, fits = fitsWalk) {
|
|
2937
|
+
const fixed = /* @__PURE__ */ new Map();
|
|
2938
|
+
const out = /* @__PURE__ */ new Map();
|
|
2939
|
+
for (const k of plan.order) {
|
|
2940
|
+
const s = plan.stages[k];
|
|
2941
|
+
const open = plan.lists[k].filter((o) => fits(plan.naming[k], fixed, s.name, o?.id ?? null));
|
|
2942
|
+
const o = open[Math.floor(picks[k][i] * open.length / plan.n)] ?? null;
|
|
2943
|
+
fixed.set(s.name, o?.id ?? null);
|
|
2944
|
+
out.set(s.name, o);
|
|
2945
|
+
}
|
|
2946
|
+
return out;
|
|
2947
|
+
}
|
|
2776
2948
|
// src/strategy-space.ts
|
|
2777
2949
|
/** The schema of a strategy space. */
|
|
2778
2950
|
const STRATEGY_SPACE_SCHEMA = "strategy-space/1";
|
|
@@ -2842,12 +3014,6 @@ function partOf(space, stage) {
|
|
|
2842
3014
|
}
|
|
2843
3015
|
/** This function gives the prefix of the innermost part of each stage. */
|
|
2844
3016
|
const prefixes = (space) => new Map(space.stages.map((s) => [s.name, partOf(space, s.name).prefix]));
|
|
2845
|
-
const refMatches = (ref, choices) => (choices.get(ref.stage) ?? null) === ref.option;
|
|
2846
|
-
/** This function tells if the option choices keep a constraint. */
|
|
2847
|
-
function holds(c, choices) {
|
|
2848
|
-
if (!refMatches(c.if, choices)) return true;
|
|
2849
|
-
return "not" in c.then ? !refMatches(c.then.not, choices) : refMatches(c.then, choices);
|
|
2850
|
-
}
|
|
2851
3017
|
const describe = (c) => {
|
|
2852
3018
|
const ref = (r) => `${r.stage}=${r.option ?? "null"}`;
|
|
2853
3019
|
return "not" in c.then ? `if ${ref(c.if)} then not ${ref(c.then.not)}` : `if ${ref(c.if)} then ${ref(c.then)}`;
|
|
@@ -3525,7 +3691,7 @@ const subSeed = (seed, step) => Math.floor(stepRandom(seed, step)() * 4294967296
|
|
|
3525
3691
|
* This function gives a sample of a space: Latin hypercube strata over the options, the params and the member counts.
|
|
3526
3692
|
* `canon` is the space of `canonicalConfig`: the space before a shape filter. A member of an option with `view: "bounds"` can have an option that the filter removed.
|
|
3527
3693
|
*/
|
|
3528
|
-
function sampleConfigs(space, n, seed, meta, maxTries, canon = space) {
|
|
3694
|
+
function sampleConfigs(space, n, seed, meta, maxTries, canon = space, walk = false) {
|
|
3529
3695
|
const stages = space.stages;
|
|
3530
3696
|
const prefix = prefixes(space);
|
|
3531
3697
|
const bounded = new Set(stages.filter((s) => meta && s.options.some((o) => memberSpaces.has(o))).map((s) => prefix.get(s.name)));
|
|
@@ -3542,15 +3708,17 @@ function sampleConfigs(space, n, seed, meta, maxTries, canon = space) {
|
|
|
3542
3708
|
if (!usable.has(o)) usable.set(o, hasMembers(space, s.name, o));
|
|
3543
3709
|
return usable.get(o);
|
|
3544
3710
|
};
|
|
3711
|
+
const plan = walk ? walkPlan(stages, lists, space.constraints ?? [], n) : null;
|
|
3545
3712
|
const points = [];
|
|
3546
3713
|
let tries = 0;
|
|
3547
3714
|
for (let round = 0; points.length < n; round++) {
|
|
3548
3715
|
const r = stepRandom(seed, `options:${round}`);
|
|
3549
|
-
const
|
|
3716
|
+
const picks = walk ? lists.map(() => permutation(n, r)) : [];
|
|
3717
|
+
const columns = walk ? [] : lists.map((list) => permutation(n, r).map((p) => list[Math.floor(p * list.length / n)]));
|
|
3550
3718
|
for (let i = 0; i < n && points.length < n; i++) {
|
|
3551
|
-
if (tries >= maxTries) throw new Error(`The constraints of the space ${space.engine} remove too many points: ${points.length} of ${n} configs after ${tries} tries
|
|
3719
|
+
if (tries >= maxTries) throw new Error(`The constraints of the space ${space.engine} remove too many points: ${points.length} of ${n} configs after ${tries} tries.${walk ? "" : " The option draw: \"walk\" gets a sample of a space with many constraints."}`);
|
|
3552
3720
|
tries++;
|
|
3553
|
-
const choices = new Map(stages.map((s, k) => [s.name, columns[k][i]]));
|
|
3721
|
+
const choices = plan !== null ? walkPoint(plan, picks, i) : new Map(stages.map((s, k) => [s.name, columns[k][i]]));
|
|
3554
3722
|
const metaPart = /* @__PURE__ */ new Map();
|
|
3555
3723
|
for (const s of stages) if (choices.get(s.name)?.members !== void 0 && !metaPart.has(prefix.get(s.name))) metaPart.set(prefix.get(s.name), s.name);
|
|
3556
3724
|
for (const s of stages) {
|
|
@@ -3585,7 +3753,7 @@ function sampleConfigs(space, n, seed, meta, maxTries, canon = space) {
|
|
|
3585
3753
|
const part = memberSpaces.get(o) ?? partOf(space, s.name).space;
|
|
3586
3754
|
const poolSize = Math.max(n, 4 * o.members.max, 8);
|
|
3587
3755
|
const seen = /* @__PURE__ */ new Set();
|
|
3588
|
-
const pool = sampleConfigs(part, poolSize, subSeed(seed, `pool:${s.name}:${o.id}`), false, Math.max(1e3, 100 * poolSize)).filter((c) => {
|
|
3756
|
+
const pool = sampleConfigs(part, poolSize, subSeed(seed, `pool:${s.name}:${o.id}`), false, Math.max(1e3, 100 * poolSize), part, walk).filter((c) => {
|
|
3589
3757
|
const id = idOf(c);
|
|
3590
3758
|
return seen.has(id) ? false : (seen.add(id), true);
|
|
3591
3759
|
});
|
|
@@ -3624,6 +3792,7 @@ function sampleConfigs(space, n, seed, meta, maxTries, canon = space) {
|
|
|
3624
3792
|
* - The mode `grid` gives each grid point without a meta option, in a stable order. Stages, options and values go in the order of the space.
|
|
3625
3793
|
* - The mode `sample` gives `n` configs of a seeded Latin hypercube. The options of a stage get equal strata, and each active param gets its own strata.
|
|
3626
3794
|
* - A sample draws again when a point breaks a constraint. After `maxTries` draws, it throws an `Error`. Two sampled configs can be equal.
|
|
3795
|
+
* - With `draw: "walk"`, each stage draws only from the options that keep the constraints with the stages before it. The largest stage keeps its equal strata.
|
|
3627
3796
|
* - With `shapes`, only the options that support each kind of the list count. Without `shapes`, the result does not change.
|
|
3628
3797
|
* - A meta option with a `pool` gives only the entries of its pool. With `shapes`, only the entries whose members support each kind count.
|
|
3629
3798
|
* - A sample draws again when a point chooses a meta option without a member list. `spaceSize` gives such an option 0.
|
|
@@ -3641,10 +3810,12 @@ function enumerateSpace(space, options) {
|
|
|
3641
3810
|
if (!Number.isInteger(options.seed)) throw new RangeError(`The seed ${options.seed} is not a whole number.`);
|
|
3642
3811
|
const meta = options.meta ?? "skip";
|
|
3643
3812
|
if (meta !== "skip" && meta !== "sample") throw new RangeError(`The option meta is ${String(meta)}, not skip or sample.`);
|
|
3813
|
+
const draw = options.draw ?? "reject";
|
|
3814
|
+
if (draw !== "reject" && draw !== "walk") throw new RangeError(`The option draw is ${String(draw)}, not reject or walk.`);
|
|
3644
3815
|
if (options.n === 0) return [];
|
|
3645
3816
|
const kept = restrict(space, options.shapes);
|
|
3646
3817
|
try {
|
|
3647
|
-
return sampleConfigs(kept, options.n, options.seed, meta === "sample", options.maxTries ?? Math.max(1e3, 100 * options.n), space);
|
|
3818
|
+
return sampleConfigs(kept, options.n, options.seed, meta === "sample", options.maxTries ?? Math.max(1e3, 100 * options.n), space, draw === "walk");
|
|
3648
3819
|
} catch (error) {
|
|
3649
3820
|
if (options.shapes !== void 0 && !hasConfig(kept, meta === "sample")) throw noSample(space, kept, options.shapes, meta === "sample");
|
|
3650
3821
|
throw error;
|
|
@@ -5763,6 +5934,94 @@ const EDGE_KEY_STEP = /* @__PURE__ */ Object.freeze({
|
|
|
5763
5934
|
familyPart: (d) => `key-${d["edgeKey"]}`,
|
|
5764
5935
|
apply: (input, seed, d) => edgeKeyStep(input, { edgeKey: edgeKeyOf(d) }, seed)
|
|
5765
5936
|
});
|
|
5937
|
+
/** The set of `CIRCLE_SCATTERED` when the caller gives no set. */
|
|
5938
|
+
const CIRCLE_SET = "circle-v1";
|
|
5939
|
+
/**
|
|
5940
|
+
* The shared family `circle-scattered`, version 1: circle items of random whole radii in a fixed container, with no obstacles and no edges.
|
|
5941
|
+
*
|
|
5942
|
+
* - The dimension `containerShape` takes `rect` or `circle`. One seed gives the same radii in the 2 containers, so a pair joins on the seed.
|
|
5943
|
+
* - The circles fill approximately half of the container, and the container is at least as large as the largest circle.
|
|
5944
|
+
* - The stream `items` gives each radius, from 8 to 40. The stream `container` gives the width of a rectangle over its side, from 0.80 to 1.25.
|
|
5945
|
+
* - The family has no margin and no gap. Each value comes from whole numbers and `Math.sqrt`, which each engine rounds correctly, so the family is `exact`.
|
|
5946
|
+
*/
|
|
5947
|
+
const CIRCLE_SCATTERED = /* @__PURE__ */ Object.freeze({
|
|
5948
|
+
name: "circle-scattered",
|
|
5949
|
+
version: 1,
|
|
5950
|
+
owner: "layout-contract",
|
|
5951
|
+
meaning: "Circle items of random radii in a fixed rectangle or circle container, which they fill approximately half.",
|
|
5952
|
+
dimensions: /* @__PURE__ */ Object.freeze([/* @__PURE__ */ sharedDimension("count", { default: 40 }), /* @__PURE__ */ sharedDimension("containerShape", { supported: ["rect", "circle"] })]),
|
|
5953
|
+
seeding: "stepRandom(seed, items) gives the radius of each item. stepRandom(seed, container) gives the width over the side of a rectangle, in hundredths.",
|
|
5954
|
+
crossEngine: "exact",
|
|
5955
|
+
generate(seed, dims, context) {
|
|
5956
|
+
const count = dims["count"];
|
|
5957
|
+
if (typeof count !== "number" || !Number.isInteger(count) || count < 0) throw new RangeError(`circle-scattered: the count is a whole number of 0 or more, not ${String(count)}.`);
|
|
5958
|
+
const containerShape = dims["containerShape"];
|
|
5959
|
+
if (containerShape !== "rect" && containerShape !== "circle") throw new RangeError(`circle-scattered: the container shape is rect or circle, not ${String(containerShape)}.`);
|
|
5960
|
+
const set = context.set ?? CIRCLE_SET;
|
|
5961
|
+
let r = stepRandom(seed, "items");
|
|
5962
|
+
const radii = Array.from({ length: count }, () => randomInt(r, 8, 40));
|
|
5963
|
+
const largest = radii.reduce((m, v) => Math.max(m, v), 1);
|
|
5964
|
+
const squares = radii.reduce((sum, v) => sum + v * v, 0);
|
|
5965
|
+
let container;
|
|
5966
|
+
if (containerShape === "circle") {
|
|
5967
|
+
const big = Math.max(largest, Math.ceil(Math.sqrt(2 * squares)));
|
|
5968
|
+
container = {
|
|
5969
|
+
w: 2 * big,
|
|
5970
|
+
h: 2 * big,
|
|
5971
|
+
fixed: "size",
|
|
5972
|
+
shape: {
|
|
5973
|
+
kind: "circle",
|
|
5974
|
+
cx: big,
|
|
5975
|
+
cy: big,
|
|
5976
|
+
r: big
|
|
5977
|
+
}
|
|
5978
|
+
};
|
|
5979
|
+
} else {
|
|
5980
|
+
const area = Math.ceil(63 * squares / 10);
|
|
5981
|
+
r = stepRandom(seed, "container");
|
|
5982
|
+
const w = Math.max(2 * largest, Math.ceil(Math.sqrt(area) * randomInt(r, 80, 125) / 100));
|
|
5983
|
+
container = {
|
|
5984
|
+
w,
|
|
5985
|
+
h: Math.max(2 * largest, Math.ceil(area / w)),
|
|
5986
|
+
fixed: "size"
|
|
5987
|
+
};
|
|
5988
|
+
}
|
|
5989
|
+
const body = {
|
|
5990
|
+
schema: "layout-input/1",
|
|
5991
|
+
id: `${set}/circle-scattered/${containerShape}/s${seed}`,
|
|
5992
|
+
set,
|
|
5993
|
+
family: "circle-scattered",
|
|
5994
|
+
seed,
|
|
5995
|
+
source: "made-up",
|
|
5996
|
+
generator: {
|
|
5997
|
+
name: "circle-scattered",
|
|
5998
|
+
version: 1,
|
|
5999
|
+
params: {
|
|
6000
|
+
count,
|
|
6001
|
+
containerShape
|
|
6002
|
+
},
|
|
6003
|
+
seed
|
|
6004
|
+
},
|
|
6005
|
+
container,
|
|
6006
|
+
boxes: radii.map((v, i) => ({
|
|
6007
|
+
id: `c${i}`,
|
|
6008
|
+
w: 2 * v,
|
|
6009
|
+
h: 2 * v,
|
|
6010
|
+
shape: {
|
|
6011
|
+
kind: "circle",
|
|
6012
|
+
cx: v,
|
|
6013
|
+
cy: v,
|
|
6014
|
+
r: v
|
|
6015
|
+
}
|
|
6016
|
+
})),
|
|
6017
|
+
edges: []
|
|
6018
|
+
};
|
|
6019
|
+
return {
|
|
6020
|
+
...body,
|
|
6021
|
+
hash: documentHash(body)
|
|
6022
|
+
};
|
|
6023
|
+
}
|
|
6024
|
+
});
|
|
5766
6025
|
/** The set of `RECT_SCATTERED` when the caller gives no set. */
|
|
5767
6026
|
const XCHECK_SET = "xcheck-v1";
|
|
5768
6027
|
/**
|
|
@@ -5842,6 +6101,6 @@ const RECT_SCATTERED = /* @__PURE__ */ Object.freeze({
|
|
|
5842
6101
|
};
|
|
5843
6102
|
}
|
|
5844
6103
|
});
|
|
5845
|
-
export { BALANCE_MEASURE_SUFFIXES, BALANCE_SIDE_DEPTH, CORPUS_DIMENSIONS, DEFAULT_FAMILY_BY, DEFAULT_RNG, DEFAULT_SHAPES, DEFAULT_TOLERANCE, EDGES_STEP, EDGE_DENSITY, EDGE_KEY_STEP, EDGE_KEY_STEP_VERSION, EDGE_STEP_VERSION, EPS, FAMILY_ANY_KIND, HARD_RULE_VERSION, INVALIDATED_FIELD, JOINT_MEASURES, JOINT_MOVED_MIN, NODE_POSITIONS_DIMENSION, OUTPUT_CLASS_MIN_INPUTS, OUTPUT_GRID_PROPERTIES, OUTPUT_NEAR_WHOLE, PACK_HARD_RULES, RECORD_EPS, RECORD_SCALE, RECT_SCATTERED, SHAPE_KINDS, SHAPE_KIND_IDS, SIDES, SPLIT_SCHEMA, STRATEGY_CATALOG_SCHEMA, STRATEGY_CATALOG_SCHEMAS, STRATEGY_SPACE_SCHEMA, VERDICT_DRAWS, VERDICT_EXACT_CAP, VERDICT_EXACT_MAX, VERDICT_RUNS, VERDICT_SEED, applyPack, balanceMeasureSpecs, balanceMeasures, balanceOf, boundsOf, boxArea, canonicalConfig, canonicalInput, canonicalJson, catalogChoices, catalogDefaults, catalogKey, catalogOptions, checkCatalog, checkConfig, checkDeclared, checkInput, checkLayoutRecord, checkOptions, checkSchema, checkShapes, checkSpace, checkSplit, circleOverlaps, circlesOutside, clampOptions, compareMeasure, composeFamily, configId, corpusHashOf, countObstacleHits, countOutside, countOverlaps, countPortsOffBorder, createFamilyRegistry, declarationIssues, declaredClaimOf, declaredCounts, decodeOptionValue, dimensionAt, dimensionSupports, dimensionUnit, documentHash, edgeKeyStep, edgeStep, encodeOptionValue, enumerateSpace, exercised, familyKind, familyOf, fnv1a32, grow, hardRuleOf, inputShapeLevel, isShapeKind, itemShapeOf, joinConfigs, leaveOneSeedOut, levelsOf, listOptions, marginSides, minEffectOf, mulberry32, nearestGaps, optionDefaults, optionIssue, outputGridClass, outputGroups, outputHash, overlapOf, ownerDimension, packHard, packLinks, paramActive, paramLevels, paramProblem, paramValue, parseLayoutRecord, parseStrategyCatalog, perChange, pickMoves, placedCircle, placedRect, pointSegmentDistance, portPoint, portfolio, procrustesOf, productSpace, randomInt, rectInRegion, regionArea, regionHitsRect, resolveDimensions, ruleLevel, segmentsCross, selectBest, sha256Hex, shapeKindOf, shapeKindProblem, shapeKindsOf, shapeLevel, shapeSupportProblems, shapesOf, shapesOverlap, sharedDimension, spaceShapeKinds, spaceSize, splitConfig, splitFileName, splitFolds, stepRandom, sweepGrid, sweepOf, sweepValues, toLayoutRecord, toPackInput, toRect, toSizedRect, translate, turnBox, turnMargin, turnPoint, turnPort, turnRegion, turnSide, verdict, writeStrategyCatalog };
|
|
6104
|
+
export { BALANCE_MEASURE_SUFFIXES, BALANCE_SIDE_DEPTH, CIRCLE_SCATTERED, CORPUS_DIMENSIONS, DEFAULT_FAMILY_BY, DEFAULT_RNG, DEFAULT_SHAPES, DEFAULT_TOLERANCE, EDGES_STEP, EDGE_DENSITY, EDGE_KEY_STEP, EDGE_KEY_STEP_VERSION, EDGE_STEP_VERSION, EPS, EPS_STEPS, FAMILY_ANY_KIND, HARD_RULE_VERSION, INVALIDATED_FIELD, JOINT_MEASURES, JOINT_MOVED_MIN, NODE_POSITIONS_DIMENSION, OUTPUT_CLASS_MIN_INPUTS, OUTPUT_GRID_PROPERTIES, OUTPUT_NEAR_WHOLE, PACK_HARD_RULES, RECORD_EPS, RECORD_SCALE, RECT_SCATTERED, SHAPE_KINDS, SHAPE_KIND_IDS, SIDES, SPLIT_SCHEMA, STRATEGY_CATALOG_SCHEMA, STRATEGY_CATALOG_SCHEMAS, STRATEGY_SPACE_SCHEMA, VERDICT_DRAWS, VERDICT_EXACT_CAP, VERDICT_EXACT_MAX, VERDICT_RUNS, VERDICT_SEED, applyPack, balanceMeasureSpecs, balanceMeasures, balanceOf, boundsOf, boxArea, canonicalConfig, canonicalInput, canonicalJson, catalogChoices, catalogDefaults, catalogKey, catalogOptions, checkCatalog, checkConfig, checkDeclared, checkInput, checkLayoutRecord, checkOptions, checkSchema, checkShapes, checkSpace, checkSplit, circleOverlaps, circlesOutside, clampOptions, compareMeasure, composeFamily, configId, corpusHashOf, countLinksThroughShapes, countObstacleHits, countOutside, countOverlaps, countPortsOffBorder, createFamilyRegistry, crossingPoint, declarationIssues, declaredClaimOf, declaredCounts, decodeOptionValue, dimensionAt, dimensionSupports, dimensionUnit, documentHash, edgeKeyStep, edgeStep, encodeOptionValue, enumerateSpace, exercised, familyKind, familyOf, fnv1a32, grow, hardRuleOf, inputShapeLevel, isShapeKind, itemShapeOf, joinConfigs, leaveOneSeedOut, levelsOf, listOptions, marginSides, minEffectOf, mulberry32, nearestGaps, optionDefaults, optionIssue, outputGridClass, outputGroups, outputHash, overlapOf, ownerDimension, packHard, packLinks, paramActive, paramLevels, paramProblem, paramValue, parseLayoutRecord, parseStrategyCatalog, perChange, pickMoves, placedCircle, placedRect, pointSegmentDistance, portPoint, portfolio, procrustesOf, productSpace, randomInt, rectInRegion, regionArea, regionHitsRect, resolveDimensions, ruleLevel, segmentThroughShape, segmentsCross, selectBest, sha256Hex, shapeKindOf, shapeKindProblem, shapeKindsOf, shapeLevel, shapeSupportProblems, shapesOf, shapesOverlap, sharedDimension, spaceShapeKinds, spaceSize, splitConfig, splitFileName, splitFolds, stepRandom, sweepGrid, sweepOf, sweepValues, toLayoutRecord, toPackInput, toRect, toSizedRect, translate, turnBox, turnMargin, turnPoint, turnPort, turnRegion, turnSide, verdict, writeStrategyCatalog };
|
|
5846
6105
|
|
|
5847
6106
|
//# sourceMappingURL=index.js.map
|