Exemple #1
0
 public Simulator(MinCogPhenotype phenotype)
 {
     InitializeComponent();
     _random = new Random();
     sim = new MinCogSimulator(phenotype);
     foreach (var h in phenotype.HiddenNodes)
     {
         System.Diagnostics.Debug.WriteLine("Hidden");
         System.Diagnostics.Debug.WriteLine("g:" + h.Gain);
         System.Diagnostics.Debug.WriteLine("t:" + h.TimeConstant);
         foreach (var v in h.UpstreamConnections)
         {
             System.Diagnostics.Debug.WriteLine(v.left.Name + " : " + v.right);
         }
     }
     foreach (var h in phenotype.OutputNodes)
     {
         System.Diagnostics.Debug.WriteLine("Output");
         System.Diagnostics.Debug.WriteLine("g:" + h.Gain);
         System.Diagnostics.Debug.WriteLine("t:" + h.TimeConstant);
         foreach (var v in h.UpstreamConnections)
         {
             System.Diagnostics.Debug.WriteLine(v.left.Name + " : " + v.right);
         }
     }
     testNet(phenotype);
 }
Exemple #2
0
 public override void CalculateFitness(AbstractPhenotype phenotype)
 {
     var sim = new MinCogSimulator.MinCogSimulator((MinCogPhenotype)phenotype);
     sim.Simulate();
     double score = sim.GoodHits - sim.BadHits;
     phenotype.Fitness = (score > 0) ? score : 0;
 }