Node#
-
struct Node#
class holding the data for a node in a tree.
Public Types
-
using HashTuple = std::tuple<UnderlyingNodeType, size_t, bool, string, bool, int>#
tuple type for hashing
Public Functions
-
Node() = default#
-
template<typename S>
inline explicit Node(NodeType type, S signature, bool weighted = false, string feature_name = "") noexcept# Constructor used by search space.
- Template Parameters:
S – signature
- Parameters:
type – node type
feature_name – name of the terminal
signature – signature
-
template<typename S>
inline void set_signature()#
-
inline void init()#
-
string get_name(bool include_weight = true) const noexcept#
gets a string version of the node for printing.
get the name of the node.
- Parameters:
include_weight – whether to include the node’s weight in the output.
- Returns:
string version of the node.
- Returns:
name
-
string get_model(const vector<string>&) const noexcept#
-
inline DataType get_ret_type() const#
-
inline std::size_t args_type() const#
-
inline auto get_arg_types() const#
-
inline size_t get_arg_count() const#
-
inline size_t get_node_hash() const#
-
inline float get_prob_change() const#
-
inline void set_prob_change(float w)#
-
inline float get_prob_keep() const#
-
inline void set_feature(string f)#
-
inline string get_feature() const#
-
inline bool get_is_weighted() const#
-
inline void set_is_weighted(bool is_weighted)#
Public Members
-
string name#
full name of the node, with types
-
bool center_op#
whether to center the operator in pretty printing
-
float prob_change#
chance of node being selected for variation
-
bool fixed#
whether node is modifiable
-
std::size_t sig_hash#
a hash of the signature
-
std::size_t sig_dual_hash#
a hash of the dual of the signature (for NLS)
-
DataType ret_type#
return data type
-
std::vector<DataType> arg_types#
argument data types
-
bool is_weighted#
whether this node is weighted
-
float W#
the weights of the node. also used for splitting thresholds.
-
using HashTuple = std::tuple<UnderlyingNodeType, size_t, bool, string, bool, int>#