@tscircuit/capacity-autorouter 0.0.208 → 0.0.210

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 CHANGED
@@ -1209,6 +1209,29 @@ declare class AvailableSegmentPointSolver extends BaseSolver {
1209
1209
  visualize(): GraphicsObject;
1210
1210
  }
1211
1211
 
1212
+ /**
1213
+ * Precomputed parameters that can be shared across multiple PortPointPathingSolver instances.
1214
+ * These are computed once and passed to each solver to avoid redundant computation.
1215
+ */
1216
+ interface PrecomputedInitialParams {
1217
+ /** Map from nodeId to InputNodeWithPortPoints */
1218
+ nodeMap: Map<CapacityMeshNodeId, InputNodeWithPortPoints>;
1219
+ /** Average node pitch for heuristic calculations */
1220
+ avgNodePitch: number;
1221
+ /** Nodes with off-board connections */
1222
+ offBoardNodes: InputNodeWithPortPoints[];
1223
+ /** Map from portPointId to InputPortPoint */
1224
+ portPointMap: Map<string, InputPortPoint>;
1225
+ /** Map from nodeId to list of port points accessible from that node */
1226
+ nodePortPointsMap: Map<CapacityMeshNodeId, InputPortPoint[]>;
1227
+ /** Map from nodeId to assigned port points (empty initially, will be cloned per solver) */
1228
+ nodeAssignedPortPoints: Map<CapacityMeshNodeId, PortPoint[]>;
1229
+ /** Connections with results (NOT shuffled) - shuffling is done per solver */
1230
+ unshuffledConnectionsWithResults: ConnectionPathResult[];
1231
+ /** Map from connection name to goal node IDs */
1232
+ connectionNameToGoalNodeIds: Map<string, CapacityMeshNodeId[]>;
1233
+ }
1234
+
1212
1235
  interface PortPointPathingHyperParameters {
1213
1236
  SHUFFLE_SEED?: number;
1214
1237
  CENTER_OFFSET_DIST_PENALTY_FACTOR?: number;
@@ -1360,6 +1383,8 @@ declare class PortPointPathingSolver extends BaseSolver {
1360
1383
  get GREEDY_MULTIPLIER(): number;
1361
1384
  MAX_CANDIDATES_IN_MEMORY: number;
1362
1385
  get MAX_ITERATIONS_PER_PATH(): number;
1386
+ ITERATIONS_PER_MM_FOR_PATH: number;
1387
+ BASE_ITERATIONS_PER_PATH: number;
1363
1388
  get MIN_ALLOWED_BOARD_SCORE(): number;
1364
1389
  nodeMemoryPfMap: Map<CapacityMeshNodeId, number>;
1365
1390
  currentConnectionIndex: number;
@@ -1373,17 +1398,19 @@ declare class PortPointPathingSolver extends BaseSolver {
1373
1398
  avgNodePitch: number;
1374
1399
  /** Whether the current connection should be forced to route off-board */
1375
1400
  currentConnectionShouldRouteOffBoard: boolean;
1401
+ activeCandidateStraightLineDistance?: number;
1376
1402
  /** Cached list of off-board nodes for computing distance to nearest off-board node */
1377
1403
  offBoardNodes: InputNodeWithPortPoints[];
1378
1404
  /** Cache of base node cost (cost of node in current committed state) */
1379
1405
  private baseNodeCostCache;
1380
- constructor({ simpleRouteJson, inputNodes, capacityMeshNodes, colorMap, nodeMemoryPfMap, hyperParameters, }: {
1406
+ constructor({ simpleRouteJson, inputNodes, capacityMeshNodes, colorMap, nodeMemoryPfMap, hyperParameters, precomputedInitialParams, }: {
1381
1407
  simpleRouteJson: SimpleRouteJson;
1382
1408
  capacityMeshNodes: CapacityMeshNode[];
1383
1409
  inputNodes: InputNodeWithPortPoints[];
1384
1410
  colorMap?: Record<string, string>;
1385
1411
  nodeMemoryPfMap?: Map<CapacityMeshNodeId, number>;
1386
1412
  hyperParameters?: Partial<PortPointPathingHyperParameters>;
1413
+ precomputedInitialParams?: PrecomputedInitialParams;
1387
1414
  });
1388
1415
  private clearCostCaches;
1389
1416
  private clampPf;
@@ -1392,6 +1419,7 @@ declare class PortPointPathingSolver extends BaseSolver {
1392
1419
  /** Base node cost with the currently-committed port points (no candidate additions) */
1393
1420
  private getBaseNodeFailureCost;
1394
1421
  computeBoardScore(): number;
1422
+ getMaxIterationsForCurrentPath(): number;
1395
1423
  /**
1396
1424
  * Exact delta cost of routing this connection through `nodeId`
1397
1425
  * for the segment defined by entry->exit.
@@ -1507,6 +1535,7 @@ interface HyperPortPointPathingSolverParams {
1507
1535
  }
1508
1536
  declare class HyperPortPointPathingSolver extends HyperParameterSupervisorSolver<PortPointPathingSolver> {
1509
1537
  private params;
1538
+ private precomputedInitialParams;
1510
1539
  constructor(params: HyperPortPointPathingSolverParams);
1511
1540
  getHyperParameterDefs(): Array<HyperParameterDef>;
1512
1541
  getCombinationDefs(): Array<string[]>;