Leaf

utils.Leaf
case class Leaf[Ctx, Res](action: Ctx => Res) extends DecisionTree[Ctx, Res]

Represents a leaf node in the decision tree.

A Leaf node is a terminal point in the tree, directly providing a result based on an associated action function without further branching.

Type parameters

Ctx

The context type.

Res

The result type.

Value parameters

action

A function that takes the context and produces the final result for this leaf.

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 Leaf node by applying its action function to the context.

Evaluates the Leaf node by applying its action function to the context.

Value parameters

ctx

The context object.

Attributes

Returns

The result produced by the action.

Definition Classes

Inherited methods

def productElementNames: Iterator[String]

Attributes

Inherited from:
Product
def productIterator: Iterator[Any]

Attributes

Inherited from:
Product