Пример #1
0
        static IEnumerable <string> RootObstacleIdentifiers(KAOSModel model, string o)
        {
            var oRefinement = model.ObstacleRefinements(x => x.SubobstacleIdentifiers.Any(y => y.Identifier == o));

            if (oRefinement.Count() == 0)
            {
                return new [] { o }
            }
            ;
            else
            {
                return(oRefinement.SelectMany(x => RootObstacleIdentifiers(model, x.ParentObstacleIdentifier)));
            }
        }
Пример #2
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);
        }