public static ChromosomeUintToJson ToJsonAdapter(this IChromosomeUint chromosomeUint)
        {
            var chromosomeUintToJson = new ChromosomeUintToJson
            {
                MaxVal   = chromosomeUint.MaxVal,
                Sequence = chromosomeUint.Sequence.ToList()
            };

            return(chromosomeUintToJson);
        }
Ejemplo n.º 2
0
 public static ISorterGenome Make(
     Guid guid,
     Guid parentGuid,
     IChromosomeUint chromosome,
     int keyCount,
     int keyPairCount)
 {
     return(new SorterGenomeImpl
            (
                guid: guid,
                parentGuid: parentGuid,
                chromosome: chromosome,
                keyCount: keyCount,
                keyPairCount: keyPairCount
            ));
 }
 public SwitchableGroupGenomeImpl
 (
     Guid guid,
     Guid parentGuid,
     int keyCount,
     IChromosomeUint chromosome,
     int groupCount
 )
     : base
     (
         guid: guid,
         chromosome: chromosome,
         parentGuid: parentGuid
     )
 {
     _keyCount = keyCount;
     _switchableGroupGenomeType = SwitchableGroupGenomeType.UInt;
     _groupCount = groupCount;
 }
 public static string ToJsonString(this IChromosomeUint chromosomeUint)
 {
     return(JsonConvert.SerializeObject(chromosomeUint.ToJsonAdapter(), Formatting.Indented));
 }