Nemo  2.2.0
Public Member Functions | Private Attributes
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:

List of all members.

Public Member Functions

 TTWolbachia ()
 TTWolbachia (const TTWolbachia &T)
virtual ~TTWolbachia ()
void set_transmit_rate (double val)
virtual void init ()
 Called to allocate the trait's genotypic sequences.
virtual void init_sequence ()
 Called at the start of each replicate, sets the initial genotypes.
virtual void reset ()
 Called at the end of each simulation/replicate, deallocates sequence memory.
virtual void inherit (TTrait *mother, TTrait *father)
 Inheritance procedure, creates a new trait from mother's and father's traits.
virtual void mutate ()
 Mutation procedure, perform mutations on the genes sequence.
virtual void * set_trait (void *value)
 Called to set the phenotypic to a particular value or to give context-dependant value(s) to the trait.
virtual void set_sequence (void **seq)
 Called to set the sequence pointer to an existing trait.
virtual void set_value ()
 Tells the trait to set its phenotype from genotype, should be used instead of getValue().
virtual void * getValue ()
 Genotype to phenotype mapper.
virtual trait_t get_type () const
 type accessor.
virtual void ** get_sequence () const
 sequence accessor.
virtual void * get_allele (int loc, int all) const
 Called to read one allele value at a particular locus.
virtual void show_up ()
 Writes some info to stdout.
virtual TTWolbachiaclone ()
 Returns a copy of itself.
virtual TTWolbachiaoperator= (const TTrait &T)
 Copies the complete state of the trait from right to left side of the operator, sequence data included.
virtual bool operator== (const TTrait &T)
 Checks for parameters equivalence, not genetic equivalence.
virtual bool operator!= (const TTrait &T)
virtual void store_data (BinaryStorageBuffer *saver)
 Interface to store the component data (e.g. gene values) into a binary buffer.
virtual bool retrieve_data (BinaryStorageBuffer *reader)
 Interface to retrieve the same data from the binary buffer.

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.

Definition at line 50 of file ttwolbachia.h.


Constructor & Destructor Documentation

TTWolbachia::TTWolbachia ( ) [inline]

Definition at line 58 of file ttwolbachia.h.

Referenced by clone().

TTWolbachia::TTWolbachia ( const TTWolbachia T) [inline]

Definition at line 61 of file ttwolbachia.h.

virtual TTWolbachia::~TTWolbachia ( ) [inline, virtual]

Definition at line 65 of file ttwolbachia.h.

{}

Member Function Documentation

virtual TTWolbachia* TTWolbachia::clone ( ) [inline, virtual]

Returns a copy of itself.

Note: call the copy constructor of the trait which should only copy the parameters values not the complete state of the trait (i.e. shallow copy). The copy of the sequence data is made through the assignement operator!

Implements TTrait.

Definition at line 85 of file ttwolbachia.h.

References TTWolbachia().

{return new TTWolbachia(*this);}
virtual void* TTWolbachia::get_allele ( int  loc,
int  all 
) const [inline, virtual]

Called to read one allele value at a particular locus.

Returns:
the allelic value at position 'all' at locus 'loc'
Parameters:
loclocus position in the sequence
allwhich allele we want to read the value from

Implements TTrait.

Definition at line 83 of file ttwolbachia.h.

{return NULL;}  
virtual void** TTWolbachia::get_sequence ( ) const [inline, virtual]

sequence accessor.

Returns:
the sequence pointer

Implements TTrait.

Definition at line 82 of file ttwolbachia.h.

{return NULL;}  
virtual trait_t TTWolbachia::get_type ( ) const [inline, virtual]

type accessor.

Returns:
the trait's type

Implements TTrait.

Definition at line 81 of file ttwolbachia.h.

References WOLB.

Referenced by operator==().

{return WOLB;}
virtual void* TTWolbachia::getValue ( ) [inline, virtual]

Genotype to phenotype mapper.

Returns:
the phenotype computed from the genotype

Implements TTrait.

Definition at line 80 of file ttwolbachia.h.

References _is_infected.

{return (void*)&_is_infected;}
virtual void TTWolbachia::inherit ( TTrait mother,
TTrait father 
) [inline, virtual]

Inheritance procedure, creates a new trait from mother's and father's traits.

Parameters:
motherthe mother's trait
fatherthe father's trait

Implements TTrait.

Definition at line 72 of file ttwolbachia.h.

References _is_infected, and TTrait::getValue().

  {  _is_infected = *(bool*)mother->getValue();  }
virtual void TTWolbachia::init ( ) [inline, virtual]

Called to allocate the trait's genotypic sequences.

Called each time a new Individual is created (Individual::init())

Implements TTrait.

