-
Notifications
You must be signed in to change notification settings - Fork 1
/
GenerationEvent.cs
40 lines (36 loc) · 1.16 KB
/
GenerationEvent.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Georgia
{
public class GenerationEvent : EventArgs
{
public int GenerationNumber { get; set; }
public double AverageFitness { get; set; }
public double MaxFitness { get; set; }
public double MinFitness { get; set; }
public IList<IChromosome> Population { get; set; }
public GenerationEvent()
: base()
{
}
public GenerationEvent(int num, IList<IChromosome> pop, double avgFitness, double minFitness, double maxFitness)
{
GenerationNumber = num;
AverageFitness = avgFitness;
MinFitness = minFitness;
MaxFitness = maxFitness;
Population = pop;
}
public override string ToString()
{
string str = String.Format("Generation #: {0} --- Average Fitness: {1}\r\n", GenerationNumber, AverageFitness);
foreach (IChromosome c in Population)
{
str += c + "\r\n";
}
return str;
}
}
}