Init version
This commit is contained in:
26
individual/Phenotype.h
Normal file
26
individual/Phenotype.h
Normal file
@@ -0,0 +1,26 @@
|
||||
#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;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user