public SimpleGa(TextComparer posComparer, TextComparer negComparer, SimpleGaParams pars = null) { _pars = pars ?? new SimpleGaParams(); _posComparer = posComparer; _negComparer = negComparer; _rnd = new Random(_pars.Seed); _pTotal = _posComparer.GetAllCites(new[] {(byte) Nucleotide.End}, 1).Count(); _nTotal = _negComparer.GetAllCites(new[] { (byte)Nucleotide.End }, 1).Count(); }
private static void TransTest(int origLen, IEnumerable<ElementGroup> groups, TextComparer cmp) { var cntOrig = 0; var cntTrans = 0; foreach (var gr in groups) { var cnt = cmp.GetAllCites(gr.Chain, gr.Chain.Length); Console.WriteLine(gr + ", otherCnt=" + cnt.Length); cntOrig += gr.Count; cntTrans += cnt.Length; } Console.WriteLine("origFactor=" + cntOrig + ", transFactor=" + Math.Round((double)origLen * cntTrans / cmp.StrokeSize, 3)); }