Skip to content

Commit df1652e

Browse files
committed
fix(webgraph): special nodes penalty
non normal nodes are now penalized slightly so path finding avoids them unless it's really valuable to go through them or there's no other way.
1 parent 048816e commit df1652e

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

utils/webgraph.simba

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -220,8 +220,10 @@ begin
220220
q := Self.Nodes[pathIdx].Node;
221221
node.Indices := current.Indices + pathIdx;
222222

223-
hyp := Hypot(p.x-q.x, p.y-q.y);
224-
node.Score := current.Score + hyp + (hyp*Random()*Rnd-Rnd/2);
223+
hyp := Hypot(p.X-q.X, p.Y-q.Y);
224+
node.Score := current.Score + hyp + (hyp*Random()*Rnd-Rnd/2);
225+
if Self.Nodes[pathIdx].Typ <> EGraphNode.NORMAL then
226+
node.Score += 10;
225227
queue += node;
226228
end;
227229
end;

0 commit comments

Comments
 (0)