Skip to content

Commit

Permalink
'nother planning graph fix check interference in both directions
Browse files Browse the repository at this point in the history
  • Loading branch information
sdcondon committed Dec 16, 2022
1 parent e79cb5c commit e9963bd
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/SCClassicalPlanning/Planning/GraphPlan/PlanningGraph.cs
Original file line number Diff line number Diff line change
Expand Up @@ -282,8 +282,10 @@ private void MakeNextLevel()
{
foreach (var (otherAction, otherActionNode) in newActionLevel.Take(actionIndex))
{
// todo-performance: at first glance looks like we can do with with just one check (union effect and precond..)?
if (otherAction.Effect.Elements.Overlaps(action.Effect.Elements.Select(l => l.Negate())) // inconsistent effects
|| otherAction.Effect.Elements.Overlaps(action.Precondition.Elements.Select(l => l.Negate())) // interference
|| otherAction.Precondition.Elements.Overlaps(action.Effect.Elements.Select(l => l.Negate())) // interference the other way around
|| otherAction.Precondition.Elements.Overlaps(action.Precondition.Elements.Select(l => l.Negate()))) // competing needs
{
actionNode.Mutexes.Add(otherActionNode);
Expand Down

0 comments on commit e9963bd

Please sign in to comment.