@tscircuit/capacity-autorouter 0.0.137 → 0.0.139
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/dist/index.d.ts +293 -29
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -191,7 +191,7 @@ declare class TargetTree {
|
|
|
191
191
|
getTargetsInArea(centerX: number, centerY: number, width: number, height: number): Target$1[];
|
|
192
192
|
}
|
|
193
193
|
|
|
194
|
-
interface CapacityMeshNodeSolverOptions$
|
|
194
|
+
interface CapacityMeshNodeSolverOptions$2 {
|
|
195
195
|
capacityDepth?: number;
|
|
196
196
|
}
|
|
197
197
|
interface Target {
|
|
@@ -208,7 +208,7 @@ interface Target {
|
|
|
208
208
|
}
|
|
209
209
|
declare class CapacityMeshNodeSolver extends BaseSolver {
|
|
210
210
|
srj: SimpleRouteJson;
|
|
211
|
-
opts: CapacityMeshNodeSolverOptions$
|
|
211
|
+
opts: CapacityMeshNodeSolverOptions$2;
|
|
212
212
|
unfinishedNodes: CapacityMeshNode[];
|
|
213
213
|
finishedNodes: CapacityMeshNode[];
|
|
214
214
|
nodeToXYOverlappingObstaclesMap: Map<CapacityMeshNodeId, Obstacle[]>;
|
|
@@ -218,7 +218,7 @@ declare class CapacityMeshNodeSolver extends BaseSolver {
|
|
|
218
218
|
targets: Target[];
|
|
219
219
|
targetTree: TargetTree;
|
|
220
220
|
obstacleTree: ObstacleSpatialHashIndex;
|
|
221
|
-
constructor(srj: SimpleRouteJson, opts?: CapacityMeshNodeSolverOptions$
|
|
221
|
+
constructor(srj: SimpleRouteJson, opts?: CapacityMeshNodeSolverOptions$2);
|
|
222
222
|
computeTargets(): Target[];
|
|
223
223
|
protected getNodeBounds(node: CapacityMeshNode): {
|
|
224
224
|
minX: number;
|
|
@@ -265,12 +265,12 @@ declare class CapacityMeshNodeSolver extends BaseSolver {
|
|
|
265
265
|
visualize(): GraphicsObject;
|
|
266
266
|
}
|
|
267
267
|
|
|
268
|
-
interface CapacityMeshNodeSolverOptions {
|
|
268
|
+
interface CapacityMeshNodeSolverOptions$1 {
|
|
269
269
|
capacityDepth?: number;
|
|
270
270
|
}
|
|
271
271
|
declare class CapacityMeshNodeSolver2_NodeUnderObstacle extends CapacityMeshNodeSolver {
|
|
272
272
|
srj: SimpleRouteJson;
|
|
273
|
-
opts: CapacityMeshNodeSolverOptions;
|
|
273
|
+
opts: CapacityMeshNodeSolverOptions$1;
|
|
274
274
|
VIA_DIAMETER: number;
|
|
275
275
|
OBSTACLE_MARGIN: number;
|
|
276
276
|
/**
|
|
@@ -278,7 +278,7 @@ declare class CapacityMeshNodeSolver2_NodeUnderObstacle extends CapacityMeshNode
|
|
|
278
278
|
* covered by obstacles to be considered "under an obstacle"
|
|
279
279
|
*/
|
|
280
280
|
OVERLAP_THRESHOLD_FOR_SINGLE_LAYER_NODES: number;
|
|
281
|
-
constructor(srj: SimpleRouteJson, opts?: CapacityMeshNodeSolverOptions);
|
|
281
|
+
constructor(srj: SimpleRouteJson, opts?: CapacityMeshNodeSolverOptions$1);
|
|
282
282
|
isNodeCompletelyOutsideBounds(node: CapacityMeshNode): boolean;
|
|
283
283
|
isNodePartiallyOutsideBounds(node: CapacityMeshNode): boolean;
|
|
284
284
|
/**
|
|
@@ -1427,21 +1427,21 @@ interface CapacityHyperParameters {
|
|
|
1427
1427
|
MAX_CAPACITY_FACTOR: number;
|
|
1428
1428
|
}
|
|
1429
1429
|
|
|
1430
|
-
type Candidate$
|
|
1431
|
-
prevCandidate: Candidate$
|
|
1430
|
+
type Candidate$2 = {
|
|
1431
|
+
prevCandidate: Candidate$2 | null;
|
|
1432
1432
|
node: CapacityMeshNode;
|
|
1433
1433
|
f: number;
|
|
1434
1434
|
g: number;
|
|
1435
1435
|
h: number;
|
|
1436
1436
|
};
|
|
1437
|
-
type ConnectionPathWithNodes = {
|
|
1437
|
+
type ConnectionPathWithNodes$1 = {
|
|
1438
1438
|
connection: SimpleRouteConnection;
|
|
1439
1439
|
nodes: CapacityMeshNode[];
|
|
1440
1440
|
path?: CapacityMeshNode[];
|
|
1441
1441
|
straightLineDistance: number;
|
|
1442
1442
|
};
|
|
1443
1443
|
declare class CapacityPathingSolver extends BaseSolver {
|
|
1444
|
-
connectionsWithNodes: Array<ConnectionPathWithNodes>;
|
|
1444
|
+
connectionsWithNodes: Array<ConnectionPathWithNodes$1>;
|
|
1445
1445
|
usedNodeCapacityMap: Map<CapacityMeshNodeId, number>;
|
|
1446
1446
|
simpleRouteJson: SimpleRouteJson;
|
|
1447
1447
|
nodes: CapacityMeshNode[];
|
|
@@ -1479,11 +1479,11 @@ declare class CapacityPathingSolver extends BaseSolver {
|
|
|
1479
1479
|
connectionNameToGoalNodeIds: Map<string, string[]>;
|
|
1480
1480
|
};
|
|
1481
1481
|
currentConnectionIndex: number;
|
|
1482
|
-
candidates?: Array<Candidate$
|
|
1482
|
+
candidates?: Array<Candidate$2> | null;
|
|
1483
1483
|
visitedNodes?: Set<CapacityMeshNodeId> | null;
|
|
1484
|
-
computeG(prevCandidate: Candidate$
|
|
1485
|
-
computeH(prevCandidate: Candidate$
|
|
1486
|
-
getBacktrackedPath(candidate: Candidate$
|
|
1484
|
+
computeG(prevCandidate: Candidate$2, node: CapacityMeshNode, endGoal: CapacityMeshNode): number;
|
|
1485
|
+
computeH(prevCandidate: Candidate$2, node: CapacityMeshNode, endGoal: CapacityMeshNode): number;
|
|
1486
|
+
getBacktrackedPath(candidate: Candidate$2): CapacityMeshNode[];
|
|
1487
1487
|
getNeighboringNodes(node: CapacityMeshNode): CapacityMeshNode[];
|
|
1488
1488
|
getCapacityPaths(): CapacityPath[];
|
|
1489
1489
|
doesNodeHaveCapacityForTrace(node: CapacityMeshNode, prevNode: CapacityMeshNode): boolean;
|
|
@@ -1513,8 +1513,8 @@ declare class CapacityPathingSolver5 extends CapacityPathingSolver {
|
|
|
1513
1513
|
* To minimize shortest path, you'd want to comment this out.
|
|
1514
1514
|
*/
|
|
1515
1515
|
getDistanceBetweenNodes(A: CapacityMeshNode, B: CapacityMeshNode): number;
|
|
1516
|
-
computeG(prevCandidate: Candidate$
|
|
1517
|
-
computeH(prevCandidate: Candidate$
|
|
1516
|
+
computeG(prevCandidate: Candidate$2, node: CapacityMeshNode, endGoal: CapacityMeshNode): number;
|
|
1517
|
+
computeH(prevCandidate: Candidate$2, node: CapacityMeshNode, endGoal: CapacityMeshNode): number;
|
|
1518
1518
|
}
|
|
1519
1519
|
|
|
1520
1520
|
declare class CapacityPathingGreedySolver extends CapacityPathingSolver5 {
|
|
@@ -1522,8 +1522,8 @@ declare class CapacityPathingGreedySolver extends CapacityPathingSolver5 {
|
|
|
1522
1522
|
getNodeCapacityPenalty(node: CapacityMeshNode): number;
|
|
1523
1523
|
}
|
|
1524
1524
|
|
|
1525
|
-
type Candidate = {
|
|
1526
|
-
prevCandidate: Candidate | null;
|
|
1525
|
+
type Candidate$1 = {
|
|
1526
|
+
prevCandidate: Candidate$1 | null;
|
|
1527
1527
|
node: CapacityMeshNode;
|
|
1528
1528
|
f: number;
|
|
1529
1529
|
g: number;
|
|
@@ -1566,7 +1566,7 @@ declare class CapacityPathingSingleSectionSolver extends BaseSolver {
|
|
|
1566
1566
|
private currentSectionScore;
|
|
1567
1567
|
MAX_CANDIDATES_IN_MEMORY: number;
|
|
1568
1568
|
currentConnectionIndex: number;
|
|
1569
|
-
candidates?: Array<Candidate> | null;
|
|
1569
|
+
candidates?: Array<Candidate$1> | null;
|
|
1570
1570
|
visitedNodes?: Set<CapacityMeshNodeId> | null;
|
|
1571
1571
|
queuedNodes?: Set<CapacityMeshNodeId> | null;
|
|
1572
1572
|
activeCandidateStraightLineDistance?: number;
|
|
@@ -1580,10 +1580,10 @@ declare class CapacityPathingSingleSectionSolver extends BaseSolver {
|
|
|
1580
1580
|
getTotalCapacity(node: CapacityMeshNode): number;
|
|
1581
1581
|
getNodeCapacityPenalty(node: CapacityMeshNode): number;
|
|
1582
1582
|
getDistanceBetweenNodes(A: CapacityMeshNode, B: CapacityMeshNode): number;
|
|
1583
|
-
computeG(prevCandidate: Candidate, node: CapacityMeshNode, endGoal: CapacityMeshNode): number;
|
|
1584
|
-
computeH(prevCandidate: Candidate, // prevCandidate not strictly needed here
|
|
1583
|
+
computeG(prevCandidate: Candidate$1, node: CapacityMeshNode, endGoal: CapacityMeshNode): number;
|
|
1584
|
+
computeH(prevCandidate: Candidate$1, // prevCandidate not strictly needed here
|
|
1585
1585
|
node: CapacityMeshNode, endGoal: CapacityMeshNode): number;
|
|
1586
|
-
getBacktrackedPath(candidate: Candidate): CapacityMeshNode[];
|
|
1586
|
+
getBacktrackedPath(candidate: Candidate$1): CapacityMeshNode[];
|
|
1587
1587
|
getNeighboringNodes(node: CapacityMeshNode): CapacityMeshNode[];
|
|
1588
1588
|
isConnectedToEndGoal(node: CapacityMeshNode, endGoal: CapacityMeshNode): boolean;
|
|
1589
1589
|
doesNodeHaveCapacityForTrace(node: CapacityMeshNode, prevNode: CapacityMeshNode | null): boolean;
|
|
@@ -1644,7 +1644,7 @@ declare class CapacityPathingMultiSectionSolver extends BaseSolver {
|
|
|
1644
1644
|
nodes: CapacityMeshNode[];
|
|
1645
1645
|
edges: CapacityMeshEdge[];
|
|
1646
1646
|
nodeEdgeMap: Map<CapacityMeshEdgeId, CapacityMeshEdge[]>;
|
|
1647
|
-
connectionsWithNodes: Array<ConnectionPathWithNodes>;
|
|
1647
|
+
connectionsWithNodes: Array<ConnectionPathWithNodes$1>;
|
|
1648
1648
|
colorMap: Record<string, string>;
|
|
1649
1649
|
initialSolver: CapacityPathingGreedySolver;
|
|
1650
1650
|
cacheProvider?: CacheProvider | null;
|
|
@@ -1970,12 +1970,12 @@ declare class UselessViaRemovalSolver extends BaseSolver {
|
|
|
1970
1970
|
visualize(): GraphicsObject;
|
|
1971
1971
|
}
|
|
1972
1972
|
|
|
1973
|
-
interface CapacityMeshSolverOptions {
|
|
1973
|
+
interface CapacityMeshSolverOptions$1 {
|
|
1974
1974
|
capacityDepth?: number;
|
|
1975
1975
|
targetMinCapacity?: number;
|
|
1976
1976
|
cacheProvider?: CacheProvider | null;
|
|
1977
1977
|
}
|
|
1978
|
-
type PipelineStep<T extends new (...args: any[]) => BaseSolver> = {
|
|
1978
|
+
type PipelineStep$1<T extends new (...args: any[]) => BaseSolver> = {
|
|
1979
1979
|
solverName: string;
|
|
1980
1980
|
solverClass: T;
|
|
1981
1981
|
getConstructorParams: (instance: AutoroutingPipelineSolver) => ConstructorParameters<T>;
|
|
@@ -1983,7 +1983,7 @@ type PipelineStep<T extends new (...args: any[]) => BaseSolver> = {
|
|
|
1983
1983
|
};
|
|
1984
1984
|
declare class AutoroutingPipelineSolver extends BaseSolver {
|
|
1985
1985
|
srj: SimpleRouteJson;
|
|
1986
|
-
opts: CapacityMeshSolverOptions;
|
|
1986
|
+
opts: CapacityMeshSolverOptions$1;
|
|
1987
1987
|
netToPointPairsSolver?: NetToPointPairsSolver;
|
|
1988
1988
|
nodeSolver?: CapacityMeshNodeSolver;
|
|
1989
1989
|
nodeTargetMerger?: CapacityNodeTargetMerger;
|
|
@@ -2013,8 +2013,8 @@ declare class AutoroutingPipelineSolver extends BaseSolver {
|
|
|
2013
2013
|
capacityNodes: CapacityMeshNode[] | null;
|
|
2014
2014
|
capacityEdges: CapacityMeshEdge[] | null;
|
|
2015
2015
|
cacheProvider: CacheProvider | null;
|
|
2016
|
-
pipelineDef: (PipelineStep<typeof NetToPointPairsSolver> | PipelineStep<typeof CapacityMeshNodeSolver2_NodeUnderObstacle> | PipelineStep<typeof SingleLayerNodeMergerSolver> | PipelineStep<typeof StrawSolver> | PipelineStep<typeof CapacityMeshEdgeSolver2_NodeTreeOptimization> | PipelineStep<typeof DeadEndSolver> | PipelineStep<typeof CapacityPathingGreedySolver> | PipelineStep<typeof CapacityPathingMultiSectionSolver> | PipelineStep<typeof CapacityEdgeToPortSegmentSolver> | PipelineStep<typeof CapacitySegmentToPointSolver> | PipelineStep<typeof UnravelMultiSectionSolver> | PipelineStep<typeof HighDensitySolver> | PipelineStep<typeof MultipleHighDensityRouteStitchSolver> | PipelineStep<typeof UselessViaRemovalSolver> | PipelineStep<typeof MultiSimplifiedPathSolver>)[];
|
|
2017
|
-
constructor(srj: SimpleRouteJson, opts?: CapacityMeshSolverOptions);
|
|
2016
|
+
pipelineDef: (PipelineStep$1<typeof NetToPointPairsSolver> | PipelineStep$1<typeof CapacityMeshNodeSolver2_NodeUnderObstacle> | PipelineStep$1<typeof SingleLayerNodeMergerSolver> | PipelineStep$1<typeof StrawSolver> | PipelineStep$1<typeof CapacityMeshEdgeSolver2_NodeTreeOptimization> | PipelineStep$1<typeof DeadEndSolver> | PipelineStep$1<typeof CapacityPathingGreedySolver> | PipelineStep$1<typeof CapacityPathingMultiSectionSolver> | PipelineStep$1<typeof CapacityEdgeToPortSegmentSolver> | PipelineStep$1<typeof CapacitySegmentToPointSolver> | PipelineStep$1<typeof UnravelMultiSectionSolver> | PipelineStep$1<typeof HighDensitySolver> | PipelineStep$1<typeof MultipleHighDensityRouteStitchSolver> | PipelineStep$1<typeof UselessViaRemovalSolver> | PipelineStep$1<typeof MultiSimplifiedPathSolver>)[];
|
|
2017
|
+
constructor(srj: SimpleRouteJson, opts?: CapacityMeshSolverOptions$1);
|
|
2018
2018
|
currentPipelineStepIndex: number;
|
|
2019
2019
|
_step(): void;
|
|
2020
2020
|
solveUntilPhase(phase: string): void;
|
|
@@ -2171,6 +2171,270 @@ declare function getGlobalLocalStorageCache(): LocalStorageCache;
|
|
|
2171
2171
|
declare function getGlobalInMemoryCache(): InMemoryCache;
|
|
2172
2172
|
declare function setupGlobalCaches(): void;
|
|
2173
2173
|
|
|
2174
|
+
interface CapacityMeshNodeSolverOptions {
|
|
2175
|
+
capacityDepth?: number;
|
|
2176
|
+
}
|
|
2177
|
+
/**
|
|
2178
|
+
* This capacity mesh node solver is meant to be used in contexts where vias
|
|
2179
|
+
* aren't allowed, but there may be assignable vias on the PCB as obstacles.
|
|
2180
|
+
*
|
|
2181
|
+
* Behavior:
|
|
2182
|
+
* - Outside obstacles, multi-layer nodes are *always* Z-split into single-layer nodes.
|
|
2183
|
+
* - Inside an "assignable" obstacle (obstacle.netIsAssignable === true), we keep
|
|
2184
|
+
* exactly *one* multi-layer node (capacity ~ 1 via region), i.e. we do not Z-split it.
|
|
2185
|
+
* Further nodes completely inside the same assignable obstacle will be Z-split (one per layer).
|
|
2186
|
+
* - Single-layer nodes that are larger than MAX_SIZE_FOR_SINGLE_LAYER_NODES are XY-subdivided.
|
|
2187
|
+
* - IMPORTANT: the single multi-layer node inside an assignable obstacle is **traversable**,
|
|
2188
|
+
* so we mark `_containsObstacle = false` and `_completelyInsideObstacle = false` on it.
|
|
2189
|
+
*/
|
|
2190
|
+
declare class CapacityMeshNodeSolver_OnlyTraverseLayersInAssignableObstacles extends CapacityMeshNodeSolver2_NodeUnderObstacle {
|
|
2191
|
+
srj: SimpleRouteJson;
|
|
2192
|
+
opts: CapacityMeshNodeSolverOptions;
|
|
2193
|
+
MAX_SIZE_FOR_SINGLE_LAYER_NODES: number;
|
|
2194
|
+
constructor(srj: SimpleRouteJson, opts?: CapacityMeshNodeSolverOptions);
|
|
2195
|
+
private isObstacleAssignable;
|
|
2196
|
+
private getOverlappingAssignableObstacles;
|
|
2197
|
+
private isNodeCompletelyInsideSpecificObstacle;
|
|
2198
|
+
private getAssignableContainer;
|
|
2199
|
+
shouldNodeBeXYSubdivided(node: CapacityMeshNode): boolean;
|
|
2200
|
+
/**
|
|
2201
|
+
* Multi-layer nodes are filtered unless they are completely inside an
|
|
2202
|
+
* assignable obstacle (the single allowed via region per obstacle).
|
|
2203
|
+
* Single-layer nodes use the standard relaxed single-layer filtering.
|
|
2204
|
+
*/
|
|
2205
|
+
shouldFilterNodeForObstacle(node: CapacityMeshNode): boolean;
|
|
2206
|
+
_step(): void;
|
|
2207
|
+
}
|
|
2208
|
+
|
|
2209
|
+
/**
|
|
2210
|
+
* Variant of SingleLayerNodeMergerSolver that only merges nodes containing targets.
|
|
2211
|
+
* Nodes without targets are passed through unchanged.
|
|
2212
|
+
*/
|
|
2213
|
+
declare class SingleLayerNodeMergerSolver_OnlyMergeTargets extends BaseSolver {
|
|
2214
|
+
nodeMap: Map<CapacityMeshNodeId, CapacityMeshNode>;
|
|
2215
|
+
currentBatchNodeIds: CapacityMeshNodeId[];
|
|
2216
|
+
absorbedNodeIds: Set<CapacityMeshNodeId>;
|
|
2217
|
+
nextBatchNodeIds: CapacityMeshNodeId[];
|
|
2218
|
+
batchHadModifications: boolean;
|
|
2219
|
+
hasComputedAdjacentNodeIds: boolean;
|
|
2220
|
+
newNodes: CapacityMeshNode[];
|
|
2221
|
+
constructor(nodes: CapacityMeshNode[]);
|
|
2222
|
+
computeAdjacentNodeIdsForFirstBatch(nodes: CapacityMeshNode[]): void;
|
|
2223
|
+
getAdjacentSameLayerUnprocessedNodes(rootNode: CapacityMeshNode): CapacityMeshNode[];
|
|
2224
|
+
_step(): void;
|
|
2225
|
+
visualize(): GraphicsObject;
|
|
2226
|
+
}
|
|
2227
|
+
|
|
2228
|
+
/**
|
|
2229
|
+
* This solver merges nodes that represent the same assignable obstacle into a single node.
|
|
2230
|
+
*
|
|
2231
|
+
* For each assignable obstacle:
|
|
2232
|
+
* - Finds all nodes that have _assignedViaObstacle pointing to that obstacle
|
|
2233
|
+
* - Replaces them with a single node representing the bounding box of all removed nodes
|
|
2234
|
+
* - Each step handles one assignable obstacle
|
|
2235
|
+
*/
|
|
2236
|
+
declare class AssignableViaNodeMergerSolver extends BaseSolver {
|
|
2237
|
+
newNodes: CapacityMeshNode[];
|
|
2238
|
+
obstacleToNodesMap: Map<Obstacle, CapacityMeshNode[]>;
|
|
2239
|
+
obstaclesToProcess: Obstacle[];
|
|
2240
|
+
mergedNodeIds: Set<CapacityMeshNodeId>;
|
|
2241
|
+
constructor(nodes: CapacityMeshNode[]);
|
|
2242
|
+
_step(): void;
|
|
2243
|
+
visualize(): GraphicsObject;
|
|
2244
|
+
}
|
|
2245
|
+
|
|
2246
|
+
type Candidate = {
|
|
2247
|
+
prevCandidate: Candidate | null;
|
|
2248
|
+
node: CapacityMeshNode;
|
|
2249
|
+
f: number;
|
|
2250
|
+
g: number;
|
|
2251
|
+
h: number;
|
|
2252
|
+
};
|
|
2253
|
+
type AssignableViaCapacityHyperParameters = Partial<CapacityHyperParameters> & {
|
|
2254
|
+
SHUFFLE_SEED?: number;
|
|
2255
|
+
DIRECTIVE_SEED?: number;
|
|
2256
|
+
FORCE_VIA_TRAVEL_CHANCE?: number;
|
|
2257
|
+
FAR_VIA_MIN_DISTANCE?: number;
|
|
2258
|
+
MAX_CLOSEST_VIA_SKIP?: number;
|
|
2259
|
+
MAX_FURTHEST_VIA_SKIP?: number;
|
|
2260
|
+
};
|
|
2261
|
+
type ConnectionNodePair = {
|
|
2262
|
+
start: CapacityMeshNode;
|
|
2263
|
+
end: CapacityMeshNode;
|
|
2264
|
+
connection: SimpleRouteConnection;
|
|
2265
|
+
};
|
|
2266
|
+
type SubpathNodePair = {
|
|
2267
|
+
start: CapacityMeshNode;
|
|
2268
|
+
end: CapacityMeshNode;
|
|
2269
|
+
solved: boolean;
|
|
2270
|
+
path?: CapacityMeshNode[];
|
|
2271
|
+
layer: number;
|
|
2272
|
+
};
|
|
2273
|
+
type ConnectionPathWithNodes = {
|
|
2274
|
+
connection: SimpleRouteConnection;
|
|
2275
|
+
path: CapacityMeshNode[];
|
|
2276
|
+
};
|
|
2277
|
+
/**
|
|
2278
|
+
* See description in the prompt
|
|
2279
|
+
*/
|
|
2280
|
+
declare class AssignableViaCapacityPathingSolver_DirectiveSubOptimal extends BaseSolver {
|
|
2281
|
+
private inputParams;
|
|
2282
|
+
/**
|
|
2283
|
+
* Bias toward greedier choices (f = g + GREEDY_MULTIPLIER * h)
|
|
2284
|
+
*/
|
|
2285
|
+
GREEDY_MULTIPLIER: number;
|
|
2286
|
+
simpleRouteJson: SimpleRouteJson;
|
|
2287
|
+
nodes: CapacityMeshNode[];
|
|
2288
|
+
edges: CapacityMeshEdge[];
|
|
2289
|
+
colorMap: Record<string, string>;
|
|
2290
|
+
MAX_ITERATIONS: number;
|
|
2291
|
+
hyperParameters: Partial<AssignableViaCapacityHyperParameters>;
|
|
2292
|
+
usedNodeMap: Map<CapacityMeshNodeId, true>;
|
|
2293
|
+
nodeMap: Map<CapacityMeshNodeId, CapacityMeshNode>;
|
|
2294
|
+
nodeEdgeMap: Map<CapacityMeshNodeId, CapacityMeshEdge[]>;
|
|
2295
|
+
unprocessedConnectionPairs: ConnectionNodePair[];
|
|
2296
|
+
solvedRoutes: ConnectionPathWithNodes[];
|
|
2297
|
+
activeConnectionPair: ConnectionNodePair | null;
|
|
2298
|
+
ogUnprocessedSubpaths: SubpathNodePair[] | null;
|
|
2299
|
+
unprocessedSubpaths: SubpathNodePair[] | null;
|
|
2300
|
+
solvedSubpaths: SubpathNodePair[] | null;
|
|
2301
|
+
activeSubpath: SubpathNodePair | null;
|
|
2302
|
+
viaNodes: CapacityMeshNode[];
|
|
2303
|
+
closestViaForConnectionStartMap: Map<ConnectionNodePair, CapacityMeshNode>;
|
|
2304
|
+
closestViaForConnectionEndMap: Map<ConnectionNodePair, CapacityMeshNode>;
|
|
2305
|
+
constructor(inputParams: {
|
|
2306
|
+
simpleRouteJson: SimpleRouteJson;
|
|
2307
|
+
nodes: CapacityMeshNode[];
|
|
2308
|
+
edges: CapacityMeshEdge[];
|
|
2309
|
+
colorMap?: Record<string, string>;
|
|
2310
|
+
MAX_ITERATIONS?: number;
|
|
2311
|
+
hyperParameters?: Partial<AssignableViaCapacityHyperParameters>;
|
|
2312
|
+
});
|
|
2313
|
+
getConstructorParams(): typeof this.inputParams;
|
|
2314
|
+
lastStepOperation: "none" | "dequeueConnectionPair" | "breakConnectionPairIntoSubpaths" | "dequeueSubpath" | "stepSolveSubpath" | "finishedSolvingSubpath" | "finishedSolvingConnectionPair";
|
|
2315
|
+
/**
|
|
2316
|
+
* Computes and stores the closest via for both start and end of each unprocessed connection pair.
|
|
2317
|
+
* This is used to ensure we don't "steal" a via that's closest to another connection.
|
|
2318
|
+
*/
|
|
2319
|
+
computeClosestViaForAllConnections(): void;
|
|
2320
|
+
_step(): void;
|
|
2321
|
+
queuedCandidateNodes: Candidate[];
|
|
2322
|
+
visitedNodes: Set<CapacityMeshNodeId>;
|
|
2323
|
+
private _dist;
|
|
2324
|
+
stepSolveSubpath(subpath: SubpathNodePair): void;
|
|
2325
|
+
getNeighbors(node: CapacityMeshNode): CapacityMeshNode[];
|
|
2326
|
+
clearCandidateNodes(): void;
|
|
2327
|
+
computeG(prevCandidate: Candidate, node: CapacityMeshNode, _endGoal: CapacityMeshNode): number;
|
|
2328
|
+
computeH(_prevCandidate: Candidate, node: CapacityMeshNode, endGoal: CapacityMeshNode): number;
|
|
2329
|
+
createSolvedRoute(subpaths: SubpathNodePair[], connectionPair: ConnectionNodePair): ConnectionPathWithNodes;
|
|
2330
|
+
breakConnectionPairIntoSubpaths(connectionPair: ConnectionNodePair): SubpathNodePair[];
|
|
2331
|
+
getClosestVia(node: CapacityMeshNode): CapacityMeshNode;
|
|
2332
|
+
getFarVia(closestVia: CapacityMeshNode, end: CapacityMeshNode): CapacityMeshNode;
|
|
2333
|
+
getCapacityPaths(): CapacityPath[];
|
|
2334
|
+
visualize(): GraphicsObject;
|
|
2335
|
+
}
|
|
2336
|
+
|
|
2337
|
+
type AssignableViaCapacityPathingParams = ConstructorParameters<typeof AssignableViaCapacityPathingSolver_DirectiveSubOptimal>[0];
|
|
2338
|
+
type HyperParameterOverrides = Partial<CapacityHyperParameters> & {
|
|
2339
|
+
TRACE_ORDERING_SEED?: number;
|
|
2340
|
+
LAYER_TRAVERSAL_REWARD?: number;
|
|
2341
|
+
};
|
|
2342
|
+
declare class HyperAssignableViaCapacityPathingSolver extends HyperParameterSupervisorSolver<AssignableViaCapacityPathingSolver_DirectiveSubOptimal> {
|
|
2343
|
+
constructorParams: AssignableViaCapacityPathingParams;
|
|
2344
|
+
constructor(opts: AssignableViaCapacityPathingParams);
|
|
2345
|
+
getHyperParameterDefs(): ({
|
|
2346
|
+
name: string;
|
|
2347
|
+
possibleValues: {
|
|
2348
|
+
SHUFFLE_SEED: number;
|
|
2349
|
+
}[];
|
|
2350
|
+
} | {
|
|
2351
|
+
name: string;
|
|
2352
|
+
possibleValues: {
|
|
2353
|
+
FORCE_VIA_TRAVEL_CHANCE: number;
|
|
2354
|
+
}[];
|
|
2355
|
+
})[];
|
|
2356
|
+
computeG(solver: AssignableViaCapacityPathingSolver_DirectiveSubOptimal): number;
|
|
2357
|
+
computeH(solver: AssignableViaCapacityPathingSolver_DirectiveSubOptimal): number;
|
|
2358
|
+
generateSolver(hyperParameters: HyperParameterOverrides): AssignableViaCapacityPathingSolver_DirectiveSubOptimal;
|
|
2359
|
+
}
|
|
2360
|
+
|
|
2361
|
+
interface CapacityMeshSolverOptions {
|
|
2362
|
+
capacityDepth?: number;
|
|
2363
|
+
targetMinCapacity?: number;
|
|
2364
|
+
cacheProvider?: CacheProvider | null;
|
|
2365
|
+
}
|
|
2366
|
+
type AutoroutingPipelineSolverOptions = CapacityMeshSolverOptions;
|
|
2367
|
+
type PipelineStep<T extends new (...args: any[]) => BaseSolver> = {
|
|
2368
|
+
solverName: string;
|
|
2369
|
+
solverClass: T;
|
|
2370
|
+
getConstructorParams: (instance: AssignableViaAutoroutingPipelineSolver) => ConstructorParameters<T>;
|
|
2371
|
+
onSolved?: (instance: AssignableViaAutoroutingPipelineSolver) => void;
|
|
2372
|
+
};
|
|
2373
|
+
declare class AssignableViaAutoroutingPipelineSolver extends BaseSolver {
|
|
2374
|
+
srj: SimpleRouteJson;
|
|
2375
|
+
opts: CapacityMeshSolverOptions;
|
|
2376
|
+
netToPointPairsSolver?: NetToPointPairsSolver;
|
|
2377
|
+
nodeSolver?: CapacityMeshNodeSolver;
|
|
2378
|
+
nodeTargetMerger?: CapacityNodeTargetMerger;
|
|
2379
|
+
edgeSolver?: CapacityMeshEdgeSolver;
|
|
2380
|
+
initialPathingSolver?: AssignableViaCapacityPathingSolver_DirectiveSubOptimal;
|
|
2381
|
+
initialPathingHyperSolver?: HyperAssignableViaCapacityPathingSolver;
|
|
2382
|
+
pathingOptimizer?: CapacityPathingMultiSectionSolver;
|
|
2383
|
+
edgeToPortSegmentSolver?: CapacityEdgeToPortSegmentSolver;
|
|
2384
|
+
colorMap: Record<string, string>;
|
|
2385
|
+
segmentToPointSolver?: CapacitySegmentToPointSolver;
|
|
2386
|
+
unravelMultiSectionSolver?: UnravelMultiSectionSolver;
|
|
2387
|
+
segmentToPointOptimizer?: CapacitySegmentPointOptimizer;
|
|
2388
|
+
highDensityRouteSolver?: HighDensitySolver;
|
|
2389
|
+
highDensityStitchSolver?: MultipleHighDensityRouteStitchSolver;
|
|
2390
|
+
singleLayerNodeMerger?: SingleLayerNodeMergerSolver_OnlyMergeTargets;
|
|
2391
|
+
mergeAssignableViaNodes?: AssignableViaNodeMergerSolver;
|
|
2392
|
+
strawSolver?: StrawSolver;
|
|
2393
|
+
deadEndSolver?: DeadEndSolver;
|
|
2394
|
+
uselessViaRemovalSolver1?: UselessViaRemovalSolver;
|
|
2395
|
+
uselessViaRemovalSolver2?: UselessViaRemovalSolver;
|
|
2396
|
+
multiSimplifiedPathSolver1?: MultiSimplifiedPathSolver;
|
|
2397
|
+
multiSimplifiedPathSolver2?: MultiSimplifiedPathSolver;
|
|
2398
|
+
startTimeOfPhase: Record<string, number>;
|
|
2399
|
+
endTimeOfPhase: Record<string, number>;
|
|
2400
|
+
timeSpentOnPhase: Record<string, number>;
|
|
2401
|
+
activeSubSolver?: BaseSolver | null;
|
|
2402
|
+
connMap: ConnectivityMap;
|
|
2403
|
+
srjWithPointPairs?: SimpleRouteJson;
|
|
2404
|
+
capacityNodes: CapacityMeshNode[] | null;
|
|
2405
|
+
capacityEdges: CapacityMeshEdge[] | null;
|
|
2406
|
+
cacheProvider: CacheProvider | null;
|
|
2407
|
+
pipelineDef: (PipelineStep<typeof NetToPointPairsSolver> | PipelineStep<typeof CapacityMeshNodeSolver_OnlyTraverseLayersInAssignableObstacles> | PipelineStep<typeof AssignableViaNodeMergerSolver> | PipelineStep<typeof SingleLayerNodeMergerSolver_OnlyMergeTargets> | PipelineStep<typeof CapacityMeshEdgeSolver2_NodeTreeOptimization> | PipelineStep<typeof DeadEndSolver> | PipelineStep<typeof HyperAssignableViaCapacityPathingSolver> | PipelineStep<typeof CapacityEdgeToPortSegmentSolver> | PipelineStep<typeof CapacitySegmentToPointSolver> | PipelineStep<typeof UnravelMultiSectionSolver> | PipelineStep<typeof HighDensitySolver> | PipelineStep<typeof MultipleHighDensityRouteStitchSolver> | PipelineStep<typeof UselessViaRemovalSolver> | PipelineStep<typeof MultiSimplifiedPathSolver>)[];
|
|
2408
|
+
constructor(srj: SimpleRouteJson, opts?: CapacityMeshSolverOptions);
|
|
2409
|
+
currentPipelineStepIndex: number;
|
|
2410
|
+
_step(): void;
|
|
2411
|
+
solveUntilPhase(phase: string): void;
|
|
2412
|
+
getCurrentPhase(): string;
|
|
2413
|
+
visualize(): GraphicsObject;
|
|
2414
|
+
/**
|
|
2415
|
+
* A lightweight version of the visualize method that can be used to stream
|
|
2416
|
+
* progress
|
|
2417
|
+
*
|
|
2418
|
+
* We return the most relevant graphic for the stage:
|
|
2419
|
+
* 1. netToPointPairs output
|
|
2420
|
+
* 2. Capacity Planning Output
|
|
2421
|
+
* 3. High Density Route Solver Output, max 200 lines
|
|
2422
|
+
*/
|
|
2423
|
+
preview(): GraphicsObject;
|
|
2424
|
+
/**
|
|
2425
|
+
* Get original connection name from connection name with MST suffix
|
|
2426
|
+
* @param mstConnectionName The MST-suffixed connection name (e.g. "connection1_mst0")
|
|
2427
|
+
* @returns The original connection name (e.g. "connection1")
|
|
2428
|
+
*/
|
|
2429
|
+
private getOriginalConnectionName;
|
|
2430
|
+
_getOutputHdRoutes(): HighDensityRoute$1[];
|
|
2431
|
+
/**
|
|
2432
|
+
* Returns the SimpleRouteJson with routes converted to SimplifiedPcbTraces
|
|
2433
|
+
*/
|
|
2434
|
+
getOutputSimplifiedPcbTraces(): SimplifiedPcbTraces;
|
|
2435
|
+
getOutputSimpleRouteJson(): SimpleRouteJson;
|
|
2436
|
+
}
|
|
2437
|
+
|
|
2174
2438
|
declare const convertSrjToGraphicsObject: (srj: SimpleRouteJson) => {
|
|
2175
2439
|
rects: Rect[];
|
|
2176
2440
|
circles: Circle[];
|
|
@@ -2178,4 +2442,4 @@ declare const convertSrjToGraphicsObject: (srj: SimpleRouteJson) => {
|
|
|
2178
2442
|
points: Point$3[];
|
|
2179
2443
|
};
|
|
2180
2444
|
|
|
2181
|
-
export { AutoroutingPipelineSolver, type CachableSolver, type CacheProvider, CapacityMeshSolver, InMemoryCache, LocalStorageCache, calculateOptimalCapacityDepth, convertSrjToGraphicsObject, getGlobalInMemoryCache, getGlobalLocalStorageCache, getTunedTotalCapacity1, setupGlobalCaches };
|
|
2445
|
+
export { AssignableViaAutoroutingPipelineSolver, AutoroutingPipelineSolver, type AutoroutingPipelineSolverOptions, type CachableSolver, type CacheProvider, CapacityMeshSolver, InMemoryCache, LocalStorageCache, calculateOptimalCapacityDepth, convertSrjToGraphicsObject, getGlobalInMemoryCache, getGlobalLocalStorageCache, getTunedTotalCapacity1, setupGlobalCaches };
|