Nemo  2.3.46
TTWolbachia Class Reference

Trait used to study the dynamics of spread of Wolbachia, an endosymbiotic parasite causing cytoplasmic incompatibility. More...

#include <ttwolbachia.h>

+ Inheritance diagram for TTWolbachia:
+ Collaboration diagram for TTWolbachia:

Public Member Functions

 TTWolbachia ()
 
 TTWolbachia (const TTWolbachia &T)
 
virtual ~TTWolbachia ()
 
void set_transmit_rate (double val)
 
virtual void init ()
 
virtual void init_sequence ()
 
virtual void reset ()
 
virtual void inherit (TTrait *mother, TTrait *father)
 
virtual void mutate ()
 
virtual void * set_trait (void *value)
 
virtual void set_sequence (void **seq)
 
virtual void set_value ()
 
virtual void * getValue () const
 
virtual trait_t get_type () const
 
virtual void ** get_sequence () const
 
virtual double get_allele_value (int loc, int all)
 
virtual void set_allele_value (unsigned int locus, unsigned int allele, double value)
 
virtual void show_up ()
 
virtual TTWolbachiaclone ()
 
virtual TTWolbachiaoperator= (const TTrait &T)
 
virtual bool operator== (const TTrait &T)
 
virtual bool operator!= (const TTrait &T)
 
virtual void store_data (BinaryStorageBuffer *saver)
 
virtual bool retrieve_data (BinaryStorageBuffer *reader)
 
- Public Member Functions inherited from TTrait
virtual ~TTrait ()
 
- Public Member Functions inherited from StorableComponent
virtual ~StorableComponent ()
 

Private Attributes

double _transmit_rate
 
bool _is_infected
 

Detailed Description

Trait used to study the dynamics of spread of Wolbachia, an endosymbiotic parasite causing cytoplasmic incompatibility.

The trait state is given by a unique haploid "gene" with two alleles, 0 = uninfected and 1 = infected.

Constructor & Destructor Documentation

TTWolbachia::TTWolbachia ( )
inline

Referenced by clone().

62  : _transmit_rate(0), _is_infected(0) { }
double _transmit_rate
Definition: ttwolbachia.h:56
bool _is_infected
Definition: ttwolbachia.h:57
TTWolbachia::TTWolbachia ( const TTWolbachia T)
inline
double _transmit_rate
Definition: ttwolbachia.h:56
bool _is_infected
Definition: ttwolbachia.h:57
virtual TTWolbachia::~TTWolbachia ( )
inlinevirtual
68 {}

Member Function Documentation

virtual TTWolbachia* TTWolbachia::clone ( )
inlinevirtual

Implements TTrait.

References TTWolbachia().

89 {return new TTWolbachia(*this);}
TTWolbachia()
Definition: ttwolbachia.h:61
virtual double TTWolbachia::get_allele_value ( int  loc,
int  all 
)
inlinevirtual

Implements TTrait.

References _is_infected.

86 {return _is_infected;}
bool _is_infected
Definition: ttwolbachia.h:57
virtual void** TTWolbachia::get_sequence ( ) const
inlinevirtual

Implements TTrait.

85 {return NULL;}
virtual trait_t TTWolbachia::get_type ( ) const
inlinevirtual

Implements TTrait.

References WOLB.

Referenced by operator==().

84 {return WOLB;}
#define WOLB
Definition: types.h:73
virtual void* TTWolbachia::getValue ( ) const
inlinevirtual

Implements TTrait.

References _is_infected.

83 {return (void*)&_is_infected;}
bool _is_infected
Definition: ttwolbachia.h:57
virtual void TTWolbachia::inherit ( TTrait mother,
TTrait father 
)
inlinevirtual

Implements TTrait.

References TTrait::getValue().

76  { _is_infected = *(bool*)mother->getValue(); }
virtual void * getValue() const =0
Genotype to phenotype mapper.
bool _is_infected
Definition: ttwolbachia.h:57
virtual void TTWolbachia::init ( )
inlinevirtual

Implements TTrait.

72 {_is_infected = 0;}
bool _is_infected
Definition: ttwolbachia.h:57
virtual void TTWolbachia::init_sequence ( )
inlinevirtual

Implements TTrait.

