@mark1russell7/highways 0.9.0 → 0.9.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +69 -1
- package/build/index.d.ts +420 -9
- package/build/index.d.ts.map +1 -1
- package/build/index.js +4361 -2002
- package/build/index.js.map +1 -1
- package/package.json +2 -2
- package/src/bench/compare.ts +13 -1
- package/src/bench/measures/curves.ts +55 -1
- package/src/bench/measures/groups.ts +71 -0
- package/src/bench/measures/index.ts +1 -0
- package/src/bench/measures/levels.ts +24 -0
- package/src/bench/measures/room.ts +106 -1
- package/src/bench/measures/symmetry.ts +114 -0
- package/src/bench/screen/exercise.ts +5 -0
- package/src/bench/screen/forms.ts +14 -3
- package/src/bench/screen/measures.ts +40 -3
- package/src/bench/screen/screen.ts +40 -5
- package/src/bench/suite.ts +10 -2
- package/src/highways/fixtures.test-util.ts +13 -0
- package/src/highways/follow.ts +3 -2
- package/src/highways/free-lines.ts +141 -0
- package/src/highways/gaps/index.ts +85 -0
- package/src/highways/index.ts +6 -0
- package/src/highways/interchanges/index.ts +231 -0
- package/src/highways/search/index.ts +170 -0
- package/src/highways/snap.ts +4 -2
- package/src/highways/steiner/index.ts +215 -0
- package/src/highways/streets/index.ts +78 -0
- package/src/model.ts +127 -4
- package/src/routers/attraction/index.ts +61 -0
- package/src/routers/corners.ts +15 -8
- package/src/routers/frames.ts +136 -0
- package/src/routers/index.ts +3 -1
- package/src/routers/plugs.ts +3 -2
- package/src/routers/sections.ts +3 -2
- package/src/routers/shared.ts +70 -7
- package/src/routers/straight.ts +3 -2
- package/src/routers/trunks.ts +3 -2
- package/src/strategies/builtins.ts +56 -1
- package/src/strategies/schemas.ts +69 -0
package/build/index.d.ts
CHANGED
|
@@ -83,7 +83,8 @@ export declare function segmentBounds(a: Point, b: Point): Box;
|
|
|
83
83
|
export type Side = "north" | "east" | "south" | "west";
|
|
84
84
|
/**
|
|
85
85
|
* A plug of a node: a place where edges go into the node.
|
|
86
|
-
* A plug with `at` is fixed. The router does not move it. A plug
|
|
86
|
+
* A plug with `at` is fixed. The router does not move it. A plug with `side` and `along` is fixed too.
|
|
87
|
+
* Another plug is free: the router places it.
|
|
87
88
|
*/
|
|
88
89
|
export interface Port {
|
|
89
90
|
readonly id: string;
|
|
@@ -91,6 +92,12 @@ export interface Port {
|
|
|
91
92
|
readonly at?: Point;
|
|
92
93
|
/** This side is where a free plug goes. Without it, the router picks the side. */
|
|
93
94
|
readonly side?: Side;
|
|
95
|
+
/**
|
|
96
|
+
* This fraction from 0 to 1 fixes the plug on its `side`. The plug is at the side start plus `along` times the side length.
|
|
97
|
+
* The start of `north` and `south` is the left end. The start of `east` and `west` is the top end.
|
|
98
|
+
* A plug with `along` needs a `side` and has no `at`. `resolvePorts` throws a `RangeError` for a bad value.
|
|
99
|
+
*/
|
|
100
|
+
readonly along?: number;
|
|
94
101
|
}
|
|
95
102
|
/** A node: a box that routes must not go through. */
|
|
96
103
|
export interface Node {
|
|
@@ -99,6 +106,12 @@ export interface Node {
|
|
|
99
106
|
readonly ports?: readonly Port[];
|
|
100
107
|
/** This data is free for the grouping rules of the nodes. The rule `keys` reads the string `data.group` by default. */
|
|
101
108
|
readonly data?: Readonly<Record<string, unknown>>;
|
|
109
|
+
/**
|
|
110
|
+
* This id names the frame node that holds the node. A frame is a node that another node names as its parent.
|
|
111
|
+
* An edge from a plug of a frame to a node in the frame is an inner edge (`splitFrames`). The router `corners` routes it inside the frame.
|
|
112
|
+
* A parent that names no node, or a cycle of parents, makes each router throw a `RangeError`.
|
|
113
|
+
*/
|
|
114
|
+
readonly parent?: string;
|
|
102
115
|
}
|
|
103
116
|
/** One end of an edge: a node, and optionally one plug of that node. */
|
|
104
117
|
export interface End {
|
|
@@ -121,6 +134,8 @@ export interface Graph {
|
|
|
121
134
|
export interface Route {
|
|
122
135
|
readonly edge: string;
|
|
123
136
|
readonly points: readonly Point[];
|
|
137
|
+
/** This id names the frame of an inner route: the route stays inside the box of that node. An outer route has no frame. */
|
|
138
|
+
readonly frame?: string;
|
|
124
139
|
}
|
|
125
140
|
/**
|
|
126
141
|
* One zoom level of a result. Each shown item is a node or a group of nodes.
|
|
@@ -190,8 +205,46 @@ export interface Router {
|
|
|
190
205
|
}
|
|
191
206
|
/** This function gives a map from the id of each node to the node. */
|
|
192
207
|
export declare function nodeIndex(g: Graph): Map<string, Node>;
|
|
193
|
-
/**
|
|
208
|
+
/**
|
|
209
|
+
* This function gives the place of a fixed plug, relative to the top-left corner of the node box, or `undefined` for a free plug.
|
|
210
|
+
* A plug with `at` gives `at`. A plug with `side` and `along` gives the point of `portPoint` of `@mark1russell7/layout-contract`.
|
|
211
|
+
*/
|
|
212
|
+
export declare function portOffset(box: Box, port: Port): Point | undefined;
|
|
213
|
+
/** This function throws a `RangeError` when the `along` of a plug is bad: not finite, outside 0 to 1, without `side` or with `at`. */
|
|
214
|
+
export declare function checkPort(node: Node, port: Port): void;
|
|
215
|
+
/**
|
|
216
|
+
* This function checks the plugs of a graph, and gives each plug with `side` and `along` a fixed `at`. The plug keeps its `side`.
|
|
217
|
+
* Each router calls it at the start of `route`, so all routers agree. A graph without `along` comes back as the same object.
|
|
218
|
+
* It throws a `RangeError` for a bad `along` (`checkPort`).
|
|
219
|
+
*/
|
|
220
|
+
export declare function resolvePorts(graph: Graph): Graph;
|
|
221
|
+
/** This function gives the absolute place of a fixed plug, or `undefined` for a free plug or no plug. A plug with `side` and `along` is fixed. */
|
|
194
222
|
export declare function fixedPortPoint(node: Node, end: End): Point | undefined;
|
|
223
|
+
/**
|
|
224
|
+
* An inner edge: an edge from a plug of a frame to a node in that frame, at any depth.
|
|
225
|
+
* `plug` tells which end of the edge is the plug of the frame.
|
|
226
|
+
*/
|
|
227
|
+
export interface InnerEdge {
|
|
228
|
+
readonly edge: Edge;
|
|
229
|
+
readonly frame: string;
|
|
230
|
+
readonly plug: "source" | "target";
|
|
231
|
+
}
|
|
232
|
+
/** This function throws a `RangeError` when the parent of a node names no node, or when the parents of a node make a cycle. */
|
|
233
|
+
export declare function checkParents(graph: Graph, byId?: ReadonlyMap<string, Node>): void;
|
|
234
|
+
/**
|
|
235
|
+
* This function checks the parents of a graph (`checkParents`), and takes its inner edges out.
|
|
236
|
+
* An inner edge of the frame F has a plug of F (`End.port`) at one end. F holds the node at the other end.
|
|
237
|
+
* The graph that it gives keeps each node and the other edges. A graph without `parent` comes back as the same object, with no inner edge.
|
|
238
|
+
*/
|
|
239
|
+
export declare function splitFrames(graph: Graph): {
|
|
240
|
+
readonly graph: Graph;
|
|
241
|
+
readonly inner: readonly InnerEdge[];
|
|
242
|
+
};
|
|
243
|
+
/**
|
|
244
|
+
* This function gives the graph of a router without frames. It has the plugs of `resolvePorts`, and no inner edges (`splitFrames`).
|
|
245
|
+
* Each router except `corners` uses it at the start of `route`. So an inner edge gets no route from such a router.
|
|
246
|
+
*/
|
|
247
|
+
export declare function outerGraph(graph: Graph): Graph;
|
|
195
248
|
/** This function gives a seeded random source with values in [0, 1) (mulberry32). */
|
|
196
249
|
export declare function rng(seed: number): () => number;
|
|
197
250
|
/**
|
|
@@ -1560,10 +1613,29 @@ export declare function getStrategy<S extends Step>(registry: Registry, step: S,
|
|
|
1560
1613
|
export declare function asRouter<O extends object>(strategy: Strategy<"router", O>, options?: Partial<O>): Router;
|
|
1561
1614
|
/** This function gives the router strategies of a registry as `Router` objects, in order. The benchmark races them. */
|
|
1562
1615
|
export declare function routersOf(registry: Registry): Router[];
|
|
1616
|
+
/**
|
|
1617
|
+
* The rule for a node box that is not fully inside the box of its frame.
|
|
1618
|
+
* With `throw`, the router throws a `RangeError`. With `skip`, the node is not an obstacle, and its inner edges get no route.
|
|
1619
|
+
* With `clamp`, the router cuts the box to the bounds of the frame.
|
|
1620
|
+
*/
|
|
1621
|
+
type Outside = "throw" | "skip" | "clamp";
|
|
1622
|
+
/** The options of the inner routes: the options of the way finder, the rule `outside` and the inset `frameInset`. */
|
|
1623
|
+
interface FrameOptions extends WayOptions {
|
|
1624
|
+
/** The rule for a node box outside the box of its frame. The default is `throw`. */
|
|
1625
|
+
readonly outside?: Outside;
|
|
1626
|
+
/** The distance from the walls of a frame to the bounds of its inner routes. The default is the margin of the router. */
|
|
1627
|
+
readonly frameInset?: number;
|
|
1628
|
+
}
|
|
1629
|
+
/**
|
|
1630
|
+
* This function gives the inner routes of the inner edges (`splitFrames`). Each route stays in the bounds of its frame:
|
|
1631
|
+
* the box of the frame, smaller by `frameInset`. It goes around the other nodes of the frame.
|
|
1632
|
+
* It leaves the plug of the frame into the frame, along the normal of the wall. Each route has the id of its frame in `frame`.
|
|
1633
|
+
*/
|
|
1634
|
+
export declare function frameRoutes(graph: Graph, inner: readonly InnerEdge[], options: FrameOptions): Route[];
|
|
1563
1635
|
/** The ways to place a free plug of the corner router. */
|
|
1564
1636
|
type PlugPlace = "facing" | "side";
|
|
1565
1637
|
/** The options of the corner router. */
|
|
1566
|
-
interface CornersOptions extends
|
|
1638
|
+
interface CornersOptions extends FrameOptions {
|
|
1567
1639
|
/** The name in the benchmark. */
|
|
1568
1640
|
readonly name: string;
|
|
1569
1641
|
/** The benchmark skips a fixture with more nodes. */
|
|
@@ -1590,6 +1662,7 @@ interface CornersOptions extends WayOptions {
|
|
|
1590
1662
|
* This function makes a router that goes around the nodes.
|
|
1591
1663
|
* Each edge leaves its plug along the normal of the side. It goes a shortest way (A*) through a sparse visibility graph
|
|
1592
1664
|
* of the box corners, without the needless corners. It enters the target plug along its normal.
|
|
1665
|
+
* An inner edge (`splitFrames`) gets an inner route in the bounds of its frame (`frameRoutes`), after the outer routes.
|
|
1593
1666
|
*/
|
|
1594
1667
|
export declare function cornersRouter(options: CornersOptions): Router;
|
|
1595
1668
|
/**
|
|
@@ -1771,13 +1844,58 @@ interface SharedOptions extends WayOptions {
|
|
|
1771
1844
|
/** The benchmark skips a fixture with more nodes. */
|
|
1772
1845
|
readonly maxNodes?: number;
|
|
1773
1846
|
}
|
|
1847
|
+
/**
|
|
1848
|
+
* The negotiation of the router `attraction` (HWY-044, PathFinder turned around). Each pass routes each edge again from no ways.
|
|
1849
|
+
* A link costs `len (1 - attraction h) (1 + weight max(0, use - cap))` more than in `shared`, with `h` the history of the link.
|
|
1850
|
+
*/
|
|
1851
|
+
interface SharedNegotiation {
|
|
1852
|
+
/** The number of passes, 1 or more. */
|
|
1853
|
+
readonly passes: number;
|
|
1854
|
+
/** The pull of the history of a link, from 0 to 1. */
|
|
1855
|
+
readonly attraction: number;
|
|
1856
|
+
/** The cost weight of each edge over the capacity of a link, 0 or more. */
|
|
1857
|
+
readonly capacityWeight: number;
|
|
1858
|
+
/** The width of one lane. The capacity of a link is its free width divided by this width, and 1 or more. */
|
|
1859
|
+
readonly laneWidth: number;
|
|
1860
|
+
}
|
|
1774
1861
|
/**
|
|
1775
1862
|
* This function makes a router where edges share their ways (after Pupyrev, Nachmanson, Bereg and Holroyd, "Edge routing with ordered bundles").
|
|
1776
1863
|
* The edges go one by one through the corner graph. A link that an edge with the same key uses already costs less.
|
|
1777
1864
|
* 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
1865
|
* The result gives each stretch as a run, with the order of its lanes.
|
|
1779
1866
|
*/
|
|
1780
|
-
export declare function sharedRouter(options: SharedOptions): Router;
|
|
1867
|
+
export declare function sharedRouter(options: SharedOptions, negotiation?: SharedNegotiation): Router;
|
|
1868
|
+
/** The options of the router `attraction` (HWY-044 of the note on highways: negotiated attraction, PathFinder turned around). */
|
|
1869
|
+
interface AttractionOptions {
|
|
1870
|
+
/** The number of passes, from 1 to 10. Each pass after the first routes each edge again from no ways. The default is 3. */
|
|
1871
|
+
readonly passes: number;
|
|
1872
|
+
/** The pull `a` of the history of a link, from 0 to 1. A link then costs `1 - a h` times more. The default is 0.5. */
|
|
1873
|
+
readonly attraction: number;
|
|
1874
|
+
/** The cost weight `b` of each edge over the capacity of a link, from 0 to 10. The default is 1. */
|
|
1875
|
+
readonly capacityWeight: number;
|
|
1876
|
+
/** The width of one lane. The capacity of a link is its free width divided by this width. The default is 4. */
|
|
1877
|
+
readonly laneWidth: number;
|
|
1878
|
+
}
|
|
1879
|
+
/** The default options of the router `attraction`. */
|
|
1880
|
+
export declare const ATTRACTION_DEFAULTS: Readonly<AttractionOptions>;
|
|
1881
|
+
/** The declarations of the options of the router `attraction` (HWY-044). */
|
|
1882
|
+
export declare const ATTRACTION_SCHEMA: OptionSchema<AttractionOptions>;
|
|
1883
|
+
/**
|
|
1884
|
+
* This function makes the router `attraction` (HWY-044). It is the router `shared` with a negotiation over the passes.
|
|
1885
|
+
* After each pass, the history `h` of each link grows by `use / m`, with `m` the edges of the key. The history stops at `0.9 / a`.
|
|
1886
|
+
* In each pass, a link costs `len (1 - a h) (1 + b max(0, use - cap))` times the cost in `shared`.
|
|
1887
|
+
* The busy links of the passes before thus pull the edges, and a link over its capacity pushes them away.
|
|
1888
|
+
*/
|
|
1889
|
+
export declare function attractionRouter(options: Partial<AttractionOptions> & {
|
|
1890
|
+
readonly name: string;
|
|
1891
|
+
readonly rule?: GroupRule;
|
|
1892
|
+
readonly maxNodes?: number;
|
|
1893
|
+
}): Router;
|
|
1894
|
+
/**
|
|
1895
|
+
* The router strategy `attraction` (HWY-044), with the rule `byCollection` of `shared`. It is not a built-in router, so the benchmark and the hashes of `ROUTERS` do not change.
|
|
1896
|
+
* A screen module or a consumer adds it to a registry.
|
|
1897
|
+
*/
|
|
1898
|
+
export declare const attractionStrategy: Strategy<"router", AttractionOptions>;
|
|
1781
1899
|
/** Two items of a level that a link joins, and the count of the edges between them. */
|
|
1782
1900
|
interface ItemPair {
|
|
1783
1901
|
readonly source: string;
|
|
@@ -2865,6 +2983,22 @@ export declare function g2Defect(segments: readonly CurveSegment[], u: number):
|
|
|
2865
2983
|
* The value has no unit, and lower is better. A full circle gives `4π^2`. The cost is linear.
|
|
2866
2984
|
*/
|
|
2867
2985
|
export declare function bendingEnergy(points: readonly Point[], tolerance?: number): number;
|
|
2986
|
+
/**
|
|
2987
|
+
* This function gives the curvature variation of a sampled curve (C4 of MEAS0, Moreton 1993): `V = L^3 · ∫ (dκ/ds)^2 ds`.
|
|
2988
|
+
* Each inner sample gets the curvature `κ = φ / l` of `bendingEnergy`, with its sign. `L` is the length of the curve.
|
|
2989
|
+
* The sum is `L^3 · Σ (κ_(i+1) - κ_i)^2 / d_i`, with `d_i` the distance of two inner samples in sequence.
|
|
2990
|
+
*
|
|
2991
|
+
* The value has no unit, and lower is better. A straight line and an arc of a circle give 0. Fewer than 4 points give 0. The cost is linear.
|
|
2992
|
+
*/
|
|
2993
|
+
export declare function curvatureVariation(points: readonly Point[], tolerance?: number): number;
|
|
2994
|
+
/**
|
|
2995
|
+
* This function gives the deviation of a curve from its route (C8 of MEAS0).
|
|
2996
|
+
* The value is the Fréchet distance of the samples of the curve and the polyline of the route.
|
|
2997
|
+
* Each list gets points with no leg longer than `step`, or longer when a list has more than 400 points. Then the discrete Fréchet distance is near the true distance.
|
|
2998
|
+
*
|
|
2999
|
+
* The value is in units of the board, and lower is better. The caller divides it by the unit of the board. The cost is quadratic for each route.
|
|
3000
|
+
*/
|
|
3001
|
+
export declare function curveDeviation(samples: readonly Point[], polyline: readonly Point[], step: number): number;
|
|
2868
3002
|
/** This function tells if a polyline crosses itself. Two legs next to each other do not count. The cost is `n log n`. */
|
|
2869
3003
|
export declare function crossesItself(p: readonly Point[]): boolean;
|
|
2870
3004
|
/** This function tells if a polyline turns back on itself at a vertex: a turn of more than 179 degrees, as at a cusp. */
|
|
@@ -2927,6 +3061,18 @@ export declare function orderStability(graph: Graph, levels: readonly Level[]):
|
|
|
2927
3061
|
* The value has no unit, and lower is better. The cost is quadratic in the points of each link.
|
|
2928
3062
|
*/
|
|
2929
3063
|
export declare function linkAgreement(graph: Graph, levels: readonly Level[], routes: readonly Route[], unit: number): number | undefined;
|
|
3064
|
+
/** The level ratio of a result (Z5 of MEAS0): the largest step and the spread of the steps from level to level. */
|
|
3065
|
+
export interface LevelRatio {
|
|
3066
|
+
/** The largest `lr_d = items_(d+1) / items_d`. */
|
|
3067
|
+
readonly max: number;
|
|
3068
|
+
/** The standard deviation of `log(lr_d)` over the steps. A value of 0 is steps of equal ratio. */
|
|
3069
|
+
readonly spread: number;
|
|
3070
|
+
}
|
|
3071
|
+
/**
|
|
3072
|
+
* This function gives the level ratio of the levels (Z5 of MEAS0, Mondal 2018): `lr_d = items_(d+1) / items_d`, in the order of depth.
|
|
3073
|
+
* A level without items does not count. Fewer than 2 levels give `undefined`. Lower is better for both values. The cost is linear.
|
|
3074
|
+
*/
|
|
3075
|
+
export declare function levelRatio(levels: readonly Level[]): LevelRatio | undefined;
|
|
2930
3076
|
/** A grouping of the nodes: a map from the id of each node to the id of its group. */
|
|
2931
3077
|
export type Grouping = ReadonlyMap<string, string>;
|
|
2932
3078
|
/** This function gives the grouping of one level: each node goes to the id of its item. */
|
|
@@ -2962,6 +3108,26 @@ export declare function leafGroups(root: Section, count: number): string[];
|
|
|
2962
3108
|
* The second tree comes from the graph after a small change (`changeGraph`). The scale is -1 to 1, and higher is better.
|
|
2963
3109
|
*/
|
|
2964
3110
|
export declare function groupStability(before: Section, after: Section, count: number): number;
|
|
3111
|
+
/**
|
|
3112
|
+
* This function gives the fill of the groups of one level (G4 of MEAS0): the mean of `fill(c) = Σ_(v in c) area(box(v)) / area(box(c))`.
|
|
3113
|
+
* `box(c)` is the box of the item. Only an item with 2 or more nodes counts, and a fill above 1 counts as 1.
|
|
3114
|
+
* The scale is 0 to 1, and higher is better. A level without such an item gives `undefined`. The cost is linear.
|
|
3115
|
+
*/
|
|
3116
|
+
export declare function groupFill(graph: Graph, level: Level): number | undefined;
|
|
3117
|
+
/**
|
|
3118
|
+
* This function counts the overlaps of the items of the levels (G5 of MEAS0).
|
|
3119
|
+
* An overlap is a pair of items of one level whose boxes overlap by more than `TOLERANCE`.
|
|
3120
|
+
* It is the sum over the levels of `countOverlaps`. Lower is better. The cost is `n log n` for each level.
|
|
3121
|
+
*/
|
|
3122
|
+
export declare function itemOverlaps(levels: readonly Level[]): number;
|
|
3123
|
+
/**
|
|
3124
|
+
* This function gives the silhouette of the groups of one level (G7 of MEAS0, Rousseeuw 1987): the mean of `s(v) = (b_v - a_v) / max(a_v, b_v)`.
|
|
3125
|
+
* `a_v` is the mean distance from the center of `v` to the centers of the other nodes of its item. `b_v` is the smallest mean distance to the nodes of another item.
|
|
3126
|
+
* A node alone in its item gets `s(v) = 0`. The scale is -1 to 1, and higher is better.
|
|
3127
|
+
* A level with fewer than 2 items gives `undefined`. The cost is quadratic up to 2000 nodes.
|
|
3128
|
+
* Above 2000 nodes, a seeded sample of 2000 nodes gets `s(v)`, against a second seeded sample of 2000 nodes. Thus the value is an estimate.
|
|
3129
|
+
*/
|
|
3130
|
+
export declare function silhouette(graph: Graph, level: Level): number | undefined;
|
|
2965
3131
|
/** A small change of a graph, for the stability measures Z10 and G9 of MEAS0. */
|
|
2966
3132
|
export interface GraphChange {
|
|
2967
3133
|
/** The graph after the change. It keeps the order of the nodes. */
|
|
@@ -3005,6 +3171,21 @@ export declare function routeStability(graph: Graph, before: Result, after: Resu
|
|
|
3005
3171
|
* Two values nearer than `snap` are equal. Lower is better, and 0 is correct. Above 2000 boxes, a seeded sample of pairs gives an estimate.
|
|
3006
3172
|
*/
|
|
3007
3173
|
export declare function roomOrderFaults(before: readonly Boxed[], after: readonly Boxed[], snap?: number): number;
|
|
3174
|
+
/**
|
|
3175
|
+
* This function gives the displacement of the boxes (M3 of MEAS0, Bridgeman 2000): `mean_v dist(box_open(v), box_packed(v)) / u`.
|
|
3176
|
+
* The distance is between the centers of the two boxes of a node, and `u` is the unit of the packed board.
|
|
3177
|
+
* The value has no unit, and lower is better. A board where no box moves gives 0. The cost is linear.
|
|
3178
|
+
*/
|
|
3179
|
+
export declare function boxDisplacement(before: readonly Boxed[], after: readonly Boxed[], unit: number): number;
|
|
3180
|
+
/** The number of nearest boxes of each box that make the neighbour pairs of `distanceDistortion`. */
|
|
3181
|
+
export declare const DISTORTION_NEIGHBOURS = 4;
|
|
3182
|
+
/**
|
|
3183
|
+
* This function gives the distance distortion of the boxes (M5 of MEAS0): the Kruskal stress of the centers.
|
|
3184
|
+
* `σ = sqrt(Σ (α d'_ij - d_ij)^2 / Σ d_ij^2)`, with `d` the distance on the packed board, `d'` the distance on the open board, and `α = Σ d d' / Σ d'^2` the best scale.
|
|
3185
|
+
* The pairs are each box and its 4 nearest boxes on the packed board. The scale is 0 to 1, and lower is better.
|
|
3186
|
+
* A board that only changes its scale gives 0. The cost is `n log n` for an even density.
|
|
3187
|
+
*/
|
|
3188
|
+
export declare function distanceDistortion(before: readonly Boxed[], after: readonly Boxed[]): number;
|
|
3008
3189
|
/** One axis of a Pareto front: the key of a measure and the direction that is better. */
|
|
3009
3190
|
export interface Objective {
|
|
3010
3191
|
readonly key: string;
|
|
@@ -3181,6 +3362,17 @@ export declare function lanesThrough(graph: Graph, open: OpenLanes): number;
|
|
|
3181
3362
|
* A board without area gives 1. The cost is linear.
|
|
3182
3363
|
*/
|
|
3183
3364
|
export declare function laneArea(graph: Graph, open: OpenLanes): number;
|
|
3365
|
+
/**
|
|
3366
|
+
* This function gives the symmetry of the drawing (H3 of MEAS0). The value is the share of the routes that the best map of the board sends onto a route.
|
|
3367
|
+
* The maps are the two mirrors on the axes and the half turn. Each one goes through the center of the boxes.
|
|
3368
|
+
*
|
|
3369
|
+
* A route of the edge `(s, t)` maps when two things are true. The map sends the centers of `s` and `t` to the centers of the nodes `s'` and `t'`, within `u / 4`.
|
|
3370
|
+
* A route of an edge between `s'` and `t'` has the same corners as the mapped route, within `u / 4`. `u` is the unit of the board.
|
|
3371
|
+
*
|
|
3372
|
+
* The scale is 0 to 1, and higher is better. A router keeps the symmetry that the boxes have, or loses it. Routes without points give `undefined`.
|
|
3373
|
+
* The cost is linear in the points of the routes.
|
|
3374
|
+
*/
|
|
3375
|
+
export declare function routeSymmetry(graph: Graph, routes: readonly Route[]): number | undefined;
|
|
3184
3376
|
/** The names of the proposed hard rules of MEAS0. The suite counts them. It does not apply them as rules yet. */
|
|
3185
3377
|
export declare const PROPOSED_RULES: readonly string[];
|
|
3186
3378
|
/** The options of `runSuite`. */
|
|
@@ -3375,7 +3567,7 @@ export interface CurveRun {
|
|
|
3375
3567
|
/** The edge of each curve of `drawn`. */
|
|
3376
3568
|
readonly edges: readonly string[];
|
|
3377
3569
|
}
|
|
3378
|
-
/** This function draws the routes of a result with each curve strategy and measures the curves (C1, C2, C3, C6 and the curve rules). */
|
|
3570
|
+
/** This function draws the routes of a result with each curve strategy and measures the curves (C1, C2, C3, C4, C6, C8 and the curve rules). */
|
|
3379
3571
|
export declare function curveRuns(graph: Graph, result: Result, curves: readonly Strategy<"curve">[], options: CurveRunOptions): CurveRun[];
|
|
3380
3572
|
/** One grouping rule on one graph: the row of the suite, the tree of the rule and the result of `sections` on that tree. */
|
|
3381
3573
|
export interface GroupRun {
|
|
@@ -3844,6 +4036,8 @@ interface SnapLine {
|
|
|
3844
4036
|
interface SnapOptions extends Pick<WayOptions, "margin" | "k"> {
|
|
3845
4037
|
/** A highway has this number of edges or more. The value is 2 or more. */
|
|
3846
4038
|
readonly minSize: number;
|
|
4039
|
+
/** With `true`, a line in clear view is its own spine, with no path through the corner graph. The default is `false`. */
|
|
4040
|
+
readonly direct?: boolean;
|
|
3847
4041
|
}
|
|
3848
4042
|
/** This function gives the line `u d + rho n` of the direction angle `theta`, with `d = (cos, sin)` and the normal `n = (-sin, cos)`. */
|
|
3849
4043
|
export declare function linePoint(theta: number, rho: number, u: number): Point;
|
|
@@ -4880,6 +5074,212 @@ export declare function scaleSpaceGroups(input: HighwayInput, o: Readonly<ScaleS
|
|
|
4880
5074
|
* A short-lived cluster is noise, so a zoom level shows only the stable structure.
|
|
4881
5075
|
*/
|
|
4882
5076
|
export declare function scaleSpacePlan(input: HighwayInput, o: Readonly<ScaleSpaceOptions>): HighwayPlan;
|
|
5077
|
+
/** The source of the candidate streets: the middle lines of the gaps of the room step, or the lines through the corners. */
|
|
5078
|
+
type StreetSource = "room" | "corners";
|
|
5079
|
+
/** The values of `StreetSource`. */
|
|
5080
|
+
export declare const STREET_SOURCES: readonly StreetSource[];
|
|
5081
|
+
/** One axis-parallel street in the free space, from `a` to `b`. */
|
|
5082
|
+
interface FreeLine {
|
|
5083
|
+
readonly a: Point;
|
|
5084
|
+
readonly b: Point;
|
|
5085
|
+
}
|
|
5086
|
+
/** One edge for the streets: its two points out of its plugs, and the length of its first route. */
|
|
5087
|
+
interface StreetEdge {
|
|
5088
|
+
readonly edge: string;
|
|
5089
|
+
readonly s: Point;
|
|
5090
|
+
readonly t: Point;
|
|
5091
|
+
readonly base: number;
|
|
5092
|
+
}
|
|
5093
|
+
/** The ride of one edge on one street. It has the points where the edge joins and leaves the street, and two lengths. */
|
|
5094
|
+
interface StreetRide {
|
|
5095
|
+
readonly on: Point;
|
|
5096
|
+
readonly off: Point;
|
|
5097
|
+
/** The length on the street. */
|
|
5098
|
+
readonly ride: number;
|
|
5099
|
+
/** The length of the two ramps, to the street and from it. */
|
|
5100
|
+
readonly ramps: number;
|
|
5101
|
+
}
|
|
5102
|
+
/**
|
|
5103
|
+
* This function gives the candidate streets of a board. Each street is an axis-parallel piece of free space.
|
|
5104
|
+
* The source `room` takes the middle line of each gap of `boardGaps` that is two margins wide or more.
|
|
5105
|
+
* The source `corners` takes the lines one margin out from each side of each box.
|
|
5106
|
+
* A street is two margins long or more. The list has no copies, and its order is the same each time.
|
|
5107
|
+
*/
|
|
5108
|
+
export declare function freeLines(graph: Graph, finder: WayFinder, source: StreetSource): FreeLine[];
|
|
5109
|
+
/** This function gives the edges of the input for the streets, with the points out of their plugs and the lengths of their first routes. */
|
|
5110
|
+
export declare function streetEdges(input: HighwayInput, finder: WayFinder): StreetEdge[];
|
|
5111
|
+
/** This function gives the point of the street nearest to `p`. */
|
|
5112
|
+
export declare function streetPoint(line: FreeLine, p: Point): Point;
|
|
5113
|
+
/** This function gives the ride of an edge on a street. The edge joins the street at the point nearest to `s`, and leaves it at the point nearest to `t`. */
|
|
5114
|
+
export declare function streetRide(line: FreeLine, e: StreetEdge): StreetRide;
|
|
5115
|
+
/** The options of the highway strategy `gaps` (HWY-057 of the note on highways). */
|
|
5116
|
+
interface GapOptions {
|
|
5117
|
+
/** A street with fewer edges than this number (the demand `k`) is not a highway. The default is 3. */
|
|
5118
|
+
readonly minSize: number;
|
|
5119
|
+
/** The cost of a length on a street against a length off the streets, from 0.1 to 0.8. The default is 0.5. */
|
|
5120
|
+
readonly discount: number;
|
|
5121
|
+
/** An edge rides a street only when its way along the street is this many times its first route or less. The default is 1.3. */
|
|
5122
|
+
readonly detour: number;
|
|
5123
|
+
/** The source of the streets: the gaps of the room step, or the lines through the corners. The default is `room`. */
|
|
5124
|
+
readonly source: StreetSource;
|
|
5125
|
+
}
|
|
5126
|
+
/** The default options of the strategy `gaps`. */
|
|
5127
|
+
export declare const GAP_DEFAULTS: Readonly<GapOptions>;
|
|
5128
|
+
/**
|
|
5129
|
+
* This function gives the highways on the gaps of the board (HWY-057). The streets are the free middle lines of the gaps.
|
|
5130
|
+
* Each edge takes the street that saves it the most cost, when a length on a street costs `discount` times its length.
|
|
5131
|
+
* A street with `minSize` edges or more becomes a highway. The edges of the other streets then choose again among the highways, two times.
|
|
5132
|
+
*/
|
|
5133
|
+
export declare function gapPlan(input: HighwayInput, o: Readonly<GapOptions>): HighwayPlan;
|
|
5134
|
+
/** The plan that gives the highways of the network: the plan of `corridors` or of `shared-ways`, with their defaults. */
|
|
5135
|
+
type InterchangeBase = "corridors" | "shared-ways";
|
|
5136
|
+
/** The values of `InterchangeBase`. */
|
|
5137
|
+
export declare const INTERCHANGE_BASES: readonly InterchangeBase[];
|
|
5138
|
+
/** The options of the highway strategy `interchanges` (HWY-060 of the note on highways). */
|
|
5139
|
+
interface InterchangeOptions {
|
|
5140
|
+
/** The plan that gives the highways. The default is `corridors`. */
|
|
5141
|
+
readonly from: InterchangeBase;
|
|
5142
|
+
/** The cost of a change between two highways, in units of the board, from 0 to 8. The default is 2. */
|
|
5143
|
+
readonly changeCost: number;
|
|
5144
|
+
/** The largest number of interchanges, from 1 to 32. The default is 16. */
|
|
5145
|
+
readonly interchanges: number;
|
|
5146
|
+
/** The largest number of highways on the way of one edge, from 1 to 3. The default is 2. */
|
|
5147
|
+
readonly perEdge: number;
|
|
5148
|
+
/** Two highways get an interchange where they come this near, in units of the board. The default is 2. */
|
|
5149
|
+
readonly radius: number;
|
|
5150
|
+
/** The cost of a length on a highway against a length off the highways, from 0.1 to 1. The default is 0.5. */
|
|
5151
|
+
readonly discount: number;
|
|
5152
|
+
/** An edge rides the network only when its way is this many times its first route or less. The default is 1.5. */
|
|
5153
|
+
readonly detour: number;
|
|
5154
|
+
}
|
|
5155
|
+
/** The default options of the strategy `interchanges`. */
|
|
5156
|
+
export declare const INTERCHANGE_DEFAULTS: Readonly<InterchangeOptions>;
|
|
5157
|
+
/** One interchange: a place on the highway `h`, a place on the highway `g`, and the length of the link between the two places. */
|
|
5158
|
+
interface Interchange {
|
|
5159
|
+
readonly h: number;
|
|
5160
|
+
readonly hAt: number;
|
|
5161
|
+
readonly g: number;
|
|
5162
|
+
readonly gAt: number;
|
|
5163
|
+
readonly gap: number;
|
|
5164
|
+
}
|
|
5165
|
+
/** This function gives the candidate interchanges: the nearest places of each pair of spines that come within `radius`, with a link in clear view. */
|
|
5166
|
+
export declare function interchangeCandidates(spines: readonly (readonly Point[])[], radius: number, clear: (a: Point, b: Point) => boolean): Interchange[];
|
|
5167
|
+
/**
|
|
5168
|
+
* This function gives the highways of a network with interchanges (HWY-060). The highways come from a plan. Two highways that come near get an interchange.
|
|
5169
|
+
* Each edge takes its cheapest way: a ride on one highway, or on up to `perEdge` highways with a change at an interchange.
|
|
5170
|
+
* A change costs `changeCost` units. The interchanges that the most edges use stay, up to `interchanges`.
|
|
5171
|
+
*/
|
|
5172
|
+
export declare function interchangePlan(input: HighwayInput, o: Readonly<InterchangeOptions>): HighwayPlan;
|
|
5173
|
+
/** The options of the highway strategy `search` (HWY-059 of the note on highways). */
|
|
5174
|
+
interface SearchOptions {
|
|
5175
|
+
/** The plan where the search starts. The default is `corridors`. */
|
|
5176
|
+
readonly from: CandidateSource;
|
|
5177
|
+
/** The generators of the highways that the move `add` takes. The default is `quickbundles` and `road-classes`. */
|
|
5178
|
+
readonly pool: readonly CandidateSource[];
|
|
5179
|
+
/** The number of plans that the search measures, from 0 to 400. The value 0 gives the start plan. The default is 16. */
|
|
5180
|
+
readonly evaluations: number;
|
|
5181
|
+
/** The first temperature of the annealing, on the scale of the score. Each sweep of 4 moves multiplies it by 0.95. The default is 0.02. */
|
|
5182
|
+
readonly temperature: number;
|
|
5183
|
+
/** The weight of the ink that the routes save (B1). The default is 1. */
|
|
5184
|
+
readonly inkWeight: number;
|
|
5185
|
+
/** The weight of the 0.95 quantile of the stretch against the first routes (B3). The default is 0.5. */
|
|
5186
|
+
readonly stretchWeight: number;
|
|
5187
|
+
/** The weight of the ambiguity (B4). The default is 0.5. */
|
|
5188
|
+
readonly ambiguityWeight: number;
|
|
5189
|
+
/** The weight of the largest merge angle (B6), divided by 180 degrees. The default is 0.25. */
|
|
5190
|
+
readonly angleWeight: number;
|
|
5191
|
+
/** The seed of the moves. The default is 1. */
|
|
5192
|
+
readonly seed: number;
|
|
5193
|
+
}
|
|
5194
|
+
/** The default options of the strategy `search`. */
|
|
5195
|
+
export declare const SEARCH_DEFAULTS: Readonly<SearchOptions>;
|
|
5196
|
+
/** The moves of the search. */
|
|
5197
|
+
type SearchMove = "add" | "drop" | "edge" | "point";
|
|
5198
|
+
/** The values of `SearchMove`, in the order of the draw. */
|
|
5199
|
+
export declare const SEARCH_MOVES: readonly SearchMove[];
|
|
5200
|
+
/**
|
|
5201
|
+
* This function gives the score of the routes of a plan: `w1 B1 - w3 B3 - w4 B4 - w6 B6 / 180`. Higher is better.
|
|
5202
|
+
* B3 is the 0.95 quantile of the stretch against the first routes. The score reads only the graph and the routes of the plan.
|
|
5203
|
+
*/
|
|
5204
|
+
export declare function searchScore(graph: Graph, routes: readonly Route[], first: readonly Route[], o: Readonly<SearchOptions>): number;
|
|
5205
|
+
/**
|
|
5206
|
+
* This function gives the highways of a local search over the set of highways (HWY-059). The search starts at the plan of `from`.
|
|
5207
|
+
* Each move adds a highway of the pool, drops a highway, moves one edge to another highway, or moves one point of a spine.
|
|
5208
|
+
* The annealing keeps a worse plan with the chance `acceptance(-delta / T)`. The best plan that the search measures is the result.
|
|
5209
|
+
*
|
|
5210
|
+
* The score reads only this graph and its routes. Thus the search does not fit to the inputs of a screen.
|
|
5211
|
+
*/
|
|
5212
|
+
export declare function searchPlan(input: HighwayInput, o: Readonly<SearchOptions>): HighwayPlan;
|
|
5213
|
+
/** The groups of the trees: the edges from one source node, or the edges of one collection. */
|
|
5214
|
+
type SteinerGroup = "source" | "key";
|
|
5215
|
+
/** The values of `SteinerGroup`. */
|
|
5216
|
+
export declare const STEINER_GROUPS: readonly SteinerGroup[];
|
|
5217
|
+
/** The method of the tree: the iterated 1-Steiner method on the Hanan grid, or the spanning tree of the terminals alone. */
|
|
5218
|
+
type SteinerMethod = "one-steiner" | "spanning";
|
|
5219
|
+
/** The values of `SteinerMethod`. */
|
|
5220
|
+
export declare const STEINER_METHODS: readonly SteinerMethod[];
|
|
5221
|
+
/** The metric of the tree: rectilinear (two directions) or octilinear (four directions). */
|
|
5222
|
+
type SteinerMetric = "rectilinear" | "octilinear";
|
|
5223
|
+
/** The values of `SteinerMetric`. */
|
|
5224
|
+
export declare const STEINER_METRICS: readonly SteinerMetric[];
|
|
5225
|
+
/** The options of the highway strategy `steiner` (HWY-036 of the note on highways, with EDA-015). */
|
|
5226
|
+
interface SteinerOptions {
|
|
5227
|
+
/** The groups of the trees. The default is `source`. */
|
|
5228
|
+
readonly group: SteinerGroup;
|
|
5229
|
+
/** The method of the tree. The default is `one-steiner`. */
|
|
5230
|
+
readonly method: SteinerMethod;
|
|
5231
|
+
/** A group with more terminals than this number gets the spanning tree alone. The default is 12. */
|
|
5232
|
+
readonly maxGroup: number;
|
|
5233
|
+
/** The metric of the tree. The default is `rectilinear`. */
|
|
5234
|
+
readonly metric: SteinerMetric;
|
|
5235
|
+
/** An edge rides the tree only when its path in the tree is this many times its first route or less. The default is 1.5. */
|
|
5236
|
+
readonly detour: number;
|
|
5237
|
+
/** A stretch of a tree with fewer edges than this number is not a highway. The default is 2. */
|
|
5238
|
+
readonly minSize: number;
|
|
5239
|
+
}
|
|
5240
|
+
/** The default options of the strategy `steiner`. */
|
|
5241
|
+
export declare const STEINER_DEFAULTS: Readonly<SteinerOptions>;
|
|
5242
|
+
/** This function gives the links of the spanning tree of the points (Prim), as pairs of indices, and the sum of their lengths. */
|
|
5243
|
+
export declare function spanningTree(points: readonly Point[], metric: SteinerMetric): {
|
|
5244
|
+
links: [number, number][];
|
|
5245
|
+
cost: number;
|
|
5246
|
+
};
|
|
5247
|
+
/**
|
|
5248
|
+
* This function gives a Steiner tree of the terminals by the iterated 1-Steiner method (Kahng and Robins). The candidates are the points of the Hanan grid.
|
|
5249
|
+
* Each round adds the candidate that makes the spanning tree shortest, and drops each added point with two links or fewer.
|
|
5250
|
+
* The test `free` removes the candidates in the boxes. The result has the terminals first, then the added points.
|
|
5251
|
+
*/
|
|
5252
|
+
export declare function oneSteiner(terminals: readonly Point[], metric: SteinerMetric, free: (p: Point) => boolean): {
|
|
5253
|
+
points: Point[];
|
|
5254
|
+
links: [number, number][];
|
|
5255
|
+
};
|
|
5256
|
+
/**
|
|
5257
|
+
* This function gives the highways of obstacle-avoiding Steiner trees (HWY-036 with EDA-015). Each group of edges gets one tree over the points out of its plugs.
|
|
5258
|
+
* The links of the tree are rectilinear or octilinear, and they go around the boxes. Each edge takes its path in the tree, when that path is short enough.
|
|
5259
|
+
* The stretches of the tree that two edges or more share become highways.
|
|
5260
|
+
*/
|
|
5261
|
+
export declare function steinerPlan(input: HighwayInput, o: Readonly<SteinerOptions>): HighwayPlan;
|
|
5262
|
+
/** The options of the highway strategy `streets` (HWY-058 of the note on highways). */
|
|
5263
|
+
interface StreetOptions {
|
|
5264
|
+
/** A street covers an edge when the way of the edge along the street is this many times its first route or less (the limit `s`). The default is 1.2. */
|
|
5265
|
+
readonly detour: number;
|
|
5266
|
+
/** The greedy cover stops when the best street gives less than this gain: the length that its edges ride over the length of the street. The default is 2. */
|
|
5267
|
+
readonly minGain: number;
|
|
5268
|
+
/** The largest number of streets. The default is 32. */
|
|
5269
|
+
readonly maxStreets: number;
|
|
5270
|
+
/** A street with fewer new edges than this number is not a highway. The default is 2. */
|
|
5271
|
+
readonly minSize: number;
|
|
5272
|
+
/** The source of the streets: the gaps of the room step, or the lines through the corners. The default is `corners`. */
|
|
5273
|
+
readonly source: StreetSource;
|
|
5274
|
+
}
|
|
5275
|
+
/** The default options of the strategy `streets`. */
|
|
5276
|
+
export declare const STREET_DEFAULTS: Readonly<StreetOptions>;
|
|
5277
|
+
/**
|
|
5278
|
+
* This function gives orthogonal streets by a greedy set cover (HWY-058). A street covers each edge whose way along it is at most `detour` times its first route.
|
|
5279
|
+
* Each step takes the street with the largest gain: the length that its new edges ride, over the length of the street that they use.
|
|
5280
|
+
* The cover stops at `maxStreets` streets, or when the best gain is below `minGain`. Each edge rides one street at most.
|
|
5281
|
+
*/
|
|
5282
|
+
export declare function streetPlan(input: HighwayInput, o: Readonly<StreetOptions>): HighwayPlan;
|
|
4883
5283
|
/** The lines that make the density: the straight lines of the edges, or their first routes. */
|
|
4884
5284
|
type RidgeSource = "lines" | "routes";
|
|
4885
5285
|
/** The options of the highway strategy `ridges` (HWY-032 of the note on highways). */
|
|
@@ -5648,6 +6048,11 @@ export declare const highwayStrategies: {
|
|
|
5648
6048
|
readonly consensus: Strategy<"highway", ConsensusOptions>;
|
|
5649
6049
|
readonly "p-hub": Strategy<"highway", PHubOptions>;
|
|
5650
6050
|
readonly "scale-space": Strategy<"highway", ScaleSpaceOptions>;
|
|
6051
|
+
readonly steiner: Strategy<"highway", SteinerOptions>;
|
|
6052
|
+
readonly gaps: Strategy<"highway", GapOptions>;
|
|
6053
|
+
readonly streets: Strategy<"highway", StreetOptions>;
|
|
6054
|
+
readonly search: Strategy<"highway", SearchOptions>;
|
|
6055
|
+
readonly interchanges: Strategy<"highway", InterchangeOptions>;
|
|
5651
6056
|
readonly "corridors+breakeven": Strategy<"highway", CorridorOptions & BreakEvenOptions>;
|
|
5652
6057
|
readonly "corridors+stretch": Strategy<"highway", CorridorOptions & StretchOptions>;
|
|
5653
6058
|
readonly "corridors+ambiguity": Strategy<"highway", CorridorOptions & AmbiguityGuardOptions>;
|
|
@@ -5773,6 +6178,8 @@ export declare function highwayRouters(registry: Registry): Strategy<"router">[]
|
|
|
5773
6178
|
* - 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
6179
|
*/
|
|
5775
6180
|
export declare function stepRouterStrategy(strategy: Strategy<RoutedStep>): Strategy<"router">;
|
|
6181
|
+
/** This function gives the board of the output of a whole strategy that `stepRouterStrategy` ran, or `undefined` for another result. A room strategy can move the boxes of this board. */
|
|
6182
|
+
export declare function wholeBoard(result: Result): Graph | undefined;
|
|
5776
6183
|
/** This function gives a router for each strategy of one step of `RoutedStep` in a registry, in the order of the registry (`stepRouterStrategy`). */
|
|
5777
6184
|
export declare function stepRouters(registry: Registry, step: RoutedStep): Strategy<"router">[];
|
|
5778
6185
|
/** One strategy of any step on one graph: a row of `compareStep`, or a row of the steps `highway` and `room`. */
|
|
@@ -5837,6 +6244,8 @@ export interface LayoutPort {
|
|
|
5837
6244
|
/** The fixed place of the port, from the top-left corner of the box. The router does not move a port with `x` and `y`. */
|
|
5838
6245
|
readonly x?: number;
|
|
5839
6246
|
readonly y?: number;
|
|
6247
|
+
/** The fixed place of the port on its `side`: a fraction from 0 to 1. The start is the top end or the left end of the side. */
|
|
6248
|
+
readonly along?: number;
|
|
5840
6249
|
}
|
|
5841
6250
|
/** A point of a region: `[x, y]`. The y axis points down. */
|
|
5842
6251
|
export type RegionPoint = readonly [number, number];
|
|
@@ -6049,7 +6458,7 @@ export interface LayoutPrediction {
|
|
|
6049
6458
|
}
|
|
6050
6459
|
/**
|
|
6051
6460
|
* This function writes a graph as an input file of the form `layout-input/1`, with its hash.
|
|
6052
|
-
* A fixed plug gets `x`, `y` and the side that holds it. `inputGraph` reads the file back.
|
|
6461
|
+
* A fixed plug gets `x`, `y` and the side that holds it. A plug with `along` keeps its `side` and `along`. `inputGraph` reads the file back.
|
|
6053
6462
|
*/
|
|
6054
6463
|
export declare function graphInput(graph: Graph, head: LayoutInputHead): LayoutInput;
|
|
6055
6464
|
/**
|
|
@@ -6069,7 +6478,7 @@ export type RouteInput = Pick<LayoutInput, "id" | "boxes" | "obstacles"> & {
|
|
|
6069
6478
|
readonly edges?: LayoutInput["edges"];
|
|
6070
6479
|
};
|
|
6071
6480
|
/**
|
|
6072
|
-
* This function reads the graph of the router from an input file. The router reads the positions, the ports, the edges and the data.
|
|
6481
|
+
* This function reads the graph of the router from an input file. The router reads the positions, the ports, the parents, the edges and the data.
|
|
6073
6482
|
* Each obstacle becomes a node without edges, with the bounding box of its region, after the boxes.
|
|
6074
6483
|
* The router ignores the other fields of the packer: `container`, `gap`, `locked`, `rank`, the `shape` of a box and the `move` of an obstacle.
|
|
6075
6484
|
* A box without `x` and `y` is an error.
|
|
@@ -6127,6 +6536,8 @@ export interface MeasureInfo {
|
|
|
6127
6536
|
* A measure without this field has the threshold `RECORD_EPS`.
|
|
6128
6537
|
*/
|
|
6129
6538
|
readonly minEffect?: MinEffect;
|
|
6539
|
+
/** The definition of the measure in one or two sentences: what it counts, and when its value is good. The site shows it. */
|
|
6540
|
+
readonly definition?: string;
|
|
6130
6541
|
}
|
|
6131
6542
|
/** One rule of `MIN_EFFECTS`: the units, the minimum effect of a measure with one of these units, and the reason. */
|
|
6132
6543
|
export interface MinEffectRule {
|
|
@@ -6827,7 +7238,7 @@ interface FollowOptions extends WayOptions {
|
|
|
6827
7238
|
* The result has a shared run for each stretch of a spine where the same two edges or more go. Each run holds the points of its routes in a row.
|
|
6828
7239
|
* The same graph, plan and options give the same result.
|
|
6829
7240
|
*/
|
|
6830
|
-
export declare function follow(
|
|
7241
|
+
export declare function follow(input: Graph, plan: HighwayPlan, options?: FollowOptions): Result;
|
|
6831
7242
|
/**
|
|
6832
7243
|
* This function gives the highways of a result of a router: one highway for each shared run and for each trunk of a bundle.
|
|
6833
7244
|
* The spine is the points of the run or of the trunk. Each edge of the run is a member, from one end of the spine to the other end, in the way of its route.
|
|
@@ -7181,5 +7592,5 @@ export declare const PORTFOLIO_SETS: Readonly<Record<`${PortfolioRule}|${Portfol
|
|
|
7181
7592
|
* The default stretch order is `sifting`, the best order of the screen. The option `stretchOrder` selects `consensus` or `periphery`.
|
|
7182
7593
|
*/
|
|
7183
7594
|
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 };
|
|
7595
|
+
export { type AdvectionSettings, type AmbiguityGuardOptions, type ArcOptions, type ArcSource, type AreaOptions, type AreaWidth, type AttractionOptions, 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 FrameOptions, type FrechetBundle, type FrechetOptions, type FreeLine, type GapOptions, 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 Interchange, type InterchangeBase, type InterchangeOptions, 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 Outside, 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 SearchMove, type SearchOptions, type SectionsOptions, type SelectCandidate, type SelectLevel, type SelectOptions, type Selection, type ShapeSkeleton, type ShareCost, type ShareMerge, type ShareOrder, type SharedNegotiation, 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 SteinerGroup, type SteinerMethod, type SteinerMetric, type SteinerOptions, type StreetEdge, type StreetOptions, type StreetRide, type StreetSource, 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 };
|
|
7185
7596
|
//# sourceMappingURL=index.d.ts.map
|