Public Member Functions | Public Attributes | List of all members
cuml::genetic::program Struct Reference

The main data structure to store the AST that represents a program in the current generation. More...

#include <program.h>

Collaboration diagram for cuml::genetic::program:
Collaboration graph

Public Member Functions

 program ()
 
 ~program ()
 Destroy the program object. More...
 
 program (const program &src)
 Copy constructor for a new program object. More...
 
programoperator= (const program &src)
 assignment operator More...
 

Public Attributes

nodenodes
 
int len
 
int depth
 
float raw_fitness_
 
metric_t metric
 
mutation_t mut_type
 

Detailed Description

The main data structure to store the AST that represents a program in the current generation.

Constructor & Destructor Documentation

◆ program() [1/2]

cuml::genetic::program::program ( )
explicit

the AST. It is stored in the reverse of DFS-right-child-first order. In other words, construct a regular AST in the form of depth-first, but instead of storing the left child first, store the right child and so on. Now take the resulting 1D array and reverse it.

Note
The pointed memory buffer is NOT owned by this class and further it is assumed to be a zero-copy (aka pinned memory) buffer, at least in this initial version Default constructor

◆ ~program()

cuml::genetic::program::~program ( )

Destroy the program object.

◆ program() [2/2]

cuml::genetic::program::program ( const program src)
explicit

Copy constructor for a new program object.

Parameters
src

Member Function Documentation

◆ operator=()

program& cuml::genetic::program::operator= ( const program src)

assignment operator

Parameters
[in]srcsource program to be copied
Returns
current program reference

Member Data Documentation

◆ depth

int cuml::genetic::program::depth

maximum depth of this AST

◆ len

int cuml::genetic::program::len

total number of nodes in this AST

◆ metric

metric_t cuml::genetic::program::metric

fitness metric used for current AST

◆ mut_type

mutation_t cuml::genetic::program::mut_type

mutation type responsible for production

◆ nodes

node* cuml::genetic::program::nodes

◆ raw_fitness_

float cuml::genetic::program::raw_fitness_

fitness score of current AST


The documentation for this struct was generated from the following file: