Beispiel #1
0
 public void Mutate(GenomInstance Instance)
 {
     foreach (Base b in Bases)
     {
         Instance.Bases[b.Index].Mutate();
     }
 }
Beispiel #2
0
 public void Randomize(GenomInstance Instance)
 {
     foreach (Base b in Bases)
     {
         Instance.Bases[b.Index].Randomize();
     }
 }
Beispiel #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);
        }
Beispiel #4
0
        public GenomInstance CreateInstance()
        {
            GenomInstance Instance = new GenomInstance(this);

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

            return(Instance);
        }
Beispiel #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);
        }
Beispiel #6
0
 public GenomInstance Cross(GenomInstance Other)
 {
     return(GenomT.Cross(this, Other));
 }