public static ISet <Goal> LeafGoals(this KAOSModel model) { var goals = new HashSet <Goal> (model.Goals()); foreach (var refinement in model.GoalRefinements()) { goals.Remove(refinement.ParentGoal()); } return(goals); }
public static ISet <Goal> RootGoals(this KAOSModel model) { var goals = new HashSet <Goal> (model.Goals()); foreach (var goal in model.Goals()) { foreach (var refinement in goal.Refinements()) { foreach (var child in refinement.SubGoals()) { goals.Remove(child); } } } foreach (var obstacle in model.Obstacles()) { foreach (var resolution in obstacle.Resolutions()) { goals.Remove(resolution.ResolvingGoal()); } } return(goals); }