Пример #1
0
		public void AddOrganism( Organism p0 )
		{
			GeneticUtil.CHECKNULLARG( p0 );

			if ( this.IsFull )
			{
				throw new GeneticError( "Cannot add an organism to a full population");
			}

			this.organisms.Add( p0 );
		}
Пример #2
0
		public Organism Clone()
		{
			IChromosome cs = this.Genes.Clone();
			Organism the_clone = new Organism( cs , this.Fitness  );

			if ( the_clone.Genes.GetLength() != this.Genes.GetLength() )
			{
				throw  new GeneticError("Cloned Chromosomes of diffetent lengths");
			}

			return the_clone;
		}
Пример #3
0
		public void Crossover( Organism parent0, Organism parent1, out Organism child0, out Organism child1 )
		{
			child0 = parent0.Clone();
			child1 = parent1.Clone();

			int left;
			int right;
			GeneticUtil.PickCrossOverPoints( parent0.Genes , out left, out right );
			child0.Genes.SwapGenesBetween( left, right, child1.Genes );
		}
Пример #4
0
		public static void RepairCrossover( Organism parent1, Organism parent2)
		{
		}
Пример #5
0
 public static void RepairCrossover(Organism parent1, Organism parent2)
 {
 }