class

Moses::Program

Inherits Reference < Object

Program representation using a structured approach Supports both string-based and tree-based representations

Constructors

new(expression : String)
Source
new(parsed_tree : ProgramNode)

Create program from tree structure

Source

Instance methods

complexity

Get complexity of the program

Source
constants
Source
constants=(constants : Array(Float64))
Source
execute(inputs : Array(Float64), problem_type : ProblemType) : Float64 | Bool

Execute program with given inputs

Source
expression
Source
expression=(expression : String)
Source
parse!

Parse expression into tree if not already parsed

Source
parsed_tree
Source
parsed_tree=(parsed_tree : ProgramNode | Nil)
Source
to_s(io)
Source
variables
Source
variables=(variables : Array(String))
Source