Ultra 0.9.4
Loading...
Searching...
No Matches
ultra::src::basic_reg_oracle< P, S > Class Template Reference

#include <oracle.h>

Inheritance diagram for ultra::src::basic_reg_oracle< P, S >:
ultra::src::basic_oracle

Public Member Functions

 basic_reg_oracle (const P &)
 basic_reg_oracle (std::istream &, const symbol_set &)
value_t operator() (const std::vector< value_t > &) const final
std::string name (const value_t &) const final
bool is_valid () const final
bool save (std::ostream &) const final

Static Public Attributes

static const std::string SERIALIZE_ID

Detailed Description

template<Individual P, bool S>
class ultra::src::basic_reg_oracle< P, S >

Oracle function specialized for regression tasks.

Template Parameters
Sstores the individual inside vs keep a reference only. Sometimes we need an autonomous oracle function that stores everything it needs inside (it will survive the death of the individual it's constructed on). Sometimes we prefer space efficiency (typically inside an evaluator)

Constructor & Destructor Documentation

◆ basic_reg_oracle() [1/2]

template<Individual P, bool S>
basic_reg_oracle::basic_reg_oracle ( const P & prg)
explicit
Parameters
[in]prgthe program (individual/team) to be lambdified

◆ basic_reg_oracle() [2/2]

template<Individual P, bool S>
basic_reg_oracle::basic_reg_oracle ( std::istream & in,
const symbol_set & ss )
Parameters
[in]ininput stream
[in]ssactive symbol set

Member Function Documentation

◆ is_valid()

template<Individual P, bool S>
bool basic_reg_oracle::is_valid ( ) const
nodiscardfinalvirtual
Returns
true if the object passes the internal consistency check

Implements ultra::src::basic_oracle.

◆ name()

template<Individual P, bool S>
std::string basic_reg_oracle::name ( const value_t & a) const
nodiscardfinalvirtual
Parameters
[in]avalue produced by basic_oracle::operator()
Returns
the string version of a

Implements ultra::src::basic_oracle.

◆ operator()()

template<Individual P, bool S>
value_t basic_reg_oracle::operator() ( const std::vector< value_t > & e) const
nodiscardfinalvirtual
Parameters
[in]einput example for the oracle
Returns
the output value associated with e

Implements ultra::src::basic_oracle.

◆ save()

template<Individual P, bool S>
bool basic_reg_oracle::save ( std::ostream & out) const
finalvirtual

Saves the object on persistent storage.

Parameters
[out]outoutput stream
Returns
true if the oracle was saved correctly

Implements ultra::src::basic_oracle.


The documentation for this class was generated from the following files: