27 lines
772 B
C++
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;
|
|
};
|
|
|