00001 using System; 00002 using System.Collections.Generic; 00003 using System.Linq; 00004 using System.Text; 00005 00006 namespace GEP.Core.Common.GeneticOperators.GenotypeSelection 00007 { 00014 [Serializable] 00015 public class Every : GenotypeSelection 00016 { 00022 protected int _selectionSize; 00027 protected int[][] _selection; 00028 00035 public Every(int selectionSize) 00036 { 00037 _selectionSize = selectionSize; 00038 _selection = new int[selectionSize][]; 00039 for (int i = 0; i < selectionSize; i++) 00040 { 00041 _selection[i] = new int[1]; 00042 _selection[i][0] = i; 00043 } 00044 } 00045 00046 public int[][] Select(ref int selectionStartIndex, ref int selectionEndIndex, Population population) 00047 { 00048 selectionStartIndex = 0; 00049 selectionEndIndex = _selection.Length - 1; 00050 return _selection; 00051 } 00052 00053 public int[][] Select(Population population) 00054 { 00055 return _selection; 00056 } 00057 } 00058 }