public GoalRefinement(KAOSModel model, params Goal[] goals) : this(model) { foreach (var goal in goals) { SubGoalIdentifiers.Add(new GoalRefinee(goal.Identifier)); } }
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()); } } }
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; }
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); }
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); }
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))); } }
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); }
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); }
public static SoftGoal SoftGoal(this KAOSModel model, Predicate <SoftGoal> pred) { return(model.goalRepository.GetSoftGoal(pred)); }
public static IEnumerable <Obstacle> Obstacles(this KAOSModel model, Predicate <Obstacle> pred) { return(model.obstacleRepository.GetObstacles(pred)); }
public static IEnumerable <SoftGoal> SoftGoals(this KAOSModel model) { return(model.goalRepository.GetSoftGoals()); }
public static IEnumerable <SoftGoal> SoftGoals(this KAOSModel model, Predicate <SoftGoal> pred) { return(model.goalRepository.GetSoftGoals(pred)); }
public static IEnumerable <GoalException> Exceptions(this KAOSModel model) { return(model.goalRepository.GetGoalExceptions()); }
public static IEnumerable <GoalReplacement> Replacements(this KAOSModel model) { return(model.goalRepository.GetGoalReplacements()); }
public static IEnumerable <ObstacleRefinement> ObstacleRefinements(this KAOSModel model) { return(model.obstacleRepository.GetObstacleRefinements()); }
public static IEnumerable <Calibration> CalibrationVariables(this KAOSModel model, Predicate <Calibration> pred) { return(model.modelMetadataRepository.GetCalibrations(pred)); }
public DomainProperty(KAOSModel model) : base(model) { }
public static GivenType GivenType(this KAOSModel model, Predicate <GivenType> pred) { return(model.entityRepository.GetGivenType(pred)); }
public static IEnumerable <Obstacle> ResolvedObstacles(this KAOSModel model) { return(from o in model.Obstacles() where o.Resolutions().Count() > 0 select o); }
public static IEnumerable <Goal> ObstructedGoals(this KAOSModel model) { return(from g in model.Obstructions() select g.ObstructedGoal()); }
public static IEnumerable <Obstacle> RootObstacles(this KAOSModel model) { return(model.Obstructions().Select(x => x.Obstacle())); }
public static Obstacle Obstacle(this KAOSModel model, Predicate <Obstacle> pred) { return(model.obstacleRepository.GetObstacle(pred)); }
public static IEnumerable <Expert> Experts(this KAOSModel model, Predicate <Expert> pred) { return(model.modelMetadataRepository.GetExperts(pred)); }
public static Obstacle Obstacle(this KAOSModel model, string identifier) { return(model.obstacleRepository.GetObstacle(identifier)); }
public static IEnumerable <Context> Contexts(this KAOSModel model) { return(model.modelMetadataRepository.GetContexts()); }
public EntityAttribute(KAOSModel model) : base(model) { Derived = false; }
public static IEnumerable <Expert> Experts(this KAOSModel model) { return(model.modelMetadataRepository.GetExperts()); }
public DomainProperty(KAOSModel model, string identifier) : base(model, identifier) { }
public static IEnumerable <GoalRefinement> GoalRefinements(this KAOSModel model, Predicate <GoalRefinement> pred) { return(model.goalRepository.GetGoalRefinements(pred)); }