Exemplo n.º 1
0
 public GoalRefinement(KAOSModel model, params Goal[] goals) : this(model)
 {
     foreach (var goal in goals)
     {
         SubGoalIdentifiers.Add(new GoalRefinee(goal.Identifier));
     }
 }
Exemplo n.º 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());
         }
     }
 }
Exemplo n.º 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;
        }
Exemplo n.º 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);
        }
Exemplo n.º 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);
        }
Exemplo n.º 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)));
            }
        }
Exemplo n.º 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);
        }
Exemplo n.º 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);
        }
Exemplo n.º 10
0
 public static SoftGoal SoftGoal(this KAOSModel model, Predicate <SoftGoal> pred)
 {
     return(model.goalRepository.GetSoftGoal(pred));
 }
Exemplo n.º 11
0
 public static IEnumerable <Obstacle> Obstacles(this KAOSModel model, Predicate <Obstacle> pred)
 {
     return(model.obstacleRepository.GetObstacles(pred));
 }
Exemplo n.º 12
0
 public static IEnumerable <SoftGoal> SoftGoals(this KAOSModel model)
 {
     return(model.goalRepository.GetSoftGoals());
 }
Exemplo n.º 13
0
 public static IEnumerable <SoftGoal> SoftGoals(this KAOSModel model, Predicate <SoftGoal> pred)
 {
     return(model.goalRepository.GetSoftGoals(pred));
 }
Exemplo n.º 14
0
 public static IEnumerable <GoalException> Exceptions(this KAOSModel model)
 {
     return(model.goalRepository.GetGoalExceptions());
 }
Exemplo n.º 15
0
 public static IEnumerable <GoalReplacement> Replacements(this KAOSModel model)
 {
     return(model.goalRepository.GetGoalReplacements());
 }
Exemplo n.º 16
0
 public static IEnumerable <ObstacleRefinement> ObstacleRefinements(this KAOSModel model)
 {
     return(model.obstacleRepository.GetObstacleRefinements());
 }
Exemplo n.º 17
0
 public static IEnumerable <Calibration> CalibrationVariables(this KAOSModel model, Predicate <Calibration> pred)
 {
     return(model.modelMetadataRepository.GetCalibrations(pred));
 }
Exemplo n.º 18
0
 public DomainProperty(KAOSModel model) : base(model)
 {
 }
Exemplo n.º 19
0
 public static GivenType GivenType(this KAOSModel model, Predicate <GivenType> pred)
 {
     return(model.entityRepository.GetGivenType(pred));
 }
Exemplo n.º 20
0
 public static IEnumerable <Obstacle> ResolvedObstacles(this KAOSModel model)
 {
     return(from o in model.Obstacles() where o.Resolutions().Count() > 0 select o);
 }
Exemplo n.º 21
0
 public static IEnumerable <Goal> ObstructedGoals(this KAOSModel model)
 {
     return(from g in model.Obstructions() select g.ObstructedGoal());
 }
Exemplo n.º 22
0
 public static IEnumerable <Obstacle> RootObstacles(this KAOSModel model)
 {
     return(model.Obstructions().Select(x => x.Obstacle()));
 }
Exemplo n.º 23
0
 public static Obstacle Obstacle(this KAOSModel model, Predicate <Obstacle> pred)
 {
     return(model.obstacleRepository.GetObstacle(pred));
 }
Exemplo n.º 24
0
 public static IEnumerable <Expert> Experts(this KAOSModel model, Predicate <Expert> pred)
 {
     return(model.modelMetadataRepository.GetExperts(pred));
 }
Exemplo n.º 25
0
 public static Obstacle Obstacle(this KAOSModel model, string identifier)
 {
     return(model.obstacleRepository.GetObstacle(identifier));
 }
Exemplo n.º 26
0
 public static IEnumerable <Context> Contexts(this KAOSModel model)
 {
     return(model.modelMetadataRepository.GetContexts());
 }
Exemplo n.º 27
0
 public EntityAttribute(KAOSModel model) : base(model)
 {
     Derived = false;
 }
Exemplo n.º 28
0
 public static IEnumerable <Expert> Experts(this KAOSModel model)
 {
     return(model.modelMetadataRepository.GetExperts());
 }
Exemplo n.º 29
0
 public DomainProperty(KAOSModel model, string identifier) : base(model, identifier)
 {
 }
Exemplo n.º 30
0
 public static IEnumerable <GoalRefinement> GoalRefinements(this KAOSModel model, Predicate <GoalRefinement> pred)
 {
     return(model.goalRepository.GetGoalRefinements(pred));
 }