Exemplo n.º 1
0
        public static ISet <Obstacle> LeafObstacles(this KAOSModel model)
        {
            var obstacles = new HashSet <Obstacle> (model.Obstacles());

            foreach (var refinement in model.ObstacleRefinements())
            {
                obstacles.Remove(refinement.ParentObstacle());
            }

            //foreach (var obstruction in model.Obstructions ())
            //    obstacles.Remove (obstruction.Obstacle ());

            return(obstacles);
        }
Exemplo n.º 2
0
        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);
        }
Exemplo n.º 3
0
 public static IEnumerable <Obstacle> ResolvedObstacles(this KAOSModel model)
 {
     return(from o in model.Obstacles() where o.Resolutions().Count() > 0 select o);
 }