Class PGGHost

Inheritance Relationships

Base Type

Class Documentation

class PGGHost : public Host

Public Functions

PGGHost(emp::Ptr<emp::Random> _random, emp::Ptr<PGGWorld> _world, emp::Ptr<SymConfigBase> _config, double _intval = 0.0, emp::vector<emp::Ptr<Organism>> _syms = {}, emp::vector<emp::Ptr<Organism>> _repro_syms = {}, double _points = 0.0)
PGGHost(const PGGHost&) = default

Input: None

Output: None

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

PGGHost(PGGHost&&) = default

Input: None

Output: None

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

PGGHost() = 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, PGGHost

Purpose: To know which subclass the object is

double GetPool()

Input: None

Output: The double representing the resource pool.

Purpose: To return the double representing the resource pool.

void SetPool(double _in)

Input: A double to be set as the resource pool.

Output: None

Purpose: To set the number of resources in the resource pool.

void AddPool(double _in)

Input: A double to be added to the resource pool.

Output: None

Purpose: To add resources into the host’s resource pool.

void DistribResources(double resources)

Input: A double quantity of resources to be distributed.

Output: None

Purpose: To distribute resources to symbionts and collect resource donations from them.

void DistribPool()

Input: None

Output: None

Purpose: To distribute the resource pool across the hosted symbionts, each donation multiplied by PGG synergy, and then set the resource pool to 0.

emp::Ptr<Organism> MakeNew()

Input: None

Output: A new PGGHost with same properties as this PGGHost.

Purpose: To avoid creating an organism via constructor in other methods.

Protected Attributes

double sourcepool = 0

Purpose: Represents the collective resource pool held by the host.

emp::Ptr<PGGWorld> my_world = NULL

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