-
-
Notifications
You must be signed in to change notification settings - Fork 335
/
IPopulation.cs
89 lines (77 loc) · 2.59 KB
/
IPopulation.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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
using System;
using System.Collections.Generic;
namespace GeneticSharp
{
/// <summary>
/// Defines an interface for a population of candidate solutions (chromosomes).
/// </summary>
public interface IPopulation
{
#region Events
/// <summary>
/// Occurs when best chromosome changed.
/// </summary>
event EventHandler BestChromosomeChanged;
#endregion
#region Properties
/// <summary>
/// Gets the creation date.
/// </summary>
DateTime CreationDate { get; }
/// <summary>
/// Gets the generations.
/// <remarks>
/// The information of Generations can vary depending of the IGenerationStrategy used.
/// </remarks>
/// </summary>
/// <value>The generations.</value>
IList<Generation> Generations { get; }
/// <summary>
/// Gets the current generation.
/// </summary>
/// <value>The current generation.</value>
Generation CurrentGeneration { get; }
/// <summary>
/// Gets the total number of generations executed.
/// <remarks>
/// Use this information to know how many generations have been executed, because Generations.Count can vary depending of the IGenerationStrategy used.
/// </remarks>
/// </summary>
int GenerationsNumber { get; }
/// <summary>
/// Gets or sets the minimum size.
/// </summary>
/// <value>The minimum size.</value>
int MinSize { get; set; }
/// <summary>
/// Gets or sets the size of the max.
/// </summary>
/// <value>The size of the max.</value>
int MaxSize { get; set; }
/// <summary>
/// Gets the best chromosome.
/// </summary>
/// <value>The best chromosome.</value>
IChromosome BestChromosome { get; }
/// <summary>
/// Gets or sets the generation strategy.
/// </summary>
IGenerationStrategy GenerationStrategy { get; set; }
#endregion
#region Methods
/// <summary>
/// Creates the initial generation.
/// </summary>
void CreateInitialGeneration();
/// <summary>
/// Creates a new generation.
/// </summary>
/// <param name="chromosomes">The chromosomes for new generation.</param>
void CreateNewGeneration(IList<IChromosome> chromosomes);
/// <summary>
/// Ends the current generation.
/// </summary>
void EndCurrentGeneration();
#endregion
}
}