DecisionNode

utils.DecisionNode
case class DecisionNode[Ctx, Res](predicate: Ctx => Boolean, trueBranch: DecisionTree[Ctx, Res], falseBranch: DecisionTree[Ctx, Res]) extends DecisionTree[Ctx, Res]

Represents a binary decision node in the decision tree.

A DecisionNode evaluates a predicate against the context and branches to either a trueBranch or a falseBranch accordingly.

Type parameters

Ctx

The context type.

Res

The result type.

Value parameters

falseBranch

The DecisionTree to evaluate if the predicate returns false.

predicate

A function that takes the context and returns a boolean, determining the branch to follow.

trueBranch

The DecisionTree to evaluate if the predicate returns true.

Attributes

Graph
Supertypes
trait Serializable
trait Product
trait Equals
trait DecisionTree[Ctx, Res]
class Object
trait Matchable
class Any
Show all

Members list

Value members

Concrete methods

override def eval(ctx: Ctx): Res

Evaluates the DecisionNode by checking its predicate and recursing into the appropriate branch.

Evaluates the DecisionNode by checking its predicate and recursing into the appropriate branch.

Value parameters

ctx

The context object.

Attributes

Returns

The result from the chosen branch.

Definition Classes

Inherited methods

def productElementNames: Iterator[String]

Attributes

Inherited from:
Product
def productIterator: Iterator[Any]

Attributes

Inherited from:
Product