Symbiont Class Documentation
-
class Symbiont : public Organism
Subclassed by EfficientSymbiont, PGGSymbiont, Phage
Public Functions
-
inline Symbiont(emp::Ptr<emp::Random> _random, emp::Ptr<SymWorld> _world, emp::Ptr<SymConfigBase> _config, double _intval = 0.0, double _points = 0.0)
The constructor for symbiont
-
Symbiont(const Symbiont&) = default
Input: None
Output: None
Purpose: To force a copy constructor to be generated by the compiler.
-
Symbiont(Symbiont&&) = default
Input: None
Output: None
Purpose: To force a move constructor to be generated by the compiler
-
Symbiont() = default
Input: None
Output: None
Purpose: To tell the compiler to use its default generated variants of the constructor
-
Symbiont &operator=(const Symbiont&) = default
Input: None
Output: None
Purpose: To force a copy assignment operator to be generated by the compiler.
-
Symbiont &operator=(Symbiont&&) = default
Input: None
Output: None
Purpose: To force a move assignment operator to be generated by the compiler.
-
inline ~Symbiont()
Input: None
Output: None
Purpose: To destruct the symbiont and remove the symbiont from the systematic.
-
inline std::string const GetName()
Input: None
Output: Name of class as string, Symbiont
Purpose: To know which subclass the object is
-
inline void SetReproCount(size_t _in)
Input: Set the reproduction counter
Output: None
Purpose: To set the count of reproductions in this lineage.
-
inline size_t GetReproCount()
Input: None.
Output: The reproduction count
Purpose: To get the count of reproductions in this lineage.
-
inline void SetTowardsPartnerCount(size_t _in)
Input: Set the flips towards a partner counter
Output: None
Purpose: To set the count of flips towards a partner in this lineage.
-
inline size_t GetTowardsPartnerCount()
Input: None.
Output: The flips towards a partner count
Purpose: To get the count of flips towards a partner in this lineage.
-
inline void SetFromPartnerCount(size_t _in)
Input: Set the flips from a partner counter
Output: None
Purpose: To set the count of flips from a partner in this lineage.
-
inline size_t GetFromPartnerCount()
Input: None.
Output: The flips from a partner count
Purpose: To get the count of flips from a partner in this lineage.
-
inline double GetIntVal() const
Input: None
Output: The double representing the symbiont’s interaction value
Purpose: To get a symbiont’s interaction value.
-
inline double GetPoints()
Input: None
Output: The double representing the symbiont’s points
Purpose: To get a symbiont’s points.
-
inline emp::WorldPosition GetLocation()
Input: None
Output: The world position of the organism
Purpose: To get the world position of the organism
-
inline bool IsPhage()
Input: None
Output: The bool representing if a symbiont is a phage
Purpose: To determine if a symbiont is a phage
-
inline bool IsHost()
Input: None
Output: The bool representing if a symbiont is a host
Purpose: To determine if a symbiont is a host
-
inline double GetInfectionChance()
Input: None
Output: The chance of a symbiont infecting a parallel host during process
Purpose: To determine a symbiont’s infection chance
-
inline emp::Ptr<Organism> GetHost()
Input: None
Output: The pointer to a symbiont’s host
Purpose: To retrieve a symbiont’s host
-
inline emp::Ptr<taxon_t::base_taxon_t> GetTaxon()
Input: None
Output: The pointer to the symbiont’s taxon
Purpose: To retrieve the symbiont’s taxon
-
inline void SetTaxon(emp::Ptr<taxon_t::base_taxon_t> _in)
Input: A pointer to the taxon that this organism should belong to.
Output: None
Purpose: To set the symbiont’s taxon
-
inline void SetTag(emp::BitSet<TAG_LENGTH> &_in)
Input: The new tag
Output: None
Purpose: To set a symbiont’s tag.
-
inline emp::BitSet<TAG_LENGTH> &GetTag()
Input: None
Output: The symbiont’s tag.
Purpose: To get a symbiont’s tag.
-
inline void SetDead()
Input: None
Output: None
Purpose: To set a symbiont to dead
-
inline bool GetDead()
Input: None
Output: The bool representing if a symbiont is dead
Purpose: To determine if a symbiont is dead
-
inline void SetIntVal(double _in)
Input: The double representing the new interaction value of a symbiont
Output: None
Purpose: To set a symbiont’s interaction value
-
inline void SetPoints(double _in)
Input: The double representing the points to be set as a symbiont’s points
Output: None
Purpose: To set a symbiont’s points
-
inline void AddPoints(double _in)
Input: The double representing the points to be added to a symbiont’s points
Output: None
Purpose: To increment a symbiont’s points
-
inline void SetLocation(emp::WorldPosition _in)
Input: A new world position
Output: None
Purpose: To set the organism’s world position
-
inline int GetAge()
Input: None
Output: an int representing the current age of the Symbiont
Purpose: To get the Symbiont’s age.
-
inline void SetAge(int _in)
Input: An int of what age the Symbiont should be set to
Output: None
Purpose: To set the Symbiont’s age for testing purposes.
-
inline void SetHost(emp::Ptr<Organism> _in)
Input: The pointer to an organism that will be set as the symbiont’s host
Output: None
Purpose: To set a symbiont’s host
-
inline void SetInfectionChance(double _in)
Input: The double that will be the symbiont’s infection chance
Output: None
Purpose: To set a symbiont’s infection host and check that the proposed value is valid.
-
inline void UponInjection()
Input: None
Output: None
Purpose: Does nothing for now, added for backwards compatibility from phage to symbiont
-
inline void GrowOlder()
Input: None
Output: None
Purpose: Increments age by one and kills it if too old.
-
inline void Mutate()
Input: None
Output: None
Purpose: To mutate a symbiont’s interaction value. The mutation value is chosen from a normal distribution centered on 0 with the mutation size as the standard deviation.
-
inline double ProcessResources(double host_donation, emp::Ptr<Organism> host = nullptr)
Input: The double representing the resources to be distributed to the symbiont and (optionally) the host from whom it comes; if no host is provided, the symbiont’s host variable is used.
Output: The double representing the host’s resources
Purpose: To process and distribute resources.
-
inline bool WantsToInfect()
Input: None
Output: The boolean representing if a symbiont will seek out to infect a host.
Purpose: To determine if a symbiont wants to infect a host based upon its infection chance
-
inline bool InfectionFails()
Input: None
Output: The boolean representing if a symbiont will survive crossing over into the host world.
Purpose: To determine if a symbiont will survive crossing over into the host world based on infection risk.
-
inline void LoseResources(double resources)
Input: The double representing the resources given by the world.
Output: None
Purpose: Free living symbionts specialized to interact with hosts (extreme interaction value in either direction) lose some of the resources that they get from the world.
-
inline void Process(emp::WorldPosition location)
Input: A WorldPosition parameter describing the location of the symbiont; ID is where they are in the world, INDEX is where they are in the host’s symbiont list (or 0 if they’re free living).
Output: None
Purpose: To process a symbiont, meaning to check for reproduction, distribute resources, and to allow for movement
-
inline emp::Ptr<Organism> MakeNew()
Input: None
Output: The pointer to the newly created organism
Purpose: To produce a new symbiont, identical to the original
-
inline emp::Ptr<Organism> Reproduce()
Input: None
Output: The pointer to the newly created organism
Purpose: To produce a new symbiont; does not remove resources from the parent, assumes that is handled by calling function
-
inline virtual bool MeetsVTRequirements()
Input: None
Output: Whether the symbiont is able to vertically transmit
Purpose: To answer if this symbiont has enough points to vertically transmit
-
inline std::optional<emp::Ptr<Organism>> VerticalTransmission(emp::Ptr<Organism> host_baby)
Input: The pointer to the organism that is the new host baby
Output: Return symbiont offspring on success; std::nullopt otherwise.
Purpose: To allow for vertical transmission to occur
-
inline void HorizontalTransmission(emp::WorldPosition location)
Input: The location of the organism as a emp::WorldPosition(<index of sym in host +1>, <index of host in world>)
Output: None
Purpose: To check and allow for horizontal transmission to occur
-
inline Symbiont(emp::Ptr<emp::Random> _random, emp::Ptr<SymWorld> _world, emp::Ptr<SymConfigBase> _config, double _intval = 0.0, double _points = 0.0)