Beispiel #1
0
        public static ResponsibilityNode GetResponsibilities(this KAOSModel model)
        {
            var node = new ResponsibilityNode(null);

            foreach (var rootGoal in model.RootGoals())
            {
                RecursiveGetResponsibilities(node, rootGoal);
            }

            Factorize(node);
            Collapse(node);

            return(node);
        }
Beispiel #2
0
 bool ConstraintsSatisfied()
 {
     foreach (var c in model.Elements.OfType <Constraint>())
     {
         var result = new List <bool>();
         foreach (var s in c.Conflict)
         {
             result.Add(model.RootGoals().Any(x => IsGoalActive(s, x)));
         }
         if (result.Count(x => x) > 1)
         {
             return(false);
         }
     }
     return(true);
 }
Beispiel #3
0
        public void Setup()
        {
            var options = new RandomModelOptions {
                NbGoals        = NbGoals,
                NbObstructions = NbObstructions,
                NbObstacles    = NbObstacles
            };

            var generator = new RandomModelGenerator(options);

            model = generator.Generate();
            root  = model.RootGoals().Single();

            p3 = new BDDBasedPropagator(model);
            p3.PreBuildObstructionSet(root);
        }