Example #1
0
        private static void PrepareClusteredDataObject(DataObject dataObject, ICollection <ClusteredDataObject> clusteredDataObjects)
        {
            var clusteredDataObject = new ClusteredDataObject
            {
                Decision = dataObject.Decision
            };

            PrepareClusteredDataObjectArguments(dataObject, clusteredDataObject);
            clusteredDataObjects.Add(clusteredDataObject);
        }
Example #2
0
        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);
        }
Example #3
0
        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;
            }
        }
Example #4
0
        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);
        }
Example #5
0
 private static void PrepareClusteredDataObjectArguments(DataObject dataObject, ClusteredDataObject clusteredDataObject)
 {
     for (var i = 0; i < dataObject.Arguments.Count; i++)
     {
         SetNewArgumentValue(dataObject, clusteredDataObject, i);
     }
 }
Example #6
0
        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;
            }
        }