Skip to content

Commit

Permalink
Insert a very small chance of resetting entirely upon discard in orde…
Browse files Browse the repository at this point in the history
…r to shift out of bad solutions. Will want tuning.
  • Loading branch information
robsimmons committed Nov 17, 2023
1 parent e4abbce commit 4752989
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/datalog/choiceengine.ts
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,10 @@ export function stepTreeRandomDFS(
case 'discard': {
// Return only as far as possible
stats.deadEnds += 1;
return cleanPath(path);
const result = cleanPath(path);
if (result.tree === null || result.path.length === 0) return result;
if (Math.random() > 0.01) return result;
return { tree: result.path[0][0], path: [] };
}

default:
Expand Down

0 comments on commit 4752989

Please sign in to comment.