コード例 #1
0
        public virtual ISatisfactionRate GetESR(Goal goal, IEnumerable <GoalException> activeResolutions)
        {
            ObstructionResolutionSuperset os;

            if (!obstructionSupersets.ContainsKey(goal.Identifier))
            {
                os = new ObstructionResolutionSuperset(goal);
            }
            else
            {
                os = obstructionSupersets[goal.Identifier];
            }
            var vector = new SamplingVector(_model);

            return(new DoubleSatisfactionRate(1.0 - os.GetProbability(vector, activeResolutions)));
        }
コード例 #2
0
        public ISatisfactionRate GetESR(Goal goal, IEnumerable <Obstacle> onlyObstacles)
        {
            ObstructionResolutionSuperset os;

            if (!obstructionSupersets.ContainsKey(goal.Identifier))
            {
                os = new ObstructionResolutionSuperset(goal);
            }
            else
            {
                os = obstructionSupersets[goal.Identifier];
            }

            var vector = new SamplingVector(_model, onlyObstacles?.Select(x => x.Identifier)?.ToHashSet());
            var value  = 1.0 - os.GetProbability(vector);

            return(new DoubleSatisfactionRate(value));
        }