예제 #1
0
 public void Mutate(GenomInstance Instance)
 {
     foreach (Base b in Bases)
     {
         Instance.Bases[b.Index].Mutate();
     }
 }
예제 #2
0
 public void Randomize(GenomInstance Instance)
 {
     foreach (Base b in Bases)
     {
         Instance.Bases[b.Index].Randomize();
     }
 }
예제 #3
0
        public GenomInstance Clone(GenomInstance Instance)
        {
            GenomInstance NewInstance = CreateInstance();

            foreach (Base b in Bases)
            {
                NewInstance.Bases[b.Index].Value = Instance.Bases[b.Index].Value;
            }
            return(NewInstance);
        }
예제 #4
0
        public GenomInstance CreateInstance()
        {
            GenomInstance Instance = new GenomInstance(this);

            foreach (Base b in Bases)
            {
                Instance.Bases[b.Index] = new BaseInstance(b);
            }

            return(Instance);
        }
예제 #5
0
        public GenomInstance Cross(GenomInstance A, GenomInstance B)
        {
            GenomInstance Instance = CreateInstance();

            foreach (Base b in Bases)
            {
                if (Simulation.random.Next(2) == 0)
                {
                    Instance.Bases[b.Index].Value = A.Bases[b.Index].Value;
                }
                else
                {
                    Instance.Bases[b.Index].Value = B.Bases[b.Index].Value;
                }
            }

            return(Instance);
        }
예제 #6
0
 public GenomInstance Cross(GenomInstance Other)
 {
     return(GenomT.Cross(this, Other));
 }