Exemplo n.º 1
0
        private int getEvidenceScore(NodeReference generalNode, KnowledgeConstraint constraint)
        {
            var evidenceScore = 0;

            foreach (var evidence in _questions.Values)
            {
                var featureNode = evidence.GetFeatureNode(generalNode, Graph);
                var answer      = evidence.GetBestEvidenceAnswer();

                if (constraint.IsSatisfiedBy(featureNode, answer, Graph))
                {
                    //if answer is possible under given constraint, we count it to the score
                    evidenceScore += evidence.GetEvidenceScore(answer);
                }
            }

            return(evidenceScore);
        }
Exemplo n.º 2
0
 private HashSet <NodeReference> findSet(NodeReference constraintNode, KnowledgeConstraint constraint)
 {
     return(constraint.FindSet(constraintNode, Graph));
 }
Exemplo n.º 3
0
 private IEnumerable <NodeReference> getConstrainedLayer(IEnumerable <NodeReference> nodeDomain, KnowledgeConstraint constraint)
 {
     return(Graph.GetForwardTargets(nodeDomain, constraint.Path));
 }