Interface ITreeEngine

  • All Known Implementing Classes:
    TreeEngine

    public interface ITreeEngine
    The tree engine which is initialized to full capacity after load. It can evaluate a decision tree until questions need to be asked or a solution is found. This class is not serializable.
    Since:
    5.0
    Author:
    F. van der Meer
    • Method Detail

      • getTreeNames

        String[] getTreeNames()
        Retrieves the tree names.
        Returns:
        the names of all the decision trees, never null, may be an empty array.
        Since:
        7.2
      • searchDecisionTrees

        ISearchResult searchDecisionTrees​(String symptomText,
                                          ILanguage language,
                                          int maximumResults,
                                          double theshold)
        This function will search all Decision Trees and try to find the best matching tree matching to the symptomText. Standard this function will return up matching decision trees.
        Parameters:
        symptomText - A symptom text of at least 1 character.
        language - The language that should be used when searching for a matching symptom.
        maximumResults - indicates what the maximum results count should be, this number is expected to be 1 or larger.
        theshold - the minimum score of the matched decision tree
        Returns:
        A search result object holding the matching trees and their scores.
      • searchDecisionTrees

        ISearchResult searchDecisionTrees​(String symptomText,
                                          ILanguage language,
                                          int maximumResults,
                                          double theshold,
                                          boolean returnNonExposedTrees)
        This function will search all Decision Trees and try to find the best matching tree matching to the symptomText. Standard this function will return up matching decision trees.
        Parameters:
        symptomText - A symptom text of at least 1 character.
        language - The language that should be used when searching for a matching symptom.
        maximumResults - indicates what the maximum results count should be, this number is expected to be 1 or larger.
        theshold - the minimum score of the matched decision tree
        returnNonExposedTrees - boolean whether to return decision trees that are not exposed as a webservice.
        Returns:
        A search result object holding the matching trees and their scores.
      • evaluateWith

        ITreeResponse evaluateWith​(String treeName,
                                   IAnswers answers,
                                   InferenceContext context)
                            throws AppException
        Evaluate a decision tree with the context passed. The answers interface will instruct the tree engine to skip asking certain questions and continue down the tree until it can find an answer.
        Parameters:
        treeName - The decision tree that should be evaluated.
        answers - The answers that have been given so far.
        context - current context.
        Returns:
        The response can never be null
        Throws:
        AppException - This exception is throw when the tree could not be evaluated.