forked from giacomelli/GeneticSharp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ICrossover.cs
49 lines (45 loc) · 1.86 KB
/
ICrossover.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
using System.Collections.Generic;
using GeneticSharp.Domain.Chromosomes;
namespace GeneticSharp.Domain.Crossovers
{
/// <summary>
/// Defines a interface for a crossover genetic operator.
/// <remarks>
/// In genetic algorithms, crossover is a genetic operator used to vary the programming of a chromosome
/// or chromosomes from one generation to the next.
/// <para>
/// It is analogous to reproduction and biological crossover, upon which genetic algorithms are based.
/// Cross over is a process of taking more than one parent solutions and producing a child solution from them.
/// </para>
/// <see href="http://en.wikipedia.org/wiki/Crossover_(genetic_algorithm)">Crossover (Genetic Algorithm)</see>
/// </remarks>
/// </summary>
public interface ICrossover : IChromosomeOperator
{
#region Properties
/// <summary>
/// Gets the number of parents need for cross.
/// </summary>
/// <value>The parents number.</value>
int ParentsNumber { get; }
/// <summary>
/// Gets the number of children generated by cross.
/// </summary>
/// <value>The children number.</value>
int ChildrenNumber { get; }
/// <summary>
/// Gets the minimum length of the chromosome supported by the crossover.
/// </summary>
/// <value>The minimum length of the chromosome.</value>
int MinChromosomeLength { get; }
#endregion
#region Methods
/// <summary>
/// Cross the specified parents generating the children.
/// </summary>
/// <param name="parents">The parents chromosomes.</param>
/// <returns>The offspring (children) of the parents.</returns>
IList<IChromosome> Cross(IList<IChromosome> parents);
#endregion
}
}