public void testCurrentValueFor()
        {
            MixedRadixNumber mrn;

            //
            mrn = new MixedRadixNumber(0, new int[] { 3, 3, 2, 2 });
            Assert.AreEqual(0, mrn.GetCurrentValueFor(new int[] { 0, 0, 0, 0 }));
            //
            mrn = new MixedRadixNumber(35, new int[] { 3, 3, 2, 2 });
            Assert.AreEqual(35,
                            mrn.GetCurrentValueFor(new int[] { 2, 2, 1, 1 }));
            //
            mrn = new MixedRadixNumber(25, new int[] { 3, 3, 2, 2 });
            Assert.AreEqual(25,
                            mrn.GetCurrentValueFor(new int[] { 1, 2, 0, 1 }));
            //
            mrn = new MixedRadixNumber(17, new int[] { 3, 3, 2, 2 });
            Assert.AreEqual(17,
                            mrn.GetCurrentValueFor(new int[] { 2, 2, 1, 0 }));
            //
            mrn = new MixedRadixNumber(8, new int[] { 3, 3, 2, 2 });
            Assert.AreEqual(8, mrn.GetCurrentValueFor(new int[] { 2, 2, 0, 0 }));
            //
            mrn = new MixedRadixNumber(359, new int[] { 3, 4, 5, 6 });
            Assert.AreEqual(359,
                            mrn.GetCurrentValueFor(new int[] { 2, 3, 4, 5 }));
            //
            mrn = new MixedRadixNumber(359, new int[] { 6, 5, 4, 3 });
            Assert.AreEqual(359,
                            mrn.GetCurrentValueFor(new int[] { 5, 4, 3, 2 }));
        }
            //
            //
            private void updateQuotient(double probability)
            {
                int offset = (int)qMRN.GetCurrentValueFor(qRVs);

                if (0 == probability)
                {
                    quotient.getValues()[offset] = 0;
                }
                else
                {
                    quotient.getValues()[offset] += probabilityTable.getValues()[offset] / probability;
                }
            }
        /**
         * Iterate over all possible values assignments for the Random Variables
         * comprising this ProbabilityTable that are not in the fixed set of values.
         * This allows you to iterate over a subset of possible combinations.
         *
         * @param pti
         *            the ProbabilityTable Iterator to iterate
         * @param fixedValues
         *            Fixed values for a subset of the Random Variables comprising
         *            this Probability Table.
         */
        public void iterateOverTable(IIterator pti, params AssignmentProposition[] fixedValues)
        {
            IMap <IRandomVariable, object> possibleWorld = CollectionFactory.CreateInsertionOrderedMap <IRandomVariable, object>();
            MixedRadixNumber tableMRN = new MixedRadixNumber(0, radices);

            int[] tableRadixValues = new int[radices.Length];

            // Assert that the Random Variables for the fixed values
            // are part of this probability table and assign
            // all the fixed values to the possible world.
            foreach (AssignmentProposition ap in fixedValues)
            {
                if (!randomVarInfo.ContainsKey(ap.getTermVariable()))
                {
                    throw new IllegalArgumentException("Assignment proposition ["
                                                       + ap + "] does not belong to this probability table.");
                }
                possibleWorld.Put(ap.getTermVariable(), ap.getValue());
                RVInfo fixedRVI = randomVarInfo.Get(ap.getTermVariable());
                tableRadixValues[fixedRVI.getRadixIdx()] = fixedRVI
                                                           .getIdxForDomain(ap.getValue());
            }
            // If have assignments for all the random variables
            // in this probability table
            if (fixedValues.Length == randomVarInfo.Size())
            {
                // Then only 1 iteration call is required.
                pti.iterate(possibleWorld, getValue(fixedValues));
            }
            else
            {
                // Else iterate over the non-fixed values
                ISet <IRandomVariable> freeVariables = SetOps.difference(
                    CollectionFactory.CreateSet <IRandomVariable>(this.randomVarInfo.GetKeys()),
                    CollectionFactory.CreateSet <IRandomVariable>(possibleWorld.GetKeys()));
                IMap <IRandomVariable, RVInfo> freeVarInfo = CollectionFactory.CreateInsertionOrderedMap <IRandomVariable, RVInfo>();
                // Remove the fixed Variables
                foreach (IRandomVariable fv in freeVariables)
                {
                    freeVarInfo.Put(fv, new RVInfo(fv));
                }
                int[]            freeRadixValues = createRadixs(freeVarInfo);
                MixedRadixNumber freeMRN         = new MixedRadixNumber(0, freeRadixValues);
                object           fval            = null;
                // Iterate through all combinations of the free variables
                do
                {
                    // Put the current assignments for the free variables
                    // into the possible world and update
                    // the current index in the table MRN
                    foreach (RVInfo freeRVI in freeVarInfo.GetValues())
                    {
                        fval = freeRVI.getDomainValueAt(freeMRN
                                                        .GetCurrentNumeralValue(freeRVI.getRadixIdx()));
                        possibleWorld.Put(freeRVI.getVariable(), fval);

                        tableRadixValues[randomVarInfo.Get(freeRVI.getVariable())
                                         .getRadixIdx()] = freeRVI.getIdxForDomain(fval);
                    }
                    pti.iterate(possibleWorld, values[(int)tableMRN
                                                      .GetCurrentValueFor(tableRadixValues)]);
                } while (freeMRN.Increment());
            }
        }