示例#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));
     }
 }
 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));
 }