Moses::Program
Inherits Reference < Object
Program representation using a structured approach Supports both string-based and tree-based representations
Constructors
new(expression : String)
new(parsed_tree : ProgramNode)
Create program from tree structure
Instance methods
complexity
Get complexity of the program
constants
constants=(constants : Array(Float64))
execute(inputs : Array(Float64), problem_type : ProblemType) : Float64 | Bool
Execute program with given inputs
expression
expression=(expression : String)
parse!
Parse expression into tree if not already parsed
parsed_tree
parsed_tree=(parsed_tree : ProgramNode | Nil)
to_s(io)
variables
variables=(variables : Array(String))