-
Notifications
You must be signed in to change notification settings - Fork 194
Open
Description
When I create a pathfinder that uses both blocked and distance, the blocked always gets ignored.
Am I doing something wrong?
graph.addLink("shopA","liftA",{weight:10, wheelchair: true});
graph.addLink("liftA","liftB",{weight:1, wheelchair: true});
graph.addLink("liftB","shopB",{weight:10, wheelchair: true});
graph.addLink("shopA","stairsA",{weight:5, wheelchair: true});
graph.addLink("stairsA","stairsB",{weight:1, wheelchair: false});
graph.addLink("stairsB","shopB",{weight:5, wheelchair: true});
let pathFinder_wc = ngraphPath.aStar(graph, {
blocked(fromNode, toNode, link) {
return !link.data.wheelchair;
},
distance(fromNode, toNode, link) {
return link.data.weight;
},
});
let path = pathFinder_wc.find("shopA","shopB");
path always returns the shortest regardless of stairsA -> stairsB is wheelchair false
Metadata
Metadata
Assignees
Labels
No labels