Example #1
0
 //PRE : N/A
 //POST: Factor object will be active
 public void Replace(uint factorValue1, uint factorValue2)
 {
     factorObjOne = new factor(factorValue1);
     factorObjTwo = new factor(factorValue2);
     min_Ping     = INITIAL_VALUE;
     max_Ping     = INITIAL_VALUE;
     ping_Count   = INITIAL_VALUE;
 }
Example #2
0
        /// <summary>
        /// Create, intialize and return factor object array
        /// </summary>
        /// <param name="rand">intialize random object</param>
        /// <param name="obj">initialized mutliQ object</param>
        /// <param name="factors">int array to hold factor values</param>
        /// <returns></returns>
        public static factor[] InitFactorObject(Random rand, multiQ obj, int[] factors)
        {
            Console.WriteLine("Initialize Factor objects.");
            factor[] fObj = new factor[ARR_SIZE];
            int      randNum;

            for (int i = 0; i < ARR_SIZE; i++)
            {
                randNum    = rand.Next(MIN_FACTOR, MAX_FACTOR);
                factors[i] = (randNum);
                fObj[i]    = new factor((uint)randNum);
            }
            return(fObj);
        }
Example #3
0
        public range(uint factorValue1 = DEFAULT_CONSTRUCTOR_FACTOR1,
                     uint factorValue2 = DEFAULT_CONSTRUCTOR_FACTOR2)
        {
            if (factorValue1 == 0)
            {
                factorValue1 = DEFAULT_CONSTRUCTOR_FACTOR1;
            }

            if (factorValue2 == 0)
            {
                factorValue2 = DEFAULT_CONSTRUCTOR_FACTOR2;
            }

            factorObjOne = new factor(factorValue1);
            factorObjTwo = new factor(factorValue2);
            min_Ping     = INITIAL_VALUE;
            max_Ping     = INITIAL_VALUE;
            ping_Count   = INITIAL_VALUE;
        }
Example #4
0
 //PRE : Factor object must be active
 //POST: Stack may not be empty
 //      Stack may get resize
 public bool PushFactorObj(factor obj)
 {
     if (isObjActive)
     {
         if ((factorIndex + 1) < array_Size)
         {
             factorIndex++;
             arrFactorObject[factorIndex] = obj;
             return(true);
         }
         else
         {
             ResizeArray((uint)factorIndex);
             factorIndex++;
             arrFactorObject[factorIndex] = obj;
             return(true);
         }
     }
     return(false);
 }