コード例 #1
0
 public GoalRefinement(KAOSModel model, params Goal[] goals) : this(model)
 {
     foreach (var goal in goals)
     {
         SubGoalIdentifiers.Add(new GoalRefinee(goal.Identifier));
     }
 }
コード例 #2
0
 public ObstacleRefinement(KAOSModel model, params Obstacle[] obstacles) : this(model)
 {
     foreach (var obstacle in obstacles)
     {
         SubobstacleIdentifiers.Add(new ObstacleRefinee(obstacle.Identifier));
     }
 }
コード例 #3
0
 public static void IntegrateResolutions(this KAOSModel model)
 {
     foreach (var goal in model.ObstructedGoals().ToArray())
     {
         foreach (var obstacle in goal.Obstructions().ToArray())
         {
             RecursiveIntegration(goal, obstacle.Obstacle());
         }
     }
 }
コード例 #4
0
        public GoalRefinement(KAOSModel model) : base(model)
        {
            SubGoalIdentifiers          = new HashSet <GoalRefinee> ();
            DomainPropertyIdentifiers   = new HashSet <GoalRefinee> ();
            DomainHypothesisIdentifiers = new HashSet <GoalRefinee> ();

            PositiveSoftGoalsIdentifiers = new HashSet <string> ();
            NegativeSoftGoalsIdentifiers = new HashSet <string> ();

            IsComplete = false;
        }
コード例 #5
0
        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);
        }
コード例 #6
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);
        }
コード例 #7
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)));
            }
        }
コード例 #8
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);
        }
コード例 #9
0
        static IEnumerable <string> GetAncestors(KAOSModel _model, IEnumerable <string> goals)
        {
            var fixpoint          = new HashSet <string> (goals);
            var goalsToProcessSet = new HashSet <string> (goals);
            var goalsToProcess    = new Queue <string>(goals);

            while (goalsToProcess.Count > 0)
            {
                var current = goalsToProcess.Dequeue();
                goalsToProcessSet.Remove(current);
                var refinements = _model.GoalRefinements(x => x.SubGoalIdentifiers.Any(y => y.Identifier == current));
                foreach (var r in refinements)
                {
                    fixpoint.Add(r.ParentGoalIdentifier);
                    if (!goalsToProcessSet.Contains(r.ParentGoalIdentifier))
                    {
                        goalsToProcessSet.Add(r.ParentGoalIdentifier);
                        goalsToProcess.Enqueue(r.ParentGoalIdentifier);
                    }
                }
            }

            return(fixpoint);
        }
コード例 #10
0
 public static SoftGoal SoftGoal(this KAOSModel model, Predicate <SoftGoal> pred)
 {
     return(model.goalRepository.GetSoftGoal(pred));
 }
コード例 #11
0
 public static IEnumerable <Obstacle> Obstacles(this KAOSModel model, Predicate <Obstacle> pred)
 {
     return(model.obstacleRepository.GetObstacles(pred));
 }
コード例 #12
0
 public static IEnumerable <SoftGoal> SoftGoals(this KAOSModel model)
 {
     return(model.goalRepository.GetSoftGoals());
 }
コード例 #13
0
 public static IEnumerable <SoftGoal> SoftGoals(this KAOSModel model, Predicate <SoftGoal> pred)
 {
     return(model.goalRepository.GetSoftGoals(pred));
 }
コード例 #14
0
 public static IEnumerable <GoalException> Exceptions(this KAOSModel model)
 {
     return(model.goalRepository.GetGoalExceptions());
 }
コード例 #15
0
 public static IEnumerable <GoalReplacement> Replacements(this KAOSModel model)
 {
     return(model.goalRepository.GetGoalReplacements());
 }
コード例 #16
0
 public static IEnumerable <ObstacleRefinement> ObstacleRefinements(this KAOSModel model)
 {
     return(model.obstacleRepository.GetObstacleRefinements());
 }
コード例 #17
0
 public static IEnumerable <Calibration> CalibrationVariables(this KAOSModel model, Predicate <Calibration> pred)
 {
     return(model.modelMetadataRepository.GetCalibrations(pred));
 }
コード例 #18
0
 public DomainProperty(KAOSModel model) : base(model)
 {
 }
コード例 #19
0
 public static GivenType GivenType(this KAOSModel model, Predicate <GivenType> pred)
 {
     return(model.entityRepository.GetGivenType(pred));
 }
コード例 #20
0
 public static IEnumerable <Obstacle> ResolvedObstacles(this KAOSModel model)
 {
     return(from o in model.Obstacles() where o.Resolutions().Count() > 0 select o);
 }
コード例 #21
0
 public static IEnumerable <Goal> ObstructedGoals(this KAOSModel model)
 {
     return(from g in model.Obstructions() select g.ObstructedGoal());
 }
コード例 #22
0
 public static IEnumerable <Obstacle> RootObstacles(this KAOSModel model)
 {
     return(model.Obstructions().Select(x => x.Obstacle()));
 }
コード例 #23
0
 public static Obstacle Obstacle(this KAOSModel model, Predicate <Obstacle> pred)
 {
     return(model.obstacleRepository.GetObstacle(pred));
 }
コード例 #24
0
 public static IEnumerable <Expert> Experts(this KAOSModel model, Predicate <Expert> pred)
 {
     return(model.modelMetadataRepository.GetExperts(pred));
 }
コード例 #25
0
 public static Obstacle Obstacle(this KAOSModel model, string identifier)
 {
     return(model.obstacleRepository.GetObstacle(identifier));
 }
コード例 #26
0
 public static IEnumerable <Context> Contexts(this KAOSModel model)
 {
     return(model.modelMetadataRepository.GetContexts());
 }
コード例 #27
0
 public EntityAttribute(KAOSModel model) : base(model)
 {
     Derived = false;
 }
コード例 #28
0
 public static IEnumerable <Expert> Experts(this KAOSModel model)
 {
     return(model.modelMetadataRepository.GetExperts());
 }
コード例 #29
0
 public DomainProperty(KAOSModel model, string identifier) : base(model, identifier)
 {
 }
コード例 #30
0
 public static IEnumerable <GoalRefinement> GoalRefinements(this KAOSModel model, Predicate <GoalRefinement> pred)
 {
     return(model.goalRepository.GetGoalRefinements(pred));
 }