Class GoTNode

java.lang.Object
com.tnsai.reasoning.got.GoTNode
All Implemented Interfaces:
Evaluable

public final class GoTNode extends Object implements Evaluable
A node in a Graph of Thoughts.

Unlike tree nodes, GoT nodes can have multiple parents (merge/aggregate) and can form cycles through refinement operations.

  • Method Details

    • root

      public static GoTNode root(String thought)
    • addChild

      public GoTNode addChild(String id, String thought, GoTOperation operation)
    • merge

      public static GoTNode merge(String id, String thought, List<GoTNode> parents)
      Creates a merge node from multiple parent nodes.
    • getId

      public String getId()
      Description copied from interface: Evaluable
      Gets the node identifier.
      Specified by:
      getId in interface Evaluable
    • getThought

      public String getThought()
      Description copied from interface: Evaluable
      Gets the thought content at this node.
      Specified by:
      getThought in interface Evaluable
    • getOperation

      public GoTOperation getOperation()
    • getParents

      public List<GoTNode> getParents()
    • getChildren

      public List<GoTNode> getChildren()
    • getScore

      public double getScore()
    • isEvaluated

      public boolean isEvaluated()
    • isLeaf

      public boolean isLeaf()
    • isRoot

      public boolean isRoot()
    • isMergeNode

      public boolean isMergeNode()
    • getThoughtChain

      public String getThoughtChain()
      Description copied from interface: Evaluable
      Gets the combined thought chain from root to this node.
      Specified by:
      getThoughtChain in interface Evaluable
    • getDepth

      public int getDepth()
      Description copied from interface: Evaluable
      Gets the depth of this node (root = 0).
      Specified by:
      getDepth in interface Evaluable
    • setScore

      public void setScore(double score)
    • toString

      public String toString()
      Overrides:
      toString in class Object