mc2lib
Public Types | Public Member Functions | Private Attributes | List of all members
mc2lib::codegen::RandInstTest< URNG, OperationFactory > Class Template Reference

#include <rit.hpp>

Inheritance diagram for mc2lib::codegen::RandInstTest< URNG, OperationFactory >:
mc2lib::simplega::Genome< OperationFactory::ResultType::Ptr >

Public Types

typedef OperationFactory::ResultType Operation
 
typedef sets::Set< sets::Types< types::Addr, std::hash< types::Addr > > > AddrSet
 
- Public Types inherited from mc2lib::simplega::Genome< OperationFactory::ResultType::Ptr >
typedef std::vector< OperationFactory::ResultType::Ptr > Container
 

Public Member Functions

 RandInstTest (URNG &urng, const OperationFactory *factory, std::size_t len)
 
 RandInstTest (const RandInstTest &parent1, const RandInstTest &parent2, std::vector< typename Operation::Ptr > g)
 
void Mutate (float rate) override
 Mutate this Genome. More...
 
float Fitness () const override
 Fitness accessor. More...
 
void set_fitness (float fitness)
 
const AddrSetfitaddrs () const
 
AddrSetfitaddrsptr ()
 
Operation::Ptr MakeRandom () const
 
Operation::Ptr MakeRandom (const AddrSet &subset_addrs, std::size_t max_tries=1000) const
 
Operation::Threads threads ()
 
- Public Member Functions inherited from mc2lib::simplega::Genome< OperationFactory::ResultType::Ptr >
 Genome ()
 Default constructor. More...
 
 Genome (Container g)
 Converting constructor. More...
 
virtual ~Genome ()
 
const Containerget () const
 Read-only genome accessor. More...
 
Containerget_ptr ()
 Modifiable genome accessor. More...
 
virtual bool operator< (const Genome &rhs) const
 Less than comparison operator. More...
 
virtual operator float () const
 Converting operator to float. More...
 
virtual operator std::string () const
 Converting operator to std::string. More...
 

Private Attributes

URNG & urng_
 
const OperationFactory * factory_
 
float fitness_
 
AddrSet fitaddrs_
 

Additional Inherited Members

- Protected Attributes inherited from mc2lib::simplega::Genome< OperationFactory::ResultType::Ptr >
Container genome_
 Raw genome of individual genes of T. More...
 

Member Typedef Documentation

§ AddrSet

template<class URNG , class OperationFactory >
typedef sets::Set<sets::Types<types::Addr, std::hash<types::Addr> > > mc2lib::codegen::RandInstTest< URNG, OperationFactory >::AddrSet

§ Operation

template<class URNG , class OperationFactory >
typedef OperationFactory::ResultType mc2lib::codegen::RandInstTest< URNG, OperationFactory >::Operation

Constructor & Destructor Documentation

§ RandInstTest() [1/2]

template<class URNG , class OperationFactory >
mc2lib::codegen::RandInstTest< URNG, OperationFactory >::RandInstTest ( URNG &  urng,
const OperationFactory *  factory,
std::size_t  len 
)
inlineexplicit

§ RandInstTest() [2/2]

template<class URNG , class OperationFactory >
mc2lib::codegen::RandInstTest< URNG, OperationFactory >::RandInstTest ( const RandInstTest< URNG, OperationFactory > &  parent1,
const RandInstTest< URNG, OperationFactory > &  parent2,
std::vector< typename Operation::Ptr >  g 
)
inlineexplicit

Member Function Documentation

§ fitaddrs()

template<class URNG , class OperationFactory >
const AddrSet& mc2lib::codegen::RandInstTest< URNG, OperationFactory >::fitaddrs ( ) const
inline

§ fitaddrsptr()

template<class URNG , class OperationFactory >
AddrSet* mc2lib::codegen::RandInstTest< URNG, OperationFactory >::fitaddrsptr ( )
inline

§ Fitness()

template<class URNG , class OperationFactory >
float mc2lib::codegen::RandInstTest< URNG, OperationFactory >::Fitness ( ) const
inlineoverridevirtual

Fitness accessor.

Returns
Current fitness.

Implements mc2lib::simplega::Genome< OperationFactory::ResultType::Ptr >.

§ MakeRandom() [1/2]

template<class URNG , class OperationFactory >
Operation::Ptr mc2lib::codegen::RandInstTest< URNG, OperationFactory >::MakeRandom ( ) const
inline

§ MakeRandom() [2/2]

template<class URNG , class OperationFactory >
Operation::Ptr mc2lib::codegen::RandInstTest< URNG, OperationFactory >::MakeRandom ( const AddrSet subset_addrs,
std::size_t  max_tries = 1000 
) const
inline

§ Mutate()

template<class URNG , class OperationFactory >
void mc2lib::codegen::RandInstTest< URNG, OperationFactory >::Mutate ( float  rate)
inlineoverridevirtual

Mutate this Genome.

Parameters
rateMutation rate.

Implements mc2lib::simplega::Genome< OperationFactory::ResultType::Ptr >.

§ set_fitness()

template<class URNG , class OperationFactory >
void mc2lib::codegen::RandInstTest< URNG, OperationFactory >::set_fitness ( float  fitness)
inline

§ threads()

template<class URNG , class OperationFactory >
Operation::Threads mc2lib::codegen::RandInstTest< URNG, OperationFactory >::threads ( )
inline

Member Data Documentation

§ factory_

template<class URNG , class OperationFactory >
const OperationFactory* mc2lib::codegen::RandInstTest< URNG, OperationFactory >::factory_
private

§ fitaddrs_

template<class URNG , class OperationFactory >
AddrSet mc2lib::codegen::RandInstTest< URNG, OperationFactory >::fitaddrs_
private

§ fitness_

template<class URNG , class OperationFactory >
float mc2lib::codegen::RandInstTest< URNG, OperationFactory >::fitness_
private

§ urng_

template<class URNG , class OperationFactory >
URNG& mc2lib::codegen::RandInstTest< URNG, OperationFactory >::urng_
private

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