Files
DEC/individual/Phenotype.h
2024-10-03 18:43:04 +07:00

27 lines
772 B
C++

#pragma once
#include "Trait.h"
#include <vector>
#include <map>
#include <string>
class Phenotype {
friend class GenotypeToPhenotypeStrategy;
friend class InOutBreedingGenotypeToPhenotypeStrategy;
friend class KolchShindyalGenotypeToPhenotypeStrategy;
friend class PhenotypeToFitnessStrategy;
friend std::ostream& operator << (std::ostream& os, const Phenotype& p);
protected:
//std::vector<Trait> traits;
std::map<std::string, Trait> traitsMap;
public:
Phenotype() { };
Phenotype(const std::map<std::string, Trait>& _tm) : traitsMap(_tm) {}
Phenotype(Trait _trait);
Trait getTraitByName(std::string name) const {return this->traitsMap.find(name)->second;};
void addTrait(Trait _trait);
std::string toSimpleString() const;
};