Skip to content

Commit

Permalink
fix pointsToConnect not properly updating with preprocess step results
Browse files Browse the repository at this point in the history
  • Loading branch information
seveibar committed Sep 15, 2024
1 parent a61afd4 commit 74c2ce7
Show file tree
Hide file tree
Showing 9 changed files with 41 additions and 4 deletions.
5 changes: 3 additions & 2 deletions algos/infinite-grid-ijump-astar/v2/lib/GeneralizedAstar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -220,14 +220,15 @@ export class GeneralizedAstarAutorouter {
}

solveConnection(connection: SimpleRouteConnection): ConnectionSolveResult {
const { pointsToConnect } = connection
if (pointsToConnect.length > 2) {
if (connection.pointsToConnect.length > 2) {
throw new Error(
"GeneralizedAstarAutorouter doesn't currently support 2+ points in a connection",
)
}
connection = this.preprocessConnectionBeforeSolving(connection)

const { pointsToConnect } = connection

this.iterations = 0
this.closedSet = new Set()
this.startNode = this.getStartNode(connection)
Expand Down
2 changes: 1 addition & 1 deletion algos/multi-layer-ijump/MultilayerIjump.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ import {
} from "autorouting-dataset/lib/solver-utils/getAlternativeGoalBoxes"

export class MultilayerIjump extends GeneralizedAstarAutorouter {
MAX_ITERATIONS: number = 200
MAX_ITERATIONS: number = 500
VIA_COST: number = 4 // Define the cost for changing layers
VIA_DIAMETER: number = 0.5
allowLayerChange: boolean = true // Flag to allow layer changes
Expand Down
1 change: 1 addition & 0 deletions algos/multi-layer-ijump/benchmark.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ await runBenchmark({
solver: autoroute,
solverName: "multi-layer-ijump",
verbose: true,
problemType: "keyboards",
})
2 changes: 2 additions & 0 deletions algos/multi-layer-ijump/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ export function autoroute(soup: AnySoupElement[]): SolutionWithDebugInfo {
const autorouter = new MultilayerIjump({
input,
connMap,
// isRemovePathLoopsEnabled: true,
optimizeWithGoalBoxes: true,
})

const solution = autorouter.solveAndMapToTraces()
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 74c2ce7

Please sign in to comment.