Ejemplo n.º 1
0
 public static Bernoulli AAverageConditional(Bernoulli b, double penalty)
 {
     double penaltyFactor = Math.Exp(-penalty);
     double bProbTrue = b.GetProbTrue();
     double probTrue = (penaltyFactor * (1 - bProbTrue) + bProbTrue) / (penaltyFactor + 1);
     return new Bernoulli(probTrue);
 }
Ejemplo n.º 2
0
 /// <summary>
 /// Configures constant values that will not change during the lifetime of the class.
 /// </summary>
 /// <remarks>
 /// This method should be called once only after the class is instantiated.  In future, it will likely become
 /// the class constructor.
 /// </remarks>
 public void Reset()
 {
     // Create array for 'firstCoin_uses' backwards messages.
     this.firstCoin_uses_B = new Bernoulli[0];
     this.vBernoulli0 = new Bernoulli(0.5);
     this.firstCoin_F = ArrayHelper.MakeUniform<Bernoulli>(vBernoulli0);
     // Message to 'firstCoin' from Random factor
     this.firstCoin_F = UnaryOp<bool>.RandomAverageConditional<Bernoulli>(this.vBernoulli0);
 }
Ejemplo n.º 3
0
		/// <summary>
		/// Evidence message for VMP.
		/// </summary>
		/// <param name="sample">Incoming message from sample</param>
		/// <param name="logOdds">Incoming message from logOdds</param>
		/// <returns><c>sum_x marginal(x)*log(factor(x))</c></returns>
		/// <remarks><para>
		/// The formula for the result is <c>int log(f(x)) q(x) dx</c>
		/// where <c>x = (sample,logOdds)</c>.
		/// </para></remarks>
		public static double AverageLogFactor(Bernoulli sample, [Proper, SkipIfUniform] Gaussian logOdds)
		{
			if (logOdds.IsUniform()) return 0.0;
			double m, v;
			logOdds.GetMeanAndVariance(out m, out v);
			double t = Math.Sqrt(m * m + v);
			double s = 2 * sample.GetProbTrue() - 1;  // probTrue - probFalse
			return MMath.LogisticLn(t) + (s * m - t) / 2;
		}
Ejemplo n.º 4
0
 /// <summary>
 /// Configures constant values that will not change during the lifetime of the class.
 /// </summary>
 /// <remarks>
 /// This method should be called once only after the class is instantiated.  In future, it will likely become
 /// the class constructor.
 /// </remarks>
 public void Reset()
 {
     // Create array for 'vbool319_uses' backwards messages.
     this.vbool319_uses_B = new Bernoulli[0];
     this.vBernoulli157 = new Bernoulli(0.166666666666667);
     this.vbool319_F = ArrayHelper.MakeUniform<Bernoulli>(vBernoulli157);
     // Message to 'vbool319' from Random factor
     this.vbool319_F = UnaryOp<bool>.RandomAverageConditional<Bernoulli>(this.vBernoulli157);
 }
Ejemplo n.º 5
0
		public void Infer(bool[] treated, bool[] placebo)
		{
			// Set the observed values
			numberPlacebo.ObservedValue = placebo.Length;
			numberTreated.ObservedValue = treated.Length;
			placeboGroupOutcomes.ObservedValue = placebo;
			treatedGroupOutcomes.ObservedValue = treated;

			// Infer the hidden values
			posteriorTreatmentIsEffective = engine.Infer<Bernoulli>(isEffective);
			posteriorProbIfPlacebo = engine.Infer<Beta>(probIfPlacebo);
			posteriorProbIfTreated = engine.Infer<Beta>(probIfTreated);
		}
Ejemplo n.º 6
0
        /// <summary>
        /// Gibbs message to 'choice'.
        /// </summary>
        /// <param name="sample">Constant value for 'sample'.</param>
        /// <param name="probTrue0">Constant value for 'probTrue0'.</param>
        /// <param name="probTrue1">Constant value for 'probTrue1'.</param>
        /// <returns>The outgoing Gibbs message to the 'choice' argument.</returns>
        /// <remarks><para>
        /// The outgoing message is the factor viewed as a function of 'choice' conditioned on the given values.
        /// </para></remarks>
		public static Bernoulli ChoiceConditional(bool sample, double probTrue0, double probTrue1)
		{
            Bernoulli result = new Bernoulli();
			if (probTrue0 == 0 || probTrue1 == 0) throw new ArgumentException("probTrue is zero");
			if (sample) {
				double sum = probTrue0 + probTrue1;
				if(sum == 0.0) throw new AllZeroException();
				else result.SetProbTrue(probTrue1 / sum);
			} else {
				double sum = 2 - probTrue1 - probTrue0;
				if(sum == 0.0) throw new AllZeroException();
				else result.SetProbTrue((1 - probTrue1) / sum);
			}
			return result;
		}
Ejemplo n.º 7
0
		/// <summary>
		/// Evidence message for EP
		/// </summary>
		/// <param name="isPositive">Incoming message from 'isPositive'.</param>
		/// <param name="x">Incoming message from 'x'.</param>
		/// <returns>Logarithm of the factor's average value across the given argument distributions</returns>
		/// <remarks><para>
		/// The formula for the result is <c>log(sum_(isPositive,x) p(isPositive,x) factor(isPositive,x))</c>.
		/// </para></remarks>
		public static double LogAverageFactor(Bernoulli isPositive, Gaussian x)
		{
			if (isPositive.IsPointMass && x.Precision == 0) {
				double tau = x.MeanTimesPrecision;
				if (isPositive.Point && tau < 0) {
					// int I(x>0) exp(tau*x) dx = -1/tau
					return -Math.Log(-tau);
				}
				if (!isPositive.Point && tau > 0) {
					// int I(x<0) exp(tau*x) dx = 1/tau
					return -Math.Log(tau);
				}
			}
			Bernoulli to_isPositive = IsPositiveAverageConditional(x);
			return isPositive.GetLogAverageOf(to_isPositive);
		}
Ejemplo n.º 8
0
		/// <summary>
		/// Generates a data set from a particular true model.
		/// </summary>
		public Vector[] GenerateData(int nData)
		{
			Vector trueM1 = Vector.FromArray(2.0, 3.0);
			Vector trueM2 = Vector.FromArray(7.0, 5.0);
			PositiveDefiniteMatrix trueP1 = new PositiveDefiniteMatrix(
				new double[,] { { 3.0, 0.2 }, { 0.2, 2.0 } });
			PositiveDefiniteMatrix trueP2 = new PositiveDefiniteMatrix(
				new double[,] { { 2.0, 0.4 }, { 0.4, 4.0 } });
			VectorGaussian trueVG1 = VectorGaussian.FromMeanAndPrecision(trueM1, trueP1);
			VectorGaussian trueVG2 = VectorGaussian.FromMeanAndPrecision(trueM2, trueP2);
			double truePi = 0.6;
			Bernoulli trueB = new Bernoulli(truePi);
			// Restart the infer.NET random number generator
			Rand.Restart(12347);
			Vector[] data = new Vector[nData];
			for (int j = 0; j < nData; j++) {
				bool bSamp = trueB.Sample();
				data[j] = bSamp ? trueVG1.Sample() : trueVG2.Sample();
			}
			return data;
		}
		/// <summary>
		/// Evidence message for EP
		/// </summary>
		/// <param name="isPositive">Incoming message from 'isPositive'.</param>
		/// <param name="x">Incoming message from 'x'.</param>
		/// <returns>Logarithm of the factor's average value across the given argument distributions</returns>
		/// <remarks><para>
		/// The formula for the result is <c>log(sum_(isPositive,x) p(isPositive,x) factor(isPositive,x))</c>.
		/// </para></remarks>
		public static double LogAverageFactor(Bernoulli isPositive, Gaussian x)
		{
			Bernoulli to_isPositive = IsPositiveAverageConditional(x);
			return isPositive.GetLogAverageOf(to_isPositive);
#if false
			// Z = p(b=T) p(x > 0) + p(b=F) p(x <= 0)
			//   = p(b=F) + (p(b=T) - p(b=F)) p(x > 0)
			if (x.IsPointMass) {
				return Factor.IsPositive(x.Point) ? isPositive.GetLogProbTrue() : isPositive.GetLogProbFalse();
			} else if(x.IsUniform()) {
				return Bernoulli.LogProbEqual(isPositive.LogOdds,0.0);
			} else {
				// m/sqrt(v) = (m/v)/sqrt(1/v)
				double z = x.MeanTimesPrecision / Math.Sqrt(x.Precision);
				if (isPositive.IsPointMass) {
					return isPositive.Point ? MMath.NormalCdfLn(z) : MMath.NormalCdfLn(-z);
				} else {
					return MMath.LogSumExp(isPositive.GetLogProbTrue() + MMath.NormalCdfLn(z), isPositive.GetLogProbFalse() + MMath.NormalCdfLn(-z));
				}
			}
#endif
		}
Ejemplo n.º 10
0
#pragma warning disable 1591
        /// <summary>Evidence message for EP.</summary>
        /// <param name="and">Incoming message from <c>and</c>.</param>
        /// <param name="a">Constant value for <c>a</c>.</param>
        /// <param name="b">Incoming message from <c>b</c>.</param>
        /// <returns>Logarithm of the factor's average value across the given argument distributions.</returns>
        /// <remarks>
        ///   <para>The formula for the result is <c>log(sum_(and,b) p(and,b) factor(and,a,b))</c>.</para>
        /// </remarks>
        public static double LogAverageFactor(Bernoulli and, bool a, Bernoulli b)
        {
            Bernoulli to_and = AndAverageConditional(a, b);

            return(to_and.GetLogAverageOf(and));
        }
Ejemplo n.º 11
0
 /// <summary>
 /// Configures constant values that will not change during the lifetime of the class.
 /// </summary>
 /// <remarks>
 /// This method should be called once only after the class is instantiated.  In future, it will likely become
 /// the class constructor.
 /// </remarks>
 public void Reset()
 {
     // Create array for 'vbool29_uses' backwards messages.
     this.vbool29_uses_B = new Bernoulli[1];
     this.vBernoulli37 = new Bernoulli(0.5);
     for(int _ind0 = 0; _ind0<1; _ind0++)
     {
         this.vbool29_uses_B[_ind0] = ArrayHelper.MakeUniform<Bernoulli>(this.vBernoulli37);
     }
     this.vbool29_F = ArrayHelper.MakeUniform<Bernoulli>(vBernoulli37);
     // Message to 'vbool29' from Random factor
     this.vbool29_F = UnaryOp<bool>.RandomAverageConditional<Bernoulli>(this.vBernoulli37);
     // Create array for 'vbool21_uses' backwards messages.
     this.vbool21_uses_B = new Bernoulli[2];
     this.vBernoulli29 = new Bernoulli(0.5);
     for(int _ind0 = 0; _ind0<2; _ind0++)
     {
         this.vbool21_uses_B[_ind0] = ArrayHelper.MakeUniform<Bernoulli>(this.vBernoulli29);
     }
     this.vbool21_F = ArrayHelper.MakeUniform<Bernoulli>(vBernoulli29);
     // Message to 'vbool21' from Random factor
     this.vbool21_F = UnaryOp<bool>.RandomAverageConditional<Bernoulli>(this.vBernoulli29);
     // Create array for 'vbool296_uses' backwards messages.
     this.vbool296_uses_B = new Bernoulli[1];
     for(int _ind0 = 0; _ind0<1; _ind0++)
     {
         this.vbool296_uses_B[_ind0] = ArrayHelper.MakeUniform<Bernoulli>(new Bernoulli());
     }
     this.vbool296_F = ArrayHelper.MakeUniform<Bernoulli>(new Bernoulli());
     // Create array for 'vbool133_uses' backwards messages.
     this.vbool133_uses_B = new Bernoulli[3];
     this.vBernoulli141 = new Bernoulli(0.5);
     for(int _ind0 = 0; _ind0<3; _ind0++)
     {
         this.vbool133_uses_B[_ind0] = ArrayHelper.MakeUniform<Bernoulli>(this.vBernoulli141);
     }
     this.vbool133_F = ArrayHelper.MakeUniform<Bernoulli>(vBernoulli141);
     // Message to 'vbool133' from Random factor
     this.vbool133_F = UnaryOp<bool>.RandomAverageConditional<Bernoulli>(this.vBernoulli141);
     // Create array for 'vbool360_uses' backwards messages.
     this.vbool360_uses_B = new Bernoulli[1];
     for(int _ind0 = 0; _ind0<1; _ind0++)
     {
         this.vbool360_uses_B[_ind0] = ArrayHelper.MakeUniform<Bernoulli>(new Bernoulli());
     }
     this.vbool360_F = ArrayHelper.MakeUniform<Bernoulli>(new Bernoulli());
     // Create array for 'vbool117_uses' backwards messages.
     this.vbool117_uses_B = new Bernoulli[2];
     this.vBernoulli125 = new Bernoulli(0.5);
     for(int _ind0 = 0; _ind0<2; _ind0++)
     {
         this.vbool117_uses_B[_ind0] = ArrayHelper.MakeUniform<Bernoulli>(this.vBernoulli125);
     }
     this.vbool117_F = ArrayHelper.MakeUniform<Bernoulli>(vBernoulli125);
     // Message to 'vbool117' from Random factor
     this.vbool117_F = UnaryOp<bool>.RandomAverageConditional<Bernoulli>(this.vBernoulli125);
     // Create array for 'vbool344_uses' backwards messages.
     this.vbool344_uses_B = new Bernoulli[1];
     for(int _ind0 = 0; _ind0<1; _ind0++)
     {
         this.vbool344_uses_B[_ind0] = ArrayHelper.MakeUniform<Bernoulli>(new Bernoulli());
     }
     this.vbool344_F = ArrayHelper.MakeUniform<Bernoulli>(new Bernoulli());
     // Create array for 'vbool125_uses' backwards messages.
     this.vbool125_uses_B = new Bernoulli[2];
     this.vBernoulli133 = new Bernoulli(0.5);
     for(int _ind0 = 0; _ind0<2; _ind0++)
     {
         this.vbool125_uses_B[_ind0] = ArrayHelper.MakeUniform<Bernoulli>(this.vBernoulli133);
     }
     this.vbool125_F = ArrayHelper.MakeUniform<Bernoulli>(vBernoulli133);
     // Message to 'vbool125' from Random factor
     this.vbool125_F = UnaryOp<bool>.RandomAverageConditional<Bernoulli>(this.vBernoulli133);
     // Create array for 'vbool352_uses' backwards messages.
     this.vbool352_uses_B = new Bernoulli[1];
     for(int _ind0 = 0; _ind0<1; _ind0++)
     {
         this.vbool352_uses_B[_ind0] = ArrayHelper.MakeUniform<Bernoulli>(new Bernoulli());
     }
     this.vbool352_F = ArrayHelper.MakeUniform<Bernoulli>(new Bernoulli());
     // Create array for 'vbool94_uses' backwards messages.
     this.vbool94_uses_B = new Bernoulli[2];
     this.vBernoulli102 = new Bernoulli(0.01);
     for(int _ind0 = 0; _ind0<2; _ind0++)
     {
         this.vbool94_uses_B[_ind0] = ArrayHelper.MakeUniform<Bernoulli>(this.vBernoulli102);
     }
     this.vbool94_F = ArrayHelper.MakeUniform<Bernoulli>(vBernoulli102);
     // Message to 'vbool94' from Random factor
     this.vbool94_F = UnaryOp<bool>.RandomAverageConditional<Bernoulli>(this.vBernoulli102);
     // Create array for 'vbool336_uses' backwards messages.
     this.vbool336_uses_B = new Bernoulli[1];
     for(int _ind0 = 0; _ind0<1; _ind0++)
     {
         this.vbool336_uses_B[_ind0] = ArrayHelper.MakeUniform<Bernoulli>(new Bernoulli());
     }
     this.vbool336_F = ArrayHelper.MakeUniform<Bernoulli>(new Bernoulli());
     // Create array for 'vbool55_uses' backwards messages.
     this.vbool55_uses_B = new Bernoulli[3];
     this.vBernoulli63 = new Bernoulli(0.5);
     for(int _ind0 = 0; _ind0<3; _ind0++)
     {
         this.vbool55_uses_B[_ind0] = ArrayHelper.MakeUniform<Bernoulli>(this.vBernoulli63);
     }
     this.vbool55_F = ArrayHelper.MakeUniform<Bernoulli>(vBernoulli63);
     // Message to 'vbool55' from Random factor
     this.vbool55_F = UnaryOp<bool>.RandomAverageConditional<Bernoulli>(this.vBernoulli63);
     // Create array for 'vbool320_uses' backwards messages.
     this.vbool320_uses_B = new Bernoulli[1];
     for(int _ind0 = 0; _ind0<1; _ind0++)
     {
         this.vbool320_uses_B[_ind0] = ArrayHelper.MakeUniform<Bernoulli>(new Bernoulli());
     }
     this.vbool320_F = ArrayHelper.MakeUniform<Bernoulli>(new Bernoulli());
     // Create array for 'vbool172_uses' backwards messages.
     this.vbool172_uses_B = new Bernoulli[2];
     this.vBernoulli180 = new Bernoulli(0.01);
     for(int _ind0 = 0; _ind0<2; _ind0++)
     {
         this.vbool172_uses_B[_ind0] = ArrayHelper.MakeUniform<Bernoulli>(this.vBernoulli180);
     }
     this.vbool172_F = ArrayHelper.MakeUniform<Bernoulli>(vBernoulli180);
     // Message to 'vbool172' from Random factor
     this.vbool172_F = UnaryOp<bool>.RandomAverageConditional<Bernoulli>(this.vBernoulli180);
     // Create array for 'vbool457_uses' backwards messages.
     this.vbool457_uses_B = new Bernoulli[1];
     for(int _ind0 = 0; _ind0<1; _ind0++)
     {
         this.vbool457_uses_B[_ind0] = ArrayHelper.MakeUniform<Bernoulli>(new Bernoulli());
     }
     this.vbool457_F = ArrayHelper.MakeUniform<Bernoulli>(new Bernoulli());
     // Create array for 'vbool47_uses' backwards messages.
     this.vbool47_uses_B = new Bernoulli[2];
     this.vBernoulli55 = new Bernoulli(0.5);
     for(int _ind0 = 0; _ind0<2; _ind0++)
     {
         this.vbool47_uses_B[_ind0] = ArrayHelper.MakeUniform<Bernoulli>(this.vBernoulli55);
     }
     this.vbool47_F = ArrayHelper.MakeUniform<Bernoulli>(vBernoulli55);
     // Message to 'vbool47' from Random factor
     this.vbool47_F = UnaryOp<bool>.RandomAverageConditional<Bernoulli>(this.vBernoulli55);
     // Create array for 'vbool304_uses' backwards messages.
     this.vbool304_uses_B = new Bernoulli[1];
     for(int _ind0 = 0; _ind0<1; _ind0++)
     {
         this.vbool304_uses_B[_ind0] = ArrayHelper.MakeUniform<Bernoulli>(new Bernoulli());
     }
     this.vbool304_F = ArrayHelper.MakeUniform<Bernoulli>(new Bernoulli());
     // Create array for 'vbool73_uses' backwards messages.
     this.vbool73_uses_B = new Bernoulli[2];
     this.vBernoulli81 = new Bernoulli(0.5);
     for(int _ind0 = 0; _ind0<2; _ind0++)
     {
         this.vbool73_uses_B[_ind0] = ArrayHelper.MakeUniform<Bernoulli>(this.vBernoulli81);
     }
     this.vbool73_F = ArrayHelper.MakeUniform<Bernoulli>(vBernoulli81);
     // Message to 'vbool73' from Random factor
     this.vbool73_F = UnaryOp<bool>.RandomAverageConditional<Bernoulli>(this.vBernoulli81);
     // Create array for 'vbool312_uses' backwards messages.
     this.vbool312_uses_B = new Bernoulli[1];
     for(int _ind0 = 0; _ind0<1; _ind0++)
     {
         this.vbool312_uses_B[_ind0] = ArrayHelper.MakeUniform<Bernoulli>(new Bernoulli());
     }
     this.vbool312_F = ArrayHelper.MakeUniform<Bernoulli>(new Bernoulli());
     // Create array for 'vbool164_uses' backwards messages.
     this.vbool164_uses_B = new Bernoulli[2];
     this.vBernoulli172 = new Bernoulli(0.5);
     for(int _ind0 = 0; _ind0<2; _ind0++)
     {
         this.vbool164_uses_B[_ind0] = ArrayHelper.MakeUniform<Bernoulli>(this.vBernoulli172);
     }
     this.vbool164_F = ArrayHelper.MakeUniform<Bernoulli>(vBernoulli172);
     // Message to 'vbool164' from Random factor
     this.vbool164_F = UnaryOp<bool>.RandomAverageConditional<Bernoulli>(this.vBernoulli172);
     // Create array for 'vbool433_uses' backwards messages.
     this.vbool433_uses_B = new Bernoulli[1];
     for(int _ind0 = 0; _ind0<1; _ind0++)
     {
         this.vbool433_uses_B[_ind0] = ArrayHelper.MakeUniform<Bernoulli>(new Bernoulli());
     }
     this.vbool433_F = ArrayHelper.MakeUniform<Bernoulli>(new Bernoulli());
     // Create array for 'vbool3_uses' backwards messages.
     this.vbool3_uses_B = new Bernoulli[1];
     this.vBernoulli11 = new Bernoulli(0.5);
     for(int _ind0 = 0; _ind0<1; _ind0++)
     {
         this.vbool3_uses_B[_ind0] = ArrayHelper.MakeUniform<Bernoulli>(this.vBernoulli11);
     }
     this.vbool3_F = ArrayHelper.MakeUniform<Bernoulli>(vBernoulli11);
     // Message to 'vbool3' from Random factor
     this.vbool3_F = UnaryOp<bool>.RandomAverageConditional<Bernoulli>(this.vBernoulli11);
     // Create array for 'vbool288_uses' backwards messages.
     this.vbool288_uses_B = new Bernoulli[1];
     for(int _ind0 = 0; _ind0<1; _ind0++)
     {
         this.vbool288_uses_B[_ind0] = ArrayHelper.MakeUniform<Bernoulli>(new Bernoulli());
     }
     this.vbool288_F = ArrayHelper.MakeUniform<Bernoulli>(new Bernoulli());
     // Create array for 'vbool81_uses' backwards messages.
     this.vbool81_uses_B = new Bernoulli[2];
     this.vBernoulli89 = new Bernoulli(0.01);
     for(int _ind0 = 0; _ind0<2; _ind0++)
     {
         this.vbool81_uses_B[_ind0] = ArrayHelper.MakeUniform<Bernoulli>(this.vBernoulli89);
     }
     this.vbool81_F = ArrayHelper.MakeUniform<Bernoulli>(vBernoulli89);
     // Message to 'vbool81' from Random factor
     this.vbool81_F = UnaryOp<bool>.RandomAverageConditional<Bernoulli>(this.vBernoulli89);
     // Create array for 'vbool328_uses' backwards messages.
     this.vbool328_uses_B = new Bernoulli[1];
     for(int _ind0 = 0; _ind0<1; _ind0++)
     {
         this.vbool328_uses_B[_ind0] = ArrayHelper.MakeUniform<Bernoulli>(new Bernoulli());
     }
     this.vbool328_F = ArrayHelper.MakeUniform<Bernoulli>(new Bernoulli());
     // Create array for 'vbool146_uses' backwards messages.
     this.vbool146_uses_B = new Bernoulli[2];
     this.vBernoulli154 = new Bernoulli(0.01);
     for(int _ind0 = 0; _ind0<2; _ind0++)
     {
         this.vbool146_uses_B[_ind0] = ArrayHelper.MakeUniform<Bernoulli>(this.vBernoulli154);
     }
     this.vbool146_F = ArrayHelper.MakeUniform<Bernoulli>(vBernoulli154);
     // Message to 'vbool146' from Random factor
     this.vbool146_F = UnaryOp<bool>.RandomAverageConditional<Bernoulli>(this.vBernoulli154);
     // Create array for 'vbool425_uses' backwards messages.
     this.vbool425_uses_B = new Bernoulli[1];
     for(int _ind0 = 0; _ind0<1; _ind0++)
     {
         this.vbool425_uses_B[_ind0] = ArrayHelper.MakeUniform<Bernoulli>(new Bernoulli());
     }
     this.vbool425_F = ArrayHelper.MakeUniform<Bernoulli>(new Bernoulli());
     // Create array for 'vbool458_uses' backwards messages.
     this.vbool458_uses_B = new Bernoulli[1];
     for(int _ind0 = 0; _ind0<1; _ind0++)
     {
         this.vbool458_uses_B[_ind0] = ArrayHelper.MakeUniform<Bernoulli>(new Bernoulli());
     }
     this.vbool458_F = ArrayHelper.MakeUniform<Bernoulli>(new Bernoulli());
     this.vbool296_B = ArrayHelper.MakeUniform<Bernoulli>(new Bernoulli());
     // Create array for 'vbool21_uses' forwards messages.
     this.vbool21_uses_F = new Bernoulli[2];
     for(int _ind0 = 0; _ind0<2; _ind0++)
     {
         this.vbool21_uses_F[_ind0] = ArrayHelper.MakeUniform<Bernoulli>(this.vBernoulli29);
     }
     // Create array for 'vbool29_uses' forwards messages.
     this.vbool29_uses_F = new Bernoulli[1];
     for(int _ind0 = 0; _ind0<1; _ind0++)
     {
         this.vbool29_uses_F[_ind0] = ArrayHelper.MakeUniform<Bernoulli>(this.vBernoulli37);
     }
     // Message to 'vbool29_uses' from UsesEqualDef factor
     this.vbool29_uses_F[0] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool29_uses_B, this.vbool29_F, 0, this.vbool29_uses_F[0]);
     this.vbool360_B = ArrayHelper.MakeUniform<Bernoulli>(new Bernoulli());
     // Create array for 'vbool133_uses' forwards messages.
     this.vbool133_uses_F = new Bernoulli[3];
     for(int _ind0 = 0; _ind0<3; _ind0++)
     {
         this.vbool133_uses_F[_ind0] = ArrayHelper.MakeUniform<Bernoulli>(this.vBernoulli141);
     }
     this.vBernoulli5 = new Bernoulli(0.9);
     // Message to 'vbool296_uses' from EqualRandom factor
     this.vbool296_uses_B[0] = ConstrainEqualRandomOp<bool>.ValueAverageConditional<Bernoulli>(this.vBernoulli5);
     // Message to 'vbool360_uses' from EqualRandom factor
     this.vbool360_uses_B[0] = ConstrainEqualRandomOp<bool>.ValueAverageConditional<Bernoulli>(this.vBernoulli5);
     // Message to 'vbool344_uses' from EqualRandom factor
     this.vbool344_uses_B[0] = ConstrainEqualRandomOp<bool>.ValueAverageConditional<Bernoulli>(this.vBernoulli5);
     // Message to 'vbool352_uses' from EqualRandom factor
     this.vbool352_uses_B[0] = ConstrainEqualRandomOp<bool>.ValueAverageConditional<Bernoulli>(this.vBernoulli5);
     // Message to 'vbool336_uses' from EqualRandom factor
     this.vbool336_uses_B[0] = ConstrainEqualRandomOp<bool>.ValueAverageConditional<Bernoulli>(this.vBernoulli5);
     // Message to 'vbool320_uses' from EqualRandom factor
     this.vbool320_uses_B[0] = ConstrainEqualRandomOp<bool>.ValueAverageConditional<Bernoulli>(this.vBernoulli5);
     // Message to 'vbool304_uses' from EqualRandom factor
     this.vbool304_uses_B[0] = ConstrainEqualRandomOp<bool>.ValueAverageConditional<Bernoulli>(this.vBernoulli5);
     // Message to 'vbool312_uses' from EqualRandom factor
     this.vbool312_uses_B[0] = ConstrainEqualRandomOp<bool>.ValueAverageConditional<Bernoulli>(this.vBernoulli5);
     // Message to 'vbool433_uses' from EqualRandom factor
     this.vbool433_uses_B[0] = ConstrainEqualRandomOp<bool>.ValueAverageConditional<Bernoulli>(this.vBernoulli5);
     // Message to 'vbool288_uses' from EqualRandom factor
     this.vbool288_uses_B[0] = ConstrainEqualRandomOp<bool>.ValueAverageConditional<Bernoulli>(this.vBernoulli5);
     // Message to 'vbool328_uses' from EqualRandom factor
     this.vbool328_uses_B[0] = ConstrainEqualRandomOp<bool>.ValueAverageConditional<Bernoulli>(this.vBernoulli5);
     // Message to 'vbool425_uses' from EqualRandom factor
     this.vbool425_uses_B[0] = ConstrainEqualRandomOp<bool>.ValueAverageConditional<Bernoulli>(this.vBernoulli5);
     // Message to 'vbool296' from ReplicateWithMarginal factor
     this.vbool296_B = ReplicateOp.DefAverageConditional<Bernoulli>(this.vbool296_uses_B, this.vbool296_B);
     // Message to 'vbool21_uses' from AreEqual factor
     this.vbool21_uses_B[0] = BooleanAreEqualOp.BAverageConditional(this.vbool296_B, this.vbool29_uses_F[0]);
     // Message to 'vbool360' from ReplicateWithMarginal factor
     this.vbool360_B = ReplicateOp.DefAverageConditional<Bernoulli>(this.vbool360_uses_B, this.vbool360_B);
     // Message to 'vbool21_uses' from UsesEqualDef factor
     this.vbool21_uses_F[1] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool21_uses_B, this.vbool21_F, 1, this.vbool21_uses_F[1]);
     // Message to 'vbool133_uses' from AreEqual factor
     this.vbool133_uses_B[0] = BooleanAreEqualOp.AAverageConditional(this.vbool360_B, this.vbool21_uses_F[1]);
     this.vbool344_B = ArrayHelper.MakeUniform<Bernoulli>(new Bernoulli());
     // Message to 'vbool344' from ReplicateWithMarginal factor
     this.vbool344_B = ReplicateOp.DefAverageConditional<Bernoulli>(this.vbool344_uses_B, this.vbool344_B);
     // Create array for 'vbool117_uses' forwards messages.
     this.vbool117_uses_F = new Bernoulli[2];
     for(int _ind0 = 0; _ind0<2; _ind0++)
     {
         this.vbool117_uses_F[_ind0] = ArrayHelper.MakeUniform<Bernoulli>(this.vBernoulli125);
     }
     this.vbool352_B = ArrayHelper.MakeUniform<Bernoulli>(new Bernoulli());
     // Message to 'vbool352' from ReplicateWithMarginal factor
     this.vbool352_B = ReplicateOp.DefAverageConditional<Bernoulli>(this.vbool352_uses_B, this.vbool352_B);
     // Create array for 'vbool125_uses' forwards messages.
     this.vbool125_uses_F = new Bernoulli[2];
     for(int _ind0 = 0; _ind0<2; _ind0++)
     {
         this.vbool125_uses_F[_ind0] = ArrayHelper.MakeUniform<Bernoulli>(this.vBernoulli133);
     }
     this.vbool336_B = ArrayHelper.MakeUniform<Bernoulli>(new Bernoulli());
     // Message to 'vbool336' from ReplicateWithMarginal factor
     this.vbool336_B = ReplicateOp.DefAverageConditional<Bernoulli>(this.vbool336_uses_B, this.vbool336_B);
     // Create array for 'vbool94_uses' forwards messages.
     this.vbool94_uses_F = new Bernoulli[2];
     for(int _ind0 = 0; _ind0<2; _ind0++)
     {
         this.vbool94_uses_F[_ind0] = ArrayHelper.MakeUniform<Bernoulli>(this.vBernoulli102);
     }
     this.vbool320_B = ArrayHelper.MakeUniform<Bernoulli>(new Bernoulli());
     // Message to 'vbool320' from ReplicateWithMarginal factor
     this.vbool320_B = ReplicateOp.DefAverageConditional<Bernoulli>(this.vbool320_uses_B, this.vbool320_B);
     // Create array for 'vbool55_uses' forwards messages.
     this.vbool55_uses_F = new Bernoulli[3];
     for(int _ind0 = 0; _ind0<3; _ind0++)
     {
         this.vbool55_uses_F[_ind0] = ArrayHelper.MakeUniform<Bernoulli>(this.vBernoulli63);
     }
     this.vbool457_B = ArrayHelper.MakeUniform<Bernoulli>(new Bernoulli());
     // Create array for 'vbool172_uses' forwards messages.
     this.vbool172_uses_F = new Bernoulli[2];
     for(int _ind0 = 0; _ind0<2; _ind0++)
     {
         this.vbool172_uses_F[_ind0] = ArrayHelper.MakeUniform<Bernoulli>(this.vBernoulli180);
     }
     this.vbool304_B = ArrayHelper.MakeUniform<Bernoulli>(new Bernoulli());
     // Message to 'vbool304' from ReplicateWithMarginal factor
     this.vbool304_B = ReplicateOp.DefAverageConditional<Bernoulli>(this.vbool304_uses_B, this.vbool304_B);
     // Create array for 'vbool47_uses' forwards messages.
     this.vbool47_uses_F = new Bernoulli[2];
     for(int _ind0 = 0; _ind0<2; _ind0++)
     {
         this.vbool47_uses_F[_ind0] = ArrayHelper.MakeUniform<Bernoulli>(this.vBernoulli55);
     }
     this.vbool312_B = ArrayHelper.MakeUniform<Bernoulli>(new Bernoulli());
     // Message to 'vbool312' from ReplicateWithMarginal factor
     this.vbool312_B = ReplicateOp.DefAverageConditional<Bernoulli>(this.vbool312_uses_B, this.vbool312_B);
     // Create array for 'vbool73_uses' forwards messages.
     this.vbool73_uses_F = new Bernoulli[2];
     for(int _ind0 = 0; _ind0<2; _ind0++)
     {
         this.vbool73_uses_F[_ind0] = ArrayHelper.MakeUniform<Bernoulli>(this.vBernoulli81);
     }
     this.vbool433_B = ArrayHelper.MakeUniform<Bernoulli>(new Bernoulli());
     // Message to 'vbool433' from ReplicateWithMarginal factor
     this.vbool433_B = ReplicateOp.DefAverageConditional<Bernoulli>(this.vbool433_uses_B, this.vbool433_B);
     // Create array for 'vbool164_uses' forwards messages.
     this.vbool164_uses_F = new Bernoulli[2];
     for(int _ind0 = 0; _ind0<2; _ind0++)
     {
         this.vbool164_uses_F[_ind0] = ArrayHelper.MakeUniform<Bernoulli>(this.vBernoulli172);
     }
     this.vBernoulli6 = new Bernoulli(0.9);
     // Message to 'vbool457_uses' from EqualRandom factor
     this.vbool457_uses_B[0] = ConstrainEqualRandomOp<bool>.ValueAverageConditional<Bernoulli>(this.vBernoulli6);
     // Message to 'vbool458_uses' from EqualRandom factor
     this.vbool458_uses_B[0] = ConstrainEqualRandomOp<bool>.ValueAverageConditional<Bernoulli>(this.vBernoulli6);
     // Message to 'vbool457' from ReplicateWithMarginal factor
     this.vbool457_B = ReplicateOp.DefAverageConditional<Bernoulli>(this.vbool457_uses_B, this.vbool457_B);
     this.vbool288_B = ArrayHelper.MakeUniform<Bernoulli>(new Bernoulli());
     // Message to 'vbool288' from ReplicateWithMarginal factor
     this.vbool288_B = ReplicateOp.DefAverageConditional<Bernoulli>(this.vbool288_uses_B, this.vbool288_B);
     // Create array for 'vbool3_uses' forwards messages.
     this.vbool3_uses_F = new Bernoulli[1];
     for(int _ind0 = 0; _ind0<1; _ind0++)
     {
         this.vbool3_uses_F[_ind0] = ArrayHelper.MakeUniform<Bernoulli>(this.vBernoulli11);
     }
     // Message to 'vbool3_uses' from UsesEqualDef factor
     this.vbool3_uses_F[0] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool3_uses_B, this.vbool3_F, 0, this.vbool3_uses_F[0]);
     // Message to 'vbool47_uses' from AreEqual factor
     this.vbool47_uses_B[1] = BooleanAreEqualOp.BAverageConditional(this.vbool288_B, this.vbool3_uses_F[0]);
     // Message to 'vbool47_uses' from UsesEqualDef factor
     this.vbool47_uses_F[0] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool47_uses_B, this.vbool47_F, 0, this.vbool47_uses_F[0]);
     // Message to 'vbool55_uses' from AreEqual factor
     this.vbool55_uses_B[1] = BooleanAreEqualOp.AAverageConditional(this.vbool304_B, this.vbool47_uses_F[0]);
     this.vbool328_B = ArrayHelper.MakeUniform<Bernoulli>(new Bernoulli());
     // Message to 'vbool328' from ReplicateWithMarginal factor
     this.vbool328_B = ReplicateOp.DefAverageConditional<Bernoulli>(this.vbool328_uses_B, this.vbool328_B);
     // Create array for 'vbool81_uses' forwards messages.
     this.vbool81_uses_F = new Bernoulli[2];
     for(int _ind0 = 0; _ind0<2; _ind0++)
     {
         this.vbool81_uses_F[_ind0] = ArrayHelper.MakeUniform<Bernoulli>(this.vBernoulli89);
     }
     this.vbool425_B = ArrayHelper.MakeUniform<Bernoulli>(new Bernoulli());
     // Message to 'vbool425' from ReplicateWithMarginal factor
     this.vbool425_B = ReplicateOp.DefAverageConditional<Bernoulli>(this.vbool425_uses_B, this.vbool425_B);
     // Create array for 'vbool146_uses' forwards messages.
     this.vbool146_uses_F = new Bernoulli[2];
     for(int _ind0 = 0; _ind0<2; _ind0++)
     {
         this.vbool146_uses_F[_ind0] = ArrayHelper.MakeUniform<Bernoulli>(this.vBernoulli154);
     }
     this.vbool458_B = ArrayHelper.MakeUniform<Bernoulli>(new Bernoulli());
     // Message to 'vbool458' from ReplicateWithMarginal factor
     this.vbool458_B = ReplicateOp.DefAverageConditional<Bernoulli>(this.vbool458_uses_B, this.vbool458_B);
 }
Ejemplo n.º 12
0
 /// <summary>
 /// Creates message arrays and initialises their values ready for inference to be performed.
 /// </summary>
 /// <remarks>
 /// This method should be called once each time inference is performed. Since the initialisation
 /// procedure normally dependson external values such as priors and array sizes, all external
 /// values must be set before calling this method.
 /// 
 /// As well as initialising message arrays, this method also performs any message passing that
 /// the scheduler determines need only be carried out once.
 /// </remarks>
 public void Initialise()
 {
     this.vbool319_marginal_B = ArrayHelper.MakeUniform<Bernoulli>(vBernoulli157);
     // Message to 'vbool319_marginal' from UsesEqualDef factor
     this.vbool319_marginal_B = UsesEqualDefOp.MarginalAverageConditional<Bernoulli>(this.vbool319_uses_B, this.vbool319_F, this.vbool319_marginal_B);
 }
Ejemplo n.º 13
0
 /// <summary>VMP message to <c>b</c>.</summary>
 /// <param name="not">Incoming message from <c>not</c>. Must be a proper distribution. If uniform, the result will be uniform.</param>
 /// <returns>The outgoing VMP message to the <c>b</c> argument.</returns>
 /// <remarks>
 ///   <para>The outgoing message is the factor viewed as a function of <c>b</c> with <c>not</c> integrated out. The formula is <c>sum_not p(not) factor(not,b)</c>.</para>
 /// </remarks>
 /// <exception cref="ImproperMessageException">
 ///   <paramref name="not" /> is not a proper distribution.</exception>
 public static Bernoulli BAverageLogarithm([SkipIfUniform] Bernoulli not)
 {
     return(BAverageConditional(not));
 }
Ejemplo n.º 14
0
		/// <summary>
		/// Evidence message for EP
		/// </summary>
		/// <param name="sample">Incoming message from 'sample'.</param>
		/// <param name="to_sample">Outgoing message to 'sample'.</param>
		/// <returns>Logarithm of the factor's average value across the given argument distributions</returns>
		/// <remarks><para>
		/// The formula for the result is <c>log(sum_(sample) p(sample) factor(sample,probTrue))</c>.
		/// </para></remarks>
		public static double LogAverageFactor(Bernoulli sample, [Fresh] Bernoulli to_sample)
		{
			return sample.GetLogAverageOf(to_sample);
		}
Ejemplo n.º 15
0
 /// <summary>
 /// Performs one iteration of inference.
 /// </summary>
 /// <remarks>
 /// This method should be called multiple times, after calling Initialise(), in order to perform
 /// multiple iterations of message passing.  You can call methods to retrieve posterior marginals
 /// at any time - the returned marginal will be the estimated marginal given the current state of
 /// the message passing algorithm.  This can be useful for monitoring convergence of the algorithm.
 /// 
 /// Where the scheduler has determined inference can be performed without iteration, this method
 /// does nothing.
 /// </remarks>
 public void Update()
 {
     // Message to 'vbool140_uses' from UsesEqualDef factor
     this.vbool140_uses_F[0] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool140_uses_B, this.vbool140_F, 0, this.vbool140_uses_F[0]);
     // Message to 'vbool124_uses' from AreEqual factor
     this.vbool124_uses_B[1] = BooleanAreEqualOp.BAverageConditional(this.vbool351_B, this.vbool140_uses_F[0]);
     // Message to 'vbool124_uses' from UsesEqualDef factor
     this.vbool124_uses_F[0] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool124_uses_B, this.vbool124_F, 0, this.vbool124_uses_F[0]);
     // Message to 'vbool101_uses' from AreEqual factor
     this.vbool101_uses_B[1] = BooleanAreEqualOp.AAverageConditional(this.vbool343_B, this.vbool124_uses_F[0]);
     // Message to 'vbool101_uses' from UsesEqualDef factor
     this.vbool101_uses_F[0] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool101_uses_B, this.vbool101_F, 0, this.vbool101_uses_F[0]);
     // Message to 'vbool179_uses' from AreEqual factor
     this.vbool179_uses_B[1] = BooleanAreEqualOp.BAverageConditional(this.vbool471_B, this.vbool101_uses_F[0]);
     // Message to 'vbool179_uses' from UsesEqualDef factor
     this.vbool179_uses_F[0] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool179_uses_B, this.vbool179_F, 0, this.vbool179_uses_F[0]);
     // Message to 'vbool171_uses' from AreEqual factor
     this.vbool171_uses_B[0] = BooleanAreEqualOp.BAverageConditional(this.vbool440_B, this.vbool179_uses_F[0]);
     // Message to 'vbool171_uses' from UsesEqualDef factor
     this.vbool171_uses_F[1] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool171_uses_B, this.vbool171_F, 1, this.vbool171_uses_F[1]);
     // Message to 'vbool153_uses' from AreEqual factor
     this.vbool153_uses_B[0] = BooleanAreEqualOp.AAverageConditional(this.vbool432_B, this.vbool171_uses_F[1]);
     // Message to 'vbool153_uses' from UsesEqualDef factor
     this.vbool153_uses_F[1] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool153_uses_B, this.vbool153_F, 1, this.vbool153_uses_F[1]);
     // Message to 'vbool88_uses' from AreEqual factor
     this.vbool88_uses_B[0] = BooleanAreEqualOp.AAverageConditional(this.vbool472_B, this.vbool153_uses_F[1]);
     // Message to 'vbool88_uses' from UsesEqualDef factor
     this.vbool88_uses_F[1] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool88_uses_B, this.vbool88_F, 1, this.vbool88_uses_F[1]);
     // Message to 'vbool80_uses' from AreEqual factor
     this.vbool80_uses_B[0] = BooleanAreEqualOp.BAverageConditional(this.vbool335_B, this.vbool88_uses_F[1]);
     // Message to 'vbool80_uses' from UsesEqualDef factor
     this.vbool80_uses_F[1] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool80_uses_B, this.vbool80_F, 1, this.vbool80_uses_F[1]);
     // Message to 'vbool62_uses' from AreEqual factor
     this.vbool62_uses_B[0] = BooleanAreEqualOp.AAverageConditional(this.vbool319_B, this.vbool80_uses_F[1]);
     // Message to 'vbool62_uses' from UsesEqualDef factor
     this.vbool62_uses_F[1] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool62_uses_B, this.vbool62_F, 1, this.vbool62_uses_F[1]);
     // Message to 'vbool132_uses' from AreEqual factor
     this.vbool132_uses_B[1] = BooleanAreEqualOp.BAverageConditional(this.vbool327_B, this.vbool62_uses_F[1]);
     // Message to 'vbool132_uses' from UsesEqualDef factor
     this.vbool132_uses_F[0] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool132_uses_B, this.vbool132_F, 0, this.vbool132_uses_F[0]);
     // Message to 'vbool140_uses' from AreEqual factor
     this.vbool140_uses_B[1] = BooleanAreEqualOp.AAverageConditional(this.vbool359_B, this.vbool132_uses_F[0]);
     // Message to 'vbool62_uses' from UsesEqualDef factor
     this.vbool62_uses_F[0] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool62_uses_B, this.vbool62_F, 0, this.vbool62_uses_F[0]);
     // Message to 'vbool80_uses' from AreEqual factor
     this.vbool80_uses_B[1] = BooleanAreEqualOp.BAverageConditional(this.vbool319_B, this.vbool62_uses_F[0]);
     // Message to 'vbool80_marginal' from UsesEqualDef factor
     this.vbool80_marginal_B = UsesEqualDefOp.MarginalAverageConditional<Bernoulli>(this.vbool80_uses_B, this.vbool80_F, this.vbool80_marginal_B);
     // Message to 'vbool319' from AreEqual factor
     this.vbool319_F = BooleanAreEqualOp.AreEqualAverageConditional(this.vbool62_uses_F[0], this.vbool80_uses_F[1]);
     // Message to 'vbool319_marginal' from ReplicateWithMarginal factor
     this.vbool319_marginal_B = ReplicateOp.MarginalAverageConditional<Bernoulli>(this.vbool319_uses_B, this.vbool319_F, this.vbool319_marginal_B);
     // Message to 'vbool80_uses' from UsesEqualDef factor
     this.vbool80_uses_F[0] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool80_uses_B, this.vbool80_F, 0, this.vbool80_uses_F[0]);
     // Message to 'vbool88_uses' from AreEqual factor
     this.vbool88_uses_B[1] = BooleanAreEqualOp.AAverageConditional(this.vbool335_B, this.vbool80_uses_F[0]);
     // Message to 'vbool88_marginal' from UsesEqualDef factor
     this.vbool88_marginal_B = UsesEqualDefOp.MarginalAverageConditional<Bernoulli>(this.vbool88_uses_B, this.vbool88_F, this.vbool88_marginal_B);
     // Message to 'vbool335' from AreEqual factor
     this.vbool335_F = BooleanAreEqualOp.AreEqualAverageConditional(this.vbool88_uses_F[1], this.vbool80_uses_F[0]);
     // Message to 'vbool335_marginal' from ReplicateWithMarginal factor
     this.vbool335_marginal_B = ReplicateOp.MarginalAverageConditional<Bernoulli>(this.vbool335_uses_B, this.vbool335_F, this.vbool335_marginal_B);
     // Message to 'vbool88_uses' from UsesEqualDef factor
     this.vbool88_uses_F[0] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool88_uses_B, this.vbool88_F, 0, this.vbool88_uses_F[0]);
     // Message to 'vbool153_uses' from AreEqual factor
     this.vbool153_uses_B[1] = BooleanAreEqualOp.BAverageConditional(this.vbool472_B, this.vbool88_uses_F[0]);
     // Message to 'vbool153_marginal' from UsesEqualDef factor
     this.vbool153_marginal_B = UsesEqualDefOp.MarginalAverageConditional<Bernoulli>(this.vbool153_uses_B, this.vbool153_F, this.vbool153_marginal_B);
     // Message to 'vbool472' from AreEqual factor
     this.vbool472_F = BooleanAreEqualOp.AreEqualAverageConditional(this.vbool88_uses_F[0], this.vbool153_uses_F[1]);
     // Message to 'vbool472_marginal' from ReplicateWithMarginal factor
     this.vbool472_marginal_B = ReplicateOp.MarginalAverageConditional<Bernoulli>(this.vbool472_uses_B, this.vbool472_F, this.vbool472_marginal_B);
     // Message to 'vbool153_uses' from UsesEqualDef factor
     this.vbool153_uses_F[0] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool153_uses_B, this.vbool153_F, 0, this.vbool153_uses_F[0]);
     // Message to 'vbool171_uses' from AreEqual factor
     this.vbool171_uses_B[1] = BooleanAreEqualOp.BAverageConditional(this.vbool432_B, this.vbool153_uses_F[0]);
     // Message to 'vbool171_marginal' from UsesEqualDef factor
     this.vbool171_marginal_B = UsesEqualDefOp.MarginalAverageConditional<Bernoulli>(this.vbool171_uses_B, this.vbool171_F, this.vbool171_marginal_B);
     // Message to 'vbool432' from AreEqual factor
     this.vbool432_F = BooleanAreEqualOp.AreEqualAverageConditional(this.vbool153_uses_F[0], this.vbool171_uses_F[1]);
     // Message to 'vbool432_marginal' from ReplicateWithMarginal factor
     this.vbool432_marginal_B = ReplicateOp.MarginalAverageConditional<Bernoulli>(this.vbool432_uses_B, this.vbool432_F, this.vbool432_marginal_B);
     // Message to 'vbool171_uses' from UsesEqualDef factor
     this.vbool171_uses_F[0] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool171_uses_B, this.vbool171_F, 0, this.vbool171_uses_F[0]);
     // Message to 'vbool179_uses' from AreEqual factor
     this.vbool179_uses_B[0] = BooleanAreEqualOp.AAverageConditional(this.vbool440_B, this.vbool171_uses_F[0]);
     // Message to 'vbool179_marginal' from UsesEqualDef factor
     this.vbool179_marginal_B = UsesEqualDefOp.MarginalAverageConditional<Bernoulli>(this.vbool179_uses_B, this.vbool179_F, this.vbool179_marginal_B);
     // Message to 'vbool440' from AreEqual factor
     this.vbool440_F = BooleanAreEqualOp.AreEqualAverageConditional(this.vbool179_uses_F[0], this.vbool171_uses_F[0]);
     // Message to 'vbool440_marginal' from ReplicateWithMarginal factor
     this.vbool440_marginal_B = ReplicateOp.MarginalAverageConditional<Bernoulli>(this.vbool440_uses_B, this.vbool440_F, this.vbool440_marginal_B);
     // Message to 'vbool179_uses' from UsesEqualDef factor
     this.vbool179_uses_F[1] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool179_uses_B, this.vbool179_F, 1, this.vbool179_uses_F[1]);
     // Message to 'vbool101_uses' from AreEqual factor
     this.vbool101_uses_B[0] = BooleanAreEqualOp.AAverageConditional(this.vbool471_B, this.vbool179_uses_F[1]);
     // Message to 'vbool101_marginal' from UsesEqualDef factor
     this.vbool101_marginal_B = UsesEqualDefOp.MarginalAverageConditional<Bernoulli>(this.vbool101_uses_B, this.vbool101_F, this.vbool101_marginal_B);
     // Message to 'vbool471' from AreEqual factor
     this.vbool471_F = BooleanAreEqualOp.AreEqualAverageConditional(this.vbool101_uses_F[0], this.vbool179_uses_F[1]);
     // Message to 'vbool471_marginal' from ReplicateWithMarginal factor
     this.vbool471_marginal_B = ReplicateOp.MarginalAverageConditional<Bernoulli>(this.vbool471_uses_B, this.vbool471_F, this.vbool471_marginal_B);
     // Message to 'vbool101_uses' from UsesEqualDef factor
     this.vbool101_uses_F[1] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool101_uses_B, this.vbool101_F, 1, this.vbool101_uses_F[1]);
     // Message to 'vbool124_uses' from AreEqual factor
     this.vbool124_uses_B[0] = BooleanAreEqualOp.BAverageConditional(this.vbool343_B, this.vbool101_uses_F[1]);
     // Message to 'vbool124_marginal' from UsesEqualDef factor
     this.vbool124_marginal_B = UsesEqualDefOp.MarginalAverageConditional<Bernoulli>(this.vbool124_uses_B, this.vbool124_F, this.vbool124_marginal_B);
     // Message to 'vbool343' from AreEqual factor
     this.vbool343_F = BooleanAreEqualOp.AreEqualAverageConditional(this.vbool101_uses_F[1], this.vbool124_uses_F[0]);
     // Message to 'vbool343_marginal' from ReplicateWithMarginal factor
     this.vbool343_marginal_B = ReplicateOp.MarginalAverageConditional<Bernoulli>(this.vbool343_uses_B, this.vbool343_F, this.vbool343_marginal_B);
     // Message to 'vbool124_uses' from UsesEqualDef factor
     this.vbool124_uses_F[1] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool124_uses_B, this.vbool124_F, 1, this.vbool124_uses_F[1]);
     // Message to 'vbool140_uses' from AreEqual factor
     this.vbool140_uses_B[0] = BooleanAreEqualOp.AAverageConditional(this.vbool351_B, this.vbool124_uses_F[1]);
     // Message to 'vbool140_marginal' from UsesEqualDef factor
     this.vbool140_marginal_B = UsesEqualDefOp.MarginalAverageConditional<Bernoulli>(this.vbool140_uses_B, this.vbool140_F, this.vbool140_marginal_B);
     // Message to 'vbool351' from AreEqual factor
     this.vbool351_F = BooleanAreEqualOp.AreEqualAverageConditional(this.vbool140_uses_F[0], this.vbool124_uses_F[1]);
     // Message to 'vbool351_marginal' from ReplicateWithMarginal factor
     this.vbool351_marginal_B = ReplicateOp.MarginalAverageConditional<Bernoulli>(this.vbool351_uses_B, this.vbool351_F, this.vbool351_marginal_B);
     // Message to 'vbool140_uses' from UsesEqualDef factor
     this.vbool140_uses_F[1] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool140_uses_B, this.vbool140_F, 1, this.vbool140_uses_F[1]);
     // Message to 'vbool132_uses' from AreEqual factor
     this.vbool132_uses_B[0] = BooleanAreEqualOp.BAverageConditional(this.vbool359_B, this.vbool140_uses_F[1]);
     // Message to 'vbool132_marginal' from UsesEqualDef factor
     this.vbool132_marginal_B = UsesEqualDefOp.MarginalAverageConditional<Bernoulli>(this.vbool132_uses_B, this.vbool132_F, this.vbool132_marginal_B);
     // Message to 'vbool359' from AreEqual factor
     this.vbool359_F = BooleanAreEqualOp.AreEqualAverageConditional(this.vbool140_uses_F[1], this.vbool132_uses_F[0]);
     // Message to 'vbool359_marginal' from ReplicateWithMarginal factor
     this.vbool359_marginal_B = ReplicateOp.MarginalAverageConditional<Bernoulli>(this.vbool359_uses_B, this.vbool359_F, this.vbool359_marginal_B);
     // Message to 'vbool140_uses' from UsesEqualDef factor
     this.vbool140_uses_F[2] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool140_uses_B, this.vbool140_F, 2, this.vbool140_uses_F[2]);
     // Message to 'vbool28_uses' from AreEqual factor
     this.vbool28_uses_B[0] = BooleanAreEqualOp.BAverageConditional(this.vbool367_B, this.vbool140_uses_F[2]);
     // Message to 'vbool28_marginal' from UsesEqualDef factor
     this.vbool28_marginal_B = UsesEqualDefOp.MarginalAverageConditional<Bernoulli>(this.vbool28_uses_B, this.vbool28_F, this.vbool28_marginal_B);
     // Message to 'vbool367' from AreEqual factor
     this.vbool367_F = BooleanAreEqualOp.AreEqualAverageConditional(this.vbool140_uses_F[2], this.vbool28_uses_F[0]);
     // Message to 'vbool367_marginal' from ReplicateWithMarginal factor
     this.vbool367_marginal_B = ReplicateOp.MarginalAverageConditional<Bernoulli>(this.vbool367_uses_B, this.vbool367_F, this.vbool367_marginal_B);
     // Message to 'vbool132_uses' from UsesEqualDef factor
     this.vbool132_uses_F[1] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool132_uses_B, this.vbool132_F, 1, this.vbool132_uses_F[1]);
     // Message to 'vbool62_uses' from AreEqual factor
     this.vbool62_uses_B[1] = BooleanAreEqualOp.AAverageConditional(this.vbool327_B, this.vbool132_uses_F[1]);
     // Message to 'vbool62_marginal' from UsesEqualDef factor
     this.vbool62_marginal_B = UsesEqualDefOp.MarginalAverageConditional<Bernoulli>(this.vbool62_uses_B, this.vbool62_F, this.vbool62_marginal_B);
     // Message to 'vbool327' from AreEqual factor
     this.vbool327_F = BooleanAreEqualOp.AreEqualAverageConditional(this.vbool62_uses_F[1], this.vbool132_uses_F[1]);
     // Message to 'vbool327_marginal' from ReplicateWithMarginal factor
     this.vbool327_marginal_B = ReplicateOp.MarginalAverageConditional<Bernoulli>(this.vbool327_uses_B, this.vbool327_F, this.vbool327_marginal_B);
     // Message to 'vbool28_uses' from UsesEqualDef factor
     this.vbool28_uses_F[1] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool28_uses_B, this.vbool28_F, 1, this.vbool28_uses_F[1]);
     // Message to 'vbool36_uses' from AreEqual factor
     this.vbool36_uses_B[0] = BooleanAreEqualOp.AAverageConditional(this.vbool303_B, this.vbool28_uses_F[1]);
     // Message to 'vbool36_marginal' from UsesEqualDef factor
     this.vbool36_marginal_B = UsesEqualDefOp.MarginalAverageConditional<Bernoulli>(this.vbool36_uses_B, this.vbool36_F, this.vbool36_marginal_B);
     // Message to 'vbool303' from AreEqual factor
     this.vbool303_F = BooleanAreEqualOp.AreEqualAverageConditional(this.vbool36_uses_F[0], this.vbool28_uses_F[1]);
     // Message to 'vbool303_marginal' from ReplicateWithMarginal factor
     this.vbool303_marginal_B = ReplicateOp.MarginalAverageConditional<Bernoulli>(this.vbool303_uses_B, this.vbool303_F, this.vbool303_marginal_B);
     // Message to 'vbool62_uses' from UsesEqualDef factor
     this.vbool62_uses_F[2] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool62_uses_B, this.vbool62_F, 2, this.vbool62_uses_F[2]);
     // Message to 'vbool54_uses' from AreEqual factor
     this.vbool54_uses_B[0] = BooleanAreEqualOp.BAverageConditional(this.vbool311_B, this.vbool62_uses_F[2]);
     // Message to 'vbool54_marginal' from UsesEqualDef factor
     this.vbool54_marginal_B = UsesEqualDefOp.MarginalAverageConditional<Bernoulli>(this.vbool54_uses_B, this.vbool54_F, this.vbool54_marginal_B);
     // Message to 'vbool311' from AreEqual factor
     this.vbool311_F = BooleanAreEqualOp.AreEqualAverageConditional(this.vbool62_uses_F[2], this.vbool54_uses_F[0]);
     // Message to 'vbool311_marginal' from ReplicateWithMarginal factor
     this.vbool311_marginal_B = ReplicateOp.MarginalAverageConditional<Bernoulli>(this.vbool311_uses_B, this.vbool311_F, this.vbool311_marginal_B);
     // Message to 'vbool54_uses' from UsesEqualDef factor
     this.vbool54_uses_F[1] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool54_uses_B, this.vbool54_F, 1, this.vbool54_uses_F[1]);
     // Message to 'vbool10_uses' from AreEqual factor
     this.vbool10_uses_B[0] = BooleanAreEqualOp.AAverageConditional(this.vbool295_B, this.vbool54_uses_F[1]);
     // Message to 'vbool10_marginal' from UsesEqualDef factor
     this.vbool10_marginal_B = UsesEqualDefOp.MarginalAverageConditional<Bernoulli>(this.vbool10_uses_B, this.vbool10_F, this.vbool10_marginal_B);
     // Message to 'vbool295' from AreEqual factor
     this.vbool295_F = BooleanAreEqualOp.AreEqualAverageConditional(this.vbool10_uses_F[0], this.vbool54_uses_F[1]);
     // Message to 'vbool295_marginal' from ReplicateWithMarginal factor
     this.vbool295_marginal_B = ReplicateOp.MarginalAverageConditional<Bernoulli>(this.vbool295_uses_B, this.vbool295_F, this.vbool295_marginal_B);
 }
Ejemplo n.º 16
0
 /// <summary>VMP message to <c>b</c>.</summary>
 /// <param name="and">Incoming message from <c>and</c>. Must be a proper distribution. If uniform, the result will be uniform.</param>
 /// <param name="A">Constant value for <c>a</c>.</param>
 /// <returns>The outgoing VMP message to the <c>b</c> argument.</returns>
 /// <remarks>
 ///   <para>The outgoing message is the factor viewed as a function of <c>b</c> with <c>and</c> integrated out. The formula is <c>sum_and p(and) factor(and,a,b)</c>.</para>
 /// </remarks>
 /// <exception cref="ImproperMessageException">
 ///   <paramref name="and" /> is not a proper distribution.</exception>
 public static Bernoulli BAverageLogarithm([SkipIfUniform] Bernoulli and, bool A)
 {
     return(AAverageLogarithm(and, A));
 }
Ejemplo n.º 17
0
		/// <summary>
		/// Evidence message for EP
		/// </summary>
		/// <param name="isGreaterThan">Incoming message from 'isGreaterThan'.</param>
		/// <param name="a">Constant value for 'a'.</param>
		/// <param name="b">Incoming message from 'b'.</param>
		/// <param name="to_isGreaterThan">Outgoing message to 'isGreaterThan'.</param>
		/// <returns>Logarithm of the factor's average value across the given argument distributions</returns>
		/// <remarks><para>
		/// The formula for the result is <c>log(sum_(isGreaterThan,b) p(isGreaterThan,b) factor(isGreaterThan,a,b))</c>.
		/// </para></remarks>
		public static double LogAverageFactor(Bernoulli isGreaterThan, int a, Discrete b, [Fresh] Bernoulli to_isGreaterThan)
		{
			return to_isGreaterThan.GetLogAverageOf(isGreaterThan);
		}
Ejemplo n.º 18
0
 /// <summary>VMP message to <c>a</c>.</summary>
 /// <param name="and">Incoming message from <c>and</c>. Must be a proper distribution. If uniform, the result will be uniform.</param>
 /// <param name="B">Incoming message from <c>b</c>.</param>
 /// <returns>The outgoing VMP message to the <c>a</c> argument.</returns>
 /// <remarks>
 ///   <para>The outgoing message is the exponential of the average log-factor value, where the average is over all arguments except <c>a</c>. Because the factor is deterministic, <c>and</c> is integrated out before taking the logarithm. The formula is <c>exp(sum_(b) p(b) log(sum_and p(and) factor(and,a,b)))</c>.</para>
 /// </remarks>
 /// <exception cref="ImproperMessageException">
 ///   <paramref name="and" /> is not a proper distribution.</exception>
 public static Bernoulli AAverageLogarithm([SkipIfUniform] Bernoulli and, Bernoulli B)
 {
     // when 'and' is marginalized, the factor is proportional to exp(A*B*and.LogOdds)
     return(Bernoulli.FromLogOdds(and.LogOdds * B.GetProbTrue()));
 }
Ejemplo n.º 19
0
 /// <summary>VMP message to <c>a</c>.</summary>
 /// <param name="and">Incoming message from <c>and</c>. Must be a proper distribution. If uniform, the result will be uniform.</param>
 /// <param name="B">Constant value for <c>b</c>.</param>
 /// <returns>The outgoing VMP message to the <c>a</c> argument.</returns>
 /// <remarks>
 ///   <para>The outgoing message is the factor viewed as a function of <c>a</c> with <c>and</c> integrated out. The formula is <c>sum_and p(and) factor(and,a,b)</c>.</para>
 /// </remarks>
 /// <exception cref="ImproperMessageException">
 ///   <paramref name="and" /> is not a proper distribution.</exception>
 public static Bernoulli AAverageLogarithm([SkipIfUniform] Bernoulli and, bool B)
 {
     return(Bernoulli.FromLogOdds(B ? and.LogOdds : 0.0));
 }
Ejemplo n.º 20
0
 /// <summary>VMP message to <c>and</c>.</summary>
 /// <param name="A">Constant value for <c>a</c>.</param>
 /// <param name="B">Incoming message from <c>b</c>.</param>
 /// <returns>The outgoing VMP message to the <c>and</c> argument.</returns>
 /// <remarks>
 ///   <para>The outgoing message is a distribution matching the moments of <c>and</c> as the random arguments are varied. The formula is <c>proj[sum_(b) p(b) factor(and,a,b)]</c>.</para>
 /// </remarks>
 public static Bernoulli AndAverageLogarithm(bool A, Bernoulli B)
 {
     // same as BP if you use John Winn's rule.
     return(AndAverageConditional(A, B));
 }
Ejemplo n.º 21
0
 /// <summary>Evidence message for EP.</summary>
 /// <param name="and">Constant value for <c>and</c>.</param>
 /// <param name="a">Incoming message from <c>a</c>.</param>
 /// <param name="b">Incoming message from <c>b</c>.</param>
 /// <returns>Logarithm of the factor's contribution the EP model evidence.</returns>
 /// <remarks>
 ///   <para>The formula for the result is <c>log(sum_(a,b) p(a,b) factor(and,a,b))</c>. Adding up these values across all factors and variables gives the log-evidence estimate for EP.</para>
 /// </remarks>
 public static double LogEvidenceRatio(bool and, Bernoulli a, Bernoulli b)
 {
     return(LogAverageFactor(and, a, b));
 }
Ejemplo n.º 22
0
        /// <summary>Evidence message for EP.</summary>
        /// <param name="and">Constant value for <c>and</c>.</param>
        /// <param name="a">Incoming message from <c>a</c>.</param>
        /// <param name="b">Constant value for <c>b</c>.</param>
        /// <returns>Logarithm of the factor's average value across the given argument distributions.</returns>
        /// <remarks>
        ///   <para>The formula for the result is <c>log(sum_(a) p(a) factor(and,a,b))</c>.</para>
        /// </remarks>
        public static double LogAverageFactor(bool and, Bernoulli a, bool b)
        {
            Bernoulli to_and = AndAverageConditional(a, b);

            return(to_and.GetLogProb(and));
        }
Ejemplo n.º 23
0
		public static double LogEvidenceRatio(Bernoulli isGreaterThan) { return 0.0; }
Ejemplo n.º 24
0
 /// <summary>Evidence message for EP.</summary>
 /// <param name="and">Incoming message from <c>and</c>.</param>
 /// <param name="a">Constant value for <c>a</c>.</param>
 /// <param name="b">Constant value for <c>b</c>.</param>
 /// <returns>Logarithm of the factor's average value across the given argument distributions.</returns>
 /// <remarks>
 ///   <para>The formula for the result is <c>log(sum_(and) p(and) factor(and,a,b))</c>.</para>
 /// </remarks>
 public static double LogAverageFactor(Bernoulli and, bool a, bool b)
 {
     return(and.GetLogProb(Factor.And(a, b)));
 }
Ejemplo n.º 25
0
		public static double AverageLogFactor(Bernoulli isGreaterThan, int a, int b) { return 0.0; }
Ejemplo n.º 26
0
 /// <summary>EP message to <c>and</c>.</summary>
 /// <param name="A">Incoming message from <c>a</c>.</param>
 /// <param name="B">Incoming message from <c>b</c>.</param>
 /// <returns>The outgoing EP message to the <c>and</c> argument.</returns>
 /// <remarks>
 ///   <para>The outgoing message is a distribution matching the moments of <c>and</c> as the random arguments are varied. The formula is <c>proj[p(and) sum_(a,b) p(a,b) factor(and,a,b)]/p(and)</c>.</para>
 /// </remarks>
 public static Bernoulli AndAverageConditional(Bernoulli A, Bernoulli B)
 {
     return(Bernoulli.FromLogOdds(-Bernoulli.Or(-A.LogOdds, -B.LogOdds)));
 }
Ejemplo n.º 27
0
		/// <summary>
		/// Evidence message for VMP
		/// </summary>
		/// <param name="sample">Incoming message from 'sample'. Must be a proper distribution.  If uniform, the result will be uniform.</param>
		/// <param name="probTrue">Constant value for 'probTrue'.</param>
		/// <returns>Average of the factor's log-value across the given argument distributions</returns>
		/// <remarks><para>
		/// The formula for the result is <c>sum_(sample) p(sample) log(factor(sample,probTrue))</c>.
		/// Adding up these values across all factors and variables gives the log-evidence estimate for VMP.
		/// </para></remarks>
		/// <exception cref="ImproperMessageException"><paramref name="sample"/> is not a proper distribution</exception>
		public static double AverageLogFactor(Bernoulli sample, double probTrue)
		{
			if (sample.IsPointMass) return AverageLogFactor(sample.Point, probTrue);
			return AverageLogFactor(sample, Beta.PointMass(probTrue));
		}
Ejemplo n.º 28
0
        /// <summary>Computations that depend on the observed value of numberOfIterationsDecreased and WetGrass</summary>
        /// <param name="numberOfIterations">The number of times to iterate each loop</param>
        public void Changed_numberOfIterationsDecreased_WetGrass(int numberOfIterations)
        {
            if (this.Changed_numberOfIterationsDecreased_WetGrass_iterationsDone == numberOfIterations)
            {
                return;
            }
            // The constant 'vBernoulli5'
            Bernoulli vBernoulli5 = Bernoulli.FromLogOdds(4.5951198501345889);

            this.WetGrass_marginal = ArrayHelper.MakeUniform <Bernoulli>(vBernoulli5);
            this.WetGrass_marginal = Distribution.SetPoint <Bernoulli, bool>(this.WetGrass_marginal, this.wetGrass);
            Bernoulli Rain_F = ArrayHelper.MakeUniform <Bernoulli>(this.vBernoulli3);
            // The constant 'vBernoulli0'
            Bernoulli vBernoulli0 = Bernoulli.FromLogOdds(0);

            this.Cloudy_marginal_F = ArrayHelper.MakeUniform <Bernoulli>(vBernoulli0);
            DistributionStructArray <Bernoulli, bool> Rain_cond_Cloudy_F = default(DistributionStructArray <Bernoulli, bool>);

            // Create array for 'Rain_cond_Cloudy' Forwards messages.
            Rain_cond_Cloudy_F = new DistributionStructArray <Bernoulli, bool>(2);
            for (int _gateind = 0; _gateind < 2; _gateind++)
            {
                Rain_cond_Cloudy_F[_gateind] = ArrayHelper.MakeUniform <Bernoulli>(this.vBernoulli3);
            }
            // Message to 'Rain_cond_Cloudy' from Copy factor
            Rain_cond_Cloudy_F[0] = Factor.Copy <Bernoulli>(this.vBernoulli3);
            // The constant 'vBernoulli4'
            Bernoulli vBernoulli4 = Bernoulli.FromLogOdds(-1.3862943611198906);

            // Message to 'Rain_cond_Cloudy' from Copy factor
            Rain_cond_Cloudy_F[1] = Factor.Copy <Bernoulli>(vBernoulli4);
            DistributionStructArray <Bernoulli, bool> Cloudy_selector_cases_F = default(DistributionStructArray <Bernoulli, bool>);

            // Create array for 'Cloudy_selector_cases' Forwards messages.
            Cloudy_selector_cases_F = new DistributionStructArray <Bernoulli, bool>(2);
            for (int _iv0 = 0; _iv0 < 2; _iv0++)
            {
                Cloudy_selector_cases_F[_iv0] = ArrayHelper.MakeUniform <Bernoulli>(new Bernoulli());
            }
            // Message to 'Cloudy_selector_cases' from Cases factor
            Cloudy_selector_cases_F = CasesOp.CasesAverageConditional <DistributionStructArray <Bernoulli, bool> >(vBernoulli0, Cloudy_selector_cases_F);
            // The constant 'vBernoulli1'
            Bernoulli vBernoulli1 = Bernoulli.FromLogOdds(-2.1972245773362191);
            DistributionStructArray <Bernoulli, bool> Sprinkler_cond_Cloudy_F = default(DistributionStructArray <Bernoulli, bool>);

            // Create array for 'Sprinkler_cond_Cloudy' Forwards messages.
            Sprinkler_cond_Cloudy_F = new DistributionStructArray <Bernoulli, bool>(2);
            for (int _gateind = 0; _gateind < 2; _gateind++)
            {
                Sprinkler_cond_Cloudy_F[_gateind] = ArrayHelper.MakeUniform <Bernoulli>(vBernoulli1);
            }
            // Message to 'Sprinkler_cond_Cloudy' from Copy factor
            Sprinkler_cond_Cloudy_F[0] = Factor.Copy <Bernoulli>(vBernoulli1);
            // Message to 'Sprinkler_cond_Cloudy' from Copy factor
            Sprinkler_cond_Cloudy_F[1] = Factor.Copy <Bernoulli>(vBernoulli0);
            Bernoulli Rain_cond_Sprinkler_0_selector_cases_0_B = ArrayHelper.MakeUniform <Bernoulli>(new Bernoulli());

            // Message to 'Rain_cond_Sprinkler_0_selector_cases_0' from Random factor
            Rain_cond_Sprinkler_0_selector_cases_0_B = Bernoulli.FromLogOdds(UnaryOp <bool> .LogEvidenceRatio <Bernoulli>(this.wetGrass, vBernoulli5));
            DistributionStructArray <Bernoulli, bool> Rain_cond_Sprinkler_0_selector_cases_B = default(DistributionStructArray <Bernoulli, bool>);

            // Create array for 'Rain_cond_Sprinkler_0_selector_cases' Backwards messages.
            Rain_cond_Sprinkler_0_selector_cases_B = new DistributionStructArray <Bernoulli, bool>(2);
            for (int _ind0 = 0; _ind0 < 2; _ind0++)
            {
                Rain_cond_Sprinkler_0_selector_cases_B[_ind0] = ArrayHelper.MakeUniform <Bernoulli>(new Bernoulli());
            }
            // Message to 'Rain_cond_Sprinkler_0_selector_cases' from Copy factor
            Rain_cond_Sprinkler_0_selector_cases_B[0] = Factor.Copy <Bernoulli>(Rain_cond_Sprinkler_0_selector_cases_0_B);
            // The constant 'vBernoulli6'
            Bernoulli vBernoulli6 = Bernoulli.FromLogOdds(2.1972245773362196);
            Bernoulli Rain_cond_Sprinkler_0_selector_cases_1_B = ArrayHelper.MakeUniform <Bernoulli>(new Bernoulli());

            // Message to 'Rain_cond_Sprinkler_0_selector_cases_1' from Random factor
            Rain_cond_Sprinkler_0_selector_cases_1_B = Bernoulli.FromLogOdds(UnaryOp <bool> .LogEvidenceRatio <Bernoulli>(this.wetGrass, vBernoulli6));
            // Message to 'Rain_cond_Sprinkler_0_selector_cases' from Copy factor
            Rain_cond_Sprinkler_0_selector_cases_B[1] = Factor.Copy <Bernoulli>(Rain_cond_Sprinkler_0_selector_cases_1_B);
            Bernoulli[] Sprinkler_selector_cases_0_uses_B = default(Bernoulli[]);
            // Create array for 'Sprinkler_selector_cases_0_uses' Backwards messages.
            Sprinkler_selector_cases_0_uses_B = new Bernoulli[5];
            for (int _ind = 0; _ind < 5; _ind++)
            {
                Sprinkler_selector_cases_0_uses_B[_ind] = ArrayHelper.MakeUniform <Bernoulli>(new Bernoulli());
            }
            Bernoulli Sprinkler_selector_cases_0_B = ArrayHelper.MakeUniform <Bernoulli>(new Bernoulli());
            DistributionStructArray <Bernoulli, bool> Sprinkler_selector_cases_B = default(DistributionStructArray <Bernoulli, bool>);

            // Create array for 'Sprinkler_selector_cases' Backwards messages.
            Sprinkler_selector_cases_B = new DistributionStructArray <Bernoulli, bool>(2);
            for (int _ind0 = 0; _ind0 < 2; _ind0++)
            {
                Sprinkler_selector_cases_B[_ind0] = ArrayHelper.MakeUniform <Bernoulli>(new Bernoulli());
            }
            Bernoulli Rain_cond_Sprinkler_1_selector_cases_0_B = ArrayHelper.MakeUniform <Bernoulli>(new Bernoulli());

            // Message to 'Rain_cond_Sprinkler_1_selector_cases_0' from Random factor
            Rain_cond_Sprinkler_1_selector_cases_0_B = Bernoulli.FromLogOdds(UnaryOp <bool> .LogEvidenceRatio <Bernoulli>(this.wetGrass, vBernoulli6));
            DistributionStructArray <Bernoulli, bool> Rain_cond_Sprinkler_1_selector_cases_B = default(DistributionStructArray <Bernoulli, bool>);

            // Create array for 'Rain_cond_Sprinkler_1_selector_cases' Backwards messages.
            Rain_cond_Sprinkler_1_selector_cases_B = new DistributionStructArray <Bernoulli, bool>(2);
            for (int _ind0 = 0; _ind0 < 2; _ind0++)
            {
                Rain_cond_Sprinkler_1_selector_cases_B[_ind0] = ArrayHelper.MakeUniform <Bernoulli>(new Bernoulli());
            }
            // Message to 'Rain_cond_Sprinkler_1_selector_cases' from Copy factor
            Rain_cond_Sprinkler_1_selector_cases_B[0] = Factor.Copy <Bernoulli>(Rain_cond_Sprinkler_1_selector_cases_0_B);
            // The constant 'vBernoulli8'
            Bernoulli vBernoulli8 = Bernoulli.FromLogOdds(Double.NegativeInfinity);
            Bernoulli Rain_cond_Sprinkler_1_selector_cases_1_B = ArrayHelper.MakeUniform <Bernoulli>(new Bernoulli());

            // Message to 'Rain_cond_Sprinkler_1_selector_cases_1' from Random factor
            Rain_cond_Sprinkler_1_selector_cases_1_B = Bernoulli.FromLogOdds(UnaryOp <bool> .LogEvidenceRatio <Bernoulli>(this.wetGrass, vBernoulli8));
            // Message to 'Rain_cond_Sprinkler_1_selector_cases' from Copy factor
            Rain_cond_Sprinkler_1_selector_cases_B[1] = Factor.Copy <Bernoulli>(Rain_cond_Sprinkler_1_selector_cases_1_B);
            Bernoulli[] Sprinkler_selector_cases_1_uses_B = default(Bernoulli[]);
            // Create array for 'Sprinkler_selector_cases_1_uses' Backwards messages.
            Sprinkler_selector_cases_1_uses_B = new Bernoulli[5];
            for (int _ind = 0; _ind < 5; _ind++)
            {
                Sprinkler_selector_cases_1_uses_B[_ind] = ArrayHelper.MakeUniform <Bernoulli>(new Bernoulli());
            }
            Bernoulli Sprinkler_selector_cases_1_B = ArrayHelper.MakeUniform <Bernoulli>(new Bernoulli());

            Bernoulli[] Sprinkler_selector_uses_B = default(Bernoulli[]);
            // Create array for 'Sprinkler_selector_uses' Backwards messages.
            Sprinkler_selector_uses_B = new Bernoulli[2];
            for (int _ind = 0; _ind < 2; _ind++)
            {
                Sprinkler_selector_uses_B[_ind] = ArrayHelper.MakeUniform <Bernoulli>(vBernoulli1);
            }
            Bernoulli Sprinkler_selector_B = ArrayHelper.MakeUniform <Bernoulli>(vBernoulli1);
            // Buffer for Replicate2BufferOp.UsesAverageConditional<DistributionStructArray<Bernoulli,bool>>
            DistributionStructArray <Bernoulli, bool> Cloudy_selector_cases_uses_B_marginal = default(DistributionStructArray <Bernoulli, bool>);

            // Message to 'Cloudy_selector_cases_uses' from Replicate factor
            Cloudy_selector_cases_uses_B_marginal = Replicate2BufferOp.MarginalInit <DistributionStructArray <Bernoulli, bool> >(Cloudy_selector_cases_F);
            DistributionStructArray <Bernoulli, bool>[] Cloudy_selector_cases_uses_F = default(DistributionStructArray <Bernoulli, bool>[]);
            // Create array for 'Cloudy_selector_cases_uses' Forwards messages.
            Cloudy_selector_cases_uses_F = new DistributionStructArray <Bernoulli, bool> [4];
            for (int _ind = 0; _ind < 4; _ind++)
            {
                // Create array for 'Cloudy_selector_cases_uses' Forwards messages.
                Cloudy_selector_cases_uses_F[_ind] = new DistributionStructArray <Bernoulli, bool>(2);
                for (int _iv0 = 0; _iv0 < 2; _iv0++)
                {
                    Cloudy_selector_cases_uses_F[_ind][_iv0] = ArrayHelper.MakeUniform <Bernoulli>(new Bernoulli());
                }
            }
            Bernoulli Sprinkler_F = ArrayHelper.MakeUniform <Bernoulli>(vBernoulli1);
            // Buffer for Replicate2BufferOp.UsesAverageConditional<Bernoulli>
            Bernoulli Sprinkler_selector_uses_B_marginal = default(Bernoulli);

            // Message to 'Sprinkler_selector_uses' from Replicate factor
            Sprinkler_selector_uses_B_marginal = Replicate2BufferOp.MarginalInit <Bernoulli>(Sprinkler_F);
            Bernoulli[] Sprinkler_selector_uses_F = default(Bernoulli[]);
            // Create array for 'Sprinkler_selector_uses' Forwards messages.
            Sprinkler_selector_uses_F = new Bernoulli[2];
            for (int _ind = 0; _ind < 2; _ind++)
            {
                Sprinkler_selector_uses_F[_ind] = ArrayHelper.MakeUniform <Bernoulli>(vBernoulli1);
            }
            Bernoulli Rain_cond_Sprinkler_0_selector_B = ArrayHelper.MakeUniform <Bernoulli>(this.vBernoulli3);

            // Message to 'Rain_cond_Sprinkler_0_selector' from Cases factor
            Rain_cond_Sprinkler_0_selector_B = CasesOp.BAverageConditional(Rain_cond_Sprinkler_0_selector_cases_B);
            DistributionStructArray <Bernoulli, bool> Rain_cond_Sprinkler_B = default(DistributionStructArray <Bernoulli, bool>);

            // Create array for 'Rain_cond_Sprinkler' Backwards messages.
            Rain_cond_Sprinkler_B = new DistributionStructArray <Bernoulli, bool>(2);
            for (int _gateind = 0; _gateind < 2; _gateind++)
            {
                Rain_cond_Sprinkler_B[_gateind] = ArrayHelper.MakeUniform <Bernoulli>(this.vBernoulli3);
            }
            // Message to 'Rain_cond_Sprinkler' from Copy factor
            Rain_cond_Sprinkler_B[0] = Factor.Copy <Bernoulli>(Rain_cond_Sprinkler_0_selector_B);
            Bernoulli Rain_cond_Sprinkler_1_selector_B = ArrayHelper.MakeUniform <Bernoulli>(this.vBernoulli3);

            // Message to 'Rain_cond_Sprinkler_1_selector' from Cases factor
            Rain_cond_Sprinkler_1_selector_B = CasesOp.BAverageConditional(Rain_cond_Sprinkler_1_selector_cases_B);
            // Message to 'Rain_cond_Sprinkler' from Copy factor
            Rain_cond_Sprinkler_B[1] = Factor.Copy <Bernoulli>(Rain_cond_Sprinkler_1_selector_B);
            for (int iteration = this.Changed_numberOfIterationsDecreased_WetGrass_iterationsDone; iteration < numberOfIterations; iteration++)
            {
                // Message to 'Cloudy_selector_cases_uses' from Replicate factor
                Cloudy_selector_cases_uses_B_marginal = Replicate2BufferOp.Marginal <DistributionStructArray <Bernoulli, bool> >(this.Cloudy_selector_cases_uses_B, Cloudy_selector_cases_F, Cloudy_selector_cases_uses_B_marginal);
                // Message to 'Cloudy_selector_cases_uses' from Replicate factor
                Cloudy_selector_cases_uses_F[1] = Replicate2BufferOp.UsesAverageConditional <DistributionStructArray <Bernoulli, bool> >(this.Cloudy_selector_cases_uses_B, Cloudy_selector_cases_F, Cloudy_selector_cases_uses_B_marginal, 1, Cloudy_selector_cases_uses_F[1]);
                // Message to 'Rain' from Exit factor
                Rain_F = GateExitOp <bool> .ExitAverageConditional <Bernoulli>(this.Rain_use_B, Cloudy_selector_cases_uses_F[1], Rain_cond_Cloudy_F, Rain_F);

                // Message to 'Sprinkler_selector_cases_1_uses' from Cases factor
                Sprinkler_selector_cases_1_uses_B[4] = Bernoulli.FromLogOdds(CasesOp.LogEvidenceRatio(Rain_cond_Sprinkler_1_selector_cases_B, Rain_F));
                // Message to 'Sprinkler_selector_cases_1' from Replicate factor
                Sprinkler_selector_cases_1_B = ReplicateOp.DefAverageConditional <Bernoulli>(Sprinkler_selector_cases_1_uses_B, Sprinkler_selector_cases_1_B);
                // Message to 'Sprinkler_selector_cases' from Copy factor
                Sprinkler_selector_cases_B[1] = Factor.Copy <Bernoulli>(Sprinkler_selector_cases_1_B);
                // Message to 'Sprinkler_selector_cases_0_uses' from Cases factor
                Sprinkler_selector_cases_0_uses_B[4] = Bernoulli.FromLogOdds(CasesOp.LogEvidenceRatio(Rain_cond_Sprinkler_0_selector_cases_B, Rain_F));
                // Message to 'Sprinkler_selector_cases_0' from Replicate factor
                Sprinkler_selector_cases_0_B = ReplicateOp.DefAverageConditional <Bernoulli>(Sprinkler_selector_cases_0_uses_B, Sprinkler_selector_cases_0_B);
                // Message to 'Sprinkler_selector_cases' from Copy factor
                Sprinkler_selector_cases_B[0] = Factor.Copy <Bernoulli>(Sprinkler_selector_cases_0_B);
                // Message to 'Sprinkler_selector_uses' from Cases factor
                Sprinkler_selector_uses_B[0] = CasesOp.BAverageConditional(Sprinkler_selector_cases_B);
                // Message to 'Sprinkler_selector' from Replicate factor
                Sprinkler_selector_B = ReplicateOp.DefAverageConditional <Bernoulli>(Sprinkler_selector_uses_B, Sprinkler_selector_B);
                // Message to 'Cloudy_selector_cases_uses' from Exit factor
                this.Cloudy_selector_cases_uses_B[3] = GateExitOp <bool> .CasesAverageConditional <Bernoulli, DistributionStructArray <Bernoulli, bool> >(Sprinkler_selector_B, Sprinkler_cond_Cloudy_F, this.Cloudy_selector_cases_uses_B[3]);

                // Message to 'Cloudy_selector_cases_uses' from Replicate factor
                Cloudy_selector_cases_uses_B_marginal = Replicate2BufferOp.Marginal <DistributionStructArray <Bernoulli, bool> >(this.Cloudy_selector_cases_uses_B, Cloudy_selector_cases_F, Cloudy_selector_cases_uses_B_marginal);
                // Message to 'Cloudy_selector_cases_uses' from Replicate factor
                Cloudy_selector_cases_uses_F[3] = Replicate2BufferOp.UsesAverageConditional <DistributionStructArray <Bernoulli, bool> >(this.Cloudy_selector_cases_uses_B, Cloudy_selector_cases_F, Cloudy_selector_cases_uses_B_marginal, 3, Cloudy_selector_cases_uses_F[3]);
                // Message to 'Sprinkler' from Exit factor
                Sprinkler_F = GateExitOp <bool> .ExitAverageConditional <Bernoulli>(Sprinkler_selector_B, Cloudy_selector_cases_uses_F[3], Sprinkler_cond_Cloudy_F, Sprinkler_F);

                // Message to 'Sprinkler_selector_uses' from Replicate factor
                Sprinkler_selector_uses_B_marginal = Replicate2BufferOp.Marginal <Bernoulli>(Sprinkler_selector_uses_B, Sprinkler_F, Sprinkler_selector_uses_B_marginal);
                // Message to 'Sprinkler_selector_uses' from Replicate factor
                Sprinkler_selector_uses_F[1] = Replicate2BufferOp.UsesAverageConditional <Bernoulli>(Sprinkler_selector_uses_B, Sprinkler_F, Sprinkler_selector_uses_B_marginal, 1, Sprinkler_selector_uses_F[1]);
                // Message to 'Rain_use' from EnterPartial factor
                this.Rain_use_B = GateEnterPartialOp <bool> .ValueAverageConditional <Bernoulli>(Rain_cond_Sprinkler_B, Sprinkler_selector_uses_F[1], Rain_F, new int[2] {
                    0, 1
                }, this.Rain_use_B);

                // Message to 'Cloudy_selector_cases_uses' from Exit factor
                this.Cloudy_selector_cases_uses_B[1] = GateExitOp <bool> .CasesAverageConditional <Bernoulli, DistributionStructArray <Bernoulli, bool> >(this.Rain_use_B, Rain_cond_Cloudy_F, this.Cloudy_selector_cases_uses_B[1]);

                this.OnProgressChanged(new ProgressChangedEventArgs(iteration));
            }
            DistributionStructArray <Bernoulli, bool> Cloudy_selector_cases_B = default(DistributionStructArray <Bernoulli, bool>);

            // Create array for 'Cloudy_selector_cases' Backwards messages.
            Cloudy_selector_cases_B = new DistributionStructArray <Bernoulli, bool>(2);
            for (int _iv0 = 0; _iv0 < 2; _iv0++)
            {
                Cloudy_selector_cases_B[_iv0] = ArrayHelper.MakeUniform <Bernoulli>(new Bernoulli());
            }
            // Message to 'Cloudy_selector_cases' from Replicate factor
            Cloudy_selector_cases_B = ReplicateOp.DefAverageConditional <DistributionStructArray <Bernoulli, bool> >(this.Cloudy_selector_cases_uses_B, Cloudy_selector_cases_B);
            Bernoulli Cloudy_selector_B = ArrayHelper.MakeUniform <Bernoulli>(vBernoulli0);

            // Message to 'Cloudy_selector' from Cases factor
            Cloudy_selector_B = CasesOp.BAverageConditional(Cloudy_selector_cases_B);
            // Message to 'Cloudy_marginal' from Variable factor
            this.Cloudy_marginal_F = VariableOp.MarginalAverageConditional <Bernoulli>(Cloudy_selector_B, vBernoulli0, this.Cloudy_marginal_F);
            this.Rain_marginal_F   = ArrayHelper.MakeUniform <Bernoulli>(this.vBernoulli3);
            // Message to 'Rain_marginal' from DerivedVariable factor
            this.Rain_marginal_F      = DerivedVariableOp.MarginalAverageConditional <Bernoulli>(this.Rain_use_B, Rain_F, this.Rain_marginal_F);
            this.Sprinkler_marginal_F = ArrayHelper.MakeUniform <Bernoulli>(vBernoulli1);
            // Message to 'Sprinkler_marginal' from DerivedVariable factor
            this.Sprinkler_marginal_F = DerivedVariableOp.MarginalAverageConditional <Bernoulli>(Sprinkler_selector_B, Sprinkler_F, this.Sprinkler_marginal_F);
            this.Changed_numberOfIterationsDecreased_WetGrass_iterationsDone = numberOfIterations;
        }
Ejemplo n.º 29
0
 /// <summary>
 /// Creates message arrays and initialises their values ready for inference to be performed.
 /// </summary>
 /// <remarks>
 /// This method should be called once each time inference is performed. Since the initialisation
 /// procedure normally dependson external values such as priors and array sizes, all external
 /// values must be set before calling this method.
 /// 
 /// As well as initialising message arrays, this method also performs any message passing that
 /// the scheduler determines need only be carried out once.
 /// </remarks>
 public void Initialise()
 {
     this.vbool440_marginal_B = ArrayHelper.MakeUniform<Bernoulli>(new Bernoulli());
     this.vbool471_marginal_B = ArrayHelper.MakeUniform<Bernoulli>(new Bernoulli());
     this.vbool432_marginal_B = ArrayHelper.MakeUniform<Bernoulli>(new Bernoulli());
     this.vbool343_marginal_B = ArrayHelper.MakeUniform<Bernoulli>(new Bernoulli());
     this.vbool472_marginal_B = ArrayHelper.MakeUniform<Bernoulli>(new Bernoulli());
     this.vbool351_marginal_B = ArrayHelper.MakeUniform<Bernoulli>(new Bernoulli());
     this.vbool335_marginal_B = ArrayHelper.MakeUniform<Bernoulli>(new Bernoulli());
     this.vbool359_marginal_B = ArrayHelper.MakeUniform<Bernoulli>(new Bernoulli());
     this.vbool367_marginal_B = ArrayHelper.MakeUniform<Bernoulli>(new Bernoulli());
     this.vbool319_marginal_B = ArrayHelper.MakeUniform<Bernoulli>(new Bernoulli());
     this.vbool327_marginal_B = ArrayHelper.MakeUniform<Bernoulli>(new Bernoulli());
     this.vbool303_marginal_B = ArrayHelper.MakeUniform<Bernoulli>(new Bernoulli());
     this.vbool311_marginal_B = ArrayHelper.MakeUniform<Bernoulli>(new Bernoulli());
     this.vbool295_marginal_B = ArrayHelper.MakeUniform<Bernoulli>(new Bernoulli());
     this.vbool179_marginal_B = ArrayHelper.MakeUniform<Bernoulli>(vBernoulli187);
     this.vbool171_marginal_B = ArrayHelper.MakeUniform<Bernoulli>(vBernoulli179);
     this.vbool101_marginal_B = ArrayHelper.MakeUniform<Bernoulli>(vBernoulli109);
     this.vbool153_marginal_B = ArrayHelper.MakeUniform<Bernoulli>(vBernoulli161);
     this.vbool124_marginal_B = ArrayHelper.MakeUniform<Bernoulli>(vBernoulli132);
     this.vbool88_marginal_B = ArrayHelper.MakeUniform<Bernoulli>(vBernoulli96);
     this.vbool140_marginal_B = ArrayHelper.MakeUniform<Bernoulli>(vBernoulli148);
     this.vbool80_marginal_B = ArrayHelper.MakeUniform<Bernoulli>(vBernoulli88);
     this.vbool132_marginal_B = ArrayHelper.MakeUniform<Bernoulli>(vBernoulli140);
     this.vbool28_marginal_B = ArrayHelper.MakeUniform<Bernoulli>(vBernoulli36);
     this.vbool62_marginal_B = ArrayHelper.MakeUniform<Bernoulli>(vBernoulli70);
     this.vbool36_marginal_B = ArrayHelper.MakeUniform<Bernoulli>(vBernoulli44);
     this.vbool54_marginal_B = ArrayHelper.MakeUniform<Bernoulli>(vBernoulli62);
     this.vbool10_marginal_B = ArrayHelper.MakeUniform<Bernoulli>(vBernoulli18);
 }
Ejemplo n.º 30
0
 /// <include file='FactorDocs.xml' path='factor_docs/message_op_class[@name="BooleanOrOp"]/message_doc[@name="BAverageConditional(Bernoulli, bool)"]/*'/>
 public static Bernoulli BAverageConditional([SkipIfUniform] Bernoulli or, bool A)
 {
     return(AAverageConditional(or, A));
 }
Ejemplo n.º 31
0
 /// <summary>
 /// Configures constant values that will not change during the lifetime of the class.
 /// </summary>
 /// <remarks>
 /// This method should be called once only after the class is instantiated.  In future, it will likely become
 /// the class constructor.
 /// </remarks>
 public void Reset()
 {
     // Create array for 'vbool149_uses' backwards messages.
     this.vbool149_uses_B = new Bernoulli[2];
     this.vBernoulli157 = new Bernoulli(0.01);
     for(int _ind0 = 0; _ind0<2; _ind0++)
     {
         this.vbool149_uses_B[_ind0] = ArrayHelper.MakeUniform<Bernoulli>(this.vBernoulli157);
     }
     this.vbool149_F = ArrayHelper.MakeUniform<Bernoulli>(vBernoulli157);
     // Message to 'vbool149' from Random factor
     this.vbool149_F = UnaryOp<bool>.RandomAverageConditional<Bernoulli>(this.vBernoulli157);
     // Create array for 'vbool167_uses' backwards messages.
     this.vbool167_uses_B = new Bernoulli[2];
     this.vBernoulli175 = new Bernoulli(0.5);
     for(int _ind0 = 0; _ind0<2; _ind0++)
     {
         this.vbool167_uses_B[_ind0] = ArrayHelper.MakeUniform<Bernoulli>(this.vBernoulli175);
     }
     this.vbool167_F = ArrayHelper.MakeUniform<Bernoulli>(vBernoulli175);
     // Message to 'vbool167' from Random factor
     this.vbool167_F = UnaryOp<bool>.RandomAverageConditional<Bernoulli>(this.vBernoulli175);
     // Create array for 'vbool431_uses' backwards messages.
     this.vbool431_uses_B = new Bernoulli[1];
     for(int _ind0 = 0; _ind0<1; _ind0++)
     {
         this.vbool431_uses_B[_ind0] = ArrayHelper.MakeUniform<Bernoulli>(new Bernoulli());
     }
     this.vbool431_F = ArrayHelper.MakeUniform<Bernoulli>(new Bernoulli());
     // Create array for 'vbool84_uses' backwards messages.
     this.vbool84_uses_B = new Bernoulli[2];
     this.vBernoulli92 = new Bernoulli(0.01);
     for(int _ind0 = 0; _ind0<2; _ind0++)
     {
         this.vbool84_uses_B[_ind0] = ArrayHelper.MakeUniform<Bernoulli>(this.vBernoulli92);
     }
     this.vbool84_F = ArrayHelper.MakeUniform<Bernoulli>(vBernoulli92);
     // Message to 'vbool84' from Random factor
     this.vbool84_F = UnaryOp<bool>.RandomAverageConditional<Bernoulli>(this.vBernoulli92);
     // Create array for 'vbool470_uses' backwards messages.
     this.vbool470_uses_B = new Bernoulli[1];
     for(int _ind0 = 0; _ind0<1; _ind0++)
     {
         this.vbool470_uses_B[_ind0] = ArrayHelper.MakeUniform<Bernoulli>(new Bernoulli());
     }
     this.vbool470_F = ArrayHelper.MakeUniform<Bernoulli>(new Bernoulli());
     // Create array for 'vbool175_uses' backwards messages.
     this.vbool175_uses_B = new Bernoulli[2];
     this.vBernoulli183 = new Bernoulli(0.01);
     for(int _ind0 = 0; _ind0<2; _ind0++)
     {
         this.vbool175_uses_B[_ind0] = ArrayHelper.MakeUniform<Bernoulli>(this.vBernoulli183);
     }
     this.vbool175_F = ArrayHelper.MakeUniform<Bernoulli>(vBernoulli183);
     // Message to 'vbool175' from Random factor
     this.vbool175_F = UnaryOp<bool>.RandomAverageConditional<Bernoulli>(this.vBernoulli183);
     // Create array for 'vbool439_uses' backwards messages.
     this.vbool439_uses_B = new Bernoulli[1];
     for(int _ind0 = 0; _ind0<1; _ind0++)
     {
         this.vbool439_uses_B[_ind0] = ArrayHelper.MakeUniform<Bernoulli>(new Bernoulli());
     }
     this.vbool439_F = ArrayHelper.MakeUniform<Bernoulli>(new Bernoulli());
     // Create array for 'vbool76_uses' backwards messages.
     this.vbool76_uses_B = new Bernoulli[2];
     this.vBernoulli84 = new Bernoulli(0.5);
     for(int _ind0 = 0; _ind0<2; _ind0++)
     {
         this.vbool76_uses_B[_ind0] = ArrayHelper.MakeUniform<Bernoulli>(this.vBernoulli84);
     }
     this.vbool76_F = ArrayHelper.MakeUniform<Bernoulli>(vBernoulli84);
     // Message to 'vbool76' from Random factor
     this.vbool76_F = UnaryOp<bool>.RandomAverageConditional<Bernoulli>(this.vBernoulli84);
     // Create array for 'vbool334_uses' backwards messages.
     this.vbool334_uses_B = new Bernoulli[1];
     for(int _ind0 = 0; _ind0<1; _ind0++)
     {
         this.vbool334_uses_B[_ind0] = ArrayHelper.MakeUniform<Bernoulli>(new Bernoulli());
     }
     this.vbool334_F = ArrayHelper.MakeUniform<Bernoulli>(new Bernoulli());
     // Create array for 'vbool97_uses' backwards messages.
     this.vbool97_uses_B = new Bernoulli[2];
     this.vBernoulli105 = new Bernoulli(0.01);
     for(int _ind0 = 0; _ind0<2; _ind0++)
     {
         this.vbool97_uses_B[_ind0] = ArrayHelper.MakeUniform<Bernoulli>(this.vBernoulli105);
     }
     this.vbool97_F = ArrayHelper.MakeUniform<Bernoulli>(vBernoulli105);
     // Message to 'vbool97' from Random factor
     this.vbool97_F = UnaryOp<bool>.RandomAverageConditional<Bernoulli>(this.vBernoulli105);
     // Create array for 'vbool469_uses' backwards messages.
     this.vbool469_uses_B = new Bernoulli[1];
     for(int _ind0 = 0; _ind0<1; _ind0++)
     {
         this.vbool469_uses_B[_ind0] = ArrayHelper.MakeUniform<Bernoulli>(new Bernoulli());
     }
     this.vbool469_F = ArrayHelper.MakeUniform<Bernoulli>(new Bernoulli());
     // Create array for 'vbool58_uses' backwards messages.
     this.vbool58_uses_B = new Bernoulli[3];
     this.vBernoulli66 = new Bernoulli(0.5);
     for(int _ind0 = 0; _ind0<3; _ind0++)
     {
         this.vbool58_uses_B[_ind0] = ArrayHelper.MakeUniform<Bernoulli>(this.vBernoulli66);
     }
     this.vbool58_F = ArrayHelper.MakeUniform<Bernoulli>(vBernoulli66);
     // Message to 'vbool58' from Random factor
     this.vbool58_F = UnaryOp<bool>.RandomAverageConditional<Bernoulli>(this.vBernoulli66);
     // Create array for 'vbool318_uses' backwards messages.
     this.vbool318_uses_B = new Bernoulli[1];
     for(int _ind0 = 0; _ind0<1; _ind0++)
     {
         this.vbool318_uses_B[_ind0] = ArrayHelper.MakeUniform<Bernoulli>(new Bernoulli());
     }
     this.vbool318_F = ArrayHelper.MakeUniform<Bernoulli>(new Bernoulli());
     // Create array for 'vbool120_uses' backwards messages.
     this.vbool120_uses_B = new Bernoulli[2];
     this.vBernoulli128 = new Bernoulli(0.5);
     for(int _ind0 = 0; _ind0<2; _ind0++)
     {
         this.vbool120_uses_B[_ind0] = ArrayHelper.MakeUniform<Bernoulli>(this.vBernoulli128);
     }
     this.vbool120_F = ArrayHelper.MakeUniform<Bernoulli>(vBernoulli128);
     // Message to 'vbool120' from Random factor
     this.vbool120_F = UnaryOp<bool>.RandomAverageConditional<Bernoulli>(this.vBernoulli128);
     // Create array for 'vbool342_uses' backwards messages.
     this.vbool342_uses_B = new Bernoulli[1];
     for(int _ind0 = 0; _ind0<1; _ind0++)
     {
         this.vbool342_uses_B[_ind0] = ArrayHelper.MakeUniform<Bernoulli>(new Bernoulli());
     }
     this.vbool342_F = ArrayHelper.MakeUniform<Bernoulli>(new Bernoulli());
     // Create array for 'vbool50_uses' backwards messages.
     this.vbool50_uses_B = new Bernoulli[2];
     this.vBernoulli58 = new Bernoulli(0.5);
     for(int _ind0 = 0; _ind0<2; _ind0++)
     {
         this.vbool50_uses_B[_ind0] = ArrayHelper.MakeUniform<Bernoulli>(this.vBernoulli58);
     }
     this.vbool50_F = ArrayHelper.MakeUniform<Bernoulli>(vBernoulli58);
     // Message to 'vbool50' from Random factor
     this.vbool50_F = UnaryOp<bool>.RandomAverageConditional<Bernoulli>(this.vBernoulli58);
     // Create array for 'vbool310_uses' backwards messages.
     this.vbool310_uses_B = new Bernoulli[1];
     for(int _ind0 = 0; _ind0<1; _ind0++)
     {
         this.vbool310_uses_B[_ind0] = ArrayHelper.MakeUniform<Bernoulli>(new Bernoulli());
     }
     this.vbool310_F = ArrayHelper.MakeUniform<Bernoulli>(new Bernoulli());
     // Create array for 'vbool128_uses' backwards messages.
     this.vbool128_uses_B = new Bernoulli[2];
     this.vBernoulli136 = new Bernoulli(0.5);
     for(int _ind0 = 0; _ind0<2; _ind0++)
     {
         this.vbool128_uses_B[_ind0] = ArrayHelper.MakeUniform<Bernoulli>(this.vBernoulli136);
     }
     this.vbool128_F = ArrayHelper.MakeUniform<Bernoulli>(vBernoulli136);
     // Message to 'vbool128' from Random factor
     this.vbool128_F = UnaryOp<bool>.RandomAverageConditional<Bernoulli>(this.vBernoulli136);
     // Create array for 'vbool326_uses' backwards messages.
     this.vbool326_uses_B = new Bernoulli[1];
     for(int _ind0 = 0; _ind0<1; _ind0++)
     {
         this.vbool326_uses_B[_ind0] = ArrayHelper.MakeUniform<Bernoulli>(new Bernoulli());
     }
     this.vbool326_F = ArrayHelper.MakeUniform<Bernoulli>(new Bernoulli());
     // Create array for 'vbool136_uses' backwards messages.
     this.vbool136_uses_B = new Bernoulli[3];
     this.vBernoulli144 = new Bernoulli(0.5);
     for(int _ind0 = 0; _ind0<3; _ind0++)
     {
         this.vbool136_uses_B[_ind0] = ArrayHelper.MakeUniform<Bernoulli>(this.vBernoulli144);
     }
     this.vbool136_F = ArrayHelper.MakeUniform<Bernoulli>(vBernoulli144);
     // Message to 'vbool136' from Random factor
     this.vbool136_F = UnaryOp<bool>.RandomAverageConditional<Bernoulli>(this.vBernoulli144);
     // Create array for 'vbool350_uses' backwards messages.
     this.vbool350_uses_B = new Bernoulli[1];
     for(int _ind0 = 0; _ind0<1; _ind0++)
     {
         this.vbool350_uses_B[_ind0] = ArrayHelper.MakeUniform<Bernoulli>(new Bernoulli());
     }
     this.vbool350_F = ArrayHelper.MakeUniform<Bernoulli>(new Bernoulli());
     // Create array for 'vbool6_uses' backwards messages.
     this.vbool6_uses_B = new Bernoulli[1];
     this.vBernoulli14 = new Bernoulli(0.5);
     for(int _ind0 = 0; _ind0<1; _ind0++)
     {
         this.vbool6_uses_B[_ind0] = ArrayHelper.MakeUniform<Bernoulli>(this.vBernoulli14);
     }
     this.vbool6_F = ArrayHelper.MakeUniform<Bernoulli>(vBernoulli14);
     // Message to 'vbool6' from Random factor
     this.vbool6_F = UnaryOp<bool>.RandomAverageConditional<Bernoulli>(this.vBernoulli14);
     // Create array for 'vbool294_uses' backwards messages.
     this.vbool294_uses_B = new Bernoulli[1];
     for(int _ind0 = 0; _ind0<1; _ind0++)
     {
         this.vbool294_uses_B[_ind0] = ArrayHelper.MakeUniform<Bernoulli>(new Bernoulli());
     }
     this.vbool294_F = ArrayHelper.MakeUniform<Bernoulli>(new Bernoulli());
     // Create array for 'vbool358_uses' backwards messages.
     this.vbool358_uses_B = new Bernoulli[1];
     for(int _ind0 = 0; _ind0<1; _ind0++)
     {
         this.vbool358_uses_B[_ind0] = ArrayHelper.MakeUniform<Bernoulli>(new Bernoulli());
     }
     this.vbool358_F = ArrayHelper.MakeUniform<Bernoulli>(new Bernoulli());
     // Create array for 'vbool24_uses' backwards messages.
     this.vbool24_uses_B = new Bernoulli[2];
     this.vBernoulli32 = new Bernoulli(0.5);
     for(int _ind0 = 0; _ind0<2; _ind0++)
     {
         this.vbool24_uses_B[_ind0] = ArrayHelper.MakeUniform<Bernoulli>(this.vBernoulli32);
     }
     this.vbool24_F = ArrayHelper.MakeUniform<Bernoulli>(vBernoulli32);
     // Message to 'vbool24' from Random factor
     this.vbool24_F = UnaryOp<bool>.RandomAverageConditional<Bernoulli>(this.vBernoulli32);
     // Create array for 'vbool366_uses' backwards messages.
     this.vbool366_uses_B = new Bernoulli[1];
     for(int _ind0 = 0; _ind0<1; _ind0++)
     {
         this.vbool366_uses_B[_ind0] = ArrayHelper.MakeUniform<Bernoulli>(new Bernoulli());
     }
     this.vbool366_F = ArrayHelper.MakeUniform<Bernoulli>(new Bernoulli());
     // Create array for 'vbool32_uses' backwards messages.
     this.vbool32_uses_B = new Bernoulli[1];
     this.vBernoulli40 = new Bernoulli(0.5);
     for(int _ind0 = 0; _ind0<1; _ind0++)
     {
         this.vbool32_uses_B[_ind0] = ArrayHelper.MakeUniform<Bernoulli>(this.vBernoulli40);
     }
     this.vbool32_F = ArrayHelper.MakeUniform<Bernoulli>(vBernoulli40);
     // Message to 'vbool32' from Random factor
     this.vbool32_F = UnaryOp<bool>.RandomAverageConditional<Bernoulli>(this.vBernoulli40);
     // Create array for 'vbool302_uses' backwards messages.
     this.vbool302_uses_B = new Bernoulli[1];
     for(int _ind0 = 0; _ind0<1; _ind0++)
     {
         this.vbool302_uses_B[_ind0] = ArrayHelper.MakeUniform<Bernoulli>(new Bernoulli());
     }
     this.vbool302_F = ArrayHelper.MakeUniform<Bernoulli>(new Bernoulli());
     this.vbool431_B = ArrayHelper.MakeUniform<Bernoulli>(new Bernoulli());
     // Create array for 'vbool167_uses' forwards messages.
     this.vbool167_uses_F = new Bernoulli[2];
     for(int _ind0 = 0; _ind0<2; _ind0++)
     {
         this.vbool167_uses_F[_ind0] = ArrayHelper.MakeUniform<Bernoulli>(this.vBernoulli175);
     }
     this.vbool470_B = ArrayHelper.MakeUniform<Bernoulli>(new Bernoulli());
     // Create array for 'vbool84_uses' forwards messages.
     this.vbool84_uses_F = new Bernoulli[2];
     for(int _ind0 = 0; _ind0<2; _ind0++)
     {
         this.vbool84_uses_F[_ind0] = ArrayHelper.MakeUniform<Bernoulli>(this.vBernoulli92);
     }
     // Create array for 'vbool149_uses' forwards messages.
     this.vbool149_uses_F = new Bernoulli[2];
     for(int _ind0 = 0; _ind0<2; _ind0++)
     {
         this.vbool149_uses_F[_ind0] = ArrayHelper.MakeUniform<Bernoulli>(this.vBernoulli157);
     }
     this.vbool439_B = ArrayHelper.MakeUniform<Bernoulli>(new Bernoulli());
     // Create array for 'vbool175_uses' forwards messages.
     this.vbool175_uses_F = new Bernoulli[2];
     for(int _ind0 = 0; _ind0<2; _ind0++)
     {
         this.vbool175_uses_F[_ind0] = ArrayHelper.MakeUniform<Bernoulli>(this.vBernoulli183);
     }
     this.vBernoulli5 = new Bernoulli(0.9);
     // Message to 'vbool431_uses' from EqualRandom factor
     this.vbool431_uses_B[0] = ConstrainEqualRandomOp<bool>.ValueAverageConditional<Bernoulli>(this.vBernoulli5);
     // Message to 'vbool439_uses' from EqualRandom factor
     this.vbool439_uses_B[0] = ConstrainEqualRandomOp<bool>.ValueAverageConditional<Bernoulli>(this.vBernoulli5);
     // Message to 'vbool334_uses' from EqualRandom factor
     this.vbool334_uses_B[0] = ConstrainEqualRandomOp<bool>.ValueAverageConditional<Bernoulli>(this.vBernoulli5);
     // Message to 'vbool318_uses' from EqualRandom factor
     this.vbool318_uses_B[0] = ConstrainEqualRandomOp<bool>.ValueAverageConditional<Bernoulli>(this.vBernoulli5);
     // Message to 'vbool342_uses' from EqualRandom factor
     this.vbool342_uses_B[0] = ConstrainEqualRandomOp<bool>.ValueAverageConditional<Bernoulli>(this.vBernoulli5);
     // Message to 'vbool310_uses' from EqualRandom factor
     this.vbool310_uses_B[0] = ConstrainEqualRandomOp<bool>.ValueAverageConditional<Bernoulli>(this.vBernoulli5);
     // Message to 'vbool326_uses' from EqualRandom factor
     this.vbool326_uses_B[0] = ConstrainEqualRandomOp<bool>.ValueAverageConditional<Bernoulli>(this.vBernoulli5);
     // Message to 'vbool350_uses' from EqualRandom factor
     this.vbool350_uses_B[0] = ConstrainEqualRandomOp<bool>.ValueAverageConditional<Bernoulli>(this.vBernoulli5);
     // Message to 'vbool294_uses' from EqualRandom factor
     this.vbool294_uses_B[0] = ConstrainEqualRandomOp<bool>.ValueAverageConditional<Bernoulli>(this.vBernoulli5);
     // Message to 'vbool358_uses' from EqualRandom factor
     this.vbool358_uses_B[0] = ConstrainEqualRandomOp<bool>.ValueAverageConditional<Bernoulli>(this.vBernoulli5);
     // Message to 'vbool366_uses' from EqualRandom factor
     this.vbool366_uses_B[0] = ConstrainEqualRandomOp<bool>.ValueAverageConditional<Bernoulli>(this.vBernoulli5);
     // Message to 'vbool302_uses' from EqualRandom factor
     this.vbool302_uses_B[0] = ConstrainEqualRandomOp<bool>.ValueAverageConditional<Bernoulli>(this.vBernoulli5);
     // Message to 'vbool431' from ReplicateWithMarginal factor
     this.vbool431_B = ReplicateOp.DefAverageConditional<Bernoulli>(this.vbool431_uses_B, this.vbool431_B);
     // Message to 'vbool439' from ReplicateWithMarginal factor
     this.vbool439_B = ReplicateOp.DefAverageConditional<Bernoulli>(this.vbool439_uses_B, this.vbool439_B);
     this.vbool334_B = ArrayHelper.MakeUniform<Bernoulli>(new Bernoulli());
     // Message to 'vbool334' from ReplicateWithMarginal factor
     this.vbool334_B = ReplicateOp.DefAverageConditional<Bernoulli>(this.vbool334_uses_B, this.vbool334_B);
     // Create array for 'vbool76_uses' forwards messages.
     this.vbool76_uses_F = new Bernoulli[2];
     for(int _ind0 = 0; _ind0<2; _ind0++)
     {
         this.vbool76_uses_F[_ind0] = ArrayHelper.MakeUniform<Bernoulli>(this.vBernoulli84);
     }
     this.vBernoulli6 = new Bernoulli(0.9);
     // Message to 'vbool470_uses' from EqualRandom factor
     this.vbool470_uses_B[0] = ConstrainEqualRandomOp<bool>.ValueAverageConditional<Bernoulli>(this.vBernoulli6);
     // Message to 'vbool469_uses' from EqualRandom factor
     this.vbool469_uses_B[0] = ConstrainEqualRandomOp<bool>.ValueAverageConditional<Bernoulli>(this.vBernoulli6);
     // Message to 'vbool470' from ReplicateWithMarginal factor
     this.vbool470_B = ReplicateOp.DefAverageConditional<Bernoulli>(this.vbool470_uses_B, this.vbool470_B);
     this.vbool469_B = ArrayHelper.MakeUniform<Bernoulli>(new Bernoulli());
     // Message to 'vbool469' from ReplicateWithMarginal factor
     this.vbool469_B = ReplicateOp.DefAverageConditional<Bernoulli>(this.vbool469_uses_B, this.vbool469_B);
     // Create array for 'vbool97_uses' forwards messages.
     this.vbool97_uses_F = new Bernoulli[2];
     for(int _ind0 = 0; _ind0<2; _ind0++)
     {
         this.vbool97_uses_F[_ind0] = ArrayHelper.MakeUniform<Bernoulli>(this.vBernoulli105);
     }
     this.vbool318_B = ArrayHelper.MakeUniform<Bernoulli>(new Bernoulli());
     // Message to 'vbool318' from ReplicateWithMarginal factor
     this.vbool318_B = ReplicateOp.DefAverageConditional<Bernoulli>(this.vbool318_uses_B, this.vbool318_B);
     // Create array for 'vbool58_uses' forwards messages.
     this.vbool58_uses_F = new Bernoulli[3];
     for(int _ind0 = 0; _ind0<3; _ind0++)
     {
         this.vbool58_uses_F[_ind0] = ArrayHelper.MakeUniform<Bernoulli>(this.vBernoulli66);
     }
     this.vbool342_B = ArrayHelper.MakeUniform<Bernoulli>(new Bernoulli());
     // Message to 'vbool342' from ReplicateWithMarginal factor
     this.vbool342_B = ReplicateOp.DefAverageConditional<Bernoulli>(this.vbool342_uses_B, this.vbool342_B);
     // Create array for 'vbool120_uses' forwards messages.
     this.vbool120_uses_F = new Bernoulli[2];
     for(int _ind0 = 0; _ind0<2; _ind0++)
     {
         this.vbool120_uses_F[_ind0] = ArrayHelper.MakeUniform<Bernoulli>(this.vBernoulli128);
     }
     this.vbool310_B = ArrayHelper.MakeUniform<Bernoulli>(new Bernoulli());
     // Message to 'vbool310' from ReplicateWithMarginal factor
     this.vbool310_B = ReplicateOp.DefAverageConditional<Bernoulli>(this.vbool310_uses_B, this.vbool310_B);
     // Create array for 'vbool50_uses' forwards messages.
     this.vbool50_uses_F = new Bernoulli[2];
     for(int _ind0 = 0; _ind0<2; _ind0++)
     {
         this.vbool50_uses_F[_ind0] = ArrayHelper.MakeUniform<Bernoulli>(this.vBernoulli58);
     }
     this.vbool326_B = ArrayHelper.MakeUniform<Bernoulli>(new Bernoulli());
     // Message to 'vbool326' from ReplicateWithMarginal factor
     this.vbool326_B = ReplicateOp.DefAverageConditional<Bernoulli>(this.vbool326_uses_B, this.vbool326_B);
     // Create array for 'vbool128_uses' forwards messages.
     this.vbool128_uses_F = new Bernoulli[2];
     for(int _ind0 = 0; _ind0<2; _ind0++)
     {
         this.vbool128_uses_F[_ind0] = ArrayHelper.MakeUniform<Bernoulli>(this.vBernoulli136);
     }
     this.vbool350_B = ArrayHelper.MakeUniform<Bernoulli>(new Bernoulli());
     // Message to 'vbool350' from ReplicateWithMarginal factor
     this.vbool350_B = ReplicateOp.DefAverageConditional<Bernoulli>(this.vbool350_uses_B, this.vbool350_B);
     // Create array for 'vbool136_uses' forwards messages.
     this.vbool136_uses_F = new Bernoulli[3];
     for(int _ind0 = 0; _ind0<3; _ind0++)
     {
         this.vbool136_uses_F[_ind0] = ArrayHelper.MakeUniform<Bernoulli>(this.vBernoulli144);
     }
     this.vbool294_B = ArrayHelper.MakeUniform<Bernoulli>(new Bernoulli());
     // Message to 'vbool294' from ReplicateWithMarginal factor
     this.vbool294_B = ReplicateOp.DefAverageConditional<Bernoulli>(this.vbool294_uses_B, this.vbool294_B);
     // Create array for 'vbool6_uses' forwards messages.
     this.vbool6_uses_F = new Bernoulli[1];
     for(int _ind0 = 0; _ind0<1; _ind0++)
     {
         this.vbool6_uses_F[_ind0] = ArrayHelper.MakeUniform<Bernoulli>(this.vBernoulli14);
     }
     // Message to 'vbool6_uses' from UsesEqualDef factor
     this.vbool6_uses_F[0] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool6_uses_B, this.vbool6_F, 0, this.vbool6_uses_F[0]);
     // Message to 'vbool50_uses' from AreEqual factor
     this.vbool50_uses_B[1] = BooleanAreEqualOp.BAverageConditional(this.vbool294_B, this.vbool6_uses_F[0]);
     // Message to 'vbool50_uses' from UsesEqualDef factor
     this.vbool50_uses_F[0] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool50_uses_B, this.vbool50_F, 0, this.vbool50_uses_F[0]);
     // Message to 'vbool58_uses' from AreEqual factor
     this.vbool58_uses_B[1] = BooleanAreEqualOp.AAverageConditional(this.vbool310_B, this.vbool50_uses_F[0]);
     this.vbool358_B = ArrayHelper.MakeUniform<Bernoulli>(new Bernoulli());
     // Message to 'vbool358' from ReplicateWithMarginal factor
     this.vbool358_B = ReplicateOp.DefAverageConditional<Bernoulli>(this.vbool358_uses_B, this.vbool358_B);
     this.vbool366_B = ArrayHelper.MakeUniform<Bernoulli>(new Bernoulli());
     // Message to 'vbool366' from ReplicateWithMarginal factor
     this.vbool366_B = ReplicateOp.DefAverageConditional<Bernoulli>(this.vbool366_uses_B, this.vbool366_B);
     // Create array for 'vbool24_uses' forwards messages.
     this.vbool24_uses_F = new Bernoulli[2];
     for(int _ind0 = 0; _ind0<2; _ind0++)
     {
         this.vbool24_uses_F[_ind0] = ArrayHelper.MakeUniform<Bernoulli>(this.vBernoulli32);
     }
     this.vbool302_B = ArrayHelper.MakeUniform<Bernoulli>(new Bernoulli());
     // Message to 'vbool302' from ReplicateWithMarginal factor
     this.vbool302_B = ReplicateOp.DefAverageConditional<Bernoulli>(this.vbool302_uses_B, this.vbool302_B);
     // Create array for 'vbool32_uses' forwards messages.
     this.vbool32_uses_F = new Bernoulli[1];
     for(int _ind0 = 0; _ind0<1; _ind0++)
     {
         this.vbool32_uses_F[_ind0] = ArrayHelper.MakeUniform<Bernoulli>(this.vBernoulli40);
     }
     // Message to 'vbool32_uses' from UsesEqualDef factor
     this.vbool32_uses_F[0] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool32_uses_B, this.vbool32_F, 0, this.vbool32_uses_F[0]);
     // Message to 'vbool24_uses' from AreEqual factor
     this.vbool24_uses_B[1] = BooleanAreEqualOp.BAverageConditional(this.vbool302_B, this.vbool32_uses_F[0]);
     // Message to 'vbool24_uses' from UsesEqualDef factor
     this.vbool24_uses_F[0] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool24_uses_B, this.vbool24_F, 0, this.vbool24_uses_F[0]);
     // Message to 'vbool136_uses' from AreEqual factor
     this.vbool136_uses_B[2] = BooleanAreEqualOp.AAverageConditional(this.vbool366_B, this.vbool24_uses_F[0]);
 }
Ejemplo n.º 32
0
        //- VMP ---------------------------------------------------------------------------

        /// <summary>VMP message to <c>not</c>.</summary>
        /// <param name="b">Incoming message from <c>b</c>. Must be a proper distribution. If uniform, the result will be uniform.</param>
        /// <returns>The outgoing VMP message to the <c>not</c> argument.</returns>
        /// <remarks>
        ///   <para>The outgoing message is a distribution matching the moments of <c>not</c> as the random arguments are varied. The formula is <c>proj[sum_(b) p(b) factor(not,b)]</c>.</para>
        /// </remarks>
        /// <exception cref="ImproperMessageException">
        ///   <paramref name="b" /> is not a proper distribution.</exception>
        public static Bernoulli NotAverageLogarithm([SkipIfUniform] Bernoulli b)
        {
            return(NotAverageConditional(b));
        }
Ejemplo n.º 33
0
 /// <summary>EP message to <c>and</c>.</summary>
 /// <param name="A">Incoming message from <c>a</c>.</param>
 /// <param name="B">Constant value for <c>b</c>.</param>
 /// <returns>The outgoing EP message to the <c>and</c> argument.</returns>
 /// <remarks>
 ///   <para>The outgoing message is a distribution matching the moments of <c>and</c> as the random arguments are varied. The formula is <c>proj[p(and) sum_(a) p(a) factor(and,a,b)]/p(and)</c>.</para>
 /// </remarks>
 public static Bernoulli AndAverageConditional(Bernoulli A, bool B)
 {
     return(AndAverageConditional(B, A));
 }
Ejemplo n.º 34
0
 /// <summary>
 /// Performs one iteration of inference.
 /// </summary>
 /// <remarks>
 /// This method should be called multiple times, after calling Initialise(), in order to perform
 /// multiple iterations of message passing.  You can call methods to retrieve posterior marginals
 /// at any time - the returned marginal will be the estimated marginal given the current state of
 /// the message passing algorithm.  This can be useful for monitoring convergence of the algorithm.
 /// 
 /// Where the scheduler has determined inference can be performed without iteration, this method
 /// does nothing.
 /// </remarks>
 public void Update()
 {
     // Message to 'vbool111_uses' from And factor
     this.vbool111_uses_B[2] = BooleanAndOp.AAverageConditional(this.vbool287_B, this.vbool116_uses_F[0]);
     // Message to 'vbool111_uses' from UsesEqualDef factor
     this.vbool111_uses_F[0] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool111_uses_B, this.vbool111_F, 0, this.vbool111_uses_F[0]);
     // Message to 'vbool103_uses' from AreEqual factor
     this.vbool103_uses_B[1] = BooleanAreEqualOp.BAverageConditional(this.vbool194_B, this.vbool111_uses_F[0]);
     // Message to 'vbool103_uses' from UsesEqualDef factor
     this.vbool103_uses_F[0] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool103_uses_B, this.vbool103_F, 0, this.vbool103_uses_F[0]);
     // Message to 'vbool181_uses' from AreEqual factor
     this.vbool181_uses_B[2] = BooleanAreEqualOp.BAverageConditional(this.vbool446_B, this.vbool103_uses_F[0]);
     // Message to 'vbool181_uses' from UsesEqualDef factor
     this.vbool181_uses_F[0] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool181_uses_B, this.vbool181_F, 0, this.vbool181_uses_F[0]);
     // Message to 'vbool163_uses' from AreEqual factor
     this.vbool163_uses_B[0] = BooleanAreEqualOp.BAverageConditional(this.vbool420_B, this.vbool181_uses_F[0]);
     // Message to 'vbool163_uses' from UsesEqualDef factor
     this.vbool163_uses_F[1] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool163_uses_B, this.vbool163_F, 1, this.vbool163_uses_F[1]);
     // Message to 'vbool155_uses' from AreEqual factor
     this.vbool155_uses_B[1] = BooleanAreEqualOp.BAverageConditional(this.vbool419_B, this.vbool163_uses_F[1]);
     // Message to 'vbool155_uses' from UsesEqualDef factor
     this.vbool155_uses_F[0] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool155_uses_B, this.vbool155_F, 0, this.vbool155_uses_F[0]);
     // Message to 'vbool181_uses' from AreEqual factor
     this.vbool181_uses_B[1] = BooleanAreEqualOp.AAverageConditional(this.vbool441_B, this.vbool155_uses_F[0]);
     // Message to 'vbool181_uses' from UsesEqualDef factor
     this.vbool181_uses_F[1] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool181_uses_B, this.vbool181_F, 1, this.vbool181_uses_F[1]);
     // Message to 'vbool155_uses' from AreEqual factor
     this.vbool155_uses_B[0] = BooleanAreEqualOp.BAverageConditional(this.vbool441_B, this.vbool181_uses_F[1]);
     // Message to 'vbool441' from AreEqual factor
     this.vbool441_F = BooleanAreEqualOp.AreEqualAverageConditional(this.vbool181_uses_F[1], this.vbool155_uses_F[0]);
     // Message to 'vbool441_marginal' from ReplicateWithMarginal factor
     this.vbool441_marginal_B = ReplicateOp.MarginalAverageConditional<Bernoulli>(this.vbool441_uses_B, this.vbool441_F, this.vbool441_marginal_B);
     // Message to 'vbool155_uses' from UsesEqualDef factor
     this.vbool155_uses_F[2] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool155_uses_B, this.vbool155_F, 2, this.vbool155_uses_F[2]);
     // Message to 'vbool90_uses' from AreEqual factor
     this.vbool90_uses_B[0] = BooleanAreEqualOp.AAverageConditional(this.vbool451_B, this.vbool155_uses_F[2]);
     // Message to 'vbool90_uses' from UsesEqualDef factor
     this.vbool90_uses_F[1] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool90_uses_B, this.vbool90_F, 1, this.vbool90_uses_F[1]);
     // Message to 'vbool72_uses' from AreEqual factor
     this.vbool72_uses_B[0] = BooleanAreEqualOp.BAverageConditional(this.vbool210_B, this.vbool90_uses_F[1]);
     // Message to 'vbool72_uses' from UsesEqualDef factor
     this.vbool72_uses_F[1] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool72_uses_B, this.vbool72_F, 1, this.vbool72_uses_F[1]);
     // Message to 'vbool155_uses' from UsesEqualDef factor
     this.vbool155_uses_F[1] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool155_uses_B, this.vbool155_F, 1, this.vbool155_uses_F[1]);
     // Message to 'vbool163_uses' from AreEqual factor
     this.vbool163_uses_B[1] = BooleanAreEqualOp.AAverageConditional(this.vbool419_B, this.vbool155_uses_F[1]);
     // Message to 'vbool163_marginal' from UsesEqualDef factor
     this.vbool163_marginal_B = UsesEqualDefOp.MarginalAverageConditional<Bernoulli>(this.vbool163_uses_B, this.vbool163_F, this.vbool163_marginal_B);
     // Message to 'vbool419' from AreEqual factor
     this.vbool419_F = BooleanAreEqualOp.AreEqualAverageConditional(this.vbool163_uses_F[1], this.vbool155_uses_F[1]);
     // Message to 'vbool419_marginal' from ReplicateWithMarginal factor
     this.vbool419_marginal_B = ReplicateOp.MarginalAverageConditional<Bernoulli>(this.vbool419_uses_B, this.vbool419_F, this.vbool419_marginal_B);
     // Message to 'vbool163_uses' from UsesEqualDef factor
     this.vbool163_uses_F[0] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool163_uses_B, this.vbool163_F, 0, this.vbool163_uses_F[0]);
     // Message to 'vbool181_uses' from AreEqual factor
     this.vbool181_uses_B[0] = BooleanAreEqualOp.AAverageConditional(this.vbool420_B, this.vbool163_uses_F[0]);
     // Message to 'vbool181_marginal' from UsesEqualDef factor
     this.vbool181_marginal_B = UsesEqualDefOp.MarginalAverageConditional<Bernoulli>(this.vbool181_uses_B, this.vbool181_F, this.vbool181_marginal_B);
     // Message to 'vbool420' from AreEqual factor
     this.vbool420_F = BooleanAreEqualOp.AreEqualAverageConditional(this.vbool181_uses_F[0], this.vbool163_uses_F[0]);
     // Message to 'vbool420_marginal' from ReplicateWithMarginal factor
     this.vbool420_marginal_B = ReplicateOp.MarginalAverageConditional<Bernoulli>(this.vbool420_uses_B, this.vbool420_F, this.vbool420_marginal_B);
     // Message to 'vbool181_uses' from UsesEqualDef factor
     this.vbool181_uses_F[2] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool181_uses_B, this.vbool181_F, 2, this.vbool181_uses_F[2]);
     // Message to 'vbool103_uses' from AreEqual factor
     this.vbool103_uses_B[0] = BooleanAreEqualOp.AAverageConditional(this.vbool446_B, this.vbool181_uses_F[2]);
     // Message to 'vbool103_marginal' from UsesEqualDef factor
     this.vbool103_marginal_B = UsesEqualDefOp.MarginalAverageConditional<Bernoulli>(this.vbool103_uses_B, this.vbool103_F, this.vbool103_marginal_B);
     // Message to 'vbool446' from AreEqual factor
     this.vbool446_F = BooleanAreEqualOp.AreEqualAverageConditional(this.vbool103_uses_F[0], this.vbool181_uses_F[2]);
     // Message to 'vbool446_marginal' from ReplicateWithMarginal factor
     this.vbool446_marginal_B = ReplicateOp.MarginalAverageConditional<Bernoulli>(this.vbool446_uses_B, this.vbool446_F, this.vbool446_marginal_B);
     // Message to 'vbool103_uses' from UsesEqualDef factor
     this.vbool103_uses_F[1] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool103_uses_B, this.vbool103_F, 1, this.vbool103_uses_F[1]);
     // Message to 'vbool111_uses' from AreEqual factor
     this.vbool111_uses_B[0] = BooleanAreEqualOp.AAverageConditional(this.vbool194_B, this.vbool103_uses_F[1]);
     // Message to 'vbool194' from AreEqual factor
     this.vbool194_F = BooleanAreEqualOp.AreEqualAverageConditional(this.vbool111_uses_F[0], this.vbool103_uses_F[1]);
     // Message to 'vbool194_marginal' from ReplicateWithMarginal factor
     this.vbool194_marginal_B = ReplicateOp.MarginalAverageConditional<Bernoulli>(this.vbool194_uses_B, this.vbool194_F, this.vbool194_marginal_B);
     // Message to 'vbool111_uses' from UsesEqualDef factor
     this.vbool111_uses_F[1] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool111_uses_B, this.vbool111_F, 1, this.vbool111_uses_F[1]);
     // Message to 'vbool111_uses' from UsesEqualDef factor
     this.vbool111_uses_F[2] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool111_uses_B, this.vbool111_F, 2, this.vbool111_uses_F[2]);
     // Message to 'vbool116_uses' from And factor
     this.vbool116_uses_B[0] = BooleanAndOp.BAverageConditional(this.vbool287_B, this.vbool111_uses_F[2]);
     // Message to 'vbool116_uses' from UsesEqualDef factor
     this.vbool116_uses_F[1] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool116_uses_B, this.vbool116_F, 1, this.vbool116_uses_F[1]);
     // Message to 'vbool116_uses' from UsesEqualDef factor
     this.vbool116_uses_F[2] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool116_uses_B, this.vbool116_F, 2, this.vbool116_uses_F[2]);
     // Message to 'vbool155_marginal' from UsesEqualDef factor
     this.vbool155_marginal_B = UsesEqualDefOp.MarginalAverageConditional<Bernoulli>(this.vbool155_uses_B, this.vbool155_F, this.vbool155_marginal_B);
     // Message to 'vbool111_marginal' from UsesEqualDef factor
     this.vbool111_marginal_B = UsesEqualDefOp.MarginalAverageConditional<Bernoulli>(this.vbool111_uses_B, this.vbool111_F, this.vbool111_marginal_B);
     // Message to 'vbool215' from And factor
     this.vbool215_F = BooleanAndOp.AndAverageConditional(this.vbool145_uses_F[0], this.vbool111_uses_F[1]);
     // Message to 'vbool215_uses' from ReplicateWithMarginal factor
     this.vbool215_uses_F[0] = ReplicateOp.UsesAverageConditional<Bernoulli>(this.vbool215_uses_B, this.vbool215_F, 0, this.vbool215_uses_F[0]);
     // Message to 'vbool287' from And factor
     this.vbool287_F = BooleanAndOp.AndAverageConditional(this.vbool111_uses_F[2], this.vbool116_uses_F[0]);
     // Message to 'vbool287_marginal' from ReplicateWithMarginal factor
     this.vbool287_marginal_B = ReplicateOp.MarginalAverageConditional<Bernoulli>(this.vbool287_uses_B, this.vbool287_F, this.vbool287_marginal_B);
     // Message to 'vbool216' from And factor
     this.vbool216_F = BooleanAndOp.AndAverageConditional(this.vbool145_uses_F[2], this.vbool116_uses_F[1]);
     // Message to 'vbool216_uses' from ReplicateWithMarginal factor
     this.vbool216_uses_F[0] = ReplicateOp.UsesAverageConditional<Bernoulli>(this.vbool216_uses_B, this.vbool216_F, 0, this.vbool216_uses_F[0]);
     // Message to 'vbool217' from Or factor
     this.vbool217_F = BooleanOrOp.OrAverageConditional(this.vbool216_uses_F[0], this.vbool215_uses_F[0]);
     // Message to 'vbool217_uses' from ReplicateWithMarginal factor
     this.vbool217_uses_F[0] = ReplicateOp.UsesAverageConditional<Bernoulli>(this.vbool217_uses_B, this.vbool217_F, 0, this.vbool217_uses_F[0]);
     // Message to 'vbool408_uses' from Or factor
     this.vbool408_uses_B[0] = BooleanOrOp.BAverageConditional(this.vbool409_B, this.vbool403_uses_F[0]);
     // Message to 'vbool408' from ReplicateWithMarginal factor
     this.vbool408_B = ReplicateOp.DefAverageConditional<Bernoulli>(this.vbool408_uses_B, this.vbool408_B);
     // Message to 'vbool407_uses' from Or factor
     this.vbool407_uses_B[0] = BooleanOrOp.BAverageConditional(this.vbool408_B, this.vbool406_uses_F[0]);
     // Message to 'vbool407' from ReplicateWithMarginal factor
     this.vbool407_B = ReplicateOp.DefAverageConditional<Bernoulli>(this.vbool407_uses_B, this.vbool407_B);
     // Message to 'vbool67_uses' from AreEqual factor
     this.vbool67_uses_B[0] = BooleanAreEqualOp.AAverageConditional(this.vbool407_B, this.vbool72_uses_F[1]);
     // Message to 'vbool406_uses' from Or factor
     this.vbool406_uses_B[0] = BooleanOrOp.AAverageConditional(this.vbool408_B, this.vbool407_uses_F[0]);
     // Message to 'vbool406' from ReplicateWithMarginal factor
     this.vbool406_B = ReplicateOp.DefAverageConditional<Bernoulli>(this.vbool406_uses_B, this.vbool406_B);
     // Message to 'vbool405_uses' from And factor
     this.vbool405_uses_B[0] = BooleanAndOp.BAverageConditional(this.vbool406_B, this.vbool404_uses_F[0]);
     // Message to 'vbool405' from ReplicateWithMarginal factor
     this.vbool405_B = ReplicateOp.DefAverageConditional<Bernoulli>(this.vbool405_uses_B, this.vbool405_B);
     // Message to 'vbool67_uses' from AreEqual factor
     this.vbool67_uses_B[2] = BooleanAreEqualOp.AAverageConditional(this.vbool405_B, this.vbool116_uses_F[2]);
     // Message to 'vbool67_uses' from UsesEqualDef factor
     this.vbool67_uses_F[1] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool67_uses_B, this.vbool67_F, 1, this.vbool67_uses_F[1]);
     // Message to 'vbool67_uses' from UsesEqualDef factor
     this.vbool67_uses_F[3] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool67_uses_B, this.vbool67_F, 3, this.vbool67_uses_F[3]);
     // Message to 'vbool46_uses' from AreEqual factor
     this.vbool46_uses_B[0] = BooleanAreEqualOp.BAverageConditional(this.vbool205_B, this.vbool67_uses_F[3]);
     // Message to 'vbool46_uses' from UsesEqualDef factor
     this.vbool46_uses_F[1] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool46_uses_B, this.vbool46_F, 1, this.vbool46_uses_F[1]);
     // Message to 'vbool15_uses' from AreEqual factor
     this.vbool15_uses_B[0] = BooleanAreEqualOp.BAverageConditional(this.vbool189_B, this.vbool46_uses_F[1]);
     // Message to 'vbool15_uses' from UsesEqualDef factor
     this.vbool15_uses_F[1] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool15_uses_B, this.vbool15_F, 1, this.vbool15_uses_F[1]);
     // Message to 'vbool41_uses' from AreEqual factor
     this.vbool41_uses_B[1] = BooleanAreEqualOp.AAverageConditional(this.vbool410_B, this.vbool15_uses_F[1]);
     // Message to 'vbool41_uses' from UsesEqualDef factor
     this.vbool41_uses_F[0] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool41_uses_B, this.vbool41_F, 0, this.vbool41_uses_F[0]);
     // Message to 'vbool20_uses' from AreEqual factor
     this.vbool20_uses_B[1] = BooleanAreEqualOp.BAverageConditional(this.vbool200_B, this.vbool41_uses_F[0]);
     // Message to 'vbool20_uses' from UsesEqualDef factor
     this.vbool20_uses_F[0] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool20_uses_B, this.vbool20_F, 0, this.vbool20_uses_F[0]);
     // Message to 'vbool145_uses' from AreEqual factor
     this.vbool145_uses_B[1] = BooleanAreEqualOp.BAverageConditional(this.vbool199_B, this.vbool20_uses_F[0]);
     // Message to 'vbool404_uses' from And factor
     this.vbool404_uses_B[0] = BooleanAndOp.AAverageConditional(this.vbool406_B, this.vbool405_uses_F[0]);
     // Message to 'vbool404' from ReplicateWithMarginal factor
     this.vbool404_B = ReplicateOp.DefAverageConditional<Bernoulli>(this.vbool404_uses_B, this.vbool404_B);
     // Message to 'vbool2_uses' from Not factor
     this.vbool2_uses_B[0] = BooleanNotOp.BAverageConditional(this.vbool404_B);
     // Message to 'vbool403_uses' from Or factor
     this.vbool403_uses_B[0] = BooleanOrOp.AAverageConditional(this.vbool409_B, this.vbool408_uses_F[0]);
     // Message to 'vbool403' from ReplicateWithMarginal factor
     this.vbool403_B = ReplicateOp.DefAverageConditional<Bernoulli>(this.vbool403_uses_B, this.vbool403_B);
     // Message to 'vbool402_uses' from And factor
     this.vbool402_uses_B[0] = BooleanAndOp.BAverageConditional(this.vbool403_B, this.vbool2_uses_F[1]);
     // Message to 'vbool402' from ReplicateWithMarginal factor
     this.vbool402_B = ReplicateOp.DefAverageConditional<Bernoulli>(this.vbool402_uses_B, this.vbool402_B);
     // Message to 'vbool145_uses' from AreEqual factor
     this.vbool145_uses_B[11] = BooleanAreEqualOp.BAverageConditional(this.vbool402_B, this.vbool67_uses_F[1]);
     // Message to 'vbool2_uses' from And factor
     this.vbool2_uses_B[1] = BooleanAndOp.AAverageConditional(this.vbool403_B, this.vbool402_uses_F[0]);
     // Message to 'vbool220' from Or factor
     this.vbool220_F = BooleanOrOp.OrAverageConditional(this.vbool219_uses_F[0], this.vbool217_uses_F[0]);
     // Message to 'vbool220_uses' from ReplicateWithMarginal factor
     this.vbool220_uses_F[0] = ReplicateOp.UsesAverageConditional<Bernoulli>(this.vbool220_uses_B, this.vbool220_F, 0, this.vbool220_uses_F[0]);
     // Message to 'vbool371_uses' from Or factor
     this.vbool371_uses_B[0] = BooleanOrOp.AAverageConditional(this.vbool377_B, this.vbool376_uses_F[0]);
     // Message to 'vbool371' from ReplicateWithMarginal factor
     this.vbool371_B = ReplicateOp.DefAverageConditional<Bernoulli>(this.vbool371_uses_B, this.vbool371_B);
     // Message to 'vbool2_uses' from And factor
     this.vbool2_uses_B[3] = BooleanAndOp.AAverageConditional(this.vbool371_B, this.vbool370_uses_F[0]);
     // Message to 'vbool370_uses' from And factor
     this.vbool370_uses_B[0] = BooleanAndOp.BAverageConditional(this.vbool371_B, this.vbool2_uses_F[3]);
     // Message to 'vbool370' from ReplicateWithMarginal factor
     this.vbool370_B = ReplicateOp.DefAverageConditional<Bernoulli>(this.vbool370_uses_B, this.vbool370_B);
     // Message to 'vbool379_uses' from Or factor
     this.vbool379_uses_B[0] = BooleanOrOp.AAverageConditional(this.vbool385_B, this.vbool384_uses_F[0]);
     // Message to 'vbool379' from ReplicateWithMarginal factor
     this.vbool379_B = ReplicateOp.DefAverageConditional<Bernoulli>(this.vbool379_uses_B, this.vbool379_B);
     // Message to 'vbool2_uses' from And factor
     this.vbool2_uses_B[5] = BooleanAndOp.AAverageConditional(this.vbool379_B, this.vbool378_uses_F[0]);
     // Message to 'vbool378_uses' from And factor
     this.vbool378_uses_B[0] = BooleanAndOp.BAverageConditional(this.vbool379_B, this.vbool2_uses_F[5]);
     // Message to 'vbool378' from ReplicateWithMarginal factor
     this.vbool378_B = ReplicateOp.DefAverageConditional<Bernoulli>(this.vbool378_uses_B, this.vbool378_B);
     // Message to 'vbool387_uses' from Or factor
     this.vbool387_uses_B[0] = BooleanOrOp.AAverageConditional(this.vbool393_B, this.vbool392_uses_F[0]);
     // Message to 'vbool387' from ReplicateWithMarginal factor
     this.vbool387_B = ReplicateOp.DefAverageConditional<Bernoulli>(this.vbool387_uses_B, this.vbool387_B);
     // Message to 'vbool2_uses' from And factor
     this.vbool2_uses_B[7] = BooleanAndOp.AAverageConditional(this.vbool387_B, this.vbool386_uses_F[0]);
     // Message to 'vbool386_uses' from And factor
     this.vbool386_uses_B[0] = BooleanAndOp.BAverageConditional(this.vbool387_B, this.vbool2_uses_F[7]);
     // Message to 'vbool386' from ReplicateWithMarginal factor
     this.vbool386_B = ReplicateOp.DefAverageConditional<Bernoulli>(this.vbool386_uses_B, this.vbool386_B);
     // Message to 'vbool395_uses' from Or factor
     this.vbool395_uses_B[0] = BooleanOrOp.AAverageConditional(this.vbool401_B, this.vbool400_uses_F[0]);
     // Message to 'vbool395' from ReplicateWithMarginal factor
     this.vbool395_B = ReplicateOp.DefAverageConditional<Bernoulli>(this.vbool395_uses_B, this.vbool395_B);
     // Message to 'vbool2_uses' from And factor
     this.vbool2_uses_B[9] = BooleanAndOp.AAverageConditional(this.vbool395_B, this.vbool394_uses_F[0]);
     // Message to 'vbool394_uses' from And factor
     this.vbool394_uses_B[0] = BooleanAndOp.BAverageConditional(this.vbool395_B, this.vbool2_uses_F[9]);
     // Message to 'vbool394' from ReplicateWithMarginal factor
     this.vbool394_B = ReplicateOp.DefAverageConditional<Bernoulli>(this.vbool394_uses_B, this.vbool394_B);
     // Message to 'vbool285_uses' from Or factor
     this.vbool285_uses_B[0] = BooleanOrOp.AAverageConditional(this.vbool286_B, this.vbool283_uses_F[0]);
     // Message to 'vbool285' from ReplicateWithMarginal factor
     this.vbool285_B = ReplicateOp.DefAverageConditional<Bernoulli>(this.vbool285_uses_B, this.vbool285_B);
     // Message to 'vbool115_uses' from And factor
     this.vbool115_uses_B[9] = BooleanAndOp.BAverageConditional(this.vbool285_B, this.vbool284_uses_F[0]);
     // Message to 'vbool284_uses' from And factor
     this.vbool284_uses_B[0] = BooleanAndOp.AAverageConditional(this.vbool285_B, this.vbool115_uses_F[9]);
     // Message to 'vbool284' from ReplicateWithMarginal factor
     this.vbool284_B = ReplicateOp.DefAverageConditional<Bernoulli>(this.vbool284_uses_B, this.vbool284_B);
     // Message to 'vbool110_uses' from And factor
     this.vbool110_uses_B[8] = BooleanAndOp.BAverageConditional(this.vbool284_B, this.vbool144_uses_F[0]);
     // Message to 'vbool144_uses' from And factor
     this.vbool144_uses_B[0] = BooleanAndOp.AAverageConditional(this.vbool284_B, this.vbool110_uses_F[8]);
     // Message to 'vbool144_uses' from UsesEqualDef factor
     this.vbool144_uses_F[1] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool144_uses_B, this.vbool144_F, 1, this.vbool144_uses_F[1]);
     // Message to 'vbool66_uses' from AreEqual factor
     this.vbool66_uses_B[0] = BooleanAreEqualOp.AAverageConditional(this.vbool394_B, this.vbool144_uses_F[1]);
     // Message to 'vbool144_uses' from UsesEqualDef factor
     this.vbool144_uses_F[2] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool144_uses_B, this.vbool144_F, 2, this.vbool144_uses_F[2]);
     // Message to 'vbool19_uses' from AreEqual factor
     this.vbool19_uses_B[0] = BooleanAreEqualOp.AAverageConditional(this.vbool198_B, this.vbool144_uses_F[2]);
     // Message to 'vbool19_uses' from UsesEqualDef factor
     this.vbool19_uses_F[1] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool19_uses_B, this.vbool19_F, 1, this.vbool19_uses_F[1]);
     // Message to 'vbool40_uses' from AreEqual factor
     this.vbool40_uses_B[0] = BooleanAreEqualOp.AAverageConditional(this.vbool204_B, this.vbool19_uses_F[1]);
     // Message to 'vbool40_uses' from UsesEqualDef factor
     this.vbool40_uses_F[1] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool40_uses_B, this.vbool40_F, 1, this.vbool40_uses_F[1]);
     // Message to 'vbool14_uses' from AreEqual factor
     this.vbool14_uses_B[1] = BooleanAreEqualOp.BAverageConditional(this.vbool414_B, this.vbool40_uses_F[1]);
     // Message to 'vbool14_uses' from UsesEqualDef factor
     this.vbool14_uses_F[0] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool14_uses_B, this.vbool14_F, 0, this.vbool14_uses_F[0]);
     // Message to 'vbool45_uses' from AreEqual factor
     this.vbool45_uses_B[1] = BooleanAreEqualOp.AAverageConditional(this.vbool188_B, this.vbool14_uses_F[0]);
     // Message to 'vbool45_uses' from UsesEqualDef factor
     this.vbool45_uses_F[0] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool45_uses_B, this.vbool45_F, 0, this.vbool45_uses_F[0]);
     // Message to 'vbool66_uses' from AreEqual factor
     this.vbool66_uses_B[2] = BooleanAreEqualOp.AAverageConditional(this.vbool209_B, this.vbool45_uses_F[0]);
     // Message to 'vbool66_uses' from UsesEqualDef factor
     this.vbool66_uses_F[1] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool66_uses_B, this.vbool66_F, 1, this.vbool66_uses_F[1]);
     // Message to 'vbool66_uses' from UsesEqualDef factor
     this.vbool66_uses_F[3] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool66_uses_B, this.vbool66_F, 3, this.vbool66_uses_F[3]);
     // Message to 'vbool223' from Or factor
     this.vbool223_F = BooleanOrOp.OrAverageConditional(this.vbool222_uses_F[0], this.vbool220_uses_F[0]);
     // Message to 'vbool223_uses' from ReplicateWithMarginal factor
     this.vbool223_uses_F[0] = ReplicateOp.UsesAverageConditional<Bernoulli>(this.vbool223_uses_B, this.vbool223_F, 0, this.vbool223_uses_F[0]);
     // Message to 'vbool226' from Or factor
     this.vbool226_F = BooleanOrOp.OrAverageConditional(this.vbool225_uses_F[0], this.vbool223_uses_F[0]);
     // Message to 'vbool226_uses' from ReplicateWithMarginal factor
     this.vbool226_uses_F[0] = ReplicateOp.UsesAverageConditional<Bernoulli>(this.vbool226_uses_B, this.vbool226_F, 0, this.vbool226_uses_F[0]);
     // Message to 'vbool229' from Or factor
     this.vbool229_F = BooleanOrOp.OrAverageConditional(this.vbool228_uses_F[0], this.vbool226_uses_F[0]);
     // Message to 'vbool229_uses' from ReplicateWithMarginal factor
     this.vbool229_uses_F[0] = ReplicateOp.UsesAverageConditional<Bernoulli>(this.vbool229_uses_B, this.vbool229_F, 0, this.vbool229_uses_F[0]);
     // Message to 'vbool232' from Or factor
     this.vbool232_F = BooleanOrOp.OrAverageConditional(this.vbool231_uses_F[0], this.vbool229_uses_F[0]);
     // Message to 'vbool232_uses' from ReplicateWithMarginal factor
     this.vbool232_uses_F[0] = ReplicateOp.UsesAverageConditional<Bernoulli>(this.vbool232_uses_B, this.vbool232_F, 0, this.vbool232_uses_F[0]);
     // Message to 'vbool235' from Or factor
     this.vbool235_F = BooleanOrOp.OrAverageConditional(this.vbool234_uses_F[0], this.vbool232_uses_F[0]);
     // Message to 'vbool235_uses' from ReplicateWithMarginal factor
     this.vbool235_uses_F[0] = ReplicateOp.UsesAverageConditional<Bernoulli>(this.vbool235_uses_B, this.vbool235_F, 0, this.vbool235_uses_F[0]);
     // Message to 'vbool238' from Or factor
     this.vbool238_F = BooleanOrOp.OrAverageConditional(this.vbool237_uses_F[0], this.vbool235_uses_F[0]);
     // Message to 'vbool238_uses' from ReplicateWithMarginal factor
     this.vbool238_uses_F[0] = ReplicateOp.UsesAverageConditional<Bernoulli>(this.vbool238_uses_B, this.vbool238_F, 0, this.vbool238_uses_F[0]);
     // Message to 'vbool241' from Or factor
     this.vbool241_F = BooleanOrOp.OrAverageConditional(this.vbool240_uses_F[0], this.vbool238_uses_F[0]);
     // Message to 'vbool241_uses' from ReplicateWithMarginal factor
     this.vbool241_uses_F[0] = ReplicateOp.UsesAverageConditional<Bernoulli>(this.vbool241_uses_B, this.vbool241_F, 0, this.vbool241_uses_F[0]);
     // Message to 'vbool0_uses' from Or factor
     this.vbool0_uses_B[0] = BooleanOrOp.BAverageConditional(this.vbool369_B, this.vbool368_uses_F[0]);
     // Message to 'vbool0_marginal' from UsesEqualDef factor
     this.vbool0_marginal_B = UsesEqualDefOp.MarginalAverageConditional<Bernoulli>(this.vbool0_uses_B, this.vbool0_F, this.vbool0_marginal_B);
     // Message to 'vbool369' from Or factor
     this.vbool369_F = BooleanOrOp.OrAverageConditional(this.vbool368_uses_F[0], this.vbool0_uses_F[0]);
     // Message to 'vbool369_marginal' from ReplicateWithMarginal factor
     this.vbool369_marginal_B = ReplicateOp.MarginalAverageConditional<Bernoulli>(this.vbool369_uses_B, this.vbool369_F, this.vbool369_marginal_B);
     // Message to 'vbool376_uses' from Or factor
     this.vbool376_uses_B[0] = BooleanOrOp.BAverageConditional(this.vbool377_B, this.vbool371_uses_F[0]);
     // Message to 'vbool376' from ReplicateWithMarginal factor
     this.vbool376_B = ReplicateOp.DefAverageConditional<Bernoulli>(this.vbool376_uses_B, this.vbool376_B);
     // Message to 'vbool375_uses' from Or factor
     this.vbool375_uses_B[0] = BooleanOrOp.BAverageConditional(this.vbool376_B, this.vbool374_uses_F[0]);
     // Message to 'vbool375' from ReplicateWithMarginal factor
     this.vbool375_B = ReplicateOp.DefAverageConditional<Bernoulli>(this.vbool375_uses_B, this.vbool375_B);
     // Message to 'vbool374_uses' from Or factor
     this.vbool374_uses_B[0] = BooleanOrOp.AAverageConditional(this.vbool376_B, this.vbool375_uses_F[0]);
     // Message to 'vbool374' from ReplicateWithMarginal factor
     this.vbool374_B = ReplicateOp.DefAverageConditional<Bernoulli>(this.vbool374_uses_B, this.vbool374_B);
     // Message to 'vbool372_uses' from And factor
     this.vbool372_uses_B[0] = BooleanAndOp.AAverageConditional(this.vbool374_B, this.vbool373_uses_F[0]);
     // Message to 'vbool372' from ReplicateWithMarginal factor
     this.vbool372_B = ReplicateOp.DefAverageConditional<Bernoulli>(this.vbool372_uses_B, this.vbool372_B);
     // Message to 'vbool2_uses' from Not factor
     this.vbool2_uses_B[4] = BooleanNotOp.BAverageConditional(this.vbool372_B);
     // Message to 'vbool2_uses' from UsesEqualDef factor
     this.vbool2_uses_F[6] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool2_uses_B, this.vbool2_F, 6, this.vbool2_uses_F[6]);
     // Message to 'vbool380' from Not factor
     this.vbool380_F = BooleanNotOp.NotAverageConditional(this.vbool2_uses_F[6]);
     // Message to 'vbool380_uses' from ReplicateWithMarginal factor
     this.vbool380_uses_F[0] = ReplicateOp.UsesAverageConditional<Bernoulli>(this.vbool380_uses_B, this.vbool380_F, 0, this.vbool380_uses_F[0]);
     // Message to 'vbool2_uses' from UsesEqualDef factor
     this.vbool2_uses_F[8] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool2_uses_B, this.vbool2_F, 8, this.vbool2_uses_F[8]);
     // Message to 'vbool388' from Not factor
     this.vbool388_F = BooleanNotOp.NotAverageConditional(this.vbool2_uses_F[8]);
     // Message to 'vbool388_uses' from ReplicateWithMarginal factor
     this.vbool388_uses_F[0] = ReplicateOp.UsesAverageConditional<Bernoulli>(this.vbool388_uses_B, this.vbool388_F, 0, this.vbool388_uses_F[0]);
     // Message to 'vbool2_uses' from UsesEqualDef factor
     this.vbool2_uses_F[10] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool2_uses_B, this.vbool2_F, 10, this.vbool2_uses_F[10]);
     // Message to 'vbool396' from Not factor
     this.vbool396_F = BooleanNotOp.NotAverageConditional(this.vbool2_uses_F[10]);
     // Message to 'vbool396_uses' from ReplicateWithMarginal factor
     this.vbool396_uses_F[0] = ReplicateOp.UsesAverageConditional<Bernoulli>(this.vbool396_uses_B, this.vbool396_F, 0, this.vbool396_uses_F[0]);
     // Message to 'vbool373_uses' from And factor
     this.vbool373_uses_B[0] = BooleanAndOp.BAverageConditional(this.vbool374_B, this.vbool372_uses_F[0]);
     // Message to 'vbool373' from ReplicateWithMarginal factor
     this.vbool373_B = ReplicateOp.DefAverageConditional<Bernoulli>(this.vbool373_uses_B, this.vbool373_B);
     // Message to 'vbool382' from And factor
     this.vbool382_F = BooleanAndOp.AndAverageConditional(this.vbool380_uses_F[0], this.vbool381_uses_F[0]);
     // Message to 'vbool382_uses' from ReplicateWithMarginal factor
     this.vbool382_uses_F[0] = ReplicateOp.UsesAverageConditional<Bernoulli>(this.vbool382_uses_B, this.vbool382_F, 0, this.vbool382_uses_F[0]);
     // Message to 'vbool384_uses' from Or factor
     this.vbool384_uses_B[0] = BooleanOrOp.BAverageConditional(this.vbool385_B, this.vbool379_uses_F[0]);
     // Message to 'vbool384' from ReplicateWithMarginal factor
     this.vbool384_B = ReplicateOp.DefAverageConditional<Bernoulli>(this.vbool384_uses_B, this.vbool384_B);
     // Message to 'vbool383_uses' from Or factor
     this.vbool383_uses_B[0] = BooleanOrOp.BAverageConditional(this.vbool384_B, this.vbool382_uses_F[0]);
     // Message to 'vbool383' from ReplicateWithMarginal factor
     this.vbool383_B = ReplicateOp.DefAverageConditional<Bernoulli>(this.vbool383_uses_B, this.vbool383_B);
     // Message to 'vbool382_uses' from Or factor
     this.vbool382_uses_B[0] = BooleanOrOp.AAverageConditional(this.vbool384_B, this.vbool383_uses_F[0]);
     // Message to 'vbool382_marginal' from ReplicateWithMarginal factor
     this.vbool382_marginal_B = ReplicateOp.MarginalAverageConditional<Bernoulli>(this.vbool382_uses_B, this.vbool382_F, this.vbool382_marginal_B);
     // Message to 'vbool382' from ReplicateWithMarginal factor
     this.vbool382_B = ReplicateOp.DefAverageConditional<Bernoulli>(this.vbool382_uses_B, this.vbool382_B);
     // Message to 'vbool381_uses' from And factor
     this.vbool381_uses_B[0] = BooleanAndOp.BAverageConditional(this.vbool382_B, this.vbool380_uses_F[0]);
     // Message to 'vbool381' from ReplicateWithMarginal factor
     this.vbool381_B = ReplicateOp.DefAverageConditional<Bernoulli>(this.vbool381_uses_B, this.vbool381_B);
     // Message to 'vbool380_uses' from And factor
     this.vbool380_uses_B[0] = BooleanAndOp.AAverageConditional(this.vbool382_B, this.vbool381_uses_F[0]);
     // Message to 'vbool380_marginal' from ReplicateWithMarginal factor
     this.vbool380_marginal_B = ReplicateOp.MarginalAverageConditional<Bernoulli>(this.vbool380_uses_B, this.vbool380_F, this.vbool380_marginal_B);
     // Message to 'vbool380' from ReplicateWithMarginal factor
     this.vbool380_B = ReplicateOp.DefAverageConditional<Bernoulli>(this.vbool380_uses_B, this.vbool380_B);
     // Message to 'vbool2_uses' from Not factor
     this.vbool2_uses_B[6] = BooleanNotOp.BAverageConditional(this.vbool380_B);
     // Message to 'vbool2_uses' from UsesEqualDef factor
     this.vbool2_uses_F[1] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool2_uses_B, this.vbool2_F, 1, this.vbool2_uses_F[1]);
     // Message to 'vbool2_uses' from UsesEqualDef factor
     this.vbool2_uses_F[0] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool2_uses_B, this.vbool2_F, 0, this.vbool2_uses_F[0]);
     // Message to 'vbool404' from Not factor
     this.vbool404_F = BooleanNotOp.NotAverageConditional(this.vbool2_uses_F[0]);
     // Message to 'vbool404_marginal' from ReplicateWithMarginal factor
     this.vbool404_marginal_B = ReplicateOp.MarginalAverageConditional<Bernoulli>(this.vbool404_uses_B, this.vbool404_F, this.vbool404_marginal_B);
     // Message to 'vbool404_uses' from ReplicateWithMarginal factor
     this.vbool404_uses_F[0] = ReplicateOp.UsesAverageConditional<Bernoulli>(this.vbool404_uses_B, this.vbool404_F, 0, this.vbool404_uses_F[0]);
     // Message to 'vbool2_uses' from UsesEqualDef factor
     this.vbool2_uses_F[2] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool2_uses_B, this.vbool2_F, 2, this.vbool2_uses_F[2]);
     // Message to 'vbool368' from Not factor
     this.vbool368_F = BooleanNotOp.NotAverageConditional(this.vbool2_uses_F[2]);
     // Message to 'vbool368_marginal' from ReplicateWithMarginal factor
     this.vbool368_marginal_B = ReplicateOp.MarginalAverageConditional<Bernoulli>(this.vbool368_uses_B, this.vbool368_F, this.vbool368_marginal_B);
     // Message to 'vbool368_uses' from ReplicateWithMarginal factor
     this.vbool368_uses_F[0] = ReplicateOp.UsesAverageConditional<Bernoulli>(this.vbool368_uses_B, this.vbool368_F, 0, this.vbool368_uses_F[0]);
     // Message to 'vbool2_uses' from UsesEqualDef factor
     this.vbool2_uses_F[3] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool2_uses_B, this.vbool2_F, 3, this.vbool2_uses_F[3]);
     // Message to 'vbool2_uses' from UsesEqualDef factor
     this.vbool2_uses_F[4] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool2_uses_B, this.vbool2_F, 4, this.vbool2_uses_F[4]);
     // Message to 'vbool372' from Not factor
     this.vbool372_F = BooleanNotOp.NotAverageConditional(this.vbool2_uses_F[4]);
     // Message to 'vbool372_marginal' from ReplicateWithMarginal factor
     this.vbool372_marginal_B = ReplicateOp.MarginalAverageConditional<Bernoulli>(this.vbool372_uses_B, this.vbool372_F, this.vbool372_marginal_B);
     // Message to 'vbool372_uses' from ReplicateWithMarginal factor
     this.vbool372_uses_F[0] = ReplicateOp.UsesAverageConditional<Bernoulli>(this.vbool372_uses_B, this.vbool372_F, 0, this.vbool372_uses_F[0]);
     // Message to 'vbool2_uses' from UsesEqualDef factor
     this.vbool2_uses_F[5] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool2_uses_B, this.vbool2_F, 5, this.vbool2_uses_F[5]);
     // Message to 'vbool2_uses' from UsesEqualDef factor
     this.vbool2_uses_F[7] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool2_uses_B, this.vbool2_F, 7, this.vbool2_uses_F[7]);
     // Message to 'vbool2_uses' from UsesEqualDef factor
     this.vbool2_uses_F[9] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool2_uses_B, this.vbool2_F, 9, this.vbool2_uses_F[9]);
     // Message to 'vbool2_uses' from UsesEqualDef factor
     this.vbool2_uses_F[11] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool2_uses_B, this.vbool2_F, 11, this.vbool2_uses_F[11]);
     // Message to 'vbool1_uses' from AreEqual factor
     this.vbool1_uses_B[0] = BooleanAreEqualOp.BAverageConditional(this.vbool456_B, this.vbool2_uses_F[11]);
     // Message to 'vbool1_marginal' from UsesEqualDef factor
     this.vbool1_marginal_B = UsesEqualDefOp.MarginalAverageConditional<Bernoulli>(this.vbool1_uses_B, this.vbool1_F, this.vbool1_marginal_B);
     // Message to 'vbool456' from AreEqual factor
     this.vbool456_F = BooleanAreEqualOp.AreEqualAverageConditional(this.vbool2_uses_F[11], this.vbool1_uses_F[0]);
     // Message to 'vbool456_marginal' from ReplicateWithMarginal factor
     this.vbool456_marginal_B = ReplicateOp.MarginalAverageConditional<Bernoulli>(this.vbool456_uses_B, this.vbool456_F, this.vbool456_marginal_B);
     // Message to 'vbool2_marginal' from UsesEqualDef factor
     this.vbool2_marginal_B = UsesEqualDefOp.MarginalAverageConditional<Bernoulli>(this.vbool2_uses_B, this.vbool2_F, this.vbool2_marginal_B);
     // Message to 'vbool406' from And factor
     this.vbool406_F = BooleanAndOp.AndAverageConditional(this.vbool404_uses_F[0], this.vbool405_uses_F[0]);
     // Message to 'vbool406_marginal' from ReplicateWithMarginal factor
     this.vbool406_marginal_B = ReplicateOp.MarginalAverageConditional<Bernoulli>(this.vbool406_uses_B, this.vbool406_F, this.vbool406_marginal_B);
     // Message to 'vbool406_uses' from ReplicateWithMarginal factor
     this.vbool406_uses_F[0] = ReplicateOp.UsesAverageConditional<Bernoulli>(this.vbool406_uses_B, this.vbool406_F, 0, this.vbool406_uses_F[0]);
     // Message to 'vbool408' from Or factor
     this.vbool408_F = BooleanOrOp.OrAverageConditional(this.vbool406_uses_F[0], this.vbool407_uses_F[0]);
     // Message to 'vbool408_marginal' from ReplicateWithMarginal factor
     this.vbool408_marginal_B = ReplicateOp.MarginalAverageConditional<Bernoulli>(this.vbool408_uses_B, this.vbool408_F, this.vbool408_marginal_B);
     // Message to 'vbool408_uses' from ReplicateWithMarginal factor
     this.vbool408_uses_F[0] = ReplicateOp.UsesAverageConditional<Bernoulli>(this.vbool408_uses_B, this.vbool408_F, 0, this.vbool408_uses_F[0]);
     // Message to 'vbool403' from And factor
     this.vbool403_F = BooleanAndOp.AndAverageConditional(this.vbool2_uses_F[1], this.vbool402_uses_F[0]);
     // Message to 'vbool403_marginal' from ReplicateWithMarginal factor
     this.vbool403_marginal_B = ReplicateOp.MarginalAverageConditional<Bernoulli>(this.vbool403_uses_B, this.vbool403_F, this.vbool403_marginal_B);
     // Message to 'vbool403_uses' from ReplicateWithMarginal factor
     this.vbool403_uses_F[0] = ReplicateOp.UsesAverageConditional<Bernoulli>(this.vbool403_uses_B, this.vbool403_F, 0, this.vbool403_uses_F[0]);
     // Message to 'vbool409' from Or factor
     this.vbool409_F = BooleanOrOp.OrAverageConditional(this.vbool403_uses_F[0], this.vbool408_uses_F[0]);
     // Message to 'vbool409_marginal' from ReplicateWithMarginal factor
     this.vbool409_marginal_B = ReplicateOp.MarginalAverageConditional<Bernoulli>(this.vbool409_uses_B, this.vbool409_F, this.vbool409_marginal_B);
     // Message to 'vbool371' from And factor
     this.vbool371_F = BooleanAndOp.AndAverageConditional(this.vbool2_uses_F[3], this.vbool370_uses_F[0]);
     // Message to 'vbool371_marginal' from ReplicateWithMarginal factor
     this.vbool371_marginal_B = ReplicateOp.MarginalAverageConditional<Bernoulli>(this.vbool371_uses_B, this.vbool371_F, this.vbool371_marginal_B);
     // Message to 'vbool371_uses' from ReplicateWithMarginal factor
     this.vbool371_uses_F[0] = ReplicateOp.UsesAverageConditional<Bernoulli>(this.vbool371_uses_B, this.vbool371_F, 0, this.vbool371_uses_F[0]);
     // Message to 'vbool379' from And factor
     this.vbool379_F = BooleanAndOp.AndAverageConditional(this.vbool2_uses_F[5], this.vbool378_uses_F[0]);
     // Message to 'vbool379_marginal' from ReplicateWithMarginal factor
     this.vbool379_marginal_B = ReplicateOp.MarginalAverageConditional<Bernoulli>(this.vbool379_uses_B, this.vbool379_F, this.vbool379_marginal_B);
     // Message to 'vbool379_uses' from ReplicateWithMarginal factor
     this.vbool379_uses_F[0] = ReplicateOp.UsesAverageConditional<Bernoulli>(this.vbool379_uses_B, this.vbool379_F, 0, this.vbool379_uses_F[0]);
     // Message to 'vbool387' from And factor
     this.vbool387_F = BooleanAndOp.AndAverageConditional(this.vbool2_uses_F[7], this.vbool386_uses_F[0]);
     // Message to 'vbool387_marginal' from ReplicateWithMarginal factor
     this.vbool387_marginal_B = ReplicateOp.MarginalAverageConditional<Bernoulli>(this.vbool387_uses_B, this.vbool387_F, this.vbool387_marginal_B);
     // Message to 'vbool387_uses' from ReplicateWithMarginal factor
     this.vbool387_uses_F[0] = ReplicateOp.UsesAverageConditional<Bernoulli>(this.vbool387_uses_B, this.vbool387_F, 0, this.vbool387_uses_F[0]);
     // Message to 'vbool392_uses' from Or factor
     this.vbool392_uses_B[0] = BooleanOrOp.BAverageConditional(this.vbool393_B, this.vbool387_uses_F[0]);
     // Message to 'vbool392' from ReplicateWithMarginal factor
     this.vbool392_B = ReplicateOp.DefAverageConditional<Bernoulli>(this.vbool392_uses_B, this.vbool392_B);
     // Message to 'vbool395' from And factor
     this.vbool395_F = BooleanAndOp.AndAverageConditional(this.vbool2_uses_F[9], this.vbool394_uses_F[0]);
     // Message to 'vbool395_marginal' from ReplicateWithMarginal factor
     this.vbool395_marginal_B = ReplicateOp.MarginalAverageConditional<Bernoulli>(this.vbool395_uses_B, this.vbool395_F, this.vbool395_marginal_B);
     // Message to 'vbool395_uses' from ReplicateWithMarginal factor
     this.vbool395_uses_F[0] = ReplicateOp.UsesAverageConditional<Bernoulli>(this.vbool395_uses_B, this.vbool395_F, 0, this.vbool395_uses_F[0]);
     // Message to 'vbool400_uses' from Or factor
     this.vbool400_uses_B[0] = BooleanOrOp.BAverageConditional(this.vbool401_B, this.vbool395_uses_F[0]);
     // Message to 'vbool400' from ReplicateWithMarginal factor
     this.vbool400_B = ReplicateOp.DefAverageConditional<Bernoulli>(this.vbool400_uses_B, this.vbool400_B);
     // Message to 'vbool374' from And factor
     this.vbool374_F = BooleanAndOp.AndAverageConditional(this.vbool372_uses_F[0], this.vbool373_uses_F[0]);
     // Message to 'vbool374_marginal' from ReplicateWithMarginal factor
     this.vbool374_marginal_B = ReplicateOp.MarginalAverageConditional<Bernoulli>(this.vbool374_uses_B, this.vbool374_F, this.vbool374_marginal_B);
     // Message to 'vbool374_uses' from ReplicateWithMarginal factor
     this.vbool374_uses_F[0] = ReplicateOp.UsesAverageConditional<Bernoulli>(this.vbool374_uses_B, this.vbool374_F, 0, this.vbool374_uses_F[0]);
     // Message to 'vbool376' from Or factor
     this.vbool376_F = BooleanOrOp.OrAverageConditional(this.vbool374_uses_F[0], this.vbool375_uses_F[0]);
     // Message to 'vbool376_marginal' from ReplicateWithMarginal factor
     this.vbool376_marginal_B = ReplicateOp.MarginalAverageConditional<Bernoulli>(this.vbool376_uses_B, this.vbool376_F, this.vbool376_marginal_B);
     // Message to 'vbool376_uses' from ReplicateWithMarginal factor
     this.vbool376_uses_F[0] = ReplicateOp.UsesAverageConditional<Bernoulli>(this.vbool376_uses_B, this.vbool376_F, 0, this.vbool376_uses_F[0]);
     // Message to 'vbool377' from Or factor
     this.vbool377_F = BooleanOrOp.OrAverageConditional(this.vbool371_uses_F[0], this.vbool376_uses_F[0]);
     // Message to 'vbool377_marginal' from ReplicateWithMarginal factor
     this.vbool377_marginal_B = ReplicateOp.MarginalAverageConditional<Bernoulli>(this.vbool377_uses_B, this.vbool377_F, this.vbool377_marginal_B);
     // Message to 'vbool384' from Or factor
     this.vbool384_F = BooleanOrOp.OrAverageConditional(this.vbool382_uses_F[0], this.vbool383_uses_F[0]);
     // Message to 'vbool384_marginal' from ReplicateWithMarginal factor
     this.vbool384_marginal_B = ReplicateOp.MarginalAverageConditional<Bernoulli>(this.vbool384_uses_B, this.vbool384_F, this.vbool384_marginal_B);
     // Message to 'vbool384_uses' from ReplicateWithMarginal factor
     this.vbool384_uses_F[0] = ReplicateOp.UsesAverageConditional<Bernoulli>(this.vbool384_uses_B, this.vbool384_F, 0, this.vbool384_uses_F[0]);
     // Message to 'vbool385' from Or factor
     this.vbool385_F = BooleanOrOp.OrAverageConditional(this.vbool379_uses_F[0], this.vbool384_uses_F[0]);
     // Message to 'vbool385_marginal' from ReplicateWithMarginal factor
     this.vbool385_marginal_B = ReplicateOp.MarginalAverageConditional<Bernoulli>(this.vbool385_uses_B, this.vbool385_F, this.vbool385_marginal_B);
     // Message to 'vbool391_uses' from Or factor
     this.vbool391_uses_B[0] = BooleanOrOp.BAverageConditional(this.vbool392_B, this.vbool390_uses_F[0]);
     // Message to 'vbool391' from ReplicateWithMarginal factor
     this.vbool391_B = ReplicateOp.DefAverageConditional<Bernoulli>(this.vbool391_uses_B, this.vbool391_B);
     // Message to 'vbool390_uses' from Or factor
     this.vbool390_uses_B[0] = BooleanOrOp.AAverageConditional(this.vbool392_B, this.vbool391_uses_F[0]);
     // Message to 'vbool390' from ReplicateWithMarginal factor
     this.vbool390_B = ReplicateOp.DefAverageConditional<Bernoulli>(this.vbool390_uses_B, this.vbool390_B);
     // Message to 'vbool389_uses' from And factor
     this.vbool389_uses_B[0] = BooleanAndOp.BAverageConditional(this.vbool390_B, this.vbool388_uses_F[0]);
     // Message to 'vbool389' from ReplicateWithMarginal factor
     this.vbool389_B = ReplicateOp.DefAverageConditional<Bernoulli>(this.vbool389_uses_B, this.vbool389_B);
     // Message to 'vbool388_uses' from And factor
     this.vbool388_uses_B[0] = BooleanAndOp.AAverageConditional(this.vbool390_B, this.vbool389_uses_F[0]);
     // Message to 'vbool388_marginal' from ReplicateWithMarginal factor
     this.vbool388_marginal_B = ReplicateOp.MarginalAverageConditional<Bernoulli>(this.vbool388_uses_B, this.vbool388_F, this.vbool388_marginal_B);
     // Message to 'vbool388' from ReplicateWithMarginal factor
     this.vbool388_B = ReplicateOp.DefAverageConditional<Bernoulli>(this.vbool388_uses_B, this.vbool388_B);
     // Message to 'vbool2_uses' from Not factor
     this.vbool2_uses_B[8] = BooleanNotOp.BAverageConditional(this.vbool388_B);
     // Message to 'vbool390' from And factor
     this.vbool390_F = BooleanAndOp.AndAverageConditional(this.vbool388_uses_F[0], this.vbool389_uses_F[0]);
     // Message to 'vbool390_marginal' from ReplicateWithMarginal factor
     this.vbool390_marginal_B = ReplicateOp.MarginalAverageConditional<Bernoulli>(this.vbool390_uses_B, this.vbool390_F, this.vbool390_marginal_B);
     // Message to 'vbool390_uses' from ReplicateWithMarginal factor
     this.vbool390_uses_F[0] = ReplicateOp.UsesAverageConditional<Bernoulli>(this.vbool390_uses_B, this.vbool390_F, 0, this.vbool390_uses_F[0]);
     // Message to 'vbool392' from Or factor
     this.vbool392_F = BooleanOrOp.OrAverageConditional(this.vbool390_uses_F[0], this.vbool391_uses_F[0]);
     // Message to 'vbool392_marginal' from ReplicateWithMarginal factor
     this.vbool392_marginal_B = ReplicateOp.MarginalAverageConditional<Bernoulli>(this.vbool392_uses_B, this.vbool392_F, this.vbool392_marginal_B);
     // Message to 'vbool392_uses' from ReplicateWithMarginal factor
     this.vbool392_uses_F[0] = ReplicateOp.UsesAverageConditional<Bernoulli>(this.vbool392_uses_B, this.vbool392_F, 0, this.vbool392_uses_F[0]);
     // Message to 'vbool393' from Or factor
     this.vbool393_F = BooleanOrOp.OrAverageConditional(this.vbool387_uses_F[0], this.vbool392_uses_F[0]);
     // Message to 'vbool393_marginal' from ReplicateWithMarginal factor
     this.vbool393_marginal_B = ReplicateOp.MarginalAverageConditional<Bernoulli>(this.vbool393_uses_B, this.vbool393_F, this.vbool393_marginal_B);
     // Message to 'vbool399_uses' from Or factor
     this.vbool399_uses_B[0] = BooleanOrOp.BAverageConditional(this.vbool400_B, this.vbool398_uses_F[0]);
     // Message to 'vbool399' from ReplicateWithMarginal factor
     this.vbool399_B = ReplicateOp.DefAverageConditional<Bernoulli>(this.vbool399_uses_B, this.vbool399_B);
     // Message to 'vbool71_uses' from AreEqual factor
     this.vbool71_uses_B[0] = BooleanAreEqualOp.BAverageConditional(this.vbool399_B, this.vbool66_uses_F[3]);
     // Message to 'vbool71_uses' from UsesEqualDef factor
     this.vbool71_uses_F[1] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool71_uses_B, this.vbool71_F, 1, this.vbool71_uses_F[1]);
     // Message to 'vbool93_uses' from AreEqual factor
     this.vbool93_uses_B[0] = BooleanAreEqualOp.AAverageConditional(this.vbool214_B, this.vbool71_uses_F[1]);
     // Message to 'vbool93_uses' from UsesEqualDef factor
     this.vbool93_uses_F[1] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool93_uses_B, this.vbool93_F, 1, this.vbool93_uses_F[1]);
     // Message to 'vbool158_uses' from AreEqual factor
     this.vbool158_uses_B[2] = BooleanAreEqualOp.BAverageConditional(this.vbool455_B, this.vbool93_uses_F[1]);
     // Message to 'vbool158_uses' from UsesEqualDef factor
     this.vbool158_uses_F[0] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool158_uses_B, this.vbool158_F, 0, this.vbool158_uses_F[0]);
     // Message to 'vbool184_uses' from AreEqual factor
     this.vbool184_uses_B[2] = BooleanAreEqualOp.AAverageConditional(this.vbool445_B, this.vbool158_uses_F[0]);
     // Message to 'vbool184_uses' from UsesEqualDef factor
     this.vbool184_uses_F[0] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool184_uses_B, this.vbool184_F, 0, this.vbool184_uses_F[0]);
     // Message to 'vbool106_uses' from AreEqual factor
     this.vbool106_uses_B[1] = BooleanAreEqualOp.AAverageConditional(this.vbool450_B, this.vbool184_uses_F[0]);
     // Message to 'vbool106_uses' from UsesEqualDef factor
     this.vbool106_uses_F[0] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool106_uses_B, this.vbool106_F, 0, this.vbool106_uses_F[0]);
     // Message to 'vbool110_uses' from AreEqual factor
     this.vbool110_uses_B[3] = BooleanAreEqualOp.AAverageConditional(this.vbool193_B, this.vbool106_uses_F[0]);
     // Message to 'vbool184_uses' from UsesEqualDef factor
     this.vbool184_uses_F[1] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool184_uses_B, this.vbool184_F, 1, this.vbool184_uses_F[1]);
     // Message to 'vbool162_uses' from AreEqual factor
     this.vbool162_uses_B[0] = BooleanAreEqualOp.BAverageConditional(this.vbool424_B, this.vbool184_uses_F[1]);
     // Message to 'vbool162_uses' from UsesEqualDef factor
     this.vbool162_uses_F[1] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool162_uses_B, this.vbool162_F, 1, this.vbool162_uses_F[1]);
     // Message to 'vbool158_uses' from AreEqual factor
     this.vbool158_uses_B[1] = BooleanAreEqualOp.BAverageConditional(this.vbool418_B, this.vbool162_uses_F[1]);
     // Message to 'vbool158_uses' from UsesEqualDef factor
     this.vbool158_uses_F[1] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool158_uses_B, this.vbool158_F, 1, this.vbool158_uses_F[1]);
     // Message to 'vbool162_uses' from AreEqual factor
     this.vbool162_uses_B[1] = BooleanAreEqualOp.AAverageConditional(this.vbool418_B, this.vbool158_uses_F[1]);
     // Message to 'vbool162_marginal' from UsesEqualDef factor
     this.vbool162_marginal_B = UsesEqualDefOp.MarginalAverageConditional<Bernoulli>(this.vbool162_uses_B, this.vbool162_F, this.vbool162_marginal_B);
     // Message to 'vbool418' from AreEqual factor
     this.vbool418_F = BooleanAreEqualOp.AreEqualAverageConditional(this.vbool162_uses_F[1], this.vbool158_uses_F[1]);
     // Message to 'vbool418_marginal' from ReplicateWithMarginal factor
     this.vbool418_marginal_B = ReplicateOp.MarginalAverageConditional<Bernoulli>(this.vbool418_uses_B, this.vbool418_F, this.vbool418_marginal_B);
     // Message to 'vbool162_uses' from UsesEqualDef factor
     this.vbool162_uses_F[0] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool162_uses_B, this.vbool162_F, 0, this.vbool162_uses_F[0]);
     // Message to 'vbool184_uses' from AreEqual factor
     this.vbool184_uses_B[1] = BooleanAreEqualOp.AAverageConditional(this.vbool424_B, this.vbool162_uses_F[0]);
     // Message to 'vbool424' from AreEqual factor
     this.vbool424_F = BooleanAreEqualOp.AreEqualAverageConditional(this.vbool184_uses_F[1], this.vbool162_uses_F[0]);
     // Message to 'vbool424_marginal' from ReplicateWithMarginal factor
     this.vbool424_marginal_B = ReplicateOp.MarginalAverageConditional<Bernoulli>(this.vbool424_uses_B, this.vbool424_F, this.vbool424_marginal_B);
     // Message to 'vbool184_uses' from UsesEqualDef factor
     this.vbool184_uses_F[2] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool184_uses_B, this.vbool184_F, 2, this.vbool184_uses_F[2]);
     // Message to 'vbool158_uses' from AreEqual factor
     this.vbool158_uses_B[0] = BooleanAreEqualOp.BAverageConditional(this.vbool445_B, this.vbool184_uses_F[2]);
     // Message to 'vbool158_marginal' from UsesEqualDef factor
     this.vbool158_marginal_B = UsesEqualDefOp.MarginalAverageConditional<Bernoulli>(this.vbool158_uses_B, this.vbool158_F, this.vbool158_marginal_B);
     // Message to 'vbool445' from AreEqual factor
     this.vbool445_F = BooleanAreEqualOp.AreEqualAverageConditional(this.vbool184_uses_F[2], this.vbool158_uses_F[0]);
     // Message to 'vbool445_marginal' from ReplicateWithMarginal factor
     this.vbool445_marginal_B = ReplicateOp.MarginalAverageConditional<Bernoulli>(this.vbool445_uses_B, this.vbool445_F, this.vbool445_marginal_B);
     // Message to 'vbool158_uses' from UsesEqualDef factor
     this.vbool158_uses_F[2] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool158_uses_B, this.vbool158_F, 2, this.vbool158_uses_F[2]);
     // Message to 'vbool93_uses' from AreEqual factor
     this.vbool93_uses_B[1] = BooleanAreEqualOp.AAverageConditional(this.vbool455_B, this.vbool158_uses_F[2]);
     // Message to 'vbool93_marginal' from UsesEqualDef factor
     this.vbool93_marginal_B = UsesEqualDefOp.MarginalAverageConditional<Bernoulli>(this.vbool93_uses_B, this.vbool93_F, this.vbool93_marginal_B);
     // Message to 'vbool455' from AreEqual factor
     this.vbool455_F = BooleanAreEqualOp.AreEqualAverageConditional(this.vbool93_uses_F[1], this.vbool158_uses_F[2]);
     // Message to 'vbool455_marginal' from ReplicateWithMarginal factor
     this.vbool455_marginal_B = ReplicateOp.MarginalAverageConditional<Bernoulli>(this.vbool455_uses_B, this.vbool455_F, this.vbool455_marginal_B);
     // Message to 'vbool93_uses' from UsesEqualDef factor
     this.vbool93_uses_F[0] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool93_uses_B, this.vbool93_F, 0, this.vbool93_uses_F[0]);
     // Message to 'vbool71_uses' from AreEqual factor
     this.vbool71_uses_B[1] = BooleanAreEqualOp.BAverageConditional(this.vbool214_B, this.vbool93_uses_F[0]);
     // Message to 'vbool71_marginal' from UsesEqualDef factor
     this.vbool71_marginal_B = UsesEqualDefOp.MarginalAverageConditional<Bernoulli>(this.vbool71_uses_B, this.vbool71_F, this.vbool71_marginal_B);
     // Message to 'vbool214' from AreEqual factor
     this.vbool214_F = BooleanAreEqualOp.AreEqualAverageConditional(this.vbool93_uses_F[0], this.vbool71_uses_F[1]);
     // Message to 'vbool214_marginal' from ReplicateWithMarginal factor
     this.vbool214_marginal_B = ReplicateOp.MarginalAverageConditional<Bernoulli>(this.vbool214_uses_B, this.vbool214_F, this.vbool214_marginal_B);
     // Message to 'vbool71_uses' from UsesEqualDef factor
     this.vbool71_uses_F[0] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool71_uses_B, this.vbool71_F, 0, this.vbool71_uses_F[0]);
     // Message to 'vbool66_uses' from AreEqual factor
     this.vbool66_uses_B[3] = BooleanAreEqualOp.AAverageConditional(this.vbool399_B, this.vbool71_uses_F[0]);
     // Message to 'vbool399' from AreEqual factor
     this.vbool399_F = BooleanAreEqualOp.AreEqualAverageConditional(this.vbool66_uses_F[3], this.vbool71_uses_F[0]);
     // Message to 'vbool399_marginal' from ReplicateWithMarginal factor
     this.vbool399_marginal_B = ReplicateOp.MarginalAverageConditional<Bernoulli>(this.vbool399_uses_B, this.vbool399_F, this.vbool399_marginal_B);
     // Message to 'vbool399_uses' from ReplicateWithMarginal factor
     this.vbool399_uses_F[0] = ReplicateOp.UsesAverageConditional<Bernoulli>(this.vbool399_uses_B, this.vbool399_F, 0, this.vbool399_uses_F[0]);
     // Message to 'vbool398_uses' from Or factor
     this.vbool398_uses_B[0] = BooleanOrOp.AAverageConditional(this.vbool400_B, this.vbool399_uses_F[0]);
     // Message to 'vbool398' from ReplicateWithMarginal factor
     this.vbool398_B = ReplicateOp.DefAverageConditional<Bernoulli>(this.vbool398_uses_B, this.vbool398_B);
     // Message to 'vbool397_uses' from And factor
     this.vbool397_uses_B[0] = BooleanAndOp.BAverageConditional(this.vbool398_B, this.vbool396_uses_F[0]);
     // Message to 'vbool397' from ReplicateWithMarginal factor
     this.vbool397_B = ReplicateOp.DefAverageConditional<Bernoulli>(this.vbool397_uses_B, this.vbool397_B);
     // Message to 'vbool115_uses' from AreEqual factor
     this.vbool115_uses_B[10] = BooleanAreEqualOp.BAverageConditional(this.vbool397_B, this.vbool66_uses_F[1]);
     // Message to 'vbool66_uses' from UsesEqualDef factor
     this.vbool66_uses_F[0] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool66_uses_B, this.vbool66_F, 0, this.vbool66_uses_F[0]);
     // Message to 'vbool144_uses' from AreEqual factor
     this.vbool144_uses_B[1] = BooleanAreEqualOp.BAverageConditional(this.vbool394_B, this.vbool66_uses_F[0]);
     // Message to 'vbool394' from AreEqual factor
     this.vbool394_F = BooleanAreEqualOp.AreEqualAverageConditional(this.vbool66_uses_F[0], this.vbool144_uses_F[1]);
     // Message to 'vbool394_marginal' from ReplicateWithMarginal factor
     this.vbool394_marginal_B = ReplicateOp.MarginalAverageConditional<Bernoulli>(this.vbool394_uses_B, this.vbool394_F, this.vbool394_marginal_B);
     // Message to 'vbool394_uses' from ReplicateWithMarginal factor
     this.vbool394_uses_F[0] = ReplicateOp.UsesAverageConditional<Bernoulli>(this.vbool394_uses_B, this.vbool394_F, 0, this.vbool394_uses_F[0]);
     // Message to 'vbool66_uses' from UsesEqualDef factor
     this.vbool66_uses_F[2] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool66_uses_B, this.vbool66_F, 2, this.vbool66_uses_F[2]);
     // Message to 'vbool45_uses' from AreEqual factor
     this.vbool45_uses_B[0] = BooleanAreEqualOp.BAverageConditional(this.vbool209_B, this.vbool66_uses_F[2]);
     // Message to 'vbool45_marginal' from UsesEqualDef factor
     this.vbool45_marginal_B = UsesEqualDefOp.MarginalAverageConditional<Bernoulli>(this.vbool45_uses_B, this.vbool45_F, this.vbool45_marginal_B);
     // Message to 'vbool209' from AreEqual factor
     this.vbool209_F = BooleanAreEqualOp.AreEqualAverageConditional(this.vbool66_uses_F[2], this.vbool45_uses_F[0]);
     // Message to 'vbool209_marginal' from ReplicateWithMarginal factor
     this.vbool209_marginal_B = ReplicateOp.MarginalAverageConditional<Bernoulli>(this.vbool209_uses_B, this.vbool209_F, this.vbool209_marginal_B);
     // Message to 'vbool45_uses' from UsesEqualDef factor
     this.vbool45_uses_F[1] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool45_uses_B, this.vbool45_F, 1, this.vbool45_uses_F[1]);
     // Message to 'vbool14_uses' from AreEqual factor
     this.vbool14_uses_B[0] = BooleanAreEqualOp.BAverageConditional(this.vbool188_B, this.vbool45_uses_F[1]);
     // Message to 'vbool14_marginal' from UsesEqualDef factor
     this.vbool14_marginal_B = UsesEqualDefOp.MarginalAverageConditional<Bernoulli>(this.vbool14_uses_B, this.vbool14_F, this.vbool14_marginal_B);
     // Message to 'vbool188' from AreEqual factor
     this.vbool188_F = BooleanAreEqualOp.AreEqualAverageConditional(this.vbool45_uses_F[1], this.vbool14_uses_F[0]);
     // Message to 'vbool188_marginal' from ReplicateWithMarginal factor
     this.vbool188_marginal_B = ReplicateOp.MarginalAverageConditional<Bernoulli>(this.vbool188_uses_B, this.vbool188_F, this.vbool188_marginal_B);
     // Message to 'vbool14_uses' from UsesEqualDef factor
     this.vbool14_uses_F[1] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool14_uses_B, this.vbool14_F, 1, this.vbool14_uses_F[1]);
     // Message to 'vbool40_uses' from AreEqual factor
     this.vbool40_uses_B[1] = BooleanAreEqualOp.AAverageConditional(this.vbool414_B, this.vbool14_uses_F[1]);
     // Message to 'vbool40_marginal' from UsesEqualDef factor
     this.vbool40_marginal_B = UsesEqualDefOp.MarginalAverageConditional<Bernoulli>(this.vbool40_uses_B, this.vbool40_F, this.vbool40_marginal_B);
     // Message to 'vbool414' from AreEqual factor
     this.vbool414_F = BooleanAreEqualOp.AreEqualAverageConditional(this.vbool40_uses_F[1], this.vbool14_uses_F[1]);
     // Message to 'vbool414_marginal' from ReplicateWithMarginal factor
     this.vbool414_marginal_B = ReplicateOp.MarginalAverageConditional<Bernoulli>(this.vbool414_uses_B, this.vbool414_F, this.vbool414_marginal_B);
     // Message to 'vbool40_uses' from UsesEqualDef factor
     this.vbool40_uses_F[0] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool40_uses_B, this.vbool40_F, 0, this.vbool40_uses_F[0]);
     // Message to 'vbool19_uses' from AreEqual factor
     this.vbool19_uses_B[1] = BooleanAreEqualOp.BAverageConditional(this.vbool204_B, this.vbool40_uses_F[0]);
     // Message to 'vbool19_marginal' from UsesEqualDef factor
     this.vbool19_marginal_B = UsesEqualDefOp.MarginalAverageConditional<Bernoulli>(this.vbool19_uses_B, this.vbool19_F, this.vbool19_marginal_B);
     // Message to 'vbool204' from AreEqual factor
     this.vbool204_F = BooleanAreEqualOp.AreEqualAverageConditional(this.vbool40_uses_F[0], this.vbool19_uses_F[1]);
     // Message to 'vbool204_marginal' from ReplicateWithMarginal factor
     this.vbool204_marginal_B = ReplicateOp.MarginalAverageConditional<Bernoulli>(this.vbool204_uses_B, this.vbool204_F, this.vbool204_marginal_B);
     // Message to 'vbool19_uses' from UsesEqualDef factor
     this.vbool19_uses_F[0] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool19_uses_B, this.vbool19_F, 0, this.vbool19_uses_F[0]);
     // Message to 'vbool144_uses' from AreEqual factor
     this.vbool144_uses_B[2] = BooleanAreEqualOp.BAverageConditional(this.vbool198_B, this.vbool19_uses_F[0]);
     // Message to 'vbool144_marginal' from UsesEqualDef factor
     this.vbool144_marginal_B = UsesEqualDefOp.MarginalAverageConditional<Bernoulli>(this.vbool144_uses_B, this.vbool144_F, this.vbool144_marginal_B);
     // Message to 'vbool198' from AreEqual factor
     this.vbool198_F = BooleanAreEqualOp.AreEqualAverageConditional(this.vbool19_uses_F[0], this.vbool144_uses_F[2]);
     // Message to 'vbool198_marginal' from ReplicateWithMarginal factor
     this.vbool198_marginal_B = ReplicateOp.MarginalAverageConditional<Bernoulli>(this.vbool198_uses_B, this.vbool198_F, this.vbool198_marginal_B);
     // Message to 'vbool144_uses' from UsesEqualDef factor
     this.vbool144_uses_F[0] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool144_uses_B, this.vbool144_F, 0, this.vbool144_uses_F[0]);
     // Message to 'vbool66_marginal' from UsesEqualDef factor
     this.vbool66_marginal_B = UsesEqualDefOp.MarginalAverageConditional<Bernoulli>(this.vbool66_uses_B, this.vbool66_F, this.vbool66_marginal_B);
     // Message to 'vbool184_marginal' from UsesEqualDef factor
     this.vbool184_marginal_B = UsesEqualDefOp.MarginalAverageConditional<Bernoulli>(this.vbool184_uses_B, this.vbool184_F, this.vbool184_marginal_B);
     // Message to 'vbool284' from And factor
     this.vbool284_F = BooleanAndOp.AndAverageConditional(this.vbool144_uses_F[0], this.vbool110_uses_F[8]);
     // Message to 'vbool284_marginal' from ReplicateWithMarginal factor
     this.vbool284_marginal_B = ReplicateOp.MarginalAverageConditional<Bernoulli>(this.vbool284_uses_B, this.vbool284_F, this.vbool284_marginal_B);
     // Message to 'vbool284_uses' from ReplicateWithMarginal factor
     this.vbool284_uses_F[0] = ReplicateOp.UsesAverageConditional<Bernoulli>(this.vbool284_uses_B, this.vbool284_F, 0, this.vbool284_uses_F[0]);
     // Message to 'vbool396_uses' from And factor
     this.vbool396_uses_B[0] = BooleanAndOp.AAverageConditional(this.vbool398_B, this.vbool397_uses_F[0]);
     // Message to 'vbool396_marginal' from ReplicateWithMarginal factor
     this.vbool396_marginal_B = ReplicateOp.MarginalAverageConditional<Bernoulli>(this.vbool396_uses_B, this.vbool396_F, this.vbool396_marginal_B);
     // Message to 'vbool396' from ReplicateWithMarginal factor
     this.vbool396_B = ReplicateOp.DefAverageConditional<Bernoulli>(this.vbool396_uses_B, this.vbool396_B);
     // Message to 'vbool2_uses' from Not factor
     this.vbool2_uses_B[10] = BooleanNotOp.BAverageConditional(this.vbool396_B);
     // Message to 'vbool285' from And factor
     this.vbool285_F = BooleanAndOp.AndAverageConditional(this.vbool284_uses_F[0], this.vbool115_uses_F[9]);
     // Message to 'vbool285_marginal' from ReplicateWithMarginal factor
     this.vbool285_marginal_B = ReplicateOp.MarginalAverageConditional<Bernoulli>(this.vbool285_uses_B, this.vbool285_F, this.vbool285_marginal_B);
     // Message to 'vbool285_uses' from ReplicateWithMarginal factor
     this.vbool285_uses_F[0] = ReplicateOp.UsesAverageConditional<Bernoulli>(this.vbool285_uses_B, this.vbool285_F, 0, this.vbool285_uses_F[0]);
     // Message to 'vbool283_uses' from Or factor
     this.vbool283_uses_B[0] = BooleanOrOp.BAverageConditional(this.vbool286_B, this.vbool285_uses_F[0]);
     // Message to 'vbool283' from ReplicateWithMarginal factor
     this.vbool283_B = ReplicateOp.DefAverageConditional<Bernoulli>(this.vbool283_uses_B, this.vbool283_B);
     // Message to 'vbool282_uses' from Or factor
     this.vbool282_uses_B[0] = BooleanOrOp.AAverageConditional(this.vbool283_B, this.vbool280_uses_F[0]);
     // Message to 'vbool282' from ReplicateWithMarginal factor
     this.vbool282_B = ReplicateOp.DefAverageConditional<Bernoulli>(this.vbool282_uses_B, this.vbool282_B);
     // Message to 'vbool115_uses' from And factor
     this.vbool115_uses_B[8] = BooleanAndOp.BAverageConditional(this.vbool282_B, this.vbool281_uses_F[0]);
     // Message to 'vbool281_uses' from And factor
     this.vbool281_uses_B[0] = BooleanAndOp.AAverageConditional(this.vbool282_B, this.vbool115_uses_F[8]);
     // Message to 'vbool281' from ReplicateWithMarginal factor
     this.vbool281_B = ReplicateOp.DefAverageConditional<Bernoulli>(this.vbool281_uses_B, this.vbool281_B);
     // Message to 'vbool109_uses' from And factor
     this.vbool109_uses_B[6] = BooleanAndOp.BAverageConditional(this.vbool281_B, this.vbool143_uses_F[2]);
     // Message to 'vbool143_uses' from And factor
     this.vbool143_uses_B[2] = BooleanAndOp.AAverageConditional(this.vbool281_B, this.vbool109_uses_F[6]);
     // Message to 'vbool398' from And factor
     this.vbool398_F = BooleanAndOp.AndAverageConditional(this.vbool396_uses_F[0], this.vbool397_uses_F[0]);
     // Message to 'vbool398_marginal' from ReplicateWithMarginal factor
     this.vbool398_marginal_B = ReplicateOp.MarginalAverageConditional<Bernoulli>(this.vbool398_uses_B, this.vbool398_F, this.vbool398_marginal_B);
     // Message to 'vbool398_uses' from ReplicateWithMarginal factor
     this.vbool398_uses_F[0] = ReplicateOp.UsesAverageConditional<Bernoulli>(this.vbool398_uses_B, this.vbool398_F, 0, this.vbool398_uses_F[0]);
     // Message to 'vbool400' from Or factor
     this.vbool400_F = BooleanOrOp.OrAverageConditional(this.vbool398_uses_F[0], this.vbool399_uses_F[0]);
     // Message to 'vbool400_marginal' from ReplicateWithMarginal factor
     this.vbool400_marginal_B = ReplicateOp.MarginalAverageConditional<Bernoulli>(this.vbool400_uses_B, this.vbool400_F, this.vbool400_marginal_B);
     // Message to 'vbool400_uses' from ReplicateWithMarginal factor
     this.vbool400_uses_F[0] = ReplicateOp.UsesAverageConditional<Bernoulli>(this.vbool400_uses_B, this.vbool400_F, 0, this.vbool400_uses_F[0]);
     // Message to 'vbool401' from Or factor
     this.vbool401_F = BooleanOrOp.OrAverageConditional(this.vbool395_uses_F[0], this.vbool400_uses_F[0]);
     // Message to 'vbool401_marginal' from ReplicateWithMarginal factor
     this.vbool401_marginal_B = ReplicateOp.MarginalAverageConditional<Bernoulli>(this.vbool401_uses_B, this.vbool401_F, this.vbool401_marginal_B);
     // Message to 'vbool244' from Or factor
     this.vbool244_F = BooleanOrOp.OrAverageConditional(this.vbool243_uses_F[0], this.vbool241_uses_F[0]);
     // Message to 'vbool244_uses' from ReplicateWithMarginal factor
     this.vbool244_uses_F[0] = ReplicateOp.UsesAverageConditional<Bernoulli>(this.vbool244_uses_B, this.vbool244_F, 0, this.vbool244_uses_F[0]);
     // Message to 'vbool247' from Or factor
     this.vbool247_F = BooleanOrOp.OrAverageConditional(this.vbool246_uses_F[0], this.vbool244_uses_F[0]);
     // Message to 'vbool247_uses' from ReplicateWithMarginal factor
     this.vbool247_uses_F[0] = ReplicateOp.UsesAverageConditional<Bernoulli>(this.vbool247_uses_B, this.vbool247_F, 0, this.vbool247_uses_F[0]);
     // Message to 'vbool250' from Or factor
     this.vbool250_F = BooleanOrOp.OrAverageConditional(this.vbool249_uses_F[0], this.vbool247_uses_F[0]);
     // Message to 'vbool250_uses' from ReplicateWithMarginal factor
     this.vbool250_uses_F[0] = ReplicateOp.UsesAverageConditional<Bernoulli>(this.vbool250_uses_B, this.vbool250_F, 0, this.vbool250_uses_F[0]);
     // Message to 'vbool253' from Or factor
     this.vbool253_F = BooleanOrOp.OrAverageConditional(this.vbool252_uses_F[0], this.vbool250_uses_F[0]);
     // Message to 'vbool253_uses' from ReplicateWithMarginal factor
     this.vbool253_uses_F[0] = ReplicateOp.UsesAverageConditional<Bernoulli>(this.vbool253_uses_B, this.vbool253_F, 0, this.vbool253_uses_F[0]);
     // Message to 'vbool256' from Or factor
     this.vbool256_F = BooleanOrOp.OrAverageConditional(this.vbool255_uses_F[0], this.vbool253_uses_F[0]);
     // Message to 'vbool256_uses' from ReplicateWithMarginal factor
     this.vbool256_uses_F[0] = ReplicateOp.UsesAverageConditional<Bernoulli>(this.vbool256_uses_B, this.vbool256_F, 0, this.vbool256_uses_F[0]);
     // Message to 'vbool259' from Or factor
     this.vbool259_F = BooleanOrOp.OrAverageConditional(this.vbool258_uses_F[0], this.vbool256_uses_F[0]);
     // Message to 'vbool259_uses' from ReplicateWithMarginal factor
     this.vbool259_uses_F[0] = ReplicateOp.UsesAverageConditional<Bernoulli>(this.vbool259_uses_B, this.vbool259_F, 0, this.vbool259_uses_F[0]);
     // Message to 'vbool262' from Or factor
     this.vbool262_F = BooleanOrOp.OrAverageConditional(this.vbool261_uses_F[0], this.vbool259_uses_F[0]);
     // Message to 'vbool262_uses' from ReplicateWithMarginal factor
     this.vbool262_uses_F[0] = ReplicateOp.UsesAverageConditional<Bernoulli>(this.vbool262_uses_B, this.vbool262_F, 0, this.vbool262_uses_F[0]);
     // Message to 'vbool265' from Or factor
     this.vbool265_F = BooleanOrOp.OrAverageConditional(this.vbool264_uses_F[0], this.vbool262_uses_F[0]);
     // Message to 'vbool265_uses' from ReplicateWithMarginal factor
     this.vbool265_uses_F[0] = ReplicateOp.UsesAverageConditional<Bernoulli>(this.vbool265_uses_B, this.vbool265_F, 0, this.vbool265_uses_F[0]);
     // Message to 'vbool268' from Or factor
     this.vbool268_F = BooleanOrOp.OrAverageConditional(this.vbool267_uses_F[0], this.vbool265_uses_F[0]);
     // Message to 'vbool268_uses' from ReplicateWithMarginal factor
     this.vbool268_uses_F[0] = ReplicateOp.UsesAverageConditional<Bernoulli>(this.vbool268_uses_B, this.vbool268_F, 0, this.vbool268_uses_F[0]);
     // Message to 'vbool271' from Or factor
     this.vbool271_F = BooleanOrOp.OrAverageConditional(this.vbool270_uses_F[0], this.vbool268_uses_F[0]);
     // Message to 'vbool271_uses' from ReplicateWithMarginal factor
     this.vbool271_uses_F[0] = ReplicateOp.UsesAverageConditional<Bernoulli>(this.vbool271_uses_B, this.vbool271_F, 0, this.vbool271_uses_F[0]);
     // Message to 'vbool274' from Or factor
     this.vbool274_F = BooleanOrOp.OrAverageConditional(this.vbool273_uses_F[0], this.vbool271_uses_F[0]);
     // Message to 'vbool274_uses' from ReplicateWithMarginal factor
     this.vbool274_uses_F[0] = ReplicateOp.UsesAverageConditional<Bernoulli>(this.vbool274_uses_B, this.vbool274_F, 0, this.vbool274_uses_F[0]);
     // Message to 'vbool277' from Or factor
     this.vbool277_F = BooleanOrOp.OrAverageConditional(this.vbool276_uses_F[0], this.vbool274_uses_F[0]);
     // Message to 'vbool277_uses' from ReplicateWithMarginal factor
     this.vbool277_uses_F[0] = ReplicateOp.UsesAverageConditional<Bernoulli>(this.vbool277_uses_B, this.vbool277_F, 0, this.vbool277_uses_F[0]);
     // Message to 'vbool280_uses' from Or factor
     this.vbool280_uses_B[0] = BooleanOrOp.BAverageConditional(this.vbool283_B, this.vbool282_uses_F[0]);
     // Message to 'vbool280' from ReplicateWithMarginal factor
     this.vbool280_B = ReplicateOp.DefAverageConditional<Bernoulli>(this.vbool280_uses_B, this.vbool280_B);
     // Message to 'vbool279_uses' from Or factor
     this.vbool279_uses_B[0] = BooleanOrOp.AAverageConditional(this.vbool280_B, this.vbool277_uses_F[0]);
     // Message to 'vbool279' from ReplicateWithMarginal factor
     this.vbool279_B = ReplicateOp.DefAverageConditional<Bernoulli>(this.vbool279_uses_B, this.vbool279_B);
     // Message to 'vbool278_uses' from And factor
     this.vbool278_uses_B[0] = BooleanAndOp.AAverageConditional(this.vbool279_B, this.vbool114_uses_F[3]);
     // Message to 'vbool278' from ReplicateWithMarginal factor
     this.vbool278_B = ReplicateOp.DefAverageConditional<Bernoulli>(this.vbool278_uses_B, this.vbool278_B);
     // Message to 'vbool110_uses' from And factor
     this.vbool110_uses_B[7] = BooleanAndOp.BAverageConditional(this.vbool278_B, this.vbool143_uses_F[0]);
     // Message to 'vbool143_uses' from And factor
     this.vbool143_uses_B[0] = BooleanAndOp.AAverageConditional(this.vbool278_B, this.vbool110_uses_F[7]);
     // Message to 'vbool114_uses' from And factor
     this.vbool114_uses_B[3] = BooleanAndOp.BAverageConditional(this.vbool279_B, this.vbool278_uses_F[0]);
     // Message to 'vbool277_uses' from Or factor
     this.vbool277_uses_B[0] = BooleanOrOp.BAverageConditional(this.vbool280_B, this.vbool279_uses_F[0]);
     // Message to 'vbool277_marginal' from ReplicateWithMarginal factor
     this.vbool277_marginal_B = ReplicateOp.MarginalAverageConditional<Bernoulli>(this.vbool277_uses_B, this.vbool277_F, this.vbool277_marginal_B);
     // Message to 'vbool277' from ReplicateWithMarginal factor
     this.vbool277_B = ReplicateOp.DefAverageConditional<Bernoulli>(this.vbool277_uses_B, this.vbool277_B);
     // Message to 'vbool276_uses' from Or factor
     this.vbool276_uses_B[0] = BooleanOrOp.AAverageConditional(this.vbool277_B, this.vbool274_uses_F[0]);
     // Message to 'vbool276' from ReplicateWithMarginal factor
     this.vbool276_B = ReplicateOp.DefAverageConditional<Bernoulli>(this.vbool276_uses_B, this.vbool276_B);
     // Message to 'vbool275_uses' from And factor
     this.vbool275_uses_B[0] = BooleanAndOp.AAverageConditional(this.vbool276_B, this.vbool114_uses_F[5]);
     // Message to 'vbool275' from ReplicateWithMarginal factor
     this.vbool275_B = ReplicateOp.DefAverageConditional<Bernoulli>(this.vbool275_uses_B, this.vbool275_B);
     // Message to 'vbool109_uses' from And factor
     this.vbool109_uses_B[5] = BooleanAndOp.BAverageConditional(this.vbool275_B, this.vbool143_uses_F[1]);
     // Message to 'vbool143_uses' from And factor
     this.vbool143_uses_B[1] = BooleanAndOp.AAverageConditional(this.vbool275_B, this.vbool109_uses_F[5]);
     // Message to 'vbool143_uses' from UsesEqualDef factor
     this.vbool143_uses_F[3] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool143_uses_B, this.vbool143_F, 3, this.vbool143_uses_F[3]);
     // Message to 'vbool65_uses' from AreEqual factor
     this.vbool65_uses_B[0] = BooleanAreEqualOp.AAverageConditional(this.vbool386_B, this.vbool143_uses_F[3]);
     // Message to 'vbool143_uses' from UsesEqualDef factor
     this.vbool143_uses_F[4] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool143_uses_B, this.vbool143_F, 4, this.vbool143_uses_F[4]);
     // Message to 'vbool18_uses' from AreEqual factor
     this.vbool18_uses_B[0] = BooleanAreEqualOp.AAverageConditional(this.vbool197_B, this.vbool143_uses_F[4]);
     // Message to 'vbool18_uses' from UsesEqualDef factor
     this.vbool18_uses_F[1] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool18_uses_B, this.vbool18_F, 1, this.vbool18_uses_F[1]);
     // Message to 'vbool39_uses' from AreEqual factor
     this.vbool39_uses_B[0] = BooleanAreEqualOp.AAverageConditional(this.vbool203_B, this.vbool18_uses_F[1]);
     // Message to 'vbool39_uses' from UsesEqualDef factor
     this.vbool39_uses_F[1] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool39_uses_B, this.vbool39_F, 1, this.vbool39_uses_F[1]);
     // Message to 'vbool13_uses' from AreEqual factor
     this.vbool13_uses_B[1] = BooleanAreEqualOp.BAverageConditional(this.vbool413_B, this.vbool39_uses_F[1]);
     // Message to 'vbool13_uses' from UsesEqualDef factor
     this.vbool13_uses_F[0] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool13_uses_B, this.vbool13_F, 0, this.vbool13_uses_F[0]);
     // Message to 'vbool44_uses' from AreEqual factor
     this.vbool44_uses_B[1] = BooleanAreEqualOp.AAverageConditional(this.vbool187_B, this.vbool13_uses_F[0]);
     // Message to 'vbool44_uses' from UsesEqualDef factor
     this.vbool44_uses_F[0] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool44_uses_B, this.vbool44_F, 0, this.vbool44_uses_F[0]);
     // Message to 'vbool65_uses' from AreEqual factor
     this.vbool65_uses_B[2] = BooleanAreEqualOp.AAverageConditional(this.vbool208_B, this.vbool44_uses_F[0]);
     // Message to 'vbool65_uses' from UsesEqualDef factor
     this.vbool65_uses_F[1] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool65_uses_B, this.vbool65_F, 1, this.vbool65_uses_F[1]);
     // Message to 'vbool114_uses' from AreEqual factor
     this.vbool114_uses_B[6] = BooleanAreEqualOp.BAverageConditional(this.vbool389_B, this.vbool65_uses_F[1]);
     // Message to 'vbool65_uses' from UsesEqualDef factor
     this.vbool65_uses_F[3] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool65_uses_B, this.vbool65_F, 3, this.vbool65_uses_F[3]);
     // Message to 'vbool70_uses' from AreEqual factor
     this.vbool70_uses_B[0] = BooleanAreEqualOp.BAverageConditional(this.vbool391_B, this.vbool65_uses_F[3]);
     // Message to 'vbool70_uses' from UsesEqualDef factor
     this.vbool70_uses_F[1] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool70_uses_B, this.vbool70_F, 1, this.vbool70_uses_F[1]);
     // Message to 'vbool92_uses' from AreEqual factor
     this.vbool92_uses_B[0] = BooleanAreEqualOp.AAverageConditional(this.vbool213_B, this.vbool70_uses_F[1]);
     // Message to 'vbool92_uses' from UsesEqualDef factor
     this.vbool92_uses_F[1] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool92_uses_B, this.vbool92_F, 1, this.vbool92_uses_F[1]);
     // Message to 'vbool157_uses' from AreEqual factor
     this.vbool157_uses_B[2] = BooleanAreEqualOp.BAverageConditional(this.vbool454_B, this.vbool92_uses_F[1]);
     // Message to 'vbool157_uses' from UsesEqualDef factor
     this.vbool157_uses_F[0] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool157_uses_B, this.vbool157_F, 0, this.vbool157_uses_F[0]);
     // Message to 'vbool183_uses' from AreEqual factor
     this.vbool183_uses_B[2] = BooleanAreEqualOp.AAverageConditional(this.vbool444_B, this.vbool157_uses_F[0]);
     // Message to 'vbool183_uses' from UsesEqualDef factor
     this.vbool183_uses_F[0] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool183_uses_B, this.vbool183_F, 0, this.vbool183_uses_F[0]);
     // Message to 'vbool105_uses' from AreEqual factor
     this.vbool105_uses_B[1] = BooleanAreEqualOp.AAverageConditional(this.vbool449_B, this.vbool183_uses_F[0]);
     // Message to 'vbool105_uses' from UsesEqualDef factor
     this.vbool105_uses_F[0] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool105_uses_B, this.vbool105_F, 0, this.vbool105_uses_F[0]);
     // Message to 'vbool109_uses' from AreEqual factor
     this.vbool109_uses_B[2] = BooleanAreEqualOp.AAverageConditional(this.vbool192_B, this.vbool105_uses_F[0]);
     // Message to 'vbool183_uses' from UsesEqualDef factor
     this.vbool183_uses_F[1] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool183_uses_B, this.vbool183_F, 1, this.vbool183_uses_F[1]);
     // Message to 'vbool161_uses' from AreEqual factor
     this.vbool161_uses_B[0] = BooleanAreEqualOp.BAverageConditional(this.vbool423_B, this.vbool183_uses_F[1]);
     // Message to 'vbool161_uses' from UsesEqualDef factor
     this.vbool161_uses_F[1] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool161_uses_B, this.vbool161_F, 1, this.vbool161_uses_F[1]);
     // Message to 'vbool157_uses' from AreEqual factor
     this.vbool157_uses_B[1] = BooleanAreEqualOp.BAverageConditional(this.vbool417_B, this.vbool161_uses_F[1]);
     // Message to 'vbool157_uses' from UsesEqualDef factor
     this.vbool157_uses_F[1] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool157_uses_B, this.vbool157_F, 1, this.vbool157_uses_F[1]);
     // Message to 'vbool161_uses' from AreEqual factor
     this.vbool161_uses_B[1] = BooleanAreEqualOp.AAverageConditional(this.vbool417_B, this.vbool157_uses_F[1]);
     // Message to 'vbool161_marginal' from UsesEqualDef factor
     this.vbool161_marginal_B = UsesEqualDefOp.MarginalAverageConditional<Bernoulli>(this.vbool161_uses_B, this.vbool161_F, this.vbool161_marginal_B);
     // Message to 'vbool417' from AreEqual factor
     this.vbool417_F = BooleanAreEqualOp.AreEqualAverageConditional(this.vbool161_uses_F[1], this.vbool157_uses_F[1]);
     // Message to 'vbool417_marginal' from ReplicateWithMarginal factor
     this.vbool417_marginal_B = ReplicateOp.MarginalAverageConditional<Bernoulli>(this.vbool417_uses_B, this.vbool417_F, this.vbool417_marginal_B);
     // Message to 'vbool161_uses' from UsesEqualDef factor
     this.vbool161_uses_F[0] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool161_uses_B, this.vbool161_F, 0, this.vbool161_uses_F[0]);
     // Message to 'vbool183_uses' from AreEqual factor
     this.vbool183_uses_B[1] = BooleanAreEqualOp.AAverageConditional(this.vbool423_B, this.vbool161_uses_F[0]);
     // Message to 'vbool423' from AreEqual factor
     this.vbool423_F = BooleanAreEqualOp.AreEqualAverageConditional(this.vbool183_uses_F[1], this.vbool161_uses_F[0]);
     // Message to 'vbool423_marginal' from ReplicateWithMarginal factor
     this.vbool423_marginal_B = ReplicateOp.MarginalAverageConditional<Bernoulli>(this.vbool423_uses_B, this.vbool423_F, this.vbool423_marginal_B);
     // Message to 'vbool183_uses' from UsesEqualDef factor
     this.vbool183_uses_F[2] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool183_uses_B, this.vbool183_F, 2, this.vbool183_uses_F[2]);
     // Message to 'vbool157_uses' from AreEqual factor
     this.vbool157_uses_B[0] = BooleanAreEqualOp.BAverageConditional(this.vbool444_B, this.vbool183_uses_F[2]);
     // Message to 'vbool157_marginal' from UsesEqualDef factor
     this.vbool157_marginal_B = UsesEqualDefOp.MarginalAverageConditional<Bernoulli>(this.vbool157_uses_B, this.vbool157_F, this.vbool157_marginal_B);
     // Message to 'vbool444' from AreEqual factor
     this.vbool444_F = BooleanAreEqualOp.AreEqualAverageConditional(this.vbool183_uses_F[2], this.vbool157_uses_F[0]);
     // Message to 'vbool444_marginal' from ReplicateWithMarginal factor
     this.vbool444_marginal_B = ReplicateOp.MarginalAverageConditional<Bernoulli>(this.vbool444_uses_B, this.vbool444_F, this.vbool444_marginal_B);
     // Message to 'vbool157_uses' from UsesEqualDef factor
     this.vbool157_uses_F[2] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool157_uses_B, this.vbool157_F, 2, this.vbool157_uses_F[2]);
     // Message to 'vbool92_uses' from AreEqual factor
     this.vbool92_uses_B[1] = BooleanAreEqualOp.AAverageConditional(this.vbool454_B, this.vbool157_uses_F[2]);
     // Message to 'vbool92_marginal' from UsesEqualDef factor
     this.vbool92_marginal_B = UsesEqualDefOp.MarginalAverageConditional<Bernoulli>(this.vbool92_uses_B, this.vbool92_F, this.vbool92_marginal_B);
     // Message to 'vbool454' from AreEqual factor
     this.vbool454_F = BooleanAreEqualOp.AreEqualAverageConditional(this.vbool92_uses_F[1], this.vbool157_uses_F[2]);
     // Message to 'vbool454_marginal' from ReplicateWithMarginal factor
     this.vbool454_marginal_B = ReplicateOp.MarginalAverageConditional<Bernoulli>(this.vbool454_uses_B, this.vbool454_F, this.vbool454_marginal_B);
     // Message to 'vbool92_uses' from UsesEqualDef factor
     this.vbool92_uses_F[0] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool92_uses_B, this.vbool92_F, 0, this.vbool92_uses_F[0]);
     // Message to 'vbool70_uses' from AreEqual factor
     this.vbool70_uses_B[1] = BooleanAreEqualOp.BAverageConditional(this.vbool213_B, this.vbool92_uses_F[0]);
     // Message to 'vbool70_marginal' from UsesEqualDef factor
     this.vbool70_marginal_B = UsesEqualDefOp.MarginalAverageConditional<Bernoulli>(this.vbool70_uses_B, this.vbool70_F, this.vbool70_marginal_B);
     // Message to 'vbool213' from AreEqual factor
     this.vbool213_F = BooleanAreEqualOp.AreEqualAverageConditional(this.vbool92_uses_F[0], this.vbool70_uses_F[1]);
     // Message to 'vbool213_marginal' from ReplicateWithMarginal factor
     this.vbool213_marginal_B = ReplicateOp.MarginalAverageConditional<Bernoulli>(this.vbool213_uses_B, this.vbool213_F, this.vbool213_marginal_B);
     // Message to 'vbool70_uses' from UsesEqualDef factor
     this.vbool70_uses_F[0] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool70_uses_B, this.vbool70_F, 0, this.vbool70_uses_F[0]);
     // Message to 'vbool65_uses' from AreEqual factor
     this.vbool65_uses_B[3] = BooleanAreEqualOp.AAverageConditional(this.vbool391_B, this.vbool70_uses_F[0]);
     // Message to 'vbool391' from AreEqual factor
     this.vbool391_F = BooleanAreEqualOp.AreEqualAverageConditional(this.vbool65_uses_F[3], this.vbool70_uses_F[0]);
     // Message to 'vbool391_marginal' from ReplicateWithMarginal factor
     this.vbool391_marginal_B = ReplicateOp.MarginalAverageConditional<Bernoulli>(this.vbool391_uses_B, this.vbool391_F, this.vbool391_marginal_B);
     // Message to 'vbool391_uses' from ReplicateWithMarginal factor
     this.vbool391_uses_F[0] = ReplicateOp.UsesAverageConditional<Bernoulli>(this.vbool391_uses_B, this.vbool391_F, 0, this.vbool391_uses_F[0]);
     // Message to 'vbool65_uses' from UsesEqualDef factor
     this.vbool65_uses_F[0] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool65_uses_B, this.vbool65_F, 0, this.vbool65_uses_F[0]);
     // Message to 'vbool143_uses' from AreEqual factor
     this.vbool143_uses_B[3] = BooleanAreEqualOp.BAverageConditional(this.vbool386_B, this.vbool65_uses_F[0]);
     // Message to 'vbool386' from AreEqual factor
     this.vbool386_F = BooleanAreEqualOp.AreEqualAverageConditional(this.vbool65_uses_F[0], this.vbool143_uses_F[3]);
     // Message to 'vbool386_marginal' from ReplicateWithMarginal factor
     this.vbool386_marginal_B = ReplicateOp.MarginalAverageConditional<Bernoulli>(this.vbool386_uses_B, this.vbool386_F, this.vbool386_marginal_B);
     // Message to 'vbool386_uses' from ReplicateWithMarginal factor
     this.vbool386_uses_F[0] = ReplicateOp.UsesAverageConditional<Bernoulli>(this.vbool386_uses_B, this.vbool386_F, 0, this.vbool386_uses_F[0]);
     // Message to 'vbool143_uses' from UsesEqualDef factor
     this.vbool143_uses_F[0] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool143_uses_B, this.vbool143_F, 0, this.vbool143_uses_F[0]);
     // Message to 'vbool143_uses' from UsesEqualDef factor
     this.vbool143_uses_F[1] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool143_uses_B, this.vbool143_F, 1, this.vbool143_uses_F[1]);
     // Message to 'vbool143_uses' from UsesEqualDef factor
     this.vbool143_uses_F[2] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool143_uses_B, this.vbool143_F, 2, this.vbool143_uses_F[2]);
     // Message to 'vbool143_marginal' from UsesEqualDef factor
     this.vbool143_marginal_B = UsesEqualDefOp.MarginalAverageConditional<Bernoulli>(this.vbool143_uses_B, this.vbool143_F, this.vbool143_marginal_B);
     // Message to 'vbool65_uses' from UsesEqualDef factor
     this.vbool65_uses_F[2] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool65_uses_B, this.vbool65_F, 2, this.vbool65_uses_F[2]);
     // Message to 'vbool44_uses' from AreEqual factor
     this.vbool44_uses_B[0] = BooleanAreEqualOp.BAverageConditional(this.vbool208_B, this.vbool65_uses_F[2]);
     // Message to 'vbool44_marginal' from UsesEqualDef factor
     this.vbool44_marginal_B = UsesEqualDefOp.MarginalAverageConditional<Bernoulli>(this.vbool44_uses_B, this.vbool44_F, this.vbool44_marginal_B);
     // Message to 'vbool208' from AreEqual factor
     this.vbool208_F = BooleanAreEqualOp.AreEqualAverageConditional(this.vbool65_uses_F[2], this.vbool44_uses_F[0]);
     // Message to 'vbool208_marginal' from ReplicateWithMarginal factor
     this.vbool208_marginal_B = ReplicateOp.MarginalAverageConditional<Bernoulli>(this.vbool208_uses_B, this.vbool208_F, this.vbool208_marginal_B);
     // Message to 'vbool44_uses' from UsesEqualDef factor
     this.vbool44_uses_F[1] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool44_uses_B, this.vbool44_F, 1, this.vbool44_uses_F[1]);
     // Message to 'vbool13_uses' from AreEqual factor
     this.vbool13_uses_B[0] = BooleanAreEqualOp.BAverageConditional(this.vbool187_B, this.vbool44_uses_F[1]);
     // Message to 'vbool13_marginal' from UsesEqualDef factor
     this.vbool13_marginal_B = UsesEqualDefOp.MarginalAverageConditional<Bernoulli>(this.vbool13_uses_B, this.vbool13_F, this.vbool13_marginal_B);
     // Message to 'vbool187' from AreEqual factor
     this.vbool187_F = BooleanAreEqualOp.AreEqualAverageConditional(this.vbool44_uses_F[1], this.vbool13_uses_F[0]);
     // Message to 'vbool187_marginal' from ReplicateWithMarginal factor
     this.vbool187_marginal_B = ReplicateOp.MarginalAverageConditional<Bernoulli>(this.vbool187_uses_B, this.vbool187_F, this.vbool187_marginal_B);
     // Message to 'vbool13_uses' from UsesEqualDef factor
     this.vbool13_uses_F[1] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool13_uses_B, this.vbool13_F, 1, this.vbool13_uses_F[1]);
     // Message to 'vbool39_uses' from AreEqual factor
     this.vbool39_uses_B[1] = BooleanAreEqualOp.AAverageConditional(this.vbool413_B, this.vbool13_uses_F[1]);
     // Message to 'vbool39_marginal' from UsesEqualDef factor
     this.vbool39_marginal_B = UsesEqualDefOp.MarginalAverageConditional<Bernoulli>(this.vbool39_uses_B, this.vbool39_F, this.vbool39_marginal_B);
     // Message to 'vbool413' from AreEqual factor
     this.vbool413_F = BooleanAreEqualOp.AreEqualAverageConditional(this.vbool39_uses_F[1], this.vbool13_uses_F[1]);
     // Message to 'vbool413_marginal' from ReplicateWithMarginal factor
     this.vbool413_marginal_B = ReplicateOp.MarginalAverageConditional<Bernoulli>(this.vbool413_uses_B, this.vbool413_F, this.vbool413_marginal_B);
     // Message to 'vbool39_uses' from UsesEqualDef factor
     this.vbool39_uses_F[0] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool39_uses_B, this.vbool39_F, 0, this.vbool39_uses_F[0]);
     // Message to 'vbool18_uses' from AreEqual factor
     this.vbool18_uses_B[1] = BooleanAreEqualOp.BAverageConditional(this.vbool203_B, this.vbool39_uses_F[0]);
     // Message to 'vbool18_marginal' from UsesEqualDef factor
     this.vbool18_marginal_B = UsesEqualDefOp.MarginalAverageConditional<Bernoulli>(this.vbool18_uses_B, this.vbool18_F, this.vbool18_marginal_B);
     // Message to 'vbool203' from AreEqual factor
     this.vbool203_F = BooleanAreEqualOp.AreEqualAverageConditional(this.vbool39_uses_F[0], this.vbool18_uses_F[1]);
     // Message to 'vbool203_marginal' from ReplicateWithMarginal factor
     this.vbool203_marginal_B = ReplicateOp.MarginalAverageConditional<Bernoulli>(this.vbool203_uses_B, this.vbool203_F, this.vbool203_marginal_B);
     // Message to 'vbool18_uses' from UsesEqualDef factor
     this.vbool18_uses_F[0] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool18_uses_B, this.vbool18_F, 0, this.vbool18_uses_F[0]);
     // Message to 'vbool143_uses' from AreEqual factor
     this.vbool143_uses_B[4] = BooleanAreEqualOp.BAverageConditional(this.vbool197_B, this.vbool18_uses_F[0]);
     // Message to 'vbool197' from AreEqual factor
     this.vbool197_F = BooleanAreEqualOp.AreEqualAverageConditional(this.vbool18_uses_F[0], this.vbool143_uses_F[4]);
     // Message to 'vbool197_marginal' from ReplicateWithMarginal factor
     this.vbool197_marginal_B = ReplicateOp.MarginalAverageConditional<Bernoulli>(this.vbool197_uses_B, this.vbool197_F, this.vbool197_marginal_B);
     // Message to 'vbool65_marginal' from UsesEqualDef factor
     this.vbool65_marginal_B = UsesEqualDefOp.MarginalAverageConditional<Bernoulli>(this.vbool65_uses_B, this.vbool65_F, this.vbool65_marginal_B);
     // Message to 'vbool183_marginal' from UsesEqualDef factor
     this.vbool183_marginal_B = UsesEqualDefOp.MarginalAverageConditional<Bernoulli>(this.vbool183_uses_B, this.vbool183_F, this.vbool183_marginal_B);
     // Message to 'vbool278' from And factor
     this.vbool278_F = BooleanAndOp.AndAverageConditional(this.vbool143_uses_F[0], this.vbool110_uses_F[7]);
     // Message to 'vbool278_marginal' from ReplicateWithMarginal factor
     this.vbool278_marginal_B = ReplicateOp.MarginalAverageConditional<Bernoulli>(this.vbool278_uses_B, this.vbool278_F, this.vbool278_marginal_B);
     // Message to 'vbool278_uses' from ReplicateWithMarginal factor
     this.vbool278_uses_F[0] = ReplicateOp.UsesAverageConditional<Bernoulli>(this.vbool278_uses_B, this.vbool278_F, 0, this.vbool278_uses_F[0]);
     // Message to 'vbool275' from And factor
     this.vbool275_F = BooleanAndOp.AndAverageConditional(this.vbool143_uses_F[1], this.vbool109_uses_F[5]);
     // Message to 'vbool275_marginal' from ReplicateWithMarginal factor
     this.vbool275_marginal_B = ReplicateOp.MarginalAverageConditional<Bernoulli>(this.vbool275_uses_B, this.vbool275_F, this.vbool275_marginal_B);
     // Message to 'vbool275_uses' from ReplicateWithMarginal factor
     this.vbool275_uses_F[0] = ReplicateOp.UsesAverageConditional<Bernoulli>(this.vbool275_uses_B, this.vbool275_F, 0, this.vbool275_uses_F[0]);
     // Message to 'vbool114_uses' from And factor
     this.vbool114_uses_B[5] = BooleanAndOp.BAverageConditional(this.vbool276_B, this.vbool275_uses_F[0]);
     // Message to 'vbool281' from And factor
     this.vbool281_F = BooleanAndOp.AndAverageConditional(this.vbool143_uses_F[2], this.vbool109_uses_F[6]);
     // Message to 'vbool281_marginal' from ReplicateWithMarginal factor
     this.vbool281_marginal_B = ReplicateOp.MarginalAverageConditional<Bernoulli>(this.vbool281_uses_B, this.vbool281_F, this.vbool281_marginal_B);
     // Message to 'vbool281_uses' from ReplicateWithMarginal factor
     this.vbool281_uses_F[0] = ReplicateOp.UsesAverageConditional<Bernoulli>(this.vbool281_uses_B, this.vbool281_F, 0, this.vbool281_uses_F[0]);
     // Message to 'vbool282' from And factor
     this.vbool282_F = BooleanAndOp.AndAverageConditional(this.vbool281_uses_F[0], this.vbool115_uses_F[8]);
     // Message to 'vbool282_marginal' from ReplicateWithMarginal factor
     this.vbool282_marginal_B = ReplicateOp.MarginalAverageConditional<Bernoulli>(this.vbool282_uses_B, this.vbool282_F, this.vbool282_marginal_B);
     // Message to 'vbool282_uses' from ReplicateWithMarginal factor
     this.vbool282_uses_F[0] = ReplicateOp.UsesAverageConditional<Bernoulli>(this.vbool282_uses_B, this.vbool282_F, 0, this.vbool282_uses_F[0]);
     // Message to 'vbool279' from And factor
     this.vbool279_F = BooleanAndOp.AndAverageConditional(this.vbool278_uses_F[0], this.vbool114_uses_F[3]);
     // Message to 'vbool279_marginal' from ReplicateWithMarginal factor
     this.vbool279_marginal_B = ReplicateOp.MarginalAverageConditional<Bernoulli>(this.vbool279_uses_B, this.vbool279_F, this.vbool279_marginal_B);
     // Message to 'vbool279_uses' from ReplicateWithMarginal factor
     this.vbool279_uses_F[0] = ReplicateOp.UsesAverageConditional<Bernoulli>(this.vbool279_uses_B, this.vbool279_F, 0, this.vbool279_uses_F[0]);
     // Message to 'vbool280' from Or factor
     this.vbool280_F = BooleanOrOp.OrAverageConditional(this.vbool279_uses_F[0], this.vbool277_uses_F[0]);
     // Message to 'vbool280_marginal' from ReplicateWithMarginal factor
     this.vbool280_marginal_B = ReplicateOp.MarginalAverageConditional<Bernoulli>(this.vbool280_uses_B, this.vbool280_F, this.vbool280_marginal_B);
     // Message to 'vbool280_uses' from ReplicateWithMarginal factor
     this.vbool280_uses_F[0] = ReplicateOp.UsesAverageConditional<Bernoulli>(this.vbool280_uses_B, this.vbool280_F, 0, this.vbool280_uses_F[0]);
     // Message to 'vbool283' from Or factor
     this.vbool283_F = BooleanOrOp.OrAverageConditional(this.vbool282_uses_F[0], this.vbool280_uses_F[0]);
     // Message to 'vbool283_marginal' from ReplicateWithMarginal factor
     this.vbool283_marginal_B = ReplicateOp.MarginalAverageConditional<Bernoulli>(this.vbool283_uses_B, this.vbool283_F, this.vbool283_marginal_B);
     // Message to 'vbool283_uses' from ReplicateWithMarginal factor
     this.vbool283_uses_F[0] = ReplicateOp.UsesAverageConditional<Bernoulli>(this.vbool283_uses_B, this.vbool283_F, 0, this.vbool283_uses_F[0]);
     // Message to 'vbool286' from Or factor
     this.vbool286_F = BooleanOrOp.OrAverageConditional(this.vbool285_uses_F[0], this.vbool283_uses_F[0]);
     // Message to 'vbool286_marginal' from ReplicateWithMarginal factor
     this.vbool286_marginal_B = ReplicateOp.MarginalAverageConditional<Bernoulli>(this.vbool286_uses_B, this.vbool286_F, this.vbool286_marginal_B);
     // Message to 'vbool276' from And factor
     this.vbool276_F = BooleanAndOp.AndAverageConditional(this.vbool275_uses_F[0], this.vbool114_uses_F[5]);
     // Message to 'vbool276_marginal' from ReplicateWithMarginal factor
     this.vbool276_marginal_B = ReplicateOp.MarginalAverageConditional<Bernoulli>(this.vbool276_uses_B, this.vbool276_F, this.vbool276_marginal_B);
     // Message to 'vbool276_uses' from ReplicateWithMarginal factor
     this.vbool276_uses_F[0] = ReplicateOp.UsesAverageConditional<Bernoulli>(this.vbool276_uses_B, this.vbool276_F, 0, this.vbool276_uses_F[0]);
     // Message to 'vbool274_uses' from Or factor
     this.vbool274_uses_B[0] = BooleanOrOp.BAverageConditional(this.vbool277_B, this.vbool276_uses_F[0]);
     // Message to 'vbool274_marginal' from ReplicateWithMarginal factor
     this.vbool274_marginal_B = ReplicateOp.MarginalAverageConditional<Bernoulli>(this.vbool274_uses_B, this.vbool274_F, this.vbool274_marginal_B);
     // Message to 'vbool274' from ReplicateWithMarginal factor
     this.vbool274_B = ReplicateOp.DefAverageConditional<Bernoulli>(this.vbool274_uses_B, this.vbool274_B);
     // Message to 'vbool273_uses' from Or factor
     this.vbool273_uses_B[0] = BooleanOrOp.AAverageConditional(this.vbool274_B, this.vbool271_uses_F[0]);
     // Message to 'vbool273' from ReplicateWithMarginal factor
     this.vbool273_B = ReplicateOp.DefAverageConditional<Bernoulli>(this.vbool273_uses_B, this.vbool273_B);
     // Message to 'vbool115_uses' from And factor
     this.vbool115_uses_B[7] = BooleanAndOp.BAverageConditional(this.vbool273_B, this.vbool272_uses_F[0]);
     // Message to 'vbool272_uses' from And factor
     this.vbool272_uses_B[0] = BooleanAndOp.AAverageConditional(this.vbool273_B, this.vbool115_uses_F[7]);
     // Message to 'vbool272' from ReplicateWithMarginal factor
     this.vbool272_B = ReplicateOp.DefAverageConditional<Bernoulli>(this.vbool272_uses_B, this.vbool272_B);
     // Message to 'vbool108_uses' from And factor
     this.vbool108_uses_B[6] = BooleanAndOp.BAverageConditional(this.vbool272_B, this.vbool142_uses_F[2]);
     // Message to 'vbool142_uses' from And factor
     this.vbool142_uses_B[2] = BooleanAndOp.AAverageConditional(this.vbool272_B, this.vbool108_uses_F[6]);
     // Message to 'vbool271_uses' from Or factor
     this.vbool271_uses_B[0] = BooleanOrOp.BAverageConditional(this.vbool274_B, this.vbool273_uses_F[0]);
     // Message to 'vbool271_marginal' from ReplicateWithMarginal factor
     this.vbool271_marginal_B = ReplicateOp.MarginalAverageConditional<Bernoulli>(this.vbool271_uses_B, this.vbool271_F, this.vbool271_marginal_B);
     // Message to 'vbool271' from ReplicateWithMarginal factor
     this.vbool271_B = ReplicateOp.DefAverageConditional<Bernoulli>(this.vbool271_uses_B, this.vbool271_B);
     // Message to 'vbool270_uses' from Or factor
     this.vbool270_uses_B[0] = BooleanOrOp.AAverageConditional(this.vbool271_B, this.vbool268_uses_F[0]);
     // Message to 'vbool270' from ReplicateWithMarginal factor
     this.vbool270_B = ReplicateOp.DefAverageConditional<Bernoulli>(this.vbool270_uses_B, this.vbool270_B);
     // Message to 'vbool269_uses' from And factor
     this.vbool269_uses_B[0] = BooleanAndOp.AAverageConditional(this.vbool270_B, this.vbool113_uses_F[3]);
     // Message to 'vbool269' from ReplicateWithMarginal factor
     this.vbool269_B = ReplicateOp.DefAverageConditional<Bernoulli>(this.vbool269_uses_B, this.vbool269_B);
     // Message to 'vbool110_uses' from And factor
     this.vbool110_uses_B[6] = BooleanAndOp.BAverageConditional(this.vbool269_B, this.vbool142_uses_F[0]);
     // Message to 'vbool142_uses' from And factor
     this.vbool142_uses_B[0] = BooleanAndOp.AAverageConditional(this.vbool269_B, this.vbool110_uses_F[6]);
     // Message to 'vbool113_uses' from And factor
     this.vbool113_uses_B[3] = BooleanAndOp.BAverageConditional(this.vbool270_B, this.vbool269_uses_F[0]);
     // Message to 'vbool268_uses' from Or factor
     this.vbool268_uses_B[0] = BooleanOrOp.BAverageConditional(this.vbool271_B, this.vbool270_uses_F[0]);
     // Message to 'vbool268_marginal' from ReplicateWithMarginal factor
     this.vbool268_marginal_B = ReplicateOp.MarginalAverageConditional<Bernoulli>(this.vbool268_uses_B, this.vbool268_F, this.vbool268_marginal_B);
     // Message to 'vbool268' from ReplicateWithMarginal factor
     this.vbool268_B = ReplicateOp.DefAverageConditional<Bernoulli>(this.vbool268_uses_B, this.vbool268_B);
     // Message to 'vbool267_uses' from Or factor
     this.vbool267_uses_B[0] = BooleanOrOp.AAverageConditional(this.vbool268_B, this.vbool265_uses_F[0]);
     // Message to 'vbool267' from ReplicateWithMarginal factor
     this.vbool267_B = ReplicateOp.DefAverageConditional<Bernoulli>(this.vbool267_uses_B, this.vbool267_B);
     // Message to 'vbool266_uses' from And factor
     this.vbool266_uses_B[0] = BooleanAndOp.AAverageConditional(this.vbool267_B, this.vbool113_uses_F[5]);
     // Message to 'vbool266' from ReplicateWithMarginal factor
     this.vbool266_B = ReplicateOp.DefAverageConditional<Bernoulli>(this.vbool266_uses_B, this.vbool266_B);
     // Message to 'vbool108_uses' from And factor
     this.vbool108_uses_B[5] = BooleanAndOp.BAverageConditional(this.vbool266_B, this.vbool142_uses_F[1]);
     // Message to 'vbool142_uses' from And factor
     this.vbool142_uses_B[1] = BooleanAndOp.AAverageConditional(this.vbool266_B, this.vbool108_uses_F[5]);
     // Message to 'vbool142_uses' from UsesEqualDef factor
     this.vbool142_uses_F[3] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool142_uses_B, this.vbool142_F, 3, this.vbool142_uses_F[3]);
     // Message to 'vbool64_uses' from AreEqual factor
     this.vbool64_uses_B[0] = BooleanAreEqualOp.AAverageConditional(this.vbool378_B, this.vbool142_uses_F[3]);
     // Message to 'vbool142_uses' from UsesEqualDef factor
     this.vbool142_uses_F[4] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool142_uses_B, this.vbool142_F, 4, this.vbool142_uses_F[4]);
     // Message to 'vbool17_uses' from AreEqual factor
     this.vbool17_uses_B[0] = BooleanAreEqualOp.AAverageConditional(this.vbool196_B, this.vbool142_uses_F[4]);
     // Message to 'vbool17_uses' from UsesEqualDef factor
     this.vbool17_uses_F[1] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool17_uses_B, this.vbool17_F, 1, this.vbool17_uses_F[1]);
     // Message to 'vbool38_uses' from AreEqual factor
     this.vbool38_uses_B[0] = BooleanAreEqualOp.AAverageConditional(this.vbool202_B, this.vbool17_uses_F[1]);
     // Message to 'vbool38_uses' from UsesEqualDef factor
     this.vbool38_uses_F[1] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool38_uses_B, this.vbool38_F, 1, this.vbool38_uses_F[1]);
     // Message to 'vbool12_uses' from AreEqual factor
     this.vbool12_uses_B[1] = BooleanAreEqualOp.BAverageConditional(this.vbool412_B, this.vbool38_uses_F[1]);
     // Message to 'vbool12_uses' from UsesEqualDef factor
     this.vbool12_uses_F[0] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool12_uses_B, this.vbool12_F, 0, this.vbool12_uses_F[0]);
     // Message to 'vbool43_uses' from AreEqual factor
     this.vbool43_uses_B[1] = BooleanAreEqualOp.AAverageConditional(this.vbool186_B, this.vbool12_uses_F[0]);
     // Message to 'vbool43_uses' from UsesEqualDef factor
     this.vbool43_uses_F[0] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool43_uses_B, this.vbool43_F, 0, this.vbool43_uses_F[0]);
     // Message to 'vbool64_uses' from AreEqual factor
     this.vbool64_uses_B[2] = BooleanAreEqualOp.AAverageConditional(this.vbool207_B, this.vbool43_uses_F[0]);
     // Message to 'vbool64_uses' from UsesEqualDef factor
     this.vbool64_uses_F[1] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool64_uses_B, this.vbool64_F, 1, this.vbool64_uses_F[1]);
     // Message to 'vbool113_uses' from AreEqual factor
     this.vbool113_uses_B[6] = BooleanAreEqualOp.BAverageConditional(this.vbool381_B, this.vbool64_uses_F[1]);
     // Message to 'vbool64_uses' from UsesEqualDef factor
     this.vbool64_uses_F[3] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool64_uses_B, this.vbool64_F, 3, this.vbool64_uses_F[3]);
     // Message to 'vbool69_uses' from AreEqual factor
     this.vbool69_uses_B[0] = BooleanAreEqualOp.BAverageConditional(this.vbool383_B, this.vbool64_uses_F[3]);
     // Message to 'vbool69_uses' from UsesEqualDef factor
     this.vbool69_uses_F[1] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool69_uses_B, this.vbool69_F, 1, this.vbool69_uses_F[1]);
     // Message to 'vbool91_uses' from AreEqual factor
     this.vbool91_uses_B[0] = BooleanAreEqualOp.AAverageConditional(this.vbool212_B, this.vbool69_uses_F[1]);
     // Message to 'vbool91_uses' from UsesEqualDef factor
     this.vbool91_uses_F[1] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool91_uses_B, this.vbool91_F, 1, this.vbool91_uses_F[1]);
     // Message to 'vbool156_uses' from AreEqual factor
     this.vbool156_uses_B[2] = BooleanAreEqualOp.BAverageConditional(this.vbool453_B, this.vbool91_uses_F[1]);
     // Message to 'vbool156_uses' from UsesEqualDef factor
     this.vbool156_uses_F[0] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool156_uses_B, this.vbool156_F, 0, this.vbool156_uses_F[0]);
     // Message to 'vbool182_uses' from AreEqual factor
     this.vbool182_uses_B[2] = BooleanAreEqualOp.AAverageConditional(this.vbool443_B, this.vbool156_uses_F[0]);
     // Message to 'vbool182_uses' from UsesEqualDef factor
     this.vbool182_uses_F[0] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool182_uses_B, this.vbool182_F, 0, this.vbool182_uses_F[0]);
     // Message to 'vbool104_uses' from AreEqual factor
     this.vbool104_uses_B[1] = BooleanAreEqualOp.AAverageConditional(this.vbool448_B, this.vbool182_uses_F[0]);
     // Message to 'vbool104_uses' from UsesEqualDef factor
     this.vbool104_uses_F[0] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool104_uses_B, this.vbool104_F, 0, this.vbool104_uses_F[0]);
     // Message to 'vbool108_uses' from AreEqual factor
     this.vbool108_uses_B[2] = BooleanAreEqualOp.AAverageConditional(this.vbool191_B, this.vbool104_uses_F[0]);
     // Message to 'vbool182_uses' from UsesEqualDef factor
     this.vbool182_uses_F[1] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool182_uses_B, this.vbool182_F, 1, this.vbool182_uses_F[1]);
     // Message to 'vbool160_uses' from AreEqual factor
     this.vbool160_uses_B[0] = BooleanAreEqualOp.BAverageConditional(this.vbool422_B, this.vbool182_uses_F[1]);
     // Message to 'vbool160_uses' from UsesEqualDef factor
     this.vbool160_uses_F[1] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool160_uses_B, this.vbool160_F, 1, this.vbool160_uses_F[1]);
     // Message to 'vbool156_uses' from AreEqual factor
     this.vbool156_uses_B[1] = BooleanAreEqualOp.BAverageConditional(this.vbool416_B, this.vbool160_uses_F[1]);
     // Message to 'vbool156_uses' from UsesEqualDef factor
     this.vbool156_uses_F[1] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool156_uses_B, this.vbool156_F, 1, this.vbool156_uses_F[1]);
     // Message to 'vbool160_uses' from AreEqual factor
     this.vbool160_uses_B[1] = BooleanAreEqualOp.AAverageConditional(this.vbool416_B, this.vbool156_uses_F[1]);
     // Message to 'vbool160_marginal' from UsesEqualDef factor
     this.vbool160_marginal_B = UsesEqualDefOp.MarginalAverageConditional<Bernoulli>(this.vbool160_uses_B, this.vbool160_F, this.vbool160_marginal_B);
     // Message to 'vbool416' from AreEqual factor
     this.vbool416_F = BooleanAreEqualOp.AreEqualAverageConditional(this.vbool160_uses_F[1], this.vbool156_uses_F[1]);
     // Message to 'vbool416_marginal' from ReplicateWithMarginal factor
     this.vbool416_marginal_B = ReplicateOp.MarginalAverageConditional<Bernoulli>(this.vbool416_uses_B, this.vbool416_F, this.vbool416_marginal_B);
     // Message to 'vbool160_uses' from UsesEqualDef factor
     this.vbool160_uses_F[0] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool160_uses_B, this.vbool160_F, 0, this.vbool160_uses_F[0]);
     // Message to 'vbool182_uses' from AreEqual factor
     this.vbool182_uses_B[1] = BooleanAreEqualOp.AAverageConditional(this.vbool422_B, this.vbool160_uses_F[0]);
     // Message to 'vbool422' from AreEqual factor
     this.vbool422_F = BooleanAreEqualOp.AreEqualAverageConditional(this.vbool182_uses_F[1], this.vbool160_uses_F[0]);
     // Message to 'vbool422_marginal' from ReplicateWithMarginal factor
     this.vbool422_marginal_B = ReplicateOp.MarginalAverageConditional<Bernoulli>(this.vbool422_uses_B, this.vbool422_F, this.vbool422_marginal_B);
     // Message to 'vbool182_uses' from UsesEqualDef factor
     this.vbool182_uses_F[2] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool182_uses_B, this.vbool182_F, 2, this.vbool182_uses_F[2]);
     // Message to 'vbool156_uses' from AreEqual factor
     this.vbool156_uses_B[0] = BooleanAreEqualOp.BAverageConditional(this.vbool443_B, this.vbool182_uses_F[2]);
     // Message to 'vbool156_marginal' from UsesEqualDef factor
     this.vbool156_marginal_B = UsesEqualDefOp.MarginalAverageConditional<Bernoulli>(this.vbool156_uses_B, this.vbool156_F, this.vbool156_marginal_B);
     // Message to 'vbool443' from AreEqual factor
     this.vbool443_F = BooleanAreEqualOp.AreEqualAverageConditional(this.vbool182_uses_F[2], this.vbool156_uses_F[0]);
     // Message to 'vbool443_marginal' from ReplicateWithMarginal factor
     this.vbool443_marginal_B = ReplicateOp.MarginalAverageConditional<Bernoulli>(this.vbool443_uses_B, this.vbool443_F, this.vbool443_marginal_B);
     // Message to 'vbool156_uses' from UsesEqualDef factor
     this.vbool156_uses_F[2] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool156_uses_B, this.vbool156_F, 2, this.vbool156_uses_F[2]);
     // Message to 'vbool91_uses' from AreEqual factor
     this.vbool91_uses_B[1] = BooleanAreEqualOp.AAverageConditional(this.vbool453_B, this.vbool156_uses_F[2]);
     // Message to 'vbool91_marginal' from UsesEqualDef factor
     this.vbool91_marginal_B = UsesEqualDefOp.MarginalAverageConditional<Bernoulli>(this.vbool91_uses_B, this.vbool91_F, this.vbool91_marginal_B);
     // Message to 'vbool453' from AreEqual factor
     this.vbool453_F = BooleanAreEqualOp.AreEqualAverageConditional(this.vbool91_uses_F[1], this.vbool156_uses_F[2]);
     // Message to 'vbool453_marginal' from ReplicateWithMarginal factor
     this.vbool453_marginal_B = ReplicateOp.MarginalAverageConditional<Bernoulli>(this.vbool453_uses_B, this.vbool453_F, this.vbool453_marginal_B);
     // Message to 'vbool91_uses' from UsesEqualDef factor
     this.vbool91_uses_F[0] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool91_uses_B, this.vbool91_F, 0, this.vbool91_uses_F[0]);
     // Message to 'vbool69_uses' from AreEqual factor
     this.vbool69_uses_B[1] = BooleanAreEqualOp.BAverageConditional(this.vbool212_B, this.vbool91_uses_F[0]);
     // Message to 'vbool69_marginal' from UsesEqualDef factor
     this.vbool69_marginal_B = UsesEqualDefOp.MarginalAverageConditional<Bernoulli>(this.vbool69_uses_B, this.vbool69_F, this.vbool69_marginal_B);
     // Message to 'vbool212' from AreEqual factor
     this.vbool212_F = BooleanAreEqualOp.AreEqualAverageConditional(this.vbool91_uses_F[0], this.vbool69_uses_F[1]);
     // Message to 'vbool212_marginal' from ReplicateWithMarginal factor
     this.vbool212_marginal_B = ReplicateOp.MarginalAverageConditional<Bernoulli>(this.vbool212_uses_B, this.vbool212_F, this.vbool212_marginal_B);
     // Message to 'vbool69_uses' from UsesEqualDef factor
     this.vbool69_uses_F[0] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool69_uses_B, this.vbool69_F, 0, this.vbool69_uses_F[0]);
     // Message to 'vbool64_uses' from AreEqual factor
     this.vbool64_uses_B[3] = BooleanAreEqualOp.AAverageConditional(this.vbool383_B, this.vbool69_uses_F[0]);
     // Message to 'vbool383' from AreEqual factor
     this.vbool383_F = BooleanAreEqualOp.AreEqualAverageConditional(this.vbool64_uses_F[3], this.vbool69_uses_F[0]);
     // Message to 'vbool383_marginal' from ReplicateWithMarginal factor
     this.vbool383_marginal_B = ReplicateOp.MarginalAverageConditional<Bernoulli>(this.vbool383_uses_B, this.vbool383_F, this.vbool383_marginal_B);
     // Message to 'vbool383_uses' from ReplicateWithMarginal factor
     this.vbool383_uses_F[0] = ReplicateOp.UsesAverageConditional<Bernoulli>(this.vbool383_uses_B, this.vbool383_F, 0, this.vbool383_uses_F[0]);
     // Message to 'vbool64_uses' from UsesEqualDef factor
     this.vbool64_uses_F[0] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool64_uses_B, this.vbool64_F, 0, this.vbool64_uses_F[0]);
     // Message to 'vbool142_uses' from AreEqual factor
     this.vbool142_uses_B[3] = BooleanAreEqualOp.BAverageConditional(this.vbool378_B, this.vbool64_uses_F[0]);
     // Message to 'vbool378' from AreEqual factor
     this.vbool378_F = BooleanAreEqualOp.AreEqualAverageConditional(this.vbool64_uses_F[0], this.vbool142_uses_F[3]);
     // Message to 'vbool378_marginal' from ReplicateWithMarginal factor
     this.vbool378_marginal_B = ReplicateOp.MarginalAverageConditional<Bernoulli>(this.vbool378_uses_B, this.vbool378_F, this.vbool378_marginal_B);
     // Message to 'vbool378_uses' from ReplicateWithMarginal factor
     this.vbool378_uses_F[0] = ReplicateOp.UsesAverageConditional<Bernoulli>(this.vbool378_uses_B, this.vbool378_F, 0, this.vbool378_uses_F[0]);
     // Message to 'vbool142_uses' from UsesEqualDef factor
     this.vbool142_uses_F[0] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool142_uses_B, this.vbool142_F, 0, this.vbool142_uses_F[0]);
     // Message to 'vbool142_uses' from UsesEqualDef factor
     this.vbool142_uses_F[1] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool142_uses_B, this.vbool142_F, 1, this.vbool142_uses_F[1]);
     // Message to 'vbool142_uses' from UsesEqualDef factor
     this.vbool142_uses_F[2] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool142_uses_B, this.vbool142_F, 2, this.vbool142_uses_F[2]);
     // Message to 'vbool142_marginal' from UsesEqualDef factor
     this.vbool142_marginal_B = UsesEqualDefOp.MarginalAverageConditional<Bernoulli>(this.vbool142_uses_B, this.vbool142_F, this.vbool142_marginal_B);
     // Message to 'vbool64_uses' from UsesEqualDef factor
     this.vbool64_uses_F[2] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool64_uses_B, this.vbool64_F, 2, this.vbool64_uses_F[2]);
     // Message to 'vbool43_uses' from AreEqual factor
     this.vbool43_uses_B[0] = BooleanAreEqualOp.BAverageConditional(this.vbool207_B, this.vbool64_uses_F[2]);
     // Message to 'vbool43_marginal' from UsesEqualDef factor
     this.vbool43_marginal_B = UsesEqualDefOp.MarginalAverageConditional<Bernoulli>(this.vbool43_uses_B, this.vbool43_F, this.vbool43_marginal_B);
     // Message to 'vbool207' from AreEqual factor
     this.vbool207_F = BooleanAreEqualOp.AreEqualAverageConditional(this.vbool64_uses_F[2], this.vbool43_uses_F[0]);
     // Message to 'vbool207_marginal' from ReplicateWithMarginal factor
     this.vbool207_marginal_B = ReplicateOp.MarginalAverageConditional<Bernoulli>(this.vbool207_uses_B, this.vbool207_F, this.vbool207_marginal_B);
     // Message to 'vbool43_uses' from UsesEqualDef factor
     this.vbool43_uses_F[1] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool43_uses_B, this.vbool43_F, 1, this.vbool43_uses_F[1]);
     // Message to 'vbool12_uses' from AreEqual factor
     this.vbool12_uses_B[0] = BooleanAreEqualOp.BAverageConditional(this.vbool186_B, this.vbool43_uses_F[1]);
     // Message to 'vbool12_marginal' from UsesEqualDef factor
     this.vbool12_marginal_B = UsesEqualDefOp.MarginalAverageConditional<Bernoulli>(this.vbool12_uses_B, this.vbool12_F, this.vbool12_marginal_B);
     // Message to 'vbool186' from AreEqual factor
     this.vbool186_F = BooleanAreEqualOp.AreEqualAverageConditional(this.vbool43_uses_F[1], this.vbool12_uses_F[0]);
     // Message to 'vbool186_marginal' from ReplicateWithMarginal factor
     this.vbool186_marginal_B = ReplicateOp.MarginalAverageConditional<Bernoulli>(this.vbool186_uses_B, this.vbool186_F, this.vbool186_marginal_B);
     // Message to 'vbool12_uses' from UsesEqualDef factor
     this.vbool12_uses_F[1] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool12_uses_B, this.vbool12_F, 1, this.vbool12_uses_F[1]);
     // Message to 'vbool38_uses' from AreEqual factor
     this.vbool38_uses_B[1] = BooleanAreEqualOp.AAverageConditional(this.vbool412_B, this.vbool12_uses_F[1]);
     // Message to 'vbool38_marginal' from UsesEqualDef factor
     this.vbool38_marginal_B = UsesEqualDefOp.MarginalAverageConditional<Bernoulli>(this.vbool38_uses_B, this.vbool38_F, this.vbool38_marginal_B);
     // Message to 'vbool412' from AreEqual factor
     this.vbool412_F = BooleanAreEqualOp.AreEqualAverageConditional(this.vbool38_uses_F[1], this.vbool12_uses_F[1]);
     // Message to 'vbool412_marginal' from ReplicateWithMarginal factor
     this.vbool412_marginal_B = ReplicateOp.MarginalAverageConditional<Bernoulli>(this.vbool412_uses_B, this.vbool412_F, this.vbool412_marginal_B);
     // Message to 'vbool38_uses' from UsesEqualDef factor
     this.vbool38_uses_F[0] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool38_uses_B, this.vbool38_F, 0, this.vbool38_uses_F[0]);
     // Message to 'vbool17_uses' from AreEqual factor
     this.vbool17_uses_B[1] = BooleanAreEqualOp.BAverageConditional(this.vbool202_B, this.vbool38_uses_F[0]);
     // Message to 'vbool17_marginal' from UsesEqualDef factor
     this.vbool17_marginal_B = UsesEqualDefOp.MarginalAverageConditional<Bernoulli>(this.vbool17_uses_B, this.vbool17_F, this.vbool17_marginal_B);
     // Message to 'vbool202' from AreEqual factor
     this.vbool202_F = BooleanAreEqualOp.AreEqualAverageConditional(this.vbool38_uses_F[0], this.vbool17_uses_F[1]);
     // Message to 'vbool202_marginal' from ReplicateWithMarginal factor
     this.vbool202_marginal_B = ReplicateOp.MarginalAverageConditional<Bernoulli>(this.vbool202_uses_B, this.vbool202_F, this.vbool202_marginal_B);
     // Message to 'vbool17_uses' from UsesEqualDef factor
     this.vbool17_uses_F[0] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool17_uses_B, this.vbool17_F, 0, this.vbool17_uses_F[0]);
     // Message to 'vbool142_uses' from AreEqual factor
     this.vbool142_uses_B[4] = BooleanAreEqualOp.BAverageConditional(this.vbool196_B, this.vbool17_uses_F[0]);
     // Message to 'vbool196' from AreEqual factor
     this.vbool196_F = BooleanAreEqualOp.AreEqualAverageConditional(this.vbool17_uses_F[0], this.vbool142_uses_F[4]);
     // Message to 'vbool196_marginal' from ReplicateWithMarginal factor
     this.vbool196_marginal_B = ReplicateOp.MarginalAverageConditional<Bernoulli>(this.vbool196_uses_B, this.vbool196_F, this.vbool196_marginal_B);
     // Message to 'vbool64_marginal' from UsesEqualDef factor
     this.vbool64_marginal_B = UsesEqualDefOp.MarginalAverageConditional<Bernoulli>(this.vbool64_uses_B, this.vbool64_F, this.vbool64_marginal_B);
     // Message to 'vbool182_marginal' from UsesEqualDef factor
     this.vbool182_marginal_B = UsesEqualDefOp.MarginalAverageConditional<Bernoulli>(this.vbool182_uses_B, this.vbool182_F, this.vbool182_marginal_B);
     // Message to 'vbool269' from And factor
     this.vbool269_F = BooleanAndOp.AndAverageConditional(this.vbool142_uses_F[0], this.vbool110_uses_F[6]);
     // Message to 'vbool269_marginal' from ReplicateWithMarginal factor
     this.vbool269_marginal_B = ReplicateOp.MarginalAverageConditional<Bernoulli>(this.vbool269_uses_B, this.vbool269_F, this.vbool269_marginal_B);
     // Message to 'vbool269_uses' from ReplicateWithMarginal factor
     this.vbool269_uses_F[0] = ReplicateOp.UsesAverageConditional<Bernoulli>(this.vbool269_uses_B, this.vbool269_F, 0, this.vbool269_uses_F[0]);
     // Message to 'vbool266' from And factor
     this.vbool266_F = BooleanAndOp.AndAverageConditional(this.vbool142_uses_F[1], this.vbool108_uses_F[5]);
     // Message to 'vbool266_marginal' from ReplicateWithMarginal factor
     this.vbool266_marginal_B = ReplicateOp.MarginalAverageConditional<Bernoulli>(this.vbool266_uses_B, this.vbool266_F, this.vbool266_marginal_B);
     // Message to 'vbool266_uses' from ReplicateWithMarginal factor
     this.vbool266_uses_F[0] = ReplicateOp.UsesAverageConditional<Bernoulli>(this.vbool266_uses_B, this.vbool266_F, 0, this.vbool266_uses_F[0]);
     // Message to 'vbool113_uses' from And factor
     this.vbool113_uses_B[5] = BooleanAndOp.BAverageConditional(this.vbool267_B, this.vbool266_uses_F[0]);
     // Message to 'vbool272' from And factor
     this.vbool272_F = BooleanAndOp.AndAverageConditional(this.vbool142_uses_F[2], this.vbool108_uses_F[6]);
     // Message to 'vbool272_marginal' from ReplicateWithMarginal factor
     this.vbool272_marginal_B = ReplicateOp.MarginalAverageConditional<Bernoulli>(this.vbool272_uses_B, this.vbool272_F, this.vbool272_marginal_B);
     // Message to 'vbool272_uses' from ReplicateWithMarginal factor
     this.vbool272_uses_F[0] = ReplicateOp.UsesAverageConditional<Bernoulli>(this.vbool272_uses_B, this.vbool272_F, 0, this.vbool272_uses_F[0]);
     // Message to 'vbool273' from And factor
     this.vbool273_F = BooleanAndOp.AndAverageConditional(this.vbool272_uses_F[0], this.vbool115_uses_F[7]);
     // Message to 'vbool273_marginal' from ReplicateWithMarginal factor
     this.vbool273_marginal_B = ReplicateOp.MarginalAverageConditional<Bernoulli>(this.vbool273_uses_B, this.vbool273_F, this.vbool273_marginal_B);
     // Message to 'vbool273_uses' from ReplicateWithMarginal factor
     this.vbool273_uses_F[0] = ReplicateOp.UsesAverageConditional<Bernoulli>(this.vbool273_uses_B, this.vbool273_F, 0, this.vbool273_uses_F[0]);
     // Message to 'vbool270' from And factor
     this.vbool270_F = BooleanAndOp.AndAverageConditional(this.vbool269_uses_F[0], this.vbool113_uses_F[3]);
     // Message to 'vbool270_marginal' from ReplicateWithMarginal factor
     this.vbool270_marginal_B = ReplicateOp.MarginalAverageConditional<Bernoulli>(this.vbool270_uses_B, this.vbool270_F, this.vbool270_marginal_B);
     // Message to 'vbool270_uses' from ReplicateWithMarginal factor
     this.vbool270_uses_F[0] = ReplicateOp.UsesAverageConditional<Bernoulli>(this.vbool270_uses_B, this.vbool270_F, 0, this.vbool270_uses_F[0]);
     // Message to 'vbool267' from And factor
     this.vbool267_F = BooleanAndOp.AndAverageConditional(this.vbool266_uses_F[0], this.vbool113_uses_F[5]);
     // Message to 'vbool267_marginal' from ReplicateWithMarginal factor
     this.vbool267_marginal_B = ReplicateOp.MarginalAverageConditional<Bernoulli>(this.vbool267_uses_B, this.vbool267_F, this.vbool267_marginal_B);
     // Message to 'vbool267_uses' from ReplicateWithMarginal factor
     this.vbool267_uses_F[0] = ReplicateOp.UsesAverageConditional<Bernoulli>(this.vbool267_uses_B, this.vbool267_F, 0, this.vbool267_uses_F[0]);
     // Message to 'vbool265_uses' from Or factor
     this.vbool265_uses_B[0] = BooleanOrOp.BAverageConditional(this.vbool268_B, this.vbool267_uses_F[0]);
     // Message to 'vbool265_marginal' from ReplicateWithMarginal factor
     this.vbool265_marginal_B = ReplicateOp.MarginalAverageConditional<Bernoulli>(this.vbool265_uses_B, this.vbool265_F, this.vbool265_marginal_B);
     // Message to 'vbool265' from ReplicateWithMarginal factor
     this.vbool265_B = ReplicateOp.DefAverageConditional<Bernoulli>(this.vbool265_uses_B, this.vbool265_B);
     // Message to 'vbool264_uses' from Or factor
     this.vbool264_uses_B[0] = BooleanOrOp.AAverageConditional(this.vbool265_B, this.vbool262_uses_F[0]);
     // Message to 'vbool264' from ReplicateWithMarginal factor
     this.vbool264_B = ReplicateOp.DefAverageConditional<Bernoulli>(this.vbool264_uses_B, this.vbool264_B);
     // Message to 'vbool115_uses' from And factor
     this.vbool115_uses_B[6] = BooleanAndOp.BAverageConditional(this.vbool264_B, this.vbool263_uses_F[0]);
     // Message to 'vbool263_uses' from And factor
     this.vbool263_uses_B[0] = BooleanAndOp.AAverageConditional(this.vbool264_B, this.vbool115_uses_F[6]);
     // Message to 'vbool263' from ReplicateWithMarginal factor
     this.vbool263_B = ReplicateOp.DefAverageConditional<Bernoulli>(this.vbool263_uses_B, this.vbool263_B);
     // Message to 'vbool109_uses' from And factor
     this.vbool109_uses_B[4] = BooleanAndOp.BAverageConditional(this.vbool263_B, this.vbool141_uses_F[6]);
     // Message to 'vbool141_uses' from And factor
     this.vbool141_uses_B[6] = BooleanAndOp.AAverageConditional(this.vbool263_B, this.vbool109_uses_F[4]);
     // Message to 'vbool262_uses' from Or factor
     this.vbool262_uses_B[0] = BooleanOrOp.BAverageConditional(this.vbool265_B, this.vbool264_uses_F[0]);
     // Message to 'vbool262_marginal' from ReplicateWithMarginal factor
     this.vbool262_marginal_B = ReplicateOp.MarginalAverageConditional<Bernoulli>(this.vbool262_uses_B, this.vbool262_F, this.vbool262_marginal_B);
     // Message to 'vbool262' from ReplicateWithMarginal factor
     this.vbool262_B = ReplicateOp.DefAverageConditional<Bernoulli>(this.vbool262_uses_B, this.vbool262_B);
     // Message to 'vbool261_uses' from Or factor
     this.vbool261_uses_B[0] = BooleanOrOp.AAverageConditional(this.vbool262_B, this.vbool259_uses_F[0]);
     // Message to 'vbool261' from ReplicateWithMarginal factor
     this.vbool261_B = ReplicateOp.DefAverageConditional<Bernoulli>(this.vbool261_uses_B, this.vbool261_B);
     // Message to 'vbool260_uses' from And factor
     this.vbool260_uses_B[0] = BooleanAndOp.AAverageConditional(this.vbool261_B, this.vbool114_uses_F[2]);
     // Message to 'vbool260' from ReplicateWithMarginal factor
     this.vbool260_B = ReplicateOp.DefAverageConditional<Bernoulli>(this.vbool260_uses_B, this.vbool260_B);
     // Message to 'vbool110_uses' from And factor
     this.vbool110_uses_B[5] = BooleanAndOp.BAverageConditional(this.vbool260_B, this.vbool141_uses_F[2]);
     // Message to 'vbool141_uses' from And factor
     this.vbool141_uses_B[2] = BooleanAndOp.AAverageConditional(this.vbool260_B, this.vbool110_uses_F[5]);
     // Message to 'vbool114_uses' from And factor
     this.vbool114_uses_B[2] = BooleanAndOp.BAverageConditional(this.vbool261_B, this.vbool260_uses_F[0]);
     // Message to 'vbool259_uses' from Or factor
     this.vbool259_uses_B[0] = BooleanOrOp.BAverageConditional(this.vbool262_B, this.vbool261_uses_F[0]);
     // Message to 'vbool259_marginal' from ReplicateWithMarginal factor
     this.vbool259_marginal_B = ReplicateOp.MarginalAverageConditional<Bernoulli>(this.vbool259_uses_B, this.vbool259_F, this.vbool259_marginal_B);
     // Message to 'vbool259' from ReplicateWithMarginal factor
     this.vbool259_B = ReplicateOp.DefAverageConditional<Bernoulli>(this.vbool259_uses_B, this.vbool259_B);
     // Message to 'vbool258_uses' from Or factor
     this.vbool258_uses_B[0] = BooleanOrOp.AAverageConditional(this.vbool259_B, this.vbool256_uses_F[0]);
     // Message to 'vbool258' from ReplicateWithMarginal factor
     this.vbool258_B = ReplicateOp.DefAverageConditional<Bernoulli>(this.vbool258_uses_B, this.vbool258_B);
     // Message to 'vbool257_uses' from And factor
     this.vbool257_uses_B[0] = BooleanAndOp.AAverageConditional(this.vbool258_B, this.vbool114_uses_F[4]);
     // Message to 'vbool257' from ReplicateWithMarginal factor
     this.vbool257_B = ReplicateOp.DefAverageConditional<Bernoulli>(this.vbool257_uses_B, this.vbool257_B);
     // Message to 'vbool109_uses' from And factor
     this.vbool109_uses_B[3] = BooleanAndOp.BAverageConditional(this.vbool257_B, this.vbool141_uses_F[5]);
     // Message to 'vbool109_uses' from UsesEqualDef factor
     this.vbool109_uses_F[0] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool109_uses_B, this.vbool109_F, 0, this.vbool109_uses_F[0]);
     // Message to 'vbool109_uses' from UsesEqualDef factor
     this.vbool109_uses_F[1] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool109_uses_B, this.vbool109_F, 1, this.vbool109_uses_F[1]);
     // Message to 'vbool233' from And factor
     this.vbool233_F = BooleanAndOp.AndAverageConditional(this.vbool145_uses_F[8], this.vbool109_uses_F[0]);
     // Message to 'vbool233_uses' from ReplicateWithMarginal factor
     this.vbool233_uses_F[0] = ReplicateOp.UsesAverageConditional<Bernoulli>(this.vbool233_uses_B, this.vbool233_F, 0, this.vbool233_uses_F[0]);
     // Message to 'vbool239' from And factor
     this.vbool239_F = BooleanAndOp.AndAverageConditional(this.vbool145_uses_F[10], this.vbool109_uses_F[1]);
     // Message to 'vbool239_uses' from ReplicateWithMarginal factor
     this.vbool239_uses_F[0] = ReplicateOp.UsesAverageConditional<Bernoulli>(this.vbool239_uses_B, this.vbool239_F, 0, this.vbool239_uses_F[0]);
     // Message to 'vbool141_uses' from And factor
     this.vbool141_uses_B[5] = BooleanAndOp.AAverageConditional(this.vbool257_B, this.vbool109_uses_F[3]);
     // Message to 'vbool114_uses' from And factor
     this.vbool114_uses_B[4] = BooleanAndOp.BAverageConditional(this.vbool258_B, this.vbool257_uses_F[0]);
     // Message to 'vbool114_uses' from UsesEqualDef factor
     this.vbool114_uses_F[0] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool114_uses_B, this.vbool114_F, 0, this.vbool114_uses_F[0]);
     // Message to 'vbool234' from And factor
     this.vbool234_F = BooleanAndOp.AndAverageConditional(this.vbool233_uses_F[0], this.vbool114_uses_F[0]);
     // Message to 'vbool234_uses' from ReplicateWithMarginal factor
     this.vbool234_uses_F[0] = ReplicateOp.UsesAverageConditional<Bernoulli>(this.vbool234_uses_B, this.vbool234_F, 0, this.vbool234_uses_F[0]);
     // Message to 'vbool114_uses' from UsesEqualDef factor
     this.vbool114_uses_F[1] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool114_uses_B, this.vbool114_F, 1, this.vbool114_uses_F[1]);
     // Message to 'vbool237' from And factor
     this.vbool237_F = BooleanAndOp.AndAverageConditional(this.vbool236_uses_F[0], this.vbool114_uses_F[1]);
     // Message to 'vbool237_uses' from ReplicateWithMarginal factor
     this.vbool237_uses_F[0] = ReplicateOp.UsesAverageConditional<Bernoulli>(this.vbool237_uses_B, this.vbool237_F, 0, this.vbool237_uses_F[0]);
     // Message to 'vbool240' from And factor
     this.vbool240_F = BooleanAndOp.AndAverageConditional(this.vbool239_uses_F[0], this.vbool115_uses_F[2]);
     // Message to 'vbool240_uses' from ReplicateWithMarginal factor
     this.vbool240_uses_F[0] = ReplicateOp.UsesAverageConditional<Bernoulli>(this.vbool240_uses_B, this.vbool240_F, 0, this.vbool240_uses_F[0]);
     // Message to 'vbool256_uses' from Or factor
     this.vbool256_uses_B[0] = BooleanOrOp.BAverageConditional(this.vbool259_B, this.vbool258_uses_F[0]);
     // Message to 'vbool256_marginal' from ReplicateWithMarginal factor
     this.vbool256_marginal_B = ReplicateOp.MarginalAverageConditional<Bernoulli>(this.vbool256_uses_B, this.vbool256_F, this.vbool256_marginal_B);
     // Message to 'vbool256' from ReplicateWithMarginal factor
     this.vbool256_B = ReplicateOp.DefAverageConditional<Bernoulli>(this.vbool256_uses_B, this.vbool256_B);
     // Message to 'vbool255_uses' from Or factor
     this.vbool255_uses_B[0] = BooleanOrOp.AAverageConditional(this.vbool256_B, this.vbool253_uses_F[0]);
     // Message to 'vbool255' from ReplicateWithMarginal factor
     this.vbool255_B = ReplicateOp.DefAverageConditional<Bernoulli>(this.vbool255_uses_B, this.vbool255_B);
     // Message to 'vbool254_uses' from And factor
     this.vbool254_uses_B[0] = BooleanAndOp.AAverageConditional(this.vbool255_B, this.vbool113_uses_F[2]);
     // Message to 'vbool254' from ReplicateWithMarginal factor
     this.vbool254_B = ReplicateOp.DefAverageConditional<Bernoulli>(this.vbool254_uses_B, this.vbool254_B);
     // Message to 'vbool110_uses' from And factor
     this.vbool110_uses_B[4] = BooleanAndOp.BAverageConditional(this.vbool254_B, this.vbool141_uses_F[1]);
     // Message to 'vbool141_uses' from And factor
     this.vbool141_uses_B[1] = BooleanAndOp.AAverageConditional(this.vbool254_B, this.vbool110_uses_F[4]);
     // Message to 'vbool113_uses' from And factor
     this.vbool113_uses_B[2] = BooleanAndOp.BAverageConditional(this.vbool255_B, this.vbool254_uses_F[0]);
     // Message to 'vbool253_uses' from Or factor
     this.vbool253_uses_B[0] = BooleanOrOp.BAverageConditional(this.vbool256_B, this.vbool255_uses_F[0]);
     // Message to 'vbool253_marginal' from ReplicateWithMarginal factor
     this.vbool253_marginal_B = ReplicateOp.MarginalAverageConditional<Bernoulli>(this.vbool253_uses_B, this.vbool253_F, this.vbool253_marginal_B);
     // Message to 'vbool253' from ReplicateWithMarginal factor
     this.vbool253_B = ReplicateOp.DefAverageConditional<Bernoulli>(this.vbool253_uses_B, this.vbool253_B);
     // Message to 'vbool252_uses' from Or factor
     this.vbool252_uses_B[0] = BooleanOrOp.AAverageConditional(this.vbool253_B, this.vbool250_uses_F[0]);
     // Message to 'vbool252' from ReplicateWithMarginal factor
     this.vbool252_B = ReplicateOp.DefAverageConditional<Bernoulli>(this.vbool252_uses_B, this.vbool252_B);
     // Message to 'vbool115_uses' from And factor
     this.vbool115_uses_B[5] = BooleanAndOp.BAverageConditional(this.vbool252_B, this.vbool251_uses_F[0]);
     // Message to 'vbool251_uses' from And factor
     this.vbool251_uses_B[0] = BooleanAndOp.AAverageConditional(this.vbool252_B, this.vbool115_uses_F[5]);
     // Message to 'vbool251' from ReplicateWithMarginal factor
     this.vbool251_B = ReplicateOp.DefAverageConditional<Bernoulli>(this.vbool251_uses_B, this.vbool251_B);
     // Message to 'vbool108_uses' from And factor
     this.vbool108_uses_B[4] = BooleanAndOp.BAverageConditional(this.vbool251_B, this.vbool141_uses_F[4]);
     // Message to 'vbool141_uses' from And factor
     this.vbool141_uses_B[4] = BooleanAndOp.AAverageConditional(this.vbool251_B, this.vbool108_uses_F[4]);
     // Message to 'vbool250_uses' from Or factor
     this.vbool250_uses_B[0] = BooleanOrOp.BAverageConditional(this.vbool253_B, this.vbool252_uses_F[0]);
     // Message to 'vbool250_marginal' from ReplicateWithMarginal factor
     this.vbool250_marginal_B = ReplicateOp.MarginalAverageConditional<Bernoulli>(this.vbool250_uses_B, this.vbool250_F, this.vbool250_marginal_B);
     // Message to 'vbool250' from ReplicateWithMarginal factor
     this.vbool250_B = ReplicateOp.DefAverageConditional<Bernoulli>(this.vbool250_uses_B, this.vbool250_B);
     // Message to 'vbool249_uses' from Or factor
     this.vbool249_uses_B[0] = BooleanOrOp.AAverageConditional(this.vbool250_B, this.vbool247_uses_F[0]);
     // Message to 'vbool249' from ReplicateWithMarginal factor
     this.vbool249_B = ReplicateOp.DefAverageConditional<Bernoulli>(this.vbool249_uses_B, this.vbool249_B);
     // Message to 'vbool248_uses' from And factor
     this.vbool248_uses_B[0] = BooleanAndOp.AAverageConditional(this.vbool249_B, this.vbool113_uses_F[4]);
     // Message to 'vbool248' from ReplicateWithMarginal factor
     this.vbool248_B = ReplicateOp.DefAverageConditional<Bernoulli>(this.vbool248_uses_B, this.vbool248_B);
     // Message to 'vbool108_uses' from And factor
     this.vbool108_uses_B[3] = BooleanAndOp.BAverageConditional(this.vbool248_B, this.vbool141_uses_F[3]);
     // Message to 'vbool108_uses' from UsesEqualDef factor
     this.vbool108_uses_F[0] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool108_uses_B, this.vbool108_F, 0, this.vbool108_uses_F[0]);
     // Message to 'vbool108_uses' from UsesEqualDef factor
     this.vbool108_uses_F[1] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool108_uses_B, this.vbool108_F, 1, this.vbool108_uses_F[1]);
     // Message to 'vbool224' from And factor
     this.vbool224_F = BooleanAndOp.AndAverageConditional(this.vbool145_uses_F[5], this.vbool108_uses_F[0]);
     // Message to 'vbool224_uses' from ReplicateWithMarginal factor
     this.vbool224_uses_F[0] = ReplicateOp.UsesAverageConditional<Bernoulli>(this.vbool224_uses_B, this.vbool224_F, 0, this.vbool224_uses_F[0]);
     // Message to 'vbool227' from And factor
     this.vbool227_F = BooleanAndOp.AndAverageConditional(this.vbool145_uses_F[6], this.vbool108_uses_F[1]);
     // Message to 'vbool227_uses' from ReplicateWithMarginal factor
     this.vbool227_uses_F[0] = ReplicateOp.UsesAverageConditional<Bernoulli>(this.vbool227_uses_B, this.vbool227_F, 0, this.vbool227_uses_F[0]);
     // Message to 'vbool141_uses' from And factor
     this.vbool141_uses_B[3] = BooleanAndOp.AAverageConditional(this.vbool248_B, this.vbool108_uses_F[3]);
     // Message to 'vbool113_uses' from And factor
     this.vbool113_uses_B[4] = BooleanAndOp.BAverageConditional(this.vbool249_B, this.vbool248_uses_F[0]);
     // Message to 'vbool113_uses' from UsesEqualDef factor
     this.vbool113_uses_F[0] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool113_uses_B, this.vbool113_F, 0, this.vbool113_uses_F[0]);
     // Message to 'vbool225' from And factor
     this.vbool225_F = BooleanAndOp.AndAverageConditional(this.vbool224_uses_F[0], this.vbool113_uses_F[0]);
     // Message to 'vbool225_uses' from ReplicateWithMarginal factor
     this.vbool225_uses_F[0] = ReplicateOp.UsesAverageConditional<Bernoulli>(this.vbool225_uses_B, this.vbool225_F, 0, this.vbool225_uses_F[0]);
     // Message to 'vbool113_uses' from UsesEqualDef factor
     this.vbool113_uses_F[1] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool113_uses_B, this.vbool113_F, 1, this.vbool113_uses_F[1]);
     // Message to 'vbool228' from And factor
     this.vbool228_F = BooleanAndOp.AndAverageConditional(this.vbool227_uses_F[0], this.vbool115_uses_F[1]);
     // Message to 'vbool228_uses' from ReplicateWithMarginal factor
     this.vbool228_uses_F[0] = ReplicateOp.UsesAverageConditional<Bernoulli>(this.vbool228_uses_B, this.vbool228_F, 0, this.vbool228_uses_F[0]);
     // Message to 'vbool231' from And factor
     this.vbool231_F = BooleanAndOp.AndAverageConditional(this.vbool230_uses_F[0], this.vbool113_uses_F[1]);
     // Message to 'vbool231_uses' from ReplicateWithMarginal factor
     this.vbool231_uses_F[0] = ReplicateOp.UsesAverageConditional<Bernoulli>(this.vbool231_uses_B, this.vbool231_F, 0, this.vbool231_uses_F[0]);
     // Message to 'vbool247_uses' from Or factor
     this.vbool247_uses_B[0] = BooleanOrOp.BAverageConditional(this.vbool250_B, this.vbool249_uses_F[0]);
     // Message to 'vbool247_marginal' from ReplicateWithMarginal factor
     this.vbool247_marginal_B = ReplicateOp.MarginalAverageConditional<Bernoulli>(this.vbool247_uses_B, this.vbool247_F, this.vbool247_marginal_B);
     // Message to 'vbool247' from ReplicateWithMarginal factor
     this.vbool247_B = ReplicateOp.DefAverageConditional<Bernoulli>(this.vbool247_uses_B, this.vbool247_B);
     // Message to 'vbool246_uses' from Or factor
     this.vbool246_uses_B[0] = BooleanOrOp.AAverageConditional(this.vbool247_B, this.vbool244_uses_F[0]);
     // Message to 'vbool246' from ReplicateWithMarginal factor
     this.vbool246_B = ReplicateOp.DefAverageConditional<Bernoulli>(this.vbool246_uses_B, this.vbool246_B);
     // Message to 'vbool112_uses' from And factor
     this.vbool112_uses_B[1] = BooleanAndOp.BAverageConditional(this.vbool246_B, this.vbool245_uses_F[0]);
     // Message to 'vbool112_uses' from UsesEqualDef factor
     this.vbool112_uses_F[0] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool112_uses_B, this.vbool112_F, 0, this.vbool112_uses_F[0]);
     // Message to 'vbool112_uses' from UsesEqualDef factor
     this.vbool112_uses_F[2] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool112_uses_B, this.vbool112_F, 2, this.vbool112_uses_F[2]);
     // Message to 'vbool63_uses' from AreEqual factor
     this.vbool63_uses_B[1] = BooleanAreEqualOp.AAverageConditional(this.vbool373_B, this.vbool112_uses_F[2]);
     // Message to 'vbool222' from And factor
     this.vbool222_F = BooleanAndOp.AndAverageConditional(this.vbool221_uses_F[0], this.vbool112_uses_F[0]);
     // Message to 'vbool222_uses' from ReplicateWithMarginal factor
     this.vbool222_uses_F[0] = ReplicateOp.UsesAverageConditional<Bernoulli>(this.vbool222_uses_B, this.vbool222_F, 0, this.vbool222_uses_F[0]);
     // Message to 'vbool245_uses' from And factor
     this.vbool245_uses_B[0] = BooleanAndOp.AAverageConditional(this.vbool246_B, this.vbool112_uses_F[1]);
     // Message to 'vbool245' from ReplicateWithMarginal factor
     this.vbool245_B = ReplicateOp.DefAverageConditional<Bernoulli>(this.vbool245_uses_B, this.vbool245_B);
     // Message to 'vbool141_uses' from And factor
     this.vbool141_uses_B[9] = BooleanAndOp.AAverageConditional(this.vbool245_B, this.vbool115_uses_F[3]);
     // Message to 'vbool141_uses' from UsesEqualDef factor
     this.vbool141_uses_F[0] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool141_uses_B, this.vbool141_F, 0, this.vbool141_uses_F[0]);
     // Message to 'vbool141_uses' from UsesEqualDef factor
     this.vbool141_uses_F[7] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool141_uses_B, this.vbool141_F, 7, this.vbool141_uses_F[7]);
     // Message to 'vbool63_uses' from AreEqual factor
     this.vbool63_uses_B[0] = BooleanAreEqualOp.AAverageConditional(this.vbool370_B, this.vbool141_uses_F[7]);
     // Message to 'vbool63_uses' from UsesEqualDef factor
     this.vbool63_uses_F[2] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool63_uses_B, this.vbool63_F, 2, this.vbool63_uses_F[2]);
     // Message to 'vbool42_uses' from AreEqual factor
     this.vbool42_uses_B[0] = BooleanAreEqualOp.BAverageConditional(this.vbool206_B, this.vbool63_uses_F[2]);
     // Message to 'vbool42_uses' from UsesEqualDef factor
     this.vbool42_uses_F[1] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool42_uses_B, this.vbool42_F, 1, this.vbool42_uses_F[1]);
     // Message to 'vbool11_uses' from AreEqual factor
     this.vbool11_uses_B[0] = BooleanAreEqualOp.BAverageConditional(this.vbool185_B, this.vbool42_uses_F[1]);
     // Message to 'vbool11_uses' from UsesEqualDef factor
     this.vbool11_uses_F[1] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool11_uses_B, this.vbool11_F, 1, this.vbool11_uses_F[1]);
     // Message to 'vbool37_uses' from AreEqual factor
     this.vbool37_uses_B[1] = BooleanAreEqualOp.AAverageConditional(this.vbool411_B, this.vbool11_uses_F[1]);
     // Message to 'vbool37_uses' from UsesEqualDef factor
     this.vbool37_uses_F[0] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool37_uses_B, this.vbool37_F, 0, this.vbool37_uses_F[0]);
     // Message to 'vbool16_uses' from AreEqual factor
     this.vbool16_uses_B[1] = BooleanAreEqualOp.BAverageConditional(this.vbool201_B, this.vbool37_uses_F[0]);
     // Message to 'vbool16_uses' from UsesEqualDef factor
     this.vbool16_uses_F[0] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool16_uses_B, this.vbool16_F, 0, this.vbool16_uses_F[0]);
     // Message to 'vbool141_uses' from AreEqual factor
     this.vbool141_uses_B[8] = BooleanAreEqualOp.BAverageConditional(this.vbool195_B, this.vbool16_uses_F[0]);
     // Message to 'vbool63_uses' from UsesEqualDef factor
     this.vbool63_uses_F[3] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool63_uses_B, this.vbool63_F, 3, this.vbool63_uses_F[3]);
     // Message to 'vbool68_uses' from AreEqual factor
     this.vbool68_uses_B[0] = BooleanAreEqualOp.BAverageConditional(this.vbool375_B, this.vbool63_uses_F[3]);
     // Message to 'vbool68_uses' from UsesEqualDef factor
     this.vbool68_uses_F[1] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool68_uses_B, this.vbool68_F, 1, this.vbool68_uses_F[1]);
     // Message to 'vbool89_uses' from AreEqual factor
     this.vbool89_uses_B[0] = BooleanAreEqualOp.AAverageConditional(this.vbool211_B, this.vbool68_uses_F[1]);
     // Message to 'vbool89_uses' from UsesEqualDef factor
     this.vbool89_uses_F[1] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool89_uses_B, this.vbool89_F, 1, this.vbool89_uses_F[1]);
     // Message to 'vbool154_uses' from AreEqual factor
     this.vbool154_uses_B[2] = BooleanAreEqualOp.BAverageConditional(this.vbool452_B, this.vbool89_uses_F[1]);
     // Message to 'vbool154_uses' from UsesEqualDef factor
     this.vbool154_uses_F[0] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool154_uses_B, this.vbool154_F, 0, this.vbool154_uses_F[0]);
     // Message to 'vbool180_uses' from AreEqual factor
     this.vbool180_uses_B[2] = BooleanAreEqualOp.AAverageConditional(this.vbool442_B, this.vbool154_uses_F[0]);
     // Message to 'vbool180_uses' from UsesEqualDef factor
     this.vbool180_uses_F[0] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool180_uses_B, this.vbool180_F, 0, this.vbool180_uses_F[0]);
     // Message to 'vbool102_uses' from AreEqual factor
     this.vbool102_uses_B[1] = BooleanAreEqualOp.AAverageConditional(this.vbool447_B, this.vbool180_uses_F[0]);
     // Message to 'vbool102_uses' from UsesEqualDef factor
     this.vbool102_uses_F[0] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool102_uses_B, this.vbool102_F, 0, this.vbool102_uses_F[0]);
     // Message to 'vbool107_uses' from AreEqual factor
     this.vbool107_uses_B[1] = BooleanAreEqualOp.AAverageConditional(this.vbool190_B, this.vbool102_uses_F[0]);
     // Message to 'vbool107_uses' from UsesEqualDef factor
     this.vbool107_uses_F[0] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool107_uses_B, this.vbool107_F, 0, this.vbool107_uses_F[0]);
     // Message to 'vbool107_uses' from UsesEqualDef factor
     this.vbool107_uses_F[2] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool107_uses_B, this.vbool107_F, 2, this.vbool107_uses_F[2]);
     // Message to 'vbool242' from And factor
     this.vbool242_F = BooleanAndOp.AndAverageConditional(this.vbool141_uses_F[0], this.vbool107_uses_F[2]);
     // Message to 'vbool242_uses' from ReplicateWithMarginal factor
     this.vbool242_uses_F[0] = ReplicateOp.UsesAverageConditional<Bernoulli>(this.vbool242_uses_B, this.vbool242_F, 0, this.vbool242_uses_F[0]);
     // Message to 'vbool180_uses' from UsesEqualDef factor
     this.vbool180_uses_F[1] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool180_uses_B, this.vbool180_F, 1, this.vbool180_uses_F[1]);
     // Message to 'vbool159_uses' from AreEqual factor
     this.vbool159_uses_B[0] = BooleanAreEqualOp.BAverageConditional(this.vbool421_B, this.vbool180_uses_F[1]);
     // Message to 'vbool159_uses' from UsesEqualDef factor
     this.vbool159_uses_F[1] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool159_uses_B, this.vbool159_F, 1, this.vbool159_uses_F[1]);
     // Message to 'vbool154_uses' from AreEqual factor
     this.vbool154_uses_B[1] = BooleanAreEqualOp.BAverageConditional(this.vbool415_B, this.vbool159_uses_F[1]);
     // Message to 'vbool154_uses' from UsesEqualDef factor
     this.vbool154_uses_F[1] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool154_uses_B, this.vbool154_F, 1, this.vbool154_uses_F[1]);
     // Message to 'vbool159_uses' from AreEqual factor
     this.vbool159_uses_B[1] = BooleanAreEqualOp.AAverageConditional(this.vbool415_B, this.vbool154_uses_F[1]);
     // Message to 'vbool159_marginal' from UsesEqualDef factor
     this.vbool159_marginal_B = UsesEqualDefOp.MarginalAverageConditional<Bernoulli>(this.vbool159_uses_B, this.vbool159_F, this.vbool159_marginal_B);
     // Message to 'vbool415' from AreEqual factor
     this.vbool415_F = BooleanAreEqualOp.AreEqualAverageConditional(this.vbool159_uses_F[1], this.vbool154_uses_F[1]);
     // Message to 'vbool415_marginal' from ReplicateWithMarginal factor
     this.vbool415_marginal_B = ReplicateOp.MarginalAverageConditional<Bernoulli>(this.vbool415_uses_B, this.vbool415_F, this.vbool415_marginal_B);
     // Message to 'vbool159_uses' from UsesEqualDef factor
     this.vbool159_uses_F[0] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool159_uses_B, this.vbool159_F, 0, this.vbool159_uses_F[0]);
     // Message to 'vbool180_uses' from AreEqual factor
     this.vbool180_uses_B[1] = BooleanAreEqualOp.AAverageConditional(this.vbool421_B, this.vbool159_uses_F[0]);
     // Message to 'vbool421' from AreEqual factor
     this.vbool421_F = BooleanAreEqualOp.AreEqualAverageConditional(this.vbool180_uses_F[1], this.vbool159_uses_F[0]);
     // Message to 'vbool421_marginal' from ReplicateWithMarginal factor
     this.vbool421_marginal_B = ReplicateOp.MarginalAverageConditional<Bernoulli>(this.vbool421_uses_B, this.vbool421_F, this.vbool421_marginal_B);
     // Message to 'vbool180_uses' from UsesEqualDef factor
     this.vbool180_uses_F[2] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool180_uses_B, this.vbool180_F, 2, this.vbool180_uses_F[2]);
     // Message to 'vbool154_uses' from AreEqual factor
     this.vbool154_uses_B[0] = BooleanAreEqualOp.BAverageConditional(this.vbool442_B, this.vbool180_uses_F[2]);
     // Message to 'vbool154_marginal' from UsesEqualDef factor
     this.vbool154_marginal_B = UsesEqualDefOp.MarginalAverageConditional<Bernoulli>(this.vbool154_uses_B, this.vbool154_F, this.vbool154_marginal_B);
     // Message to 'vbool442' from AreEqual factor
     this.vbool442_F = BooleanAreEqualOp.AreEqualAverageConditional(this.vbool180_uses_F[2], this.vbool154_uses_F[0]);
     // Message to 'vbool442_marginal' from ReplicateWithMarginal factor
     this.vbool442_marginal_B = ReplicateOp.MarginalAverageConditional<Bernoulli>(this.vbool442_uses_B, this.vbool442_F, this.vbool442_marginal_B);
     // Message to 'vbool154_uses' from UsesEqualDef factor
     this.vbool154_uses_F[2] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool154_uses_B, this.vbool154_F, 2, this.vbool154_uses_F[2]);
     // Message to 'vbool89_uses' from AreEqual factor
     this.vbool89_uses_B[1] = BooleanAreEqualOp.AAverageConditional(this.vbool452_B, this.vbool154_uses_F[2]);
     // Message to 'vbool89_marginal' from UsesEqualDef factor
     this.vbool89_marginal_B = UsesEqualDefOp.MarginalAverageConditional<Bernoulli>(this.vbool89_uses_B, this.vbool89_F, this.vbool89_marginal_B);
     // Message to 'vbool452' from AreEqual factor
     this.vbool452_F = BooleanAreEqualOp.AreEqualAverageConditional(this.vbool89_uses_F[1], this.vbool154_uses_F[2]);
     // Message to 'vbool452_marginal' from ReplicateWithMarginal factor
     this.vbool452_marginal_B = ReplicateOp.MarginalAverageConditional<Bernoulli>(this.vbool452_uses_B, this.vbool452_F, this.vbool452_marginal_B);
     // Message to 'vbool89_uses' from UsesEqualDef factor
     this.vbool89_uses_F[0] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool89_uses_B, this.vbool89_F, 0, this.vbool89_uses_F[0]);
     // Message to 'vbool68_uses' from AreEqual factor
     this.vbool68_uses_B[1] = BooleanAreEqualOp.BAverageConditional(this.vbool211_B, this.vbool89_uses_F[0]);
     // Message to 'vbool68_marginal' from UsesEqualDef factor
     this.vbool68_marginal_B = UsesEqualDefOp.MarginalAverageConditional<Bernoulli>(this.vbool68_uses_B, this.vbool68_F, this.vbool68_marginal_B);
     // Message to 'vbool211' from AreEqual factor
     this.vbool211_F = BooleanAreEqualOp.AreEqualAverageConditional(this.vbool89_uses_F[0], this.vbool68_uses_F[1]);
     // Message to 'vbool211_marginal' from ReplicateWithMarginal factor
     this.vbool211_marginal_B = ReplicateOp.MarginalAverageConditional<Bernoulli>(this.vbool211_uses_B, this.vbool211_F, this.vbool211_marginal_B);
     // Message to 'vbool68_uses' from UsesEqualDef factor
     this.vbool68_uses_F[0] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool68_uses_B, this.vbool68_F, 0, this.vbool68_uses_F[0]);
     // Message to 'vbool63_uses' from AreEqual factor
     this.vbool63_uses_B[3] = BooleanAreEqualOp.AAverageConditional(this.vbool375_B, this.vbool68_uses_F[0]);
     // Message to 'vbool375' from AreEqual factor
     this.vbool375_F = BooleanAreEqualOp.AreEqualAverageConditional(this.vbool63_uses_F[3], this.vbool68_uses_F[0]);
     // Message to 'vbool375_marginal' from ReplicateWithMarginal factor
     this.vbool375_marginal_B = ReplicateOp.MarginalAverageConditional<Bernoulli>(this.vbool375_uses_B, this.vbool375_F, this.vbool375_marginal_B);
     // Message to 'vbool375_uses' from ReplicateWithMarginal factor
     this.vbool375_uses_F[0] = ReplicateOp.UsesAverageConditional<Bernoulli>(this.vbool375_uses_B, this.vbool375_F, 0, this.vbool375_uses_F[0]);
     // Message to 'vbool63_uses' from UsesEqualDef factor
     this.vbool63_uses_F[0] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool63_uses_B, this.vbool63_F, 0, this.vbool63_uses_F[0]);
     // Message to 'vbool141_uses' from AreEqual factor
     this.vbool141_uses_B[7] = BooleanAreEqualOp.BAverageConditional(this.vbool370_B, this.vbool63_uses_F[0]);
     // Message to 'vbool370' from AreEqual factor
     this.vbool370_F = BooleanAreEqualOp.AreEqualAverageConditional(this.vbool63_uses_F[0], this.vbool141_uses_F[7]);
     // Message to 'vbool370_marginal' from ReplicateWithMarginal factor
     this.vbool370_marginal_B = ReplicateOp.MarginalAverageConditional<Bernoulli>(this.vbool370_uses_B, this.vbool370_F, this.vbool370_marginal_B);
     // Message to 'vbool370_uses' from ReplicateWithMarginal factor
     this.vbool370_uses_F[0] = ReplicateOp.UsesAverageConditional<Bernoulli>(this.vbool370_uses_B, this.vbool370_F, 0, this.vbool370_uses_F[0]);
     // Message to 'vbool141_uses' from UsesEqualDef factor
     this.vbool141_uses_F[1] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool141_uses_B, this.vbool141_F, 1, this.vbool141_uses_F[1]);
     // Message to 'vbool141_uses' from UsesEqualDef factor
     this.vbool141_uses_F[2] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool141_uses_B, this.vbool141_F, 2, this.vbool141_uses_F[2]);
     // Message to 'vbool141_uses' from UsesEqualDef factor
     this.vbool141_uses_F[3] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool141_uses_B, this.vbool141_F, 3, this.vbool141_uses_F[3]);
     // Message to 'vbool141_uses' from UsesEqualDef factor
     this.vbool141_uses_F[4] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool141_uses_B, this.vbool141_F, 4, this.vbool141_uses_F[4]);
     // Message to 'vbool141_uses' from UsesEqualDef factor
     this.vbool141_uses_F[5] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool141_uses_B, this.vbool141_F, 5, this.vbool141_uses_F[5]);
     // Message to 'vbool141_uses' from UsesEqualDef factor
     this.vbool141_uses_F[6] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool141_uses_B, this.vbool141_F, 6, this.vbool141_uses_F[6]);
     // Message to 'vbool141_uses' from UsesEqualDef factor
     this.vbool141_uses_F[9] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool141_uses_B, this.vbool141_F, 9, this.vbool141_uses_F[9]);
     // Message to 'vbool115_uses' from And factor
     this.vbool115_uses_B[3] = BooleanAndOp.BAverageConditional(this.vbool245_B, this.vbool141_uses_F[9]);
     // Message to 'vbool141_uses' from UsesEqualDef factor
     this.vbool141_uses_F[8] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool141_uses_B, this.vbool141_F, 8, this.vbool141_uses_F[8]);
     // Message to 'vbool16_uses' from AreEqual factor
     this.vbool16_uses_B[0] = BooleanAreEqualOp.AAverageConditional(this.vbool195_B, this.vbool141_uses_F[8]);
     // Message to 'vbool16_marginal' from UsesEqualDef factor
     this.vbool16_marginal_B = UsesEqualDefOp.MarginalAverageConditional<Bernoulli>(this.vbool16_uses_B, this.vbool16_F, this.vbool16_marginal_B);
     // Message to 'vbool195' from AreEqual factor
     this.vbool195_F = BooleanAreEqualOp.AreEqualAverageConditional(this.vbool16_uses_F[0], this.vbool141_uses_F[8]);
     // Message to 'vbool195_marginal' from ReplicateWithMarginal factor
     this.vbool195_marginal_B = ReplicateOp.MarginalAverageConditional<Bernoulli>(this.vbool195_uses_B, this.vbool195_F, this.vbool195_marginal_B);
     // Message to 'vbool16_uses' from UsesEqualDef factor
     this.vbool16_uses_F[1] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool16_uses_B, this.vbool16_F, 1, this.vbool16_uses_F[1]);
     // Message to 'vbool37_uses' from AreEqual factor
     this.vbool37_uses_B[0] = BooleanAreEqualOp.AAverageConditional(this.vbool201_B, this.vbool16_uses_F[1]);
     // Message to 'vbool37_marginal' from UsesEqualDef factor
     this.vbool37_marginal_B = UsesEqualDefOp.MarginalAverageConditional<Bernoulli>(this.vbool37_uses_B, this.vbool37_F, this.vbool37_marginal_B);
     // Message to 'vbool201' from AreEqual factor
     this.vbool201_F = BooleanAreEqualOp.AreEqualAverageConditional(this.vbool37_uses_F[0], this.vbool16_uses_F[1]);
     // Message to 'vbool201_marginal' from ReplicateWithMarginal factor
     this.vbool201_marginal_B = ReplicateOp.MarginalAverageConditional<Bernoulli>(this.vbool201_uses_B, this.vbool201_F, this.vbool201_marginal_B);
     // Message to 'vbool37_uses' from UsesEqualDef factor
     this.vbool37_uses_F[1] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool37_uses_B, this.vbool37_F, 1, this.vbool37_uses_F[1]);
     // Message to 'vbool11_uses' from AreEqual factor
     this.vbool11_uses_B[1] = BooleanAreEqualOp.BAverageConditional(this.vbool411_B, this.vbool37_uses_F[1]);
     // Message to 'vbool11_marginal' from UsesEqualDef factor
     this.vbool11_marginal_B = UsesEqualDefOp.MarginalAverageConditional<Bernoulli>(this.vbool11_uses_B, this.vbool11_F, this.vbool11_marginal_B);
     // Message to 'vbool411' from AreEqual factor
     this.vbool411_F = BooleanAreEqualOp.AreEqualAverageConditional(this.vbool37_uses_F[1], this.vbool11_uses_F[1]);
     // Message to 'vbool411_marginal' from ReplicateWithMarginal factor
     this.vbool411_marginal_B = ReplicateOp.MarginalAverageConditional<Bernoulli>(this.vbool411_uses_B, this.vbool411_F, this.vbool411_marginal_B);
     // Message to 'vbool11_uses' from UsesEqualDef factor
     this.vbool11_uses_F[0] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool11_uses_B, this.vbool11_F, 0, this.vbool11_uses_F[0]);
     // Message to 'vbool42_uses' from AreEqual factor
     this.vbool42_uses_B[1] = BooleanAreEqualOp.AAverageConditional(this.vbool185_B, this.vbool11_uses_F[0]);
     // Message to 'vbool42_marginal' from UsesEqualDef factor
     this.vbool42_marginal_B = UsesEqualDefOp.MarginalAverageConditional<Bernoulli>(this.vbool42_uses_B, this.vbool42_F, this.vbool42_marginal_B);
     // Message to 'vbool185' from AreEqual factor
     this.vbool185_F = BooleanAreEqualOp.AreEqualAverageConditional(this.vbool42_uses_F[1], this.vbool11_uses_F[0]);
     // Message to 'vbool185_marginal' from ReplicateWithMarginal factor
     this.vbool185_marginal_B = ReplicateOp.MarginalAverageConditional<Bernoulli>(this.vbool185_uses_B, this.vbool185_F, this.vbool185_marginal_B);
     // Message to 'vbool42_uses' from UsesEqualDef factor
     this.vbool42_uses_F[0] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool42_uses_B, this.vbool42_F, 0, this.vbool42_uses_F[0]);
     // Message to 'vbool63_uses' from AreEqual factor
     this.vbool63_uses_B[2] = BooleanAreEqualOp.AAverageConditional(this.vbool206_B, this.vbool42_uses_F[0]);
     // Message to 'vbool63_marginal' from UsesEqualDef factor
     this.vbool63_marginal_B = UsesEqualDefOp.MarginalAverageConditional<Bernoulli>(this.vbool63_uses_B, this.vbool63_F, this.vbool63_marginal_B);
     // Message to 'vbool206' from AreEqual factor
     this.vbool206_F = BooleanAreEqualOp.AreEqualAverageConditional(this.vbool63_uses_F[2], this.vbool42_uses_F[0]);
     // Message to 'vbool206_marginal' from ReplicateWithMarginal factor
     this.vbool206_marginal_B = ReplicateOp.MarginalAverageConditional<Bernoulli>(this.vbool206_uses_B, this.vbool206_F, this.vbool206_marginal_B);
     // Message to 'vbool63_uses' from UsesEqualDef factor
     this.vbool63_uses_F[1] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool63_uses_B, this.vbool63_F, 1, this.vbool63_uses_F[1]);
     // Message to 'vbool112_uses' from AreEqual factor
     this.vbool112_uses_B[2] = BooleanAreEqualOp.BAverageConditional(this.vbool373_B, this.vbool63_uses_F[1]);
     // Message to 'vbool373' from AreEqual factor
     this.vbool373_F = BooleanAreEqualOp.AreEqualAverageConditional(this.vbool63_uses_F[1], this.vbool112_uses_F[2]);
     // Message to 'vbool373_marginal' from ReplicateWithMarginal factor
     this.vbool373_marginal_B = ReplicateOp.MarginalAverageConditional<Bernoulli>(this.vbool373_uses_B, this.vbool373_F, this.vbool373_marginal_B);
     // Message to 'vbool373_uses' from ReplicateWithMarginal factor
     this.vbool373_uses_F[0] = ReplicateOp.UsesAverageConditional<Bernoulli>(this.vbool373_uses_B, this.vbool373_F, 0, this.vbool373_uses_F[0]);
     // Message to 'vbool141_marginal' from UsesEqualDef factor
     this.vbool141_marginal_B = UsesEqualDefOp.MarginalAverageConditional<Bernoulli>(this.vbool141_uses_B, this.vbool141_F, this.vbool141_marginal_B);
     // Message to 'vbool112_uses' from UsesEqualDef factor
     this.vbool112_uses_F[1] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool112_uses_B, this.vbool112_F, 1, this.vbool112_uses_F[1]);
     // Message to 'vbool112_marginal' from UsesEqualDef factor
     this.vbool112_marginal_B = UsesEqualDefOp.MarginalAverageConditional<Bernoulli>(this.vbool112_uses_B, this.vbool112_F, this.vbool112_marginal_B);
     // Message to 'vbool180_marginal' from UsesEqualDef factor
     this.vbool180_marginal_B = UsesEqualDefOp.MarginalAverageConditional<Bernoulli>(this.vbool180_uses_B, this.vbool180_F, this.vbool180_marginal_B);
     // Message to 'vbool218' from And factor
     this.vbool218_F = BooleanAndOp.AndAverageConditional(this.vbool145_uses_F[3], this.vbool107_uses_F[0]);
     // Message to 'vbool218_uses' from ReplicateWithMarginal factor
     this.vbool218_uses_F[0] = ReplicateOp.UsesAverageConditional<Bernoulli>(this.vbool218_uses_B, this.vbool218_F, 0, this.vbool218_uses_F[0]);
     // Message to 'vbool219' from And factor
     this.vbool219_F = BooleanAndOp.AndAverageConditional(this.vbool218_uses_F[0], this.vbool115_uses_F[0]);
     // Message to 'vbool219_uses' from ReplicateWithMarginal factor
     this.vbool219_uses_F[0] = ReplicateOp.UsesAverageConditional<Bernoulli>(this.vbool219_uses_B, this.vbool219_F, 0, this.vbool219_uses_F[0]);
     // Message to 'vbool254' from And factor
     this.vbool254_F = BooleanAndOp.AndAverageConditional(this.vbool141_uses_F[1], this.vbool110_uses_F[4]);
     // Message to 'vbool254_marginal' from ReplicateWithMarginal factor
     this.vbool254_marginal_B = ReplicateOp.MarginalAverageConditional<Bernoulli>(this.vbool254_uses_B, this.vbool254_F, this.vbool254_marginal_B);
     // Message to 'vbool254_uses' from ReplicateWithMarginal factor
     this.vbool254_uses_F[0] = ReplicateOp.UsesAverageConditional<Bernoulli>(this.vbool254_uses_B, this.vbool254_F, 0, this.vbool254_uses_F[0]);
     // Message to 'vbool260' from And factor
     this.vbool260_F = BooleanAndOp.AndAverageConditional(this.vbool141_uses_F[2], this.vbool110_uses_F[5]);
     // Message to 'vbool260_marginal' from ReplicateWithMarginal factor
     this.vbool260_marginal_B = ReplicateOp.MarginalAverageConditional<Bernoulli>(this.vbool260_uses_B, this.vbool260_F, this.vbool260_marginal_B);
     // Message to 'vbool260_uses' from ReplicateWithMarginal factor
     this.vbool260_uses_F[0] = ReplicateOp.UsesAverageConditional<Bernoulli>(this.vbool260_uses_B, this.vbool260_F, 0, this.vbool260_uses_F[0]);
     // Message to 'vbool248' from And factor
     this.vbool248_F = BooleanAndOp.AndAverageConditional(this.vbool141_uses_F[3], this.vbool108_uses_F[3]);
     // Message to 'vbool248_marginal' from ReplicateWithMarginal factor
     this.vbool248_marginal_B = ReplicateOp.MarginalAverageConditional<Bernoulli>(this.vbool248_uses_B, this.vbool248_F, this.vbool248_marginal_B);
     // Message to 'vbool248_uses' from ReplicateWithMarginal factor
     this.vbool248_uses_F[0] = ReplicateOp.UsesAverageConditional<Bernoulli>(this.vbool248_uses_B, this.vbool248_F, 0, this.vbool248_uses_F[0]);
     // Message to 'vbool251' from And factor
     this.vbool251_F = BooleanAndOp.AndAverageConditional(this.vbool141_uses_F[4], this.vbool108_uses_F[4]);
     // Message to 'vbool251_marginal' from ReplicateWithMarginal factor
     this.vbool251_marginal_B = ReplicateOp.MarginalAverageConditional<Bernoulli>(this.vbool251_uses_B, this.vbool251_F, this.vbool251_marginal_B);
     // Message to 'vbool251_uses' from ReplicateWithMarginal factor
     this.vbool251_uses_F[0] = ReplicateOp.UsesAverageConditional<Bernoulli>(this.vbool251_uses_B, this.vbool251_F, 0, this.vbool251_uses_F[0]);
     // Message to 'vbool257' from And factor
     this.vbool257_F = BooleanAndOp.AndAverageConditional(this.vbool141_uses_F[5], this.vbool109_uses_F[3]);
     // Message to 'vbool257_marginal' from ReplicateWithMarginal factor
     this.vbool257_marginal_B = ReplicateOp.MarginalAverageConditional<Bernoulli>(this.vbool257_uses_B, this.vbool257_F, this.vbool257_marginal_B);
     // Message to 'vbool257_uses' from ReplicateWithMarginal factor
     this.vbool257_uses_F[0] = ReplicateOp.UsesAverageConditional<Bernoulli>(this.vbool257_uses_B, this.vbool257_F, 0, this.vbool257_uses_F[0]);
     // Message to 'vbool263' from And factor
     this.vbool263_F = BooleanAndOp.AndAverageConditional(this.vbool141_uses_F[6], this.vbool109_uses_F[4]);
     // Message to 'vbool263_marginal' from ReplicateWithMarginal factor
     this.vbool263_marginal_B = ReplicateOp.MarginalAverageConditional<Bernoulli>(this.vbool263_uses_B, this.vbool263_F, this.vbool263_marginal_B);
     // Message to 'vbool263_uses' from ReplicateWithMarginal factor
     this.vbool263_uses_F[0] = ReplicateOp.UsesAverageConditional<Bernoulli>(this.vbool263_uses_B, this.vbool263_F, 0, this.vbool263_uses_F[0]);
     // Message to 'vbool245' from And factor
     this.vbool245_F = BooleanAndOp.AndAverageConditional(this.vbool141_uses_F[9], this.vbool115_uses_F[3]);
     // Message to 'vbool245_marginal' from ReplicateWithMarginal factor
     this.vbool245_marginal_B = ReplicateOp.MarginalAverageConditional<Bernoulli>(this.vbool245_uses_B, this.vbool245_F, this.vbool245_marginal_B);
     // Message to 'vbool245_uses' from ReplicateWithMarginal factor
     this.vbool245_uses_F[0] = ReplicateOp.UsesAverageConditional<Bernoulli>(this.vbool245_uses_B, this.vbool245_F, 0, this.vbool245_uses_F[0]);
     // Message to 'vbool246' from And factor
     this.vbool246_F = BooleanAndOp.AndAverageConditional(this.vbool245_uses_F[0], this.vbool112_uses_F[1]);
     // Message to 'vbool246_marginal' from ReplicateWithMarginal factor
     this.vbool246_marginal_B = ReplicateOp.MarginalAverageConditional<Bernoulli>(this.vbool246_uses_B, this.vbool246_F, this.vbool246_marginal_B);
     // Message to 'vbool246_uses' from ReplicateWithMarginal factor
     this.vbool246_uses_F[0] = ReplicateOp.UsesAverageConditional<Bernoulli>(this.vbool246_uses_B, this.vbool246_F, 0, this.vbool246_uses_F[0]);
     // Message to 'vbool244_uses' from Or factor
     this.vbool244_uses_B[0] = BooleanOrOp.BAverageConditional(this.vbool247_B, this.vbool246_uses_F[0]);
     // Message to 'vbool244_marginal' from ReplicateWithMarginal factor
     this.vbool244_marginal_B = ReplicateOp.MarginalAverageConditional<Bernoulli>(this.vbool244_uses_B, this.vbool244_F, this.vbool244_marginal_B);
     // Message to 'vbool244' from ReplicateWithMarginal factor
     this.vbool244_B = ReplicateOp.DefAverageConditional<Bernoulli>(this.vbool244_uses_B, this.vbool244_B);
     // Message to 'vbool243_uses' from Or factor
     this.vbool243_uses_B[0] = BooleanOrOp.AAverageConditional(this.vbool244_B, this.vbool241_uses_F[0]);
     // Message to 'vbool243' from ReplicateWithMarginal factor
     this.vbool243_B = ReplicateOp.DefAverageConditional<Bernoulli>(this.vbool243_uses_B, this.vbool243_B);
     // Message to 'vbool115_uses' from And factor
     this.vbool115_uses_B[4] = BooleanAndOp.BAverageConditional(this.vbool243_B, this.vbool242_uses_F[0]);
     // Message to 'vbool115_uses' from UsesEqualDef factor
     this.vbool115_uses_F[0] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool115_uses_B, this.vbool115_F, 0, this.vbool115_uses_F[0]);
     // Message to 'vbool115_uses' from UsesEqualDef factor
     this.vbool115_uses_F[1] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool115_uses_B, this.vbool115_F, 1, this.vbool115_uses_F[1]);
     // Message to 'vbool115_uses' from UsesEqualDef factor
     this.vbool115_uses_F[2] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool115_uses_B, this.vbool115_F, 2, this.vbool115_uses_F[2]);
     // Message to 'vbool242_uses' from And factor
     this.vbool242_uses_B[0] = BooleanAndOp.AAverageConditional(this.vbool243_B, this.vbool115_uses_F[4]);
     // Message to 'vbool242_marginal' from ReplicateWithMarginal factor
     this.vbool242_marginal_B = ReplicateOp.MarginalAverageConditional<Bernoulli>(this.vbool242_uses_B, this.vbool242_F, this.vbool242_marginal_B);
     // Message to 'vbool242' from ReplicateWithMarginal factor
     this.vbool242_B = ReplicateOp.DefAverageConditional<Bernoulli>(this.vbool242_uses_B, this.vbool242_B);
     // Message to 'vbool107_uses' from And factor
     this.vbool107_uses_B[2] = BooleanAndOp.BAverageConditional(this.vbool242_B, this.vbool141_uses_F[0]);
     // Message to 'vbool141_uses' from And factor
     this.vbool141_uses_B[0] = BooleanAndOp.AAverageConditional(this.vbool242_B, this.vbool107_uses_F[2]);
     // Message to 'vbool107_uses' from UsesEqualDef factor
     this.vbool107_uses_F[1] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool107_uses_B, this.vbool107_F, 1, this.vbool107_uses_F[1]);
     // Message to 'vbool102_uses' from AreEqual factor
     this.vbool102_uses_B[0] = BooleanAreEqualOp.BAverageConditional(this.vbool190_B, this.vbool107_uses_F[1]);
     // Message to 'vbool102_marginal' from UsesEqualDef factor
     this.vbool102_marginal_B = UsesEqualDefOp.MarginalAverageConditional<Bernoulli>(this.vbool102_uses_B, this.vbool102_F, this.vbool102_marginal_B);
     // Message to 'vbool190' from AreEqual factor
     this.vbool190_F = BooleanAreEqualOp.AreEqualAverageConditional(this.vbool107_uses_F[1], this.vbool102_uses_F[0]);
     // Message to 'vbool190_marginal' from ReplicateWithMarginal factor
     this.vbool190_marginal_B = ReplicateOp.MarginalAverageConditional<Bernoulli>(this.vbool190_uses_B, this.vbool190_F, this.vbool190_marginal_B);
     // Message to 'vbool102_uses' from UsesEqualDef factor
     this.vbool102_uses_F[1] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool102_uses_B, this.vbool102_F, 1, this.vbool102_uses_F[1]);
     // Message to 'vbool180_uses' from AreEqual factor
     this.vbool180_uses_B[0] = BooleanAreEqualOp.BAverageConditional(this.vbool447_B, this.vbool102_uses_F[1]);
     // Message to 'vbool447' from AreEqual factor
     this.vbool447_F = BooleanAreEqualOp.AreEqualAverageConditional(this.vbool102_uses_F[1], this.vbool180_uses_F[0]);
     // Message to 'vbool447_marginal' from ReplicateWithMarginal factor
     this.vbool447_marginal_B = ReplicateOp.MarginalAverageConditional<Bernoulli>(this.vbool447_uses_B, this.vbool447_F, this.vbool447_marginal_B);
     // Message to 'vbool107_marginal' from UsesEqualDef factor
     this.vbool107_marginal_B = UsesEqualDefOp.MarginalAverageConditional<Bernoulli>(this.vbool107_uses_B, this.vbool107_F, this.vbool107_marginal_B);
     // Message to 'vbool243' from And factor
     this.vbool243_F = BooleanAndOp.AndAverageConditional(this.vbool242_uses_F[0], this.vbool115_uses_F[4]);
     // Message to 'vbool243_marginal' from ReplicateWithMarginal factor
     this.vbool243_marginal_B = ReplicateOp.MarginalAverageConditional<Bernoulli>(this.vbool243_uses_B, this.vbool243_F, this.vbool243_marginal_B);
     // Message to 'vbool243_uses' from ReplicateWithMarginal factor
     this.vbool243_uses_F[0] = ReplicateOp.UsesAverageConditional<Bernoulli>(this.vbool243_uses_B, this.vbool243_F, 0, this.vbool243_uses_F[0]);
     // Message to 'vbool241_uses' from Or factor
     this.vbool241_uses_B[0] = BooleanOrOp.BAverageConditional(this.vbool244_B, this.vbool243_uses_F[0]);
     // Message to 'vbool241_marginal' from ReplicateWithMarginal factor
     this.vbool241_marginal_B = ReplicateOp.MarginalAverageConditional<Bernoulli>(this.vbool241_uses_B, this.vbool241_F, this.vbool241_marginal_B);
     // Message to 'vbool241' from ReplicateWithMarginal factor
     this.vbool241_B = ReplicateOp.DefAverageConditional<Bernoulli>(this.vbool241_uses_B, this.vbool241_B);
     // Message to 'vbool240_uses' from Or factor
     this.vbool240_uses_B[0] = BooleanOrOp.AAverageConditional(this.vbool241_B, this.vbool238_uses_F[0]);
     // Message to 'vbool240_marginal' from ReplicateWithMarginal factor
     this.vbool240_marginal_B = ReplicateOp.MarginalAverageConditional<Bernoulli>(this.vbool240_uses_B, this.vbool240_F, this.vbool240_marginal_B);
     // Message to 'vbool238_uses' from Or factor
     this.vbool238_uses_B[0] = BooleanOrOp.BAverageConditional(this.vbool241_B, this.vbool240_uses_F[0]);
     // Message to 'vbool238_marginal' from ReplicateWithMarginal factor
     this.vbool238_marginal_B = ReplicateOp.MarginalAverageConditional<Bernoulli>(this.vbool238_uses_B, this.vbool238_F, this.vbool238_marginal_B);
     // Message to 'vbool240' from ReplicateWithMarginal factor
     this.vbool240_B = ReplicateOp.DefAverageConditional<Bernoulli>(this.vbool240_uses_B, this.vbool240_B);
     // Message to 'vbool239_uses' from And factor
     this.vbool239_uses_B[0] = BooleanAndOp.AAverageConditional(this.vbool240_B, this.vbool115_uses_F[2]);
     // Message to 'vbool239_marginal' from ReplicateWithMarginal factor
     this.vbool239_marginal_B = ReplicateOp.MarginalAverageConditional<Bernoulli>(this.vbool239_uses_B, this.vbool239_F, this.vbool239_marginal_B);
     // Message to 'vbool115_uses' from And factor
     this.vbool115_uses_B[2] = BooleanAndOp.BAverageConditional(this.vbool240_B, this.vbool239_uses_F[0]);
     // Message to 'vbool239' from ReplicateWithMarginal factor
     this.vbool239_B = ReplicateOp.DefAverageConditional<Bernoulli>(this.vbool239_uses_B, this.vbool239_B);
     // Message to 'vbool145_uses' from And factor
     this.vbool145_uses_B[10] = BooleanAndOp.AAverageConditional(this.vbool239_B, this.vbool109_uses_F[1]);
     // Message to 'vbool238' from ReplicateWithMarginal factor
     this.vbool238_B = ReplicateOp.DefAverageConditional<Bernoulli>(this.vbool238_uses_B, this.vbool238_B);
     // Message to 'vbool237_uses' from Or factor
     this.vbool237_uses_B[0] = BooleanOrOp.AAverageConditional(this.vbool238_B, this.vbool235_uses_F[0]);
     // Message to 'vbool237_marginal' from ReplicateWithMarginal factor
     this.vbool237_marginal_B = ReplicateOp.MarginalAverageConditional<Bernoulli>(this.vbool237_uses_B, this.vbool237_F, this.vbool237_marginal_B);
     // Message to 'vbool235_uses' from Or factor
     this.vbool235_uses_B[0] = BooleanOrOp.BAverageConditional(this.vbool238_B, this.vbool237_uses_F[0]);
     // Message to 'vbool235_marginal' from ReplicateWithMarginal factor
     this.vbool235_marginal_B = ReplicateOp.MarginalAverageConditional<Bernoulli>(this.vbool235_uses_B, this.vbool235_F, this.vbool235_marginal_B);
     // Message to 'vbool237' from ReplicateWithMarginal factor
     this.vbool237_B = ReplicateOp.DefAverageConditional<Bernoulli>(this.vbool237_uses_B, this.vbool237_B);
     // Message to 'vbool236_uses' from And factor
     this.vbool236_uses_B[0] = BooleanAndOp.AAverageConditional(this.vbool237_B, this.vbool114_uses_F[1]);
     // Message to 'vbool236' from ReplicateWithMarginal factor
     this.vbool236_B = ReplicateOp.DefAverageConditional<Bernoulli>(this.vbool236_uses_B, this.vbool236_B);
     // Message to 'vbool235' from ReplicateWithMarginal factor
     this.vbool235_B = ReplicateOp.DefAverageConditional<Bernoulli>(this.vbool235_uses_B, this.vbool235_B);
     // Message to 'vbool234_uses' from Or factor
     this.vbool234_uses_B[0] = BooleanOrOp.AAverageConditional(this.vbool235_B, this.vbool232_uses_F[0]);
     // Message to 'vbool234_marginal' from ReplicateWithMarginal factor
     this.vbool234_marginal_B = ReplicateOp.MarginalAverageConditional<Bernoulli>(this.vbool234_uses_B, this.vbool234_F, this.vbool234_marginal_B);
     // Message to 'vbool232_uses' from Or factor
     this.vbool232_uses_B[0] = BooleanOrOp.BAverageConditional(this.vbool235_B, this.vbool234_uses_F[0]);
     // Message to 'vbool232_marginal' from ReplicateWithMarginal factor
     this.vbool232_marginal_B = ReplicateOp.MarginalAverageConditional<Bernoulli>(this.vbool232_uses_B, this.vbool232_F, this.vbool232_marginal_B);
     // Message to 'vbool234' from ReplicateWithMarginal factor
     this.vbool234_B = ReplicateOp.DefAverageConditional<Bernoulli>(this.vbool234_uses_B, this.vbool234_B);
     // Message to 'vbool233_uses' from And factor
     this.vbool233_uses_B[0] = BooleanAndOp.AAverageConditional(this.vbool234_B, this.vbool114_uses_F[0]);
     // Message to 'vbool233_marginal' from ReplicateWithMarginal factor
     this.vbool233_marginal_B = ReplicateOp.MarginalAverageConditional<Bernoulli>(this.vbool233_uses_B, this.vbool233_F, this.vbool233_marginal_B);
     // Message to 'vbool114_uses' from And factor
     this.vbool114_uses_B[0] = BooleanAndOp.BAverageConditional(this.vbool234_B, this.vbool233_uses_F[0]);
     // Message to 'vbool233' from ReplicateWithMarginal factor
     this.vbool233_B = ReplicateOp.DefAverageConditional<Bernoulli>(this.vbool233_uses_B, this.vbool233_B);
     // Message to 'vbool145_uses' from And factor
     this.vbool145_uses_B[8] = BooleanAndOp.AAverageConditional(this.vbool233_B, this.vbool109_uses_F[0]);
     // Message to 'vbool232' from ReplicateWithMarginal factor
     this.vbool232_B = ReplicateOp.DefAverageConditional<Bernoulli>(this.vbool232_uses_B, this.vbool232_B);
     // Message to 'vbool231_uses' from Or factor
     this.vbool231_uses_B[0] = BooleanOrOp.AAverageConditional(this.vbool232_B, this.vbool229_uses_F[0]);
     // Message to 'vbool231_marginal' from ReplicateWithMarginal factor
     this.vbool231_marginal_B = ReplicateOp.MarginalAverageConditional<Bernoulli>(this.vbool231_uses_B, this.vbool231_F, this.vbool231_marginal_B);
     // Message to 'vbool229_uses' from Or factor
     this.vbool229_uses_B[0] = BooleanOrOp.BAverageConditional(this.vbool232_B, this.vbool231_uses_F[0]);
     // Message to 'vbool229_marginal' from ReplicateWithMarginal factor
     this.vbool229_marginal_B = ReplicateOp.MarginalAverageConditional<Bernoulli>(this.vbool229_uses_B, this.vbool229_F, this.vbool229_marginal_B);
     // Message to 'vbool231' from ReplicateWithMarginal factor
     this.vbool231_B = ReplicateOp.DefAverageConditional<Bernoulli>(this.vbool231_uses_B, this.vbool231_B);
     // Message to 'vbool230_uses' from And factor
     this.vbool230_uses_B[0] = BooleanAndOp.AAverageConditional(this.vbool231_B, this.vbool113_uses_F[1]);
     // Message to 'vbool230' from ReplicateWithMarginal factor
     this.vbool230_B = ReplicateOp.DefAverageConditional<Bernoulli>(this.vbool230_uses_B, this.vbool230_B);
     // Message to 'vbool229' from ReplicateWithMarginal factor
     this.vbool229_B = ReplicateOp.DefAverageConditional<Bernoulli>(this.vbool229_uses_B, this.vbool229_B);
     // Message to 'vbool228_uses' from Or factor
     this.vbool228_uses_B[0] = BooleanOrOp.AAverageConditional(this.vbool229_B, this.vbool226_uses_F[0]);
     // Message to 'vbool228_marginal' from ReplicateWithMarginal factor
     this.vbool228_marginal_B = ReplicateOp.MarginalAverageConditional<Bernoulli>(this.vbool228_uses_B, this.vbool228_F, this.vbool228_marginal_B);
     // Message to 'vbool226_uses' from Or factor
     this.vbool226_uses_B[0] = BooleanOrOp.BAverageConditional(this.vbool229_B, this.vbool228_uses_F[0]);
     // Message to 'vbool226_marginal' from ReplicateWithMarginal factor
     this.vbool226_marginal_B = ReplicateOp.MarginalAverageConditional<Bernoulli>(this.vbool226_uses_B, this.vbool226_F, this.vbool226_marginal_B);
     // Message to 'vbool228' from ReplicateWithMarginal factor
     this.vbool228_B = ReplicateOp.DefAverageConditional<Bernoulli>(this.vbool228_uses_B, this.vbool228_B);
     // Message to 'vbool227_uses' from And factor
     this.vbool227_uses_B[0] = BooleanAndOp.AAverageConditional(this.vbool228_B, this.vbool115_uses_F[1]);
     // Message to 'vbool227_marginal' from ReplicateWithMarginal factor
     this.vbool227_marginal_B = ReplicateOp.MarginalAverageConditional<Bernoulli>(this.vbool227_uses_B, this.vbool227_F, this.vbool227_marginal_B);
     // Message to 'vbool115_uses' from And factor
     this.vbool115_uses_B[1] = BooleanAndOp.BAverageConditional(this.vbool228_B, this.vbool227_uses_F[0]);
     // Message to 'vbool227' from ReplicateWithMarginal factor
     this.vbool227_B = ReplicateOp.DefAverageConditional<Bernoulli>(this.vbool227_uses_B, this.vbool227_B);
     // Message to 'vbool145_uses' from And factor
     this.vbool145_uses_B[6] = BooleanAndOp.AAverageConditional(this.vbool227_B, this.vbool108_uses_F[1]);
     // Message to 'vbool226' from ReplicateWithMarginal factor
     this.vbool226_B = ReplicateOp.DefAverageConditional<Bernoulli>(this.vbool226_uses_B, this.vbool226_B);
     // Message to 'vbool225_uses' from Or factor
     this.vbool225_uses_B[0] = BooleanOrOp.AAverageConditional(this.vbool226_B, this.vbool223_uses_F[0]);
     // Message to 'vbool225_marginal' from ReplicateWithMarginal factor
     this.vbool225_marginal_B = ReplicateOp.MarginalAverageConditional<Bernoulli>(this.vbool225_uses_B, this.vbool225_F, this.vbool225_marginal_B);
     // Message to 'vbool223_uses' from Or factor
     this.vbool223_uses_B[0] = BooleanOrOp.BAverageConditional(this.vbool226_B, this.vbool225_uses_F[0]);
     // Message to 'vbool223_marginal' from ReplicateWithMarginal factor
     this.vbool223_marginal_B = ReplicateOp.MarginalAverageConditional<Bernoulli>(this.vbool223_uses_B, this.vbool223_F, this.vbool223_marginal_B);
     // Message to 'vbool225' from ReplicateWithMarginal factor
     this.vbool225_B = ReplicateOp.DefAverageConditional<Bernoulli>(this.vbool225_uses_B, this.vbool225_B);
     // Message to 'vbool224_uses' from And factor
     this.vbool224_uses_B[0] = BooleanAndOp.AAverageConditional(this.vbool225_B, this.vbool113_uses_F[0]);
     // Message to 'vbool224_marginal' from ReplicateWithMarginal factor
     this.vbool224_marginal_B = ReplicateOp.MarginalAverageConditional<Bernoulli>(this.vbool224_uses_B, this.vbool224_F, this.vbool224_marginal_B);
     // Message to 'vbool113_uses' from And factor
     this.vbool113_uses_B[0] = BooleanAndOp.BAverageConditional(this.vbool225_B, this.vbool224_uses_F[0]);
     // Message to 'vbool224' from ReplicateWithMarginal factor
     this.vbool224_B = ReplicateOp.DefAverageConditional<Bernoulli>(this.vbool224_uses_B, this.vbool224_B);
     // Message to 'vbool145_uses' from And factor
     this.vbool145_uses_B[5] = BooleanAndOp.AAverageConditional(this.vbool224_B, this.vbool108_uses_F[0]);
     // Message to 'vbool223' from ReplicateWithMarginal factor
     this.vbool223_B = ReplicateOp.DefAverageConditional<Bernoulli>(this.vbool223_uses_B, this.vbool223_B);
     // Message to 'vbool222_uses' from Or factor
     this.vbool222_uses_B[0] = BooleanOrOp.AAverageConditional(this.vbool223_B, this.vbool220_uses_F[0]);
     // Message to 'vbool222_marginal' from ReplicateWithMarginal factor
     this.vbool222_marginal_B = ReplicateOp.MarginalAverageConditional<Bernoulli>(this.vbool222_uses_B, this.vbool222_F, this.vbool222_marginal_B);
     // Message to 'vbool220_uses' from Or factor
     this.vbool220_uses_B[0] = BooleanOrOp.BAverageConditional(this.vbool223_B, this.vbool222_uses_F[0]);
     // Message to 'vbool220_marginal' from ReplicateWithMarginal factor
     this.vbool220_marginal_B = ReplicateOp.MarginalAverageConditional<Bernoulli>(this.vbool220_uses_B, this.vbool220_F, this.vbool220_marginal_B);
     // Message to 'vbool222' from ReplicateWithMarginal factor
     this.vbool222_B = ReplicateOp.DefAverageConditional<Bernoulli>(this.vbool222_uses_B, this.vbool222_B);
     // Message to 'vbool221_uses' from And factor
     this.vbool221_uses_B[0] = BooleanAndOp.AAverageConditional(this.vbool222_B, this.vbool112_uses_F[0]);
     // Message to 'vbool221' from ReplicateWithMarginal factor
     this.vbool221_B = ReplicateOp.DefAverageConditional<Bernoulli>(this.vbool221_uses_B, this.vbool221_B);
     // Message to 'vbool220' from ReplicateWithMarginal factor
     this.vbool220_B = ReplicateOp.DefAverageConditional<Bernoulli>(this.vbool220_uses_B, this.vbool220_B);
     // Message to 'vbool217_uses' from Or factor
     this.vbool217_uses_B[0] = BooleanOrOp.BAverageConditional(this.vbool220_B, this.vbool219_uses_F[0]);
     // Message to 'vbool217_marginal' from ReplicateWithMarginal factor
     this.vbool217_marginal_B = ReplicateOp.MarginalAverageConditional<Bernoulli>(this.vbool217_uses_B, this.vbool217_F, this.vbool217_marginal_B);
     // Message to 'vbool219_uses' from Or factor
     this.vbool219_uses_B[0] = BooleanOrOp.AAverageConditional(this.vbool220_B, this.vbool217_uses_F[0]);
     // Message to 'vbool219_marginal' from ReplicateWithMarginal factor
     this.vbool219_marginal_B = ReplicateOp.MarginalAverageConditional<Bernoulli>(this.vbool219_uses_B, this.vbool219_F, this.vbool219_marginal_B);
     // Message to 'vbool217' from ReplicateWithMarginal factor
     this.vbool217_B = ReplicateOp.DefAverageConditional<Bernoulli>(this.vbool217_uses_B, this.vbool217_B);
     // Message to 'vbool215_uses' from Or factor
     this.vbool215_uses_B[0] = BooleanOrOp.BAverageConditional(this.vbool217_B, this.vbool216_uses_F[0]);
     // Message to 'vbool215_marginal' from ReplicateWithMarginal factor
     this.vbool215_marginal_B = ReplicateOp.MarginalAverageConditional<Bernoulli>(this.vbool215_uses_B, this.vbool215_F, this.vbool215_marginal_B);
     // Message to 'vbool216_uses' from Or factor
     this.vbool216_uses_B[0] = BooleanOrOp.AAverageConditional(this.vbool217_B, this.vbool215_uses_F[0]);
     // Message to 'vbool216_marginal' from ReplicateWithMarginal factor
     this.vbool216_marginal_B = ReplicateOp.MarginalAverageConditional<Bernoulli>(this.vbool216_uses_B, this.vbool216_F, this.vbool216_marginal_B);
     // Message to 'vbool215' from ReplicateWithMarginal factor
     this.vbool215_B = ReplicateOp.DefAverageConditional<Bernoulli>(this.vbool215_uses_B, this.vbool215_B);
     // Message to 'vbool145_uses' from And factor
     this.vbool145_uses_B[0] = BooleanAndOp.AAverageConditional(this.vbool215_B, this.vbool111_uses_F[1]);
     // Message to 'vbool216' from ReplicateWithMarginal factor
     this.vbool216_B = ReplicateOp.DefAverageConditional<Bernoulli>(this.vbool216_uses_B, this.vbool216_B);
     // Message to 'vbool145_uses' from And factor
     this.vbool145_uses_B[2] = BooleanAndOp.AAverageConditional(this.vbool216_B, this.vbool116_uses_F[1]);
     // Message to 'vbool219' from ReplicateWithMarginal factor
     this.vbool219_B = ReplicateOp.DefAverageConditional<Bernoulli>(this.vbool219_uses_B, this.vbool219_B);
     // Message to 'vbool218_uses' from And factor
     this.vbool218_uses_B[0] = BooleanAndOp.AAverageConditional(this.vbool219_B, this.vbool115_uses_F[0]);
     // Message to 'vbool218_marginal' from ReplicateWithMarginal factor
     this.vbool218_marginal_B = ReplicateOp.MarginalAverageConditional<Bernoulli>(this.vbool218_uses_B, this.vbool218_F, this.vbool218_marginal_B);
     // Message to 'vbool115_uses' from And factor
     this.vbool115_uses_B[0] = BooleanAndOp.BAverageConditional(this.vbool219_B, this.vbool218_uses_F[0]);
     // Message to 'vbool115_marginal' from UsesEqualDef factor
     this.vbool115_marginal_B = UsesEqualDefOp.MarginalAverageConditional<Bernoulli>(this.vbool115_uses_B, this.vbool115_F, this.vbool115_marginal_B);
     // Message to 'vbool218' from ReplicateWithMarginal factor
     this.vbool218_B = ReplicateOp.DefAverageConditional<Bernoulli>(this.vbool218_uses_B, this.vbool218_B);
     // Message to 'vbool145_uses' from And factor
     this.vbool145_uses_B[3] = BooleanAndOp.AAverageConditional(this.vbool218_B, this.vbool107_uses_F[0]);
     // Message to 'vbool115_uses' from UsesEqualDef factor
     this.vbool115_uses_F[3] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool115_uses_B, this.vbool115_F, 3, this.vbool115_uses_F[3]);
     // Message to 'vbool115_uses' from UsesEqualDef factor
     this.vbool115_uses_F[4] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool115_uses_B, this.vbool115_F, 4, this.vbool115_uses_F[4]);
     // Message to 'vbool115_uses' from UsesEqualDef factor
     this.vbool115_uses_F[9] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool115_uses_B, this.vbool115_F, 9, this.vbool115_uses_F[9]);
     // Message to 'vbool115_uses' from UsesEqualDef factor
     this.vbool115_uses_F[5] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool115_uses_B, this.vbool115_F, 5, this.vbool115_uses_F[5]);
     // Message to 'vbool252' from And factor
     this.vbool252_F = BooleanAndOp.AndAverageConditional(this.vbool251_uses_F[0], this.vbool115_uses_F[5]);
     // Message to 'vbool252_marginal' from ReplicateWithMarginal factor
     this.vbool252_marginal_B = ReplicateOp.MarginalAverageConditional<Bernoulli>(this.vbool252_uses_B, this.vbool252_F, this.vbool252_marginal_B);
     // Message to 'vbool115_uses' from UsesEqualDef factor
     this.vbool115_uses_F[7] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool115_uses_B, this.vbool115_F, 7, this.vbool115_uses_F[7]);
     // Message to 'vbool115_uses' from UsesEqualDef factor
     this.vbool115_uses_F[6] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool115_uses_B, this.vbool115_F, 6, this.vbool115_uses_F[6]);
     // Message to 'vbool264' from And factor
     this.vbool264_F = BooleanAndOp.AndAverageConditional(this.vbool263_uses_F[0], this.vbool115_uses_F[6]);
     // Message to 'vbool264_marginal' from ReplicateWithMarginal factor
     this.vbool264_marginal_B = ReplicateOp.MarginalAverageConditional<Bernoulli>(this.vbool264_uses_B, this.vbool264_F, this.vbool264_marginal_B);
     // Message to 'vbool115_uses' from UsesEqualDef factor
     this.vbool115_uses_F[8] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool115_uses_B, this.vbool115_F, 8, this.vbool115_uses_F[8]);
     // Message to 'vbool115_uses' from UsesEqualDef factor
     this.vbool115_uses_F[10] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool115_uses_B, this.vbool115_F, 10, this.vbool115_uses_F[10]);
     // Message to 'vbool66_uses' from AreEqual factor
     this.vbool66_uses_B[1] = BooleanAreEqualOp.AAverageConditional(this.vbool397_B, this.vbool115_uses_F[10]);
     // Message to 'vbool397' from AreEqual factor
     this.vbool397_F = BooleanAreEqualOp.AreEqualAverageConditional(this.vbool66_uses_F[1], this.vbool115_uses_F[10]);
     // Message to 'vbool397_marginal' from ReplicateWithMarginal factor
     this.vbool397_marginal_B = ReplicateOp.MarginalAverageConditional<Bernoulli>(this.vbool397_uses_B, this.vbool397_F, this.vbool397_marginal_B);
     // Message to 'vbool397_uses' from ReplicateWithMarginal factor
     this.vbool397_uses_F[0] = ReplicateOp.UsesAverageConditional<Bernoulli>(this.vbool397_uses_B, this.vbool397_F, 0, this.vbool397_uses_F[0]);
     // Message to 'vbool252_uses' from ReplicateWithMarginal factor
     this.vbool252_uses_F[0] = ReplicateOp.UsesAverageConditional<Bernoulli>(this.vbool252_uses_B, this.vbool252_F, 0, this.vbool252_uses_F[0]);
     // Message to 'vbool264_uses' from ReplicateWithMarginal factor
     this.vbool264_uses_F[0] = ReplicateOp.UsesAverageConditional<Bernoulli>(this.vbool264_uses_B, this.vbool264_F, 0, this.vbool264_uses_F[0]);
     // Message to 'vbool113_uses' from UsesEqualDef factor
     this.vbool113_uses_F[2] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool113_uses_B, this.vbool113_F, 2, this.vbool113_uses_F[2]);
     // Message to 'vbool255' from And factor
     this.vbool255_F = BooleanAndOp.AndAverageConditional(this.vbool254_uses_F[0], this.vbool113_uses_F[2]);
     // Message to 'vbool255_marginal' from ReplicateWithMarginal factor
     this.vbool255_marginal_B = ReplicateOp.MarginalAverageConditional<Bernoulli>(this.vbool255_uses_B, this.vbool255_F, this.vbool255_marginal_B);
     // Message to 'vbool255_uses' from ReplicateWithMarginal factor
     this.vbool255_uses_F[0] = ReplicateOp.UsesAverageConditional<Bernoulli>(this.vbool255_uses_B, this.vbool255_F, 0, this.vbool255_uses_F[0]);
     // Message to 'vbool114_uses' from UsesEqualDef factor
     this.vbool114_uses_F[2] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool114_uses_B, this.vbool114_F, 2, this.vbool114_uses_F[2]);
     // Message to 'vbool261' from And factor
     this.vbool261_F = BooleanAndOp.AndAverageConditional(this.vbool260_uses_F[0], this.vbool114_uses_F[2]);
     // Message to 'vbool261_marginal' from ReplicateWithMarginal factor
     this.vbool261_marginal_B = ReplicateOp.MarginalAverageConditional<Bernoulli>(this.vbool261_uses_B, this.vbool261_F, this.vbool261_marginal_B);
     // Message to 'vbool261_uses' from ReplicateWithMarginal factor
     this.vbool261_uses_F[0] = ReplicateOp.UsesAverageConditional<Bernoulli>(this.vbool261_uses_B, this.vbool261_F, 0, this.vbool261_uses_F[0]);
     // Message to 'vbool113_uses' from UsesEqualDef factor
     this.vbool113_uses_F[3] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool113_uses_B, this.vbool113_F, 3, this.vbool113_uses_F[3]);
     // Message to 'vbool114_uses' from UsesEqualDef factor
     this.vbool114_uses_F[3] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool114_uses_B, this.vbool114_F, 3, this.vbool114_uses_F[3]);
     // Message to 'vbool113_uses' from UsesEqualDef factor
     this.vbool113_uses_F[4] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool113_uses_B, this.vbool113_F, 4, this.vbool113_uses_F[4]);
     // Message to 'vbool249' from And factor
     this.vbool249_F = BooleanAndOp.AndAverageConditional(this.vbool248_uses_F[0], this.vbool113_uses_F[4]);
     // Message to 'vbool249_marginal' from ReplicateWithMarginal factor
     this.vbool249_marginal_B = ReplicateOp.MarginalAverageConditional<Bernoulli>(this.vbool249_uses_B, this.vbool249_F, this.vbool249_marginal_B);
     // Message to 'vbool249_uses' from ReplicateWithMarginal factor
     this.vbool249_uses_F[0] = ReplicateOp.UsesAverageConditional<Bernoulli>(this.vbool249_uses_B, this.vbool249_F, 0, this.vbool249_uses_F[0]);
     // Message to 'vbool113_uses' from UsesEqualDef factor
     this.vbool113_uses_F[5] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool113_uses_B, this.vbool113_F, 5, this.vbool113_uses_F[5]);
     // Message to 'vbool114_uses' from UsesEqualDef factor
     this.vbool114_uses_F[4] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool114_uses_B, this.vbool114_F, 4, this.vbool114_uses_F[4]);
     // Message to 'vbool258' from And factor
     this.vbool258_F = BooleanAndOp.AndAverageConditional(this.vbool257_uses_F[0], this.vbool114_uses_F[4]);
     // Message to 'vbool258_marginal' from ReplicateWithMarginal factor
     this.vbool258_marginal_B = ReplicateOp.MarginalAverageConditional<Bernoulli>(this.vbool258_uses_B, this.vbool258_F, this.vbool258_marginal_B);
     // Message to 'vbool258_uses' from ReplicateWithMarginal factor
     this.vbool258_uses_F[0] = ReplicateOp.UsesAverageConditional<Bernoulli>(this.vbool258_uses_B, this.vbool258_F, 0, this.vbool258_uses_F[0]);
     // Message to 'vbool114_uses' from UsesEqualDef factor
     this.vbool114_uses_F[5] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool114_uses_B, this.vbool114_F, 5, this.vbool114_uses_F[5]);
     // Message to 'vbool113_uses' from UsesEqualDef factor
     this.vbool113_uses_F[6] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool113_uses_B, this.vbool113_F, 6, this.vbool113_uses_F[6]);
     // Message to 'vbool64_uses' from AreEqual factor
     this.vbool64_uses_B[1] = BooleanAreEqualOp.AAverageConditional(this.vbool381_B, this.vbool113_uses_F[6]);
     // Message to 'vbool381' from AreEqual factor
     this.vbool381_F = BooleanAreEqualOp.AreEqualAverageConditional(this.vbool64_uses_F[1], this.vbool113_uses_F[6]);
     // Message to 'vbool381_marginal' from ReplicateWithMarginal factor
     this.vbool381_marginal_B = ReplicateOp.MarginalAverageConditional<Bernoulli>(this.vbool381_uses_B, this.vbool381_F, this.vbool381_marginal_B);
     // Message to 'vbool381_uses' from ReplicateWithMarginal factor
     this.vbool381_uses_F[0] = ReplicateOp.UsesAverageConditional<Bernoulli>(this.vbool381_uses_B, this.vbool381_F, 0, this.vbool381_uses_F[0]);
     // Message to 'vbool114_uses' from UsesEqualDef factor
     this.vbool114_uses_F[6] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool114_uses_B, this.vbool114_F, 6, this.vbool114_uses_F[6]);
     // Message to 'vbool65_uses' from AreEqual factor
     this.vbool65_uses_B[1] = BooleanAreEqualOp.AAverageConditional(this.vbool389_B, this.vbool114_uses_F[6]);
     // Message to 'vbool389' from AreEqual factor
     this.vbool389_F = BooleanAreEqualOp.AreEqualAverageConditional(this.vbool65_uses_F[1], this.vbool114_uses_F[6]);
     // Message to 'vbool389_marginal' from ReplicateWithMarginal factor
     this.vbool389_marginal_B = ReplicateOp.MarginalAverageConditional<Bernoulli>(this.vbool389_uses_B, this.vbool389_F, this.vbool389_marginal_B);
     // Message to 'vbool389_uses' from ReplicateWithMarginal factor
     this.vbool389_uses_F[0] = ReplicateOp.UsesAverageConditional<Bernoulli>(this.vbool389_uses_B, this.vbool389_F, 0, this.vbool389_uses_F[0]);
     // Message to 'vbool113_marginal' from UsesEqualDef factor
     this.vbool113_marginal_B = UsesEqualDefOp.MarginalAverageConditional<Bernoulli>(this.vbool113_uses_B, this.vbool113_F, this.vbool113_marginal_B);
     // Message to 'vbool114_marginal' from UsesEqualDef factor
     this.vbool114_marginal_B = UsesEqualDefOp.MarginalAverageConditional<Bernoulli>(this.vbool114_uses_B, this.vbool114_F, this.vbool114_marginal_B);
     // Message to 'vbool145_uses' from UsesEqualDef factor
     this.vbool145_uses_F[4] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool145_uses_B, this.vbool145_F, 4, this.vbool145_uses_F[4]);
     // Message to 'vbool110_uses' from And factor
     this.vbool110_uses_B[0] = BooleanAndOp.BAverageConditional(this.vbool221_B, this.vbool145_uses_F[4]);
     // Message to 'vbool110_uses' from UsesEqualDef factor
     this.vbool110_uses_F[1] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool110_uses_B, this.vbool110_F, 1, this.vbool110_uses_F[1]);
     // Message to 'vbool145_uses' from And factor
     this.vbool145_uses_B[7] = BooleanAndOp.AAverageConditional(this.vbool230_B, this.vbool110_uses_F[1]);
     // Message to 'vbool145_uses' from UsesEqualDef factor
     this.vbool145_uses_F[9] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool145_uses_B, this.vbool145_F, 9, this.vbool145_uses_F[9]);
     // Message to 'vbool110_uses' from And factor
     this.vbool110_uses_B[2] = BooleanAndOp.BAverageConditional(this.vbool236_B, this.vbool145_uses_F[9]);
     // Message to 'vbool110_uses' from UsesEqualDef factor
     this.vbool110_uses_F[0] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool110_uses_B, this.vbool110_F, 0, this.vbool110_uses_F[0]);
     // Message to 'vbool145_uses' from And factor
     this.vbool145_uses_B[4] = BooleanAndOp.AAverageConditional(this.vbool221_B, this.vbool110_uses_F[0]);
     // Message to 'vbool221' from And factor
     this.vbool221_F = BooleanAndOp.AndAverageConditional(this.vbool145_uses_F[4], this.vbool110_uses_F[0]);
     // Message to 'vbool221_marginal' from ReplicateWithMarginal factor
     this.vbool221_marginal_B = ReplicateOp.MarginalAverageConditional<Bernoulli>(this.vbool221_uses_B, this.vbool221_F, this.vbool221_marginal_B);
     // Message to 'vbool221_uses' from ReplicateWithMarginal factor
     this.vbool221_uses_F[0] = ReplicateOp.UsesAverageConditional<Bernoulli>(this.vbool221_uses_B, this.vbool221_F, 0, this.vbool221_uses_F[0]);
     // Message to 'vbool112_uses' from And factor
     this.vbool112_uses_B[0] = BooleanAndOp.BAverageConditional(this.vbool222_B, this.vbool221_uses_F[0]);
     // Message to 'vbool145_uses' from UsesEqualDef factor
     this.vbool145_uses_F[0] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool145_uses_B, this.vbool145_F, 0, this.vbool145_uses_F[0]);
     // Message to 'vbool111_uses' from And factor
     this.vbool111_uses_B[1] = BooleanAndOp.BAverageConditional(this.vbool215_B, this.vbool145_uses_F[0]);
     // Message to 'vbool145_uses' from UsesEqualDef factor
     this.vbool145_uses_F[2] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool145_uses_B, this.vbool145_F, 2, this.vbool145_uses_F[2]);
     // Message to 'vbool116_uses' from And factor
     this.vbool116_uses_B[1] = BooleanAndOp.BAverageConditional(this.vbool216_B, this.vbool145_uses_F[2]);
     // Message to 'vbool145_uses' from UsesEqualDef factor
     this.vbool145_uses_F[11] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool145_uses_B, this.vbool145_F, 11, this.vbool145_uses_F[11]);
     // Message to 'vbool67_uses' from AreEqual factor
     this.vbool67_uses_B[1] = BooleanAreEqualOp.AAverageConditional(this.vbool402_B, this.vbool145_uses_F[11]);
     // Message to 'vbool402' from AreEqual factor
     this.vbool402_F = BooleanAreEqualOp.AreEqualAverageConditional(this.vbool67_uses_F[1], this.vbool145_uses_F[11]);
     // Message to 'vbool402_marginal' from ReplicateWithMarginal factor
     this.vbool402_marginal_B = ReplicateOp.MarginalAverageConditional<Bernoulli>(this.vbool402_uses_B, this.vbool402_F, this.vbool402_marginal_B);
     // Message to 'vbool402_uses' from ReplicateWithMarginal factor
     this.vbool402_uses_F[0] = ReplicateOp.UsesAverageConditional<Bernoulli>(this.vbool402_uses_B, this.vbool402_F, 0, this.vbool402_uses_F[0]);
     // Message to 'vbool145_uses' from UsesEqualDef factor
     this.vbool145_uses_F[1] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool145_uses_B, this.vbool145_F, 1, this.vbool145_uses_F[1]);
     // Message to 'vbool20_uses' from AreEqual factor
     this.vbool20_uses_B[0] = BooleanAreEqualOp.AAverageConditional(this.vbool199_B, this.vbool145_uses_F[1]);
     // Message to 'vbool20_marginal' from UsesEqualDef factor
     this.vbool20_marginal_B = UsesEqualDefOp.MarginalAverageConditional<Bernoulli>(this.vbool20_uses_B, this.vbool20_F, this.vbool20_marginal_B);
     // Message to 'vbool199' from AreEqual factor
     this.vbool199_F = BooleanAreEqualOp.AreEqualAverageConditional(this.vbool20_uses_F[0], this.vbool145_uses_F[1]);
     // Message to 'vbool199_marginal' from ReplicateWithMarginal factor
     this.vbool199_marginal_B = ReplicateOp.MarginalAverageConditional<Bernoulli>(this.vbool199_uses_B, this.vbool199_F, this.vbool199_marginal_B);
     // Message to 'vbool20_uses' from UsesEqualDef factor
     this.vbool20_uses_F[1] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool20_uses_B, this.vbool20_F, 1, this.vbool20_uses_F[1]);
     // Message to 'vbool41_uses' from AreEqual factor
     this.vbool41_uses_B[0] = BooleanAreEqualOp.AAverageConditional(this.vbool200_B, this.vbool20_uses_F[1]);
     // Message to 'vbool41_marginal' from UsesEqualDef factor
     this.vbool41_marginal_B = UsesEqualDefOp.MarginalAverageConditional<Bernoulli>(this.vbool41_uses_B, this.vbool41_F, this.vbool41_marginal_B);
     // Message to 'vbool200' from AreEqual factor
     this.vbool200_F = BooleanAreEqualOp.AreEqualAverageConditional(this.vbool41_uses_F[0], this.vbool20_uses_F[1]);
     // Message to 'vbool200_marginal' from ReplicateWithMarginal factor
     this.vbool200_marginal_B = ReplicateOp.MarginalAverageConditional<Bernoulli>(this.vbool200_uses_B, this.vbool200_F, this.vbool200_marginal_B);
     // Message to 'vbool41_uses' from UsesEqualDef factor
     this.vbool41_uses_F[1] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool41_uses_B, this.vbool41_F, 1, this.vbool41_uses_F[1]);
     // Message to 'vbool15_uses' from AreEqual factor
     this.vbool15_uses_B[1] = BooleanAreEqualOp.BAverageConditional(this.vbool410_B, this.vbool41_uses_F[1]);
     // Message to 'vbool15_marginal' from UsesEqualDef factor
     this.vbool15_marginal_B = UsesEqualDefOp.MarginalAverageConditional<Bernoulli>(this.vbool15_uses_B, this.vbool15_F, this.vbool15_marginal_B);
     // Message to 'vbool410' from AreEqual factor
     this.vbool410_F = BooleanAreEqualOp.AreEqualAverageConditional(this.vbool41_uses_F[1], this.vbool15_uses_F[1]);
     // Message to 'vbool410_marginal' from ReplicateWithMarginal factor
     this.vbool410_marginal_B = ReplicateOp.MarginalAverageConditional<Bernoulli>(this.vbool410_uses_B, this.vbool410_F, this.vbool410_marginal_B);
     // Message to 'vbool15_uses' from UsesEqualDef factor
     this.vbool15_uses_F[0] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool15_uses_B, this.vbool15_F, 0, this.vbool15_uses_F[0]);
     // Message to 'vbool46_uses' from AreEqual factor
     this.vbool46_uses_B[1] = BooleanAreEqualOp.AAverageConditional(this.vbool189_B, this.vbool15_uses_F[0]);
     // Message to 'vbool46_marginal' from UsesEqualDef factor
     this.vbool46_marginal_B = UsesEqualDefOp.MarginalAverageConditional<Bernoulli>(this.vbool46_uses_B, this.vbool46_F, this.vbool46_marginal_B);
     // Message to 'vbool189' from AreEqual factor
     this.vbool189_F = BooleanAreEqualOp.AreEqualAverageConditional(this.vbool46_uses_F[1], this.vbool15_uses_F[0]);
     // Message to 'vbool189_marginal' from ReplicateWithMarginal factor
     this.vbool189_marginal_B = ReplicateOp.MarginalAverageConditional<Bernoulli>(this.vbool189_uses_B, this.vbool189_F, this.vbool189_marginal_B);
     // Message to 'vbool46_uses' from UsesEqualDef factor
     this.vbool46_uses_F[0] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool46_uses_B, this.vbool46_F, 0, this.vbool46_uses_F[0]);
     // Message to 'vbool67_uses' from AreEqual factor
     this.vbool67_uses_B[3] = BooleanAreEqualOp.AAverageConditional(this.vbool205_B, this.vbool46_uses_F[0]);
     // Message to 'vbool67_marginal' from UsesEqualDef factor
     this.vbool67_marginal_B = UsesEqualDefOp.MarginalAverageConditional<Bernoulli>(this.vbool67_uses_B, this.vbool67_F, this.vbool67_marginal_B);
     // Message to 'vbool205' from AreEqual factor
     this.vbool205_F = BooleanAreEqualOp.AreEqualAverageConditional(this.vbool67_uses_F[3], this.vbool46_uses_F[0]);
     // Message to 'vbool205_marginal' from ReplicateWithMarginal factor
     this.vbool205_marginal_B = ReplicateOp.MarginalAverageConditional<Bernoulli>(this.vbool205_uses_B, this.vbool205_F, this.vbool205_marginal_B);
     // Message to 'vbool67_uses' from UsesEqualDef factor
     this.vbool67_uses_F[0] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool67_uses_B, this.vbool67_F, 0, this.vbool67_uses_F[0]);
     // Message to 'vbool72_uses' from AreEqual factor
     this.vbool72_uses_B[1] = BooleanAreEqualOp.BAverageConditional(this.vbool407_B, this.vbool67_uses_F[0]);
     // Message to 'vbool72_marginal' from UsesEqualDef factor
     this.vbool72_marginal_B = UsesEqualDefOp.MarginalAverageConditional<Bernoulli>(this.vbool72_uses_B, this.vbool72_F, this.vbool72_marginal_B);
     // Message to 'vbool407' from AreEqual factor
     this.vbool407_F = BooleanAreEqualOp.AreEqualAverageConditional(this.vbool67_uses_F[0], this.vbool72_uses_F[1]);
     // Message to 'vbool407_marginal' from ReplicateWithMarginal factor
     this.vbool407_marginal_B = ReplicateOp.MarginalAverageConditional<Bernoulli>(this.vbool407_uses_B, this.vbool407_F, this.vbool407_marginal_B);
     // Message to 'vbool72_uses' from UsesEqualDef factor
     this.vbool72_uses_F[0] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool72_uses_B, this.vbool72_F, 0, this.vbool72_uses_F[0]);
     // Message to 'vbool90_uses' from AreEqual factor
     this.vbool90_uses_B[1] = BooleanAreEqualOp.AAverageConditional(this.vbool210_B, this.vbool72_uses_F[0]);
     // Message to 'vbool90_marginal' from UsesEqualDef factor
     this.vbool90_marginal_B = UsesEqualDefOp.MarginalAverageConditional<Bernoulli>(this.vbool90_uses_B, this.vbool90_F, this.vbool90_marginal_B);
     // Message to 'vbool210' from AreEqual factor
     this.vbool210_F = BooleanAreEqualOp.AreEqualAverageConditional(this.vbool90_uses_F[1], this.vbool72_uses_F[0]);
     // Message to 'vbool210_marginal' from ReplicateWithMarginal factor
     this.vbool210_marginal_B = ReplicateOp.MarginalAverageConditional<Bernoulli>(this.vbool210_uses_B, this.vbool210_F, this.vbool210_marginal_B);
     // Message to 'vbool90_uses' from UsesEqualDef factor
     this.vbool90_uses_F[0] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool90_uses_B, this.vbool90_F, 0, this.vbool90_uses_F[0]);
     // Message to 'vbool155_uses' from AreEqual factor
     this.vbool155_uses_B[2] = BooleanAreEqualOp.BAverageConditional(this.vbool451_B, this.vbool90_uses_F[0]);
     // Message to 'vbool451' from AreEqual factor
     this.vbool451_F = BooleanAreEqualOp.AreEqualAverageConditional(this.vbool90_uses_F[0], this.vbool155_uses_F[2]);
     // Message to 'vbool451_marginal' from ReplicateWithMarginal factor
     this.vbool451_marginal_B = ReplicateOp.MarginalAverageConditional<Bernoulli>(this.vbool451_uses_B, this.vbool451_F, this.vbool451_marginal_B);
     // Message to 'vbool67_uses' from UsesEqualDef factor
     this.vbool67_uses_F[2] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool67_uses_B, this.vbool67_F, 2, this.vbool67_uses_F[2]);
     // Message to 'vbool116_uses' from AreEqual factor
     this.vbool116_uses_B[2] = BooleanAreEqualOp.BAverageConditional(this.vbool405_B, this.vbool67_uses_F[2]);
     // Message to 'vbool116_marginal' from UsesEqualDef factor
     this.vbool116_marginal_B = UsesEqualDefOp.MarginalAverageConditional<Bernoulli>(this.vbool116_uses_B, this.vbool116_F, this.vbool116_marginal_B);
     // Message to 'vbool405' from AreEqual factor
     this.vbool405_F = BooleanAreEqualOp.AreEqualAverageConditional(this.vbool67_uses_F[2], this.vbool116_uses_F[2]);
     // Message to 'vbool405_marginal' from ReplicateWithMarginal factor
     this.vbool405_marginal_B = ReplicateOp.MarginalAverageConditional<Bernoulli>(this.vbool405_uses_B, this.vbool405_F, this.vbool405_marginal_B);
     // Message to 'vbool116_uses' from UsesEqualDef factor
     this.vbool116_uses_F[0] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool116_uses_B, this.vbool116_F, 0, this.vbool116_uses_F[0]);
     // Message to 'vbool405_uses' from ReplicateWithMarginal factor
     this.vbool405_uses_F[0] = ReplicateOp.UsesAverageConditional<Bernoulli>(this.vbool405_uses_B, this.vbool405_F, 0, this.vbool405_uses_F[0]);
     // Message to 'vbool407_uses' from ReplicateWithMarginal factor
     this.vbool407_uses_F[0] = ReplicateOp.UsesAverageConditional<Bernoulli>(this.vbool407_uses_B, this.vbool407_F, 0, this.vbool407_uses_F[0]);
     // Message to 'vbool145_uses' from UsesEqualDef factor
     this.vbool145_uses_F[3] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool145_uses_B, this.vbool145_F, 3, this.vbool145_uses_F[3]);
     // Message to 'vbool107_uses' from And factor
     this.vbool107_uses_B[0] = BooleanAndOp.BAverageConditional(this.vbool218_B, this.vbool145_uses_F[3]);
     // Message to 'vbool145_uses' from UsesEqualDef factor
     this.vbool145_uses_F[7] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool145_uses_B, this.vbool145_F, 7, this.vbool145_uses_F[7]);
     // Message to 'vbool110_uses' from And factor
     this.vbool110_uses_B[1] = BooleanAndOp.BAverageConditional(this.vbool230_B, this.vbool145_uses_F[7]);
     // Message to 'vbool110_marginal' from UsesEqualDef factor
     this.vbool110_marginal_B = UsesEqualDefOp.MarginalAverageConditional<Bernoulli>(this.vbool110_uses_B, this.vbool110_F, this.vbool110_marginal_B);
     // Message to 'vbool230' from And factor
     this.vbool230_F = BooleanAndOp.AndAverageConditional(this.vbool145_uses_F[7], this.vbool110_uses_F[1]);
     // Message to 'vbool230_marginal' from ReplicateWithMarginal factor
     this.vbool230_marginal_B = ReplicateOp.MarginalAverageConditional<Bernoulli>(this.vbool230_uses_B, this.vbool230_F, this.vbool230_marginal_B);
     // Message to 'vbool110_uses' from UsesEqualDef factor
     this.vbool110_uses_F[2] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool110_uses_B, this.vbool110_F, 2, this.vbool110_uses_F[2]);
     // Message to 'vbool145_uses' from And factor
     this.vbool145_uses_B[9] = BooleanAndOp.AAverageConditional(this.vbool236_B, this.vbool110_uses_F[2]);
     // Message to 'vbool145_marginal' from UsesEqualDef factor
     this.vbool145_marginal_B = UsesEqualDefOp.MarginalAverageConditional<Bernoulli>(this.vbool145_uses_B, this.vbool145_F, this.vbool145_marginal_B);
     // Message to 'vbool236' from And factor
     this.vbool236_F = BooleanAndOp.AndAverageConditional(this.vbool145_uses_F[9], this.vbool110_uses_F[2]);
     // Message to 'vbool236_marginal' from ReplicateWithMarginal factor
     this.vbool236_marginal_B = ReplicateOp.MarginalAverageConditional<Bernoulli>(this.vbool236_uses_B, this.vbool236_F, this.vbool236_marginal_B);
     // Message to 'vbool145_uses' from UsesEqualDef factor
     this.vbool145_uses_F[5] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool145_uses_B, this.vbool145_F, 5, this.vbool145_uses_F[5]);
     // Message to 'vbool108_uses' from And factor
     this.vbool108_uses_B[0] = BooleanAndOp.BAverageConditional(this.vbool224_B, this.vbool145_uses_F[5]);
     // Message to 'vbool145_uses' from UsesEqualDef factor
     this.vbool145_uses_F[6] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool145_uses_B, this.vbool145_F, 6, this.vbool145_uses_F[6]);
     // Message to 'vbool108_uses' from And factor
     this.vbool108_uses_B[1] = BooleanAndOp.BAverageConditional(this.vbool227_B, this.vbool145_uses_F[6]);
     // Message to 'vbool108_marginal' from UsesEqualDef factor
     this.vbool108_marginal_B = UsesEqualDefOp.MarginalAverageConditional<Bernoulli>(this.vbool108_uses_B, this.vbool108_F, this.vbool108_marginal_B);
     // Message to 'vbool145_uses' from UsesEqualDef factor
     this.vbool145_uses_F[8] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool145_uses_B, this.vbool145_F, 8, this.vbool145_uses_F[8]);
     // Message to 'vbool109_uses' from And factor
     this.vbool109_uses_B[0] = BooleanAndOp.BAverageConditional(this.vbool233_B, this.vbool145_uses_F[8]);
     // Message to 'vbool145_uses' from UsesEqualDef factor
     this.vbool145_uses_F[10] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool145_uses_B, this.vbool145_F, 10, this.vbool145_uses_F[10]);
     // Message to 'vbool109_uses' from And factor
     this.vbool109_uses_B[1] = BooleanAndOp.BAverageConditional(this.vbool239_B, this.vbool145_uses_F[10]);
     // Message to 'vbool109_marginal' from UsesEqualDef factor
     this.vbool109_marginal_B = UsesEqualDefOp.MarginalAverageConditional<Bernoulli>(this.vbool109_uses_B, this.vbool109_F, this.vbool109_marginal_B);
     // Message to 'vbool110_uses' from UsesEqualDef factor
     this.vbool110_uses_F[4] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool110_uses_B, this.vbool110_F, 4, this.vbool110_uses_F[4]);
     // Message to 'vbool110_uses' from UsesEqualDef factor
     this.vbool110_uses_F[5] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool110_uses_B, this.vbool110_F, 5, this.vbool110_uses_F[5]);
     // Message to 'vbool108_uses' from UsesEqualDef factor
     this.vbool108_uses_F[3] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool108_uses_B, this.vbool108_F, 3, this.vbool108_uses_F[3]);
     // Message to 'vbool108_uses' from UsesEqualDef factor
     this.vbool108_uses_F[4] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool108_uses_B, this.vbool108_F, 4, this.vbool108_uses_F[4]);
     // Message to 'vbool109_uses' from UsesEqualDef factor
     this.vbool109_uses_F[3] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool109_uses_B, this.vbool109_F, 3, this.vbool109_uses_F[3]);
     // Message to 'vbool109_uses' from UsesEqualDef factor
     this.vbool109_uses_F[4] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool109_uses_B, this.vbool109_F, 4, this.vbool109_uses_F[4]);
     // Message to 'vbool110_uses' from UsesEqualDef factor
     this.vbool110_uses_F[3] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool110_uses_B, this.vbool110_F, 3, this.vbool110_uses_F[3]);
     // Message to 'vbool106_uses' from AreEqual factor
     this.vbool106_uses_B[0] = BooleanAreEqualOp.BAverageConditional(this.vbool193_B, this.vbool110_uses_F[3]);
     // Message to 'vbool106_marginal' from UsesEqualDef factor
     this.vbool106_marginal_B = UsesEqualDefOp.MarginalAverageConditional<Bernoulli>(this.vbool106_uses_B, this.vbool106_F, this.vbool106_marginal_B);
     // Message to 'vbool193' from AreEqual factor
     this.vbool193_F = BooleanAreEqualOp.AreEqualAverageConditional(this.vbool110_uses_F[3], this.vbool106_uses_F[0]);
     // Message to 'vbool193_marginal' from ReplicateWithMarginal factor
     this.vbool193_marginal_B = ReplicateOp.MarginalAverageConditional<Bernoulli>(this.vbool193_uses_B, this.vbool193_F, this.vbool193_marginal_B);
     // Message to 'vbool110_uses' from UsesEqualDef factor
     this.vbool110_uses_F[6] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool110_uses_B, this.vbool110_F, 6, this.vbool110_uses_F[6]);
     // Message to 'vbool108_uses' from UsesEqualDef factor
     this.vbool108_uses_F[5] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool108_uses_B, this.vbool108_F, 5, this.vbool108_uses_F[5]);
     // Message to 'vbool108_uses' from UsesEqualDef factor
     this.vbool108_uses_F[6] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool108_uses_B, this.vbool108_F, 6, this.vbool108_uses_F[6]);
     // Message to 'vbool110_uses' from UsesEqualDef factor
     this.vbool110_uses_F[7] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool110_uses_B, this.vbool110_F, 7, this.vbool110_uses_F[7]);
     // Message to 'vbool109_uses' from UsesEqualDef factor
     this.vbool109_uses_F[5] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool109_uses_B, this.vbool109_F, 5, this.vbool109_uses_F[5]);
     // Message to 'vbool109_uses' from UsesEqualDef factor
     this.vbool109_uses_F[6] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool109_uses_B, this.vbool109_F, 6, this.vbool109_uses_F[6]);
     // Message to 'vbool110_uses' from UsesEqualDef factor
     this.vbool110_uses_F[8] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool110_uses_B, this.vbool110_F, 8, this.vbool110_uses_F[8]);
     // Message to 'vbool108_uses' from UsesEqualDef factor
     this.vbool108_uses_F[2] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool108_uses_B, this.vbool108_F, 2, this.vbool108_uses_F[2]);
     // Message to 'vbool104_uses' from AreEqual factor
     this.vbool104_uses_B[0] = BooleanAreEqualOp.BAverageConditional(this.vbool191_B, this.vbool108_uses_F[2]);
     // Message to 'vbool104_marginal' from UsesEqualDef factor
     this.vbool104_marginal_B = UsesEqualDefOp.MarginalAverageConditional<Bernoulli>(this.vbool104_uses_B, this.vbool104_F, this.vbool104_marginal_B);
     // Message to 'vbool191' from AreEqual factor
     this.vbool191_F = BooleanAreEqualOp.AreEqualAverageConditional(this.vbool108_uses_F[2], this.vbool104_uses_F[0]);
     // Message to 'vbool191_marginal' from ReplicateWithMarginal factor
     this.vbool191_marginal_B = ReplicateOp.MarginalAverageConditional<Bernoulli>(this.vbool191_uses_B, this.vbool191_F, this.vbool191_marginal_B);
     // Message to 'vbool230_uses' from ReplicateWithMarginal factor
     this.vbool230_uses_F[0] = ReplicateOp.UsesAverageConditional<Bernoulli>(this.vbool230_uses_B, this.vbool230_F, 0, this.vbool230_uses_F[0]);
     // Message to 'vbool113_uses' from And factor
     this.vbool113_uses_B[1] = BooleanAndOp.BAverageConditional(this.vbool231_B, this.vbool230_uses_F[0]);
     // Message to 'vbool109_uses' from UsesEqualDef factor
     this.vbool109_uses_F[2] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool109_uses_B, this.vbool109_F, 2, this.vbool109_uses_F[2]);
     // Message to 'vbool105_uses' from AreEqual factor
     this.vbool105_uses_B[0] = BooleanAreEqualOp.BAverageConditional(this.vbool192_B, this.vbool109_uses_F[2]);
     // Message to 'vbool105_marginal' from UsesEqualDef factor
     this.vbool105_marginal_B = UsesEqualDefOp.MarginalAverageConditional<Bernoulli>(this.vbool105_uses_B, this.vbool105_F, this.vbool105_marginal_B);
     // Message to 'vbool192' from AreEqual factor
     this.vbool192_F = BooleanAreEqualOp.AreEqualAverageConditional(this.vbool109_uses_F[2], this.vbool105_uses_F[0]);
     // Message to 'vbool192_marginal' from ReplicateWithMarginal factor
     this.vbool192_marginal_B = ReplicateOp.MarginalAverageConditional<Bernoulli>(this.vbool192_uses_B, this.vbool192_F, this.vbool192_marginal_B);
     // Message to 'vbool236_uses' from ReplicateWithMarginal factor
     this.vbool236_uses_F[0] = ReplicateOp.UsesAverageConditional<Bernoulli>(this.vbool236_uses_B, this.vbool236_F, 0, this.vbool236_uses_F[0]);
     // Message to 'vbool114_uses' from And factor
     this.vbool114_uses_B[1] = BooleanAndOp.BAverageConditional(this.vbool237_B, this.vbool236_uses_F[0]);
     // Message to 'vbool106_uses' from UsesEqualDef factor
     this.vbool106_uses_F[1] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool106_uses_B, this.vbool106_F, 1, this.vbool106_uses_F[1]);
     // Message to 'vbool184_uses' from AreEqual factor
     this.vbool184_uses_B[0] = BooleanAreEqualOp.BAverageConditional(this.vbool450_B, this.vbool106_uses_F[1]);
     // Message to 'vbool450' from AreEqual factor
     this.vbool450_F = BooleanAreEqualOp.AreEqualAverageConditional(this.vbool106_uses_F[1], this.vbool184_uses_F[0]);
     // Message to 'vbool450_marginal' from ReplicateWithMarginal factor
     this.vbool450_marginal_B = ReplicateOp.MarginalAverageConditional<Bernoulli>(this.vbool450_uses_B, this.vbool450_F, this.vbool450_marginal_B);
     // Message to 'vbool104_uses' from UsesEqualDef factor
     this.vbool104_uses_F[1] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool104_uses_B, this.vbool104_F, 1, this.vbool104_uses_F[1]);
     // Message to 'vbool182_uses' from AreEqual factor
     this.vbool182_uses_B[0] = BooleanAreEqualOp.BAverageConditional(this.vbool448_B, this.vbool104_uses_F[1]);
     // Message to 'vbool448' from AreEqual factor
     this.vbool448_F = BooleanAreEqualOp.AreEqualAverageConditional(this.vbool104_uses_F[1], this.vbool182_uses_F[0]);
     // Message to 'vbool448_marginal' from ReplicateWithMarginal factor
     this.vbool448_marginal_B = ReplicateOp.MarginalAverageConditional<Bernoulli>(this.vbool448_uses_B, this.vbool448_F, this.vbool448_marginal_B);
     // Message to 'vbool105_uses' from UsesEqualDef factor
     this.vbool105_uses_F[1] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool105_uses_B, this.vbool105_F, 1, this.vbool105_uses_F[1]);
     // Message to 'vbool183_uses' from AreEqual factor
     this.vbool183_uses_B[0] = BooleanAreEqualOp.BAverageConditional(this.vbool449_B, this.vbool105_uses_F[1]);
     // Message to 'vbool449' from AreEqual factor
     this.vbool449_F = BooleanAreEqualOp.AreEqualAverageConditional(this.vbool105_uses_F[1], this.vbool183_uses_F[0]);
     // Message to 'vbool449_marginal' from ReplicateWithMarginal factor
     this.vbool449_marginal_B = ReplicateOp.MarginalAverageConditional<Bernoulli>(this.vbool449_uses_B, this.vbool449_F, this.vbool449_marginal_B);
 }
Ejemplo n.º 35
0
 /// <include file='FactorDocs.xml' path='factor_docs/message_op_class[@name="BooleanOrOp"]/message_doc[@name="BAverageConditional(bool, Bernoulli)"]/*'/>
 public static Bernoulli BAverageConditional(bool or, Bernoulli A)
 {
     return(AAverageConditional(or, A));
 }
Ejemplo n.º 36
0
 /// <summary>EP message to <c>b</c>.</summary>
 /// <param name="and">Incoming message from <c>and</c>. Must be a proper distribution. If uniform, the result will be uniform.</param>
 /// <param name="A">Incoming message from <c>a</c>.</param>
 /// <returns>The outgoing EP message to the <c>b</c> argument.</returns>
 /// <remarks>
 ///   <para>The outgoing message is a distribution matching the moments of <c>b</c> as the random arguments are varied. The formula is <c>proj[p(b) sum_(and,a) p(and,a) factor(and,a,b)]/p(b)</c>.</para>
 /// </remarks>
 /// <exception cref="ImproperMessageException">
 ///   <paramref name="and" /> is not a proper distribution.</exception>
 public static Bernoulli BAverageConditional([SkipIfUniform] Bernoulli and, Bernoulli A)
 {
     return(AAverageConditional(and, A));
 }
Ejemplo n.º 37
0
 /// <include file='FactorDocs.xml' path='factor_docs/message_op_class[@name="BooleanOrOp"]/message_doc[@name="LogAverageFactor(Bernoulli, Bernoulli)"]/*'/>
 public static double LogAverageFactor(Bernoulli or, [Fresh] Bernoulli to_or)
 {
     return(to_or.GetLogAverageOf(or));
 }
Ejemplo n.º 38
0
        /// <include file='FactorDocs.xml' path='factor_docs/message_op_class[@name="BooleanOrOp"]/message_doc[@name="LogAverageFactor(bool, Bernoulli, bool)"]/*'/>
        public static double LogAverageFactor(bool or, Bernoulli a, bool b)
        {
            Bernoulli to_or = OrAverageConditional(a, b);

            return(to_or.GetLogProb(or));
        }
Ejemplo n.º 39
0
 /// <summary>
 /// Creates message arrays and initialises their values ready for inference to be performed.
 /// </summary>
 /// <remarks>
 /// This method should be called once each time inference is performed. Since the initialisation
 /// procedure normally dependson external values such as priors and array sizes, all external
 /// values must be set before calling this method.
 /// 
 /// As well as initialising message arrays, this method also performs any message passing that
 /// the scheduler determines need only be carried out once.
 /// </remarks>
 public void Initialise()
 {
     this.vbool296_marginal_B = ArrayHelper.MakeUniform<Bernoulli>(new Bernoulli());
     this.vbool360_marginal_B = ArrayHelper.MakeUniform<Bernoulli>(new Bernoulli());
     this.vbool344_marginal_B = ArrayHelper.MakeUniform<Bernoulli>(new Bernoulli());
     this.vbool352_marginal_B = ArrayHelper.MakeUniform<Bernoulli>(new Bernoulli());
     this.vbool336_marginal_B = ArrayHelper.MakeUniform<Bernoulli>(new Bernoulli());
     this.vbool320_marginal_B = ArrayHelper.MakeUniform<Bernoulli>(new Bernoulli());
     this.vbool457_marginal_B = ArrayHelper.MakeUniform<Bernoulli>(new Bernoulli());
     this.vbool304_marginal_B = ArrayHelper.MakeUniform<Bernoulli>(new Bernoulli());
     this.vbool312_marginal_B = ArrayHelper.MakeUniform<Bernoulli>(new Bernoulli());
     this.vbool433_marginal_B = ArrayHelper.MakeUniform<Bernoulli>(new Bernoulli());
     this.vbool288_marginal_B = ArrayHelper.MakeUniform<Bernoulli>(new Bernoulli());
     this.vbool328_marginal_B = ArrayHelper.MakeUniform<Bernoulli>(new Bernoulli());
     this.vbool425_marginal_B = ArrayHelper.MakeUniform<Bernoulli>(new Bernoulli());
     this.vbool458_marginal_B = ArrayHelper.MakeUniform<Bernoulli>(new Bernoulli());
     this.vbool29_marginal_B = ArrayHelper.MakeUniform<Bernoulli>(vBernoulli37);
     this.vbool21_marginal_B = ArrayHelper.MakeUniform<Bernoulli>(vBernoulli29);
     this.vbool133_marginal_B = ArrayHelper.MakeUniform<Bernoulli>(vBernoulli141);
     this.vbool117_marginal_B = ArrayHelper.MakeUniform<Bernoulli>(vBernoulli125);
     this.vbool125_marginal_B = ArrayHelper.MakeUniform<Bernoulli>(vBernoulli133);
     this.vbool94_marginal_B = ArrayHelper.MakeUniform<Bernoulli>(vBernoulli102);
     this.vbool55_marginal_B = ArrayHelper.MakeUniform<Bernoulli>(vBernoulli63);
     this.vbool172_marginal_B = ArrayHelper.MakeUniform<Bernoulli>(vBernoulli180);
     this.vbool47_marginal_B = ArrayHelper.MakeUniform<Bernoulli>(vBernoulli55);
     this.vbool73_marginal_B = ArrayHelper.MakeUniform<Bernoulli>(vBernoulli81);
     this.vbool164_marginal_B = ArrayHelper.MakeUniform<Bernoulli>(vBernoulli172);
     this.vbool3_marginal_B = ArrayHelper.MakeUniform<Bernoulli>(vBernoulli11);
     this.vbool81_marginal_B = ArrayHelper.MakeUniform<Bernoulli>(vBernoulli89);
     this.vbool146_marginal_B = ArrayHelper.MakeUniform<Bernoulli>(vBernoulli154);
 }
Ejemplo n.º 40
0
 /// <include file='FactorDocs.xml' path='factor_docs/message_op_class[@name="BooleanOrOp"]/message_doc[@name="LogAverageFactor(bool, bool, Bernoulli)"]/*'/>
 public static double LogAverageFactor(bool or, bool a, Bernoulli b)
 {
     return(LogAverageFactor(or, b, a));
 }
Ejemplo n.º 41
0
 /// <summary>
 /// Performs one iteration of inference.
 /// </summary>
 /// <remarks>
 /// This method should be called multiple times, after calling Initialise(), in order to perform
 /// multiple iterations of message passing.  You can call methods to retrieve posterior marginals
 /// at any time - the returned marginal will be the estimated marginal given the current state of
 /// the message passing algorithm.  This can be useful for monitoring convergence of the algorithm.
 /// 
 /// Where the scheduler has determined inference can be performed without iteration, this method
 /// does nothing.
 /// </remarks>
 public void Update()
 {
     // Message to 'vbool133_uses' from UsesEqualDef factor
     this.vbool133_uses_F[1] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool133_uses_B, this.vbool133_F, 1, this.vbool133_uses_F[1]);
     // Message to 'vbool117_uses' from AreEqual factor
     this.vbool117_uses_B[0] = BooleanAreEqualOp.BAverageConditional(this.vbool344_B, this.vbool133_uses_F[1]);
     // Message to 'vbool117_uses' from UsesEqualDef factor
     this.vbool117_uses_F[1] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool117_uses_B, this.vbool117_F, 1, this.vbool117_uses_F[1]);
     // Message to 'vbool94_uses' from AreEqual factor
     this.vbool94_uses_B[0] = BooleanAreEqualOp.AAverageConditional(this.vbool336_B, this.vbool117_uses_F[1]);
     // Message to 'vbool94_uses' from UsesEqualDef factor
     this.vbool94_uses_F[1] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool94_uses_B, this.vbool94_F, 1, this.vbool94_uses_F[1]);
     // Message to 'vbool172_uses' from AreEqual factor
     this.vbool172_uses_B[0] = BooleanAreEqualOp.BAverageConditional(this.vbool457_B, this.vbool94_uses_F[1]);
     // Message to 'vbool172_uses' from UsesEqualDef factor
     this.vbool172_uses_F[1] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool172_uses_B, this.vbool172_F, 1, this.vbool172_uses_F[1]);
     // Message to 'vbool164_uses' from AreEqual factor
     this.vbool164_uses_B[0] = BooleanAreEqualOp.BAverageConditional(this.vbool433_B, this.vbool172_uses_F[1]);
     // Message to 'vbool164_uses' from UsesEqualDef factor
     this.vbool164_uses_F[1] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool164_uses_B, this.vbool164_F, 1, this.vbool164_uses_F[1]);
     // Message to 'vbool146_uses' from AreEqual factor
     this.vbool146_uses_B[0] = BooleanAreEqualOp.AAverageConditional(this.vbool425_B, this.vbool164_uses_F[1]);
     // Message to 'vbool146_uses' from UsesEqualDef factor
     this.vbool146_uses_F[1] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool146_uses_B, this.vbool146_F, 1, this.vbool146_uses_F[1]);
     // Message to 'vbool81_uses' from AreEqual factor
     this.vbool81_uses_B[1] = BooleanAreEqualOp.AAverageConditional(this.vbool458_B, this.vbool146_uses_F[1]);
     // Message to 'vbool81_uses' from UsesEqualDef factor
     this.vbool81_uses_F[0] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool81_uses_B, this.vbool81_F, 0, this.vbool81_uses_F[0]);
     // Message to 'vbool73_uses' from AreEqual factor
     this.vbool73_uses_B[1] = BooleanAreEqualOp.BAverageConditional(this.vbool328_B, this.vbool81_uses_F[0]);
     // Message to 'vbool73_uses' from UsesEqualDef factor
     this.vbool73_uses_F[0] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool73_uses_B, this.vbool73_F, 0, this.vbool73_uses_F[0]);
     // Message to 'vbool55_uses' from AreEqual factor
     this.vbool55_uses_B[2] = BooleanAreEqualOp.AAverageConditional(this.vbool312_B, this.vbool73_uses_F[0]);
     // Message to 'vbool55_uses' from UsesEqualDef factor
     this.vbool55_uses_F[0] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool55_uses_B, this.vbool55_F, 0, this.vbool55_uses_F[0]);
     // Message to 'vbool125_uses' from AreEqual factor
     this.vbool125_uses_B[1] = BooleanAreEqualOp.BAverageConditional(this.vbool320_B, this.vbool55_uses_F[0]);
     // Message to 'vbool125_uses' from UsesEqualDef factor
     this.vbool125_uses_F[0] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool125_uses_B, this.vbool125_F, 0, this.vbool125_uses_F[0]);
     // Message to 'vbool133_uses' from AreEqual factor
     this.vbool133_uses_B[2] = BooleanAreEqualOp.AAverageConditional(this.vbool352_B, this.vbool125_uses_F[0]);
     // Message to 'vbool133_uses' from UsesEqualDef factor
     this.vbool133_uses_F[0] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool133_uses_B, this.vbool133_F, 0, this.vbool133_uses_F[0]);
     // Message to 'vbool21_uses' from AreEqual factor
     this.vbool21_uses_B[1] = BooleanAreEqualOp.BAverageConditional(this.vbool360_B, this.vbool133_uses_F[0]);
     // Message to 'vbool21_marginal' from UsesEqualDef factor
     this.vbool21_marginal_B = UsesEqualDefOp.MarginalAverageConditional<Bernoulli>(this.vbool21_uses_B, this.vbool21_F, this.vbool21_marginal_B);
     // Message to 'vbool360' from AreEqual factor
     this.vbool360_F = BooleanAreEqualOp.AreEqualAverageConditional(this.vbool133_uses_F[0], this.vbool21_uses_F[1]);
     // Message to 'vbool360_marginal' from ReplicateWithMarginal factor
     this.vbool360_marginal_B = ReplicateOp.MarginalAverageConditional<Bernoulli>(this.vbool360_uses_B, this.vbool360_F, this.vbool360_marginal_B);
     // Message to 'vbool21_uses' from UsesEqualDef factor
     this.vbool21_uses_F[0] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool21_uses_B, this.vbool21_F, 0, this.vbool21_uses_F[0]);
     // Message to 'vbool29_uses' from AreEqual factor
     this.vbool29_uses_B[0] = BooleanAreEqualOp.AAverageConditional(this.vbool296_B, this.vbool21_uses_F[0]);
     // Message to 'vbool29_marginal' from UsesEqualDef factor
     this.vbool29_marginal_B = UsesEqualDefOp.MarginalAverageConditional<Bernoulli>(this.vbool29_uses_B, this.vbool29_F, this.vbool29_marginal_B);
     // Message to 'vbool296' from AreEqual factor
     this.vbool296_F = BooleanAreEqualOp.AreEqualAverageConditional(this.vbool29_uses_F[0], this.vbool21_uses_F[0]);
     // Message to 'vbool296_marginal' from ReplicateWithMarginal factor
     this.vbool296_marginal_B = ReplicateOp.MarginalAverageConditional<Bernoulli>(this.vbool296_uses_B, this.vbool296_F, this.vbool296_marginal_B);
     // Message to 'vbool133_uses' from UsesEqualDef factor
     this.vbool133_uses_F[2] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool133_uses_B, this.vbool133_F, 2, this.vbool133_uses_F[2]);
     // Message to 'vbool125_uses' from AreEqual factor
     this.vbool125_uses_B[0] = BooleanAreEqualOp.BAverageConditional(this.vbool352_B, this.vbool133_uses_F[2]);
     // Message to 'vbool125_marginal' from UsesEqualDef factor
     this.vbool125_marginal_B = UsesEqualDefOp.MarginalAverageConditional<Bernoulli>(this.vbool125_uses_B, this.vbool125_F, this.vbool125_marginal_B);
     // Message to 'vbool352' from AreEqual factor
     this.vbool352_F = BooleanAreEqualOp.AreEqualAverageConditional(this.vbool133_uses_F[2], this.vbool125_uses_F[0]);
     // Message to 'vbool352_marginal' from ReplicateWithMarginal factor
     this.vbool352_marginal_B = ReplicateOp.MarginalAverageConditional<Bernoulli>(this.vbool352_uses_B, this.vbool352_F, this.vbool352_marginal_B);
     // Message to 'vbool125_uses' from UsesEqualDef factor
     this.vbool125_uses_F[1] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool125_uses_B, this.vbool125_F, 1, this.vbool125_uses_F[1]);
     // Message to 'vbool55_uses' from AreEqual factor
     this.vbool55_uses_B[0] = BooleanAreEqualOp.AAverageConditional(this.vbool320_B, this.vbool125_uses_F[1]);
     // Message to 'vbool55_marginal' from UsesEqualDef factor
     this.vbool55_marginal_B = UsesEqualDefOp.MarginalAverageConditional<Bernoulli>(this.vbool55_uses_B, this.vbool55_F, this.vbool55_marginal_B);
     // Message to 'vbool320' from AreEqual factor
     this.vbool320_F = BooleanAreEqualOp.AreEqualAverageConditional(this.vbool55_uses_F[0], this.vbool125_uses_F[1]);
     // Message to 'vbool320_marginal' from ReplicateWithMarginal factor
     this.vbool320_marginal_B = ReplicateOp.MarginalAverageConditional<Bernoulli>(this.vbool320_uses_B, this.vbool320_F, this.vbool320_marginal_B);
     // Message to 'vbool55_uses' from UsesEqualDef factor
     this.vbool55_uses_F[1] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool55_uses_B, this.vbool55_F, 1, this.vbool55_uses_F[1]);
     // Message to 'vbool47_uses' from AreEqual factor
     this.vbool47_uses_B[0] = BooleanAreEqualOp.BAverageConditional(this.vbool304_B, this.vbool55_uses_F[1]);
     // Message to 'vbool47_marginal' from UsesEqualDef factor
     this.vbool47_marginal_B = UsesEqualDefOp.MarginalAverageConditional<Bernoulli>(this.vbool47_uses_B, this.vbool47_F, this.vbool47_marginal_B);
     // Message to 'vbool304' from AreEqual factor
     this.vbool304_F = BooleanAreEqualOp.AreEqualAverageConditional(this.vbool55_uses_F[1], this.vbool47_uses_F[0]);
     // Message to 'vbool304_marginal' from ReplicateWithMarginal factor
     this.vbool304_marginal_B = ReplicateOp.MarginalAverageConditional<Bernoulli>(this.vbool304_uses_B, this.vbool304_F, this.vbool304_marginal_B);
     // Message to 'vbool55_uses' from UsesEqualDef factor
     this.vbool55_uses_F[2] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool55_uses_B, this.vbool55_F, 2, this.vbool55_uses_F[2]);
     // Message to 'vbool73_uses' from AreEqual factor
     this.vbool73_uses_B[0] = BooleanAreEqualOp.BAverageConditional(this.vbool312_B, this.vbool55_uses_F[2]);
     // Message to 'vbool73_marginal' from UsesEqualDef factor
     this.vbool73_marginal_B = UsesEqualDefOp.MarginalAverageConditional<Bernoulli>(this.vbool73_uses_B, this.vbool73_F, this.vbool73_marginal_B);
     // Message to 'vbool312' from AreEqual factor
     this.vbool312_F = BooleanAreEqualOp.AreEqualAverageConditional(this.vbool55_uses_F[2], this.vbool73_uses_F[0]);
     // Message to 'vbool312_marginal' from ReplicateWithMarginal factor
     this.vbool312_marginal_B = ReplicateOp.MarginalAverageConditional<Bernoulli>(this.vbool312_uses_B, this.vbool312_F, this.vbool312_marginal_B);
     // Message to 'vbool47_uses' from UsesEqualDef factor
     this.vbool47_uses_F[1] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool47_uses_B, this.vbool47_F, 1, this.vbool47_uses_F[1]);
     // Message to 'vbool3_uses' from AreEqual factor
     this.vbool3_uses_B[0] = BooleanAreEqualOp.AAverageConditional(this.vbool288_B, this.vbool47_uses_F[1]);
     // Message to 'vbool3_marginal' from UsesEqualDef factor
     this.vbool3_marginal_B = UsesEqualDefOp.MarginalAverageConditional<Bernoulli>(this.vbool3_uses_B, this.vbool3_F, this.vbool3_marginal_B);
     // Message to 'vbool288' from AreEqual factor
     this.vbool288_F = BooleanAreEqualOp.AreEqualAverageConditional(this.vbool3_uses_F[0], this.vbool47_uses_F[1]);
     // Message to 'vbool288_marginal' from ReplicateWithMarginal factor
     this.vbool288_marginal_B = ReplicateOp.MarginalAverageConditional<Bernoulli>(this.vbool288_uses_B, this.vbool288_F, this.vbool288_marginal_B);
     // Message to 'vbool73_uses' from UsesEqualDef factor
     this.vbool73_uses_F[1] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool73_uses_B, this.vbool73_F, 1, this.vbool73_uses_F[1]);
     // Message to 'vbool81_uses' from AreEqual factor
     this.vbool81_uses_B[0] = BooleanAreEqualOp.AAverageConditional(this.vbool328_B, this.vbool73_uses_F[1]);
     // Message to 'vbool81_marginal' from UsesEqualDef factor
     this.vbool81_marginal_B = UsesEqualDefOp.MarginalAverageConditional<Bernoulli>(this.vbool81_uses_B, this.vbool81_F, this.vbool81_marginal_B);
     // Message to 'vbool328' from AreEqual factor
     this.vbool328_F = BooleanAreEqualOp.AreEqualAverageConditional(this.vbool81_uses_F[0], this.vbool73_uses_F[1]);
     // Message to 'vbool328_marginal' from ReplicateWithMarginal factor
     this.vbool328_marginal_B = ReplicateOp.MarginalAverageConditional<Bernoulli>(this.vbool328_uses_B, this.vbool328_F, this.vbool328_marginal_B);
     // Message to 'vbool81_uses' from UsesEqualDef factor
     this.vbool81_uses_F[1] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool81_uses_B, this.vbool81_F, 1, this.vbool81_uses_F[1]);
     // Message to 'vbool146_uses' from AreEqual factor
     this.vbool146_uses_B[1] = BooleanAreEqualOp.BAverageConditional(this.vbool458_B, this.vbool81_uses_F[1]);
     // Message to 'vbool146_marginal' from UsesEqualDef factor
     this.vbool146_marginal_B = UsesEqualDefOp.MarginalAverageConditional<Bernoulli>(this.vbool146_uses_B, this.vbool146_F, this.vbool146_marginal_B);
     // Message to 'vbool458' from AreEqual factor
     this.vbool458_F = BooleanAreEqualOp.AreEqualAverageConditional(this.vbool81_uses_F[1], this.vbool146_uses_F[1]);
     // Message to 'vbool458_marginal' from ReplicateWithMarginal factor
     this.vbool458_marginal_B = ReplicateOp.MarginalAverageConditional<Bernoulli>(this.vbool458_uses_B, this.vbool458_F, this.vbool458_marginal_B);
     // Message to 'vbool146_uses' from UsesEqualDef factor
     this.vbool146_uses_F[0] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool146_uses_B, this.vbool146_F, 0, this.vbool146_uses_F[0]);
     // Message to 'vbool164_uses' from AreEqual factor
     this.vbool164_uses_B[1] = BooleanAreEqualOp.BAverageConditional(this.vbool425_B, this.vbool146_uses_F[0]);
     // Message to 'vbool164_marginal' from UsesEqualDef factor
     this.vbool164_marginal_B = UsesEqualDefOp.MarginalAverageConditional<Bernoulli>(this.vbool164_uses_B, this.vbool164_F, this.vbool164_marginal_B);
     // Message to 'vbool425' from AreEqual factor
     this.vbool425_F = BooleanAreEqualOp.AreEqualAverageConditional(this.vbool146_uses_F[0], this.vbool164_uses_F[1]);
     // Message to 'vbool425_marginal' from ReplicateWithMarginal factor
     this.vbool425_marginal_B = ReplicateOp.MarginalAverageConditional<Bernoulli>(this.vbool425_uses_B, this.vbool425_F, this.vbool425_marginal_B);
     // Message to 'vbool164_uses' from UsesEqualDef factor
     this.vbool164_uses_F[0] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool164_uses_B, this.vbool164_F, 0, this.vbool164_uses_F[0]);
     // Message to 'vbool172_uses' from AreEqual factor
     this.vbool172_uses_B[1] = BooleanAreEqualOp.AAverageConditional(this.vbool433_B, this.vbool164_uses_F[0]);
     // Message to 'vbool172_marginal' from UsesEqualDef factor
     this.vbool172_marginal_B = UsesEqualDefOp.MarginalAverageConditional<Bernoulli>(this.vbool172_uses_B, this.vbool172_F, this.vbool172_marginal_B);
     // Message to 'vbool433' from AreEqual factor
     this.vbool433_F = BooleanAreEqualOp.AreEqualAverageConditional(this.vbool172_uses_F[1], this.vbool164_uses_F[0]);
     // Message to 'vbool433_marginal' from ReplicateWithMarginal factor
     this.vbool433_marginal_B = ReplicateOp.MarginalAverageConditional<Bernoulli>(this.vbool433_uses_B, this.vbool433_F, this.vbool433_marginal_B);
     // Message to 'vbool172_uses' from UsesEqualDef factor
     this.vbool172_uses_F[0] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool172_uses_B, this.vbool172_F, 0, this.vbool172_uses_F[0]);
     // Message to 'vbool94_uses' from AreEqual factor
     this.vbool94_uses_B[1] = BooleanAreEqualOp.AAverageConditional(this.vbool457_B, this.vbool172_uses_F[0]);
     // Message to 'vbool94_marginal' from UsesEqualDef factor
     this.vbool94_marginal_B = UsesEqualDefOp.MarginalAverageConditional<Bernoulli>(this.vbool94_uses_B, this.vbool94_F, this.vbool94_marginal_B);
     // Message to 'vbool457' from AreEqual factor
     this.vbool457_F = BooleanAreEqualOp.AreEqualAverageConditional(this.vbool94_uses_F[1], this.vbool172_uses_F[0]);
     // Message to 'vbool457_marginal' from ReplicateWithMarginal factor
     this.vbool457_marginal_B = ReplicateOp.MarginalAverageConditional<Bernoulli>(this.vbool457_uses_B, this.vbool457_F, this.vbool457_marginal_B);
     // Message to 'vbool94_uses' from UsesEqualDef factor
     this.vbool94_uses_F[0] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool94_uses_B, this.vbool94_F, 0, this.vbool94_uses_F[0]);
     // Message to 'vbool117_uses' from AreEqual factor
     this.vbool117_uses_B[1] = BooleanAreEqualOp.BAverageConditional(this.vbool336_B, this.vbool94_uses_F[0]);
     // Message to 'vbool117_marginal' from UsesEqualDef factor
     this.vbool117_marginal_B = UsesEqualDefOp.MarginalAverageConditional<Bernoulli>(this.vbool117_uses_B, this.vbool117_F, this.vbool117_marginal_B);
     // Message to 'vbool336' from AreEqual factor
     this.vbool336_F = BooleanAreEqualOp.AreEqualAverageConditional(this.vbool94_uses_F[0], this.vbool117_uses_F[1]);
     // Message to 'vbool336_marginal' from ReplicateWithMarginal factor
     this.vbool336_marginal_B = ReplicateOp.MarginalAverageConditional<Bernoulli>(this.vbool336_uses_B, this.vbool336_F, this.vbool336_marginal_B);
     // Message to 'vbool117_uses' from UsesEqualDef factor
     this.vbool117_uses_F[0] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool117_uses_B, this.vbool117_F, 0, this.vbool117_uses_F[0]);
     // Message to 'vbool133_uses' from AreEqual factor
     this.vbool133_uses_B[1] = BooleanAreEqualOp.AAverageConditional(this.vbool344_B, this.vbool117_uses_F[0]);
     // Message to 'vbool133_marginal' from UsesEqualDef factor
     this.vbool133_marginal_B = UsesEqualDefOp.MarginalAverageConditional<Bernoulli>(this.vbool133_uses_B, this.vbool133_F, this.vbool133_marginal_B);
     // Message to 'vbool344' from AreEqual factor
     this.vbool344_F = BooleanAreEqualOp.AreEqualAverageConditional(this.vbool133_uses_F[1], this.vbool117_uses_F[0]);
     // Message to 'vbool344_marginal' from ReplicateWithMarginal factor
     this.vbool344_marginal_B = ReplicateOp.MarginalAverageConditional<Bernoulli>(this.vbool344_uses_B, this.vbool344_F, this.vbool344_marginal_B);
 }
Ejemplo n.º 42
0
 public static double LogEvidenceRatio(Bernoulli or)
 {
     return(0.0);
 }
Ejemplo n.º 43
0
		public static double AverageLogFactor(Bernoulli isGreaterThan, Discrete a, Discrete b) { return 0.0; }
Ejemplo n.º 44
0
 /// <include file='FactorDocs.xml' path='factor_docs/message_op_class[@name="BooleanOrOp"]/message_doc[@name="LogEvidenceRatio(bool, Bernoulli, bool)"]/*'/>
 public static double LogEvidenceRatio(bool or, Bernoulli a, bool b)
 {
     return(LogAverageFactor(or, a, b));
 }
Ejemplo n.º 45
0
		/// <summary>
		/// Evidence message for EP
		/// </summary>
		/// <param name="isGreaterThan">Incoming message from 'isGreaterThan'.</param>
		/// <param name="a">Constant value for 'a'.</param>
		/// <param name="b">Constant value for 'b'.</param>
		/// <returns>Logarithm of the factor's average value across the given argument distributions</returns>
		/// <remarks><para>
		/// The formula for the result is <c>log(sum_(isGreaterThan) p(isGreaterThan) factor(isGreaterThan,a,b))</c>.
		/// </para></remarks>
		public static double LogAverageFactor(Bernoulli isGreaterThan, int a, int b)
		{
			return isGreaterThan.GetLogProb(Factor.IsGreaterThan(a, b));
		}
Ejemplo n.º 46
0
 /// <include file='FactorDocs.xml' path='factor_docs/message_op_class[@name="BooleanOrOp"]/message_doc[@name="LogEvidenceRatio(bool, bool, Bernoulli)"]/*'/>
 public static double LogEvidenceRatio(bool or, bool a, Bernoulli b)
 {
     return(LogEvidenceRatio(or, b, a));
 }
Ejemplo n.º 47
0
		//-- VMP -------------------------------------------------------------------------------------------

		/// <summary>
		/// Evidence message for VMP
		/// </summary>
		/// <param name="sample">Incoming message from 'sample'. Must be a proper distribution.  If uniform, the result will be uniform.</param>
		/// <param name="probTrue">Incoming message from 'probTrue'. Must be a proper distribution.  If uniform, the result will be uniform.</param>
		/// <returns>Average of the factor's log-value across the given argument distributions</returns>
		/// <remarks><para>
		/// The formula for the result is <c>sum_(sample,probTrue) p(sample,probTrue) log(factor(sample,probTrue))</c>.
		/// Adding up these values across all factors and variables gives the log-evidence estimate for VMP.
		/// </para></remarks>
		/// <exception cref="ImproperMessageException"><paramref name="sample"/> is not a proper distribution</exception>
		/// <exception cref="ImproperMessageException"><paramref name="probTrue"/> is not a proper distribution</exception>
		public static double AverageLogFactor(Bernoulli sample, [Proper] Beta probTrue)
		{
			if (sample.IsPointMass) return AverageLogFactor(sample.Point, probTrue);
			double eLogP, eLog1MinusP;
			probTrue.GetMeanLogs(out eLogP, out eLog1MinusP);
			double p = sample.GetProbTrue();
			return p * eLogP + (1 - p) * eLog1MinusP;
		}
Ejemplo n.º 48
0
 /// <include file='FactorDocs.xml' path='factor_docs/message_op_class[@name="BooleanOrOp"]/message_doc[@name="OrAverageLogarithm(Bernoulli, bool)"]/*'/>
 public static Bernoulli OrAverageLogarithm(Bernoulli A, bool B)
 {
     // same as BP if you use John Winn's rule.
     return(OrAverageConditional(A, B));
 }
Ejemplo n.º 49
0
		/// <summary>
		/// VMP message to 'probTrue'
		/// </summary>
		/// <param name="sample">Incoming message from 'sample'. Must be a proper distribution.  If uniform, the result will be uniform.</param>
		/// <returns>The outgoing VMP message to the 'probTrue' argument</returns>
		/// <remarks><para>
		/// The outgoing message is the exponential of the average log-factor value, where the average is over all arguments except 'probTrue'.
		/// The formula is <c>exp(sum_(sample) p(sample) log(factor(sample,probTrue)))</c>.
		/// </para></remarks>
		/// <exception cref="ImproperMessageException"><paramref name="sample"/> is not a proper distribution</exception>
		public static Beta ProbTrueAverageLogarithm(Bernoulli sample)
		{
			// E[x*log(p) + (1-x)*log(1-p)] = E[x]*log(p) + (1-E[x])*log(1-p)
			double ex = sample.GetProbTrue();
			return new Beta(1 + ex, 2 - ex);
		}
Ejemplo n.º 50
0
 /// <include file='FactorDocs.xml' path='factor_docs/message_op_class[@name="BooleanOrOp"]/message_doc[@name="AAverageLogarithm(Bernoulli, Bernoulli)"]/*'/>
 public static Bernoulli AAverageLogarithm([SkipIfUniform] Bernoulli or, Bernoulli B)
 {
     // when 'or' is marginalized, the factor is proportional to exp((A|B)*or.LogOdds)
     return(Bernoulli.FromLogOdds(or.LogOdds * B.GetProbFalse()));
 }
Ejemplo n.º 51
0
		public static double LogEvidenceRatio(Bernoulli sample, double probTrue)
		{
			return 0.0;
		}
Ejemplo n.º 52
0
 /// <summary>EP message to <c>b</c>.</summary>
 /// <param name="not">Constant value for <c>not</c>.</param>
 /// <returns>The outgoing EP message to the <c>b</c> argument.</returns>
 /// <remarks>
 ///   <para>The outgoing message is the factor viewed as a function of <c>b</c> conditioned on the given values.</para>
 /// </remarks>
 public static Bernoulli BAverageConditional(bool not)
 {
     return(Bernoulli.PointMass(!not));
 }
Ejemplo n.º 53
0
 /// <summary>
 /// Configures constant values that will not change during the lifetime of the class.
 /// </summary>
 /// <remarks>
 /// This method should be called once only after the class is instantiated.  In future, it will likely become
 /// the class constructor.
 /// </remarks>
 public void Reset()
 {
     // Create array for 'vbool179_uses' backwards messages.
     this.vbool179_uses_B = new Bernoulli[2];
     this.vBernoulli187 = new Bernoulli(0.01);
     for(int _ind0 = 0; _ind0<2; _ind0++)
     {
         this.vbool179_uses_B[_ind0] = ArrayHelper.MakeUniform<Bernoulli>(this.vBernoulli187);
     }
     this.vbool179_F = ArrayHelper.MakeUniform<Bernoulli>(vBernoulli187);
     // Message to 'vbool179' from Random factor
     this.vbool179_F = UnaryOp<bool>.RandomAverageConditional<Bernoulli>(this.vBernoulli187);
     // Create array for 'vbool171_uses' backwards messages.
     this.vbool171_uses_B = new Bernoulli[2];
     this.vBernoulli179 = new Bernoulli(0.5);
     for(int _ind0 = 0; _ind0<2; _ind0++)
     {
         this.vbool171_uses_B[_ind0] = ArrayHelper.MakeUniform<Bernoulli>(this.vBernoulli179);
     }
     this.vbool171_F = ArrayHelper.MakeUniform<Bernoulli>(vBernoulli179);
     // Message to 'vbool171' from Random factor
     this.vbool171_F = UnaryOp<bool>.RandomAverageConditional<Bernoulli>(this.vBernoulli179);
     // Create array for 'vbool440_uses' backwards messages.
     this.vbool440_uses_B = new Bernoulli[1];
     for(int _ind0 = 0; _ind0<1; _ind0++)
     {
         this.vbool440_uses_B[_ind0] = ArrayHelper.MakeUniform<Bernoulli>(new Bernoulli());
     }
     this.vbool440_F = ArrayHelper.MakeUniform<Bernoulli>(new Bernoulli());
     // Create array for 'vbool101_uses' backwards messages.
     this.vbool101_uses_B = new Bernoulli[2];
     this.vBernoulli109 = new Bernoulli(0.01);
     for(int _ind0 = 0; _ind0<2; _ind0++)
     {
         this.vbool101_uses_B[_ind0] = ArrayHelper.MakeUniform<Bernoulli>(this.vBernoulli109);
     }
     this.vbool101_F = ArrayHelper.MakeUniform<Bernoulli>(vBernoulli109);
     // Message to 'vbool101' from Random factor
     this.vbool101_F = UnaryOp<bool>.RandomAverageConditional<Bernoulli>(this.vBernoulli109);
     // Create array for 'vbool471_uses' backwards messages.
     this.vbool471_uses_B = new Bernoulli[1];
     for(int _ind0 = 0; _ind0<1; _ind0++)
     {
         this.vbool471_uses_B[_ind0] = ArrayHelper.MakeUniform<Bernoulli>(new Bernoulli());
     }
     this.vbool471_F = ArrayHelper.MakeUniform<Bernoulli>(new Bernoulli());
     // Create array for 'vbool153_uses' backwards messages.
     this.vbool153_uses_B = new Bernoulli[2];
     this.vBernoulli161 = new Bernoulli(0.01);
     for(int _ind0 = 0; _ind0<2; _ind0++)
     {
         this.vbool153_uses_B[_ind0] = ArrayHelper.MakeUniform<Bernoulli>(this.vBernoulli161);
     }
     this.vbool153_F = ArrayHelper.MakeUniform<Bernoulli>(vBernoulli161);
     // Message to 'vbool153' from Random factor
     this.vbool153_F = UnaryOp<bool>.RandomAverageConditional<Bernoulli>(this.vBernoulli161);
     // Create array for 'vbool432_uses' backwards messages.
     this.vbool432_uses_B = new Bernoulli[1];
     for(int _ind0 = 0; _ind0<1; _ind0++)
     {
         this.vbool432_uses_B[_ind0] = ArrayHelper.MakeUniform<Bernoulli>(new Bernoulli());
     }
     this.vbool432_F = ArrayHelper.MakeUniform<Bernoulli>(new Bernoulli());
     // Create array for 'vbool124_uses' backwards messages.
     this.vbool124_uses_B = new Bernoulli[2];
     this.vBernoulli132 = new Bernoulli(0.5);
     for(int _ind0 = 0; _ind0<2; _ind0++)
     {
         this.vbool124_uses_B[_ind0] = ArrayHelper.MakeUniform<Bernoulli>(this.vBernoulli132);
     }
     this.vbool124_F = ArrayHelper.MakeUniform<Bernoulli>(vBernoulli132);
     // Message to 'vbool124' from Random factor
     this.vbool124_F = UnaryOp<bool>.RandomAverageConditional<Bernoulli>(this.vBernoulli132);
     // Create array for 'vbool343_uses' backwards messages.
     this.vbool343_uses_B = new Bernoulli[1];
     for(int _ind0 = 0; _ind0<1; _ind0++)
     {
         this.vbool343_uses_B[_ind0] = ArrayHelper.MakeUniform<Bernoulli>(new Bernoulli());
     }
     this.vbool343_F = ArrayHelper.MakeUniform<Bernoulli>(new Bernoulli());
     // Create array for 'vbool88_uses' backwards messages.
     this.vbool88_uses_B = new Bernoulli[2];
     this.vBernoulli96 = new Bernoulli(0.01);
     for(int _ind0 = 0; _ind0<2; _ind0++)
     {
         this.vbool88_uses_B[_ind0] = ArrayHelper.MakeUniform<Bernoulli>(this.vBernoulli96);
     }
     this.vbool88_F = ArrayHelper.MakeUniform<Bernoulli>(vBernoulli96);
     // Message to 'vbool88' from Random factor
     this.vbool88_F = UnaryOp<bool>.RandomAverageConditional<Bernoulli>(this.vBernoulli96);
     // Create array for 'vbool472_uses' backwards messages.
     this.vbool472_uses_B = new Bernoulli[1];
     for(int _ind0 = 0; _ind0<1; _ind0++)
     {
         this.vbool472_uses_B[_ind0] = ArrayHelper.MakeUniform<Bernoulli>(new Bernoulli());
     }
     this.vbool472_F = ArrayHelper.MakeUniform<Bernoulli>(new Bernoulli());
     // Create array for 'vbool140_uses' backwards messages.
     this.vbool140_uses_B = new Bernoulli[3];
     this.vBernoulli148 = new Bernoulli(0.5);
     for(int _ind0 = 0; _ind0<3; _ind0++)
     {
         this.vbool140_uses_B[_ind0] = ArrayHelper.MakeUniform<Bernoulli>(this.vBernoulli148);
     }
     this.vbool140_F = ArrayHelper.MakeUniform<Bernoulli>(vBernoulli148);
     // Message to 'vbool140' from Random factor
     this.vbool140_F = UnaryOp<bool>.RandomAverageConditional<Bernoulli>(this.vBernoulli148);
     // Create array for 'vbool351_uses' backwards messages.
     this.vbool351_uses_B = new Bernoulli[1];
     for(int _ind0 = 0; _ind0<1; _ind0++)
     {
         this.vbool351_uses_B[_ind0] = ArrayHelper.MakeUniform<Bernoulli>(new Bernoulli());
     }
     this.vbool351_F = ArrayHelper.MakeUniform<Bernoulli>(new Bernoulli());
     // Create array for 'vbool80_uses' backwards messages.
     this.vbool80_uses_B = new Bernoulli[2];
     this.vBernoulli88 = new Bernoulli(0.5);
     for(int _ind0 = 0; _ind0<2; _ind0++)
     {
         this.vbool80_uses_B[_ind0] = ArrayHelper.MakeUniform<Bernoulli>(this.vBernoulli88);
     }
     this.vbool80_F = ArrayHelper.MakeUniform<Bernoulli>(vBernoulli88);
     // Message to 'vbool80' from Random factor
     this.vbool80_F = UnaryOp<bool>.RandomAverageConditional<Bernoulli>(this.vBernoulli88);
     // Create array for 'vbool335_uses' backwards messages.
     this.vbool335_uses_B = new Bernoulli[1];
     for(int _ind0 = 0; _ind0<1; _ind0++)
     {
         this.vbool335_uses_B[_ind0] = ArrayHelper.MakeUniform<Bernoulli>(new Bernoulli());
     }
     this.vbool335_F = ArrayHelper.MakeUniform<Bernoulli>(new Bernoulli());
     // Create array for 'vbool132_uses' backwards messages.
     this.vbool132_uses_B = new Bernoulli[2];
     this.vBernoulli140 = new Bernoulli(0.5);
     for(int _ind0 = 0; _ind0<2; _ind0++)
     {
         this.vbool132_uses_B[_ind0] = ArrayHelper.MakeUniform<Bernoulli>(this.vBernoulli140);
     }
     this.vbool132_F = ArrayHelper.MakeUniform<Bernoulli>(vBernoulli140);
     // Message to 'vbool132' from Random factor
     this.vbool132_F = UnaryOp<bool>.RandomAverageConditional<Bernoulli>(this.vBernoulli140);
     // Create array for 'vbool359_uses' backwards messages.
     this.vbool359_uses_B = new Bernoulli[1];
     for(int _ind0 = 0; _ind0<1; _ind0++)
     {
         this.vbool359_uses_B[_ind0] = ArrayHelper.MakeUniform<Bernoulli>(new Bernoulli());
     }
     this.vbool359_F = ArrayHelper.MakeUniform<Bernoulli>(new Bernoulli());
     // Create array for 'vbool28_uses' backwards messages.
     this.vbool28_uses_B = new Bernoulli[2];
     this.vBernoulli36 = new Bernoulli(0.5);
     for(int _ind0 = 0; _ind0<2; _ind0++)
     {
         this.vbool28_uses_B[_ind0] = ArrayHelper.MakeUniform<Bernoulli>(this.vBernoulli36);
     }
     this.vbool28_F = ArrayHelper.MakeUniform<Bernoulli>(vBernoulli36);
     // Message to 'vbool28' from Random factor
     this.vbool28_F = UnaryOp<bool>.RandomAverageConditional<Bernoulli>(this.vBernoulli36);
     // Create array for 'vbool367_uses' backwards messages.
     this.vbool367_uses_B = new Bernoulli[1];
     for(int _ind0 = 0; _ind0<1; _ind0++)
     {
         this.vbool367_uses_B[_ind0] = ArrayHelper.MakeUniform<Bernoulli>(new Bernoulli());
     }
     this.vbool367_F = ArrayHelper.MakeUniform<Bernoulli>(new Bernoulli());
     // Create array for 'vbool62_uses' backwards messages.
     this.vbool62_uses_B = new Bernoulli[3];
     this.vBernoulli70 = new Bernoulli(0.5);
     for(int _ind0 = 0; _ind0<3; _ind0++)
     {
         this.vbool62_uses_B[_ind0] = ArrayHelper.MakeUniform<Bernoulli>(this.vBernoulli70);
     }
     this.vbool62_F = ArrayHelper.MakeUniform<Bernoulli>(vBernoulli70);
     // Message to 'vbool62' from Random factor
     this.vbool62_F = UnaryOp<bool>.RandomAverageConditional<Bernoulli>(this.vBernoulli70);
     // Create array for 'vbool319_uses' backwards messages.
     this.vbool319_uses_B = new Bernoulli[1];
     for(int _ind0 = 0; _ind0<1; _ind0++)
     {
         this.vbool319_uses_B[_ind0] = ArrayHelper.MakeUniform<Bernoulli>(new Bernoulli());
     }
     this.vbool319_F = ArrayHelper.MakeUniform<Bernoulli>(new Bernoulli());
     // Create array for 'vbool327_uses' backwards messages.
     this.vbool327_uses_B = new Bernoulli[1];
     for(int _ind0 = 0; _ind0<1; _ind0++)
     {
         this.vbool327_uses_B[_ind0] = ArrayHelper.MakeUniform<Bernoulli>(new Bernoulli());
     }
     this.vbool327_F = ArrayHelper.MakeUniform<Bernoulli>(new Bernoulli());
     // Create array for 'vbool36_uses' backwards messages.
     this.vbool36_uses_B = new Bernoulli[1];
     this.vBernoulli44 = new Bernoulli(0.5);
     for(int _ind0 = 0; _ind0<1; _ind0++)
     {
         this.vbool36_uses_B[_ind0] = ArrayHelper.MakeUniform<Bernoulli>(this.vBernoulli44);
     }
     this.vbool36_F = ArrayHelper.MakeUniform<Bernoulli>(vBernoulli44);
     // Message to 'vbool36' from Random factor
     this.vbool36_F = UnaryOp<bool>.RandomAverageConditional<Bernoulli>(this.vBernoulli44);
     // Create array for 'vbool303_uses' backwards messages.
     this.vbool303_uses_B = new Bernoulli[1];
     for(int _ind0 = 0; _ind0<1; _ind0++)
     {
         this.vbool303_uses_B[_ind0] = ArrayHelper.MakeUniform<Bernoulli>(new Bernoulli());
     }
     this.vbool303_F = ArrayHelper.MakeUniform<Bernoulli>(new Bernoulli());
     // Create array for 'vbool54_uses' backwards messages.
     this.vbool54_uses_B = new Bernoulli[2];
     this.vBernoulli62 = new Bernoulli(0.5);
     for(int _ind0 = 0; _ind0<2; _ind0++)
     {
         this.vbool54_uses_B[_ind0] = ArrayHelper.MakeUniform<Bernoulli>(this.vBernoulli62);
     }
     this.vbool54_F = ArrayHelper.MakeUniform<Bernoulli>(vBernoulli62);
     // Message to 'vbool54' from Random factor
     this.vbool54_F = UnaryOp<bool>.RandomAverageConditional<Bernoulli>(this.vBernoulli62);
     // Create array for 'vbool311_uses' backwards messages.
     this.vbool311_uses_B = new Bernoulli[1];
     for(int _ind0 = 0; _ind0<1; _ind0++)
     {
         this.vbool311_uses_B[_ind0] = ArrayHelper.MakeUniform<Bernoulli>(new Bernoulli());
     }
     this.vbool311_F = ArrayHelper.MakeUniform<Bernoulli>(new Bernoulli());
     // Create array for 'vbool10_uses' backwards messages.
     this.vbool10_uses_B = new Bernoulli[1];
     this.vBernoulli18 = new Bernoulli(0.5);
     for(int _ind0 = 0; _ind0<1; _ind0++)
     {
         this.vbool10_uses_B[_ind0] = ArrayHelper.MakeUniform<Bernoulli>(this.vBernoulli18);
     }
     this.vbool10_F = ArrayHelper.MakeUniform<Bernoulli>(vBernoulli18);
     // Message to 'vbool10' from Random factor
     this.vbool10_F = UnaryOp<bool>.RandomAverageConditional<Bernoulli>(this.vBernoulli18);
     // Create array for 'vbool295_uses' backwards messages.
     this.vbool295_uses_B = new Bernoulli[1];
     for(int _ind0 = 0; _ind0<1; _ind0++)
     {
         this.vbool295_uses_B[_ind0] = ArrayHelper.MakeUniform<Bernoulli>(new Bernoulli());
     }
     this.vbool295_F = ArrayHelper.MakeUniform<Bernoulli>(new Bernoulli());
     this.vbool440_B = ArrayHelper.MakeUniform<Bernoulli>(new Bernoulli());
     // Create array for 'vbool171_uses' forwards messages.
     this.vbool171_uses_F = new Bernoulli[2];
     for(int _ind0 = 0; _ind0<2; _ind0++)
     {
         this.vbool171_uses_F[_ind0] = ArrayHelper.MakeUniform<Bernoulli>(this.vBernoulli179);
     }
     this.vbool471_B = ArrayHelper.MakeUniform<Bernoulli>(new Bernoulli());
     // Create array for 'vbool101_uses' forwards messages.
     this.vbool101_uses_F = new Bernoulli[2];
     for(int _ind0 = 0; _ind0<2; _ind0++)
     {
         this.vbool101_uses_F[_ind0] = ArrayHelper.MakeUniform<Bernoulli>(this.vBernoulli109);
     }
     // Create array for 'vbool179_uses' forwards messages.
     this.vbool179_uses_F = new Bernoulli[2];
     for(int _ind0 = 0; _ind0<2; _ind0++)
     {
         this.vbool179_uses_F[_ind0] = ArrayHelper.MakeUniform<Bernoulli>(this.vBernoulli187);
     }
     this.vbool432_B = ArrayHelper.MakeUniform<Bernoulli>(new Bernoulli());
     // Create array for 'vbool153_uses' forwards messages.
     this.vbool153_uses_F = new Bernoulli[2];
     for(int _ind0 = 0; _ind0<2; _ind0++)
     {
         this.vbool153_uses_F[_ind0] = ArrayHelper.MakeUniform<Bernoulli>(this.vBernoulli161);
     }
     this.vBernoulli5 = new Bernoulli(0.9);
     // Message to 'vbool440_uses' from EqualRandom factor
     this.vbool440_uses_B[0] = ConstrainEqualRandomOp<bool>.ValueAverageConditional<Bernoulli>(this.vBernoulli5);
     // Message to 'vbool432_uses' from EqualRandom factor
     this.vbool432_uses_B[0] = ConstrainEqualRandomOp<bool>.ValueAverageConditional<Bernoulli>(this.vBernoulli5);
     // Message to 'vbool343_uses' from EqualRandom factor
     this.vbool343_uses_B[0] = ConstrainEqualRandomOp<bool>.ValueAverageConditional<Bernoulli>(this.vBernoulli5);
     // Message to 'vbool351_uses' from EqualRandom factor
     this.vbool351_uses_B[0] = ConstrainEqualRandomOp<bool>.ValueAverageConditional<Bernoulli>(this.vBernoulli5);
     // Message to 'vbool335_uses' from EqualRandom factor
     this.vbool335_uses_B[0] = ConstrainEqualRandomOp<bool>.ValueAverageConditional<Bernoulli>(this.vBernoulli5);
     // Message to 'vbool359_uses' from EqualRandom factor
     this.vbool359_uses_B[0] = ConstrainEqualRandomOp<bool>.ValueAverageConditional<Bernoulli>(this.vBernoulli5);
     // Message to 'vbool367_uses' from EqualRandom factor
     this.vbool367_uses_B[0] = ConstrainEqualRandomOp<bool>.ValueAverageConditional<Bernoulli>(this.vBernoulli5);
     // Message to 'vbool319_uses' from EqualRandom factor
     this.vbool319_uses_B[0] = ConstrainEqualRandomOp<bool>.ValueAverageConditional<Bernoulli>(this.vBernoulli5);
     // Message to 'vbool327_uses' from EqualRandom factor
     this.vbool327_uses_B[0] = ConstrainEqualRandomOp<bool>.ValueAverageConditional<Bernoulli>(this.vBernoulli5);
     // Message to 'vbool303_uses' from EqualRandom factor
     this.vbool303_uses_B[0] = ConstrainEqualRandomOp<bool>.ValueAverageConditional<Bernoulli>(this.vBernoulli5);
     // Message to 'vbool311_uses' from EqualRandom factor
     this.vbool311_uses_B[0] = ConstrainEqualRandomOp<bool>.ValueAverageConditional<Bernoulli>(this.vBernoulli5);
     // Message to 'vbool295_uses' from EqualRandom factor
     this.vbool295_uses_B[0] = ConstrainEqualRandomOp<bool>.ValueAverageConditional<Bernoulli>(this.vBernoulli5);
     // Message to 'vbool440' from ReplicateWithMarginal factor
     this.vbool440_B = ReplicateOp.DefAverageConditional<Bernoulli>(this.vbool440_uses_B, this.vbool440_B);
     // Message to 'vbool432' from ReplicateWithMarginal factor
     this.vbool432_B = ReplicateOp.DefAverageConditional<Bernoulli>(this.vbool432_uses_B, this.vbool432_B);
     this.vbool343_B = ArrayHelper.MakeUniform<Bernoulli>(new Bernoulli());
     // Message to 'vbool343' from ReplicateWithMarginal factor
     this.vbool343_B = ReplicateOp.DefAverageConditional<Bernoulli>(this.vbool343_uses_B, this.vbool343_B);
     // Create array for 'vbool124_uses' forwards messages.
     this.vbool124_uses_F = new Bernoulli[2];
     for(int _ind0 = 0; _ind0<2; _ind0++)
     {
         this.vbool124_uses_F[_ind0] = ArrayHelper.MakeUniform<Bernoulli>(this.vBernoulli132);
     }
     this.vBernoulli6 = new Bernoulli(0.9);
     // Message to 'vbool471_uses' from EqualRandom factor
     this.vbool471_uses_B[0] = ConstrainEqualRandomOp<bool>.ValueAverageConditional<Bernoulli>(this.vBernoulli6);
     // Message to 'vbool472_uses' from EqualRandom factor
     this.vbool472_uses_B[0] = ConstrainEqualRandomOp<bool>.ValueAverageConditional<Bernoulli>(this.vBernoulli6);
     // Message to 'vbool471' from ReplicateWithMarginal factor
     this.vbool471_B = ReplicateOp.DefAverageConditional<Bernoulli>(this.vbool471_uses_B, this.vbool471_B);
     this.vbool472_B = ArrayHelper.MakeUniform<Bernoulli>(new Bernoulli());
     // Message to 'vbool472' from ReplicateWithMarginal factor
     this.vbool472_B = ReplicateOp.DefAverageConditional<Bernoulli>(this.vbool472_uses_B, this.vbool472_B);
     // Create array for 'vbool88_uses' forwards messages.
     this.vbool88_uses_F = new Bernoulli[2];
     for(int _ind0 = 0; _ind0<2; _ind0++)
     {
         this.vbool88_uses_F[_ind0] = ArrayHelper.MakeUniform<Bernoulli>(this.vBernoulli96);
     }
     this.vbool351_B = ArrayHelper.MakeUniform<Bernoulli>(new Bernoulli());
     // Message to 'vbool351' from ReplicateWithMarginal factor
     this.vbool351_B = ReplicateOp.DefAverageConditional<Bernoulli>(this.vbool351_uses_B, this.vbool351_B);
     // Create array for 'vbool140_uses' forwards messages.
     this.vbool140_uses_F = new Bernoulli[3];
     for(int _ind0 = 0; _ind0<3; _ind0++)
     {
         this.vbool140_uses_F[_ind0] = ArrayHelper.MakeUniform<Bernoulli>(this.vBernoulli148);
     }
     this.vbool335_B = ArrayHelper.MakeUniform<Bernoulli>(new Bernoulli());
     // Message to 'vbool335' from ReplicateWithMarginal factor
     this.vbool335_B = ReplicateOp.DefAverageConditional<Bernoulli>(this.vbool335_uses_B, this.vbool335_B);
     // Create array for 'vbool80_uses' forwards messages.
     this.vbool80_uses_F = new Bernoulli[2];
     for(int _ind0 = 0; _ind0<2; _ind0++)
     {
         this.vbool80_uses_F[_ind0] = ArrayHelper.MakeUniform<Bernoulli>(this.vBernoulli88);
     }
     this.vbool359_B = ArrayHelper.MakeUniform<Bernoulli>(new Bernoulli());
     // Message to 'vbool359' from ReplicateWithMarginal factor
     this.vbool359_B = ReplicateOp.DefAverageConditional<Bernoulli>(this.vbool359_uses_B, this.vbool359_B);
     // Create array for 'vbool132_uses' forwards messages.
     this.vbool132_uses_F = new Bernoulli[2];
     for(int _ind0 = 0; _ind0<2; _ind0++)
     {
         this.vbool132_uses_F[_ind0] = ArrayHelper.MakeUniform<Bernoulli>(this.vBernoulli140);
     }
     this.vbool367_B = ArrayHelper.MakeUniform<Bernoulli>(new Bernoulli());
     // Message to 'vbool367' from ReplicateWithMarginal factor
     this.vbool367_B = ReplicateOp.DefAverageConditional<Bernoulli>(this.vbool367_uses_B, this.vbool367_B);
     // Create array for 'vbool28_uses' forwards messages.
     this.vbool28_uses_F = new Bernoulli[2];
     for(int _ind0 = 0; _ind0<2; _ind0++)
     {
         this.vbool28_uses_F[_ind0] = ArrayHelper.MakeUniform<Bernoulli>(this.vBernoulli36);
     }
     this.vbool319_B = ArrayHelper.MakeUniform<Bernoulli>(new Bernoulli());
     // Message to 'vbool319' from ReplicateWithMarginal factor
     this.vbool319_B = ReplicateOp.DefAverageConditional<Bernoulli>(this.vbool319_uses_B, this.vbool319_B);
     // Create array for 'vbool62_uses' forwards messages.
     this.vbool62_uses_F = new Bernoulli[3];
     for(int _ind0 = 0; _ind0<3; _ind0++)
     {
         this.vbool62_uses_F[_ind0] = ArrayHelper.MakeUniform<Bernoulli>(this.vBernoulli70);
     }
     this.vbool327_B = ArrayHelper.MakeUniform<Bernoulli>(new Bernoulli());
     // Message to 'vbool327' from ReplicateWithMarginal factor
     this.vbool327_B = ReplicateOp.DefAverageConditional<Bernoulli>(this.vbool327_uses_B, this.vbool327_B);
     this.vbool303_B = ArrayHelper.MakeUniform<Bernoulli>(new Bernoulli());
     // Message to 'vbool303' from ReplicateWithMarginal factor
     this.vbool303_B = ReplicateOp.DefAverageConditional<Bernoulli>(this.vbool303_uses_B, this.vbool303_B);
     // Create array for 'vbool36_uses' forwards messages.
     this.vbool36_uses_F = new Bernoulli[1];
     for(int _ind0 = 0; _ind0<1; _ind0++)
     {
         this.vbool36_uses_F[_ind0] = ArrayHelper.MakeUniform<Bernoulli>(this.vBernoulli44);
     }
     // Message to 'vbool36_uses' from UsesEqualDef factor
     this.vbool36_uses_F[0] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool36_uses_B, this.vbool36_F, 0, this.vbool36_uses_F[0]);
     // Message to 'vbool28_uses' from AreEqual factor
     this.vbool28_uses_B[1] = BooleanAreEqualOp.BAverageConditional(this.vbool303_B, this.vbool36_uses_F[0]);
     // Message to 'vbool28_uses' from UsesEqualDef factor
     this.vbool28_uses_F[0] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool28_uses_B, this.vbool28_F, 0, this.vbool28_uses_F[0]);
     // Message to 'vbool140_uses' from AreEqual factor
     this.vbool140_uses_B[2] = BooleanAreEqualOp.AAverageConditional(this.vbool367_B, this.vbool28_uses_F[0]);
     this.vbool311_B = ArrayHelper.MakeUniform<Bernoulli>(new Bernoulli());
     // Message to 'vbool311' from ReplicateWithMarginal factor
     this.vbool311_B = ReplicateOp.DefAverageConditional<Bernoulli>(this.vbool311_uses_B, this.vbool311_B);
     // Create array for 'vbool54_uses' forwards messages.
     this.vbool54_uses_F = new Bernoulli[2];
     for(int _ind0 = 0; _ind0<2; _ind0++)
     {
         this.vbool54_uses_F[_ind0] = ArrayHelper.MakeUniform<Bernoulli>(this.vBernoulli62);
     }
     this.vbool295_B = ArrayHelper.MakeUniform<Bernoulli>(new Bernoulli());
     // Message to 'vbool295' from ReplicateWithMarginal factor
     this.vbool295_B = ReplicateOp.DefAverageConditional<Bernoulli>(this.vbool295_uses_B, this.vbool295_B);
     // Create array for 'vbool10_uses' forwards messages.
     this.vbool10_uses_F = new Bernoulli[1];
     for(int _ind0 = 0; _ind0<1; _ind0++)
     {
         this.vbool10_uses_F[_ind0] = ArrayHelper.MakeUniform<Bernoulli>(this.vBernoulli18);
     }
     // Message to 'vbool10_uses' from UsesEqualDef factor
     this.vbool10_uses_F[0] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool10_uses_B, this.vbool10_F, 0, this.vbool10_uses_F[0]);
     // Message to 'vbool54_uses' from AreEqual factor
     this.vbool54_uses_B[1] = BooleanAreEqualOp.BAverageConditional(this.vbool295_B, this.vbool10_uses_F[0]);
     // Message to 'vbool54_uses' from UsesEqualDef factor
     this.vbool54_uses_F[0] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool54_uses_B, this.vbool54_F, 0, this.vbool54_uses_F[0]);
     // Message to 'vbool62_uses' from AreEqual factor
     this.vbool62_uses_B[2] = BooleanAreEqualOp.AAverageConditional(this.vbool311_B, this.vbool54_uses_F[0]);
 }
Ejemplo n.º 54
0
 public static Bernoulli AAverageLogarithm(bool or, Bernoulli B)
 {
     throw new NotSupportedException(NotSupportedMessage);
 }
Ejemplo n.º 55
0
 /// <summary>
 /// Creates message arrays and initialises their values ready for inference to be performed.
 /// </summary>
 /// <remarks>
 /// This method should be called once each time inference is performed. Since the initialisation
 /// procedure normally dependson external values such as priors and array sizes, all external
 /// values must be set before calling this method.
 /// 
 /// As well as initialising message arrays, this method also performs any message passing that
 /// the scheduler determines need only be carried out once.
 /// </remarks>
 public void Initialise()
 {
     this.vbool431_marginal_B = ArrayHelper.MakeUniform<Bernoulli>(new Bernoulli());
     this.vbool470_marginal_B = ArrayHelper.MakeUniform<Bernoulli>(new Bernoulli());
     this.vbool439_marginal_B = ArrayHelper.MakeUniform<Bernoulli>(new Bernoulli());
     this.vbool334_marginal_B = ArrayHelper.MakeUniform<Bernoulli>(new Bernoulli());
     this.vbool469_marginal_B = ArrayHelper.MakeUniform<Bernoulli>(new Bernoulli());
     this.vbool318_marginal_B = ArrayHelper.MakeUniform<Bernoulli>(new Bernoulli());
     this.vbool342_marginal_B = ArrayHelper.MakeUniform<Bernoulli>(new Bernoulli());
     this.vbool310_marginal_B = ArrayHelper.MakeUniform<Bernoulli>(new Bernoulli());
     this.vbool326_marginal_B = ArrayHelper.MakeUniform<Bernoulli>(new Bernoulli());
     this.vbool350_marginal_B = ArrayHelper.MakeUniform<Bernoulli>(new Bernoulli());
     this.vbool294_marginal_B = ArrayHelper.MakeUniform<Bernoulli>(new Bernoulli());
     this.vbool358_marginal_B = ArrayHelper.MakeUniform<Bernoulli>(new Bernoulli());
     this.vbool366_marginal_B = ArrayHelper.MakeUniform<Bernoulli>(new Bernoulli());
     this.vbool302_marginal_B = ArrayHelper.MakeUniform<Bernoulli>(new Bernoulli());
     this.vbool149_marginal_B = ArrayHelper.MakeUniform<Bernoulli>(vBernoulli157);
     this.vbool167_marginal_B = ArrayHelper.MakeUniform<Bernoulli>(vBernoulli175);
     this.vbool84_marginal_B = ArrayHelper.MakeUniform<Bernoulli>(vBernoulli92);
     this.vbool175_marginal_B = ArrayHelper.MakeUniform<Bernoulli>(vBernoulli183);
     this.vbool76_marginal_B = ArrayHelper.MakeUniform<Bernoulli>(vBernoulli84);
     this.vbool97_marginal_B = ArrayHelper.MakeUniform<Bernoulli>(vBernoulli105);
     this.vbool58_marginal_B = ArrayHelper.MakeUniform<Bernoulli>(vBernoulli66);
     this.vbool120_marginal_B = ArrayHelper.MakeUniform<Bernoulli>(vBernoulli128);
     this.vbool50_marginal_B = ArrayHelper.MakeUniform<Bernoulli>(vBernoulli58);
     this.vbool128_marginal_B = ArrayHelper.MakeUniform<Bernoulli>(vBernoulli136);
     this.vbool136_marginal_B = ArrayHelper.MakeUniform<Bernoulli>(vBernoulli144);
     this.vbool6_marginal_B = ArrayHelper.MakeUniform<Bernoulli>(vBernoulli14);
     this.vbool24_marginal_B = ArrayHelper.MakeUniform<Bernoulli>(vBernoulli32);
     this.vbool32_marginal_B = ArrayHelper.MakeUniform<Bernoulli>(vBernoulli40);
 }
Ejemplo n.º 56
0
 /// <summary>EP message to <c>b</c>.</summary>
 /// <param name="not">Incoming message from <c>not</c>. Must be a proper distribution. If uniform, the result will be uniform.</param>
 /// <returns>The outgoing EP message to the <c>b</c> argument.</returns>
 /// <remarks>
 ///   <para>The outgoing message is a distribution matching the moments of <c>b</c> as the random arguments are varied. The formula is <c>proj[p(b) sum_(not) p(not) factor(not,b)]/p(b)</c>.</para>
 /// </remarks>
 /// <exception cref="ImproperMessageException">
 ///   <paramref name="not" /> is not a proper distribution.</exception>
 public static Bernoulli BAverageConditional([SkipIfUniform] Bernoulli not)
 {
     return(Bernoulli.FromLogOdds(-not.LogOdds));
 }
Ejemplo n.º 57
0
 /// <summary>
 /// Performs one iteration of inference.
 /// </summary>
 /// <remarks>
 /// This method should be called multiple times, after calling Initialise(), in order to perform
 /// multiple iterations of message passing.  You can call methods to retrieve posterior marginals
 /// at any time - the returned marginal will be the estimated marginal given the current state of
 /// the message passing algorithm.  This can be useful for monitoring convergence of the algorithm.
 /// 
 /// Where the scheduler has determined inference can be performed without iteration, this method
 /// does nothing.
 /// </remarks>
 public void Update()
 {
     // Message to 'vbool58_uses' from UsesEqualDef factor
     this.vbool58_uses_F[0] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool58_uses_B, this.vbool58_F, 0, this.vbool58_uses_F[0]);
     // Message to 'vbool76_uses' from AreEqual factor
     this.vbool76_uses_B[1] = BooleanAreEqualOp.BAverageConditional(this.vbool318_B, this.vbool58_uses_F[0]);
     // Message to 'vbool76_uses' from UsesEqualDef factor
     this.vbool76_uses_F[0] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool76_uses_B, this.vbool76_F, 0, this.vbool76_uses_F[0]);
     // Message to 'vbool84_uses' from AreEqual factor
     this.vbool84_uses_B[1] = BooleanAreEqualOp.AAverageConditional(this.vbool334_B, this.vbool76_uses_F[0]);
     // Message to 'vbool84_uses' from UsesEqualDef factor
     this.vbool84_uses_F[0] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool84_uses_B, this.vbool84_F, 0, this.vbool84_uses_F[0]);
     // Message to 'vbool149_uses' from AreEqual factor
     this.vbool149_uses_B[1] = BooleanAreEqualOp.BAverageConditional(this.vbool470_B, this.vbool84_uses_F[0]);
     // Message to 'vbool149_uses' from UsesEqualDef factor
     this.vbool149_uses_F[0] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool149_uses_B, this.vbool149_F, 0, this.vbool149_uses_F[0]);
     // Message to 'vbool167_uses' from AreEqual factor
     this.vbool167_uses_B[0] = BooleanAreEqualOp.BAverageConditional(this.vbool431_B, this.vbool149_uses_F[0]);
     // Message to 'vbool167_uses' from UsesEqualDef factor
     this.vbool167_uses_F[1] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool167_uses_B, this.vbool167_F, 1, this.vbool167_uses_F[1]);
     // Message to 'vbool175_uses' from AreEqual factor
     this.vbool175_uses_B[0] = BooleanAreEqualOp.AAverageConditional(this.vbool439_B, this.vbool167_uses_F[1]);
     // Message to 'vbool175_uses' from UsesEqualDef factor
     this.vbool175_uses_F[1] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool175_uses_B, this.vbool175_F, 1, this.vbool175_uses_F[1]);
     // Message to 'vbool97_uses' from AreEqual factor
     this.vbool97_uses_B[0] = BooleanAreEqualOp.AAverageConditional(this.vbool469_B, this.vbool175_uses_F[1]);
     // Message to 'vbool97_uses' from UsesEqualDef factor
     this.vbool97_uses_F[1] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool97_uses_B, this.vbool97_F, 1, this.vbool97_uses_F[1]);
     // Message to 'vbool120_uses' from AreEqual factor
     this.vbool120_uses_B[0] = BooleanAreEqualOp.BAverageConditional(this.vbool342_B, this.vbool97_uses_F[1]);
     // Message to 'vbool120_uses' from UsesEqualDef factor
     this.vbool120_uses_F[1] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool120_uses_B, this.vbool120_F, 1, this.vbool120_uses_F[1]);
     // Message to 'vbool136_uses' from AreEqual factor
     this.vbool136_uses_B[0] = BooleanAreEqualOp.AAverageConditional(this.vbool350_B, this.vbool120_uses_F[1]);
     // Message to 'vbool136_uses' from UsesEqualDef factor
     this.vbool136_uses_F[1] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool136_uses_B, this.vbool136_F, 1, this.vbool136_uses_F[1]);
     // Message to 'vbool128_uses' from AreEqual factor
     this.vbool128_uses_B[1] = BooleanAreEqualOp.BAverageConditional(this.vbool358_B, this.vbool136_uses_F[1]);
     // Message to 'vbool128_uses' from UsesEqualDef factor
     this.vbool128_uses_F[0] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool128_uses_B, this.vbool128_F, 0, this.vbool128_uses_F[0]);
     // Message to 'vbool58_uses' from AreEqual factor
     this.vbool58_uses_B[2] = BooleanAreEqualOp.AAverageConditional(this.vbool326_B, this.vbool128_uses_F[0]);
     // Message to 'vbool136_uses' from UsesEqualDef factor
     this.vbool136_uses_F[0] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool136_uses_B, this.vbool136_F, 0, this.vbool136_uses_F[0]);
     // Message to 'vbool120_uses' from AreEqual factor
     this.vbool120_uses_B[1] = BooleanAreEqualOp.BAverageConditional(this.vbool350_B, this.vbool136_uses_F[0]);
     // Message to 'vbool120_marginal' from UsesEqualDef factor
     this.vbool120_marginal_B = UsesEqualDefOp.MarginalAverageConditional<Bernoulli>(this.vbool120_uses_B, this.vbool120_F, this.vbool120_marginal_B);
     // Message to 'vbool350' from AreEqual factor
     this.vbool350_F = BooleanAreEqualOp.AreEqualAverageConditional(this.vbool136_uses_F[0], this.vbool120_uses_F[1]);
     // Message to 'vbool350_marginal' from ReplicateWithMarginal factor
     this.vbool350_marginal_B = ReplicateOp.MarginalAverageConditional<Bernoulli>(this.vbool350_uses_B, this.vbool350_F, this.vbool350_marginal_B);
     // Message to 'vbool120_uses' from UsesEqualDef factor
     this.vbool120_uses_F[0] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool120_uses_B, this.vbool120_F, 0, this.vbool120_uses_F[0]);
     // Message to 'vbool97_uses' from AreEqual factor
     this.vbool97_uses_B[1] = BooleanAreEqualOp.AAverageConditional(this.vbool342_B, this.vbool120_uses_F[0]);
     // Message to 'vbool97_marginal' from UsesEqualDef factor
     this.vbool97_marginal_B = UsesEqualDefOp.MarginalAverageConditional<Bernoulli>(this.vbool97_uses_B, this.vbool97_F, this.vbool97_marginal_B);
     // Message to 'vbool342' from AreEqual factor
     this.vbool342_F = BooleanAreEqualOp.AreEqualAverageConditional(this.vbool97_uses_F[1], this.vbool120_uses_F[0]);
     // Message to 'vbool342_marginal' from ReplicateWithMarginal factor
     this.vbool342_marginal_B = ReplicateOp.MarginalAverageConditional<Bernoulli>(this.vbool342_uses_B, this.vbool342_F, this.vbool342_marginal_B);
     // Message to 'vbool97_uses' from UsesEqualDef factor
     this.vbool97_uses_F[0] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool97_uses_B, this.vbool97_F, 0, this.vbool97_uses_F[0]);
     // Message to 'vbool175_uses' from AreEqual factor
     this.vbool175_uses_B[1] = BooleanAreEqualOp.BAverageConditional(this.vbool469_B, this.vbool97_uses_F[0]);
     // Message to 'vbool175_marginal' from UsesEqualDef factor
     this.vbool175_marginal_B = UsesEqualDefOp.MarginalAverageConditional<Bernoulli>(this.vbool175_uses_B, this.vbool175_F, this.vbool175_marginal_B);
     // Message to 'vbool469' from AreEqual factor
     this.vbool469_F = BooleanAreEqualOp.AreEqualAverageConditional(this.vbool97_uses_F[0], this.vbool175_uses_F[1]);
     // Message to 'vbool469_marginal' from ReplicateWithMarginal factor
     this.vbool469_marginal_B = ReplicateOp.MarginalAverageConditional<Bernoulli>(this.vbool469_uses_B, this.vbool469_F, this.vbool469_marginal_B);
     // Message to 'vbool175_uses' from UsesEqualDef factor
     this.vbool175_uses_F[0] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool175_uses_B, this.vbool175_F, 0, this.vbool175_uses_F[0]);
     // Message to 'vbool167_uses' from AreEqual factor
     this.vbool167_uses_B[1] = BooleanAreEqualOp.BAverageConditional(this.vbool439_B, this.vbool175_uses_F[0]);
     // Message to 'vbool167_marginal' from UsesEqualDef factor
     this.vbool167_marginal_B = UsesEqualDefOp.MarginalAverageConditional<Bernoulli>(this.vbool167_uses_B, this.vbool167_F, this.vbool167_marginal_B);
     // Message to 'vbool439' from AreEqual factor
     this.vbool439_F = BooleanAreEqualOp.AreEqualAverageConditional(this.vbool175_uses_F[0], this.vbool167_uses_F[1]);
     // Message to 'vbool439_marginal' from ReplicateWithMarginal factor
     this.vbool439_marginal_B = ReplicateOp.MarginalAverageConditional<Bernoulli>(this.vbool439_uses_B, this.vbool439_F, this.vbool439_marginal_B);
     // Message to 'vbool167_uses' from UsesEqualDef factor
     this.vbool167_uses_F[0] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool167_uses_B, this.vbool167_F, 0, this.vbool167_uses_F[0]);
     // Message to 'vbool149_uses' from AreEqual factor
     this.vbool149_uses_B[0] = BooleanAreEqualOp.AAverageConditional(this.vbool431_B, this.vbool167_uses_F[0]);
     // Message to 'vbool149_marginal' from UsesEqualDef factor
     this.vbool149_marginal_B = UsesEqualDefOp.MarginalAverageConditional<Bernoulli>(this.vbool149_uses_B, this.vbool149_F, this.vbool149_marginal_B);
     // Message to 'vbool431' from AreEqual factor
     this.vbool431_F = BooleanAreEqualOp.AreEqualAverageConditional(this.vbool149_uses_F[0], this.vbool167_uses_F[0]);
     // Message to 'vbool431_marginal' from ReplicateWithMarginal factor
     this.vbool431_marginal_B = ReplicateOp.MarginalAverageConditional<Bernoulli>(this.vbool431_uses_B, this.vbool431_F, this.vbool431_marginal_B);
     // Message to 'vbool149_uses' from UsesEqualDef factor
     this.vbool149_uses_F[1] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool149_uses_B, this.vbool149_F, 1, this.vbool149_uses_F[1]);
     // Message to 'vbool84_uses' from AreEqual factor
     this.vbool84_uses_B[0] = BooleanAreEqualOp.AAverageConditional(this.vbool470_B, this.vbool149_uses_F[1]);
     // Message to 'vbool84_marginal' from UsesEqualDef factor
     this.vbool84_marginal_B = UsesEqualDefOp.MarginalAverageConditional<Bernoulli>(this.vbool84_uses_B, this.vbool84_F, this.vbool84_marginal_B);
     // Message to 'vbool470' from AreEqual factor
     this.vbool470_F = BooleanAreEqualOp.AreEqualAverageConditional(this.vbool84_uses_F[0], this.vbool149_uses_F[1]);
     // Message to 'vbool470_marginal' from ReplicateWithMarginal factor
     this.vbool470_marginal_B = ReplicateOp.MarginalAverageConditional<Bernoulli>(this.vbool470_uses_B, this.vbool470_F, this.vbool470_marginal_B);
     // Message to 'vbool84_uses' from UsesEqualDef factor
     this.vbool84_uses_F[1] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool84_uses_B, this.vbool84_F, 1, this.vbool84_uses_F[1]);
     // Message to 'vbool76_uses' from AreEqual factor
     this.vbool76_uses_B[0] = BooleanAreEqualOp.BAverageConditional(this.vbool334_B, this.vbool84_uses_F[1]);
     // Message to 'vbool76_marginal' from UsesEqualDef factor
     this.vbool76_marginal_B = UsesEqualDefOp.MarginalAverageConditional<Bernoulli>(this.vbool76_uses_B, this.vbool76_F, this.vbool76_marginal_B);
     // Message to 'vbool334' from AreEqual factor
     this.vbool334_F = BooleanAreEqualOp.AreEqualAverageConditional(this.vbool84_uses_F[1], this.vbool76_uses_F[0]);
     // Message to 'vbool334_marginal' from ReplicateWithMarginal factor
     this.vbool334_marginal_B = ReplicateOp.MarginalAverageConditional<Bernoulli>(this.vbool334_uses_B, this.vbool334_F, this.vbool334_marginal_B);
     // Message to 'vbool76_uses' from UsesEqualDef factor
     this.vbool76_uses_F[1] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool76_uses_B, this.vbool76_F, 1, this.vbool76_uses_F[1]);
     // Message to 'vbool58_uses' from AreEqual factor
     this.vbool58_uses_B[0] = BooleanAreEqualOp.AAverageConditional(this.vbool318_B, this.vbool76_uses_F[1]);
     // Message to 'vbool58_marginal' from UsesEqualDef factor
     this.vbool58_marginal_B = UsesEqualDefOp.MarginalAverageConditional<Bernoulli>(this.vbool58_uses_B, this.vbool58_F, this.vbool58_marginal_B);
     // Message to 'vbool318' from AreEqual factor
     this.vbool318_F = BooleanAreEqualOp.AreEqualAverageConditional(this.vbool58_uses_F[0], this.vbool76_uses_F[1]);
     // Message to 'vbool318_marginal' from ReplicateWithMarginal factor
     this.vbool318_marginal_B = ReplicateOp.MarginalAverageConditional<Bernoulli>(this.vbool318_uses_B, this.vbool318_F, this.vbool318_marginal_B);
     // Message to 'vbool58_uses' from UsesEqualDef factor
     this.vbool58_uses_F[1] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool58_uses_B, this.vbool58_F, 1, this.vbool58_uses_F[1]);
     // Message to 'vbool50_uses' from AreEqual factor
     this.vbool50_uses_B[0] = BooleanAreEqualOp.BAverageConditional(this.vbool310_B, this.vbool58_uses_F[1]);
     // Message to 'vbool50_marginal' from UsesEqualDef factor
     this.vbool50_marginal_B = UsesEqualDefOp.MarginalAverageConditional<Bernoulli>(this.vbool50_uses_B, this.vbool50_F, this.vbool50_marginal_B);
     // Message to 'vbool310' from AreEqual factor
     this.vbool310_F = BooleanAreEqualOp.AreEqualAverageConditional(this.vbool58_uses_F[1], this.vbool50_uses_F[0]);
     // Message to 'vbool310_marginal' from ReplicateWithMarginal factor
     this.vbool310_marginal_B = ReplicateOp.MarginalAverageConditional<Bernoulli>(this.vbool310_uses_B, this.vbool310_F, this.vbool310_marginal_B);
     // Message to 'vbool58_uses' from UsesEqualDef factor
     this.vbool58_uses_F[2] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool58_uses_B, this.vbool58_F, 2, this.vbool58_uses_F[2]);
     // Message to 'vbool128_uses' from AreEqual factor
     this.vbool128_uses_B[0] = BooleanAreEqualOp.BAverageConditional(this.vbool326_B, this.vbool58_uses_F[2]);
     // Message to 'vbool128_marginal' from UsesEqualDef factor
     this.vbool128_marginal_B = UsesEqualDefOp.MarginalAverageConditional<Bernoulli>(this.vbool128_uses_B, this.vbool128_F, this.vbool128_marginal_B);
     // Message to 'vbool326' from AreEqual factor
     this.vbool326_F = BooleanAreEqualOp.AreEqualAverageConditional(this.vbool58_uses_F[2], this.vbool128_uses_F[0]);
     // Message to 'vbool326_marginal' from ReplicateWithMarginal factor
     this.vbool326_marginal_B = ReplicateOp.MarginalAverageConditional<Bernoulli>(this.vbool326_uses_B, this.vbool326_F, this.vbool326_marginal_B);
     // Message to 'vbool128_uses' from UsesEqualDef factor
     this.vbool128_uses_F[1] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool128_uses_B, this.vbool128_F, 1, this.vbool128_uses_F[1]);
     // Message to 'vbool136_uses' from AreEqual factor
     this.vbool136_uses_B[1] = BooleanAreEqualOp.AAverageConditional(this.vbool358_B, this.vbool128_uses_F[1]);
     // Message to 'vbool136_marginal' from UsesEqualDef factor
     this.vbool136_marginal_B = UsesEqualDefOp.MarginalAverageConditional<Bernoulli>(this.vbool136_uses_B, this.vbool136_F, this.vbool136_marginal_B);
     // Message to 'vbool358' from AreEqual factor
     this.vbool358_F = BooleanAreEqualOp.AreEqualAverageConditional(this.vbool136_uses_F[1], this.vbool128_uses_F[1]);
     // Message to 'vbool358_marginal' from ReplicateWithMarginal factor
     this.vbool358_marginal_B = ReplicateOp.MarginalAverageConditional<Bernoulli>(this.vbool358_uses_B, this.vbool358_F, this.vbool358_marginal_B);
     // Message to 'vbool50_uses' from UsesEqualDef factor
     this.vbool50_uses_F[1] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool50_uses_B, this.vbool50_F, 1, this.vbool50_uses_F[1]);
     // Message to 'vbool6_uses' from AreEqual factor
     this.vbool6_uses_B[0] = BooleanAreEqualOp.AAverageConditional(this.vbool294_B, this.vbool50_uses_F[1]);
     // Message to 'vbool6_marginal' from UsesEqualDef factor
     this.vbool6_marginal_B = UsesEqualDefOp.MarginalAverageConditional<Bernoulli>(this.vbool6_uses_B, this.vbool6_F, this.vbool6_marginal_B);
     // Message to 'vbool294' from AreEqual factor
     this.vbool294_F = BooleanAreEqualOp.AreEqualAverageConditional(this.vbool6_uses_F[0], this.vbool50_uses_F[1]);
     // Message to 'vbool294_marginal' from ReplicateWithMarginal factor
     this.vbool294_marginal_B = ReplicateOp.MarginalAverageConditional<Bernoulli>(this.vbool294_uses_B, this.vbool294_F, this.vbool294_marginal_B);
     // Message to 'vbool136_uses' from UsesEqualDef factor
     this.vbool136_uses_F[2] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool136_uses_B, this.vbool136_F, 2, this.vbool136_uses_F[2]);
     // Message to 'vbool24_uses' from AreEqual factor
     this.vbool24_uses_B[0] = BooleanAreEqualOp.BAverageConditional(this.vbool366_B, this.vbool136_uses_F[2]);
     // Message to 'vbool24_marginal' from UsesEqualDef factor
     this.vbool24_marginal_B = UsesEqualDefOp.MarginalAverageConditional<Bernoulli>(this.vbool24_uses_B, this.vbool24_F, this.vbool24_marginal_B);
     // Message to 'vbool366' from AreEqual factor
     this.vbool366_F = BooleanAreEqualOp.AreEqualAverageConditional(this.vbool136_uses_F[2], this.vbool24_uses_F[0]);
     // Message to 'vbool366_marginal' from ReplicateWithMarginal factor
     this.vbool366_marginal_B = ReplicateOp.MarginalAverageConditional<Bernoulli>(this.vbool366_uses_B, this.vbool366_F, this.vbool366_marginal_B);
     // Message to 'vbool24_uses' from UsesEqualDef factor
     this.vbool24_uses_F[1] = UsesEqualDefOp.UsesAverageConditional<Bernoulli>(this.vbool24_uses_B, this.vbool24_F, 1, this.vbool24_uses_F[1]);
     // Message to 'vbool32_uses' from AreEqual factor
     this.vbool32_uses_B[0] = BooleanAreEqualOp.AAverageConditional(this.vbool302_B, this.vbool24_uses_F[1]);
     // Message to 'vbool32_marginal' from UsesEqualDef factor
     this.vbool32_marginal_B = UsesEqualDefOp.MarginalAverageConditional<Bernoulli>(this.vbool32_uses_B, this.vbool32_F, this.vbool32_marginal_B);
     // Message to 'vbool302' from AreEqual factor
     this.vbool302_F = BooleanAreEqualOp.AreEqualAverageConditional(this.vbool32_uses_F[0], this.vbool24_uses_F[1]);
     // Message to 'vbool302_marginal' from ReplicateWithMarginal factor
     this.vbool302_marginal_B = ReplicateOp.MarginalAverageConditional<Bernoulli>(this.vbool302_uses_B, this.vbool302_F, this.vbool302_marginal_B);
 }
Ejemplo n.º 58
0
 /// <summary>EP message to <c>not</c>.</summary>
 /// <param name="b">Incoming message from <c>b</c>. Must be a proper distribution. If uniform, the result will be uniform.</param>
 /// <returns>The outgoing EP message to the <c>not</c> argument.</returns>
 /// <remarks>
 ///   <para>The outgoing message is a distribution matching the moments of <c>not</c> as the random arguments are varied. The formula is <c>proj[p(not) sum_(b) p(b) factor(not,b)]/p(not)</c>.</para>
 /// </remarks>
 /// <exception cref="ImproperMessageException">
 ///   <paramref name="b" /> is not a proper distribution.</exception>
 public static Bernoulli NotAverageConditional([SkipIfUniform] Bernoulli b)
 {
     return(Bernoulli.FromLogOdds(-b.LogOdds));
 }
Ejemplo n.º 59
0
 /// <include file='FactorDocs.xml' path='factor_docs/message_op_class[@name="BooleanOrOp"]/message_doc[@name="AAverageLogarithm(Bernoulli, bool)"]/*'/>
 public static Bernoulli AAverageLogarithm([SkipIfUniform] Bernoulli or, bool B)
 {
     return(Bernoulli.FromLogOdds(B ? 0.0 : or.LogOdds));
 }
Ejemplo n.º 60
0
 /// <summary>Evidence message for EP.</summary>
 /// <param name="not">Incoming message from <c>not</c>.</param>
 /// <param name="b">Incoming message from <c>b</c>.</param>
 /// <param name="to_not">Outgoing message to <c>not</c>.</param>
 /// <returns>Logarithm of the factor's average value across the given argument distributions.</returns>
 /// <remarks>
 ///   <para>The formula for the result is <c>log(sum_(not,b) p(not,b) factor(not,b))</c>.</para>
 /// </remarks>
 public static double LogAverageFactor(Bernoulli not, Bernoulli b, [Fresh] Bernoulli to_not)
 {
     return(to_not.GetLogAverageOf(not));
 }