示例#1
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="resultFilterOneOrZero">Specify if all results are in 0 or 1 range.</param>
        public static EvaluativeOccurenceResultSet CreateCombinedSet(CombinationMethodEnum combinationMethod, bool resultFilterOneOrZero, EvaluativeOccurenceResultSet[] occurenceSets, int startingIndex, int count)
        {
            //System.Diagnostics.Debug.Fail("FIX ME");

            EvaluativeOccurenceResultSet resultingOccurenceSet = new EvaluativeOccurenceResultSet(startingIndex, count);

            // Result combination.
            foreach (EvaluativeOccurenceResultSet evaluativeOccurenceSet in occurenceSets)
            {
                // Perform combination.
                for (int actualIndex = 0; actualIndex < startingIndex + count; actualIndex++)
                {
                    if (combinationMethod == CombinationMethodEnum.AbsSumming)
                    {
                        resultingOccurenceSet.Values[actualIndex] += Math.Abs(evaluativeOccurenceSet.Values[actualIndex]);
                    }
                    else if (combinationMethod == CombinationMethodEnum.Multiplication)
                    {
                        resultingOccurenceSet.Values[actualIndex] *= evaluativeOccurenceSet.Values[actualIndex];
                    }

                    if (resultFilterOneOrZero && resultingOccurenceSet.Values[actualIndex] != 0)
                    {
                        resultingOccurenceSet.Values[actualIndex] = 1;
                    }
                }
            }

            return(resultingOccurenceSet);
        }
示例#2
0
        public EvaluativeOccurenceResultSet EvaluateNegatives(int startingIndex, int count)
        {
            EvaluativeOccurenceResultSet result = OnEvaluateNegatives(startingIndex, count);

            System.Diagnostics.Debug.Assert(result.CheckPositiveValues(), "Value has been found to be below zero and this was not expected. An occurence is producing invalid results.");
            return(result);
        }
        /// <summary>
        /// 
        /// </summary>
        /// <param name="resultFilterOneOrZero">Specify if all results are in 0 or 1 range.</param>
        public static EvaluativeOccurenceResultSet CreateCombinedSet(CombinationMethodEnum combinationMethod, bool resultFilterOneOrZero, EvaluativeOccurenceResultSet[] occurenceSets, int startingIndex, int count)
        {
            //System.Diagnostics.Debug.Fail("FIX ME");

            EvaluativeOccurenceResultSet resultingOccurenceSet = new EvaluativeOccurenceResultSet(startingIndex, count);

            // Result combination.
            foreach (EvaluativeOccurenceResultSet evaluativeOccurenceSet in occurenceSets)
            {
                // Perform combination.
                for (int actualIndex = 0; actualIndex < startingIndex + count; actualIndex++)
                {
                    if (combinationMethod == CombinationMethodEnum.AbsSumming)
                    {
                        resultingOccurenceSet.Values[actualIndex] += Math.Abs(evaluativeOccurenceSet.Values[actualIndex]);
                    }
                    else if (combinationMethod == CombinationMethodEnum.Multiplication)
                    {
                        resultingOccurenceSet.Values[actualIndex] *= evaluativeOccurenceSet.Values[actualIndex];
                    }

                    if (resultFilterOneOrZero && resultingOccurenceSet.Values[actualIndex] != 0)
                    {
                        resultingOccurenceSet.Values[actualIndex] = 1;
                    }
                }
            }

            return resultingOccurenceSet;
        }