Пример #1
0
 public static ISorterGenome ToSorterGenome(this SorterGenomeToJson sorterGenomeToJson)
 {
     return(SorterGenome.Make(
                guid: sorterGenomeToJson.Guid,
                keyCount: sorterGenomeToJson.KeyCount,
                parentGuid: sorterGenomeToJson.ParentGuid,
                chromosome: sorterGenomeToJson.ChromosomeUintToJson.ToChromosomeUint(),
                keyPairCount: sorterGenomeToJson.KeyPairCount
                ));
 }
Пример #2
0
 public static Func <ISorterGenome, int, Guid, ISorterGenome> SorterPropigator
 (
     double mutationRate,
     double insertionRate,
     double deletionRate
 )
 {
     return((sg, i, guid) =>
     {
         var randy = Rando.Fast(i);
         return SorterGenome.Make
         (
             guid: guid,
             parentGuid: sg.Guid,
             chromosome: (IChromosomeUint)sg.Chromosome
             .StandardPropigate(randy, mutationRate, insertionRate, deletionRate),
             keyCount: sg.KeyCount,
             keyPairCount: sg.KeyPairCount
         );
     });
 }
Пример #3
0
 protected void OnConvertToGenomesCommand()
 {
     foreach (var sorterVm in SorterGridVm.SorterVms)
     {
         SorterGenomeGridVm.SorterGenomeVms.Add
         (
             new SorterGenomeVm
             (
                 SorterGenome.Make
                 (
                     guid: sorterVm.Guid,
                     parentGuid: Guid.Empty,
                     chromosome: ChromosomeUint.Make
                     (
                         sequence: sorterVm.Sorter.KeyPairs.Select(kp => (uint)kp.Index).ToArray(),
                         maxVal: (uint)KeyPairRepository.KeyPairSetSizeForKeyCount(sorterVm.Sorter.KeyCount)
                     ),
                     keyCount: sorterVm.Sorter.KeyCount,
                     keyPairCount: sorterVm.Sorter.KeyPairCount
                 )
             )
         );
     }
 }