Update of /cvsroot/quantproject/QuantProject/b1_ADT/Optimizing/Genetic
In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv8463/b1_ADT/Optimizing/Genetic
Modified Files:
GeneticOptimizer.cs Genome.cs
Log Message:
The Property HasBeenChanged has been renamed to HasBeenMutated.
This property is now set by the genetic optimizer directly after the
call of the IGenomeManager's Mutate method (this is now more logical and direct than before).
Index: Genome.cs
===================================================================
RCS file: /cvsroot/quantproject/QuantProject/b1_ADT/Optimizing/Genetic/Genome.cs,v
retrieving revision 1.18
retrieving revision 1.19
diff -C2 -d -r1.18 -r1.19
*** Genome.cs 29 Jun 2007 15:18:21 -0000 1.18
--- Genome.cs 21 Aug 2007 21:52:24 -0000 1.19
***************
*** 39,43 ****
private object meaning;
private bool hasBeenCloned;
! private bool hasBeenChanged;
private IGenomeManager genomeManager;
--- 39,43 ----
private object meaning;
private bool hasBeenCloned;
! private bool hasBeenMutated;
private IGenomeManager genomeManager;
***************
*** 53,62 ****
/// <summary>
! /// Returns true if a gene has been set
! /// by calling SetGeneValue
/// </summary>
! public bool HasBeenChanged
{
! get{return this.hasBeenChanged;}
}
--- 53,63 ----
/// <summary>
! /// Returns true if a gene has been mutated
! /// through a IGenomeManager Mutate method
/// </summary>
! public bool HasBeenMutated
{
! get{return this.hasBeenMutated;}
! set{this.hasBeenMutated = value;}
}
***************
*** 204,208 ****
//the current generation number is stored
this.generation = this.geneticOptimizer.GenerationCounter;
- this.hasBeenChanged = true;
}
--- 205,208 ----
Index: GeneticOptimizer.cs
===================================================================
RCS file: /cvsroot/quantproject/QuantProject/b1_ADT/Optimizing/Genetic/GeneticOptimizer.cs,v
retrieving revision 1.25
retrieving revision 1.26
diff -C2 -d -r1.25 -r1.26
*** GeneticOptimizer.cs 4 Aug 2007 19:57:47 -0000 1.25
--- GeneticOptimizer.cs 21 Aug 2007 21:52:23 -0000 1.26
***************
*** 336,340 ****
System.Console.WriteLine("\r\n" + this.GenerationCounter + " " + genomeNumber + " " + genes + " " +
((Genome)this.currentGeneration[i]).Fitness + " " +
! ((Genome)this.currentGeneration[i]).HasBeenChanged.ToString() + " " +
((Genome)this.currentGeneration[i]).HasBeenCloned.ToString() + " " +
((Genome)this.currentGeneration[i]).Generation + " " +
--- 336,340 ----
System.Console.WriteLine("\r\n" + this.GenerationCounter + " " + genomeNumber + " " + genes + " " +
((Genome)this.currentGeneration[i]).Fitness + " " +
! ((Genome)this.currentGeneration[i]).HasBeenMutated.ToString() + " " +
((Genome)this.currentGeneration[i]).HasBeenCloned.ToString() + " " +
((Genome)this.currentGeneration[i]).Generation + " " +
***************
*** 342,346 ****
// w.Write("\r\n" + this.GenerationCounter + " " + genomeNumber + " " + genes + " " +
// ((Genome)this.currentGeneration[i]).Fitness + " " +
! // ((Genome)this.currentGeneration[i]).HasBeenChanged.ToString() + " " +
// ((Genome)this.currentGeneration[i]).HasBeenCloned.ToString() + " " +
// ((Genome)this.currentGeneration[i]).Generation + " " +
--- 342,346 ----
// w.Write("\r\n" + this.GenerationCounter + " " + genomeNumber + " " + genes + " " +
// ((Genome)this.currentGeneration[i]).Fitness + " " +
! // ((Genome)this.currentGeneration[i]).HasBeenMutated.ToString() + " " +
// ((Genome)this.currentGeneration[i]).HasBeenCloned.ToString() + " " +
// ((Genome)this.currentGeneration[i]).Generation + " " +
***************
*** 491,495 ****
{
if( GenomeManagement.RandomGenerator.Next(0,101) < (int)(this.mutationRate*100) )
! this.genomeManager.Mutate(g);
}
}
--- 491,498 ----
{
if( GenomeManagement.RandomGenerator.Next(0,101) < (int)(this.mutationRate*100) )
! {
! this.genomeManager.Mutate(g);
! g.HasBeenMutated = true;
! }
}
}
|