AIMA.Probability.Example.BayesNetExampleFactory.constructToothacheCavityCatchWeatherNetwork C# (CSharp) Method

constructToothacheCavityCatchWeatherNetwork() public static method

public static constructToothacheCavityCatchWeatherNetwork ( ) : BayesianNetwork
return BayesianNetwork
        public static BayesianNetwork constructToothacheCavityCatchWeatherNetwork()
        {
            FiniteNode cavity = new FullCPTNode(ExampleRV.CAVITY_RV, new double[]
                                                                         {
                                                                             0.2, 0.8
                                                                         });
            FiniteNode toothache = new FullCPTNode(ExampleRV.TOOTHACHE_RV,
                                                   new double[]
                                                       {
                                                           // C=true, T=true
                                                           0.6,
                                                           // C=true, T=false
                                                           0.4,
                                                           // C=false, T=true
                                                           0.1,
                                                           // C=false, T=false
                                                           0.9

                                                       }, cavity);

            FiniteNode catchN = new FullCPTNode(ExampleRV.CATCH_RV, new double[]
                                                                        {
                                                                            // C=true, Catch=true
                                                                            0.9,
                                                                            // C=true, Catch=false
                                                                            0.1,
                                                                            // C=false, Catch=true
                                                                            0.2,
                                                                            // C=false, Catch=false
                                                                            0.8
                                                                        }, cavity);
            FiniteNode weather = new FullCPTNode(ExampleRV.WEATHER_RV,
                                                 new double[]
                                                     {
                                                         // sunny
                                                         0.6,
                                                         // rain
                                                         0.1,
                                                         // cloudy
                                                         0.29,
                                                         // snow
                                                         0.01
                                                     });

            return new BayesNet(cavity, weather);
        }