context: using System;
  using MicrosoftResearch.Infer;
  using MicrosoftResearch.Infer.Distributions;
  using MicrosoftResearch.Infer.Collections;
  using MicrosoftResearch.Infer.Factors;
  
  namespace MicrosoftResearch.Infer.Models.User
  {
  	/// <summary>
  	/// Class for performing inference in model 'Model' using algorithm 'ExpectationPropagation'.
  	/// </summary>
  	/// <remarks>
  	/// The easiest way to use this class is to wrap an instance in a CompiledAlgorithm object and use
  	/// the methods on CompiledAlgorithm to set parameters and execute inference.
  	/// 
  	/// If you instead wish to use this class directly, you must perform the following steps:
  	/// 1) Create an instance of the class
  	/// 2) Set the value of any externally-set fields e.g. data, priors
  	/// 3) Call the Reset() method
  	/// 4) Call the Initialise() method once
  	/// 5) Call the Update() method multiple times  - each call performs one iteration of inference
  	/// 6) Use the XXXMarginal() methods to retrieve posterior marginals for different variables.
  	/// 
  	/// Generated by Infer.NET 2.3 beta 4 at 19:26 on 29 May 2010.
  	/// </remarks>
  	public class Model34_EP : IIterativeProcess
  	{
  		#region Fields
  		// Messages from uses of 'vbool84'
  		public Bernoulli[] vbool84_uses_B;
  		// The constant 'vBernoulli92'
  		public Bernoulli vBernoulli92;
  		// Message from definition of 'vbool84'
  		public Bernoulli vbool84_F;
  		// Messages from uses of 'vbool76'
  		public Bernoulli[] vbool76_uses_B;
  		// The constant 'vBernoulli84'
  		public Bernoulli vBernoulli84;
  		// Message from definition of 'vbool76'
  		public Bernoulli vbool76_F;
  		// Messages from uses of 'vbool334'
  		public Bernoulli[] vbool334_uses_B;
  		// Message from definition of 'vbool334'
  		public Bernoulli vbool334_F;
  		// Messages from uses of 'vbool149'
  		public Bernoulli[] vbool149_uses_B;
  		// The constant 'vBernoulli157'
  		public Bernoulli vBernoulli157;
  		// Message from definition of 'vbool149'
  		public Bernoulli vbool149_F;
  		// Messages from uses of 'vbool470'
  		public Bernoulli[] vbool470_uses_B;
  		// Message from definition of 'vbool470'
  		public Bernoulli vbool470_F;
  		// Messages from uses of 'vbool58'
  		public Bernoulli[] vbool58_uses_B;
  		// The constant 'vBernoulli66'
  		public Bernoulli vBernoulli66;
  		// Message from definition of 'vbool58'
  		public Bernoulli vbool58_F;
  		// Messages from uses of 'vbool318'
  		public Bernoulli[] vbool318_uses_B;
  		// Message from definition of 'vbool318'
  		public Bernoulli vbool318_F;
  		// Messages from uses of 'vbool167'
  		public Bernoulli[] vbool167_uses_B;
  		// The constant 'vBernoulli175'
  		public Bernoulli vBernoulli175;
  		// Message from definition of 'vbool167'
  		public Bernoulli vbool167_F;
  		// Messages from uses of 'vbool431'
  		public Bernoulli[] vbool431_uses_B;
  		// Message from definition of 'vbool431'
  		public Bernoulli vbool431_F;
  		// Messages from uses of 'vbool50'
  		public Bernoulli[] vbool50_uses_B;
  		// The constant 'vBernoulli58'
  		public Bernoulli vBernoulli58;
  		// Message from definition of 'vbool50'
  		public Bernoulli vbool50_F;
  		// Messages from uses of 'vbool310'
  		public Bernoulli[] vbool310_uses_B;
  		// Message from definition of 'vbool310'
  		public Bernoulli vbool310_F;
  		// Messages from uses of 'vbool128'
  		public Bernoulli[] vbool128_uses_B;
  		// The constant 'vBernoulli136'
  		public Bernoulli vBernoulli136;
  		// Message from definition of 'vbool128'
  		public Bernoulli vbool128_F;
  		// Messages from uses of 'vbool326'
  		public Bernoulli[] vbool326_uses_B;
  		// Message from definition of 'vbool326'
  		public Bernoulli vbool326_F;
  		// Messages from uses of 'vbool175'
  		public Bernoulli[] vbool175_uses_B;
  		// The constant 'vBernoulli183'
  		public Bernoulli vBernoulli183;
  		// Message from definition of 'vbool175'
  		public Bernoulli vbool175_F;
  		// Messages from uses of 'vbool439'
  		public Bernoulli[] vbool439_uses_B;
  		// Message from definition of 'vbool439'
  		public Bernoulli vbool439_F;
  		// Messages from uses of 'vbool6'
  		public Bernoulli[] vbool6_uses_B;
  		// The constant 'vBernoulli14'
  		public Bernoulli vBernoulli14;
  		// Message from definition of 'vbool6'
  		public Bernoulli vbool6_F;
  		// Messages from uses of 'vbool294'
  		public Bernoulli[] vbool294_uses_B;
  		// Message from definition of 'vbool294'
  		public Bernoulli vbool294_F;
  		// Messages from uses of 'vbool136'
  		public Bernoulli[] vbool136_uses_B;
  		// The constant 'vBernoulli144'
  		public Bernoulli vBernoulli144;
  		// Message from definition of 'vbool136'
  		public Bernoulli vbool136_F;
  		// Messages from uses of 'vbool358'
  		public Bernoulli[] vbool358_uses_B;
  		// Message from definition of 'vbool358'
  		public Bernoulli vbool358_F;
  		// Messages from uses of 'vbool97'
  		public Bernoulli[] vbool97_uses_B;
  		// The constant 'vBernoulli105'
  		public Bernoulli vBernoulli105;
  		// Message from definition of 'vbool97'
  		public Bernoulli vbool97_F;
  		// Messages from uses of 'vbool469'
  		public Bernoulli[] vbool469_uses_B;
  		// Message from definition of 'vbool469'
  		public Bernoulli vbool469_F;
  		// Messages from uses of 'vbool120'
  		public Bernoulli[] vbool120_uses_B;
  		// The constant 'vBernoulli128'
  		public Bernoulli vBernoulli128;
  		// Message from definition of 'vbool120'
  		public Bernoulli vbool120_F;
  		// Messages from uses of 'vbool350'
  		public Bernoulli[] vbool350_uses_B;
  		// Message from definition of 'vbool350'
  		public Bernoulli vbool350_F;
  		// Messages from uses of 'vbool24'
  		public Bernoulli[] vbool24_uses_B;
  		// The constant 'vBernoulli32'
  		public Bernoulli vBernoulli32;
  		// Message from definition of 'vbool24'
  		public Bernoulli vbool24_F;
  		// Messages from uses of 'vbool366'
  		public Bernoulli[] vbool366_uses_B;
  		// Message from definition of 'vbool366'
  		public Bernoulli vbool366_F;
  		// Messages from uses of 'vbool342'
  		public Bernoulli[] vbool342_uses_B;
  		// Message from definition of 'vbool342'
  		public Bernoulli vbool342_F;
  		// Messages from uses of 'vbool32'
  		public Bernoulli[] vbool32_uses_B;
  		// The constant 'vBernoulli40'
  		public Bernoulli vBernoulli40;
  		// Message from definition of 'vbool32'
  		public Bernoulli vbool32_F;
  		// Messages from uses of 'vbool302'
  		public Bernoulli[] vbool302_uses_B;
  		// Message from definition of 'vbool302'
  		public Bernoulli vbool302_F;
  		// Message to definition of 'vbool334'
  		public Bernoulli vbool334_B;
  		// Messages to uses of 'vbool76'
  		public Bernoulli[] vbool76_uses_F;
  		// Message to definition of 'vbool470'
  		public Bernoulli vbool470_B;
  		// Messages to uses of 'vbool149'
  		public Bernoulli[] vbool149_uses_F;
  		// Messages to uses of 'vbool84'
  		public Bernoulli[] vbool84_uses_F;
  		// Message to definition of 'vbool318'
  		public Bernoulli vbool318_B;
  		// Messages to uses of 'vbool58'
  		public Bernoulli[] vbool58_uses_F;
  		// The constant 'vBernoulli5'
  		public Bernoulli vBernoulli5;
  		// Message to definition of 'vbool431'
  		public Bernoulli vbool431_B;
  		// Messages to uses of 'vbool167'
  		public Bernoulli[] vbool167_uses_F;
  		// The constant 'vBernoulli6'
  		public Bernoulli vBernoulli6;
  		// Message to definition of 'vbool310'
  		public Bernoulli vbool310_B;
  		// Messages to uses of 'vbool50'
  		public Bernoulli[] vbool50_uses_F;
  		// Message to definition of 'vbool326'
  		public Bernoulli vbool326_B;
  		// Messages to uses of 'vbool128'
  		public Bernoulli[] vbool128_uses_F;
  		// Message to definition of 'vbool439'
  		public Bernoulli vbool439_B;
  		// Messages to uses of 'vbool175'
  		public Bernoulli[] vbool175_uses_F;
  		// Message to definition of 'vbool294'
  		public Bernoulli vbool294_B;
  		// Messages to uses of 'vbool6'
  		public Bernoulli[] vbool6_uses_F;
  		// Message to definition of 'vbool358'
  		public Bernoulli vbool358_B;
  		// Messages to uses of 'vbool136'
  		public Bernoulli[] vbool136_uses_F;
  		// Message to definition of 'vbool469'
  		public Bernoulli vbool469_B;
  		// Messages to uses of 'vbool97'
  		public Bernoulli[] vbool97_uses_F;
  		// Message to definition of 'vbool350'
  		public Bernoulli vbool350_B;
  		// Messages to uses of 'vbool120'
  		public Bernoulli[] vbool120_uses_F;
  		// Message to definition of 'vbool366'
  		public Bernoulli vbool366_B;
  		// Messages to uses of 'vbool24'
  		public Bernoulli[] vbool24_uses_F;
  		// Message to definition of 'vbool342'
  		public Bernoulli vbool342_B;
  		// Message to definition of 'vbool302'
  		public Bernoulli vbool302_B;
  		// Messages to uses of 'vbool32'
  		public Bernoulli[] vbool32_uses_F;
  		// Message to marginal of 'vbool334'
  		public Bernoulli vbool334_marginal_B;
  		// Message to marginal of 'vbool470'
  		public Bernoulli vbool470_marginal_B;
  		// Message to marginal of 'vbool318'
  		public Bernoulli vbool318_marginal_B;
  		// Message to marginal of 'vbool431'
  		public Bernoulli vbool431_marginal_B;
  		// Message to marginal of 'vbool310'
  		public Bernoulli vbool310_marginal_B;
  		// Message to marginal of 'vbool326'
  		public Bernoulli vbool326_marginal_B;
  		// Message to marginal of 'vbool439'
  		public Bernoulli vbool439_marginal_B;
  		// Message to marginal of 'vbool294'
  		public Bernoulli vbool294_marginal_B;
  		// Message to marginal of 'vbool358'
  		public Bernoulli vbool358_marginal_B;
  		// Message to marginal of 'vbool469'
  		public Bernoulli vbool469_marginal_B;
  		// Message to marginal of 'vbool350'
  		public Bernoulli vbool350_marginal_B;
  		// Message to marginal of 'vbool366'
  		public Bernoulli vbool366_marginal_B;
  		// Message to marginal of 'vbool342'
  		public Bernoulli vbool342_marginal_B;
  		// Message to marginal of 'vbool302'
  		public Bernoulli vbool302_marginal_B;
  		// Message to marginal of 'vbool84'
  		public Bernoulli vbool84_marginal_B;
  		// Message to marginal of 'vbool76'
  		public Bernoulli vbool76_marginal_B;
  		// Message to marginal of 'vbool149'
  		public Bernoulli vbool149_marginal_B;
  		// Message to marginal of 'vbool58'
  		public Bernoulli vbool58_marginal_B;
  		// Message to marginal of 'vbool167'
  		public Bernoulli vbool167_marginal_B;
  		// Message to marginal of 'vbool50'
  		public Bernoulli vbool50_marginal_B;
  		// Message to marginal of 'vbool128'
  		public Bernoulli vbool128_marginal_B;
  		// Message to marginal of 'vbool175'
  		public Bernoulli vbool175_marginal_B;
  		// Message to marginal of 'vbool6'
  		public Bernoulli vbool6_marginal_B;
  		// Message to marginal of 'vbool136'
  		public Bernoulli vbool136_marginal_B;
  		// Message to marginal of 'vbool97'
  		public Bernoulli vbool97_marginal_B;
  		// Message to marginal of 'vbool120'
  		public Bernoulli vbool120_marginal_B;
  		// Message to marginal of 'vbool24'
  		public Bernoulli vbool24_marginal_B;
  		// Message to marginal of 'vbool32'
  		public Bernoulli vbool32_marginal_B;
  		#endregion
  
  		#region Methods
  		/// <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 '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 '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 '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 '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 '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 '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 '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 '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 '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 '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 '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 '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 '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 '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 '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 '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 '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.vbool334_B = ArrayHelper.MakeUniform<Bernoulli>(new Bernoulli());
  			// 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.vbool470_B = ArrayHelper.MakeUniform<Bernoulli>(new Bernoulli());
  			// 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);
  			}
  			// 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);
  			}
  			this.vbool318_B = ArrayHelper.MakeUniform<Bernoulli>(new Bernoulli());
  			// 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.vBernoulli5 = new Bernoulli(0.9);
  			// 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 'vbool431_uses' from EqualRandom factor
  			this.vbool431_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 'vbool439_uses' from EqualRandom factor
  			this.vbool439_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 'vbool350_uses' from EqualRandom factor
  			this.vbool350_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 'vbool342_uses' from EqualRandom factor
  			this.vbool342_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 'vbool334' from ReplicateWithMarginal factor
  			this.vbool334_B = ReplicateOp.DefAverageConditional<Bernoulli>(this.vbool334_uses_B, this.vbool334_B);
  			// Message to 'vbool318' from ReplicateWithMarginal factor
  			this.vbool318_B = ReplicateOp.DefAverageConditional<Bernoulli>(this.vbool318_uses_B, this.vbool318_B);
  			this.vbool431_B = ArrayHelper.MakeUniform<Bernoulli>(new Bernoulli());
  			// Message to 'vbool431' from ReplicateWithMarginal factor
  			this.vbool431_B = ReplicateOp.DefAverageConditional<Bernoulli>(this.vbool431_uses_B, this.vbool431_B);
  			// 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.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.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];
  
gt: 			for(int _ind0 = 0; _ind0<2; _ind0++)