Definition at line 69 of file ttwolbachia.h.

References _is_infected.

{_is_infected = 0;}
virtual void TTWolbachia::init_sequence ( ) [inline, virtual]

Called at the start of each replicate, sets the initial genotypes.

Called by Individual::create().

Implements TTrait.

Definition at line 70 of file ttwolbachia.h.

References _is_infected.

{_is_infected = 0;}
virtual void TTWolbachia::mutate ( ) [inline, virtual]

Mutation procedure, perform mutations on the genes sequence.

Implements TTrait.

Definition at line 74 of file ttwolbachia.h.

References _is_infected, _transmit_rate, and RAND::Uniform().

bool TTWolbachia::operator!= ( const TTrait T) [virtual]

Implements TTrait.

Definition at line 98 of file ttwolbachia.cc.

{
  if(!((*this) == T))
    return true;
  else
    return false;
}
TTWolbachia & TTWolbachia::operator= ( const TTrait ) [virtual]

Copies the complete state of the trait from right to left side of the operator, sequence data included.

Implements TTrait.

Definition at line 74 of file ttwolbachia.cc.

References _is_infected, and _transmit_rate.

{
  const TTWolbachia& TD = dynamic_cast<const TTWolbachia&> (T);
  if(this != &TD) {
    _is_infected = TD._is_infected;
    _transmit_rate = TD._transmit_rate;
  }
  return *this;
}
bool TTWolbachia::operator== ( const TTrait ) [virtual]

Checks for parameters equivalence, not genetic equivalence.

Implements TTrait.

Definition at line 86 of file ttwolbachia.cc.

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

{
  if(this->get_type().compare(T.get_type()) != 0) return false;
//  const TTWolbachia& TD = dynamic_cast<const TTWolbachia&> (T);
//  if(this != &TD) {
//    if(_transmit_rate != TD._transmit_rate) return false;
//  }
  return true;
}
virtual void TTWolbachia::reset ( ) [inline, virtual]

Called at the end of each simulation/replicate, deallocates sequence memory.

Implements TTrait.

Definition at line 71 of file ttwolbachia.h.

References _is_infected.

{_is_infected = 0;}
virtual bool TTWolbachia::retrieve_data ( BinaryStorageBuffer reader) [inline, virtual]

Interface to retrieve the same data from the binary buffer.

Implements StorableComponent.

Definition at line 95 of file ttwolbachia.h.

References _is_infected, and BinaryStorageBuffer::read().

  {
    unsigned char dummy;
    reader->read(&dummy, 1);
    _is_infected = dummy;
    return true;
  }
virtual void TTWolbachia::set_sequence ( void **  seq) [inline, virtual]

Called to set the sequence pointer to an existing trait.

Parameters:
seqthe existing sequence pointer

Implements TTrait.

Definition at line 78 of file ttwolbachia.h.

{ }
virtual void* TTWolbachia::set_trait ( void *  value) [inline, virtual]

Called to set the phenotypic to a particular value or to give context-dependant value(s) to the trait.

Parameters:
valuethe value passed to the trait
Returns:
the argument passed

Implements TTrait.

Definition at line 76 of file ttwolbachia.h.

References _is_infected.

  {  _is_infected = *(bool*)value; return &_is_infected; }
void TTWolbachia::set_transmit_rate ( double  val) [inline]

Definition at line 67 of file ttwolbachia.h.

References _transmit_rate.

Referenced by TProtoWolbachia::hatch().

{_transmit_rate = val;}
virtual void TTWolbachia::set_value ( ) [inline, virtual]

Tells the trait to set its phenotype from genotype, should be used instead of getValue().

Implements TTrait.

Definition at line 79 of file ttwolbachia.h.

{ }
virtual void TTWolbachia::show_up ( ) [inline, virtual]

Writes some info to stdout.

Implements TTrait.

Definition at line 84 of file ttwolbachia.h.

{}
virtual void TTWolbachia::store_data ( BinaryStorageBuffer saver) [inline, virtual]

Interface to store the component data (e.g. gene values) into a binary buffer.

Implements StorableComponent.

Definition at line 90 of file ttwolbachia.h.

References _is_infected, and BinaryStorageBuffer::store().

  { 
    unsigned char dummy = static_cast<unsigned char>(_is_infected);
    saver->store(&dummy, 1);
  }

Member Data Documentation

bool TTWolbachia::_is_infected [private]
double TTWolbachia::_transmit_rate [private]

Definition at line 53 of file ttwolbachia.h.

Referenced by mutate(), operator=(), and set_transmit_rate().


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

Generated for Nemo v2.2.0 by  doxygen 1.7.5.1 -- Nemo is hosted by  SourceForge.net Logo