@tscircuit/capacity-autorouter 0.0.55 → 0.0.57
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 +51 -38
- package/dist/index.js +811 -167
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -101,6 +101,7 @@ declare class BaseSolver {
|
|
|
101
101
|
activeSubSolver?: BaseSolver | null;
|
|
102
102
|
failedSubSolvers?: BaseSolver[];
|
|
103
103
|
timeToSolve?: number;
|
|
104
|
+
stats: Record<string, number>;
|
|
104
105
|
/** DO NOT OVERRIDE! Override _step() instead */
|
|
105
106
|
step(): void;
|
|
106
107
|
_step(): void;
|
|
@@ -616,6 +617,7 @@ declare class HyperParameterSupervisorSolver<T extends BaseSolver> extends BaseS
|
|
|
616
617
|
computeH(solver: T): number;
|
|
617
618
|
computeF(g: number, h: number): number;
|
|
618
619
|
getSupervisedSolverWithBestFitness(): SupervisedSolver<T> | null;
|
|
620
|
+
getFailureMessage(): string;
|
|
619
621
|
_step(): void;
|
|
620
622
|
onSolve(solver: SupervisedSolver<T>): void;
|
|
621
623
|
visualize(): GraphicsObject;
|
|
@@ -1387,9 +1389,10 @@ interface CapacityPathingSingleSectionPathingSolverParams {
|
|
|
1387
1389
|
endNodeId: CapacityMeshNodeId;
|
|
1388
1390
|
}>;
|
|
1389
1391
|
colorMap?: Record<string, string>;
|
|
1392
|
+
centerNodeId: string;
|
|
1390
1393
|
hyperParameters?: CpssPathingSolverHyperParameters;
|
|
1391
1394
|
}
|
|
1392
|
-
declare class
|
|
1395
|
+
declare class CapacityPathingSingleSectionSolver extends BaseSolver {
|
|
1393
1396
|
GREEDY_MULTIPLIER: number;
|
|
1394
1397
|
sectionNodes: CapacityMeshNode[];
|
|
1395
1398
|
sectionEdges: CapacityMeshEdge[];
|
|
@@ -1403,6 +1406,7 @@ declare class CapacityPathingSingleSectionPathingSolver extends BaseSolver {
|
|
|
1403
1406
|
nodeEdgeMap: Map<CapacityMeshNodeId, CapacityMeshEdge[]>;
|
|
1404
1407
|
colorMap: Record<string, string>;
|
|
1405
1408
|
usedNodeCapacityMap: Map<CapacityMeshNodeId, number>;
|
|
1409
|
+
centerNodeId: string;
|
|
1406
1410
|
MAX_CANDIDATES_IN_MEMORY: number;
|
|
1407
1411
|
currentConnectionIndex: number;
|
|
1408
1412
|
candidates?: Array<Candidate> | null;
|
|
@@ -1428,50 +1432,50 @@ declare class CapacityPathingSingleSectionPathingSolver extends BaseSolver {
|
|
|
1428
1432
|
doesNodeHaveCapacityForTrace(node: CapacityMeshNode, prevNode: CapacityMeshNode | null): boolean;
|
|
1429
1433
|
reduceCapacityAlongPath(path: CapacityMeshNode[]): void;
|
|
1430
1434
|
_step(): void;
|
|
1435
|
+
computeProgress(): number;
|
|
1431
1436
|
private _setupAStar;
|
|
1432
1437
|
private _handleCandidatesExhausted;
|
|
1433
1438
|
private _handleGoalReached;
|
|
1434
1439
|
visualize(): GraphicsObject;
|
|
1435
1440
|
}
|
|
1441
|
+
declare const CapacityPathingSingleSectionPathingSolver: typeof CapacityPathingSingleSectionSolver;
|
|
1442
|
+
type CapacityPathingSingleSectionPathingSolver = InstanceType<typeof CapacityPathingSingleSectionSolver>;
|
|
1436
1443
|
|
|
1437
|
-
|
|
1438
|
-
|
|
1439
|
-
|
|
1440
|
-
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
|
|
1444
|
-
|
|
1445
|
-
|
|
1446
|
-
|
|
1447
|
-
|
|
1448
|
-
|
|
1449
|
-
|
|
1450
|
-
|
|
1451
|
-
nodeEdgeMap: Map<CapacityMeshNodeId, CapacityMeshEdge[]>;
|
|
1452
|
-
expansionDegrees: number;
|
|
1453
|
-
colorMap: Record<string, string>;
|
|
1454
|
-
sectionNodes: CapacityMeshNode[];
|
|
1455
|
-
sectionEdges: CapacityMeshEdge[];
|
|
1456
|
-
sectionConnectionTerminals: Array<{
|
|
1444
|
+
declare class HyperCapacityPathingSingleSectionSolver extends HyperParameterSupervisorSolver<CapacityPathingSingleSectionPathingSolver> {
|
|
1445
|
+
constructorParams: CapacityPathingSingleSectionPathingSolverParams;
|
|
1446
|
+
winningSolver?: CapacityPathingSingleSectionPathingSolver;
|
|
1447
|
+
constructor(params: ConstructorParameters<typeof CapacityPathingSingleSectionPathingSolver>[0]);
|
|
1448
|
+
computeG(solver: CapacityPathingSingleSectionPathingSolver): number;
|
|
1449
|
+
computeH(solver: CapacityPathingSingleSectionPathingSolver): number;
|
|
1450
|
+
getCombinationDefs(): Array<Array<string>> | null;
|
|
1451
|
+
getFailureMessage(): string;
|
|
1452
|
+
getHyperParameterDefs(): Array<HyperParameterDef>;
|
|
1453
|
+
generateSolver(hyperParameters: any): CapacityPathingSingleSectionPathingSolver;
|
|
1454
|
+
onSolve({ solver, }: SupervisedSolver<CapacityPathingSingleSectionPathingSolver>): void;
|
|
1455
|
+
get centerNodeId(): string;
|
|
1456
|
+
get sectionNodes(): CapacityMeshNode[];
|
|
1457
|
+
get sectionConnectionTerminals(): {
|
|
1457
1458
|
connectionName: string;
|
|
1458
1459
|
startNodeId: CapacityMeshNodeId;
|
|
1459
1460
|
endNodeId: CapacityMeshNodeId;
|
|
1460
|
-
|
|
1461
|
-
|
|
1462
|
-
|
|
1463
|
-
|
|
1464
|
-
|
|
1465
|
-
|
|
1466
|
-
|
|
1467
|
-
|
|
1468
|
-
|
|
1469
|
-
|
|
1470
|
-
|
|
1471
|
-
|
|
1472
|
-
|
|
1461
|
+
path?: CapacityMeshNode[];
|
|
1462
|
+
}[] | undefined;
|
|
1463
|
+
}
|
|
1464
|
+
|
|
1465
|
+
interface SectionConnectionTerminal {
|
|
1466
|
+
connectionName: string;
|
|
1467
|
+
startNodeId: CapacityMeshNodeId;
|
|
1468
|
+
endNodeId: CapacityMeshNodeId;
|
|
1469
|
+
path?: CapacityMeshNode[];
|
|
1470
|
+
}
|
|
1471
|
+
interface CapacityPathingSection {
|
|
1472
|
+
centerNodeId: string;
|
|
1473
|
+
sectionConnectionTerminals: SectionConnectionTerminal[];
|
|
1474
|
+
sectionNodes: CapacityMeshNode[];
|
|
1475
|
+
sectionEdges: CapacityMeshEdge[];
|
|
1473
1476
|
}
|
|
1474
1477
|
|
|
1478
|
+
type CapacityMeshEdgeId = string;
|
|
1475
1479
|
/**
|
|
1476
1480
|
* This solver solves for capacity paths by first solving with negative
|
|
1477
1481
|
* capacities allowed, then re-solving problematic sections with a section
|
|
@@ -1481,6 +1485,7 @@ declare class CapacityPathingMultiSectionSolver extends BaseSolver {
|
|
|
1481
1485
|
simpleRouteJson: SimpleRouteJson;
|
|
1482
1486
|
nodes: CapacityMeshNode[];
|
|
1483
1487
|
edges: CapacityMeshEdge[];
|
|
1488
|
+
nodeEdgeMap: Map<CapacityMeshEdgeId, CapacityMeshEdge[]>;
|
|
1484
1489
|
connectionsWithNodes: Array<ConnectionPathWithNodes>;
|
|
1485
1490
|
colorMap: Record<string, string>;
|
|
1486
1491
|
initialSolver: CapacityPathingGreedySolver;
|
|
@@ -1490,11 +1495,18 @@ declare class CapacityPathingMultiSectionSolver extends BaseSolver {
|
|
|
1490
1495
|
totalNodeCapacityMap: Map<CapacityMeshNodeId, number>;
|
|
1491
1496
|
nodeCapacityPercentMap: Map<CapacityMeshNodeId, number>;
|
|
1492
1497
|
nodeOptimizationAttemptCountMap: Map<CapacityMeshNodeId, number>;
|
|
1493
|
-
|
|
1498
|
+
currentSection: CapacityPathingSection | null;
|
|
1499
|
+
sectionSolver?: CapacityPathingSingleSectionSolver | HyperCapacityPathingSingleSectionSolver | null;
|
|
1494
1500
|
MAX_ATTEMPTS_PER_NODE: number;
|
|
1495
1501
|
MINIMUM_PROBABILITY_OF_FAILURE_TO_OPTIMIZE: number;
|
|
1496
1502
|
MAX_EXPANSION_DEGREES: number;
|
|
1497
|
-
|
|
1503
|
+
stats: {
|
|
1504
|
+
successfulOptimizations: number;
|
|
1505
|
+
failedOptimizations: number;
|
|
1506
|
+
};
|
|
1507
|
+
constructor(params: ConstructorParameters<typeof CapacityPathingSolver>[0] & {
|
|
1508
|
+
initialPathingSolver?: CapacityPathingGreedySolver;
|
|
1509
|
+
});
|
|
1498
1510
|
_stepInitialization(): void;
|
|
1499
1511
|
_getNextNodeToOptimize(): CapacityMeshNodeId | null;
|
|
1500
1512
|
_stepSectionOptimization(): void;
|
|
@@ -1754,7 +1766,8 @@ declare class AutoroutingPipelineSolver extends BaseSolver {
|
|
|
1754
1766
|
nodeSolver?: CapacityMeshNodeSolver;
|
|
1755
1767
|
nodeTargetMerger?: CapacityNodeTargetMerger;
|
|
1756
1768
|
edgeSolver?: CapacityMeshEdgeSolver;
|
|
1757
|
-
|
|
1769
|
+
initialPathingSolver?: CapacityPathingGreedySolver;
|
|
1770
|
+
pathingOptimizer?: CapacityPathingMultiSectionSolver;
|
|
1758
1771
|
edgeToPortSegmentSolver?: CapacityEdgeToPortSegmentSolver;
|
|
1759
1772
|
colorMap: Record<string, string>;
|
|
1760
1773
|
segmentToPointSolver?: CapacitySegmentToPointSolver;
|
|
@@ -1775,7 +1788,7 @@ declare class AutoroutingPipelineSolver extends BaseSolver {
|
|
|
1775
1788
|
connMap: ConnectivityMap;
|
|
1776
1789
|
srjWithPointPairs?: SimpleRouteJson;
|
|
1777
1790
|
capacityNodes: CapacityMeshNode[] | null;
|
|
1778
|
-
pipelineDef: (PipelineStep<typeof NetToPointPairsSolver> | PipelineStep<typeof CapacityMeshNodeSolver2_NodeUnderObstacle> | PipelineStep<typeof SingleLayerNodeMergerSolver> | PipelineStep<typeof StrawSolver> | PipelineStep<typeof CapacityMeshEdgeSolver2_NodeTreeOptimization> | PipelineStep<typeof CapacityPathingMultiSectionSolver> | PipelineStep<typeof CapacityEdgeToPortSegmentSolver> | PipelineStep<typeof CapacitySegmentToPointSolver> | PipelineStep<typeof UnravelMultiSectionSolver> | PipelineStep<typeof HighDensitySolver> | PipelineStep<typeof MultipleHighDensityRouteStitchSolver> | PipelineStep<typeof UselessViaRemovalSolver> | PipelineStep<typeof MultiSimplifiedPathSolver>)[];
|
|
1791
|
+
pipelineDef: (PipelineStep<typeof NetToPointPairsSolver> | PipelineStep<typeof CapacityMeshNodeSolver2_NodeUnderObstacle> | PipelineStep<typeof SingleLayerNodeMergerSolver> | PipelineStep<typeof StrawSolver> | PipelineStep<typeof CapacityMeshEdgeSolver2_NodeTreeOptimization> | 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>)[];
|
|
1779
1792
|
constructor(srj: SimpleRouteJson, opts?: CapacityMeshSolverOptions);
|
|
1780
1793
|
currentPipelineStepIndex: number;
|
|
1781
1794
|
_step(): void;
|