private static void PrepareClusteredDataObject(DataObject dataObject, ICollection <ClusteredDataObject> clusteredDataObjects) { var clusteredDataObject = new ClusteredDataObject { Decision = dataObject.Decision }; PrepareClusteredDataObjectArguments(dataObject, clusteredDataObject); clusteredDataObjects.Add(clusteredDataObject); }
private static AbstractClass CreateNewAbstractClass(List <int> arguments, ClusteredDataObject reductDataObject, int indexOfReductDataObject) { var newAbstractClass = new AbstractClass { ArgumentsValues = arguments, Decision = reductDataObject.Decision, IsClear = true }; newAbstractClass.ObjectsIndexes.Add(indexOfReductDataObject); return(newAbstractClass); }
private static void SetNewArgumentValue(DataObject dataObject, ClusteredDataObject clusteredDataObject, int argumentIndex) { var argumentValue = dataObject.Arguments[argumentIndex]; foreach (var clusterRange in _argumentsClustersRangeList[argumentIndex].ClusterRanges) { if (argumentValue < clusterRange.From || argumentValue > clusterRange.To) { continue; } var indexOfClusterRange = _argumentsClustersRangeList[argumentIndex].ClusterRanges.IndexOf(clusterRange); clusteredDataObject.Arguments.Add(indexOfClusterRange); break; } }
private ClusteredDataObject CreateReductDataObject(ClusteredDataObject clusteredDataObject) { var reductDataObject = new ClusteredDataObject { Decision = clusteredDataObject.Decision }; for (var i = 0; i < clusteredDataObject.Arguments.Count; i++) { if (Subset.Contains(i)) { reductDataObject.Arguments.Add(clusteredDataObject.Arguments[i]); } } return(reductDataObject); }
private static void PrepareClusteredDataObjectArguments(DataObject dataObject, ClusteredDataObject clusteredDataObject) { for (var i = 0; i < dataObject.Arguments.Count; i++) { SetNewArgumentValue(dataObject, clusteredDataObject, i); } }
private void UpdateExistingAbstractClassesWithTheSameArguments(List <int> arguments, ClusteredDataObject reductDataObject, int indexOfReductDataObject, out bool isNewAbstractClass) { isNewAbstractClass = true; foreach (var abstractClass in AbstractClasses.Where(abstractClass => abstractClass.ArgumentsValues.SequenceEqual(arguments))) { isNewAbstractClass = false; abstractClass.ObjectsIndexes.Add(indexOfReductDataObject); if (abstractClass.Decision == reductDataObject.Decision) { continue; } abstractClass.IsClear = false; abstractClass.Decision = null; } }