Example #1
0
        public virtual ISatisfactionRate GetESR(Goal goal)
        {
            ObstructionCaseSuperset os;

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

            return(new DoubleSatisfactionRate(1.0 - os.GetProbability(vector)));
        }
Example #2
0
        public ISatisfactionRate GetESR(Goal goal, IEnumerable <Obstacle> onlyObstacles)
        {
            ObstructionCaseSuperset os;

            if (!obstructionSupersets.ContainsKey(goal.Identifier))
            {
                os = new ObstructionCaseSuperset(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));
        }