@mark1russell7/highways 0.8.1 → 0.9.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.
- package/README.md +74 -8
- package/build/index.d.ts +705 -183
- package/build/index.d.ts.map +1 -1
- package/build/index.js +4079 -2639
- package/build/index.js.map +1 -1
- package/package.json +3 -2
- package/src/bench/compare.ts +174 -5
- package/src/bench/room.ts +1 -1
- package/src/bench/run.ts +38 -3
- package/src/bench/screen/generators.ts +11 -41
- package/src/bench/screen/screen.ts +16 -10
- package/src/bench/screen/set.ts +156 -49
- package/src/bench/suite.ts +110 -12
- package/src/cases.ts +64 -18
- package/src/families/cases.ts +108 -0
- package/src/families/fixtures.ts +101 -0
- package/src/families/index.ts +36 -0
- package/src/families/model.ts +55 -0
- package/src/fixtures.ts +8 -2
- package/src/highways/soft-keys/index.ts +8 -4
- package/src/index.ts +8 -0
- package/src/lane-order.ts +37 -0
- package/src/lane-orders/stretch/index.ts +486 -0
- package/src/lane-orders/stretch/router.ts +22 -0
- package/src/levels/depths/index.ts +57 -0
- package/src/plugs/facing/index.ts +22 -0
- package/src/portfolio/router.ts +44 -0
- package/src/routers/corners.ts +27 -3
- package/src/routers/sections.ts +22 -40
- package/src/routers/shared.ts +26 -7
- package/src/routers/trunks.ts +21 -3
- package/src/segments.ts +4 -25
- package/src/strategies/builtins.ts +54 -2
- package/src/strategies/model.ts +55 -10
- package/src/strategies/options.ts +36 -4
- package/src/strategies/schemas.ts +68 -5
- package/src/whole/pipeline/index.ts +66 -0
package/build/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ExerciseEvidence, HashOptions, MeasureSpec, Member, MemberStatus, MemberTrace, OutputGroup, PickSpec, Portfolio, PortfolioKey, PortfolioLevel, PortfolioOptions, PortfolioPick, PortfolioTrace, RECORD_EPS, SelectCandidate, SelectLevel, Selection, Verdict, canonicalJson, compareMeasure, exercised, minEffectOf, outputGroups, outputHash, pickMoves, portfolio, selectBest, sha256Hex } from "@mark1russell7/layout-contract";
|
|
1
|
+
import { ClaimBreak, CorpusDimension, CorpusDimension as CorpusDimension$1, CorpusFamily, CorpusFamily as CorpusFamily$1, CorpusSplit, DEFAULT_RNG, DeclaredClaim, DimensionValues, DimensionValues as DimensionValues$1, ExerciseEvidence, FamilyBy, FamilyCell, FamilyRegistry, FamilyRegistry as FamilyRegistry$1, GenerateContext, HashOptions, MeasureSpec, Member, MemberStatus, MemberTrace, OutputGroup, ParamValue, ParamValue as ParamValue$1, PickSpec, Portfolio, PortfolioKey, PortfolioLevel, PortfolioOptions, PortfolioPick, PortfolioTrace, RECORD_EPS, SelectCandidate, SelectLevel, Selection, Verdict, canonicalJson, compareMeasure, createFamilyRegistry, dimensionAt, dimensionUnit, exercised, familyKind, levelsOf, minEffectOf, outputGroups, outputHash, paramProblem, pickMoves, portfolio, randomInt, selectBest, sha256Hex } from "@mark1russell7/layout-contract";
|
|
2
2
|
/** A point in the plane. */
|
|
3
3
|
export interface Point {
|
|
4
4
|
readonly x: number;
|
|
@@ -214,11 +214,14 @@ export interface FixtureSpec {
|
|
|
214
214
|
}
|
|
215
215
|
/** The fixtures of the benchmark, from 10 to 100 000 nodes. */
|
|
216
216
|
export declare const FIXTURES: readonly FixtureSpec[];
|
|
217
|
+
/** This function gives the seed of the random numbers of a fixture: `(seed × 2654435761 + nodes) >>> 0`. */
|
|
218
|
+
export declare function fixtureRngSeed(seed: number, nodes: number): number;
|
|
217
219
|
/**
|
|
218
220
|
* This function makes the graph of a fixture. The same spec always gives the same graph.
|
|
219
221
|
* Node boxes do not overlap, and a gap of 12 units stays between them.
|
|
222
|
+
* The default source of random numbers is `rng(fixtureRngSeed(spec.seed, spec.nodes))`. A corpus family gives the same stream from its registry.
|
|
220
223
|
*/
|
|
221
|
-
export declare function makeFixture(spec: FixtureSpec): Graph;
|
|
224
|
+
export declare function makeFixture(spec: FixtureSpec, random?: () => number): Graph;
|
|
222
225
|
/**
|
|
223
226
|
* A board of made-up data that shows one known defect of the routes or of the zoom levels.
|
|
224
227
|
* The benchmark races the routers on each case, and the measures of `measureLinks` give a number for the defect.
|
|
@@ -230,23 +233,60 @@ export interface CaseBoard {
|
|
|
230
233
|
/** This function makes the graph. The same function always gives the same graph. */
|
|
231
234
|
readonly make: () => Graph;
|
|
232
235
|
}
|
|
236
|
+
/** The options of a case board with a seed: `hubChainBoard` and `manyGroupsBoard`. */
|
|
237
|
+
export interface CaseSeedOptions {
|
|
238
|
+
/** The seed of the random links of the board. Each board has its own default. */
|
|
239
|
+
readonly seed?: number;
|
|
240
|
+
}
|
|
233
241
|
/**
|
|
234
242
|
* This function makes a dense board: 150 nodes in tight clusters. At the far view, the boxes of the groups overlap.
|
|
235
243
|
* Then a level link starts or ends in a group that another group covers.
|
|
236
244
|
*/
|
|
237
245
|
export declare function denseGroupsBoard(): Graph;
|
|
246
|
+
/** The options of `hubChainBoard`. Each option at its default keeps the board of today. */
|
|
247
|
+
export interface HubChainOptions extends CaseSeedOptions {
|
|
248
|
+
/** The number of rows of cards. The default is 3. */
|
|
249
|
+
readonly rows?: number;
|
|
250
|
+
/** The number of cards in each row. The default is 32. */
|
|
251
|
+
readonly cols?: number;
|
|
252
|
+
/** The number of tries for a long link. The default is 40. */
|
|
253
|
+
readonly long?: number;
|
|
254
|
+
/** The free space between two cards, in units. The default is 48. */
|
|
255
|
+
readonly gap?: number;
|
|
256
|
+
}
|
|
238
257
|
/**
|
|
239
258
|
* This function makes a board of three rows of 32 cards. Each card links to the next card of its row.
|
|
240
259
|
* Forty long links join cards far apart. The hub of a section is near the middle of its cards.
|
|
241
260
|
* So a long link climbs to hubs behind its source or past its target, and comes back.
|
|
242
|
-
|
|
243
|
-
|
|
261
|
+
*
|
|
262
|
+
* The seed changes only the long links. The rows of cards, and thus the chain of hubs, do not change.
|
|
263
|
+
* The default seed is 3. Without options, the board does not change.
|
|
264
|
+
* The default source of random numbers is `rng(seed)`. A corpus family gives the same stream from its registry.
|
|
265
|
+
*/
|
|
266
|
+
export declare function hubChainBoard(options?: HubChainOptions, random?: () => number): Graph;
|
|
267
|
+
/** The options of `manyGroupsBoard`. Each option at its default keeps the board of today. */
|
|
268
|
+
export interface ManyGroupsOptions extends CaseSeedOptions {
|
|
269
|
+
/** The number of columns of groups. The default is 8. */
|
|
270
|
+
readonly groupCols?: number;
|
|
271
|
+
/** The number of rows of groups. The default is 4. */
|
|
272
|
+
readonly groupRows?: number;
|
|
273
|
+
/** The number of cards in each group. The default is 4. */
|
|
274
|
+
readonly perGroup?: number;
|
|
275
|
+
/** The number of random links between groups, for each group. The default is 3. */
|
|
276
|
+
readonly crossLinksPerGroup?: number;
|
|
277
|
+
/** The free space between two groups, in units. The default is 60. */
|
|
278
|
+
readonly groupGap?: number;
|
|
279
|
+
}
|
|
244
280
|
/**
|
|
245
281
|
* This function makes a board of 32 groups in 8 columns and 4 rows. Each group has 4 cards in a square.
|
|
246
282
|
* The cards of a group link in a chain, and 96 random links join cards of two groups.
|
|
247
283
|
* On a level with many groups, some level links go around the outer edge of the board.
|
|
284
|
+
*
|
|
285
|
+
* The seed changes only the 96 links between groups. The 32 groups and their chains do not change.
|
|
286
|
+
* The default seed is 7. Without options, the board does not change.
|
|
287
|
+
* The default source of random numbers is `rng(seed)`. A corpus family gives the same stream from its registry.
|
|
248
288
|
*/
|
|
249
|
-
export declare function manyGroupsBoard(): Graph;
|
|
289
|
+
export declare function manyGroupsBoard(options?: ManyGroupsOptions, random?: () => number): Graph;
|
|
250
290
|
/** The options of `packedGridBoard`. */
|
|
251
291
|
export interface PackedGridOptions {
|
|
252
292
|
/** The seed of the links. The default is 11. */
|
|
@@ -257,6 +297,8 @@ export interface PackedGridOptions {
|
|
|
257
297
|
readonly rows?: number;
|
|
258
298
|
/** The number of long links between boxes far apart. The default is 48. */
|
|
259
299
|
readonly long?: number;
|
|
300
|
+
/** The largest step, in rows and in columns, of the link of a box to a box near it. The default is 2. */
|
|
301
|
+
readonly reach?: number;
|
|
260
302
|
}
|
|
261
303
|
/**
|
|
262
304
|
* This function makes the far view of a board after a host layout packs it.
|
|
@@ -266,8 +308,9 @@ export interface PackedGridOptions {
|
|
|
266
308
|
*
|
|
267
309
|
* The board is not in `CASES`, because the digests of the router fix the output on each board of `CASES`.
|
|
268
310
|
* The options make a family of such boards for the measure suite. Without options, the board does not change.
|
|
311
|
+
* The default source of random numbers is `rng(seed)`. A corpus family gives the same stream from its registry.
|
|
269
312
|
*/
|
|
270
|
-
export declare function packedGridBoard(options?: PackedGridOptions): Graph;
|
|
313
|
+
export declare function packedGridBoard(options?: PackedGridOptions, random?: () => number): Graph;
|
|
271
314
|
/**
|
|
272
315
|
* This function makes a packed board with three zoom levels of groups. The board has 256 touching boxes in a grid of 16 columns and 16 rows.
|
|
273
316
|
* The quadtree of `buildSections` splits it into 4, 16 and 64 groups. Each box links to a box near it, and 64 long links join boxes far apart.
|
|
@@ -1004,112 +1047,6 @@ export declare const straightRouter: Router;
|
|
|
1004
1047
|
* It goes to the target plug on the curve of the rule. This router measures the rule alone.
|
|
1005
1048
|
*/
|
|
1006
1049
|
export declare const plugsRouter: Router;
|
|
1007
|
-
/** The ways to place a free plug of the corner router. */
|
|
1008
|
-
type PlugPlace = "facing" | "side";
|
|
1009
|
-
/** The options of the corner router. */
|
|
1010
|
-
interface CornersOptions extends WayOptions {
|
|
1011
|
-
/** The name in the benchmark. */
|
|
1012
|
-
readonly name: string;
|
|
1013
|
-
/** The benchmark skips a fixture with more nodes. */
|
|
1014
|
-
readonly maxNodes?: number;
|
|
1015
|
-
/**
|
|
1016
|
-
* The place of a free plug. The default is `facing`: the plug faces the other end (`placePlug`).
|
|
1017
|
-
* With `side`, the search starts from the whole free side, and the plug goes where the way leaves the side (`sidePlugs`, WILD-001).
|
|
1018
|
-
*/
|
|
1019
|
-
readonly plugs?: PlugPlace;
|
|
1020
|
-
/**
|
|
1021
|
-
* The least gap between two free plugs of one side. The default is 0: each plug stays where it is.
|
|
1022
|
-
* Above 0, the free plugs of each side keep their order and move the least distance (`justifyPlugs`, WILD-002).
|
|
1023
|
-
*/
|
|
1024
|
-
readonly plugGap?: number;
|
|
1025
|
-
}
|
|
1026
|
-
/**
|
|
1027
|
-
* This function makes a router that goes around the nodes.
|
|
1028
|
-
* Each edge leaves its plug along the normal of the side. It goes a shortest way (A*) through a sparse visibility graph
|
|
1029
|
-
* of the box corners, without the needless corners. It enters the target plug along its normal.
|
|
1030
|
-
*/
|
|
1031
|
-
export declare function cornersRouter(options: CornersOptions): Router;
|
|
1032
|
-
/** The cost of a link that edges of one key share: a fixed discount, or the flow cost `len * f^alpha` (EDA-029). */
|
|
1033
|
-
type ShareCost = "fixed" | "flow";
|
|
1034
|
-
/** The order of the edges of one key: the longest first, the shortest first, the most load first, or the order of the input (NAT-024). */
|
|
1035
|
-
type ShareOrder = "span" | "shortest" | "load" | "input";
|
|
1036
|
-
/** The place where a route joins or leaves a run: at a corner of the graph, or at the Snell angle (NAT-035). */
|
|
1037
|
-
type ShareMerge = "corner" | "snell";
|
|
1038
|
-
/** The options of the router with shared ways. */
|
|
1039
|
-
interface SharedOptions extends WayOptions {
|
|
1040
|
-
/** The name in the benchmark. */
|
|
1041
|
-
readonly name: string;
|
|
1042
|
-
/** The edges with one key share their ways. Without a rule, all edges share. An edge without a key shares with no edge. */
|
|
1043
|
-
readonly rule?: GroupRule;
|
|
1044
|
-
/** The cost of a link that an edge with the same key uses already, as a share of its length. The default is 0.5. */
|
|
1045
|
-
readonly discount?: number;
|
|
1046
|
-
/** The lane order of the runs. With `bundle`, the default, two edges keep one order on each run of their common stretch. With `run`, each run gets its order alone. */
|
|
1047
|
-
readonly laneOrder?: RunOrder;
|
|
1048
|
-
/**
|
|
1049
|
-
* The cost of a shared link. With `fixed`, the default, a link that the key uses already costs `discount` times its length.
|
|
1050
|
-
* With `flow`, one more edge on a link with `f` edges costs `len * ((f + 1)^alpha - f^alpha)` (EDA-029).
|
|
1051
|
-
*/
|
|
1052
|
-
readonly cost?: ShareCost;
|
|
1053
|
-
/** The exponent of the flow cost, from 0.1 to 1. A smaller value gives more sharing. The default is 0.6. Only the cost `flow` uses it. */
|
|
1054
|
-
readonly alpha?: number;
|
|
1055
|
-
/** The number of passes. In each pass after the first, each edge leaves its links and finds its way again with the others fixed (HWY-039). The default is 1. */
|
|
1056
|
-
readonly passes?: number;
|
|
1057
|
-
/**
|
|
1058
|
-
* The order of the edges of one key. With `span`, the default, the longest edge goes first. With `shortest`, the shortest edge goes first.
|
|
1059
|
-
* With `load`, the edge with the most edges between its two sections goes first. With `input`, the edges keep the order of the graph (NAT-024).
|
|
1060
|
-
*/
|
|
1061
|
-
readonly order?: ShareOrder;
|
|
1062
|
-
/**
|
|
1063
|
-
* The place where a route joins or leaves a run. With `corner`, the default, it is a corner of the graph.
|
|
1064
|
-
* With `snell`, the route meets the run at the angle `acos(d)`, with `d` the cost share of the run for the route (NAT-035).
|
|
1065
|
-
*/
|
|
1066
|
-
readonly merge?: ShareMerge;
|
|
1067
|
-
/**
|
|
1068
|
-
* The pull of the busy links of the pass before (HWY-005, Winding Roads). With a value above 0 and two passes or more, each later pass routes each edge again from no ways.
|
|
1069
|
-
* A link then costs `len / (1 + reuse * u)^reuseExponent`, with `u` the edges of the key on it in the pass before. The default is 0: the later passes are rip-up passes.
|
|
1070
|
-
*/
|
|
1071
|
-
readonly reuse?: number;
|
|
1072
|
-
/** The exponent of the pull of `reuse`. The default is 1. */
|
|
1073
|
-
readonly reuseExponent?: number;
|
|
1074
|
-
/**
|
|
1075
|
-
* The cost of a lane that does not fit in its channel (HWY-016). One more edge on a link with `f` edges of the key costs `capacity * max(0, (f + 1) * laneWidth - width)` more.
|
|
1076
|
-
* `width` is the free space across the link (`channelWidth`). The default is 0: the router does not read the channels.
|
|
1077
|
-
*/
|
|
1078
|
-
readonly capacity?: number;
|
|
1079
|
-
/** The width of one lane, for `capacity`. The default is 4. */
|
|
1080
|
-
readonly laneWidth?: number;
|
|
1081
|
-
/** The benchmark skips a fixture with more nodes. */
|
|
1082
|
-
readonly maxNodes?: number;
|
|
1083
|
-
}
|
|
1084
|
-
/**
|
|
1085
|
-
* This function makes a router where edges share their ways (after Pupyrev, Nachmanson, Bereg and Holroyd, "Edge routing with ordered bundles").
|
|
1086
|
-
* The edges go one by one through the corner graph. A link that an edge with the same key uses already costs less.
|
|
1087
|
-
* Thus the edges of a key come together on common ways. Each stretch that several edges share has the same points in each route.
|
|
1088
|
-
* The result gives each stretch as a run, with the order of its lanes.
|
|
1089
|
-
*/
|
|
1090
|
-
export declare function sharedRouter(options: SharedOptions): Router;
|
|
1091
|
-
/** Two items of a level that a link joins, and the count of the edges between them. */
|
|
1092
|
-
interface ItemPair {
|
|
1093
|
-
readonly source: string;
|
|
1094
|
-
readonly target: string;
|
|
1095
|
-
readonly count: number;
|
|
1096
|
-
}
|
|
1097
|
-
/** The options of the links of a level: the options of the ways, and two limits of the level links. */
|
|
1098
|
-
interface LevelLinkOptions extends WayOptions {
|
|
1099
|
-
/**
|
|
1100
|
-
* The margin of the second corner graph. A gap between two boxes wider than approximately 1.5 times this margin lets a link through.
|
|
1101
|
-
* The second graph uses the smaller of this value and `margin`. The default is 1.
|
|
1102
|
-
*/
|
|
1103
|
-
readonly tightMargin?: number;
|
|
1104
|
-
/** A plug stays at least this far from the corners of its side. The level links use the smaller of this value and `margin`. The default is 6. */
|
|
1105
|
-
readonly plugInset?: number;
|
|
1106
|
-
/**
|
|
1107
|
-
* The cost of a level link through a far box, in units of the mean box size. A far box overlaps neither end of the link.
|
|
1108
|
-
* A link through a far box gets a second way that can go through boxes (`SoftGraph`). The link keeps the way with fewer far boxes.
|
|
1109
|
-
* The value 0 turns the second way off and gives the links of version 0.1.5. The default is 8.
|
|
1110
|
-
*/
|
|
1111
|
-
readonly throughCost?: number;
|
|
1112
|
-
}
|
|
1113
1050
|
/** The input of a highway strategy: the boxes and the edges, and optionally the first routes of a router. */
|
|
1114
1051
|
interface HighwayInput {
|
|
1115
1052
|
readonly graph: Graph;
|
|
@@ -1319,6 +1256,11 @@ export interface NumberOption extends OptionBase {
|
|
|
1319
1256
|
readonly special?: readonly number[];
|
|
1320
1257
|
/** These values are the notable values of the option: the default and the values of the sweeps of the benchmark. */
|
|
1321
1258
|
readonly marks?: readonly number[];
|
|
1259
|
+
/**
|
|
1260
|
+
* These values are the only valid values of the option, in the order of a control. A control shows them as a list, and a sweep gives them.
|
|
1261
|
+
* Without them, each value on the range is valid.
|
|
1262
|
+
*/
|
|
1263
|
+
readonly values?: readonly number[];
|
|
1322
1264
|
/** The strategy uses this value when the caller and `defaults` give no value. */
|
|
1323
1265
|
readonly default?: number;
|
|
1324
1266
|
}
|
|
@@ -1333,6 +1275,11 @@ export interface EnumOption<V extends string = string> extends OptionBase {
|
|
|
1333
1275
|
readonly type: "enum";
|
|
1334
1276
|
/** The values of the option, in the order of a control. */
|
|
1335
1277
|
readonly values: readonly V[];
|
|
1278
|
+
/**
|
|
1279
|
+
* With `function`, the option also takes a rule of the caller in place of a name. A control sets only the names.
|
|
1280
|
+
* Each name is a known rule of the strategy.
|
|
1281
|
+
*/
|
|
1282
|
+
readonly custom?: "function";
|
|
1336
1283
|
/** The strategy uses this value when the caller and `defaults` give no value. */
|
|
1337
1284
|
readonly default?: V;
|
|
1338
1285
|
}
|
|
@@ -1349,8 +1296,11 @@ export interface ValueOption<V = unknown> extends OptionBase {
|
|
|
1349
1296
|
}
|
|
1350
1297
|
/** The declaration of one option of any type. */
|
|
1351
1298
|
export type AnyOption = NumberOption | BooleanOption | EnumOption | ValueOption;
|
|
1352
|
-
/**
|
|
1353
|
-
|
|
1299
|
+
/**
|
|
1300
|
+
* The declaration that fits the type of an option value: numbers, booleans, string unions or other values.
|
|
1301
|
+
* A union of strings and other values takes an enum of the strings or a value declaration. An example is a rule or the name of a rule.
|
|
1302
|
+
*/
|
|
1303
|
+
export type OptionDeclaration<V> = [V] extends [number] ? NumberOption : [V] extends [boolean] ? BooleanOption : [V] extends [string] ? EnumOption<V> : [Extract<V, string>] extends [never] ? ValueOption<V> : EnumOption<Extract<V, string>> | ValueOption<V>;
|
|
1354
1304
|
/** The declarations of the options of a strategy. The schema has one declaration for each key of the options type, and no other key. */
|
|
1355
1305
|
export type OptionSchema<O> = { readonly [K in keyof O]-?: OptionDeclaration<NonNullable<O[K]>>; };
|
|
1356
1306
|
/** One problem of an option value against its declaration. */
|
|
@@ -1399,12 +1349,12 @@ export declare function optionDefaults<S extends Step, O extends object>(strateg
|
|
|
1399
1349
|
export declare function checkOptions<S extends Step, O extends object>(strategy: Strategy<S, O>, options: Partial<O>): OptionIssue[];
|
|
1400
1350
|
/**
|
|
1401
1351
|
* This function moves each number option into the range of its declaration, for a control. An integer option gets the nearest whole number.
|
|
1402
|
-
* A special value stays. The function keeps each other value as it is. `checkOptions` reports the values that this function cannot correct.
|
|
1352
|
+
* An option with a list of `values` gets the nearest value of the list. A special value stays. The function keeps each other value as it is. `checkOptions` reports the values that this function cannot correct.
|
|
1403
1353
|
*/
|
|
1404
1354
|
export declare function clampOptions<S extends Step, O extends object>(strategy: Strategy<S, O>, options: Partial<O>): Partial<O>;
|
|
1405
1355
|
/**
|
|
1406
1356
|
* This function gives the values of a sweep of one option declaration.
|
|
1407
|
-
* A number option gives its `marks`, or `count` values on its range and its scale. A boolean gives `false` and `true`. An enum gives its values.
|
|
1357
|
+
* A number option gives its `marks`, or its list of `values`, or `count` values on its range and its scale. A boolean gives `false` and `true`. An enum gives its values.
|
|
1408
1358
|
* An option of another type has no sweep, so the function throws an error.
|
|
1409
1359
|
*/
|
|
1410
1360
|
export declare function sweepValues(declaration: AnyOption, options?: SweepOptions): unknown[];
|
|
@@ -1464,20 +1414,53 @@ export interface RoomInput {
|
|
|
1464
1414
|
*/
|
|
1465
1415
|
readonly sections?: Section;
|
|
1466
1416
|
}
|
|
1417
|
+
/** The input of a plug strategy: the graph, and optionally the way finder of the router that reads the plugs. */
|
|
1418
|
+
export interface PlugInput {
|
|
1419
|
+
readonly graph: Graph;
|
|
1420
|
+
/** The ways around the nodes of the graph, for a strategy that reads the free space. The default strategy `facing` does not read it. */
|
|
1421
|
+
readonly ways?: WayFinder;
|
|
1422
|
+
}
|
|
1423
|
+
/** The plugs of the two ends of one edge: the output of a plug strategy for that edge. */
|
|
1424
|
+
export interface PlugPair {
|
|
1425
|
+
readonly edge: string;
|
|
1426
|
+
readonly source: Plug;
|
|
1427
|
+
readonly target: Plug;
|
|
1428
|
+
}
|
|
1429
|
+
/** The input of a level strategy: the graph, the tree of sections of its grouping rule and the routes of the router. */
|
|
1430
|
+
export interface LevelInput {
|
|
1431
|
+
readonly graph: Graph;
|
|
1432
|
+
/** The tree of sections. The indices of its nodes are the indices of `graph.nodes`. */
|
|
1433
|
+
readonly root: Section;
|
|
1434
|
+
/** The routes of the router. The default strategy `depths` gives the links of the last level the points of these routes. */
|
|
1435
|
+
readonly routes: readonly Route[];
|
|
1436
|
+
}
|
|
1437
|
+
/** The output of a strategy of the step `whole`: the board that the routes go on, and the routes. */
|
|
1438
|
+
export interface WholeOutput {
|
|
1439
|
+
/** The board: the graph, or the graph with the gaps that a room strategy opened. It has the edges of the input. */
|
|
1440
|
+
readonly graph: Graph;
|
|
1441
|
+
readonly result: Result;
|
|
1442
|
+
}
|
|
1467
1443
|
/**
|
|
1468
1444
|
* The steps that have strategies, with the fixed input and output type of each step.
|
|
1469
1445
|
*
|
|
1470
1446
|
* - `group`: a graph in, the tree of sections out. The router `sections` makes its hubs and its zoom levels from this tree.
|
|
1447
|
+
* - `plugs`: a graph in, the plugs of the two ends of each edge out. The router `corners` routes between these plugs.
|
|
1471
1448
|
* - `router`: a graph in, the routes (and the `levels`, `bundles` and `runs`) out.
|
|
1472
1449
|
* - `highway`: a graph and optionally its first routes in, a highway plan out. `follow` routes the edges along the plan.
|
|
1450
|
+
* - `levels`: a graph, its tree of sections and its routes in, the zoom levels out. The router `sections` gives them in its result.
|
|
1473
1451
|
* - `curve`: a polyline in, the segments of a curve out.
|
|
1474
1452
|
* - `room`: the boxes and links of a board in, the gaps of the board with their need out.
|
|
1453
|
+
* - `whole`: a graph in, the board and its routes out. A strategy of this step runs the other steps.
|
|
1475
1454
|
*/
|
|
1476
1455
|
export interface StepTypes {
|
|
1477
1456
|
readonly group: {
|
|
1478
1457
|
readonly input: Graph;
|
|
1479
1458
|
readonly output: Section;
|
|
1480
1459
|
};
|
|
1460
|
+
readonly plugs: {
|
|
1461
|
+
readonly input: PlugInput;
|
|
1462
|
+
readonly output: PlugPair[];
|
|
1463
|
+
};
|
|
1481
1464
|
readonly router: {
|
|
1482
1465
|
readonly input: Graph;
|
|
1483
1466
|
readonly output: Result;
|
|
@@ -1486,6 +1469,10 @@ export interface StepTypes {
|
|
|
1486
1469
|
readonly input: HighwayInput;
|
|
1487
1470
|
readonly output: HighwayPlan;
|
|
1488
1471
|
};
|
|
1472
|
+
readonly levels: {
|
|
1473
|
+
readonly input: LevelInput;
|
|
1474
|
+
readonly output: Level[];
|
|
1475
|
+
};
|
|
1489
1476
|
readonly curve: {
|
|
1490
1477
|
readonly input: CurveInput;
|
|
1491
1478
|
readonly output: CurveSegment[];
|
|
@@ -1494,6 +1481,10 @@ export interface StepTypes {
|
|
|
1494
1481
|
readonly input: RoomInput;
|
|
1495
1482
|
readonly output: Gap[];
|
|
1496
1483
|
};
|
|
1484
|
+
readonly whole: {
|
|
1485
|
+
readonly input: Graph;
|
|
1486
|
+
readonly output: WholeOutput;
|
|
1487
|
+
};
|
|
1497
1488
|
}
|
|
1498
1489
|
/** The name of a step that has strategies. */
|
|
1499
1490
|
export type Step = keyof StepTypes;
|
|
@@ -1501,7 +1492,11 @@ export type Step = keyof StepTypes;
|
|
|
1501
1492
|
export type StepInput<S extends Step> = StepTypes[S]["input"];
|
|
1502
1493
|
/** The output type of a step. */
|
|
1503
1494
|
export type StepOutput<S extends Step> = StepTypes[S]["output"];
|
|
1504
|
-
/**
|
|
1495
|
+
/**
|
|
1496
|
+
* The steps that have strategies, in the order of the pipeline.
|
|
1497
|
+
* The plugs come before the router, because the router searches its ways between them. The levels come after the routes, because the last level reads them.
|
|
1498
|
+
* The step `whole` runs the other steps, so it comes last.
|
|
1499
|
+
*/
|
|
1505
1500
|
export declare const STEPS: readonly Step[];
|
|
1506
1501
|
/**
|
|
1507
1502
|
* A strategy: one way to do one step, with a name and a description.
|
|
@@ -1546,12 +1541,11 @@ export declare function defineStrategy<S extends Step, O extends object>(definit
|
|
|
1546
1541
|
/**
|
|
1547
1542
|
* A registry: the strategies of each step, in order. A registry is data. No import changes it.
|
|
1548
1543
|
* A consumer makes its own registry with `createRegistry`, and adds a strategy with `register`.
|
|
1549
|
-
* The lists `group` and `
|
|
1544
|
+
* The lists `group`, `highway`, `plugs`, `levels` and `whole` are optional in the type, so a registry of an older version stays a registry. `createRegistry` always gives them.
|
|
1550
1545
|
*/
|
|
1551
|
-
export type Registry = { readonly [S in Exclude<Step,
|
|
1552
|
-
|
|
1553
|
-
|
|
1554
|
-
};
|
|
1546
|
+
export type Registry = { readonly [S in Exclude<Step, OptionalStep>]: readonly Strategy<S>[]; } & { readonly [S in OptionalStep]?: readonly Strategy<S>[]; };
|
|
1547
|
+
/** The steps whose lists are optional in a `Registry`: the steps that came after version 0.1.5. */
|
|
1548
|
+
type OptionalStep = "group" | "highway" | "plugs" | "levels" | "whole";
|
|
1555
1549
|
/** This function makes a registry from a list of strategies. It keeps their order. Two strategies with one step and one name are an error. */
|
|
1556
1550
|
export declare function createRegistry(strategies: readonly AnyStrategy[]): Registry;
|
|
1557
1551
|
/** This function gives a new registry with the strategies of `registry` and then `strategies`. It does not change `registry`. */
|
|
@@ -1566,66 +1560,93 @@ export declare function getStrategy<S extends Step>(registry: Registry, step: S,
|
|
|
1566
1560
|
export declare function asRouter<O extends object>(strategy: Strategy<"router", O>, options?: Partial<O>): Router;
|
|
1567
1561
|
/** This function gives the router strategies of a registry as `Router` objects, in order. The benchmark races them. */
|
|
1568
1562
|
export declare function routersOf(registry: Registry): Router[];
|
|
1569
|
-
/**
|
|
1570
|
-
|
|
1571
|
-
|
|
1572
|
-
|
|
1573
|
-
*/
|
|
1574
|
-
interface SectionsOptions extends LevelLinkOptions, SectionOptions {
|
|
1563
|
+
/** The ways to place a free plug of the corner router. */
|
|
1564
|
+
type PlugPlace = "facing" | "side";
|
|
1565
|
+
/** The options of the corner router. */
|
|
1566
|
+
interface CornersOptions extends WayOptions {
|
|
1575
1567
|
/** The name in the benchmark. */
|
|
1576
1568
|
readonly name: string;
|
|
1569
|
+
/** The benchmark skips a fixture with more nodes. */
|
|
1570
|
+
readonly maxNodes?: number;
|
|
1577
1571
|
/**
|
|
1578
|
-
* The
|
|
1579
|
-
*
|
|
1580
|
-
*/
|
|
1581
|
-
readonly hubs?: number;
|
|
1582
|
-
/**
|
|
1583
|
-
* The hub limit. A way through the hubs can be at most this many times as long as the line between its plugs, plus `stretchPad` margins.
|
|
1584
|
-
* Else the edge goes directly. The default is 2. The value `Infinity` keeps each way through the hubs.
|
|
1585
|
-
*/
|
|
1586
|
-
readonly stretch?: number;
|
|
1587
|
-
/** A way through the hubs can be this many margins longer than `stretch` times the line between its plugs. The default is 4. */
|
|
1588
|
-
readonly stretchPad?: number;
|
|
1589
|
-
/**
|
|
1590
|
-
* A way skips a hub that is more than this many units farther from the target than the nearest approach of the way before it.
|
|
1591
|
-
* The default is 80, two times `BACKTRACK_MIN`. The value `Infinity` keeps each hub.
|
|
1572
|
+
* The place of a free plug. The default is `facing`: the plug faces the other end (`placePlug`).
|
|
1573
|
+
* With `side`, the search starts from the whole free side, and the plug goes where the way leaves the side (`sidePlugs`, WILD-001).
|
|
1592
1574
|
*/
|
|
1593
|
-
readonly
|
|
1575
|
+
readonly plugs?: PlugPlace;
|
|
1594
1576
|
/**
|
|
1595
|
-
* The
|
|
1596
|
-
*
|
|
1577
|
+
* The least gap between two free plugs of one side. The default is 0: each plug stays where it is.
|
|
1578
|
+
* Above 0, the free plugs of each side keep their order and move the least distance (`justifyPlugs`, WILD-002).
|
|
1597
1579
|
*/
|
|
1598
|
-
readonly
|
|
1599
|
-
/** The options of the strategy `group`. The strategy gets its `defaults` for each option that this object does not give. */
|
|
1600
|
-
readonly groupOptions?: object;
|
|
1580
|
+
readonly plugGap?: number;
|
|
1601
1581
|
/**
|
|
1602
|
-
* The
|
|
1603
|
-
*
|
|
1582
|
+
* The plug rule: a strategy of the step `plugs` that places the plugs of each edge. It takes the place of the option `plugs`.
|
|
1583
|
+
* Without it, the router places the plugs with the option `plugs`. An edge without plugs from the strategy gets the plugs of `facing`.
|
|
1604
1584
|
*/
|
|
1605
|
-
readonly
|
|
1606
|
-
/** The
|
|
1607
|
-
readonly
|
|
1608
|
-
/** The benchmark skips a fixture with more nodes. */
|
|
1609
|
-
readonly maxNodes?: number;
|
|
1585
|
+
readonly plug?: Strategy<"plugs">;
|
|
1586
|
+
/** The options of the strategy `plug`. The strategy gets its `defaults` for each option that this object does not give. */
|
|
1587
|
+
readonly plugOptions?: object;
|
|
1610
1588
|
}
|
|
1611
1589
|
/**
|
|
1612
|
-
* This function makes a router
|
|
1613
|
-
*
|
|
1614
|
-
*
|
|
1615
|
-
|
|
1590
|
+
* This function makes a router that goes around the nodes.
|
|
1591
|
+
* Each edge leaves its plug along the normal of the side. It goes a shortest way (A*) through a sparse visibility graph
|
|
1592
|
+
* of the box corners, without the needless corners. It enters the target plug along its normal.
|
|
1593
|
+
*/
|
|
1594
|
+
export declare function cornersRouter(options: CornersOptions): Router;
|
|
1595
|
+
/**
|
|
1596
|
+
* The lane order of the stretches (LANE-STRETCH).
|
|
1616
1597
|
*
|
|
1617
|
-
*
|
|
1598
|
+
* - `none`: each run gets its own order, as the order `bundle` of `orderLanes` gives it.
|
|
1599
|
+
* - `consensus`: one order of the pair relation of the stretch, from the heuristic of Eades, Lin and Smyth for the feedback arc set.
|
|
1600
|
+
* - `periphery`: the largest run gives its order. Each next run keeps that order and puts each new edge at the place with the fewest broken pairs.
|
|
1601
|
+
* - `sifting`: the order of `consensus`. Then each edge moves to the place with the fewest broken pairs, for `passes` passes.
|
|
1602
|
+
*/
|
|
1603
|
+
export type LaneStretchOrder = "none" | "consensus" | "periphery" | "sifting";
|
|
1604
|
+
/** The values of `LaneStretchOrder`, in the order of a control. */
|
|
1605
|
+
export declare const LANE_STRETCH_ORDERS: readonly LaneStretchOrder[];
|
|
1606
|
+
/** The options of `stretchLaneOrders`. */
|
|
1607
|
+
export interface LaneStretchOptions {
|
|
1608
|
+
/** The lane order of the stretches. The default is `sifting`. */
|
|
1609
|
+
readonly method: LaneStretchOrder;
|
|
1610
|
+
/** The number of passes of the method `sifting`, from 1 to 4. The default is 2. The other methods do not read it. */
|
|
1611
|
+
readonly passes: number;
|
|
1612
|
+
}
|
|
1613
|
+
/** The default options of `stretchLaneOrders`. */
|
|
1614
|
+
export declare const LANE_STRETCH_DEFAULTS: Readonly<LaneStretchOptions>;
|
|
1615
|
+
/** One run: its points and the routes on it. Each route holds the points of the run in a row, in either direction. */
|
|
1616
|
+
export interface LaneRun {
|
|
1617
|
+
readonly points: readonly Point[];
|
|
1618
|
+
readonly routes: readonly Route[];
|
|
1619
|
+
}
|
|
1620
|
+
/** One stretch: the runs that follow each other on the routes, and the order of the edges of the stretch. */
|
|
1621
|
+
export interface LaneStretch {
|
|
1622
|
+
/** The indexes of the runs in the list of the input. The first run is the root: the run with the most lanes. The others follow in the order of a breadth-first walk. */
|
|
1623
|
+
readonly runs: readonly number[];
|
|
1624
|
+
/** The way of each run of `runs` against the root. The value -1 tells that the left of the root is the right of the run. */
|
|
1625
|
+
readonly turns: readonly (1 | -1)[];
|
|
1626
|
+
/** The edges of the stretch from left to right, in the way of the root. A stretch of one run has the order `bundle` of the run. */
|
|
1627
|
+
readonly order: readonly string[];
|
|
1628
|
+
}
|
|
1629
|
+
/**
|
|
1630
|
+
* This function gives the stretches of the runs (LANE-STRETCH). Two runs are in one stretch when a chain of links joins them.
|
|
1631
|
+
* A link joins two runs when a route goes through one and then the other, and they share two edges or more.
|
|
1632
|
+
* The result does not depend on the order of the runs or of the routes of each run.
|
|
1633
|
+
*/
|
|
1634
|
+
export declare function laneStretches(runs: readonly LaneRun[], options?: Partial<LaneStretchOptions>): LaneStretch[];
|
|
1635
|
+
/**
|
|
1636
|
+
* This function gives the lane order of each run (LANE-STRETCH). The orders are in the order of `runs`.
|
|
1637
|
+
* Each order holds the edges of the run from left to right. The way goes from the first point of the run to its last point, with the y axis down.
|
|
1638
|
+
* A route that does not hold its run goes last, as in `orderLanes`.
|
|
1618
1639
|
*
|
|
1619
|
-
*
|
|
1620
|
-
*
|
|
1640
|
+
* With the method `none`, each run gets the order `bundle` of `orderLanes`. With the other methods, each run of a stretch gets the order of the stretch.
|
|
1641
|
+
* Thus two runs of one stretch give two edges the same side. The result does not depend on the order of the runs or of the routes of each run.
|
|
1621
1642
|
*/
|
|
1622
|
-
export declare function
|
|
1643
|
+
export declare function stretchLaneOrders(runs: readonly LaneRun[], options?: Partial<LaneStretchOptions>): string[][];
|
|
1623
1644
|
/** The options of the trunk router. */
|
|
1624
1645
|
interface TrunksOptions extends WayOptions {
|
|
1625
1646
|
/** The name in the benchmark. */
|
|
1626
1647
|
readonly name: string;
|
|
1627
|
-
/** The grouping rule. The edges from one plug with one key share a trunk. */
|
|
1628
|
-
readonly rule: GroupRule;
|
|
1648
|
+
/** The grouping rule, or the name of a built-in rule (`GROUP_RULE_NAMES`). The edges from one plug with one key share a trunk. */
|
|
1649
|
+
readonly rule: GroupRule | GroupRuleName;
|
|
1629
1650
|
/** The split point is at this share of the way to the center of the targets. The default is 0.5. */
|
|
1630
1651
|
readonly split?: number;
|
|
1631
1652
|
/** A group with fewer edges stays unbundled. The default is 2. */
|
|
@@ -1662,6 +1683,8 @@ type TrunkSplit = "share" | "gilbert";
|
|
|
1662
1683
|
type TrunkFan = "split" | "tree";
|
|
1663
1684
|
/** The rule that groups the edges by the collection of their target, in `data.collection`. */
|
|
1664
1685
|
export declare const byCollection: GroupRule;
|
|
1686
|
+
/** The names of the built-in grouping rules of the edges. With `collection`, the rule is `byCollection`. With `all`, each edge has one key. */
|
|
1687
|
+
type GroupRuleName = "collection" | "all";
|
|
1665
1688
|
/**
|
|
1666
1689
|
* This function groups the edges by their source plug and their key. Each group keeps the order of the edges.
|
|
1667
1690
|
* A group with fewer than `minSize` edges does not appear.
|
|
@@ -1686,6 +1709,159 @@ export declare function splitPoint(start: Point, targets: readonly Point[], spli
|
|
|
1686
1709
|
* The edges outside the groups go as in the corner router.
|
|
1687
1710
|
*/
|
|
1688
1711
|
export declare function trunksRouter(options: TrunksOptions): Router;
|
|
1712
|
+
/** The cost of a link that edges of one key share: a fixed discount, or the flow cost `len * f^alpha` (EDA-029). */
|
|
1713
|
+
type ShareCost = "fixed" | "flow";
|
|
1714
|
+
/** The order of the edges of one key: the longest first, the shortest first, the most load first, or the order of the input (NAT-024). */
|
|
1715
|
+
type ShareOrder = "span" | "shortest" | "load" | "input";
|
|
1716
|
+
/** The place where a route joins or leaves a run: at a corner of the graph, or at the Snell angle (NAT-035). */
|
|
1717
|
+
type ShareMerge = "corner" | "snell";
|
|
1718
|
+
/** The options of the router with shared ways. */
|
|
1719
|
+
interface SharedOptions extends WayOptions {
|
|
1720
|
+
/** The name in the benchmark. */
|
|
1721
|
+
readonly name: string;
|
|
1722
|
+
/**
|
|
1723
|
+
* The edges with one key share their ways. The option takes a rule or the name of a built-in rule (`GROUP_RULE_NAMES`).
|
|
1724
|
+
* Without a rule, or with `all`, all edges share. An edge without a key shares with no edge.
|
|
1725
|
+
*/
|
|
1726
|
+
readonly rule?: GroupRule | GroupRuleName;
|
|
1727
|
+
/** The cost of a link that an edge with the same key uses already, as a share of its length. The default is 0.5. */
|
|
1728
|
+
readonly discount?: number;
|
|
1729
|
+
/** The lane order of the runs. With `bundle`, the default, two edges keep one order on each run of their common stretch. With `run`, each run gets its order alone. */
|
|
1730
|
+
readonly laneOrder?: RunOrder;
|
|
1731
|
+
/**
|
|
1732
|
+
* The lane order of each stretch of runs (LANE-STRETCH). With `none`, the default, each run gets its order alone.
|
|
1733
|
+
* With `consensus`, `periphery` or `sifting`, the runs that follow each other on the routes share one order. Only the lane order `bundle` reads it.
|
|
1734
|
+
*/
|
|
1735
|
+
readonly stretchOrder?: LaneStretchOrder;
|
|
1736
|
+
/** The number of passes of the stretch order `sifting`, from 1 to 4. The default is 2. */
|
|
1737
|
+
readonly siftPasses?: number;
|
|
1738
|
+
/**
|
|
1739
|
+
* The cost of a shared link. With `fixed`, the default, a link that the key uses already costs `discount` times its length.
|
|
1740
|
+
* With `flow`, one more edge on a link with `f` edges costs `len * ((f + 1)^alpha - f^alpha)` (EDA-029).
|
|
1741
|
+
*/
|
|
1742
|
+
readonly cost?: ShareCost;
|
|
1743
|
+
/** The exponent of the flow cost, from 0.1 to 1. A smaller value gives more sharing. The default is 0.6. Only the cost `flow` uses it. */
|
|
1744
|
+
readonly alpha?: number;
|
|
1745
|
+
/** The number of passes. In each pass after the first, each edge leaves its links and finds its way again with the others fixed (HWY-039). The default is 1. */
|
|
1746
|
+
readonly passes?: number;
|
|
1747
|
+
/**
|
|
1748
|
+
* The order of the edges of one key. With `span`, the default, the longest edge goes first. With `shortest`, the shortest edge goes first.
|
|
1749
|
+
* With `load`, the edge with the most edges between its two sections goes first. With `input`, the edges keep the order of the graph (NAT-024).
|
|
1750
|
+
*/
|
|
1751
|
+
readonly order?: ShareOrder;
|
|
1752
|
+
/**
|
|
1753
|
+
* The place where a route joins or leaves a run. With `corner`, the default, it is a corner of the graph.
|
|
1754
|
+
* With `snell`, the route meets the run at the angle `acos(d)`, with `d` the cost share of the run for the route (NAT-035).
|
|
1755
|
+
*/
|
|
1756
|
+
readonly merge?: ShareMerge;
|
|
1757
|
+
/**
|
|
1758
|
+
* The pull of the busy links of the pass before (HWY-005, Winding Roads). With a value above 0 and two passes or more, each later pass routes each edge again from no ways.
|
|
1759
|
+
* A link then costs `len / (1 + reuse * u)^reuseExponent`, with `u` the edges of the key on it in the pass before. The default is 0: the later passes are rip-up passes.
|
|
1760
|
+
*/
|
|
1761
|
+
readonly reuse?: number;
|
|
1762
|
+
/** The exponent of the pull of `reuse`. The default is 1. */
|
|
1763
|
+
readonly reuseExponent?: number;
|
|
1764
|
+
/**
|
|
1765
|
+
* The cost of a lane that does not fit in its channel (HWY-016). One more edge on a link with `f` edges of the key costs `capacity * max(0, (f + 1) * laneWidth - width)` more.
|
|
1766
|
+
* `width` is the free space across the link (`channelWidth`). The default is 0: the router does not read the channels.
|
|
1767
|
+
*/
|
|
1768
|
+
readonly capacity?: number;
|
|
1769
|
+
/** The width of one lane, for `capacity`. The default is 4. */
|
|
1770
|
+
readonly laneWidth?: number;
|
|
1771
|
+
/** The benchmark skips a fixture with more nodes. */
|
|
1772
|
+
readonly maxNodes?: number;
|
|
1773
|
+
}
|
|
1774
|
+
/**
|
|
1775
|
+
* This function makes a router where edges share their ways (after Pupyrev, Nachmanson, Bereg and Holroyd, "Edge routing with ordered bundles").
|
|
1776
|
+
* The edges go one by one through the corner graph. A link that an edge with the same key uses already costs less.
|
|
1777
|
+
* Thus the edges of a key come together on common ways. Each stretch that several edges share has the same points in each route.
|
|
1778
|
+
* The result gives each stretch as a run, with the order of its lanes.
|
|
1779
|
+
*/
|
|
1780
|
+
export declare function sharedRouter(options: SharedOptions): Router;
|
|
1781
|
+
/** Two items of a level that a link joins, and the count of the edges between them. */
|
|
1782
|
+
interface ItemPair {
|
|
1783
|
+
readonly source: string;
|
|
1784
|
+
readonly target: string;
|
|
1785
|
+
readonly count: number;
|
|
1786
|
+
}
|
|
1787
|
+
/** The options of the links of a level: the options of the ways, and two limits of the level links. */
|
|
1788
|
+
interface LevelLinkOptions extends WayOptions {
|
|
1789
|
+
/**
|
|
1790
|
+
* The margin of the second corner graph. A gap between two boxes wider than approximately 1.5 times this margin lets a link through.
|
|
1791
|
+
* The second graph uses the smaller of this value and `margin`. The default is 1.
|
|
1792
|
+
*/
|
|
1793
|
+
readonly tightMargin?: number;
|
|
1794
|
+
/** A plug stays at least this far from the corners of its side. The level links use the smaller of this value and `margin`. The default is 6. */
|
|
1795
|
+
readonly plugInset?: number;
|
|
1796
|
+
/**
|
|
1797
|
+
* The cost of a level link through a far box, in units of the mean box size. A far box overlaps neither end of the link.
|
|
1798
|
+
* A link through a far box gets a second way that can go through boxes (`SoftGraph`). The link keeps the way with fewer far boxes.
|
|
1799
|
+
* The value 0 turns the second way off and gives the links of version 0.1.5. The default is 8.
|
|
1800
|
+
*/
|
|
1801
|
+
readonly throughCost?: number;
|
|
1802
|
+
}
|
|
1803
|
+
/**
|
|
1804
|
+
* The options of the router with sections. Each option has a default, and the defaults give the output of version 0.1.5.
|
|
1805
|
+
* The options `cap`, `maxDepth` and `collapse` are the limits of the default grouping rule, the quadtree of `buildSections`.
|
|
1806
|
+
* The options `tightMargin`, `plugInset` and `throughCost` are the limits of the level links (`levelLinks`).
|
|
1807
|
+
*/
|
|
1808
|
+
interface SectionsOptions extends LevelLinkOptions, SectionOptions {
|
|
1809
|
+
/** The name in the benchmark. */
|
|
1810
|
+
readonly name: string;
|
|
1811
|
+
/**
|
|
1812
|
+
* The number of hubs on each side of the lowest common section that a way passes. A smaller number gives shorter ways
|
|
1813
|
+
* and fewer shared ways. Without it, a way passes each hub from its node up.
|
|
1814
|
+
*/
|
|
1815
|
+
readonly hubs?: number;
|
|
1816
|
+
/**
|
|
1817
|
+
* The hub limit. A way through the hubs can be at most this many times as long as the line between its plugs, plus `stretchPad` margins.
|
|
1818
|
+
* Else the edge goes directly. The default is 2. The value `Infinity` keeps each way through the hubs.
|
|
1819
|
+
*/
|
|
1820
|
+
readonly stretch?: number;
|
|
1821
|
+
/** A way through the hubs can be this many margins longer than `stretch` times the line between its plugs. The default is 4. */
|
|
1822
|
+
readonly stretchPad?: number;
|
|
1823
|
+
/**
|
|
1824
|
+
* A way skips a hub that is more than this many units farther from the target than the nearest approach of the way before it.
|
|
1825
|
+
* The default is 80, two times `BACKTRACK_MIN`. The value `Infinity` keeps each hub.
|
|
1826
|
+
*/
|
|
1827
|
+
readonly hubSlack?: number;
|
|
1828
|
+
/**
|
|
1829
|
+
* The grouping rule: a strategy of the step `group` that makes the tree of sections. The hubs and the zoom levels come from this tree.
|
|
1830
|
+
* Without it, the router uses the quadtree of `buildSections` with the options `cap`, `maxDepth` and `collapse`.
|
|
1831
|
+
*/
|
|
1832
|
+
readonly group?: Strategy<"group">;
|
|
1833
|
+
/** The options of the strategy `group`. The strategy gets its `defaults` for each option that this object does not give. */
|
|
1834
|
+
readonly groupOptions?: object;
|
|
1835
|
+
/**
|
|
1836
|
+
* The depths of the tree that get a zoom level with groups. The last level, with each node alone, always comes after them.
|
|
1837
|
+
* The default is each depth, from 0 to the depth of the deepest section.
|
|
1838
|
+
*/
|
|
1839
|
+
readonly levels?: readonly number[];
|
|
1840
|
+
/**
|
|
1841
|
+
* The level rule: a strategy of the step `levels` that makes the zoom levels from the tree and the routes.
|
|
1842
|
+
* Without it, the router uses the strategy `depths` (`depthLevels`). The strategy gets the options `levels`, `margin`, `k`, `tightMargin`, `plugInset` and `throughCost` of the router,
|
|
1843
|
+
* and then `levelOptions`.
|
|
1844
|
+
*/
|
|
1845
|
+
readonly level?: Strategy<"levels">;
|
|
1846
|
+
/** The options of the strategy `level`. They go over the level options of the router. */
|
|
1847
|
+
readonly levelOptions?: object;
|
|
1848
|
+
/** The lane order of the runs. With `run`, the default, each run gets its order alone. With `bundle`, two edges keep one order on each run of their common stretch. */
|
|
1849
|
+
readonly laneOrder?: RunOrder;
|
|
1850
|
+
/** The benchmark skips a fixture with more nodes. */
|
|
1851
|
+
readonly maxNodes?: number;
|
|
1852
|
+
}
|
|
1853
|
+
/**
|
|
1854
|
+
* This function makes a router with a tree of sections. Each section has a hub: the free corner nearest to the center of its nodes.
|
|
1855
|
+
* An edge goes from its node up the hubs of its sections to the lowest common section, across, and down to the other node.
|
|
1856
|
+
* Each way from hub to hub is found one time, so all the edges on it share its points.
|
|
1857
|
+
* The edges in one section of the lowest level go straight around the nodes.
|
|
1858
|
+
*
|
|
1859
|
+
* An edge skips a hub that takes it away from its target. A way that still goes out and back gives way to the direct way.
|
|
1860
|
+
*
|
|
1861
|
+
* The result gives one zoom level for each depth of the tree.
|
|
1862
|
+
* A link of a level goes from the boundary of one item to the boundary of the other, around the other items.
|
|
1863
|
+
*/
|
|
1864
|
+
export declare function sectionsRouter(options: SectionsOptions): Router;
|
|
1689
1865
|
/** The built-in routers. The registry `STRATEGIES` holds the same routers as strategies, and the benchmark races the routers of the registry. */
|
|
1690
1866
|
export declare const ROUTERS: readonly Router[];
|
|
1691
1867
|
/**
|
|
@@ -1793,6 +1969,71 @@ export declare function levelPairs(items: readonly LevelItem[], owner: readonly
|
|
|
1793
1969
|
* A nearer level only adds growth, so no gap of a far level gets narrower, and a box moves with its parent.
|
|
1794
1970
|
*/
|
|
1795
1971
|
export declare function levelRoom<T extends Boxed>(nodes: readonly T[], links: readonly RoomLink[], root: Section, options?: LevelRoomOptions): LevelRoom<T>;
|
|
1972
|
+
/**
|
|
1973
|
+
* This function gives the plugs of the plug strategy `facing`: each free plug faces the other end of its edge (`placePlug`).
|
|
1974
|
+
* A fixed plug stays at its point, and a plug with a side stays on that side. It is the default of the router `corners`.
|
|
1975
|
+
* The output has one entry for each edge with two known nodes, in the order of the edges.
|
|
1976
|
+
*/
|
|
1977
|
+
export declare function facingEnds(input: PlugInput): PlugPair[];
|
|
1978
|
+
/** The options of the level strategy `depths`: the limits of the level links, and the depths that get a level with groups. */
|
|
1979
|
+
export interface DepthLevelOptions extends Omit<LevelLinkOptions, "smooth"> {
|
|
1980
|
+
/**
|
|
1981
|
+
* The depths of the tree that get a zoom level with groups. The last level, with each node alone, always comes after them.
|
|
1982
|
+
* The default is each depth, from 0 to the depth of the deepest section.
|
|
1983
|
+
*/
|
|
1984
|
+
readonly levels?: readonly number[];
|
|
1985
|
+
}
|
|
1986
|
+
/**
|
|
1987
|
+
* This function gives the zoom levels of the level strategy `depths`.
|
|
1988
|
+
* It gives one level for each depth of the tree, and a last level with each node alone.
|
|
1989
|
+
* It is the default of the router `sections`. With the option `levels`, only those depths get a level with groups.
|
|
1990
|
+
* At depth d, a section of depth d is one item. A link joins two items and counts the edges between them.
|
|
1991
|
+
* In a level with groups, a link goes around the boxes of the other items (`levelLinks`).
|
|
1992
|
+
* In the last level, the points of a link are the route of its first edge.
|
|
1993
|
+
*/
|
|
1994
|
+
export declare function depthLevels(input: LevelInput, options?: DepthLevelOptions): Level[];
|
|
1995
|
+
/**
|
|
1996
|
+
* The options of the whole strategy `pipeline`: one strategy of each step, and the options of each one.
|
|
1997
|
+
* A rule of the steps `group`, `plugs` and `levels` acts only on a router that reads a rule of that step (`strategyKey`).
|
|
1998
|
+
*/
|
|
1999
|
+
export interface PipelineOptions {
|
|
2000
|
+
/** The router. A highway plan takes its place. */
|
|
2001
|
+
readonly router: Strategy<"router">;
|
|
2002
|
+
/** The options of the router. */
|
|
2003
|
+
readonly routerOptions?: object;
|
|
2004
|
+
/** The highway strategy. With it, the plan of the strategy and `follow` give the routes, not the router. */
|
|
2005
|
+
readonly highway?: Strategy<"highway">;
|
|
2006
|
+
/** The options of the highway strategy. */
|
|
2007
|
+
readonly highwayOptions?: object;
|
|
2008
|
+
/** The grouping rule of a router that reads one, for example `sections`. */
|
|
2009
|
+
readonly group?: Strategy<"group">;
|
|
2010
|
+
/** The options of the grouping rule. */
|
|
2011
|
+
readonly groupOptions?: object;
|
|
2012
|
+
/** The plug rule of a router that reads one, for example `corners`. */
|
|
2013
|
+
readonly plugs?: Strategy<"plugs">;
|
|
2014
|
+
/** The options of the plug rule. */
|
|
2015
|
+
readonly plugOptions?: object;
|
|
2016
|
+
/** The level rule of a router that reads one, for example `sections`. */
|
|
2017
|
+
readonly levels?: Strategy<"levels">;
|
|
2018
|
+
/** The options of the level rule. */
|
|
2019
|
+
readonly levelOptions?: object;
|
|
2020
|
+
/** The room strategy. With it, the pipeline opens the gaps of the board before the routes (`openGaps`). */
|
|
2021
|
+
readonly room?: Strategy<"room">;
|
|
2022
|
+
/** The options of the room strategy. */
|
|
2023
|
+
readonly roomOptions?: object;
|
|
2024
|
+
}
|
|
2025
|
+
/**
|
|
2026
|
+
* This function gives the key of the option of a router that takes a strategy of one step.
|
|
2027
|
+
* It gives `undefined` when the router has no such option.
|
|
2028
|
+
* The schema of the router declares the option with the type `strategy` and the step. The options of that strategy have the key `<key>Options`.
|
|
2029
|
+
*/
|
|
2030
|
+
export declare function strategyKey(router: Strategy<"router">, step: Step): string | undefined;
|
|
2031
|
+
/**
|
|
2032
|
+
* This function runs the whole strategy `pipeline` on one graph. The room strategy opens the gaps of the board first.
|
|
2033
|
+
* A highway strategy makes its plan, and `follow` routes the plan. Otherwise the router routes, with each rule of the steps `group`, `plugs` and `levels` that it reads.
|
|
2034
|
+
* The output has the board and the routes. The function does not examine the `maxNodes` of the router.
|
|
2035
|
+
*/
|
|
2036
|
+
export declare function runPipeline(graph: Graph, options: PipelineOptions): WholeOutput;
|
|
1796
2037
|
/** A broken hard rule. A correct router has none. */
|
|
1797
2038
|
export interface Violation {
|
|
1798
2039
|
readonly rule: "complete" | "ends-at-plugs" | "fixed-plugs" | "no-pass-through" | "counts-sum" | "link-ends" | "bundle-trunk" | "run-shared";
|
|
@@ -1967,6 +2208,22 @@ export interface BenchRow {
|
|
|
1967
2208
|
readonly levelFaults: readonly LevelFaults[];
|
|
1968
2209
|
/** The routes of this cell took longer than the cell limit. The cell did not start more routes. A row within the limit has no such field. */
|
|
1969
2210
|
readonly overLimit?: OverLimit;
|
|
2211
|
+
/** The time of the paired baseline arm (BENCH-GREEN). Only a cell with a baseline router has it. */
|
|
2212
|
+
readonly paired?: Paired;
|
|
2213
|
+
}
|
|
2214
|
+
/**
|
|
2215
|
+
* The paired baseline arm of a cell. The baseline router routes the same graph in turn with the router, on the same CPU.
|
|
2216
|
+
* The ratio does not change with the speed of the runner, so the ratios of two runs compare better than their times.
|
|
2217
|
+
*/
|
|
2218
|
+
export interface Paired {
|
|
2219
|
+
/** The name of the baseline router. */
|
|
2220
|
+
readonly base: string;
|
|
2221
|
+
/** The median time of one route of the router in the paired routes, in milliseconds. */
|
|
2222
|
+
readonly ms: number;
|
|
2223
|
+
/** The median time of one route of the baseline router, in milliseconds. */
|
|
2224
|
+
readonly baseMs: number;
|
|
2225
|
+
/** The ratio `ms / baseMs`. A ratio below 1 tells that the router is faster than the baseline. */
|
|
2226
|
+
readonly ratio: number;
|
|
1970
2227
|
}
|
|
1971
2228
|
/** The record of a cell over its time limit. */
|
|
1972
2229
|
export interface OverLimit {
|
|
@@ -2003,8 +2260,12 @@ export interface BenchRun {
|
|
|
2003
2260
|
readonly row: BenchRow;
|
|
2004
2261
|
readonly result: Result;
|
|
2005
2262
|
}
|
|
2006
|
-
/**
|
|
2007
|
-
|
|
2263
|
+
/**
|
|
2264
|
+
* This function does the work of `benchOne` and also gives the result, so more measures can read it without a second route.
|
|
2265
|
+
* With a baseline router `pair`, the baseline routes the graph one time for each route of the router, in turn: first before, then after.
|
|
2266
|
+
* The row then gets `paired`. The baseline routes do not count for the cell limit, and their results do not change the row.
|
|
2267
|
+
*/
|
|
2268
|
+
export declare function benchRun(router: Router, fixture: string, graph: Graph, repeat?: number, cellLimit?: number, pair?: Router): BenchRun;
|
|
2008
2269
|
/**
|
|
2009
2270
|
* This function puts rows in the order of one benchmark run: by fixture, then by router, each in the order of its list.
|
|
2010
2271
|
* A name that is not in its list goes after the names of the list. Rows with the same place keep their order.
|
|
@@ -2218,6 +2479,8 @@ export interface RoomBenchRow {
|
|
|
2218
2479
|
* The function also measures the lane routes of the router `sections` at the lane width `spacing`.
|
|
2219
2480
|
*/
|
|
2220
2481
|
export declare function measureBoard(graph: Graph, spacing: number, order?: LaneOrder): Omit<RoomBenchRow, "fixture" | "board" | "area" | "ms">;
|
|
2482
|
+
/** This function gives the links of the far view of a board: `levelLinks` with each node as one item. */
|
|
2483
|
+
export declare function farLinks(graph: Graph): LevelLink[];
|
|
2221
2484
|
/**
|
|
2222
2485
|
* This function measures a packed board, the board with each gap open to the gutter only, and the board that each room strategy opens.
|
|
2223
2486
|
* The options are the same for each strategy, except `method`. The default strategies are the methods `routes` and `lines` of `roomDemand`.
|
|
@@ -2952,6 +3215,29 @@ export interface SuiteOptions {
|
|
|
2952
3215
|
readonly steps?: readonly Step[];
|
|
2953
3216
|
/** The time limit of one cell of the step `router`, in milliseconds, as `BenchOptions.cellLimit` gives it. The default is no limit. */
|
|
2954
3217
|
readonly cellLimit?: number;
|
|
3218
|
+
/**
|
|
3219
|
+
* One shard of the cells of the steps `router` and `highway` (BENCH-GREEN). The default is all the cells.
|
|
3220
|
+
* The strategy at place `s` of its step, on the seed `k`, belongs to the shard `(s + k) % count`, from 0.
|
|
3221
|
+
* So the seeds of one strategy go to different shards, and each shard gets a similar share of the time.
|
|
3222
|
+
* A shard has only these two steps and the step `curve`, because the cells of the other steps do not divide.
|
|
3223
|
+
*/
|
|
3224
|
+
readonly shard?: {
|
|
3225
|
+
readonly index: number;
|
|
3226
|
+
readonly count: number;
|
|
3227
|
+
};
|
|
3228
|
+
/**
|
|
3229
|
+
* The largest fixture of a strategy of the steps `router` and `highway`, in nodes, by the name of the strategy. The default is no cap.
|
|
3230
|
+
* A capped strategy does not route a larger fixture. The report lists each such cell in `capped`, so the row is capped, not missing.
|
|
3231
|
+
*/
|
|
3232
|
+
readonly caps?: Readonly<Record<string, number>>;
|
|
3233
|
+
/**
|
|
3234
|
+
* The name of the baseline router of the paired arm, for example `shared`. The default is no paired arm.
|
|
3235
|
+
* On the first seed of each fixture, the baseline routes the same graph in turn with each strategy of the steps `router` and `highway`.
|
|
3236
|
+
* The row and the bench row then get `paired`.
|
|
3237
|
+
*/
|
|
3238
|
+
readonly pair?: string;
|
|
3239
|
+
/** The paired arm routes only the fixtures up to this number of nodes. The default is 1000. */
|
|
3240
|
+
readonly pairMax?: number;
|
|
2955
3241
|
/** This function gets one line of progress for each fixture and seed. */
|
|
2956
3242
|
readonly log?: (line: string) => void;
|
|
2957
3243
|
}
|
|
@@ -2990,6 +3276,18 @@ export interface SuiteRow {
|
|
|
2990
3276
|
readonly treeMs?: number;
|
|
2991
3277
|
/** The measures, by a key that starts with the id of MEAS0, or the name of a proposed rule. */
|
|
2992
3278
|
readonly values: Readonly<Record<string, number>>;
|
|
3279
|
+
/** The time of the paired baseline arm (`SuiteOptions.pair`). Only the first seed of a fixture has it. */
|
|
3280
|
+
readonly paired?: Paired;
|
|
3281
|
+
}
|
|
3282
|
+
/** A cell that the suite did not route, because the fixture is larger than the cap of the strategy (`SuiteOptions.caps`). */
|
|
3283
|
+
export interface CappedCell {
|
|
3284
|
+
readonly step: Step;
|
|
3285
|
+
readonly strategy: string;
|
|
3286
|
+
readonly fixture: string;
|
|
3287
|
+
/** The nodes of the fixture. */
|
|
3288
|
+
readonly nodes: number;
|
|
3289
|
+
/** The cap of the strategy, in nodes. */
|
|
3290
|
+
readonly cap: number;
|
|
2993
3291
|
}
|
|
2994
3292
|
/** The spread of each measure of one strategy on one fixture family, over the seeds. */
|
|
2995
3293
|
export interface SuiteSummary {
|
|
@@ -3037,8 +3335,13 @@ export interface SuiteReport {
|
|
|
3037
3335
|
readonly summaries: readonly SuiteSummary[];
|
|
3038
3336
|
readonly fronts: readonly SuiteFront[];
|
|
3039
3337
|
readonly rules: readonly RuleCount[];
|
|
3338
|
+
/** The cells over the cap of their strategy, one for each strategy and fixture. A report with no cap has no such field. */
|
|
3339
|
+
readonly capped?: readonly CappedCell[];
|
|
3040
3340
|
}
|
|
3041
|
-
/**
|
|
3341
|
+
/**
|
|
3342
|
+
* The axes of the Pareto front of each step. The note MEAS0 asks for two to four scores.
|
|
3343
|
+
* The steps `plugs`, `levels` and `whole` run as routers (`stepRouterStrategy`), so they use the axes of the step `router`.
|
|
3344
|
+
*/
|
|
3042
3345
|
export declare const FRONT_OBJECTIVES: Readonly<Record<Step, readonly Objective[]>>;
|
|
3043
3346
|
/** This function gives the seed of the member `k` of the family of a fixture. The member 0 is the fixture itself. */
|
|
3044
3347
|
export declare function familySeed(spec: FixtureSpec, k: number): number;
|
|
@@ -3151,6 +3454,13 @@ export declare function formatRules(rules: readonly RuleCount[]): string;
|
|
|
3151
3454
|
* It gives one row for each fixture family of a step. The extra routes of the stability measures have their own column.
|
|
3152
3455
|
*/
|
|
3153
3456
|
export declare function formatMeasureTime(rows: readonly SuiteRow[], step?: Step): string;
|
|
3457
|
+
/** This function writes the capped cells as a Markdown table. Each line is a cell that the cap of its strategy stopped, so the row is capped, not missing. */
|
|
3458
|
+
export declare function formatCapped(capped: readonly CappedCell[]): string;
|
|
3459
|
+
/**
|
|
3460
|
+
* This function writes the paired arm of the rows as a Markdown table. It gives the medians of the strategy and of the baseline, and their ratio.
|
|
3461
|
+
* Only the rows with `paired` count.
|
|
3462
|
+
*/
|
|
3463
|
+
export declare function formatPaired(rows: readonly SuiteRow[]): string;
|
|
3154
3464
|
/**
|
|
3155
3465
|
* The options of the highway strategy `corridors` (HWY-031 of the note on highways).
|
|
3156
3466
|
* The options `margin` and `k` set the corner graph of the first ways, when the input has no first routes.
|
|
@@ -4636,8 +4946,11 @@ export declare function ridgeLines(input: HighwayInput, o: Readonly<RidgeOptions
|
|
|
4636
4946
|
export declare function ridgePlan(input: HighwayInput, o: Readonly<RidgeOptions>): HighwayPlan;
|
|
4637
4947
|
/** The options of the highway strategy `soft-keys` (HWY-019 of the note on highways). */
|
|
4638
4948
|
interface SoftKeyOptions {
|
|
4639
|
-
/**
|
|
4640
|
-
|
|
4949
|
+
/**
|
|
4950
|
+
* The rule that gives the key of each edge, or the name of a built-in rule (`GROUP_RULE_NAMES`). The default is `byCollection`: the string `data.collection`.
|
|
4951
|
+
* With `all`, each edge has one key, so the keys add no distance.
|
|
4952
|
+
*/
|
|
4953
|
+
readonly rule: GroupRule | GroupRuleName;
|
|
4641
4954
|
/** The distance that two different keys add. `Infinity` keeps the edges of two keys apart, as the hard keys do. The default is 0.25. */
|
|
4642
4955
|
readonly lambda: number;
|
|
4643
4956
|
/** Two clusters join while their distance is this value or less. The default is 0.5. */
|
|
@@ -5341,15 +5654,40 @@ export declare const highwayStrategies: {
|
|
|
5341
5654
|
readonly "corridors+hysteresis": Strategy<"highway", CorridorOptions & HysteresisOptions>;
|
|
5342
5655
|
readonly "corridors+ids": Strategy<"highway", CorridorOptions & StableIdOptions>;
|
|
5343
5656
|
};
|
|
5657
|
+
/** The built-in plug rules: the strategies of the step `plugs`. The router `corners` routes between their plugs with its option `plug`. */
|
|
5658
|
+
export declare const plugStrategies: {
|
|
5659
|
+
readonly facing: Strategy<"plugs", object>;
|
|
5660
|
+
};
|
|
5661
|
+
/** The built-in level rules: the strategies of the step `levels`. The router `sections` makes its zoom levels with its option `level`. */
|
|
5662
|
+
export declare const levelStrategies: {
|
|
5663
|
+
readonly depths: Strategy<"levels", DepthLevelOptions>;
|
|
5664
|
+
};
|
|
5665
|
+
/**
|
|
5666
|
+
* The built-in whole strategies: the strategies of the step `whole`. The strategy `pipeline` runs one strategy of each step, as the demo of the site does.
|
|
5667
|
+
* Without options, it routes the graph with the router `corners`.
|
|
5668
|
+
*/
|
|
5669
|
+
export declare const wholeStrategies: {
|
|
5670
|
+
readonly pipeline: Strategy<"whole", PipelineOptions>;
|
|
5671
|
+
};
|
|
5344
5672
|
/** The built-in strategies of each step, in order. A consumer adds its own: `createRegistry([...BUILT_IN_STRATEGIES, mine])`. */
|
|
5345
5673
|
export declare const BUILT_IN_STRATEGIES: readonly AnyStrategy[];
|
|
5346
5674
|
/** The registry of the built-in strategies. The benchmark and the site take their lists from it. */
|
|
5347
5675
|
export declare const STRATEGIES: Registry;
|
|
5676
|
+
/**
|
|
5677
|
+
* The steps whose strategies give no routes alone. `compareAnyStep` and the screen compare each strategy of these steps as a router (`stepRouterStrategy`).
|
|
5678
|
+
* The step `highway` gives a plan, and the step `plugs` gives the plugs.
|
|
5679
|
+
* The step `levels` gives the zoom levels, and the step `whole` gives a board with its routes.
|
|
5680
|
+
*/
|
|
5681
|
+
export type RoutedStep = "plugs" | "highway" | "levels" | "whole";
|
|
5682
|
+
/** The steps of `RoutedStep`, in the order of the pipeline. */
|
|
5683
|
+
export declare const ROUTED_STEPS: readonly RoutedStep[];
|
|
5684
|
+
/** This function tells if a step is a step of `RoutedStep`. */
|
|
5685
|
+
export declare const isRoutedStep: (step: Step) => step is RoutedStep;
|
|
5348
5686
|
/**
|
|
5349
5687
|
* The steps that `compareStep` compares. The step `room` takes a packed board, not a graph, so it is not in the list.
|
|
5350
|
-
* The
|
|
5688
|
+
* The steps of `RoutedStep` give no routes alone, so they are not in the list. `compareAnyStep` compares them as routers.
|
|
5351
5689
|
*/
|
|
5352
|
-
export type CompareStep = Exclude<Step, "room" |
|
|
5690
|
+
export type CompareStep = Exclude<Step, "room" | RoutedStep>;
|
|
5353
5691
|
/** The steps that `compareStep` compares, in the order of the pipeline. */
|
|
5354
5692
|
export declare const COMPARE_STEPS: readonly CompareStep[];
|
|
5355
5693
|
/** The options of `compareStep`. */
|
|
@@ -5419,6 +5757,60 @@ export interface StepComparison {
|
|
|
5419
5757
|
* The same graph and the same options give the same measures. Only the times change.
|
|
5420
5758
|
*/
|
|
5421
5759
|
export declare function compareStep(step: CompareStep, graph: Graph, options?: CompareOptions): StepComparison;
|
|
5760
|
+
/** The steps that `compareAnyStep` compares: each step of `STEPS`, in the order of the pipeline. */
|
|
5761
|
+
export declare const COMPARE_ALL_STEPS: readonly Step[];
|
|
5762
|
+
/**
|
|
5763
|
+
* This function gives a router for each highway strategy of a registry, in the order of the registry.
|
|
5764
|
+
* Each router makes the plan of its strategy and routes the plan with `follow` (`highwayRouterStrategy`).
|
|
5765
|
+
* The screen and `compareAnyStep` compare the highway strategies as these routers.
|
|
5766
|
+
*/
|
|
5767
|
+
export declare function highwayRouters(registry: Registry): Strategy<"router">[];
|
|
5768
|
+
/**
|
|
5769
|
+
* This function gives a router strategy that runs a strategy of a step of `RoutedStep`. The router has the name, the options and the schema of the strategy.
|
|
5770
|
+
* - A highway strategy makes its plan, and `follow` routes the plan (`highwayRouterStrategy`).
|
|
5771
|
+
* - A plug rule gives the plugs of the router `corners` (its option `plug`).
|
|
5772
|
+
* - A level rule gives the zoom levels of the router `sections` (its option `level`).
|
|
5773
|
+
* - A whole strategy gives the routes of its output. A room strategy in its options can change the board, but the measures read the input graph.
|
|
5774
|
+
*/
|
|
5775
|
+
export declare function stepRouterStrategy(strategy: Strategy<RoutedStep>): Strategy<"router">;
|
|
5776
|
+
/** This function gives a router for each strategy of one step of `RoutedStep` in a registry, in the order of the registry (`stepRouterStrategy`). */
|
|
5777
|
+
export declare function stepRouters(registry: Registry, step: RoutedStep): Strategy<"router">[];
|
|
5778
|
+
/** One strategy of any step on one graph: a row of `compareStep`, or a row of the steps `highway` and `room`. */
|
|
5779
|
+
export interface AnyCompareRow extends Omit<CompareRow, "step"> {
|
|
5780
|
+
readonly step: Step;
|
|
5781
|
+
/** The boxes of the board that the room strategy opens, in the order of the nodes, for the step `room`. */
|
|
5782
|
+
readonly boxes?: readonly Box[];
|
|
5783
|
+
/** The links of the far view on the board that the room strategy opens, for the step `room`. */
|
|
5784
|
+
readonly links?: readonly LevelLink[];
|
|
5785
|
+
}
|
|
5786
|
+
/** The comparison of the strategies of any step on one graph. */
|
|
5787
|
+
export interface AnyStepComparison extends Omit<StepComparison, "step" | "rows"> {
|
|
5788
|
+
readonly step: Step;
|
|
5789
|
+
/** One row for each strategy of the step, in the order of the registry. */
|
|
5790
|
+
readonly rows: readonly AnyCompareRow[];
|
|
5791
|
+
}
|
|
5792
|
+
/** The options of `compareAnyStep`. */
|
|
5793
|
+
export interface AnyCompareOptions extends CompareOptions {
|
|
5794
|
+
/** This function gets each row when its strategy is done, with the number of rows that are done and the number of all rows. A host can show the progress. */
|
|
5795
|
+
readonly onRow?: (row: AnyCompareRow, done: number, total: number) => void;
|
|
5796
|
+
}
|
|
5797
|
+
/**
|
|
5798
|
+
* This function gives the measures of a board that a room strategy opened.
|
|
5799
|
+
* It uses the keys and the lane spacing 4 of the step `room` of `runSuite`.
|
|
5800
|
+
* The measures are the area against the board before (`M1.area`), the lane routes through a box (`M4.laneThrough`), the faults of the far view and `room-order`.
|
|
5801
|
+
*/
|
|
5802
|
+
export declare function roomValues(graph: Graph, open: readonly Node[]): Record<string, number>;
|
|
5803
|
+
/**
|
|
5804
|
+
* This function runs each strategy of any step of `STEPS` on one graph and measures it. Then it gives the Pareto front of `FRONT_OBJECTIVES`.
|
|
5805
|
+
* The steps `group`, `router` and `curve` give the rows of `compareStep`.
|
|
5806
|
+
* The step `highway` makes the plan of each strategy and routes it with `follow`, as the screen does. It measures the routes as the step `router`.
|
|
5807
|
+
* The steps `plugs`, `levels` and `whole` also run each strategy as a router (`stepRouterStrategy`), and measure the routes as the step `router`.
|
|
5808
|
+
* The step `room` opens the gaps of the board with each strategy (`openGaps`). It measures the open board as the step `room` of `runSuite`.
|
|
5809
|
+
* The step `room` expects a packed board, for example `packedGridBoard`. On a board with wide gaps, a gap opens only when its links need more room.
|
|
5810
|
+
*
|
|
5811
|
+
* The function runs one strategy at a time and gives each row to `onRow`. The same graph and the same options give the same measures. Only the times change.
|
|
5812
|
+
*/
|
|
5813
|
+
export declare function compareAnyStep(step: Step, graph: Graph, options?: AnyCompareOptions): AnyStepComparison;
|
|
5422
5814
|
/** This function gives the bytes of a string in UTF-8. The contract does not export its own `utf8`, so the core keeps this function. */
|
|
5423
5815
|
export declare function utf8(text: string): Uint8Array;
|
|
5424
5816
|
/**
|
|
@@ -5778,20 +6170,55 @@ export interface ScreenFamily {
|
|
|
5778
6170
|
/** The cell of each member in the taxonomy of the corpus. */
|
|
5779
6171
|
readonly cell: LayoutCell;
|
|
5780
6172
|
}
|
|
6173
|
+
/**
|
|
6174
|
+
* The key of the family of a screen input (SCREEN-WEIGHT). The map form gives the kind of the cell as the key, with no other dimension.
|
|
6175
|
+
* The cells of a screen set have no `kind`, and `dense-groups` and `many-groups` have the same cell. Thus `familyCell` adds the family of the input as the kind.
|
|
6176
|
+
*/
|
|
6177
|
+
export declare const SCREEN_FAMILY_BY: FamilyBy;
|
|
6178
|
+
/** This function gives the cell of an input for the key `familyBy`: the cell of the input, with its family as `kind`. */
|
|
6179
|
+
export declare const familyCell: (input: {
|
|
6180
|
+
readonly family: string;
|
|
6181
|
+
readonly cell?: LayoutCell;
|
|
6182
|
+
}) => FamilyCell;
|
|
6183
|
+
/** The claims of a manifest. `declared` gives the count of the inputs of each family (`docs/CORPUS-CHECKS.md` of `layout-contract`). */
|
|
6184
|
+
export interface CorpusClaims {
|
|
6185
|
+
readonly declared: DeclaredClaim;
|
|
6186
|
+
}
|
|
5781
6187
|
/** A screen set: a fixed list of small boards with an id. A new board or a changed board gets a new id. */
|
|
5782
6188
|
export interface ScreenSet {
|
|
5783
6189
|
/** The id of the set, for example `screen-v1`. The records name it in `set` and `corpus`. */
|
|
5784
6190
|
readonly id: string;
|
|
5785
6191
|
readonly families: readonly ScreenFamily[];
|
|
6192
|
+
/** The claims of the manifest of the set. A set without claims has no field `claims` in its manifest. */
|
|
6193
|
+
readonly claims?: CorpusClaims;
|
|
6194
|
+
/** The member seeds of each family that the split `default` holds out. A set without them has no split file. */
|
|
6195
|
+
readonly heldOut?: readonly number[];
|
|
5786
6196
|
}
|
|
6197
|
+
/** This function gives the seed of the member `k` of a case board with the base seed `base`: `base + 1009 * k`, the rule of `familySeed`. */
|
|
6198
|
+
export declare function caseSeed(base: number, k: number): number;
|
|
5787
6199
|
/**
|
|
5788
6200
|
* The screen set `screen-v1`: 14 boards of made-up data from 10 to 150 nodes. Each family shows a known hard case.
|
|
5789
6201
|
* The seed 0 of each family is the fixture or the case board of the benchmark. The seed `k` of a fixture family is `familySeed(spec, k)`, as in `runSuite`.
|
|
5790
6202
|
* The generators wrap the fixtures and the case boards without a change to their output.
|
|
5791
|
-
*
|
|
6203
|
+
*
|
|
6204
|
+
* The manifest declares the inputs of each family, with `minCount` 3. The case boards `hub-chain` and `many-groups` have 1 input, so they are in `thin`.
|
|
6205
|
+
* The boards of this set do not change. The tests compare it with the files in `corpus/screen-v1`.
|
|
5792
6206
|
*/
|
|
5793
6207
|
export declare const SCREEN_V1: ScreenSet;
|
|
5794
|
-
/** The
|
|
6208
|
+
/** The member seeds of each family of `screen-v2` that the split `default` holds out. */
|
|
6209
|
+
export declare const SCREEN_V2_HELD_OUT: readonly number[];
|
|
6210
|
+
/**
|
|
6211
|
+
* The screen set `screen-v2` (CORPUS-SEEDS): the 6 families of `screen-v1`, each with the 10 members 0 to 9, thus 60 boards.
|
|
6212
|
+
* Each family keeps the seed rule of `screen-v1`. Thus the members 0 to 2 are the boards of `screen-v1`, and the member 0 of `hub-chain` and `many-groups` is their board.
|
|
6213
|
+
*
|
|
6214
|
+
* The manifest declares 10 inputs for each family, and each family key has 10 inputs or more. The split `default` holds out the members 7 to 9 of each family.
|
|
6215
|
+
* This set does not change. The tests compare it with the files in `corpus/screen-v2`.
|
|
6216
|
+
*/
|
|
6217
|
+
export declare const SCREEN_V2: ScreenSet;
|
|
6218
|
+
/**
|
|
6219
|
+
* The screen sets by id. `screen-v1` and its larger version `screen-v2` (CORPUS-SEEDS) have the boards of the screen.
|
|
6220
|
+
* `exact-v1` has small boards with a known optimum (MEAS2). `exact-v1-bounds` has larger boards with bounds (EXACT-BOUNDS).
|
|
6221
|
+
*/
|
|
5795
6222
|
export declare const SCREEN_SETS: Readonly<Record<string, ScreenSet>>;
|
|
5796
6223
|
/** This function gives the id of the member `seed` of a family of a set: `<set>/<family>/s<seed>`. */
|
|
5797
6224
|
export declare function inputId(set: string, family: string, seed: number): string;
|
|
@@ -5814,9 +6241,35 @@ export interface LayoutCorpus {
|
|
|
5814
6241
|
readonly hash: string;
|
|
5815
6242
|
readonly cell: LayoutCell;
|
|
5816
6243
|
}[];
|
|
6244
|
+
readonly claims?: CorpusClaims;
|
|
5817
6245
|
}
|
|
5818
|
-
/**
|
|
5819
|
-
|
|
6246
|
+
/**
|
|
6247
|
+
* This function gives the manifest of a list of inputs. The inputs of one generator, version and parameters share one spec.
|
|
6248
|
+
* With `claims`, the manifest has the field `claims`.
|
|
6249
|
+
*/
|
|
6250
|
+
export declare function corpusManifest(corpus: string, inputs: readonly LayoutInput[], claims?: CorpusClaims): LayoutCorpus;
|
|
6251
|
+
/** This function gives the manifest of a screen set, with the claims of the set. */
|
|
6252
|
+
export declare function setManifest(set: ScreenSet, inputs?: readonly LayoutInput[]): LayoutCorpus;
|
|
6253
|
+
/** The hook of the claim `declared` of a screen set: each input declares its family. */
|
|
6254
|
+
export declare const declaresFamily: (input: {
|
|
6255
|
+
readonly family: string;
|
|
6256
|
+
}) => readonly string[];
|
|
6257
|
+
/**
|
|
6258
|
+
* This function checks the claim `declared` of a manifest against its inputs, with the shared check of the contract. A manifest without the claim gives no break.
|
|
6259
|
+
* With `familyBy`, the check reads the cell of each input with `familyCell`.
|
|
6260
|
+
*/
|
|
6261
|
+
export declare function checkFamilies(manifest: LayoutCorpus, inputs: readonly LayoutInput[]): ClaimBreak[];
|
|
6262
|
+
/** This function gives the hash of the corpus of a manifest with the shared function `corpusHashOf` of the contract. It reads the input ids and the input hashes. */
|
|
6263
|
+
export declare function manifestHash(manifest: LayoutCorpus): string;
|
|
6264
|
+
/**
|
|
6265
|
+
* This function gives the split file `corpus-split/1` of a screen set with `heldOut`. A set without `heldOut` gives `undefined`.
|
|
6266
|
+
* The seeds of a split file are the seeds of the specs of the manifest. Thus each fold lists the generator seeds of its members.
|
|
6267
|
+
* - The split `default` has one fold. It holds out the members `heldOut` of each family and trains on the other members.
|
|
6268
|
+
* - The split `by-member` has one fold for each member `k`. The fold holds out the member `k` of each family.
|
|
6269
|
+
*/
|
|
6270
|
+
export declare function screenSplit(set: ScreenSet, manifest?: LayoutCorpus): CorpusSplit | undefined;
|
|
6271
|
+
/** This function gives the path of the split file of a corpus, relative to the folder of the corpora: `splits/<corpus id>.<corpus hash>.json`. */
|
|
6272
|
+
export declare function splitPath(split: CorpusSplit): string;
|
|
5820
6273
|
/**
|
|
5821
6274
|
* This function gives the output hash of a result of a router, in the highways form.
|
|
5822
6275
|
* The form holds the routes in the order of the edge ids, and the levels, the bundles and the runs as the router gives them.
|
|
@@ -6069,10 +6522,11 @@ export declare function gapValues(input: {
|
|
|
6069
6522
|
readonly hash: string;
|
|
6070
6523
|
}, graph: Graph, result: Result, corners: readonly Route[], baselines: Readonly<Record<GapRule, number>>, optima: ReadonlyMap<string, ExactOptimum>): Record<string, number>;
|
|
6071
6524
|
/**
|
|
6072
|
-
* The steps of the screen: the steps of `compareStep` and the
|
|
6525
|
+
* The steps of the screen: the steps of `compareStep` and the steps of `RoutedStep`.
|
|
6073
6526
|
* The screen of the step `highway` routes the plan of each strategy with `follow`, and measures the routes as the routes of a router.
|
|
6527
|
+
* The screen of the steps `plugs`, `levels` and `whole` runs each strategy as a router (`stepRouterStrategy`). It measures the routes as the routes of a router.
|
|
6074
6528
|
*/
|
|
6075
|
-
export type ScreenStep = CompareStep |
|
|
6529
|
+
export type ScreenStep = CompareStep | RoutedStep;
|
|
6076
6530
|
/** The steps of the screen, in the order of the pipeline. */
|
|
6077
6531
|
export declare const SCREEN_STEPS: readonly ScreenStep[];
|
|
6078
6532
|
/** The routers that the screen of the step `highway` also runs by default. They are the baselines of the note on highways. */
|
|
@@ -6217,8 +6671,6 @@ export declare function unwrappedName(name: string): string;
|
|
|
6217
6671
|
export declare function screen(step: ScreenStep, strategies?: readonly (Strategy<ScreenStep> | string)[], options?: ScreenOptions): ScreenReport;
|
|
6218
6672
|
/** This function writes the summary of a screen as Markdown: one row for each strategy, the front and the predictions. */
|
|
6219
6673
|
export declare function formatScreen(summary: ScreenSummary): string;
|
|
6220
|
-
/** This function gives a whole number from `lo` to `hi`, both included, from a generator of random numbers. */
|
|
6221
|
-
export declare function randomInt(r: () => number, lo: number, hi: number): number;
|
|
6222
6674
|
/** The parameters of the generator `rect-scattered`. */
|
|
6223
6675
|
export interface RectScatteredParams {
|
|
6224
6676
|
/** The number of boxes. */
|
|
@@ -6226,8 +6678,9 @@ export interface RectScatteredParams {
|
|
|
6226
6678
|
}
|
|
6227
6679
|
/**
|
|
6228
6680
|
* This function makes the input of the shared generator `rect-scattered`, version 1: a fixed rectangle container, scattered obstacles and boxes without positions.
|
|
6229
|
-
* The repository `packing` makes the same file, byte for byte.
|
|
6230
|
-
*
|
|
6681
|
+
* It uses the shared family `RECT_SCATTERED` of `@mark1russell7/layout-contract` (CORPUS-GEN). The repository `packing` makes the same file, byte for byte.
|
|
6682
|
+
*
|
|
6683
|
+
* @deprecated Use `RECT_SCATTERED` on a registry of `createFamilyRegistry`. This function stays for the callers of today.
|
|
6231
6684
|
*/
|
|
6232
6685
|
export declare function rectScattered(seed: number, params: RectScatteredParams, set?: string): LayoutInput;
|
|
6233
6686
|
/** The board classes of the small boards with a known optimum (MEAS2). */
|
|
@@ -6272,6 +6725,70 @@ export declare function boundsFamilyName(cls: ExactClass, nodes: number): string
|
|
|
6272
6725
|
* This set does not change. The tests compare it with the files in `corpus/exact-v1-bounds`.
|
|
6273
6726
|
*/
|
|
6274
6727
|
export declare const EXACT_V1_BOUNDS: ScreenSet;
|
|
6728
|
+
/**
|
|
6729
|
+
* The output of a family of highways: the graph of the board and its generator record.
|
|
6730
|
+
* A screen set puts the board into an input file with `graphInput`. The set gives the id, the member seed and the cell.
|
|
6731
|
+
*/
|
|
6732
|
+
export interface HighwaysBoard {
|
|
6733
|
+
readonly graph: Graph;
|
|
6734
|
+
/** The generator of the board: its name, its version, its parameters and its input seed. */
|
|
6735
|
+
readonly generator: LayoutGenerator;
|
|
6736
|
+
}
|
|
6737
|
+
/** A corpus family of highways: a family of the shared registry whose output is a `HighwaysBoard`. */
|
|
6738
|
+
export type HighwaysFamily = CorpusFamily$1<HighwaysBoard>;
|
|
6739
|
+
/** The engine of each dimension of the families of highways. */
|
|
6740
|
+
export declare const HIGHWAYS_ENGINE = "highways";
|
|
6741
|
+
/** The fields of a numeric dimension of `numberDimension`. */
|
|
6742
|
+
interface NumberFields {
|
|
6743
|
+
readonly name: string;
|
|
6744
|
+
readonly kind: "int" | "real";
|
|
6745
|
+
readonly min: number;
|
|
6746
|
+
readonly max: number;
|
|
6747
|
+
readonly default: number;
|
|
6748
|
+
readonly scale?: "linear" | "log";
|
|
6749
|
+
readonly meaning: string;
|
|
6750
|
+
}
|
|
6751
|
+
/** This function gives an `int` or a `real` dimension that only highways reads. */
|
|
6752
|
+
export declare function numberDimension(fields: NumberFields): CorpusDimension$1;
|
|
6753
|
+
/** This function gives an `enum` dimension that only highways reads. */
|
|
6754
|
+
export declare function enumDimension(name: string, values: readonly string[], value: string, meaning: string): CorpusDimension$1;
|
|
6755
|
+
/** This function gives the values of the dimensions that differ from their defaults, in the order of the dimensions. */
|
|
6756
|
+
export declare function changedDimensions(dimensions: readonly CorpusDimension$1[], dims: DimensionValues$1): Record<string, ParamValue$1>;
|
|
6757
|
+
/** This function gives the value of a numeric dimension. It throws a `RangeError` when the value is not a number. */
|
|
6758
|
+
export declare function numberOf(dims: DimensionValues$1, name: string): number;
|
|
6759
|
+
/** The values of the dimension `layout`: each `FixtureKind`. */
|
|
6760
|
+
export declare const FIXTURE_LAYOUTS: readonly FixtureKind[];
|
|
6761
|
+
/** The share of the edges near the source when a spec has no `locality`: the default of `makeFixture`. */
|
|
6762
|
+
export declare const FIXTURE_LOCALITY = .65;
|
|
6763
|
+
/** This function gives the spec of a fixture board from the full dimension values. A field at the default of `makeFixture` stays out of the spec. */
|
|
6764
|
+
export declare function fixtureSpecOf(name: string, seed: number, dims: DimensionValues$1): FixtureSpec;
|
|
6765
|
+
/**
|
|
6766
|
+
* This function gives the parameters of the generator record of a fixture board: the spec without its name and its seed.
|
|
6767
|
+
* Thus the record of each screen board stays the record of today, for example `{ kind, nodes, edgesPerNode, fixedPorts }` of `small-clustered`.
|
|
6768
|
+
*/
|
|
6769
|
+
export declare function fixtureParams(spec: FixtureSpec): Readonly<Record<string, unknown>>;
|
|
6770
|
+
/** The family `tiny-uniform`: 10 nodes at random places. It is the fixture `tiny-uniform` of `FIXTURES` at its defaults. */
|
|
6771
|
+
export declare const TINY_UNIFORM: HighwaysFamily;
|
|
6772
|
+
/** The family `small-clustered`: 100 nodes in clusters, with a fixed plug on 20% of the nodes. It is the fixture `small-clustered` at its defaults. */
|
|
6773
|
+
export declare const SMALL_CLUSTERED: HighwaysFamily;
|
|
6774
|
+
/** The family `dense-groups`: 150 nodes in tight clusters. It is `denseGroupsBoard` at its defaults. */
|
|
6775
|
+
export declare const DENSE_GROUPS: HighwaysFamily;
|
|
6776
|
+
/** The family `hub-chain`: rows of cards in a chain, and long links between rows. At its defaults, it is `hubChainBoard`. */
|
|
6777
|
+
export declare const HUB_CHAIN: HighwaysFamily;
|
|
6778
|
+
/** The family `many-groups`: groups of cards in a grid, with links between groups. At its defaults, it is `manyGroupsBoard`. */
|
|
6779
|
+
export declare const MANY_GROUPS: HighwaysFamily;
|
|
6780
|
+
/**
|
|
6781
|
+
* The family `packed-grid`: a grid of boxes that touch. At its defaults, it is `packedGridBoard` with 12 columns, 8 rows and 48 long links.
|
|
6782
|
+
* Its generator record always has `cols`, `rows` and `long`, as the screen sets of today. It has `reach` only away from its default.
|
|
6783
|
+
*/
|
|
6784
|
+
export declare const PACKED_GRID: HighwaysFamily;
|
|
6785
|
+
/**
|
|
6786
|
+
* The corpus families of highways, in the order of the screen sets. Each family at its defaults makes the board of its screen family.
|
|
6787
|
+
* An import registers nothing. A host makes a registry with `createFamilyRegistry(HIGHWAYS_FAMILIES)`, or with the lists of other engines too.
|
|
6788
|
+
*/
|
|
6789
|
+
export declare const HIGHWAYS_FAMILIES: readonly HighwaysFamily[];
|
|
6790
|
+
/** This function gives a new registry of `HIGHWAYS_FAMILIES`. */
|
|
6791
|
+
export declare function highwaysRegistry(): FamilyRegistry$1<HighwaysBoard>;
|
|
6275
6792
|
/**
|
|
6276
6793
|
* This function gives the stretch of each route as the exact model counts it, by the edge id.
|
|
6277
6794
|
* The stretch of a route is its length without its two plug ends, divided by the shortest way in the network of the model.
|
|
@@ -6659,5 +7176,10 @@ export declare const portfolioStrategy: Strategy<"router", PortfolioRouterOption
|
|
|
6659
7176
|
* Each set comes from the train seeds (0 to 4) of its band. The base `shared` is not in a set: the portfolio always runs it first.
|
|
6660
7177
|
*/
|
|
6661
7178
|
export declare const PORTFOLIO_SETS: Readonly<Record<`${PortfolioRule}|${PortfolioCap}|${string}`, readonly string[]>>;
|
|
6662
|
-
|
|
7179
|
+
/**
|
|
7180
|
+
* The router strategy `shared-stretch` (LANE-STRETCH). It routes as `shared`, and the runs of one stretch share one lane order.
|
|
7181
|
+
* The default stretch order is `sifting`, the best order of the screen. The option `stretchOrder` selects `consensus` or `periphery`.
|
|
7182
|
+
*/
|
|
7183
|
+
export declare const sharedStretchStrategy: Strategy<"router", RouterPreset<SharedOptions>>;
|
|
7184
|
+
export { type AdvectionSettings, type AmbiguityGuardOptions, type ArcOptions, type ArcSource, type AreaOptions, type AreaWidth, type Biclique, type BreakEvenOptions, type BundleLine, type BundleOrder, type CandidateSource, type CellStep, type ClothoidOptions, type ConfluentOptions, type ConsensusLinkage, type ConsensusOptions, type CornersOptions, type CorpusDimension, type CorpusFamily, type CorridorOptions, type Crossbar, type CrossbarOptions, type CubuOptions, type CurveSpace, type CutObjective, type CutOptions, DEFAULT_RNG, type DensityGrid, type DensityImage, type DensityKernel, type DensitySource, type DiffusionOptions, type DimensionValues, type DividedOptions, type EdgeDistance, type EdgeEnds, type EdgeGroup, type EdgeLengths, type EdgePathOptions, type EdgePlugs, type ExerciseEvidence, type FamilyRegistry, type FdebOptions, type FieldEnd, type FlowClusterOptions, type FlowFieldOptions, type FollowOptions, type FrechetBundle, type FrechetOptions, type Gate, type GenerateContext, type GroupScope, type GroupSpine, type GroupedOptions, type GrowthOptions, type GrowthOrder, type HashOptions, type HdbscanOptions, type HierarchyGroups, type HierarchyOptions, type Highway, type HighwayBase, type HighwayInput, type HighwayMember, type HighwayOptions, type HighwayPlan, type HoughOptions, type HoughPeak, type HubAllocation, type HubArcOptions, type HubCandidates, type HysteresisOptions, type JogStyle, type KdAxis, type KdLine, type KdOptions, type KdeebOptions, type KeyOptions, type KeyedWay, type KeysOptions, type LaneCurve, type LanesOptions, type LevelHighwayOptions, type LinkCommunityOptions, type LinkEdge, type Linkage, type MeetOptions, type Member, type MemberStatus, type MemberTrace, type MeshOptions, type MingleOptions, type MlsFit, type MlsebOptions, type ModuleRule, type NestedOptions, type NodeKey, type NodeLinks, type OdCellOptions, type OutputGroup, type PHubOptions, type ParamValue, type PathStep, type PickSpec, type Portfolio, type PortfolioKey, type PortfolioLevel, type PortfolioOptions, type PortfolioPick, type PortfolioTrace, type PowerOptions, type QuickBundlesOptions, RECORD_EPS, type ResistanceOptions, type Ridge, type RidgeOptions, type RidgeSource, type RoadClassOptions, type RoomBends, type RoundedOptions, type RouteCrossing, type RouteSegment, type SbebOptions, type ScaleCluster, type ScaleSpaceOptions, type SectionsOptions, type SelectCandidate, type SelectLevel, type SelectOptions, type Selection, type ShapeSkeleton, type ShareCost, type ShareMerge, type ShareOrder, type SharedOptions, type SharedStretchOptions, type SharedWaysOptions, type SkeletonGroups, type SkeletonTarget, type SmoothOptions, type SnapLine, type SnapMember, type SnapOptions, type SoftKeyOptions, type SpectralOptions, type SpiralNode, type SpiralOptions, type SplineOptions, type SplitCell, type StableIdOptions, type StretchOptions, type StubEnds, type StubOptions, type TerritoryOptions, type TerritoryPoints, type TraceOptions, type TraclusOptions, type TrafficRule, type TrunkFan, type TrunkSplit, type TrunksOptions, type WeiszfeldOptions, type WspdOptions, type Zip, type ZipLimits, type ZipperOptions, canonicalJson, compareMeasure, createFamilyRegistry, dimensionAt, dimensionUnit, exercised, familyKind, levelsOf, minEffectOf, outputGroups, outputHash, paramProblem, pickMoves, portfolio, randomInt, selectBest, sha256Hex };
|
|
6663
7185
|
//# sourceMappingURL=index.d.ts.map
|