/* foreach (var subgoal in anchor.Refinements().SelectMany(x => x.SubGoals())) { var assumption = new ObstacleNegativeAssumption { Assumed = obstacle, Implicit = true }; Propagate (assumption, subgoal); } */ static void DownPropagate(ObstacleAssumption assumption, Goal goal) { foreach (var children in goal.Refinements().SelectMany (x => x.SubGoals()).ToArray()) { Console.WriteLine ("<pre> -- " + children.FriendlyName + " -- " + assumption.Obstacle().FriendlyName); Console.WriteLine (string.Join ("\n", children.Obstacles ().Select (x => x.Identifier))); Console.WriteLine ("</pre><hr />"); if (children.Obstacles ().Select (x => x.Identifier).Contains (assumption.ResolvedObstacleIdentifier)) { var obstacleAssumption = (ObstacleAssumption) assumption.Copy (); obstacleAssumption.Identifier = Guid.NewGuid().ToString (); obstacleAssumption.SetAnchorGoal (children); children.model.Add (obstacleAssumption); DownPropagate (obstacleAssumption, children); } } /* foreach (var obstacle in goal.Obstructions()) { var obstacleAssumption = assumption.Copy (); obstacleAssumption.SetAnchorGoal (children); DownPropagate (obstacleAssumption, obstacle.Obstacle()); } */ }
protected void Render(ObstacleAssumption exception) { if (!shapes.ContainsKey (exception.AnchorGoalIdentifier)) { return; } if (!shapes.ContainsKey (exception.ResolvedObstacleIdentifier)) { return; } var anchorGoalGraphic = shapes [exception.AnchorGoalIdentifier] [0]; var resolvingGoalGraphic = shapes [exception.ResolvedObstacleIdentifier] [0]; var topArrow = GetArrow (anchorGoalGraphic, resolvingGoalGraphic); topArrow.Style.Stroke.Pattern = StrokePattern.Dashed; AddText (topArrow, @"\b Provided not \b0"); Add (exception.Identifier, topArrow); }