using System; namespace Science.Biology.PopulationGenetics { /// /// Mating Type /// -- randomMating /// | /// -- non-randomMating /// -- genotype & breedfunctiontype /// -- genotype & hierarchicaltype /// -- phenotype & breedfunctiontype /// -- phenotype & hierarchicaltype /// public class Mating { private bool objectiveMating; private bool phenotypeMating; private bool hierarchicalMating; public Mating() // random mating { objectiveMating = false; hierarchicalMating = false; } private double[,] breed; public double[,] BreedParameter { get { return breed; } } private int female, male; private double modifiedvalue; public int WhichFemale { set { female = value; } } public int WhichMale { set { male = value; } } public double ModifiedValue { set { modifiedvalue = value; } } public void SetBreedParameter() // after set { breed[female, male] = modifiedvalue; } public void ObjectiveMating(GenotypeFemale fg, GenotypeMale mg) // nonrandom - genotype - objective mating { phenotypeMating = false; objectiveMating = true; hierarchicalMating = false; breed = new double[fg.NumberOfAllele,mg.NumberOfAllele]; } public void ObjectiveMating(PhenotypeFemale fph, PhenotypeMale mph) // nonrandom - phenotype - objective mating { phenotypeMating = true; objectiveMating = true; hierarchicalMating = false; breed = new double[fph.NumberOfAllele,mph.NumberOfAllele]; mapFromGenoToPhenoXX = fph.MapFromGenoToPheno; mapFromGenoToPhenoXY = mph.MapFromGenoToPheno; numberOfPhenoAlleleXX = fph.NumberOfAllele; numberOfPhenoAlleleXY = mph.NumberOfAllele; } public void HierarchicalMating(GenotypeFemale fg, GenotypeMale mg) // nonrandom - genotype - hierarchical mating { phenotypeMating = false; objectiveMating = false; hierarchicalMating = true; } public void HierarchicalMating(PhenotypeFemale fph, PhenotypeMale mph) // nonrandom - phenotype - hierarchicalmating { phenotypeMating = true; objectiveMating = false; hierarchicalMating = true; mapFromGenoToPhenoXX = fph.MapFromGenoToPheno; mapFromGenoToPhenoXY = mph.MapFromGenoToPheno; numberOfPhenoAlleleXX = fph.NumberOfAllele; numberOfPhenoAlleleXY = mph.NumberOfAllele; } public bool PhenotypeQ { get{return phenotypeMating;} } public bool ObjectiveQ { get { return objectiveMating; } } public bool HierarchicalQ { get{return hierarchicalMating;} } private int[] mapFromGenoToPhenoXX; private int[] mapFromGenoToPhenoXY; public int[] MapFromGenoToPhenoFemale { get { return mapFromGenoToPhenoXX; } } public int[] MapFromGenoToPhenoMale { get { return mapFromGenoToPhenoXY; } } private int numberOfPhenoAlleleXX; private int numberOfPhenoAlleleXY; public int NumberOfPhenoAlleleFemale { get { return numberOfPhenoAlleleXX; } } public int NumberOfPhenoAlleleMale { get { return numberOfPhenoAlleleXY; } } } }