public Objects.AnalizedTuple DAUResearcher(int column, double Entropy, Objects.AnalizedTuple analizedTuple) { DenseAbsorbsUndense denseAbsorbsUndense = new DenseAbsorbsUndense(); List <Objects.AnalizedGroup> analizedGroupsList = analizedTuple.analizedGroups.ToList(); for (int i = 0; i < analizedTuple.analizedGroups.Length; i++) { if (analizedTuple.analizedGroups[i].dispersia > minDispers) { Objects.AnalizedTuple analizedTupleNew = denseAbsorbsUndense.Worker(analizedTuple.analizedGroups[i].participatns, column, Entropy); analizedGroupsList.Remove(analizedTuple.analizedGroups[i]); analizedGroupsList.AddRange(analizedTupleNew.analizedGroups); } } Objects.AnalizedGroup[] analizedGroupsArray = new Objects.AnalizedGroup[analizedGroupsList.Count]; analizedGroupsArray = analizedGroupsList.OrderBy(x => x.mediana).ToArray(); analizedTuple.groupsCount = analizedGroupsArray.Length; analizedTuple.analizedGroups = analizedGroupsArray; return(analizedTuple); }
public void DataGetter(double Upper, double Entropy, int times, int column, bool OneSided) { if (method == DBL) { DistantBecomesLast distantBecomesLast = new DistantBecomesLast(); if (column < inputHumenArray[0].Normalized.Length && !OneSided) { this.Entropy = Entropy; if (times == 0) { this.minDispers = 10000; } EvaluatorDBL(column, times, distantBecomesLast.Sorter(inputHumenArray, column, Upper, Entropy, false)); } else if (column < inputHumenArray[0].Normalized.Length) { bestAnalizedTuplesList.Add(distantBecomesLast.Sorter(inputHumenArray, column, Upper, Entropy, true)); //mainPage.UpdateStats("ended " + column); } else { Objects.AnalizedTuple[] analizedTuplesArray = new Objects.AnalizedTuple[bestAnalizedTuplesList.Count]; analizedTuplesArray = GroupsWritter(bestAnalizedTuplesList.ToArray()); string bestObjects = JsonConvert.SerializeObject(new Objects.AlgorhytmOutPut(inputHumenArray, analizedTuplesArray, method)); if (!Directory.Exists(storageFolder)) { Directory.CreateDirectory(storageFolder); } File.WriteAllText(storageFolder + "\\temp.json", bestObjects); } } else { DenseAbsorbsUndense denseAbsorbsUndense = new DenseAbsorbsUndense(); if (column < inputHumenArray[0].Normalized.Length && !OneSided) { this.Entropy = Entropy; if (times == 0) { this.minDispers = denseAbsorbsUndense.DispersiaOfArray(column, inputHumenArray) / DispersiaDivideIndex; } Objects.AnalizedTuple analizedTuple = denseAbsorbsUndense.Sorter(inputHumenArray, column, Entropy); int step = 0; do { step++; analizedTuple = DAUResearcher(column, Entropy, analizedTuple); } while (analizedTuple.analizedGroups.Any(x => x.dispersia > minDispers) && step < MaxCalls / 5); EvaluatorDAU(column, times, analizedTuple); //mainPage.UpdateStats("ended " + column); } else { Objects.AnalizedTuple[] analizedTuplesArray = new Objects.AnalizedTuple[bestAnalizedTuplesList.Count]; analizedTuplesArray = GroupsWritter(bestAnalizedTuplesList.ToArray()); string bestObjects = JsonConvert.SerializeObject(new Objects.AlgorhytmOutPut(inputHumenArray, analizedTuplesArray, method)); if (!Directory.Exists(storageFolder)) { Directory.CreateDirectory(storageFolder); } File.WriteAllText(storageFolder + "\\temp.json", bestObjects); } } }