163 this->is_weighted =
false;
211 return !((*this) ==
rhs);
218 return (*
this) <
rhs;
223 return ((*
this) ==
rhs || (*
this) <
rhs);
228 return !((*this) <=
rhs);
233 return !((*this) <
rhs);
332template <>
struct fmt::formatter<
Brush::
Node>: formatter<string_view> {
334 template <
typename FormatContext>
336 return formatter<string_view>::format(
x.get_name(),
ctx);
void bind_engine(py::module &m, string name)
holds variable type data.
< nsga2 selection operator for getting the front
ostream & operator<<(ostream &os, DataType n)
std::underlying_type_t< NodeType > UnderlyingNodeType
auto Isnt(DataType dt) -> bool
auto IsWeighable() noexcept -> bool
void from_json(const json &j, Fitness &f)
auto IsLeaf(NodeType nt) noexcept -> bool
auto IsCommutative(NodeType nt) noexcept -> bool
auto Is(NodeType nt) -> bool
void to_json(json &j, const Fitness &f)
std::map< NodeType, std::string > NodeTypeName
auto IsDifferentiable(NodeType nt) noexcept -> bool
static auto GetIndex(NodeType type) -> size_t
class holding the data for a node in a tree.
float get_prob_keep() const
bool center_op
whether to center the operator in pretty printing
size_t get_node_hash() const
std::vector< DataType > arg_types
argument data types
DataType get_ret_type() const
bool fixed
whether node is modifiable
float get_prob_change() const
NodeType node_type
the node type
auto operator<=(const Node &rhs) const noexcept -> bool
Node(NodeType type, S signature, bool weighted=false, string feature_name="") noexcept
Constructor used by search space.
DataType ret_type
return data type
auto operator>(const Node &rhs) const noexcept -> bool
void set_is_weighted(bool is_weighted)
auto get_arg_types() const
auto operator==(const Node &rhs) const noexcept -> bool
void set_feature(string f)
string get_feature() const
std::size_t sig_hash
a hash of the signature
bool get_is_weighted() const
std::size_t args_type() const
float prob_change
chance of node being selected for variation
auto operator>=(const Node &rhs) const noexcept -> bool
string get_name(bool include_weight=true) const noexcept
gets a string version of the node for printing.
float W
the weights of the node. also used for splitting thresholds.
bool is_weighted
whether this node is weighted
std::tuple< UnderlyingNodeType, size_t, bool, string, bool, int > HashTuple
tuple type for hashing
size_t get_arg_count() const
string feature
feature name for terminals or splitting nodes
auto operator!=(const Node &rhs) const noexcept -> bool
string name
full name of the node, with types
void set_prob_change(float w)
auto operator<(const Node &rhs) const noexcept -> bool
std::size_t sig_dual_hash
a hash of the dual of the signature (for NLS)
string get_model(const vector< string > &) const noexcept
std::size_t operator()(std::vector< Brush::DataType > const &vec) const
std::size_t operator()(std::vector< uint32_t > const &vec) const