Class Phage

Inheritance Relationships

Base Type

Class Documentation

class Phage : public Symbiont

Public Functions

Phage(emp::Ptr<emp::Random> _random, emp::Ptr<LysisWorld> _world, emp::Ptr<SymConfigBase> _config, double _intval = 0.0, double _points = 0.0)

The constructor for phage

Phage(const Phage&) = default

Input: None

Output: None

Purpose: To force a copy constructor to be generated by the compiler.

Phage(Phage&&) = default

Input: None

Output: None

Purpose: To force a move constructor to be generated by the compiler

Phage() = default

Input: None

Output: None

Purpose: To tell the compiler to use its default generated variants of the constructor

std::string const GetName()

Input: None

Output: Name of class as string, Phage

Purpose: To know which subclass the object is

double GetBurstTimer()

Input: None

Output: The double representing the phage’s burst timer.

Purpose: To get a phage’s burst timer.

void IncBurstTimer()

Input: None

Output: None

Purpose: To increment a phage’s burst timer.

void SetBurstTimer(double _in)

Input: The double to be set as the phage’s burst timer

Output: None

Purpose: To set a phage’s burst timer.

double GetLysisChance()

Input: None

Output: The double representing a phage’s change of lysis.

Purpose: To determine a phage’s chance of lysis.

void SetLysisChance(double _in)

Input: The double to be set as the phage’s chance of lysis.

Output: None

Purpose: To set a phage’s chance of lysis

double GetIncVal()

Input: None

Output: The double representing a phage’s incorporation value.

Purpose: To determine a phage’s incorporation value.

void SetIncVal(double _in)

Input: The double to be set as the phage’s incorporation value.

Output: None

Purpose: To set a phage’s incorporation value.

double GetInductionChance()

Input: None

Output: The double representing a prophage’s chance of induction.

Purpose: To determine a lysogenic phage’s chance of inducing

void SetInductionChance(double _in)

Input: The double to be set as the phage’s chance of induction

Output:None

Purpose: To set a phage’s chance of inducing

bool GetLysogeny()

Input: None

Output: The bool representing if a phage will do lysogeny.

Purpose: To determine if a phage is capable of lysogeny

bool IsPhage()

Input: None

Output: The bool representing if an organism is a phage, always true.

Purpose: To determine if an organism is a phage.

void UponInjection()

Input: None

Output: None

Purpose: To determine if a phage will choose lysis or lysogeny. If a phage chooses to be lytic, their interaction value will be -1 to represent them being antagonistic. If a phage chooses to be lysogenic, their interaction value will be 0 to represent them being neutral.

void Mutate()

Input: None

Output: None

Purpose: To mutate a phage’s chance of lysis. The mutation will be based on a value chosen from a normal distribution centered at 0, with a standard deviation that is equal to the mutation size. Phage mutation can be on or off.

emp::Ptr<Organism> MakeNew()

Input: None

Output: The pointer to the newly created organism

Purpose: To produce a new symbiont, identical to the original

void LysisBurst(emp::WorldPosition location)

Input: location of the phage attempting to horizontally transmit

Output: None

Purpose: To burst host and release offspring

void LysisStep()

Input: None

Output: None

Purpose: To allow lytic phage to produce offspring and increment the burst timer

void VerticalTransmission(emp::Ptr<Organism> host_baby)

Input: A pointer to the baby host to have symbionts added.

Output: None

Purpose: To allow for vertical transmission to occur. lysogenic phage have 100% chance of vertical transmission, lytic phage have 0% chance

double ProcessResources(double host_donation, emp::Ptr<Organism> host = nullptr)

Input: The double representing the resources to be distributed to the phage and (optionally) the host from whom it comes; if no host is provided, the phage’s host variable is used.

Output: The double representing the resources that are left over from what was distributed to the phage.

Purpose: To allow a phage to steal or use donated resources from their host.

void Process(emp::WorldPosition location)

Input: The worldposition representing the location of the phage being processed.

Output: None

Purpose: To process a phage, meaning check for reproduction, check for lysis, and move the phage.

Protected Attributes

double burst_timer = 0

Purpose: Represents the time until lysis will be triggered.

bool lysogeny = false

Purpose: Represents if lysogeny is on.

double incorporation_val = 0.0

Purpose: Represents the compatibility of the prophage to it’s placement within the host’s genome.

double chance_of_lysis = 1

Purpose: Represents the chance of lysis

double induction_chance = 1

Purpose: Represents the chance of a prophage inducing to the lytic process

emp::Ptr<LysisWorld> my_world = NULL

Purpose: Represents the world that the phage are living in.