73 {_is_infected = 0;}
bool _is_infected
Definition: ttwolbachia.h:57
virtual void TTWolbachia::mutate ( )
inlinevirtual

Implements TTrait.

References _transmit_rate, and RAND::Uniform().

static double Uniform()
Generates a random number from [0.0, 1.0[ uniformly distributed.
Definition: Uniform.h:101
double _transmit_rate
Definition: ttwolbachia.h:56
bool _is_infected
Definition: ttwolbachia.h:57
bool TTWolbachia::operator!= ( const TTrait T)
virtual

Implements TTrait.

100 {
101  if(!((*this) == T))
102  return true;
103  else
104  return false;
105 }
TTWolbachia & TTWolbachia::operator= ( const TTrait T)
virtual

Implements TTrait.

References _is_infected.

76 {
77  const TTWolbachia& TD = dynamic_cast<const TTWolbachia&> (T);
78  if(this != &TD) {
80 // _transmit_rate = TD._transmit_rate;
81  }
82  return *this;
83 }
Trait used to study the dynamics of spread of Wolbachia, an endosymbiotic parasite causing cytoplasmi...
Definition: ttwolbachia.h:53
bool _is_infected
Definition: ttwolbachia.h:57
bool TTWolbachia::operator== ( const TTrait T)
virtual

Implements TTrait.

References get_type(), and TTrait::get_type().

88 {
89  if(this->get_type().compare(T.get_type()) != 0) return false;
90 // const TTWolbachia& TD = dynamic_cast<const TTWolbachia&> (T);
91 // if(this != &TD) {
92 // if(_transmit_rate != TD._transmit_rate) return false;
93 // }
94  return true;
95 }
virtual trait_t get_type() const =0
type accessor.
virtual trait_t get_type() const
Definition: ttwolbachia.h:84
virtual void TTWolbachia::reset ( )
inlinevirtual

Implements TTrait.

74 {_is_infected = 0;}
bool _is_infected
Definition: ttwolbachia.h:57
virtual bool TTWolbachia::retrieve_data ( BinaryStorageBuffer reader)
inlinevirtual

Implements StorableComponent.

References BinaryStorageBuffer::read().

100  {
101  unsigned char dummy;
102  reader->read(&dummy, 1);
103  _is_infected = dummy;
104  return true;
105  }
void read(void *out, unsigned int nb_bytes)
Definition: binarystoragebuffer.h:147
bool _is_infected
Definition: ttwolbachia.h:57
virtual void TTWolbachia::set_allele_value ( unsigned int  locus,
unsigned int  allele,
double  value 
)
inlinevirtual

Implements TTrait.

87 {_is_infected=(bool)value;}
bool _is_infected
Definition: ttwolbachia.h:57
virtual void TTWolbachia::set_sequence ( void **  seq)
inlinevirtual

Implements TTrait.

81 { }
virtual void* TTWolbachia::set_trait ( void *  value)
inlinevirtual

Implements TTrait.

References _is_infected.

80  { _is_infected = *(bool*)value; return &_is_infected; }
bool _is_infected
Definition: ttwolbachia.h:57
void TTWolbachia::set_transmit_rate ( double  val)
inline

Referenced by TProtoWolbachia::hatch().

70 {_transmit_rate = val;}
double _transmit_rate
Definition: ttwolbachia.h:56
virtual void TTWolbachia::set_value ( )
inlinevirtual

Implements TTrait.

82 { }
virtual void TTWolbachia::show_up ( )
inlinevirtual

Implements TTrait.

88 {}
virtual void TTWolbachia::store_data ( BinaryStorageBuffer saver)
inlinevirtual

Implements StorableComponent.

References _is_infected, and BinaryStorageBuffer::store().

95  {
96  unsigned char dummy = static_cast<unsigned char>(_is_infected);
97  saver->store(&dummy, 1);
98  }
void store(void *stream, unsigned int nb_bytes)
Definition: binarystoragebuffer.h:130
bool _is_infected
Definition: ttwolbachia.h:57

Member Data Documentation

bool TTWolbachia::_is_infected
private
double TTWolbachia::_transmit_rate
private

Referenced by mutate().


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

Generated for Nemo v2.3.0 by  doxygen 1.8.8 --
Catalogued on GSR