diff --git a/configure b/configure index 62bbc55e2..06fa67f67 100755 --- a/configure +++ b/configure @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.68. +# Generated by GNU Autoconf 2.67. # # # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, @@ -89,7 +89,6 @@ fi IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. -as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -215,18 +214,11 @@ IFS=$as_save_IFS # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. - # Preserve -v and -x to the replacement shell. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV export CONFIG_SHELL - case $- in # (((( - *v*x* | *x*v* ) as_opts=-vx ;; - *v* ) as_opts=-v ;; - *x* ) as_opts=-x ;; - * ) as_opts= ;; - esac - exec "$CONFIG_SHELL" $as_opts "$as_myself" ${1+"$@"} + exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"} fi if test x$as_have_required = xno; then : @@ -809,9 +801,6 @@ LIBS CPPFLAGS CXX CXXFLAGS -LDFLAGS -LIBS -CPPFLAGS CCC CPP' @@ -1218,7 +1207,7 @@ Try \`$0 --help' for more information" $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 - : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" + : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option} ;; esac @@ -1554,7 +1543,7 @@ test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF configure -generated by GNU Autoconf 2.68 +generated by GNU Autoconf 2.67 Copyright (C) 2010 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation @@ -1600,7 +1589,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} as_fn_set_status $ac_retval } # ac_fn_c_try_compile @@ -1638,7 +1627,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} as_fn_set_status $ac_retval } # ac_fn_cxx_try_compile @@ -1684,7 +1673,7 @@ fi # interfere with the next link command; also delete a directory that is # left behind by Apple's compiler. We do this before executing the actions. rm -rf conftest.dSYM conftest_ipa8_conftest.oo - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} as_fn_set_status $ac_retval } # ac_fn_c_try_link @@ -1721,7 +1710,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} as_fn_set_status $ac_retval } # ac_fn_c_try_cpp @@ -1734,10 +1723,10 @@ fi ac_fn_c_check_header_mongrel () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - if eval \${$3+:} false; then : + if eval "test \"\${$3+set}\"" = set; then : { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } -if eval \${$3+:} false; then : +if eval "test \"\${$3+set}\"" = set; then : $as_echo_n "(cached) " >&6 fi eval ac_res=\$$3 @@ -1800,7 +1789,7 @@ $as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } -if eval \${$3+:} false; then : +if eval "test \"\${$3+set}\"" = set; then : $as_echo_n "(cached) " >&6 else eval "$3=\$ac_header_compiler" @@ -1809,7 +1798,7 @@ eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } fi - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} } # ac_fn_c_check_header_mongrel @@ -1850,7 +1839,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=$ac_status fi rm -rf conftest.dSYM conftest_ipa8_conftest.oo - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} as_fn_set_status $ac_retval } # ac_fn_c_try_run @@ -1864,7 +1853,7 @@ ac_fn_c_check_header_compile () as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } -if eval \${$3+:} false; then : +if eval "test \"\${$3+set}\"" = set; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -1882,7 +1871,7 @@ fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} } # ac_fn_c_check_header_compile @@ -1894,7 +1883,7 @@ ac_fn_c_check_func () as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } -if eval \${$3+:} false; then : +if eval "test \"\${$3+set}\"" = set; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -1949,7 +1938,7 @@ fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} } # ac_fn_c_check_func @@ -2126,7 +2115,7 @@ rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ rm -f conftest.val fi - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} as_fn_set_status $ac_retval } # ac_fn_c_compute_int @@ -2140,7 +2129,7 @@ ac_fn_c_check_type () as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } -if eval \${$3+:} false; then : +if eval "test \"\${$3+set}\"" = set; then : $as_echo_n "(cached) " >&6 else eval "$3=no" @@ -2181,7 +2170,7 @@ fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} } # ac_fn_c_check_type @@ -2194,7 +2183,7 @@ ac_fn_c_check_member () as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2.$3" >&5 $as_echo_n "checking for $2.$3... " >&6; } -if eval \${$4+:} false; then : +if eval "test \"\${$4+set}\"" = set; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -2238,7 +2227,7 @@ fi eval ac_res=\$$4 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} } # ac_fn_c_check_member cat >config.log <<_ACEOF @@ -2246,7 +2235,7 @@ This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by $as_me, which was -generated by GNU Autoconf 2.68. Invocation command line was +generated by GNU Autoconf 2.67. Invocation command line was $ $0 $@ @@ -2504,7 +2493,7 @@ $as_echo "$as_me: loading site script $ac_site_file" >&6;} || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "failed to load site script $ac_site_file -See \`config.log' for more details" "$LINENO" 5; } +See \`config.log' for more details" "$LINENO" 5 ; } fi done @@ -2608,7 +2597,7 @@ if test -n "$ac_tool_prefix"; then set dummy ${ac_tool_prefix}gcc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_CC+:} false; then : +if test "${ac_cv_prog_CC+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then @@ -2648,7 +2637,7 @@ if test -z "$ac_cv_prog_CC"; then set dummy gcc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_CC+:} false; then : +if test "${ac_cv_prog_ac_ct_CC+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then @@ -2701,7 +2690,7 @@ if test -z "$CC"; then set dummy ${ac_tool_prefix}cc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_CC+:} false; then : +if test "${ac_cv_prog_CC+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then @@ -2741,7 +2730,7 @@ if test -z "$CC"; then set dummy cc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_CC+:} false; then : +if test "${ac_cv_prog_CC+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then @@ -2800,7 +2789,7 @@ if test -z "$CC"; then set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_CC+:} false; then : +if test "${ac_cv_prog_CC+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then @@ -2844,7 +2833,7 @@ do set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_CC+:} false; then : +if test "${ac_cv_prog_ac_ct_CC+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then @@ -2899,7 +2888,7 @@ fi test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "no acceptable C compiler found in \$PATH -See \`config.log' for more details" "$LINENO" 5; } +See \`config.log' for more details" "$LINENO" 5 ; } # Provide some information about the compiler. $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 @@ -3014,7 +3003,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "C compiler cannot create executables -See \`config.log' for more details" "$LINENO" 5; } +See \`config.log' for more details" "$LINENO" 5 ; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } @@ -3057,7 +3046,7 @@ else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of executables: cannot compile and link -See \`config.log' for more details" "$LINENO" 5; } +See \`config.log' for more details" "$LINENO" 5 ; } fi rm -f conftest conftest$ac_cv_exeext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 @@ -3116,7 +3105,7 @@ $as_echo "$ac_try_echo"; } >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot run C compiled programs. If you meant to cross compile, use \`--host'. -See \`config.log' for more details" "$LINENO" 5; } +See \`config.log' for more details" "$LINENO" 5 ; } fi fi fi @@ -3127,7 +3116,7 @@ rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out ac_clean_files=$ac_clean_files_save { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 $as_echo_n "checking for suffix of object files... " >&6; } -if ${ac_cv_objext+:} false; then : +if test "${ac_cv_objext+set}" = set; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -3168,7 +3157,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of object files: cannot compile -See \`config.log' for more details" "$LINENO" 5; } +See \`config.log' for more details" "$LINENO" 5 ; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi @@ -3178,7 +3167,7 @@ OBJEXT=$ac_cv_objext ac_objext=$OBJEXT { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 $as_echo_n "checking whether we are using the GNU C compiler... " >&6; } -if ${ac_cv_c_compiler_gnu+:} false; then : +if test "${ac_cv_c_compiler_gnu+set}" = set; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -3215,7 +3204,7 @@ ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 $as_echo_n "checking whether $CC accepts -g... " >&6; } -if ${ac_cv_prog_cc_g+:} false; then : +if test "${ac_cv_prog_cc_g+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_save_c_werror_flag=$ac_c_werror_flag @@ -3293,7 +3282,7 @@ else fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 $as_echo_n "checking for $CC option to accept ISO C89... " >&6; } -if ${ac_cv_prog_cc_c89+:} false; then : +if test "${ac_cv_prog_cc_c89+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_cv_prog_cc_c89=no @@ -3404,7 +3393,7 @@ if test -z "$CXX"; then set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_CXX+:} false; then : +if test "${ac_cv_prog_CXX+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$CXX"; then @@ -3448,7 +3437,7 @@ do set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_CXX+:} false; then : +if test "${ac_cv_prog_ac_ct_CXX+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CXX"; then @@ -3526,7 +3515,7 @@ done { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C++ compiler" >&5 $as_echo_n "checking whether we are using the GNU C++ compiler... " >&6; } -if ${ac_cv_cxx_compiler_gnu+:} false; then : +if test "${ac_cv_cxx_compiler_gnu+set}" = set; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -3563,7 +3552,7 @@ ac_test_CXXFLAGS=${CXXFLAGS+set} ac_save_CXXFLAGS=$CXXFLAGS { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CXX accepts -g" >&5 $as_echo_n "checking whether $CXX accepts -g... " >&6; } -if ${ac_cv_prog_cxx_g+:} false; then : +if test "${ac_cv_prog_cxx_g+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_save_cxx_werror_flag=$ac_cxx_werror_flag @@ -3651,7 +3640,7 @@ do set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_AWK+:} false; then : +if test "${ac_cv_prog_AWK+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$AWK"; then @@ -4214,7 +4203,7 @@ $SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || { $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5 $as_echo_n "checking build system type... " >&6; } -if ${ac_cv_build+:} false; then : +if test "${ac_cv_build+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_build_alias=$build_alias @@ -4230,7 +4219,7 @@ fi $as_echo "$ac_cv_build" >&6; } case $ac_cv_build in *-*-*) ;; -*) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;; +*) as_fn_error $? "invalid value of canonical build" "$LINENO" 5 ;; esac build=$ac_cv_build ac_save_IFS=$IFS; IFS='-' @@ -4248,7 +4237,7 @@ case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5 $as_echo_n "checking host system type... " >&6; } -if ${ac_cv_host+:} false; then : +if test "${ac_cv_host+set}" = set; then : $as_echo_n "(cached) " >&6 else if test "x$host_alias" = x; then @@ -4263,7 +4252,7 @@ fi $as_echo "$ac_cv_host" >&6; } case $ac_cv_host in *-*-*) ;; -*) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;; +*) as_fn_error $? "invalid value of canonical host" "$LINENO" 5 ;; esac host=$ac_cv_host ac_save_IFS=$IFS; IFS='-' @@ -4281,7 +4270,7 @@ case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking target system type" >&5 $as_echo_n "checking target system type... " >&6; } -if ${ac_cv_target+:} false; then : +if test "${ac_cv_target+set}" = set; then : $as_echo_n "(cached) " >&6 else if test "x$target_alias" = x; then @@ -4296,7 +4285,7 @@ fi $as_echo "$ac_cv_target" >&6; } case $ac_cv_target in *-*-*) ;; -*) as_fn_error $? "invalid value of canonical target" "$LINENO" 5;; +*) as_fn_error $? "invalid value of canonical target" "$LINENO" 5 ;; esac target=$ac_cv_target ac_save_IFS=$IFS; IFS='-' @@ -4525,7 +4514,7 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 $as_echo_n "checking for a BSD-compatible install... " >&6; } if test -z "$INSTALL"; then -if ${ac_cv_path_install+:} false; then : +if test "${ac_cv_path_install+set}" = set; then : $as_echo_n "(cached) " >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -4606,7 +4595,7 @@ if test -n "$ac_tool_prefix"; then set dummy ${ac_tool_prefix}ranlib; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_RANLIB+:} false; then : +if test "${ac_cv_prog_RANLIB+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$RANLIB"; then @@ -4646,7 +4635,7 @@ if test -z "$ac_cv_prog_RANLIB"; then set dummy ranlib; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_RANLIB+:} false; then : +if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_RANLIB"; then @@ -4698,7 +4687,7 @@ if test -n "$ac_tool_prefix"; then set dummy ${ac_tool_prefix}indent; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_INDENT+:} false; then : +if test "${ac_cv_prog_INDENT+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$INDENT"; then @@ -4738,7 +4727,7 @@ if test -z "$ac_cv_prog_INDENT"; then set dummy indent; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_INDENT+:} false; then : +if test "${ac_cv_prog_ac_ct_INDENT+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_INDENT"; then @@ -4790,7 +4779,7 @@ if test -n "$ac_tool_prefix"; then set dummy ${ac_tool_prefix}ar; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_AR+:} false; then : +if test "${ac_cv_prog_AR+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$AR"; then @@ -4830,7 +4819,7 @@ if test -z "$ac_cv_prog_AR"; then set dummy ar; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_AR+:} false; then : +if test "${ac_cv_prog_ac_ct_AR+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_AR"; then @@ -4882,7 +4871,7 @@ if test -n "$ac_tool_prefix"; then set dummy ${ac_tool_prefix}mpicc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_MPI_CC+:} false; then : +if test "${ac_cv_prog_MPI_CC+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$MPI_CC"; then @@ -4922,7 +4911,7 @@ if test -z "$ac_cv_prog_MPI_CC"; then set dummy mpicc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_MPI_CC+:} false; then : +if test "${ac_cv_prog_ac_ct_MPI_CC+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_MPI_CC"; then @@ -4973,7 +4962,7 @@ fi set dummy install-info; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_INSTALL_INFO+:} false; then : +if test "${ac_cv_path_INSTALL_INFO+set}" = set; then : $as_echo_n "(cached) " >&6 else case $INSTALL_INFO in @@ -5015,7 +5004,7 @@ fi set dummy sh; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_SHELL+:} false; then : +if test "${ac_cv_path_SHELL+set}" = set; then : $as_echo_n "(cached) " >&6 else case $SHELL in @@ -5062,7 +5051,7 @@ then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lws2_32" >&5 $as_echo_n "checking for main in -lws2_32... " >&6; } -if ${ac_cv_lib_ws2_32_main+:} false; then : +if test "${ac_cv_lib_ws2_32_main+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS @@ -5090,7 +5079,7 @@ LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ws2_32_main" >&5 $as_echo "$ac_cv_lib_ws2_32_main" >&6; } -if test "x$ac_cv_lib_ws2_32_main" = xyes; then : +if test "x$ac_cv_lib_ws2_32_main" = x""yes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBWS2_32 1 _ACEOF @@ -5106,7 +5095,7 @@ fi CXX="${CXX} -mno-cygwin" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lwsock32" >&5 $as_echo_n "checking for main in -lwsock32... " >&6; } -if ${ac_cv_lib_wsock32_main+:} false; then : +if test "${ac_cv_lib_wsock32_main+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS @@ -5134,7 +5123,7 @@ LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_wsock32_main" >&5 $as_echo "$ac_cv_lib_wsock32_main" >&6; } -if test "x$ac_cv_lib_wsock32_main" = xyes; then : +if test "x$ac_cv_lib_wsock32_main" = x""yes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBWSOCK32 1 _ACEOF @@ -5147,7 +5136,7 @@ fi else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lwsock32" >&5 $as_echo_n "checking for main in -lwsock32... " >&6; } -if ${ac_cv_lib_wsock32_main+:} false; then : +if test "${ac_cv_lib_wsock32_main+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS @@ -5175,7 +5164,7 @@ LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_wsock32_main" >&5 $as_echo "$ac_cv_lib_wsock32_main" >&6; } -if test "x$ac_cv_lib_wsock32_main" = xyes; then : +if test "x$ac_cv_lib_wsock32_main" = x""yes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBWSOCK32 1 _ACEOF @@ -5188,7 +5177,7 @@ fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lpsapi" >&5 $as_echo_n "checking for main in -lpsapi... " >&6; } -if ${ac_cv_lib_psapi_main+:} false; then : +if test "${ac_cv_lib_psapi_main+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS @@ -5216,7 +5205,7 @@ LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_psapi_main" >&5 $as_echo "$ac_cv_lib_psapi_main" >&6; } -if test "x$ac_cv_lib_psapi_main" = xyes; then : +if test "x$ac_cv_lib_psapi_main" = x""yes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBPSAPI 1 _ACEOF @@ -5252,7 +5241,7 @@ else ENABLE_WINCONSOLE="#" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sin in -lm" >&5 $as_echo_n "checking for sin in -lm... " >&6; } -if ${ac_cv_lib_m_sin+:} false; then : +if test "${ac_cv_lib_m_sin+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS @@ -5286,7 +5275,7 @@ LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_sin" >&5 $as_echo "$ac_cv_lib_m_sin" >&6; } -if test "x$ac_cv_lib_m_sin" = xyes; then : +if test "x$ac_cv_lib_m_sin" = x""yes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBM 1 _ACEOF @@ -5297,7 +5286,7 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for socket in -lsocket" >&5 $as_echo_n "checking for socket in -lsocket... " >&6; } -if ${ac_cv_lib_socket_socket+:} false; then : +if test "${ac_cv_lib_socket_socket+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS @@ -5331,7 +5320,7 @@ LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_socket_socket" >&5 $as_echo "$ac_cv_lib_socket_socket" >&6; } -if test "x$ac_cv_lib_socket_socket" = xyes; then : +if test "x$ac_cv_lib_socket_socket" = x""yes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBSOCKET 1 _ACEOF @@ -5342,7 +5331,7 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for getsockname in -lxnet" >&5 $as_echo_n "checking for getsockname in -lxnet... " >&6; } -if ${ac_cv_lib_xnet_getsockname+:} false; then : +if test "${ac_cv_lib_xnet_getsockname+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS @@ -5376,7 +5365,7 @@ LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_xnet_getsockname" >&5 $as_echo "$ac_cv_lib_xnet_getsockname" >&6; } -if test "x$ac_cv_lib_xnet_getsockname" = xyes; then : +if test "x$ac_cv_lib_xnet_getsockname" = x""yes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBXNET 1 _ACEOF @@ -5387,7 +5376,7 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lstdc++" >&5 $as_echo_n "checking for main in -lstdc++... " >&6; } -if ${ac_cv_lib_stdcpp_main+:} false; then : +if test "${ac_cv_lib_stdcpp_main+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS @@ -5415,7 +5404,7 @@ LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_stdcpp_main" >&5 $as_echo "$ac_cv_lib_stdcpp_main" >&6; } -if test "x$ac_cv_lib_stdcpp_main" = xyes; then : +if test "x$ac_cv_lib_stdcpp_main" = x""yes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBSTDC__ 1 _ACEOF @@ -5426,7 +5415,7 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lnsl" >&5 $as_echo_n "checking for main in -lnsl... " >&6; } -if ${ac_cv_lib_nsl_main+:} false; then : +if test "${ac_cv_lib_nsl_main+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS @@ -5454,7 +5443,7 @@ LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_nsl_main" >&5 $as_echo "$ac_cv_lib_nsl_main" >&6; } -if test "x$ac_cv_lib_nsl_main" = xyes; then : +if test "x$ac_cv_lib_nsl_main" = x""yes; then : have_nsl=yes else @@ -5463,7 +5452,7 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lcrypt" >&5 $as_echo_n "checking for main in -lcrypt... " >&6; } -if ${ac_cv_lib_crypt_main+:} false; then : +if test "${ac_cv_lib_crypt_main+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS @@ -5491,7 +5480,7 @@ LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypt_main" >&5 $as_echo "$ac_cv_lib_crypt_main" >&6; } -if test "x$ac_cv_lib_crypt_main" = xyes; then : +if test "x$ac_cv_lib_crypt_main" = x""yes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBCRYPT 1 _ACEOF @@ -5502,7 +5491,7 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lnss_files" >&5 $as_echo_n "checking for main in -lnss_files... " >&6; } -if ${ac_cv_lib_nss_files_main+:} false; then : +if test "${ac_cv_lib_nss_files_main+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS @@ -5530,7 +5519,7 @@ LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_nss_files_main" >&5 $as_echo "$ac_cv_lib_nss_files_main" >&6; } -if test "x$ac_cv_lib_nss_files_main" = xyes; then : +if test "x$ac_cv_lib_nss_files_main" = x""yes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBNSS_FILES 1 _ACEOF @@ -5541,7 +5530,7 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lnss_dns" >&5 $as_echo_n "checking for main in -lnss_dns... " >&6; } -if ${ac_cv_lib_nss_dns_main+:} false; then : +if test "${ac_cv_lib_nss_dns_main+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS @@ -5569,7 +5558,7 @@ LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_nss_dns_main" >&5 $as_echo "$ac_cv_lib_nss_dns_main" >&6; } -if test "x$ac_cv_lib_nss_dns_main" = xyes; then : +if test "x$ac_cv_lib_nss_dns_main" = x""yes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBNSS_DNS 1 _ACEOF @@ -5580,7 +5569,7 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lresolv" >&5 $as_echo_n "checking for main in -lresolv... " >&6; } -if ${ac_cv_lib_resolv_main+:} false; then : +if test "${ac_cv_lib_resolv_main+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS @@ -5608,7 +5597,7 @@ LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_resolv_main" >&5 $as_echo "$ac_cv_lib_resolv_main" >&6; } -if test "x$ac_cv_lib_resolv_main" = xyes; then : +if test "x$ac_cv_lib_resolv_main" = x""yes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBRESOLV 1 _ACEOF @@ -5623,7 +5612,7 @@ if test "$yap_cv_readline" != "no" then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lreadline" >&5 $as_echo_n "checking for main in -lreadline... " >&6; } -if ${ac_cv_lib_readline_main+:} false; then : +if test "${ac_cv_lib_readline_main+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS @@ -5651,7 +5640,7 @@ LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_readline_main" >&5 $as_echo "$ac_cv_lib_readline_main" >&6; } -if test "x$ac_cv_lib_readline_main" = xyes; then : +if test "x$ac_cv_lib_readline_main" = x""yes; then : $as_echo "#define HAVE_LIBREADLINE 1" >>confdefs.h @@ -5663,7 +5652,7 @@ else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "--with-readline was given, but test for readline failed -See \`config.log' for more details" "$LINENO" 5; } +See \`config.log' for more details" "$LINENO" 5 ; } fi fi @@ -5673,7 +5662,7 @@ if test "$yap_cv_gmp" != "no" then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lgmp" >&5 $as_echo_n "checking for main in -lgmp... " >&6; } -if ${ac_cv_lib_gmp_main+:} false; then : +if test "${ac_cv_lib_gmp_main+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS @@ -5701,7 +5690,7 @@ LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_gmp_main" >&5 $as_echo "$ac_cv_lib_gmp_main" >&6; } -if test "x$ac_cv_lib_gmp_main" = xyes; then : +if test "x$ac_cv_lib_gmp_main" = x""yes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBGMP 1 _ACEOF @@ -5715,7 +5704,7 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for zlibVersion in -lz" >&5 $as_echo_n "checking for zlibVersion in -lz... " >&6; } -if ${ac_cv_lib_z_zlibVersion+:} false; then : +if test "${ac_cv_lib_z_zlibVersion+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS @@ -5749,7 +5738,7 @@ LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_z_zlibVersion" >&5 $as_echo "$ac_cv_lib_z_zlibVersion" >&6; } -if test "x$ac_cv_lib_z_zlibVersion" = xyes; then : +if test "x$ac_cv_lib_z_zlibVersion" = x""yes; then : ZLIBS="-lz" ZLIB=yes else @@ -5765,7 +5754,7 @@ if test "$yap_cv_myddas" != "no" then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lmysqlclient" >&5 $as_echo_n "checking for main in -lmysqlclient... " >&6; } - if ${yap_cv_mysql+:} false; then : + if test "${yap_cv_mysql+set}" = set; then : $as_echo_n "(cached) " >&6 else @@ -5802,7 +5791,7 @@ $as_echo "$yap_cv_mysql" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lodbc" >&5 $as_echo_n "checking for main in -lodbc... " >&6; } - if ${yap_cv_odbc+:} false; then : + if test "${yap_cv_odbc+set}" = set; then : $as_echo_n "(cached) " >&6 else @@ -5863,7 +5852,7 @@ then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_create in -lpthread" >&5 $as_echo_n "checking for pthread_create in -lpthread... " >&6; } -if ${ac_cv_lib_pthread_pthread_create+:} false; then : +if test "${ac_cv_lib_pthread_pthread_create+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS @@ -5897,7 +5886,7 @@ LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthread_pthread_create" >&5 $as_echo "$ac_cv_lib_pthread_pthread_create" >&6; } -if test "x$ac_cv_lib_pthread_pthread_create" = xyes; then : +if test "x$ac_cv_lib_pthread_pthread_create" = x""yes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBPTHREAD 1 _ACEOF @@ -5918,7 +5907,7 @@ if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then - if ${ac_cv_prog_CPP+:} false; then : + if test "${ac_cv_prog_CPP+set}" = set; then : $as_echo_n "(cached) " >&6 else # Double quotes because CPP needs to be expanded @@ -6034,7 +6023,7 @@ else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "C preprocessor \"$CPP\" fails sanity check -See \`config.log' for more details" "$LINENO" 5; } +See \`config.log' for more details" "$LINENO" 5 ; } fi ac_ext=c @@ -6046,7 +6035,7 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 $as_echo_n "checking for grep that handles long lines and -e... " >&6; } -if ${ac_cv_path_GREP+:} false; then : +if test "${ac_cv_path_GREP+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -z "$GREP"; then @@ -6109,7 +6098,7 @@ $as_echo "$ac_cv_path_GREP" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 $as_echo_n "checking for egrep... " >&6; } -if ${ac_cv_path_EGREP+:} false; then : +if test "${ac_cv_path_EGREP+set}" = set; then : $as_echo_n "(cached) " >&6 else if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 @@ -6176,7 +6165,7 @@ $as_echo "$ac_cv_path_EGREP" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 $as_echo_n "checking for ANSI C header files... " >&6; } -if ${ac_cv_header_stdc+:} false; then : +if test "${ac_cv_header_stdc+set}" = set; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -6306,7 +6295,7 @@ done for ac_header in pthread.h do : ac_fn_c_check_header_mongrel "$LINENO" "pthread.h" "ac_cv_header_pthread_h" "$ac_includes_default" -if test "x$ac_cv_header_pthread_h" = xyes; then : +if test "x$ac_cv_header_pthread_h" = x""yes; then : cat >>confdefs.h <<_ACEOF #define HAVE_PTHREAD_H 1 _ACEOF @@ -6427,7 +6416,7 @@ then CC=${MPI_CC} { $as_echo "$as_me:${as_lineno-$LINENO}: checking for MPI_Init in -lmpi" >&5 $as_echo_n "checking for MPI_Init in -lmpi... " >&6; } -if ${ac_cv_lib_mpi_MPI_Init+:} false; then : +if test "${ac_cv_lib_mpi_MPI_Init+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS @@ -6461,7 +6450,7 @@ LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_mpi_MPI_Init" >&5 $as_echo "$ac_cv_lib_mpi_MPI_Init" >&6; } -if test "x$ac_cv_lib_mpi_MPI_Init" = xyes; then : +if test "x$ac_cv_lib_mpi_MPI_Init" = x""yes; then : $as_echo "#define HAVE_LIBMPI 1" >>confdefs.h else @@ -6476,7 +6465,7 @@ fi else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for MPI_Init in -lmpich" >&5 $as_echo_n "checking for MPI_Init in -lmpich... " >&6; } -if ${ac_cv_lib_mpich_MPI_Init+:} false; then : +if test "${ac_cv_lib_mpich_MPI_Init+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS @@ -6510,7 +6499,7 @@ LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_mpich_MPI_Init" >&5 $as_echo "$ac_cv_lib_mpich_MPI_Init" >&6; } -if test "x$ac_cv_lib_mpich_MPI_Init" = xyes; then : +if test "x$ac_cv_lib_mpich_MPI_Init" = x""yes; then : $as_echo "#define HAVE_LIBMPICH 1" >>confdefs.h else @@ -6541,7 +6530,7 @@ then CC=${MPI_CC} { $as_echo "$as_me:${as_lineno-$LINENO}: checking for MPE_Init_log in -lmpe" >&5 $as_echo_n "checking for MPE_Init_log in -lmpe... " >&6; } -if ${ac_cv_lib_mpe_MPE_Init_log+:} false; then : +if test "${ac_cv_lib_mpe_MPE_Init_log+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS @@ -6575,7 +6564,7 @@ LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_mpe_MPE_Init_log" >&5 $as_echo "$ac_cv_lib_mpe_MPE_Init_log" >&6; } -if test "x$ac_cv_lib_mpe_MPE_Init_log" = xyes; then : +if test "x$ac_cv_lib_mpe_MPE_Init_log" = x""yes; then : $as_echo "#define HAVE_LIBMPE 1" >>confdefs.h else @@ -6603,7 +6592,7 @@ if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then - if ${ac_cv_prog_CPP+:} false; then : + if test "${ac_cv_prog_CPP+set}" = set; then : $as_echo_n "(cached) " >&6 else # Double quotes because CPP needs to be expanded @@ -6719,7 +6708,7 @@ else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "C preprocessor \"$CPP\" fails sanity check -See \`config.log' for more details" "$LINENO" 5; } +See \`config.log' for more details" "$LINENO" 5 ; } fi ac_ext=c @@ -6735,7 +6724,7 @@ then else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sys/wait.h that is POSIX.1 compatible" >&5 $as_echo_n "checking for sys/wait.h that is POSIX.1 compatible... " >&6; } -if ${ac_cv_header_sys_wait_h+:} false; then : +if test "${ac_cv_header_sys_wait_h+set}" = set; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -6776,14 +6765,14 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for restartable system calls" >&5 $as_echo_n "checking for restartable system calls... " >&6; } -if ${ac_cv_sys_restartable_syscalls+:} false; then : +if test "${ac_cv_sys_restartable_syscalls+set}" = set; then : $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot run test program while cross compiling -See \`config.log' for more details" "$LINENO" 5; } +See \`config.log' for more details" "$LINENO" 5 ; } else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -6865,7 +6854,7 @@ case "$target_os" in then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 $as_echo_n "checking for dlopen in -ldl... " >&6; } -if ${ac_cv_lib_dl_dlopen+:} false; then : +if test "${ac_cv_lib_dl_dlopen+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS @@ -6899,7 +6888,7 @@ LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 $as_echo "$ac_cv_lib_dl_dlopen" >&6; } -if test "x$ac_cv_lib_dl_dlopen" = xyes; then : +if test "x$ac_cv_lib_dl_dlopen" = x""yes; then : have_dl=yes else @@ -7031,7 +7020,7 @@ fi then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 $as_echo_n "checking for dlopen in -ldl... " >&6; } -if ${ac_cv_lib_dl_dlopen+:} false; then : +if test "${ac_cv_lib_dl_dlopen+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS @@ -7065,7 +7054,7 @@ LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 $as_echo "$ac_cv_lib_dl_dlopen" >&6; } -if test "x$ac_cv_lib_dl_dlopen" = xyes; then : +if test "x$ac_cv_lib_dl_dlopen" = x""yes; then : have_dl=yes else @@ -7103,7 +7092,7 @@ fi then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 $as_echo_n "checking for dlopen in -ldl... " >&6; } -if ${ac_cv_lib_dl_dlopen+:} false; then : +if test "${ac_cv_lib_dl_dlopen+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS @@ -7137,7 +7126,7 @@ LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 $as_echo "$ac_cv_lib_dl_dlopen" >&6; } -if test "x$ac_cv_lib_dl_dlopen" = xyes; then : +if test "x$ac_cv_lib_dl_dlopen" = x""yes; then : have_dl=yes else @@ -7254,7 +7243,7 @@ fi *) { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 $as_echo_n "checking for dlopen in -ldl... " >&6; } -if ${ac_cv_lib_dl_dlopen+:} false; then : +if test "${ac_cv_lib_dl_dlopen+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS @@ -7288,7 +7277,7 @@ LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 $as_echo "$ac_cv_lib_dl_dlopen" >&6; } -if test "x$ac_cv_lib_dl_dlopen" = xyes; then : +if test "x$ac_cv_lib_dl_dlopen" = x""yes; then : have_dl=yes else @@ -7449,7 +7438,7 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for zlibVersion in -lz" >&5 $as_echo_n "checking for zlibVersion in -lz... " >&6; } -if ${ac_cv_lib_z_zlibVersion+:} false; then : +if test "${ac_cv_lib_z_zlibVersion+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS @@ -7483,7 +7472,7 @@ LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_z_zlibVersion" >&5 $as_echo "$ac_cv_lib_z_zlibVersion" >&6; } -if test "x$ac_cv_lib_z_zlibVersion" = xyes; then : +if test "x$ac_cv_lib_z_zlibVersion" = x""yes; then : ZLIBS="-lz" ZLIB=yes else @@ -7519,7 +7508,7 @@ OLD_CC=${CC} CC=${LAM_MPI_CC} { $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -llam" >&5 $as_echo_n "checking for main in -llam... " >&6; } -if ${ac_cv_lib_lam_main+:} false; then : +if test "${ac_cv_lib_lam_main+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS @@ -7547,7 +7536,7 @@ LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_lam_main" >&5 $as_echo "$ac_cv_lib_lam_main" >&6; } -if test "x$ac_cv_lib_lam_main" = xyes; then : +if test "x$ac_cv_lib_lam_main" = x""yes; then : LAMOBJS=yap_mpi."$SO" else LAMOBJS=no @@ -7557,7 +7546,7 @@ CC=${OLD_CC} { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 $as_echo_n "checking for ANSI C header files... " >&6; } -if ${ac_cv_header_stdc+:} false; then : +if test "${ac_cv_header_stdc+set}" = set; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -7669,7 +7658,7 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sys/wait.h that is POSIX.1 compatible" >&5 $as_echo_n "checking for sys/wait.h that is POSIX.1 compatible... " >&6; } -if ${ac_cv_header_sys_wait_h+:} false; then : +if test "${ac_cv_header_sys_wait_h+set}" = set; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -7906,7 +7895,7 @@ done for ac_header in mach-o/dyld.h do : ac_fn_c_check_header_mongrel "$LINENO" "mach-o/dyld.h" "ac_cv_header_mach_o_dyld_h" "$ac_includes_default" -if test "x$ac_cv_header_mach_o_dyld_h" = xyes; then : +if test "x$ac_cv_header_mach_o_dyld_h" = x""yes; then : cat >>confdefs.h <<_ACEOF #define HAVE_MACH_O_DYLD_H 1 _ACEOF @@ -7920,7 +7909,7 @@ then for ac_header in gmp.h do : ac_fn_c_check_header_mongrel "$LINENO" "gmp.h" "ac_cv_header_gmp_h" "$ac_includes_default" -if test "x$ac_cv_header_gmp_h" = xyes; then : +if test "x$ac_cv_header_gmp_h" = x""yes; then : cat >>confdefs.h <<_ACEOF #define HAVE_GMP_H 1 _ACEOF @@ -7935,7 +7924,7 @@ then for ac_header in cudd.h do : ac_fn_c_check_header_mongrel "$LINENO" "cudd.h" "ac_cv_header_cudd_h" "$ac_includes_default" -if test "x$ac_cv_header_cudd_h" = xyes; then : +if test "x$ac_cv_header_cudd_h" = x""yes; then : cat >>confdefs.h <<_ACEOF #define HAVE_CUDD_H 1 _ACEOF @@ -7950,7 +7939,7 @@ then for ac_header in mysql/mysql.h do : ac_fn_c_check_header_mongrel "$LINENO" "mysql/mysql.h" "ac_cv_header_mysql_mysql_h" "$ac_includes_default" -if test "x$ac_cv_header_mysql_mysql_h" = xyes; then : +if test "x$ac_cv_header_mysql_mysql_h" = x""yes; then : cat >>confdefs.h <<_ACEOF #define HAVE_MYSQL_MYSQL_H 1 _ACEOF @@ -7965,7 +7954,7 @@ then for ac_header in readline/readline.h do : ac_fn_c_check_header_mongrel "$LINENO" "readline/readline.h" "ac_cv_header_readline_readline_h" "$ac_includes_default" -if test "x$ac_cv_header_readline_readline_h" = xyes; then : +if test "x$ac_cv_header_readline_readline_h" = x""yes; then : cat >>confdefs.h <<_ACEOF #define HAVE_READLINE_READLINE_H 1 _ACEOF @@ -7977,7 +7966,7 @@ done for ac_header in readline/history.h do : ac_fn_c_check_header_mongrel "$LINENO" "readline/history.h" "ac_cv_header_readline_history_h" "$ac_includes_default" -if test "x$ac_cv_header_readline_history_h" = xyes; then : +if test "x$ac_cv_header_readline_history_h" = x""yes; then : cat >>confdefs.h <<_ACEOF #define HAVE_READLINE_HISTORY_H 1 _ACEOF @@ -7987,27 +7976,27 @@ fi done ac_fn_c_check_func "$LINENO" "rl_completion_matches " "ac_cv_func_rl_completion_matches_" -if test "x$ac_cv_func_rl_completion_matches_" = xyes; then : +if test "x$ac_cv_func_rl_completion_matches_" = x""yes; then : fi ac_fn_c_check_func "$LINENO" "rl_insert_close " "ac_cv_func_rl_insert_close_" -if test "x$ac_cv_func_rl_insert_close_" = xyes; then : +if test "x$ac_cv_func_rl_insert_close_" = x""yes; then : fi ac_fn_c_check_func "$LINENO" "rl_filename_completion_function " "ac_cv_func_rl_filename_completion_function_" -if test "x$ac_cv_func_rl_filename_completion_function_" = xyes; then : +if test "x$ac_cv_func_rl_filename_completion_function_" = x""yes; then : fi ac_fn_c_check_func "$LINENO" "rl_set_prompt " "ac_cv_func_rl_set_prompt_" -if test "x$ac_cv_func_rl_set_prompt_" = xyes; then : +if test "x$ac_cv_func_rl_set_prompt_" = x""yes; then : fi ac_fn_c_check_func "$LINENO" "rl_clear_pending_input " "ac_cv_func_rl_clear_pending_input_" -if test "x$ac_cv_func_rl_clear_pending_input_" = xyes; then : +if test "x$ac_cv_func_rl_clear_pending_input_" = x""yes; then : fi @@ -8015,7 +8004,7 @@ fi for ac_header in mpi.h do : ac_fn_c_check_header_mongrel "$LINENO" "mpi.h" "ac_cv_header_mpi_h" "$ac_includes_default" -if test "x$ac_cv_header_mpi_h" = xyes; then : +if test "x$ac_cv_header_mpi_h" = x""yes; then : cat >>confdefs.h <<_ACEOF #define HAVE_MPI_H 1 _ACEOF @@ -8027,7 +8016,7 @@ done for ac_header in mpe.h do : ac_fn_c_check_header_mongrel "$LINENO" "mpe.h" "ac_cv_header_mpe_h" "$ac_includes_default" -if test "x$ac_cv_header_mpe_h" = xyes; then : +if test "x$ac_cv_header_mpe_h" = x""yes; then : cat >>confdefs.h <<_ACEOF #define HAVE_MPE_H 1 _ACEOF @@ -8039,7 +8028,7 @@ done { $as_echo "$as_me:${as_lineno-$LINENO}: checking for inline" >&5 $as_echo_n "checking for inline... " >&6; } -if ${ac_cv_c_inline+:} false; then : +if test "${ac_cv_c_inline+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_cv_c_inline=no @@ -8081,7 +8070,7 @@ esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether struct tm is in sys/time.h or time.h" >&5 $as_echo_n "checking whether struct tm is in sys/time.h or time.h... " >&6; } -if ${ac_cv_struct_tm+:} false; then : +if test "${ac_cv_struct_tm+set}" = set; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -8120,7 +8109,7 @@ fi # This bug is HP SR number 8606223364. { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of int *" >&5 $as_echo_n "checking size of int *... " >&6; } -if ${ac_cv_sizeof_int_p+:} false; then : +if test "${ac_cv_sizeof_int_p+set}" = set; then : $as_echo_n "(cached) " >&6 else if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (int *))" "ac_cv_sizeof_int_p" "$ac_includes_default"; then : @@ -8130,7 +8119,7 @@ else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "cannot compute sizeof (int *) -See \`config.log' for more details" "$LINENO" 5; } +See \`config.log' for more details" "$LINENO" 5 ; } else ac_cv_sizeof_int_p=0 fi @@ -8153,7 +8142,7 @@ _ACEOF # This bug is HP SR number 8606223364. { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of short int" >&5 $as_echo_n "checking size of short int... " >&6; } -if ${ac_cv_sizeof_short_int+:} false; then : +if test "${ac_cv_sizeof_short_int+set}" = set; then : $as_echo_n "(cached) " >&6 else if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (short int))" "ac_cv_sizeof_short_int" "$ac_includes_default"; then : @@ -8163,7 +8152,7 @@ else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "cannot compute sizeof (short int) -See \`config.log' for more details" "$LINENO" 5; } +See \`config.log' for more details" "$LINENO" 5 ; } else ac_cv_sizeof_short_int=0 fi @@ -8186,7 +8175,7 @@ _ACEOF # This bug is HP SR number 8606223364. { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of int" >&5 $as_echo_n "checking size of int... " >&6; } -if ${ac_cv_sizeof_int+:} false; then : +if test "${ac_cv_sizeof_int+set}" = set; then : $as_echo_n "(cached) " >&6 else if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (int))" "ac_cv_sizeof_int" "$ac_includes_default"; then : @@ -8196,7 +8185,7 @@ else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "cannot compute sizeof (int) -See \`config.log' for more details" "$LINENO" 5; } +See \`config.log' for more details" "$LINENO" 5 ; } else ac_cv_sizeof_int=0 fi @@ -8219,7 +8208,7 @@ _ACEOF # This bug is HP SR number 8606223364. { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of long int" >&5 $as_echo_n "checking size of long int... " >&6; } -if ${ac_cv_sizeof_long_int+:} false; then : +if test "${ac_cv_sizeof_long_int+set}" = set; then : $as_echo_n "(cached) " >&6 else if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (long int))" "ac_cv_sizeof_long_int" "$ac_includes_default"; then : @@ -8229,7 +8218,7 @@ else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "cannot compute sizeof (long int) -See \`config.log' for more details" "$LINENO" 5; } +See \`config.log' for more details" "$LINENO" 5 ; } else ac_cv_sizeof_long_int=0 fi @@ -8252,7 +8241,7 @@ _ACEOF # This bug is HP SR number 8606223364. { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of long long int" >&5 $as_echo_n "checking size of long long int... " >&6; } -if ${ac_cv_sizeof_long_long_int+:} false; then : +if test "${ac_cv_sizeof_long_long_int+set}" = set; then : $as_echo_n "(cached) " >&6 else if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (long long int))" "ac_cv_sizeof_long_long_int" "$ac_includes_default"; then : @@ -8262,7 +8251,7 @@ else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "cannot compute sizeof (long long int) -See \`config.log' for more details" "$LINENO" 5; } +See \`config.log' for more details" "$LINENO" 5 ; } else ac_cv_sizeof_long_long_int=0 fi @@ -8285,7 +8274,7 @@ _ACEOF # This bug is HP SR number 8606223364. { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of float" >&5 $as_echo_n "checking size of float... " >&6; } -if ${ac_cv_sizeof_float+:} false; then : +if test "${ac_cv_sizeof_float+set}" = set; then : $as_echo_n "(cached) " >&6 else if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (float))" "ac_cv_sizeof_float" "$ac_includes_default"; then : @@ -8295,7 +8284,7 @@ else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "cannot compute sizeof (float) -See \`config.log' for more details" "$LINENO" 5; } +See \`config.log' for more details" "$LINENO" 5 ; } else ac_cv_sizeof_float=0 fi @@ -8318,7 +8307,7 @@ _ACEOF # This bug is HP SR number 8606223364. { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of double" >&5 $as_echo_n "checking size of double... " >&6; } -if ${ac_cv_sizeof_double+:} false; then : +if test "${ac_cv_sizeof_double+set}" = set; then : $as_echo_n "(cached) " >&6 else if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (double))" "ac_cv_sizeof_double" "$ac_includes_default"; then : @@ -8328,7 +8317,7 @@ else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "cannot compute sizeof (double) -See \`config.log' for more details" "$LINENO" 5; } +See \`config.log' for more details" "$LINENO" 5 ; } else ac_cv_sizeof_double=0 fi @@ -8348,7 +8337,7 @@ _ACEOF { $as_echo "$as_me:${as_lineno-$LINENO}: checking for type of malloc" >&5 $as_echo_n "checking for type of malloc... " >&6; } -if ${yap_cv_malloct+:} false; then : +if test "${yap_cv_malloct+set}" = set; then : $as_echo_n "(cached) " >&6 else @@ -8388,7 +8377,7 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gcc inline" >&5 $as_echo_n "checking for gcc inline... " >&6; } -if ${yap_cv_gcc+:} false; then : +if test "${yap_cv_gcc+set}" = set; then : $as_echo_n "(cached) " >&6 else @@ -8496,7 +8485,7 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gcc threaded code" >&5 $as_echo_n "checking for gcc threaded code... " >&6; } -if ${yap_cv_threaded_code+:} false; then : +if test "${yap_cv_threaded_code+set}" = set; then : $as_echo_n "(cached) " >&6 else @@ -8541,7 +8530,7 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for IEEE floats" >&5 $as_echo_n "checking for IEEE floats... " >&6; } -if ${yap_cv_ffieee+:} false; then : +if test "${yap_cv_ffieee+set}" = set; then : $as_echo_n "(cached) " >&6 else @@ -8582,7 +8571,7 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sigsetjmp" >&5 $as_echo_n "checking for sigsetjmp... " >&6; } -if ${yap_cv_sigsetjmp+:} false; then : +if test "${yap_cv_sigsetjmp+set}" = set; then : $as_echo_n "(cached) " >&6 else @@ -8622,7 +8611,7 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sigsegv" >&5 $as_echo_n "checking for sigsegv... " >&6; } -if ${yap_cv_sigsegv+:} false; then : +if test "${yap_cv_sigsegv+set}" = set; then : $as_echo_n "(cached) " >&6 else @@ -8661,7 +8650,7 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sigprof" >&5 $as_echo_n "checking for sigprof... " >&6; } -if ${yap_cv_sigprof+:} false; then : +if test "${yap_cv_sigprof+set}" = set; then : $as_echo_n "(cached) " >&6 else @@ -8700,7 +8689,7 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for siginfo" >&5 $as_echo_n "checking for siginfo... " >&6; } -if ${yap_cv_siginfo+:} false; then : +if test "${yap_cv_siginfo+set}" = set; then : $as_echo_n "(cached) " >&6 else @@ -8801,7 +8790,7 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking return type of signal handlers" >&5 $as_echo_n "checking return type of signal handlers... " >&6; } -if ${ac_cv_type_signal+:} false; then : +if test "${ac_cv_type_signal+set}" = set; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -8943,7 +8932,7 @@ done for ac_func in mbsnrtowcs do : ac_fn_c_check_func "$LINENO" "mbsnrtowcs" "ac_cv_func_mbsnrtowcs" -if test "x$ac_cv_func_mbsnrtowcs" = xyes; then : +if test "x$ac_cv_func_mbsnrtowcs" = x""yes; then : cat >>confdefs.h <<_ACEOF #define HAVE_MBSNRTOWCS 1 _ACEOF @@ -9061,7 +9050,7 @@ done ac_fn_c_check_func "$LINENO" "regexec" "ac_cv_func_regexec" -if test "x$ac_cv_func_regexec" = xyes; then : +if test "x$ac_cv_func_regexec" = x""yes; then : NO_BUILTIN_REGEXP="#" else NO_BUILTIN_REGEXP="" @@ -9071,7 +9060,7 @@ fi for ac_func in NSLinkModule do : ac_fn_c_check_func "$LINENO" "NSLinkModule" "ac_cv_func_NSLinkModule" -if test "x$ac_cv_func_NSLinkModule" = xyes; then : +if test "x$ac_cv_func_NSLinkModule" = x""yes; then : cat >>confdefs.h <<_ACEOF #define HAVE_NSLINKMODULE 1 _ACEOF @@ -9114,7 +9103,7 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for mpz_xor" >&5 $as_echo_n "checking for mpz_xor... " >&6; } -if ${yap_cv_mpz_xor+:} false; then : +if test "${yap_cv_mpz_xor+set}" = set; then : $as_echo_n "(cached) " >&6 else @@ -9160,7 +9149,7 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking if fflush(NULL) clobbers input pipes" >&5 $as_echo_n "checking if fflush(NULL) clobbers input pipes... " >&6; } -if ${yap_cv_broken_fflush_null+:} false; then : +if test "${yap_cv_broken_fflush_null+set}" = set; then : $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <&5 $as_echo_n "checking for socket in -lsocket... " >&6; } -if ${ac_cv_lib_socket_socket+:} false; then : +if test "${ac_cv_lib_socket_socket+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS @@ -9311,7 +9300,7 @@ LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_socket_socket" >&5 $as_echo "$ac_cv_lib_socket_socket" >&6; } -if test "x$ac_cv_lib_socket_socket" = xyes; then : +if test "x$ac_cv_lib_socket_socket" = x""yes; then : CLIB_NETLIBS="$CLIB_NETLIBS -lsocket" $as_echo "#define HAVE_LIBSOCKET 1" >>confdefs.h @@ -9321,13 +9310,13 @@ fi fi ac_fn_c_check_func "$LINENO" "gethostent" "ac_cv_func_gethostent" -if test "x$ac_cv_func_gethostent" = xyes; then : +if test "x$ac_cv_func_gethostent" = x""yes; then : else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gethostent in -lnsl" >&5 $as_echo_n "checking for gethostent in -lnsl... " >&6; } -if ${ac_cv_lib_nsl_gethostent+:} false; then : +if test "${ac_cv_lib_nsl_gethostent+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS @@ -9361,7 +9350,7 @@ LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_nsl_gethostent" >&5 $as_echo "$ac_cv_lib_nsl_gethostent" >&6; } -if test "x$ac_cv_lib_nsl_gethostent" = xyes; then : +if test "x$ac_cv_lib_nsl_gethostent" = x""yes; then : CLIB_NETLIBS="$CLIB_NETLIBS -lnsl" $as_echo "#define HAVE_LIBNSL 1" >>confdefs.h @@ -9374,7 +9363,7 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_create in -lpthread" >&5 $as_echo_n "checking for pthread_create in -lpthread... " >&6; } -if ${ac_cv_lib_pthread_pthread_create+:} false; then : +if test "${ac_cv_lib_pthread_pthread_create+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS @@ -9408,7 +9397,7 @@ LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthread_pthread_create" >&5 $as_echo "$ac_cv_lib_pthread_pthread_create" >&6; } -if test "x$ac_cv_lib_pthread_pthread_create" = xyes; then : +if test "x$ac_cv_lib_pthread_pthread_create" = x""yes; then : CLIB_PTHREADS="-lpthread" else CLIB_PTHREADS="" @@ -9418,7 +9407,7 @@ fi oldlibs="$LIBS" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for crypt in -lcrypt" >&5 $as_echo_n "checking for crypt in -lcrypt... " >&6; } -if ${ac_cv_lib_crypt_crypt+:} false; then : +if test "${ac_cv_lib_crypt_crypt+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS @@ -9452,7 +9441,7 @@ LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypt_crypt" >&5 $as_echo "$ac_cv_lib_crypt_crypt" >&6; } -if test "x$ac_cv_lib_crypt_crypt" = xyes; then : +if test "x$ac_cv_lib_crypt_crypt" = x""yes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBCRYPT 1 _ACEOF @@ -9465,7 +9454,7 @@ CLIB_CRYPTLIBS="$LIBS" for ac_func in crypt do : ac_fn_c_check_func "$LINENO" "crypt" "ac_cv_func_crypt" -if test "x$ac_cv_func_crypt" = xyes; then : +if test "x$ac_cv_func_crypt" = x""yes; then : cat >>confdefs.h <<_ACEOF #define HAVE_CRYPT 1 _ACEOF @@ -9486,7 +9475,7 @@ ac_fn_c_check_type "$LINENO" "socklen_t" "ac_cv_type_socklen_t" " #include " -if test "x$ac_cv_type_socklen_t" = xyes; then : +if test "x$ac_cv_type_socklen_t" = x""yes; then : cat >>confdefs.h <<_ACEOF #define HAVE_SOCKLEN_T 1 @@ -9500,7 +9489,7 @@ ac_fn_c_check_type "$LINENO" "ssize_t" "ac_cv_type_ssize_t" " #include " -if test "x$ac_cv_type_ssize_t" = xyes; then : +if test "x$ac_cv_type_ssize_t" = x""yes; then : cat >>confdefs.h <<_ACEOF #define HAVE_SSIZE_T 1 @@ -9555,7 +9544,7 @@ fi ac_fn_c_check_member "$LINENO" "struct tm" "tm_gmtoff" "ac_cv_member_struct_tm_tm_gmtoff" "#include " -if test "x$ac_cv_member_struct_tm_tm_gmtoff" = xyes; then : +if test "x$ac_cv_member_struct_tm_tm_gmtoff" = x""yes; then : $as_echo "#define HAVE_STRUCT_TIME_TM_GMTOFF /**/" >>confdefs.h @@ -9691,6 +9680,8 @@ ac_config_files="$ac_config_files packages/clib/maildrop/rfc2045/Makefile" ac_config_files="$ac_config_files packages/CLPBN/Makefile" +ac_config_files="$ac_config_files packages/CLPBN/clpbn/bp/Makefile" + ac_config_files="$ac_config_files packages/cplint/Makefile" ac_config_files="$ac_config_files packages/cplint/approx/simplecuddLPADs/Makefile" @@ -9807,21 +9798,10 @@ $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; :end' >>confcache if diff "$cache_file" confcache >/dev/null 2>&1; then :; else if test -w "$cache_file"; then - if test "x$cache_file" != "x/dev/null"; then + test "x$cache_file" != "x/dev/null" && { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 $as_echo "$as_me: updating cache $cache_file" >&6;} - if test ! -f "$cache_file" || test -h "$cache_file"; then - cat confcache >"$cache_file" - else - case $cache_file in #( - */* | ?:*) - mv -f confcache "$cache_file"$$ && - mv -f "$cache_file"$$ "$cache_file" ;; #( - *) - mv -f confcache "$cache_file" ;; - esac - fi - fi + cat confcache >$cache_file else { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 $as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} @@ -9853,7 +9833,7 @@ LTLIBOBJS=$ac_ltlibobjs -: "${CONFIG_STATUS=./config.status}" +: ${CONFIG_STATUS=./config.status} ac_write_fail=0 ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" @@ -9954,7 +9934,6 @@ fi IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. -as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -10262,7 +10241,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # values after options handling. ac_log=" This file was extended by $as_me, which was -generated by GNU Autoconf 2.68. Invocation command line was +generated by GNU Autoconf 2.67. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS @@ -10324,7 +10303,7 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ config.status -configured by $0, generated by GNU Autoconf 2.68, +configured by $0, generated by GNU Autoconf 2.67, with options \\"\$ac_cs_config\\" Copyright (C) 2010 Free Software Foundation, Inc. @@ -10468,6 +10447,7 @@ do "packages/clib/maildrop/rfc822/Makefile") CONFIG_FILES="$CONFIG_FILES packages/clib/maildrop/rfc822/Makefile" ;; "packages/clib/maildrop/rfc2045/Makefile") CONFIG_FILES="$CONFIG_FILES packages/clib/maildrop/rfc2045/Makefile" ;; "packages/CLPBN/Makefile") CONFIG_FILES="$CONFIG_FILES packages/CLPBN/Makefile" ;; + "packages/CLPBN/clpbn/bp/Makefile") CONFIG_FILES="$CONFIG_FILES packages/CLPBN/clpbn/bp/Makefile" ;; "packages/cplint/Makefile") CONFIG_FILES="$CONFIG_FILES packages/cplint/Makefile" ;; "packages/cplint/approx/simplecuddLPADs/Makefile") CONFIG_FILES="$CONFIG_FILES packages/cplint/approx/simplecuddLPADs/Makefile" ;; "packages/http/Makefile") CONFIG_FILES="$CONFIG_FILES packages/http/Makefile" ;; @@ -10490,7 +10470,7 @@ do "packages/swi-minisat2/Makefile") CONFIG_FILES="$CONFIG_FILES packages/swi-minisat2/Makefile" ;; "packages/swi-minisat2/C/Makefile") CONFIG_FILES="$CONFIG_FILES packages/swi-minisat2/C/Makefile" ;; - *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; + *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5 ;; esac done @@ -10512,10 +10492,9 @@ fi # after its creation but before its name has been assigned to `$tmp'. $debug || { - tmp= ac_tmp= + tmp= trap 'exit_status=$? - : "${ac_tmp:=$tmp}" - { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status + { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status ' 0 trap 'as_fn_exit 1' 1 2 13 15 } @@ -10523,13 +10502,12 @@ $debug || { tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && - test -d "$tmp" + test -n "$tmp" && test -d "$tmp" } || { tmp=./conf$$-$RANDOM (umask 077 && mkdir "$tmp") } || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 -ac_tmp=$tmp # Set up the scripts for CONFIG_FILES section. # No need to generate them if there are no CONFIG_FILES. @@ -10551,7 +10529,7 @@ else ac_cs_awk_cr=$ac_cr fi -echo 'BEGIN {' >"$ac_tmp/subs1.awk" && +echo 'BEGIN {' >"$tmp/subs1.awk" && _ACEOF @@ -10579,7 +10557,7 @@ done rm -f conf$$subs.sh cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK && +cat >>"\$tmp/subs1.awk" <<\\_ACAWK && _ACEOF sed -n ' h @@ -10627,7 +10605,7 @@ t delim rm -f conf$$subs.awk cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 _ACAWK -cat >>"\$ac_tmp/subs1.awk" <<_ACAWK && +cat >>"\$tmp/subs1.awk" <<_ACAWK && for (key in S) S_is_set[key] = 1 FS = "" @@ -10659,7 +10637,7 @@ if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" else cat -fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \ +fi < "$tmp/subs1.awk" > "$tmp/subs.awk" \ || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 _ACEOF @@ -10693,7 +10671,7 @@ fi # test -n "$CONFIG_FILES" # No need to generate them if there are no CONFIG_HEADERS. # This happens for instance with `./config.status Makefile'. if test -n "$CONFIG_HEADERS"; then -cat >"$ac_tmp/defines.awk" <<\_ACAWK || +cat >"$tmp/defines.awk" <<\_ACAWK || BEGIN { _ACEOF @@ -10705,8 +10683,8 @@ _ACEOF # handling of long lines. ac_delim='%!_!# ' for ac_last_try in false false :; do - ac_tt=`sed -n "/$ac_delim/p" confdefs.h` - if test -z "$ac_tt"; then + ac_t=`sed -n "/$ac_delim/p" confdefs.h` + if test -z "$ac_t"; then break elif $ac_last_try; then as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5 @@ -10807,7 +10785,7 @@ do esac case $ac_mode$ac_tag in :[FHL]*:*);; - :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; + :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5 ;; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; esac @@ -10826,7 +10804,7 @@ do for ac_f do case $ac_f in - -) ac_f="$ac_tmp/stdin";; + -) ac_f="$tmp/stdin";; *) # Look for the file first in the build tree, then in the source tree # (if the path is not absolute). The absolute path cannot be DOS-style, # because $ac_f cannot contain `:'. @@ -10835,7 +10813,7 @@ do [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || - as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; + as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5 ;; esac case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac as_fn_append ac_file_inputs " '$ac_f'" @@ -10861,8 +10839,8 @@ $as_echo "$as_me: creating $ac_file" >&6;} esac case $ac_tag in - *:-:* | *:-) cat >"$ac_tmp/stdin" \ - || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; + *:-:* | *:-) cat >"$tmp/stdin" \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; esac ;; esac @@ -10992,22 +10970,21 @@ s&@abs_top_builddir@&$ac_abs_top_builddir&;t t s&@INSTALL@&$ac_INSTALL&;t t $ac_datarootdir_hack " -eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \ - >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5 +eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$tmp/subs.awk" >$tmp/out \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && - { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && - { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ - "$ac_tmp/out"`; test -z "$ac_out"; } && + { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } && + { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } && { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&5 $as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&2;} - rm -f "$ac_tmp/stdin" + rm -f "$tmp/stdin" case $ac_file in - -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; - *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";; + -) cat "$tmp/out" && rm -f "$tmp/out";; + *) rm -f "$ac_file" && mv "$tmp/out" "$ac_file";; esac \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; @@ -11018,20 +10995,20 @@ which seems to be undefined. Please make sure it is defined" >&2;} if test x"$ac_file" != x-; then { $as_echo "/* $configure_input */" \ - && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" - } >"$ac_tmp/config.h" \ + && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs" + } >"$tmp/config.h" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 - if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then + if diff "$ac_file" "$tmp/config.h" >/dev/null 2>&1; then { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 $as_echo "$as_me: $ac_file is unchanged" >&6;} else rm -f "$ac_file" - mv "$ac_tmp/config.h" "$ac_file" \ + mv "$tmp/config.h" "$ac_file" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 fi else $as_echo "/* $configure_input */" \ - && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \ + && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs" \ || as_fn_error $? "could not create -" "$LINENO" 5 fi ;; diff --git a/configure.in b/configure.in index 6286c3403..3737f1d57 100755 --- a/configure.in +++ b/configure.in @@ -1985,6 +1985,7 @@ AC_CONFIG_FILES([packages/clib/Makefile]) AC_CONFIG_FILES([packages/clib/maildrop/rfc822/Makefile]) AC_CONFIG_FILES([packages/clib/maildrop/rfc2045/Makefile]) AC_CONFIG_FILES([packages/CLPBN/Makefile]) +AC_CONFIG_FILES([packages/CLPBN/clpbn/bp/Makefile]) AC_CONFIG_FILES([packages/cplint/Makefile]) AC_CONFIG_FILES([packages/cplint/approx/simplecuddLPADs/Makefile]) AC_CONFIG_FILES([packages/http/Makefile]) diff --git a/packages/CLPBN/Makefile.in b/packages/CLPBN/Makefile.in index 99807275f..0e9bd8fb9 100644 --- a/packages/CLPBN/Makefile.in +++ b/packages/CLPBN/Makefile.in @@ -35,6 +35,7 @@ CLPBN_EXDIR = $(srcdir)/clpbn/examples CLPBN_PROGRAMS= \ $(CLPBN_SRCDIR)/aggregates.yap \ $(CLPBN_SRCDIR)/bnt.yap \ + $(CLPBN_SRCDIR)/bp.yap \ $(CLPBN_SRCDIR)/connected.yap \ $(CLPBN_SRCDIR)/discrete_utils.yap \ $(CLPBN_SRCDIR)/display.yap \ diff --git a/packages/CLPBN/clpbn/bp.yap b/packages/CLPBN/clpbn/bp.yap new file mode 100644 index 000000000..da4043a4f --- /dev/null +++ b/packages/CLPBN/clpbn/bp.yap @@ -0,0 +1,157 @@ + +/*********************************** + + Belief Propagation in CLP(BN) + + This should connect to C-code. + +*********************************/ + +:- module(clpbn_bp, [ + bp/3, + check_if_bp_done/1, + init_bp_solver/4, + run_bp_solver/3]). + + +:- use_module(library('clpbn/aggregates'), + [check_for_agg_vars/2]). + +:- use_module(library('clpbn/connected'), + [init_influences/3, + influences/5 + ]). + +:- use_module(library('clpbn/dists'), + [dist/4, + get_dist_domain/2, + get_dist_params/2 + ]). + +:- use_module(library('clpbn/display'), + [clpbn_bind_vals/3]). + +:-use_module(library(lists), + [append/3, + memberchk/2 + ]). + +:- load_foreign_files(['horus'], [], init_predicates). + +:- attribute all_diffs/1. + + +check_if_bp_done(_Var). + +% +% implementation of belief propagation +% +% A1 = +QueryVars -> sets of independent marginalization variables +% A2 = *AllVars -> list of all variables +% A3 = -Output -> output probabilities +% +% Other important variables: +% +% State0 initialized graph, is used to pass data from initialization +% to query solving (eg, State might be the JT and be used to run +% different queries). +% +bp([[]],_,_) :- !. +bp([QueryVars],AllVars,Output) :- + writeln(queryVars:QueryVars), + writeln(allVars:AllVars), + % init_bp_solver([QueryVars], AllVars, Output, State), + run_bp_solver([QueryVars], [AllVars], _State), + % bind probs back to variables so that they can be output. + clpbn_bind_vals([QueryVars],[LPs],Output). + +% initialise necessary data for query solver +init_bp_solver(Qs, AllVars, _, graph(LVis)) :- + % replace average, max, min and friends by binary nodes. + check_for_agg_vars(AllVars, UnFoldedVars), + % replace the variables reachable from G + init_influences(UnfoldedVars, G, RG), + init_bp_solver_for_questions(Qs, G, RG, _, LVis). + +init_bp_solver_for_questions([], _, _, [], []). +init_bp_solver_for_questions([Vs|MVs], G, RG, [NVs|MNVs0], [NVs|LVis]) :- + % find variables connectd to Vs + influences(Vs, _, NVs0, G, RG), + sort(NVs0, NVs), + init_bp_solver_for_questions(MVs, G, RG, MNVs0, LVis). + + +% use a findall to recover space without needing for GC +run_bp_solver(LVs, LPs, _) :- + findall(Ps, solve_bp(LVs, LPs, Ps), LPs). + + +solve_bp([LVs|_], [NVs0|_], Ps) :- + get_vars_info(NVs0, LVi), + get_dists_info(NVs0, Dists), + process(LVi, Dists, LVs, Ps). +solve_bp([_|MoreLVs], [_|MoreLVis], Ps) :- + solve_bp(MoreLVs, MoreLVis, Ps). + + +get_vars_info([], []). +get_vars_info([V|Vs], [var(V, Id, Parents, NParents, Ev)|LV]) :- + clpbn:get_atts(V, [dist(Id, Parents)]), !, + length(Parents, NParents), + get_evidence(V, Ev), + get_vars_info(Vs, LV). +get_vars_info([_|Vs], LV) :- + get_vars_info(Vs, LV). + + +get_evidence(V, Ev) :- + clpbn:get_atts(V, [evidence(Ev)]), !. +get_evidence(V, -1). % no evidence !!! + + +get_dists_info([],[]). +get_dists_info([V|Vs], [dist(Id, Domain, DSize, Params, NParams) | Dists]) :- + clpbn:get_atts(V, [dist(Id, _)]), !, + get_dist_domain(Id, Domain), + length(Domain, DSize), + get_dist_params(Id, Params), + length(Params, NParams), + get_dists_info(Vs, Dists). +get_dists_info([_|Vs], Dists) :- + get_dists_info(Vs, Dists). + + +% +Vars is a list containing info about every clpbn variables +% +Dists is a list containing info about distributions +% +QVs is a list containing the query variables +% -Out is some output term stating the probabilities +process(Vars, Dists, QVs, Out) :- + write('vars = '), writeln(Vars), + order_vars(Vars, [], OrderedVars), + write('ovars = '), writeln(OrderedVars), + write('dists = '), writeln(Dists), + write('qvs = '), writeln(QVs), + length(OrderedVars, NVars), + length(Dists, NDists), + %create_network(OrderedVars, NVars, Dists, NDists, BNet), + length(QVs, NQVs), + run_solver(BNet, QVs, NQVs, Out), + free_memory(BNet). + + +order_vars([V], _, [V]) :- !. +order_vars([var(V, Id, Parents, NParents, Ev)|Vs], ParsedVars, [var(V, Id, Parents, NParents, Ev)|OrderedVars]) :- + \+ memberchk(V, ParsedVars), + parents_defined(Parents, ParsedVars), !, + order_vars(Vs, [V|ParsedVars], OrderedVars). +order_vars([var(V, Id, Parents, NParents, Ev)|Vs], ParsedVars, OrderedVars) :- + append(Vs, [var(V, Id, Parents, NParents, Ev)], NVs), + order_vars(NVs, ParsedVars, OrderedVars). + + +parents_defined([], _) :- !. +parents_defined([Parent|Parents], ParsedVars) :- + memberchk(Parent, ParsedVars), + parents_defined(Parents, ParsedVars). + +% f(F), b(B). ----> FAIL diff --git a/packages/CLPBN/clpbn/bp/BayesianNetwork.cpp b/packages/CLPBN/clpbn/bp/BayesianNetwork.cpp new file mode 100644 index 000000000..1dd17af03 --- /dev/null +++ b/packages/CLPBN/clpbn/bp/BayesianNetwork.cpp @@ -0,0 +1,208 @@ +#include +#include +#include +#include + +#include "BayesianNetwork.h" +#include "BayesianNode.h" + +BayesianNetwork::BayesianNetwork (void) +{ +} + + + +BayesianNetwork::~BayesianNetwork (void) +{ + for (unsigned int i = 0; i < nodes_.size(); i++) { + delete nodes_[i]; + } + for (unsigned int i = 0; i < dists_.size(); i++) { + delete dists_[i]; + } +} + + + +void +BayesianNetwork::addNode (string varName, + vector parents, + int evidence, + int distId) +{ + for (unsigned int i = 0; i < dists_.size(); i++) { + if (dists_[i]->id == distId) { + BayesianNode* node = new BayesianNode (varName, parents, + dists_[i], evidence); + nodes_.push_back (node); + break; + } + } +} + + +void +BayesianNetwork::addNode (string varName, + vector parents, + double* params, + int nParams, + vector domain) +{ + Distribution* dist = new Distribution (params, nParams, domain); + BayesianNode* node = new BayesianNode (varName, parents, dist); + dists_.push_back (dist); + nodes_.push_back (node); +} + + + +BayesianNode* +BayesianNetwork::getNode (string varName) const +{ + for (unsigned int i = 0; i < nodes_.size(); i++) { + if (nodes_[i]->getVariableName() == varName) { + return nodes_[i]; + } + } + return 0; +} + + + +void +BayesianNetwork::addDistribution (int distId, + double* params, + int nParams, + vector domain) +{ + dists_.push_back (new Distribution (distId, params, nParams, domain)); +} + + + +vector +BayesianNetwork::getNodes (void) const +{ + return nodes_; +} + + + +vector +BayesianNetwork::getRootNodes (void) const +{ + vector roots; + for (unsigned int i = 0; i < nodes_.size(); i++) { + if (nodes_[i]->isRoot()) { + roots.push_back (nodes_[i]); + } + } + return roots; +} + + + +vector +BayesianNetwork::getLeafNodes (void) const +{ + vector leafs; + for (unsigned int i = 0; i < nodes_.size(); i++) { + if (nodes_[i]->isLeaf()) { + leafs.push_back (nodes_[i]); + } + } + return leafs; +} + + + +bool +BayesianNetwork::isPolyTree (void) const +{ + return !containsCycle(); +} + + + +void +BayesianNetwork::printNetwork (void) const +{ + for (unsigned int i = 0; i < nodes_.size(); i++) { + cout << *nodes_[i]; + } +} + + + +bool +BayesianNetwork::containsCycle (void) const +{ + vector visited (nodes_.size()); + for (unsigned int v = 0; v < nodes_.size(); v++) { + visited[v] = false; + } + + for (unsigned int v = 0; v < nodes_.size(); v++) { + if (!visited[v]) { + if (containsCycle (v, -1, visited)) { + return true; + } + } + } + + return false; +} + + + +bool +BayesianNetwork::containsCycle (int v, + int predecessor, + vector& visited) const +{ + visited[v] = true; + vector adjs = getAdjacentVertexes (v); + for (unsigned int i = 0; i < adjs.size(); i++) { + int w = adjs[i]; + if (!visited[w]) { + if (containsCycle (w, v, visited)) { + return true; + } + } + else if (visited[w] && w != predecessor) { + return true; + } + } + return false; // no cycle detected in this component +} + + + +int +BayesianNetwork::getIndexOf (const BayesianNode* node) const +{ + for (unsigned int i = 0; i < nodes_.size(); i++) { + if (node == nodes_[i]) { + return i; + } + } + return -1; +} + + + +vector +BayesianNetwork::getAdjacentVertexes (int v) const +{ + vector adjs; + vector parents = nodes_[v]->getParents(); + vector childs = nodes_[v]->getChilds(); + for (unsigned int i = 0; i < parents.size(); i++) { + adjs.push_back (getIndexOf (parents[i])); + } + for (unsigned int i = 0; i < childs.size(); i++) { + adjs.push_back (getIndexOf (childs[i])); + } + return adjs; +} + diff --git a/packages/CLPBN/clpbn/bp/BayesianNetwork.h b/packages/CLPBN/clpbn/bp/BayesianNetwork.h new file mode 100644 index 000000000..5003faaed --- /dev/null +++ b/packages/CLPBN/clpbn/bp/BayesianNetwork.h @@ -0,0 +1,46 @@ +#ifndef BAYESIAN_NETWORK_H +#define BAYESIAN_NETWORK_H + +#include +#include + +using namespace std; + +class BayesianNode; +class Distribution; + +class BayesianNetwork +{ + public: + // constructs + BayesianNetwork (void); + // destruct + virtual ~BayesianNetwork (void); + // methods + virtual void addNode (string, vector, int, int); + virtual void addNode (string, vector, + double*, int, vector); + BayesianNode* getNode (string) const; + void addDistribution (int, double*, int, vector); + vector getNodes (void) const; + vector getRootNodes (void) const; + vector getLeafNodes (void) const; + bool isPolyTree (void) const; + void printNetwork (void) const; + + protected: + // members + vector nodes_; + vector dists_; + + private: + BayesianNetwork (const BayesianNetwork&); // disallow copy + void operator= (const BayesianNetwork&); // disallow assign + bool containsCycle (void) const; + bool containsCycle (int, int, vector&) const; + int getIndexOf (const BayesianNode*) const; + vector getAdjacentVertexes (int) const ; +}; + +#endif // BAYESIAN_NETWORK_H + diff --git a/packages/CLPBN/clpbn/bp/BayesianNode.cpp b/packages/CLPBN/clpbn/bp/BayesianNode.cpp new file mode 100644 index 000000000..26a3106e5 --- /dev/null +++ b/packages/CLPBN/clpbn/bp/BayesianNode.cpp @@ -0,0 +1,382 @@ +#include +#include +#include + +#include "BayesianNode.h" +#include "CptEntry.h" + + +BayesianNode::BayesianNode (string varName, + vector parents, + Distribution* dist, + int evidence) +{ + varName_ = varName; + parents_ = parents; + dist_ = dist; + evidence_ = evidence; + for (unsigned int i = 0; i < parents.size(); i++) { + parents[i]->addChild (this); + } +} + + + +BayesianNode::~BayesianNode (void) +{ +} + + + +string +BayesianNode::getVariableName (void) const +{ + return varName_; +} + + + +vector +BayesianNode::getParents (void) const +{ + return parents_; +} + + + +vector +BayesianNode::getChilds (void) const +{ + return childs_; +} + + + +void +BayesianNode::addChild (BayesianNode* node) +{ + childs_.push_back (node); +} + + + +double* +BayesianNode::getParameters (void) +{ + return dist_->params; +} + + + +double* +BayesianNode::getRow (int rowIndex) const +{ + int offset = getRowSize() * rowIndex; + return &dist_->params[offset]; +} + + + +double +BayesianNode::getProbability (CptEntry& entry) +{ + int index = entry.getCptIndex(); + return dist_->params[index]; +} + + + +void +BayesianNode::setProbability (CptEntry& entry, double prob) +{ + int index = entry.getCptIndex(); + dist_->params[index] = prob; +} + + + +bool +BayesianNode::isRoot (void) +{ + return parents_.empty(); +} + + + +bool +BayesianNode::isLeaf (void) +{ + return childs_.empty(); +} + + + +int +BayesianNode::getRowSize (void) const +{ + return dist_->nParams / dist_->domain.size(); +} + + + +int +BayesianNode::getCptSize (void) +{ + return dist_->nParams; +} + + + +vector +BayesianNode::getDomain (void) const +{ + return dist_->domain; +} + + + +int +BayesianNode::getDomainSize (void) const +{ + return dist_->domain.size(); +} + + + +vector +BayesianNode::getCptEntries (const vector >& constraints) +{ + vector matchedEntries; + if (constraints.size() > 0 && constraints[0].first == 0) { + vector entries = getCptEntriesOfRow (constraints[0].second); + for (unsigned int i = 0; i < entries.size(); i++) { + if (entries[i].matchConstraints (constraints)) { + matchedEntries.push_back (entries[i]); + } + } + } + else { + for (unsigned int i = 0; i < dist_->domain.size(); i++) { + vector entries = getCptEntriesOfRow (i); + for (unsigned int j = 0; j < entries.size(); j++) { + if (entries[j].matchConstraints (constraints)) { + matchedEntries.push_back (entries[j]); + } + } + } + } + return matchedEntries; +} + + + +vector +BayesianNode::getCptEntriesOfRow (int rowIndex) +{ + int rowSize = getRowSize(); + int nParents = parents_.size(); + vector > insts (rowSize); + + for (int i = 0; i < rowSize; i++) { + insts[i].resize (nParents + 1); + insts[i][0] = rowIndex; + } + + int reps = 1; + for (int i = nParents - 1; i >= 0; i--) { + int index = 0; + while (index < rowSize) { + for (int j = 0; j < parents_[i]->getDomainSize(); j++) { + for (int k = 0; k < reps; k++) { + insts[index][i + 1] = j; + index++; + } + } + } + reps *= parents_[i]->getDomainSize(); + } + + vector entries; + for (int i = 0; i < rowSize; i++ ) { + entries.push_back (CptEntry ((rowIndex * rowSize) + i, insts[i])); + } + + return entries; +} + + + +int +BayesianNode::getIndexOfParent (const BayesianNode* myParent) const +{ + for (unsigned int i = 0; i < parents_.size(); i++) { + if (myParent == parents_[i]) { + return i; + } + } + return -1; +} + + + +bool +BayesianNode::hasEvidence (void) +{ + return evidence_ != -1; +} + + + +int +BayesianNode::getEvidence (void) +{ + return evidence_; +} + + + +void +BayesianNode::setEvidence (int evidence) +{ + evidence_ = evidence; +} + + + +string +BayesianNode::entryToString (const CptEntry& entry) const +{ + string s = "p(" ; + vector insts = entry.getDomainInstantiations(); + s += getDomain()[insts[0]]; + if (parents_.size() > 0) { + s += "|" ; + for (unsigned int i = 1; i < insts.size() - 1; i++) { + s += parents_[i - 1]->getDomain()[insts[i]] + ","; + } + BayesianNode* lastParent = parents_[parents_.size() - 1]; + int lastIndex = insts[insts.size() - 1]; + s += lastParent->getDomain()[lastIndex]; + } + s += ")" ; + return s; +} + + + +vector +BayesianNode::getDomainHeaders (void) const +{ + int rowSize = getRowSize(); + int nParents = parents_.size(); + int reps = 1; + vector headers (rowSize); + for (int i = nParents - 1; i >= 0; i--) { + vector domain = parents_[i]->getDomain(); + int index = 0; + while (index < rowSize) { + for (int j = 0; j < parents_[i]->getDomainSize(); j++) { + for (int k = 0; k < reps; k++) { + if (headers[index] != "") { + headers[index] = domain[j] + "," + headers[index]; + } else { + headers[index] = domain[j]; + } + index++; + } + } + } + reps *= parents_[i]->getDomainSize(); + } + return headers; +} + + + +ostream& +operator << (ostream& o, const BayesianNode& node) +{ + o << "Variable: " << node.getVariableName() << endl; + + o << "Domain: " ; + vector domain = node.dist_->domain; + for (unsigned int i = 0; i < domain.size() - 1; i++) { + o << domain[i] << ", " ; + } + if (domain.size() != 0) { + o << domain[domain.size() - 1]; + } + o << endl; + + o << "Parents: " ; + vector parents = node.getParents(); + if (parents.size() != 0) { + for (unsigned int i = 0; i < parents.size() - 1; i++) { + o << parents[i]->getVariableName() << ", " ; + } + o << parents[parents.size() - 1]->getVariableName(); + } + o << endl; + + o << "Childs: " ; + vector childs = node.getChilds(); + if (childs.size() != 0) { + for (unsigned int i = 0; i < childs.size() - 1; i++) { + o << childs[i]->getVariableName() << ", " ; + } + o << childs[childs.size() - 1]->getVariableName(); + } + o << endl; + + const unsigned int MIN_DOMAIN_WIDTH = 4; // min width of first column + const unsigned int MIN_COMBO_WIDTH = 12; // min width of following columns + + unsigned int domainWidth = domain[0].length(); + for (unsigned int i = 1; i < domain.size(); i++) { + if (domain[i].length() > domainWidth) { + domainWidth = domain[i].length(); + } + } + + domainWidth = (domainWidth < MIN_DOMAIN_WIDTH) + ? MIN_DOMAIN_WIDTH + : domainWidth; + + o << left << setw (domainWidth) << "cpt" << right; + + vector widths; + int lineWidth = domainWidth; + vector headers = node.getDomainHeaders(); + if (!headers.empty()) { + for (unsigned int i = 0; i < headers.size(); i++) { + unsigned int len = headers[i].length(); + int w = (len < MIN_COMBO_WIDTH) ? MIN_COMBO_WIDTH : len; + widths.push_back (w); + o << setw (w) << headers[i]; + lineWidth += w; + } + o << endl; + } else { + cout << endl; + widths.push_back (domainWidth); + lineWidth += MIN_COMBO_WIDTH; + } + + for (int i = 0; i < lineWidth; i++) { + o << "-" ; + } + o << endl; + + for (unsigned int i = 0; i < domain.size(); i++) { + double* row = node.getRow (i); + o << left << setw (domainWidth) << domain[i] << right; + for (int j = 0; j < node.getRowSize(); j++) { + o << setw (widths[j]) << row[j]; + } + o << endl; + } + o << endl; + + return o; +} + diff --git a/packages/CLPBN/clpbn/bp/BayesianNode.h b/packages/CLPBN/clpbn/bp/BayesianNode.h new file mode 100644 index 000000000..63b1dc301 --- /dev/null +++ b/packages/CLPBN/clpbn/bp/BayesianNode.h @@ -0,0 +1,59 @@ +#ifndef BAYESIAN_NODE_H +#define BAYESIAN_NODE_H + +#include +#include + +#include "Distribution.h" +#include "CptEntry.h" + +using namespace std; + +class BayesianNode +{ + public: + // constructs + BayesianNode (string, vector, Distribution*, int = -1); + // destruct + ~BayesianNode (void); + // methods + string getVariableName (void) const; + vector getParents (void) const; + vector getChilds (void) const; + void addChild (BayesianNode*); + double* getParameters (void); + double* getRow (int) const; + double getProbability (CptEntry&); + void setProbability (CptEntry&, double); + bool isRoot (void); + bool isLeaf (void); + int getRowSize (void) const; + int getCptSize (void); + vector getDomain (void) const; + int getDomainSize (void) const; + vector getCptEntries (const vector >&); + vector getCptEntriesOfRow (int); + int getIndexOfParent (const BayesianNode*) const; + bool hasEvidence (void); + int getEvidence (void); + void setEvidence (int); + string entryToString (const CptEntry& entry) const; + + private: + BayesianNode (const BayesianNode&); // disallow copy + void operator= (const BayesianNode&); // disallow assign + // methods + vector getDomainHeaders (void) const; + friend ostream& operator << (ostream&, const BayesianNode&); + // members + string varName_; // variable name + vector parents_; // parents of this node + vector childs_; // children of this node + Distribution* dist_; + int evidence_; +}; + +ostream& operator << (ostream&, const BayesianNode&); + +#endif // BAYESIAN_NODE_H + diff --git a/packages/CLPBN/clpbn/bp/BifInterface.cpp b/packages/CLPBN/clpbn/bp/BifInterface.cpp new file mode 100644 index 000000000..ba38030af --- /dev/null +++ b/packages/CLPBN/clpbn/bp/BifInterface.cpp @@ -0,0 +1,117 @@ +#include +#include +#include + +#include "xmlParser/xmlParser.h" + +#include "BifInterface.h" +#include "BayesianNetwork.h" +#include "BayesianNode.h" + + +void +BifInterface::createNetworkFromXML (BayesianNetwork* bn, const char* fileName) +{ + map > domains; + XMLNode xMainNode = XMLNode::openFileHelper (fileName, "BIF"); + // only the first network is parsed, others are ignored + XMLNode xNode = xMainNode.getChildNode ("NETWORK"); + int nVars = xNode.nChildNode ("VARIABLE"); + for (int i = 0; i < nVars; i++) { + XMLNode var = xNode.getChildNode ("VARIABLE", i); + string type = var.getAttribute ("TYPE"); + if (type != "nature") { + cerr << "error: only \"nature\" variables are supported" << endl; + abort(); + } + vector domain; + string varName = var.getChildNode("NAME").getText(); + int domainSize = var.nChildNode ("OUTCOME"); + for (int j = 0; j < domainSize; j++) { + domain.push_back (var.getChildNode("OUTCOME", j).getText()); + } + domains.insert (make_pair (varName, domain)); + } + + int nDefs = xNode.nChildNode ("DEFINITION"); + if (nVars != nDefs) { + cerr << "error: different number of variables and definitions"; + cerr << endl; + } + + for (int i = 0; i < nDefs; i++) { + XMLNode def = xNode.getChildNode ("DEFINITION", i); + string nodeName = def.getChildNode("FOR").getText(); + map >::const_iterator iter = domains.find (nodeName); + if (iter == domains.end()) { + cerr << "error: unknow variable `" << nodeName << "'" << endl; + abort(); + } + vector parents; + int nParams = iter->second.size(); + for (int j = 0; j < def.nChildNode ("GIVEN"); j++) { + string parentName = def.getChildNode("GIVEN", j).getText(); + BayesianNode* parentNode = bn->getNode (parentName); + if (parentNode) { + nParams *= parentNode->getDomainSize(); + parents.push_back (parentNode); + } + else { + cerr << "error: unknow variable `" << parentName << "'" << endl; + abort(); + } + } + + int c = 0; + double* params = new double [nParams]; + stringstream s (def.getChildNode("TABLE").getText()); + while (!s.eof() && c < nParams) { + s >> params[c]; + c++; + } + if (c != nParams) { + cerr << "error: invalid number of parameters " ; + cerr << "for variable `" << nodeName << "'" << endl; + abort(); + } + + params = reorderParameters (params, nParams, iter->second.size()); + bn->addNode (nodeName, parents, params, nParams, iter->second); + } +} + + +double* +BifInterface::reorderParameters (double* params, + int nParams, + int domainSize) +{ + // the interchange format for bayesian networks saves the probabilities + // in the following order: + // p(a1|b1,c1) p(a2|b1,c1) p(a1|b1,c2) p(a2|b1,c2) p(a1|b2,c1) p(a2|b2,c1) + // p(a1|b2,c2) p(a2|b2,c2). + // + // however, in clpbn we keep the probabilities in this order: + // p(a1|b1,c1) p(a1|b1,c2) p(a1|b2,c1) p(a1|b2,c2) p(a2|b1,c1) p(a2|b1,c2) + // p(a2|b2,c1) p(a2|b2,c2). + + int count = 0; + int index1 = 0; + int index2 = 0; + int rowSize = nParams / domainSize; + double* reordered = new double [nParams]; + + while (index1 < nParams) { + index2 = count; + for (int i = 0; i < domainSize; i++) { + reordered[index2] = params[index1]; + index1 += 1; + index2 += rowSize; + } + count++; + } + + delete [] params; + return reordered; +} + diff --git a/packages/CLPBN/clpbn/bp/BifInterface.h b/packages/CLPBN/clpbn/bp/BifInterface.h new file mode 100644 index 000000000..84f3cceb0 --- /dev/null +++ b/packages/CLPBN/clpbn/bp/BifInterface.h @@ -0,0 +1,20 @@ +#ifndef BIF_INTERFACE_H +#define BIF_INTERFACE_H + +using namespace std; + +class BayesianNetwork; +class BayesianNode; + +class BifInterface +{ + public: + static void createNetworkFromXML (BayesianNetwork*, const char*); + + private: + static double* reorderParameters (double*, int, int); +}; + +#endif // BIF_INTERFACE_H + + diff --git a/packages/CLPBN/clpbn/bp/BifTest.cpp b/packages/CLPBN/clpbn/bp/BifTest.cpp new file mode 100644 index 000000000..13420e6aa --- /dev/null +++ b/packages/CLPBN/clpbn/bp/BifTest.cpp @@ -0,0 +1,36 @@ +#include + +#include "BayesianNetwork.h" +#include "BayesianNode.h" +#include "BpNetwork.h" +#include "BpNode.h" +#include "BifInterface.h" + +using namespace std; + +int main (int argc, char* argv[]) +{ + BpNetwork bn; + // BayesianNetwork bn; + BifInterface::createNetworkFromXML (&bn, argv[1]); + bn.printNetwork(); + + // bn.getNode("FreightTruck")->setEvidence (0); + // bn.getNode("Alarm")->setEvidence (0); + + // bn.setSolverParameters (SEQUENTIAL_SCHEDULE, 500, 0.001); + // bn.setSolverParameters (PARALLEL_SCHEDULE, 500, 0.00000000000001); + // bn.setSolverParameters (PARALLEL_SCHEDULE, 500, 0.0000000000000000000001); + + //bn.getNode ("F")->setEvidence (0); + vector queryVars; + //queryVars.push_back (bn.getNode ("D")); + //queryVars.push_back (bn.getNode ("Burglar")); + queryVars.push_back (bn.getNode ("FreightTruck")); + queryVars.push_back (bn.getNode ("Alarm")); + bn.runSolver (queryVars); + + // bn.printCurrentStatus(); + // bn.printBeliefs(); + return 0; +} diff --git a/packages/CLPBN/clpbn/bp/BpNetwork.cpp b/packages/CLPBN/clpbn/bp/BpNetwork.cpp new file mode 100644 index 000000000..905f7cbc3 --- /dev/null +++ b/packages/CLPBN/clpbn/bp/BpNetwork.cpp @@ -0,0 +1,811 @@ +#include +#include +#include +#include + +#include "BpNetwork.h" +#include "BpNode.h" +#include "CptEntry.h" + +BpNetwork::BpNetwork (void) +{ + schedule_ = SEQUENTIAL_SCHEDULE; + maxIter_ = 150; + stableThreashold_ = 0.00000000000000000001; +} + + + +BpNetwork::~BpNetwork (void) +{ + for (unsigned int i = 0; i < nodes_.size(); i++) { + delete nodes_[i]; + } + nodes_.clear(); +} + + + +void +BpNetwork::setSolverParameters (Schedule schedule, + int maxIter, + double stableThreashold) +{ + if (maxIter <= 0) { + cerr << "error: maxIter must be greater or equal to 1" << endl; + abort(); + } + if (stableThreashold <= 0.0 || stableThreashold >= 1.0) { + cerr << "error: stableThreashold must be greater than 0.0 " ; + cerr << "and lesser than 1.0" << endl; + abort(); + } + schedule_ = schedule; + maxIter_ = maxIter; + stableThreashold_ = stableThreashold; +} + + + +void +BpNetwork::runSolver (BayesianNode* queryVar) +{ + vector queryVars; + queryVars.push_back (queryVar); + runSolver (queryVars); +} + + + +void +BpNetwork::runSolver (vector queryVars) +{ + if (queryVars.size() > 1) { + addJunctionNode (queryVars); + } + else { + string varName = queryVars[0]->getVariableName(); + queryNode_ = static_cast (getNode (varName)); + } + + if (!isPolyTree()) { + if (DL_ >= 1) { + cout << "The graph is not single connected. " ; + cout << "Iterative belief propagation will be used." ; + cout << endl << endl; + } + schedule_ = PARALLEL_SCHEDULE; + } + + if (schedule_ == SEQUENTIAL_SCHEDULE) { + initializeSolver (queryVars); + runNeapolitanSolver(); + for (unsigned int i = 0; i < nodes_.size(); i++) { + if (nodes_[i]->hasEvidence()) { + BpNode* v = static_cast (nodes_[i]); + addEvidence (v); + vector parents = cast (v->getParents()); + for (unsigned int i = 0; i < parents.size(); i++) { + if (!parents[i]->hasEvidence()) { + sendLambdaMessage (v, parents[i]); + } + } + vector childs = cast (v->getChilds()); + for (unsigned int i = 0; i < childs.size(); i++) { + sendPiMessage (v, childs[i]); + } + } + } + } else if (schedule_ == PARALLEL_SCHEDULE) { + BpNode::enableParallelSchedule(); + initializeSolver (queryVars); + for (unsigned int i = 0; i < nodes_.size(); i++) { + if (nodes_[i]->hasEvidence()) { + addEvidence (static_cast (nodes_[i])); + } + } + runIterativeBpSolver(); + } +} + + + +void +BpNetwork::printCurrentStatus (void) +{ + for (unsigned int i = 0; i < nodes_.size(); i++) { + printCurrentStatusOf (static_cast (nodes_[i])); + } +} + + + +void +BpNetwork::printCurrentStatusOf (BpNode* x) +{ + vector childs = cast (x->getChilds()); + vector domain = x->getDomain(); + + cout << left; + cout << setw (10) << "domain" ; + cout << setw (20) << "π(" + x->getVariableName() + ")" ; + cout << setw (20) << "λ(" + x->getVariableName() + ")" ; + cout << setw (16) << "belief" ; + cout << endl; + + cout << "--------------------------------" ; + cout << "--------------------------------" ; + cout << endl; + + double* piValues = x->getPiValues(); + double* lambdaValues = x->getLambdaValues(); + double* beliefs = x->getBeliefs(); + for (int xi = 0; xi < x->getDomainSize(); xi++) { + cout << setw (10) << domain[xi]; + cout << setw (19) << piValues[xi]; + cout << setw (19) << lambdaValues[xi]; + cout.precision (PRECISION_); + cout << setw (16) << beliefs[xi]; + cout << endl; + } + cout << endl; + if (childs.size() > 0) { + string s = "(" + x->getVariableName() + ")" ; + for (unsigned int j = 0; j < childs.size(); j++) { + cout << setw (10) << "domain" ; + cout << setw (28) << "π" + childs[j]->getVariableName() + s; + cout << setw (28) << "λ" + childs[j]->getVariableName() + s; + cout << endl; + cout << "--------------------------------" ; + cout << "--------------------------------" ; + cout << endl; + for (int xi = 0; xi < x->getDomainSize(); xi++) { + cout << setw (10) << domain[xi]; + cout.precision (PRECISION_); + cout << setw (27) << x->getPiMessage(childs[j], xi); + cout.precision (PRECISION_); + cout << setw (27) << x->getLambdaMessage(childs[j], xi); + cout << endl; + } + cout << endl; + } + } +} + + + +void +BpNetwork::printBeliefs (void) +{ + for (unsigned int i = 0; i < nodes_.size(); i++) { + BpNode* x = static_cast (nodes_[i]); + vector domain = x->getDomain(); + cout << setw (20) << left << x->getVariableName() ; + cout << setw (26) << "belief" ; + cout << endl; + cout << "--------------------------------------" ; + cout << endl; + double* beliefs = x->getBeliefs(); + for (int xi = 0; xi < x->getDomainSize(); xi++) { + cout << setw (20) << domain[xi]; + cout.precision (PRECISION_); + cout << setw (26) << beliefs[xi]; + cout << endl; + } + cout << endl; + } +} + + + +vector +BpNetwork::getBeliefs (void) +{ + return getBeliefs (queryNode_); +} + + + +vector +BpNetwork::getBeliefs (BpNode* x) +{ + double* beliefs = x->getBeliefs(); + vector beliefsVec; + for (int xi = 0; xi < x->getDomainSize(); xi++) { + beliefsVec.push_back (beliefs[xi]); + } + return beliefsVec; +} + + + +void +BpNetwork::initializeSolver (vector queryVars) +{ + if (DL_ >= 1) { + cout << "Initializing solver" << endl; + if (schedule_ == SEQUENTIAL_SCHEDULE) { + cout << "-> schedule = sequential" << endl; + } else { + cout << "-> schedule = parallel" << endl; + } + cout << "-> max iters = " << maxIter_ << endl; + cout << "-> stable threashold = " << stableThreashold_ << endl; + cout << "-> query vars = " ; + for (unsigned int i = 0; i < queryVars.size(); i++) { + cout << queryVars[i]->getVariableName() << " " ; + } + cout << endl; + } + + nIter_ = 0; + + for (unsigned int i = 0; i < nodes_.size(); i++) { + BpNode* node = static_cast (nodes_[i]); + node->allocateMemory(); + } + + for (unsigned int i = 0; i < nodes_.size(); i++) { + BpNode* x = static_cast (nodes_[i]); + + double* piValues = x->getPiValues(); + double* lambdaValues = x->getLambdaValues(); + for (int xi = 0; xi < x->getDomainSize(); xi++) { + piValues[xi] = 1.0; + lambdaValues[xi] = 1.0; + } + + vector xChilds = cast (x->getChilds()); + for (unsigned int j = 0; j < xChilds.size(); j++) { + double* piMessages = x->getPiMessages (xChilds[j]); + for (int xi = 0; xi < x->getDomainSize(); xi++) { + piMessages[xi] = 1.0; + //x->setPiMessage (xChilds[j], xi, 1.0); + } + } + + vector xParents = cast (x->getParents()); + for (unsigned int j = 0; j < xParents.size(); j++) { + double* lambdaMessages = xParents[j]->getLambdaMessages (x); + for (int xi = 0; xi < xParents[j]->getDomainSize(); xi++) { + lambdaMessages[xi] = 1.0; + //xParents[j]->setLambdaMessage (x, xi, 1.0); + } + } + } + + for (unsigned int i = 0; i < nodes_.size(); i++) { + BpNode* x = static_cast (nodes_[i]); + x->normalizeMessages(); + } + printCurrentStatus(); + + + vector roots = cast (getRootNodes()); + for (unsigned int i = 0; i < roots.size(); i++) { + double* params = roots[i]->getParameters(); + double* piValues = roots[i]->getPiValues(); + for (int ri = 0; ri < roots[i]->getDomainSize(); ri++) { + piValues[ri] = params[ri]; + } + } +} + + + +void +BpNetwork::addJunctionNode (vector queryVars) +{ + const string VAR_NAME = "_Jn"; + int nStates = 1; + vector parents; + vector domain; + for (unsigned int i = 0; i < queryVars.size(); i++) { + parents.push_back (queryVars[i]); + nStates *= queryVars[i]->getDomainSize(); + } + + for (int i = 0; i < nStates; i++) { + stringstream ss; + ss << "_jn" << i; + domain.push_back (ss.str()); // FIXME make domain optional + } + + int nParams = nStates * nStates; + double* params = new double [nParams]; + for (int i = 0; i < nParams; i++) { + int row = i / nStates; + int col = i % nStates; + if (row == col) { + params[i] = 1; + } else { + params[i] = 0; + } + } + addNode (VAR_NAME, parents, params, nParams, domain); + queryNode_ = static_cast (getNode (VAR_NAME)); + printNetwork(); +} + + + +void +BpNetwork::addEvidence (BpNode* v) +{ + if (DL_ >= 1) { + cout << "Adding evidence: node " ; + cout << "`" << v->getVariableName() << "' was instantiated as " ; + cout << "`" << v->getDomain()[v->getEvidence()] << "'" ; + cout << endl; + } + double* piValues = v->getPiValues(); + double* lambdaValues = v->getLambdaValues(); + for (int vi = 0; vi < v->getDomainSize(); vi++) { + if (vi == v->getEvidence()) { + piValues[vi] = 1.0; + lambdaValues[vi] = 1.0; + } else { + piValues[vi] = 0.0; + lambdaValues[vi] = 0.0; + } + } +} + + + +void +BpNetwork::runNeapolitanSolver (void) +{ + vector roots = cast (getRootNodes()); + for (unsigned int i = 0; i < roots.size(); i++) { + vector childs = cast (roots[i]->getChilds()); + for (unsigned int j = 0; j < childs.size(); j++) { + sendPiMessage (roots[i], static_cast (childs[j])); + } + } +} + + + +void +BpNetwork::sendPiMessage (BpNode* z, BpNode* x) +{ + nIter_ ++; + if (!(maxIter_ == -1 || nIter_ < maxIter_)) { + cout << "the maximum number of iterations was achieved, terminating..." ; + cout << endl; + return; + } + + if (DL_ >= 1) { + cout << "π message " << z->getVariableName(); + cout << " --> " << x->getVariableName() << endl; + } + + updatePiMessages(z, x); + + if (!x->hasEvidence()) { + updatePiValues (x); + vector xChilds = cast (x->getChilds()); + for (unsigned int i = 0; i < xChilds.size(); i++) { + sendPiMessage (x, xChilds[i]); + } + } + + bool isAllOnes = true; + double* lambdaValues = x->getLambdaValues(); + for (int xi = 0; xi < x->getDomainSize(); xi++) { + if (lambdaValues[xi] != 1.0) { + isAllOnes = false; + break; + } + } + + if (!isAllOnes) { + vector xParents = cast (x->getParents()); + for (unsigned int i = 0; i < xParents.size(); i++) { + if (xParents[i] != z && !xParents[i]->hasEvidence()) { + sendLambdaMessage (x, xParents[i]); + } + } + } +} + + + +void +BpNetwork::sendLambdaMessage (BpNode* y, BpNode* x) +{ + nIter_ ++; + if (!(maxIter_ == -1 || nIter_ < maxIter_)) { + cout << "the maximum number of iterations was achieved, terminating..." ; + cout << endl; + return; + } + + if (DL_ >= 1) { + cout << "λ message " << y->getVariableName(); + cout << " --> " << x->getVariableName() << endl; + } + + updateLambdaMessages (x, y); + updateLambdaValues (x); + + vector xParents = cast (x->getParents()); + for (unsigned int i = 0; i < xParents.size(); i++) { + if (!xParents[i]->hasEvidence()) { + sendLambdaMessage (x, xParents[i]); + } + } + + vector xChilds = cast (x->getChilds()); + for (unsigned int i = 0; i < xChilds.size(); i++) { + if (xChilds[i] != y) { + sendPiMessage (x, xChilds[i]); + } + } +} + + + +void +BpNetwork::updatePiValues (BpNode* x) +{ + // π(Xi) + vector parents = cast (x->getParents()); + for (int xi = 0; xi < x->getDomainSize(); xi++) { + stringstream calcs1; + stringstream calcs2; + if (DL_ >= 2) { + calcs1 << "π("<< x->getDomain()[xi] << ")" << endl << "= " ; + } + double sum = 0.0; + vector > constraints; + vector entries = x->getCptEntriesOfRow (xi); + for (unsigned int k = 0; k < entries.size(); k++) { + double prod = x->getProbability (entries[k]); + if (DL_ >= 2) { + if (k != 0) calcs1 << endl << "+ " ; + calcs1 << x->entryToString (entries[k]); + if (DL_ >= 3) { + (k == 0) ? calcs2 << "(" << prod : calcs2 << endl << "+ (" << prod; + } + } + vector insts = entries[k].getDomainInstantiations(); + for (unsigned int i = 0; i < parents.size(); i++) { + double value = parents[i]->getPiMessage (x, insts[i + 1]); + prod *= value; + if (DL_ >= 2) { + calcs1 << ".π" << x->getVariableName(); + calcs1 << "(" << parents[i]->getDomain()[insts[i + 1]] << ")"; + if (DL_ >= 3) calcs2 << "x" << value; + } + } + sum += prod; + if (DL_ >= 3) calcs2 << ")"; + } + x->setPiValue (xi, sum); + if (DL_ >= 2) { + cout << calcs1.str(); + if (DL_ >= 3) cout << endl << "= " << calcs2.str(); + cout << " = " << sum << endl; + } + } +} + + + +void +BpNetwork::updatePiMessages (BpNode* z, BpNode* x) +{ + // πX(Zi) + vector zChilds = cast (z->getChilds()); + for (int zi = 0; zi < z->getDomainSize(); zi++) { + stringstream calcs1; + stringstream calcs2; + if (DL_ >= 2) { + calcs1 << "π" << x->getVariableName(); + calcs1 << "(" << z->getDomain()[zi] << ") = " ; + } + double prod = z->getPiValue (zi); + if (DL_ >= 2) { + calcs1 << "π(" << z->getDomain()[zi] << ")" ; + if (DL_ >= 3) calcs2 << prod; + } + for (unsigned int i = 0; i < zChilds.size(); i++) { + if (zChilds[i] != x) { + double value = z->getLambdaMessage (zChilds[i], zi); + prod *= value; + if (DL_ >= 2) { + calcs1 << ".λ" << zChilds[i]->getVariableName(); + calcs1 << "(" << z->getDomain()[zi] + ")" ; + if (DL_ >= 3) calcs2 << " x " << value; + } + } + } + z->setPiMessage (x, zi, prod); + if (DL_ >= 2) { + cout << calcs1.str(); + if (DL_ >= 3) cout << " = " << calcs2.str(); + cout << " = " << prod << endl; + } + } +} + + + +void +BpNetwork::updateLambdaValues (BpNode* x) +{ + // λ(Xi) + vector childs = cast (x->getChilds()); + for (int xi = 0; xi < x->getDomainSize(); xi++) { + stringstream calcs1; + stringstream calcs2; + if (DL_ >= 2) { + calcs1 << "λ" << "(" << x->getDomain()[xi] << ") = " ; + } + double prod = 1.0; + for (unsigned int i = 0; i < childs.size(); i++) { + double val = x->getLambdaMessage (childs[i], xi); + prod *= val; + if (DL_ >= 2) { + if (i != 0) calcs1 << "." ; + calcs1 << "λ" << childs[i]->getVariableName(); + calcs1 << "(" << x->getDomain()[xi] + ")" ; + if (DL_ >= 3) (i == 0) ? calcs2 << val : calcs2 << " x " << val; + } + } + x->setLambdaValue (xi, prod); + if (DL_ >= 2) { + cout << calcs1.str(); + if (childs.size() == 0) { + cout << 1 << endl; + } else { + if (DL_ >= 3) cout << " = " << calcs2.str(); + cout << " = " << prod << endl; + } + } + } +} + + + +void +BpNetwork::updateLambdaMessages (BpNode* x, BpNode* y) +{ + // λY(Xi) + int parentIndex = y->getIndexOfParent (x) + 1; + vector yParents = cast (y->getParents()); + for (int xi = 0; xi < x->getDomainSize(); xi++) { + stringstream calcs1; + stringstream calcs2; + if (DL_ >= 2) { + calcs1 << "λ" << y->getVariableName() ; + calcs1 << "(" << x->getDomain()[xi] << ")" << endl << "= " ; + } + double outer_sum = 0.0; + for (int yi = 0; yi < y->getDomainSize(); yi++) { + if (DL_ >= 2) { + (yi == 0) ? calcs1 << "[" : calcs1 << endl << "+ [" ; + if (DL_ >= 3) { + (yi == 0) ? calcs2 << "[" : calcs2 << endl << "+ [" ; + } + } + double inner_sum = 0.0; + vector > constraints; + constraints.push_back (make_pair (0, yi)); + constraints.push_back (make_pair (parentIndex, xi)); + vector entries = y->getCptEntries (constraints); + for (unsigned int k = 0; k < entries.size(); k++) { + double prod = y->getProbability (entries[k]); + if (DL_ >= 2) { + if (k != 0) calcs1 << " + " ; + calcs1 << y->entryToString (entries[k]); + if (DL_ >= 3) { + (k == 0) ? calcs2 << "(" << prod : calcs2 << " + (" << prod; + } + } + vector insts = entries[k].getDomainInstantiations(); + for (unsigned int i = 0; i < yParents.size(); i++) { + if (yParents[i] != x) { + double val = yParents[i]->getPiMessage (y, insts[i + 1]); + prod *= val; + if (DL_ >= 2) { + calcs1 << ".π" << y->getVariableName(); + calcs1 << "(" << yParents[i]->getDomain()[insts[i + 1]] << ")" ; + if (DL_ >= 3) calcs2 << "x" << val; + } + + } + } + inner_sum += prod; + if (DL_ >= 3) { + calcs2 << ")" ; + } + } + outer_sum += inner_sum * y->getLambdaValue (yi); + if (DL_ >= 2) { + calcs1 << "].λ(" << y->getDomain()[yi] << ")"; + if (DL_ >= 3) calcs2 << "]x" << y->getLambdaValue (yi); + } + } + x->setLambdaMessage (y, xi, outer_sum); + if (DL_ >= 2) { + cout << calcs1.str(); + if (DL_ >= 3) cout << endl << "= " << calcs2.str(); + cout << " = " << outer_sum << endl; + } + } +} + + + +void +BpNetwork::runIterativeBpSolver() +{ + int nIter = 0; + maxIter_ = 100; + bool converged = false; + while (nIter < maxIter_ && !converged) { + if (DL_ >= 1) { + cout << endl << endl; + cout << "****************************************" ; + cout << "****************************************" ; + cout << endl; + cout << " Iteration " << nIter + 1 << endl; + cout << "****************************************" ; + cout << "****************************************" ; + } + + for (unsigned int i = 0; i < nodes_.size(); i++) { + BpNode* x = static_cast(nodes_[i]); + vector xParents = cast (x->getParents()); + for (unsigned int j = 0; j < xParents.size(); j++) { + //if (!xParents[j]->hasEvidence()) { + if (DL_ >= 1) { + cout << endl << "λ message " << x->getVariableName(); + cout << " --> " << xParents[j]->getVariableName() << endl; + } + updateLambdaMessages (xParents[j], x); + //} + } + } + + for (unsigned int i = 0; i < nodes_.size(); i++) { + BpNode* x = static_cast(nodes_[i]); + vector xChilds = cast (x->getChilds()); + for (unsigned int j = 0; j < xChilds.size(); j++) { + if (DL_ >= 1) { + cout << endl << "π message " << x->getVariableName(); + cout << " --> " << xChilds[j]->getVariableName() << endl; + } + updatePiMessages (x, xChilds[j]); + } + } + + /* + for (unsigned int i = 0; i < nodes_.size(); i++) { + BpNode* x = static_cast(nodes_[i]); + vector xChilds = cast (x->getChilds()); + for (unsigned int j = 0; j < xChilds.size(); j++) { + if (DL_ >= 1) { + cout << "π message " << x->getVariableName(); + cout << " --> " << xChilds[j]->getVariableName() << endl; + } + updatePiMessages (x, xChilds[j]); + } + vector xParents = cast (x->getParents()); + for (unsigned int j = 0; j < xParents.size(); j++) { + //if (!xParents[j]->hasEvidence()) { + if (DL_ >= 1) { + cout << "λ message " << x->getVariableName(); + cout << " --> " << xParents[j]->getVariableName() << endl; + } + updateLambdaMessages (xParents[j], x); + //} + } + } + */ + + for (unsigned int i = 0; i < nodes_.size(); i++) { + BpNode* x = static_cast (nodes_[i]); + //cout << endl << "SWAPING MESSAGES FOR " << x->getVariableName() << ":" ; + //cout << endl << endl; + //printCurrentStatusOf (x); + x->swapMessages(); + x->normalizeMessages(); + //cout << endl << "messages swaped " << endl; + //printCurrentStatusOf (x); + } + + converged = true; + for (unsigned int i = 0; i < nodes_.size(); i++) { + BpNode* x = static_cast(nodes_[i]); + if (DL_ >= 1) { + cout << endl << "var " << x->getVariableName() << ":" << endl; + } + //if (!x->hasEvidence()) { + updatePiValues (x); + updateLambdaValues (x); + double change = x->getBeliefChange(); + if (DL_ >= 1) { + cout << "belief change = " << change << endl; + } + if (change > stableThreashold_) { + converged = false; + } + //} + } + + if (converged) { + // converged = false; + } + if (DL_ >= 2) { + cout << endl; + printCurrentStatus(); + } + nIter++; + } + + if (DL_ >= 1) { + cout << endl; + if (converged) { + cout << "Iterative belief propagation converged in " ; + cout << nIter << " iterations" << endl; + } else { + cout << "Iterative belief propagation converged didn't converge" ; + cout << endl; + } + if (DL_ == 1) { + cout << endl; + printBeliefs(); + } + cout << endl; + } +} + + + +void +BpNetwork::addNode (string varName, + vector parents, + int evidence, + int distId) +{ + for (unsigned int i = 0; i < dists_.size(); i++) { + if (dists_[i]->id == distId) { + BpNode* node = new BpNode (varName, parents, dists_[i], evidence); + nodes_.push_back (node); + break; + } + } +} + + + +void +BpNetwork::addNode (string varName, + vector parents, + double* params, + int nParams, + vector domain) +{ + Distribution* dist = new Distribution (params, nParams, domain); + BpNode* node = new BpNode (varName, parents, dist); + dists_.push_back (dist); + nodes_.push_back (node); +} + + + +vector +BpNetwork::cast (vector nodes) +{ + vector castedNodes (nodes.size()); + for (unsigned int i = 0; i < nodes.size(); i++) { + castedNodes[i] = static_cast (nodes[i]); + } + return castedNodes; +} + diff --git a/packages/CLPBN/clpbn/bp/BpNetwork.h b/packages/CLPBN/clpbn/bp/BpNetwork.h new file mode 100644 index 000000000..a37b079af --- /dev/null +++ b/packages/CLPBN/clpbn/bp/BpNetwork.h @@ -0,0 +1,66 @@ +#ifndef BP_BP_NETWORK_H +#define BP_BP_NETWORK_H + +#include +#include + +#include "BayesianNetwork.h" + +using namespace std; + +class BpNode; + +enum Schedule +{ + SEQUENTIAL_SCHEDULE, + PARALLEL_SCHEDULE +}; + +class BpNetwork : public BayesianNetwork +{ + public: + // constructs + BpNetwork (void); + // destruct + ~BpNetwork (void); + // methods + void setSolverParameters (Schedule, int, double); + void runSolver (BayesianNode* queryVar); + void runSolver (vector); + void printCurrentStatus (void); + void printCurrentStatusOf (BpNode*); + void printBeliefs (void); + vector getBeliefs (void); + vector getBeliefs (BpNode*); + + private: + BpNetwork (const BpNetwork&); // disallow copy + void operator= (const BpNetwork&); // disallow assign + // methods + void initializeSolver (vector); + void addJunctionNode (vector); + void addEvidence (BpNode*); + void runNeapolitanSolver (void); + void sendLambdaMessage (BpNode*, BpNode*); + void sendPiMessage (BpNode*, BpNode*); + void updatePiValues (BpNode*); + void updatePiMessages (BpNode*, BpNode*); + void updateLambdaValues (BpNode*); + void updateLambdaMessages (BpNode*, BpNode*); + void runIterativeBpSolver (void); + void addNode (string, vector, int, int); + void addNode (string, vector, + double*, int, vector); + vector cast (vector); + // members + Schedule schedule_; + int nIter_; + int maxIter_; + double stableThreashold_; + BpNode* queryNode_; + static const int DL_ = 3; + static const int PRECISION_ = 10; +}; + +#endif // BP_BP_NETWORK_H + diff --git a/packages/CLPBN/clpbn/bp/BpNode.cpp b/packages/CLPBN/clpbn/bp/BpNode.cpp new file mode 100644 index 000000000..8f784ab16 --- /dev/null +++ b/packages/CLPBN/clpbn/bp/BpNode.cpp @@ -0,0 +1,321 @@ +#include +#include +#include + +#include "BpNode.h" + + +bool BpNode::parallelSchedule_ = false; + +BpNode::BpNode (string varName, + vector parents, + Distribution* dist, + int evidence) : BayesianNode (varName, parents, dist, evidence) +{ + +} + + + +BpNode::~BpNode (void) +{ + delete [] piValues_; + delete [] lambdaValues_; + delete [] oldBeliefs_; + map::iterator iter; + for (iter = lambdaMessages_.begin(); iter != lambdaMessages_.end(); ++iter) { + delete [] iter->second; + } + for (iter = piMessages_.begin(); iter != piMessages_.end(); ++iter) { + delete [] iter->second; + } + // FIXME delete new messages +} + + + +void +BpNode::enableParallelSchedule (void) +{ + parallelSchedule_ = true; +} + + + +void +BpNode::allocateMemory (void) +{ + // FIXME do i need this !? + int domainSize = getDomainSize(); + piValues_ = new double [domainSize]; + lambdaValues_ = new double [domainSize]; + if (parallelSchedule_) { + newPiMessages_ = new map; + newLambdaMessages_ = new map; + } + oldBeliefs_ = 0; + vector childs = getChilds(); + for (unsigned int i = 0; i < childs.size(); i++) { + BpNode* child = static_cast (childs[i]); + piMessages_.insert (make_pair (child, new double [domainSize])); + lambdaMessages_.insert (make_pair (child, new double [domainSize])); + if (parallelSchedule_) { + newPiMessages_->insert (make_pair (child, new double [domainSize])); + newLambdaMessages_->insert (make_pair (child, new double [domainSize])); + } + } +} + + + +double* +BpNode::getPiValues (void) const +{ + return piValues_; +} + + + +double +BpNode::getPiValue (int index) const +{ + const int c = getDomainSize(); + assert (index >=0 && index < c); + return piValues_[index]; +} + + + +void +BpNode::setPiValue (int index, double value) +{ + const int c = getDomainSize(); + assert (index >=0 && index < c); + piValues_[index] = value; +} + + + +double* +BpNode::getLambdaValues (void) const +{ + return lambdaValues_; +} + + + +double +BpNode::getLambdaValue (int index) const +{ + const int c = getDomainSize(); + assert (index >=0 && index < c); + return lambdaValues_[index]; +} + + + +void +BpNode::setLambdaValue (int index, double value) +{ + const int c = getDomainSize(); + assert (index >=0 && index < c); + lambdaValues_[index] = value; +} + + + +double* +BpNode::getPiMessages (BpNode* node) const +{ + assert (node); + map::const_iterator iter = piMessages_.find (node); + assert (iter != piMessages_.end()); + return iter->second; +} + + + +double +BpNode::getPiMessage (BpNode* node, int index) const +{ + assert (node); + const int c = getDomainSize(); + assert (index >=0 && index < c); + map::const_iterator iter = piMessages_.find (node); + assert (iter != piMessages_.end()); + return iter->second[index]; +} + + + +void +BpNode::setPiMessage (BpNode* node, int index, double probability) +{ + assert (node); + const int c = getDomainSize(); + assert (index >=0 && index < c); + map::const_iterator iter; + if (parallelSchedule_) { + // cerr << "set_pi_message" << endl; + iter = newPiMessages_->find (node); + assert (iter != newPiMessages_->end()); + } else { + iter = piMessages_.find (node); + assert (iter != piMessages_.end()); + } + iter->second[index] = probability; +} + + + +double* +BpNode::getLambdaMessages (BpNode* node) const +{ + assert (node); + map::const_iterator iter = lambdaMessages_.find (node); + assert (iter != piMessages_.end()); + return iter->second; +} + + + +double +BpNode::getLambdaMessage (BpNode* node, int index) const +{ + assert (node); + const int c = getDomainSize(); + assert (index >=0 && index < c); + map::const_iterator iter = lambdaMessages_.find (node); + assert (iter != piMessages_.end()); + return iter->second[index]; +} + + + +void +BpNode::setLambdaMessage (BpNode* node, int index, double probability) +{ + assert (node); + const int c = getDomainSize(); + assert (index >=0 && index < c); + map::const_iterator iter; + if (parallelSchedule_) { + //cerr << "set_lambda_message" << endl; + iter = newLambdaMessages_->find (node); + assert (iter != newLambdaMessages_->end()); + } else { + iter = lambdaMessages_.find (node); + assert (iter != lambdaMessages_.end()); + } + iter->second[index] = probability; +} + + + +double* +BpNode::getBeliefs (void) +{ + double sum = 0.0; + double* beliefs = new double [getDomainSize()]; + for (int xi = 0; xi < getDomainSize(); xi++) { + double prod = piValues_[xi] * lambdaValues_[xi]; + beliefs[xi] = prod; + sum += prod; + } + // normalize the beliefs + for (int xi = 0; xi < getDomainSize(); xi++) { + beliefs[xi] /= sum; + } + return beliefs; +} + + + +double +BpNode::getBeliefChange (void) +{ + double change = 0.0; + if (!oldBeliefs_) { + oldBeliefs_ = getBeliefs(); + change = MAX_CHANGE_; + } else { + double* currentBeliefs = getBeliefs(); + for (int xi = 0; xi < getDomainSize(); xi++) { + change += abs (currentBeliefs[xi] - oldBeliefs_[xi]); + } + oldBeliefs_ = currentBeliefs; + } + //FIXME memory leak + return change; +} + + + +void +BpNode::normalizeMessages (void) +{ + map::iterator iter; + + iter = lambdaMessages_.begin(); + while (iter != lambdaMessages_.end()) { + double* v = iter->second; + double sum = 0.0; + for (int xi = 0; xi < getDomainSize(); xi++) { + sum += v[xi]; + } + for (int xi = 0; xi < getDomainSize(); xi++) { + v[xi] /= sum; + } + iter ++; + } + + iter = piMessages_.begin(); + while (iter != piMessages_.end()) { + double* v = iter->second; + double sum = 0.0; + for (int xi = 0; xi < getDomainSize(); xi++) { + sum += v[xi]; + } + for (int xi = 0; xi < getDomainSize(); xi++) { + v[xi] /= sum; + } + iter ++; + } +} + + + +void +BpNode::swapMessages (void) +{ + //FIXME fast way to do this + map::iterator iter1; + map::iterator iter2; + + iter1 = lambdaMessages_.begin(); + iter2 = newLambdaMessages_->begin(); + while (iter1 != lambdaMessages_.end()) { + double* v1 = iter1->second; + double* v2 = iter2->second; + for (int xi = 0; xi < getDomainSize(); xi++) { + //v1[xi] = v2[xi]; + v1[xi] = (v1[xi] + v2[xi]) / 2; + } + iter1 ++; + iter2 ++; + } + + iter1 = piMessages_.begin(); + iter2 = newPiMessages_->begin(); + while (iter1 != piMessages_.end()) { + double* v1 = iter1->second; + double* v2 = iter2->second; + for (int xi = 0; xi < getDomainSize(); xi++) { + //v1[xi] = v2[xi]; + v1[xi] = (v1[xi] + v2[xi]) / 2; + } + iter1 ++; + iter2 ++; + } +} + diff --git a/packages/CLPBN/clpbn/bp/BpNode.h b/packages/CLPBN/clpbn/bp/BpNode.h new file mode 100644 index 000000000..2d796365e --- /dev/null +++ b/packages/CLPBN/clpbn/bp/BpNode.h @@ -0,0 +1,56 @@ +#ifndef BP_BP_NODE_H +#define BP_BP_NODE_H + +#include +#include +#include +#include + +#include "BayesianNode.h" + +using namespace std; + +class BpNode : public BayesianNode +{ + public: + // constructs + BpNode (string, vector, Distribution* dist, int = -1); + // destruct + ~BpNode (void); + // methods + static void enableParallelSchedule (void); + void allocateMemory (void); + double* getPiValues (void) const; + double getPiValue (int) const; + void setPiValue (int, double); + double* getLambdaValues (void) const; + double getLambdaValue (int) const; + void setLambdaValue (int, double); + double* getPiMessages (BpNode*) const; + double getPiMessage (BpNode*, int) const; + void setPiMessage (BpNode*, int, double); + double* getLambdaMessages (BpNode*) const; + double getLambdaMessage (BpNode*, int) const; + void setLambdaMessage (BpNode*, int, double); + double* getBeliefs (void); + double getBeliefChange (void); + void normalizeMessages (void); + void swapMessages (void); + + private: + BpNode (const BpNode&); // disallow copy + void operator= (const BpNode&); // disallow assign + // members + double* lambdaValues_; + double* piValues_; + map piMessages_; + map lambdaMessages_; + map* newPiMessages_; + map* newLambdaMessages_; + double* oldBeliefs_; + static bool parallelSchedule_; + static const double MAX_CHANGE_ = 1.0; +}; + +#endif // BP_BP_NODE_H + diff --git a/packages/CLPBN/clpbn/bp/CptEntry.cpp b/packages/CLPBN/clpbn/bp/CptEntry.cpp new file mode 100644 index 000000000..7ef03f075 --- /dev/null +++ b/packages/CLPBN/clpbn/bp/CptEntry.cpp @@ -0,0 +1,38 @@ +#include "CptEntry.h" + +CptEntry::CptEntry (int cptIndex, vector instantiations) +{ + cptIndex_ = cptIndex; + instantiations_ = instantiations; +} + + + +int +CptEntry::getCptIndex (void) const +{ + return cptIndex_; +} + + + +vector +CptEntry::getDomainInstantiations (void) const +{ + return instantiations_; +} + + + +bool +CptEntry::matchConstraints (const vector >& constraints) const +{ + for (unsigned int j = 0; j < constraints.size(); j++) { + int index = constraints[j].first; + if (instantiations_[index] != constraints[j].second) { + return false; + } + } + return true; +} + diff --git a/packages/CLPBN/clpbn/bp/CptEntry.h b/packages/CLPBN/clpbn/bp/CptEntry.h new file mode 100644 index 000000000..7289212d7 --- /dev/null +++ b/packages/CLPBN/clpbn/bp/CptEntry.h @@ -0,0 +1,23 @@ +#ifndef CPT_ENTRY_H +#define CPT_ENTRY_H + +#include + +using namespace std; + +class CptEntry +{ + public: + // constructs + CptEntry (int, vector); + // methods + int getCptIndex (void) const; + vector getDomainInstantiations (void) const; + bool matchConstraints (const vector >&) const; + private: + // members + int cptIndex_; + vector instantiations_; +}; + +#endif // CPT_ENTRY_H diff --git a/packages/CLPBN/clpbn/bp/Distribution.cpp b/packages/CLPBN/clpbn/bp/Distribution.cpp new file mode 100644 index 000000000..309d8b73e --- /dev/null +++ b/packages/CLPBN/clpbn/bp/Distribution.cpp @@ -0,0 +1,40 @@ +#include +#include + +#include + +Distribution::Distribution (int id, + double* params, + int nParams, + vector domain) +{ + this->id = id; + this->params = params; + this->nParams = nParams; + this->domain = domain; +} + + +Distribution::Distribution (double* params, + int nParams, + vector domain) +{ + this->id = -1; + this->params = params; + this->nParams = nParams; + this->domain = domain; +} + + + +/* +Distribution::~Distribution() +{ + delete params; + for (unsigned int i = 0; i < cptEntries.size(); i++) { + delete cptEntries[i]; + } +} +*/ + + diff --git a/packages/CLPBN/clpbn/bp/Distribution.h b/packages/CLPBN/clpbn/bp/Distribution.h new file mode 100644 index 000000000..51a540b4c --- /dev/null +++ b/packages/CLPBN/clpbn/bp/Distribution.h @@ -0,0 +1,24 @@ +#ifndef DISTRIBUTION_H +#define DISTRIBUTION_H + +#include +#include + +using namespace std; + +class CptEntry; + +class Distribution +{ + public: + Distribution (int, double*, int, vector); + Distribution (double*, int, vector); + int id; + double* params; + int nParams; + vector domain; + int* offsets; +}; + +#endif // DISTRIBUTION + diff --git a/packages/CLPBN/clpbn/bp/Horus.cpp b/packages/CLPBN/clpbn/bp/Horus.cpp new file mode 100644 index 000000000..3e8058d36 --- /dev/null +++ b/packages/CLPBN/clpbn/bp/Horus.cpp @@ -0,0 +1,125 @@ +#include +#include +#include +#include + +#include + +#include +#include +#include +#include + + +using namespace std; + +int addVariables (BayesianNetwork&, YAP_Term, int); +int addDistributions (BayesianNetwork&, YAP_Term, int); + +int createNetwork (void) +{ + BayesianNetwork* bn = new BpNetwork(); + addDistributions (*bn, YAP_ARG3, (int) YAP_IntOfTerm (YAP_ARG4)); + addVariables (*bn, YAP_ARG1, (int) YAP_IntOfTerm (YAP_ARG2)); + YAP_Int p = (YAP_Int) (bn); + return YAP_Unify (YAP_MkIntTerm (p), YAP_ARG5); +} + + + +int addVariables (BayesianNetwork& bn, YAP_Term varList, int nVars) +{ + for (int i = 0; i < nVars; i++) { + YAP_Term var = YAP_HeadOfTerm (varList); + int varId = (int) YAP_IntOfTerm (YAP_ArgOfTerm (1, var)); + int distId = (int) YAP_IntOfTerm (YAP_ArgOfTerm (2, var)); + YAP_Term parentsList = YAP_ArgOfTerm (3, var); + int nParents = (int) YAP_IntOfTerm (YAP_ArgOfTerm (4, var)); + vector parents; + for (int j = 0; j < nParents; j++) { + int parentId = (int) YAP_IntOfTerm (YAP_HeadOfTerm (parentsList)); + stringstream parentName; + parentName << parentId; + parents.push_back (bn.getNode (parentName.str())); + parentsList = YAP_TailOfTerm (parentsList); + } + stringstream nodeName; + nodeName << varId; + int evidence = (int) YAP_IntOfTerm (YAP_ArgOfTerm (5, var)); + bn.addNode (nodeName.str(), parents, evidence, distId); + varList = YAP_TailOfTerm (varList); + } + return TRUE; +} + + + +int addDistributions (BayesianNetwork& bn, YAP_Term distList, int nDists) +{ + for (int i = 0; i < nDists; i++) { + YAP_Term dist = YAP_HeadOfTerm (distList); + int distId = (int) YAP_IntOfTerm (YAP_ArgOfTerm (1, dist)); + YAP_Term domainList = YAP_ArgOfTerm (2, dist); + int domainSize = (int) YAP_IntOfTerm (YAP_ArgOfTerm (3, dist)); + vector domain (domainSize); + for (int j = 0; j < domainSize; j++) { + YAP_Atom atom = YAP_AtomOfTerm (YAP_HeadOfTerm (domainList)); + domain[j] = (char*) YAP_AtomName (atom);; + domainList = YAP_TailOfTerm (domainList); + } + YAP_Term paramsList = YAP_ArgOfTerm (4, dist); + int nParams = (int) YAP_IntOfTerm (YAP_ArgOfTerm (5, dist)); + double* params = new double [nParams]; + for (int j = 0; j < nParams; j++) { + params[j] = (double) YAP_FloatOfTerm (YAP_HeadOfTerm (paramsList)); + paramsList = YAP_TailOfTerm (paramsList); + } + bn.addDistribution (distId, params, nParams, domain); + distList = YAP_TailOfTerm (distList); + } + return TRUE; +} + + + +int runSolver (void) +{ + BpNetwork* bn = (BpNetwork*) YAP_IntOfTerm (YAP_ARG1); + YAP_Term queryVarsList = YAP_ARG2; + int nQueryVars = (int) YAP_IntOfTerm (YAP_ARG3); + vector queryVars; + for (int i = 0; i < nQueryVars; i++) { + int queryVarId = (int) YAP_IntOfTerm (YAP_HeadOfTerm (queryVarsList)); + stringstream queryVarName; + queryVarName << queryVarId; + queryVars.push_back (bn->getNode (queryVarName.str())); + queryVarsList = YAP_TailOfTerm (queryVarsList); + } + bn->runSolver (queryVars); + vector beliefs = bn->getBeliefs(); + YAP_Term beliefsList = YAP_TermNil(); + for (int i = beliefs.size() - 1; i >= 0; i--) { + YAP_Term belief = YAP_MkFloatTerm (beliefs[i]); + beliefsList = YAP_MkPairTerm (belief, beliefsList); + } + return YAP_Unify (beliefsList, YAP_ARG4); +} + + + +int freeMemory (void) +{ + BpNetwork* bn = (BpNetwork*) YAP_IntOfTerm (YAP_ARG1); + delete bn; + return TRUE; +} + + + +extern "C" void init_predicates (void) +{ + YAP_UserCPredicate ("create_network", createNetwork, 5); + YAP_UserCPredicate ("run_solver", runSolver, 4); + YAP_UserCPredicate ("free_memory", freeMemory, 1); +} + diff --git a/packages/CLPBN/clpbn/bp/Makefile b/packages/CLPBN/clpbn/bp/Makefile new file mode 100644 index 000000000..792e7954e --- /dev/null +++ b/packages/CLPBN/clpbn/bp/Makefile @@ -0,0 +1,115 @@ +# +# default base directory for YAP installation +# (EROOT for architecture-dependent files) +# +GCC = yes +prefix = /usr/local +exec_prefix = ${prefix} +ROOTDIR = $(prefix) +EROOTDIR = ${prefix} +abs_top_builddir = /home/tiago/yap +# +# where the binary should be +# +BINDIR = $(EROOTDIR)/bin +# +# where YAP should look for libraries +# +LIBDIR=${exec_prefix}/lib +YAPLIBDIR=${exec_prefix}/lib/Yap +# +# +CC=gcc +CXX=g++ +CXXFLAGS= -shared -fPIC -DBP_FREE -O3 -fomit-frame-pointer -Wall -g -O2 $(YAP_EXTRAS) $(DEFS) -D_YAP_NOT_INSTALLED_=1 -I$(srcdir) -I../../../.. -I$(srcdir)/../../../../include +# +# +# You shouldn't need to change what follows. +# +INSTALL=/usr/bin/install -c +INSTALL_DATA=${INSTALL} -m 644 +INSTALL_PROGRAM=${INSTALL} +SHELL=/bin/sh +RANLIB=ranlib +srcdir=. +SO=so +#4.1VPATH=.:./OPTYap +CWD=$(PWD) + + +HEADERS = \ + $(srcdir)/BayesianNetwork.h \ + $(srcdir)/BayesianNode.h \ + $(srcdir)/BpNetwork.h \ + $(srcdir)/BpNode.h \ + $(srcdir)/Distribution.h \ + $(srcdir)/CptEntry.h \ + $(srcdir)/BifInterface.h \ + $(srcdir)/xmlParser/xmlParser.h + +CPP_SOURCES = \ + $(srcdir)/BayesianNetwork.cpp \ + $(srcdir)/BayesianNode.cpp \ + $(srcdir)/BpNetwork.cpp \ + $(srcdir)/BpNode.cpp \ + $(srcdir)/Distribution.cpp \ + $(srcdir)/CptEntry.cpp \ + $(srcdir)/Horus.cpp \ + $(srcdir)/BifInterface.cpp \ + $(srcdir)/BifTest.cpp \ + $(srcdir)/xmlParser/xmlParser.cpp + +OBJS = \ + BayesianNetwork.o \ + BayesianNode.o \ + BpNetwork.o \ + BpNode.o \ + Distribution.o \ + CptEntry.o \ + Horus.o + +BIF_OBJS = \ + BayesianNetwork.o \ + BayesianNode.o \ + BpNetwork.o \ + BpNode.o \ + Distribution.o \ + CptEntry.o \ + BifInterface.o \ + BifTest.o \ + xmlParser/xmlParser.o + +SOBJS=horus.so + + +all: $(SOBJS) biftest + +# default rule +%.o : $(srcdir)/%.cpp + $(CXX) -c $(CXXFLAGS) $< -o $@ + +horus.so: $(OBJS) + g++ -shared -export-dynamic -o horus.so $(OBJS) + +biftest: $(BIF_OBJS) + $(CXX) -o biftest $(BIF_OBJS) + + +install: all + $(INSTALL_PROGRAM) $(SOBJS) $(DESTDIR) $(YAPLIBDIR) + + +clean: + rm -f *.o *~ $(OBJS) $(SOBJS) *.BAK biftest xmlParser/*.o + + +depend: $(HEADERS) $(CPP_SOURCES) + -@if test "$(GCC)" = yes; then\ + $(CC) -MM -MG $(CFLAGS) -I$(srcdir) -I$(srcdir)/../../../../include -I$(srcdir)/../../../../H $(CPP_SOURCES) >> Makefile;\ + else\ + makedepend -f - -- $(CFLAGS) -I$(srcdir)/../../../../H -I$(srcdir)/../../../../include -- $(CPP_SOURCES) |\ + sed 's|.*/\([^:]*\):|\1:|' >> Makefile ;\ + fi + +# DO NOT DELETE THIS LINE -- make depend depends on it. + diff --git a/packages/CLPBN/clpbn/bp/Makefile.in b/packages/CLPBN/clpbn/bp/Makefile.in new file mode 100644 index 000000000..7f98526c0 --- /dev/null +++ b/packages/CLPBN/clpbn/bp/Makefile.in @@ -0,0 +1,115 @@ +# +# default base directory for YAP installation +# (EROOT for architecture-dependent files) +# +GCC = @GCC@ +prefix = @prefix@ +exec_prefix = @exec_prefix@ +ROOTDIR = $(prefix) +EROOTDIR = @exec_prefix@ +abs_top_builddir = @abs_top_builddir@ +# +# where the binary should be +# +BINDIR = $(EROOTDIR)/bin +# +# where YAP should look for libraries +# +LIBDIR=@libdir@ +YAPLIBDIR=@libdir@/Yap +# +# +CC=@CC@ +CXX=@CXX@ +CXXFLAGS= @SHLIB_CXXFLAGS@ $(YAP_EXTRAS) $(DEFS) -D_YAP_NOT_INSTALLED_=1 -I$(srcdir) -I../../../.. -I$(srcdir)/../../../../include @CPPFLAGS@ +# +# +# You shouldn't need to change what follows. +# +INSTALL=@INSTALL@ +INSTALL_DATA=@INSTALL_DATA@ +INSTALL_PROGRAM=@INSTALL_PROGRAM@ +SHELL=/bin/sh +RANLIB=@RANLIB@ +srcdir=@srcdir@ +SO=@SO@ +#4.1VPATH=@srcdir@:@srcdir@/OPTYap +CWD=$(PWD) + + +HEADERS = \ + $(srcdir)/BayesianNetwork.h \ + $(srcdir)/BayesianNode.h \ + $(srcdir)/BpNetwork.h \ + $(srcdir)/BpNode.h \ + $(srcdir)/Distribution.h \ + $(srcdir)/CptEntry.h \ + $(srcdir)/BifInterface.h \ + $(srcdir)/xmlParser/xmlParser.h + +CPP_SOURCES = \ + $(srcdir)/BayesianNetwork.cpp \ + $(srcdir)/BayesianNode.cpp \ + $(srcdir)/BpNetwork.cpp \ + $(srcdir)/BpNode.cpp \ + $(srcdir)/Distribution.cpp \ + $(srcdir)/CptEntry.cpp \ + $(srcdir)/Horus.cpp \ + $(srcdir)/BifInterface.cpp \ + $(srcdir)/BifTest.cpp \ + $(srcdir)/xmlParser/xmlParser.cpp + +OBJS = \ + BayesianNetwork.o \ + BayesianNode.o \ + BpNetwork.o \ + BpNode.o \ + Distribution.o \ + CptEntry.o \ + Horus.o + +BIF_OBJS = \ + BayesianNetwork.o \ + BayesianNode.o \ + BpNetwork.o \ + BpNode.o \ + Distribution.o \ + CptEntry.o \ + BifInterface.o \ + BifTest.o \ + xmlParser/xmlParser.o + +SOBJS=horus.@SO@ + + +all: $(SOBJS) biftest + +# default rule +%.o : $(srcdir)/%.cpp + $(CXX) -c $(CXXFLAGS) $< -o $@ + +@DO_SECOND_LD@horus.@SO@: $(OBJS) +@DO_SECOND_LD@ @SHLIB_CXX_LD@ -o horus.@SO@ $(OBJS) + +biftest: $(BIF_OBJS) + $(CXX) -o biftest $(BIF_OBJS) + + +install: all + $(INSTALL_PROGRAM) $(SOBJS) $(DESTDIR) $(YAPLIBDIR) + + +clean: + rm -f *.o *~ $(OBJS) $(SOBJS) *.BAK biftest xmlParser/*.o + + +depend: $(HEADERS) $(CPP_SOURCES) + -@if test "$(GCC)" = yes; then\ + $(CC) -MM -MG $(CFLAGS) -I$(srcdir) -I$(srcdir)/../../../../include -I$(srcdir)/../../../../H $(CPP_SOURCES) >> Makefile;\ + else\ + makedepend -f - -- $(CFLAGS) -I$(srcdir)/../../../../H -I$(srcdir)/../../../../include -- $(CPP_SOURCES) |\ + sed 's|.*/\([^:]*\):|\1:|' >> Makefile ;\ + fi + +# DO NOT DELETE THIS LINE -- make depend depends on it. + diff --git a/packages/CLPBN/clpbn/bp/biftest b/packages/CLPBN/clpbn/bp/biftest new file mode 100755 index 000000000..51993149b Binary files /dev/null and b/packages/CLPBN/clpbn/bp/biftest differ diff --git a/packages/CLPBN/clpbn/bp/bnets/dog-net.xml b/packages/CLPBN/clpbn/bp/bnets/dog-net.xml new file mode 100644 index 000000000..74f0a0e1e --- /dev/null +++ b/packages/CLPBN/clpbn/bp/bnets/dog-net.xml @@ -0,0 +1,102 @@ + + + + + + + + + + + + + + + + + + + + +]> + + + + +Dog-Problem + + + + light-on + true + false + position = (73, 165) + + + + bowel-problem + true + false + position = (190, 69) + + + + dog-out + true + false + position = (155, 165) + + + + hear-bark + true + false + position = (154, 241) + + + + family-out + true + false + position = (112, 69) + + + + + + light-on + family-out + 0.6 0.4 0.05 0.95
+
+ + + bowel-problem + 0.01 0.99
+
+ + + dog-out + bowel-problem + family-out + 0.99 0.01 0.97 0.03 0.9 0.1 0.3 0.7
+
+ + + hear-bark + dog-out + 0.7 0.3 0.01 0.99
+
+ + + family-out + 0.15 0.85
+
+ + +
+
diff --git a/packages/CLPBN/clpbn/bp/bnets/john-mary-call.xml b/packages/CLPBN/clpbn/bp/bnets/john-mary-call.xml new file mode 100644 index 000000000..037134fc5 --- /dev/null +++ b/packages/CLPBN/clpbn/bp/bnets/john-mary-call.xml @@ -0,0 +1,106 @@ + + + + + + + + + + + + + + + + + + +]> + + + + +John-Mary-Call + + + + Burglary + discrete + False + True + position = (145, 114) + + + + Earthquake + discrete + False + True + position = (351, 110) + + + + Alarm + discrete + False + True + position = (253, 224) + + + + JohnCalls + discrete + False + True + position = (156, 343) + + + + MaryCalls + discrete + False + True + position = (344, 341) + + + + + + Burglary + 0.999 0.0010
+
+ + + Earthquake + 0.998 0.0020
+
+ + + Alarm + Burglary + Earthquake + 0.999 0.71 0.06 0.05 0.0010 0.29 0.94 0.95
+
+ + + JohnCalls + Alarm + 0.95 0.1 0.05 0.9
+
+ + + MaryCalls + Alarm + 0.99 0.3 0.01 0.7
+
+ + +
diff --git a/packages/CLPBN/clpbn/bp/bnets/more-than-2-parents-and-childs.xml b/packages/CLPBN/clpbn/bp/bnets/more-than-2-parents-and-childs.xml new file mode 100644 index 000000000..9d1794264 --- /dev/null +++ b/packages/CLPBN/clpbn/bp/bnets/more-than-2-parents-and-childs.xml @@ -0,0 +1,116 @@ + + + + +Test + + + A + a1 + a2 + + + + B + b1 + b2 + b3 + b4 + + + + C + c1 + c2 + c3 + + + + D + d1 + d2 + d3 + + + + E + e1 + e2 + e3 + e4 + + + + F + f1 + f2 + f3 + + + + G + g1 + g2 + + + + + A + .1 .2
+
+ + + B + .01 .02 .03 .04
+
+ + + C + .11 .22 .33
+
+ + + D + A + B + C + + .522 .008 .99 .01 .2 .8 .003 .457 .423 .007 .92 .04 .5 .232 .033 .227 .112 .048 .91 .21 .24 .18 .005 .227 + .212 .04 .59 .21 .6 .1 .023 .215 .913 .017 .96 .01 .55 .422 .013 .417 .272 .068 .61 .11 .26 .28 .205 .322 + .142 .028 .19 .11 .5 .67 .013 .437 .163 .067 .12 .06 .1 .262 .063 .167 .512 .028 .11 .41 .14 .68 .015 .92 +
+
+ + + E + D + + .111 .11 .1 + .222 .22 .2 + .333 .33 .3 + .444 .44 .4 +
+
+ + + F + D + + .112 .111 .110 + .223 .222 .221 + .334 .333 .332 +
+
+ + + G + D + + .101 .102 .103 + .201 .202 .203 +
+
+ +
+
+ diff --git a/packages/CLPBN/clpbn/bp/bnets/multiconnected.xml b/packages/CLPBN/clpbn/bp/bnets/multiconnected.xml new file mode 100644 index 000000000..973679408 --- /dev/null +++ b/packages/CLPBN/clpbn/bp/bnets/multiconnected.xml @@ -0,0 +1,84 @@ + + + + + + + + +Multiconnected + + + + H + h1 + h2 + + + + B + b1 + b2 + + + + L + l1 + l2 + + + + F + f1 + f2 + + + + C + c1 + c2 + + + + H + .2 .8
+
+ + + B + H + .25 .75 .05 .95
+
+ + + L + H + .003 .997 .00005 .99995
+
+ + + F + B + L + .75 .25 .1 .9 .5 .5 .05 .95
+
+ + + C + L + .6 .4 .02 .98
+
+ +
+
+ diff --git a/packages/CLPBN/clpbn/bp/bnets/multiconnected.yap b/packages/CLPBN/clpbn/bp/bnets/multiconnected.yap new file mode 100644 index 000000000..493ac7bf3 --- /dev/null +++ b/packages/CLPBN/clpbn/bp/bnets/multiconnected.yap @@ -0,0 +1,59 @@ + +:- use_module(library(clpbn)). + +:- set_clpbn_flag(solver, bp). + + +% H +% / \ +% / \ +% B L +% \ / \ +% \ / \ +% F C + + +h(H) :- + h_table(HDist), + { H = h with p([h1, h2], HDist) }. + + +b(B) :- + h(H), + b_table(BDist), + { B = b with p([b1, b2], BDist, [H]) }. + + +l(L) :- + h(H), + l_table(LDist), + { L = l with p([l1, l2], LDist, [H]) }. + + +f(F) :- + b(B), + l(L), + f_table(FDist), + { F = f with p([f1, f2], FDist, [B, L]) }. + + +c(C) :- + l(L), + c_table(CDist), + { C = c with p([c1, c2], CDist, [L]) }. + + +h_table([0.2, 0.8]). + +b_table([0.25, 0.05, + 0.75, 0.95]). + +l_table([0.003, 0.00005, + 0.997, 0.99995]). + +f_table([0.75, 0.1, 0.5, 0.05, + 0.25, 0.9, 0.5, 0.95]). + +c_table([0.6, 0.02, + 0.4, 0.98]). + diff --git a/packages/CLPBN/clpbn/bp/bnets/neapolitan.xml b/packages/CLPBN/clpbn/bp/bnets/neapolitan.xml new file mode 100644 index 000000000..b3a2e9612 --- /dev/null +++ b/packages/CLPBN/clpbn/bp/bnets/neapolitan.xml @@ -0,0 +1,52 @@ + + + + + + + +Neapolitan + + + + Burglar + b1 + b2 + + + + FreightTruck + f1 + f2 + + + + Alarm + a1 + a2 + + + + Burglar + .005 .995
+
+ + + FreightTruck + .03 .97
+
+ + + Alarm + Burglar + FreightTruck + .992 .008 .99 .01 .2 .8 .003 .997
+
+ +
+
+ diff --git a/packages/CLPBN/clpbn/bp/bnets/neapolitan.yap b/packages/CLPBN/clpbn/bp/bnets/neapolitan.yap new file mode 100644 index 000000000..7a2155931 --- /dev/null +++ b/packages/CLPBN/clpbn/bp/bnets/neapolitan.yap @@ -0,0 +1,35 @@ + +:- use_module(library(clpbn)). + +:- set_clpbn_flag(solver, bp). + + +% B F +% \ / +% \ / +% A + + +a(A) :- + b(B), + f(F), + a_table(ADist), + { A = a with p([a1, a2], ADist, [B, F]) }. + + + +b(B) :- + b_table(BDist), + { B = b with p([b1, b2], BDist) }. + +f(F) :- + f_table(FDist), + { F = f with p([f1, f2], FDist) }. + +b_table([0.005, 0.995]). + +f_table([0.03, 0.97]). + +a_table([0.992, 0.99, 0.2, 0.003, + 0.008, 0.01, 0.8, 0.997]). + diff --git a/packages/CLPBN/clpbn/bp/bnets/simple-loop.xml b/packages/CLPBN/clpbn/bp/bnets/simple-loop.xml new file mode 100644 index 000000000..f3a52a087 --- /dev/null +++ b/packages/CLPBN/clpbn/bp/bnets/simple-loop.xml @@ -0,0 +1,57 @@ + + + + +Simple Loop + + + A + a1 + a2 + + + + B + b1 + b2 + + + + C + c1 + c2 + + + + D + d1 + d2 + + + + A + .01 .09
+
+ + + B + A + .03 .97 .6 .4
+
+ + + C + A + .24 .76 .12 .88
+
+ + + D + B + C + .2 .8 .7 .3 .45 .55 .22 .78
+
+ +
+
+ diff --git a/packages/CLPBN/clpbn/bp/bnets/test.yap b/packages/CLPBN/clpbn/bp/bnets/test.yap new file mode 100644 index 000000000..d617ea5ae --- /dev/null +++ b/packages/CLPBN/clpbn/bp/bnets/test.yap @@ -0,0 +1,36 @@ + +:- use_module(library(clpbn)). + +:- set_clpbn_flag(solver, bp). + + +% B F +% \ / +% \ / +% A + + +a(A) :- + b(B), + f(F), + a_table(ADist), + { A = a with p([a1, a2, a3], ADist, [B, F]) }. + + + +b(B) :- + b_table(BDist), + { B = b with p([b1, b2], BDist) }. + +f(F) :- + f_table(FDist), + { F = f with p([f1, f2], FDist) }. + +b_table([0.005, 0.995]). + +f_table([0.03, 0.97]). + +a_table([0.992, 0.99, 0.2, 0.003, + 0.008, 0.01, 0.8, 0.997, + 0.018, 0.21, 0.2, 0.927]). + diff --git a/packages/CLPBN/clpbn/bp/out.damping.txt b/packages/CLPBN/clpbn/bp/out.damping.txt new file mode 100644 index 000000000..1955ef29f --- /dev/null +++ b/packages/CLPBN/clpbn/bp/out.damping.txt @@ -0,0 +1,21187 @@ +Variable: Burglar +Domain: b1, b2 +Parents: +Childs: Alarm +cpt +---------------- +b1 0.005 +b2 0.995 + +Variable: FreightTruck +Domain: f1, f2 +Parents: +Childs: Alarm +cpt +---------------- +f1 0.03 +f2 0.97 + +Variable: Alarm +Domain: a1, a2 +Parents: Burglar, FreightTruck +Childs: +cpt b1,f1 b1,f2 b2,f1 b2,f2 +---------------------------------------------------- +a1 0.992 0.99 0.2 0.003 +a2 0.008 0.01 0.8 0.997 + +Variable: Burglar +Domain: b1, b2 +Parents: +Childs: Alarm +cpt +---------------- +b1 0.005 +b2 0.995 + +Variable: FreightTruck +Domain: f1, f2 +Parents: +Childs: Alarm, _Jn +cpt +---------------- +f1 0.03 +f2 0.97 + +Variable: Alarm +Domain: a1, a2 +Parents: Burglar, FreightTruck +Childs: _Jn +cpt b1,f1 b1,f2 b2,f1 b2,f2 +---------------------------------------------------- +a1 0.992 0.99 0.2 0.003 +a2 0.008 0.01 0.8 0.997 + +Variable: _Jn +Domain: _jn0, _jn1, _jn2, _jn3 +Parents: FreightTruck, Alarm +Childs: +cpt f1,a1 f1,a2 f2,a1 f2,a2 +---------------------------------------------------- +_jn0 1 0 0 0 +_jn1 0 1 0 0 +_jn2 0 0 1 0 +_jn3 0 0 0 1 + +The graph is not single connected. Iterative belief propagation will be used. + +Initializing solver +-> schedule = parallel +-> max iters = 150 +-> stable threashold = 1e-20 +-> query vars = FreightTruck Alarm +domain π(Burglar) λ(Burglar) belief +---------------------------------------------------------------- +b1 1 1 0.5 +b2 1 1 0.5 + +domain πAlarm(Burglar) λAlarm(Burglar) +---------------------------------------------------------------- +b1 0.5 0.5 +b2 0.5 0.5 + +domain π(FreightTruck) λ(FreightTruck) belief +---------------------------------------------------------------- +f1 1 1 0.5 +f2 1 1 0.5 + +domain πAlarm(FreightTruck) λAlarm(FreightTruck) +---------------------------------------------------------------- +f1 0.5 0.5 +f2 0.5 0.5 + +domain π_Jn(FreightTruck) λ_Jn(FreightTruck) +---------------------------------------------------------------- +f1 0.5 0.5 +f2 0.5 0.5 + +domain π(Alarm) λ(Alarm) belief +---------------------------------------------------------------- +a1 1 1 0.5 +a2 1 1 0.5 + +domain π_Jn(Alarm) λ_Jn(Alarm) +---------------------------------------------------------------- +a1 0.5 0.5 +a2 0.5 0.5 + +domain π(_Jn) λ(_Jn) belief +---------------------------------------------------------------- +_jn0 1 1 0.25 +_jn1 1 1 0.25 +_jn2 1 1 0.25 +_jn3 1 1 0.25 + + + +******************************************************************************** + Iteration 1 +******************************************************************************** +λ message Alarm --> Burglar +λAlarm(b1) += [p(a1|b1,f1).πAlarm(f1) + p(a1|b1,f2).πAlarm(f2)].λ(a1) ++ [p(a2|b1,f1).πAlarm(f1) + p(a2|b1,f2).πAlarm(f2)].λ(a2) += [(0.992x0.5) + (0.99x0.5)]x1 ++ [(0.008x0.5) + (0.01x0.5)]x1 = 1 +λAlarm(b2) += [p(a1|b2,f1).πAlarm(f1) + p(a1|b2,f2).πAlarm(f2)].λ(a1) ++ [p(a2|b2,f1).πAlarm(f1) + p(a2|b2,f2).πAlarm(f2)].λ(a2) += [(0.2x0.5) + (0.003x0.5)]x1 ++ [(0.8x0.5) + (0.997x0.5)]x1 = 1 + +λ message Alarm --> FreightTruck +λAlarm(f1) += [p(a1|b1,f1).πAlarm(b1) + p(a1|b2,f1).πAlarm(b2)].λ(a1) ++ [p(a2|b1,f1).πAlarm(b1) + p(a2|b2,f1).πAlarm(b2)].λ(a2) += [(0.992x0.5) + (0.2x0.5)]x1 ++ [(0.008x0.5) + (0.8x0.5)]x1 = 1 +λAlarm(f2) += [p(a1|b1,f2).πAlarm(b1) + p(a1|b2,f2).πAlarm(b2)].λ(a1) ++ [p(a2|b1,f2).πAlarm(b1) + p(a2|b2,f2).πAlarm(b2)].λ(a2) += [(0.99x0.5) + (0.003x0.5)]x1 ++ [(0.01x0.5) + (0.997x0.5)]x1 = 1 + +λ message _Jn --> FreightTruck +λ_Jn(f1) += [p(_jn0|f1,a1).π_Jn(a1) + p(_jn0|f1,a2).π_Jn(a2)].λ(_jn0) ++ [p(_jn1|f1,a1).π_Jn(a1) + p(_jn1|f1,a2).π_Jn(a2)].λ(_jn1) ++ [p(_jn2|f1,a1).π_Jn(a1) + p(_jn2|f1,a2).π_Jn(a2)].λ(_jn2) ++ [p(_jn3|f1,a1).π_Jn(a1) + p(_jn3|f1,a2).π_Jn(a2)].λ(_jn3) += [(1x0.5) + (0x0.5)]x1 ++ [(0x0.5) + (1x0.5)]x1 ++ [(0x0.5) + (0x0.5)]x1 ++ [(0x0.5) + (0x0.5)]x1 = 1 +λ_Jn(f2) += [p(_jn0|f2,a1).π_Jn(a1) + p(_jn0|f2,a2).π_Jn(a2)].λ(_jn0) ++ [p(_jn1|f2,a1).π_Jn(a1) + p(_jn1|f2,a2).π_Jn(a2)].λ(_jn1) ++ [p(_jn2|f2,a1).π_Jn(a1) + p(_jn2|f2,a2).π_Jn(a2)].λ(_jn2) ++ [p(_jn3|f2,a1).π_Jn(a1) + p(_jn3|f2,a2).π_Jn(a2)].λ(_jn3) += [(0x0.5) + (0x0.5)]x1 ++ [(0x0.5) + (0x0.5)]x1 ++ [(1x0.5) + (0x0.5)]x1 ++ [(0x0.5) + (1x0.5)]x1 = 1 + +λ message _Jn --> Alarm +λ_Jn(a1) += [p(_jn0|f1,a1).π_Jn(f1) + p(_jn0|f2,a1).π_Jn(f2)].λ(_jn0) ++ [p(_jn1|f1,a1).π_Jn(f1) + p(_jn1|f2,a1).π_Jn(f2)].λ(_jn1) ++ [p(_jn2|f1,a1).π_Jn(f1) + p(_jn2|f2,a1).π_Jn(f2)].λ(_jn2) ++ [p(_jn3|f1,a1).π_Jn(f1) + p(_jn3|f2,a1).π_Jn(f2)].λ(_jn3) += [(1x0.5) + (0x0.5)]x1 ++ [(0x0.5) + (0x0.5)]x1 ++ [(0x0.5) + (1x0.5)]x1 ++ [(0x0.5) + (0x0.5)]x1 = 1 +λ_Jn(a2) += [p(_jn0|f1,a2).π_Jn(f1) + p(_jn0|f2,a2).π_Jn(f2)].λ(_jn0) ++ [p(_jn1|f1,a2).π_Jn(f1) + p(_jn1|f2,a2).π_Jn(f2)].λ(_jn1) ++ [p(_jn2|f1,a2).π_Jn(f1) + p(_jn2|f2,a2).π_Jn(f2)].λ(_jn2) ++ [p(_jn3|f1,a2).π_Jn(f1) + p(_jn3|f2,a2).π_Jn(f2)].λ(_jn3) += [(0x0.5) + (0x0.5)]x1 ++ [(1x0.5) + (0x0.5)]x1 ++ [(0x0.5) + (0x0.5)]x1 ++ [(0x0.5) + (1x0.5)]x1 = 1 + +π message Burglar --> Alarm +πAlarm(b1) = π(b1) = 0.005 = 0.005 +πAlarm(b2) = π(b2) = 0.995 = 0.995 + +π message FreightTruck --> Alarm +πAlarm(f1) = π(f1).λ_Jn(f1) = 0.03 x 0.5 = 0.015 +πAlarm(f2) = π(f2).λ_Jn(f2) = 0.97 x 0.5 = 0.485 + +π message FreightTruck --> _Jn +π_Jn(f1) = π(f1).λAlarm(f1) = 0.03 x 0.5 = 0.015 +π_Jn(f2) = π(f2).λAlarm(f2) = 0.97 x 0.5 = 0.485 + +π message Alarm --> _Jn +π_Jn(a1) = π(a1) = 1 = 1 +π_Jn(a2) = π(a2) = 1 = 1 + +var Burglar: +π(b1) += p(b1) += (0.005) = 0.005 +π(b2) += p(b2) += (0.995) = 0.995 +λ(b1) = λAlarm(b1) = 0.5 = 0.5 +λ(b2) = λAlarm(b2) = 0.5 = 0.5 +belief change = 1 + +var FreightTruck: +π(f1) += p(f1) += (0.03) = 0.03 +π(f2) += p(f2) += (0.97) = 0.97 +λ(f1) = λAlarm(f1).λ_Jn(f1) = 0.5 x 0.5 = 0.25 +λ(f2) = λAlarm(f2).λ_Jn(f2) = 0.5 x 0.5 = 0.25 +belief change = 1 + +var Alarm: +π(a1) += p(a1|b1,f1).πAlarm(b1).πAlarm(f1) ++ p(a1|b1,f2).πAlarm(b1).πAlarm(f2) ++ p(a1|b2,f1).πAlarm(b2).πAlarm(f1) ++ p(a1|b2,f2).πAlarm(b2).πAlarm(f2) += (0.992x0.2525x0.343333) ++ (0.99x0.2525x0.656667) ++ (0.2x0.7475x0.343333) ++ (0.003x0.7475x0.656667) = 0.3029492917 +π(a2) += p(a2|b1,f1).πAlarm(b1).πAlarm(f1) ++ p(a2|b1,f2).πAlarm(b1).πAlarm(f2) ++ p(a2|b2,f1).πAlarm(b2).πAlarm(f1) ++ p(a2|b2,f2).πAlarm(b2).πAlarm(f2) += (0.008x0.2525x0.343333) ++ (0.01x0.2525x0.656667) ++ (0.8x0.7475x0.343333) ++ (0.997x0.7475x0.656667) = 0.6970507083 +λ(a1) = λ_Jn(a1) = 0.5 = 0.5 +λ(a2) = λ_Jn(a2) = 0.5 = 0.5 +belief change = 1 + +var _Jn: +π(_jn0) += p(_jn0|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn0|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn0|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn0|f2,a2).π_Jn(f2).π_Jn(a2) += (1x0.343333x0.5) ++ (0x0.343333x0.5) ++ (0x0.656667x0.5) ++ (0x0.656667x0.5) = 0.1716666667 +π(_jn1) += p(_jn1|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn1|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn1|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn1|f2,a2).π_Jn(f2).π_Jn(a2) += (0x0.343333x0.5) ++ (1x0.343333x0.5) ++ (0x0.656667x0.5) ++ (0x0.656667x0.5) = 0.1716666667 +π(_jn2) += p(_jn2|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn2|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn2|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn2|f2,a2).π_Jn(f2).π_Jn(a2) += (0x0.343333x0.5) ++ (0x0.343333x0.5) ++ (1x0.656667x0.5) ++ (0x0.656667x0.5) = 0.3283333333 +π(_jn3) += p(_jn3|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn3|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn3|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn3|f2,a2).π_Jn(f2).π_Jn(a2) += (0x0.343333x0.5) ++ (0x0.343333x0.5) ++ (0x0.656667x0.5) ++ (1x0.656667x0.5) = 0.3283333333 +λ(_jn0) = 1 +λ(_jn1) = 1 +λ(_jn2) = 1 +λ(_jn3) = 1 +belief change = 1 + +domain π(Burglar) λ(Burglar) belief +---------------------------------------------------------------- +b1 0.005 0.5 0.005 +b2 0.995 0.5 0.995 + +domain πAlarm(Burglar) λAlarm(Burglar) +---------------------------------------------------------------- +b1 0.2525 0.5 +b2 0.7475 0.5 + +domain π(FreightTruck) λ(FreightTruck) belief +---------------------------------------------------------------- +f1 0.03 0.25 0.03 +f2 0.97 0.25 0.97 + +domain πAlarm(FreightTruck) λAlarm(FreightTruck) +---------------------------------------------------------------- +f1 0.3433333333 0.5 +f2 0.6566666667 0.5 + +domain π_Jn(FreightTruck) λ_Jn(FreightTruck) +---------------------------------------------------------------- +f1 0.3433333333 0.5 +f2 0.6566666667 0.5 + +domain π(Alarm) λ(Alarm) belief +---------------------------------------------------------------- +a1 0.3029492917 0.5 0.3029492917 +a2 0.6970507083 0.5 0.6970507083 + +domain π_Jn(Alarm) λ_Jn(Alarm) +---------------------------------------------------------------- +a1 0.5 0.5 +a2 0.5 0.5 + +domain π(_Jn) λ(_Jn) belief +---------------------------------------------------------------- +_jn0 0.1716666667 1 0.1716666667 +_jn1 0.1716666667 1 0.1716666667 +_jn2 0.3283333333 1 0.3283333333 +_jn3 0.3283333333 1 0.3283333333 + + + +******************************************************************************** + Iteration 2 +******************************************************************************** +λ message Alarm --> Burglar +λAlarm(b1) += [p(a1|b1,f1).πAlarm(f1) + p(a1|b1,f2).πAlarm(f2)].λ(a1) ++ [p(a2|b1,f1).πAlarm(f1) + p(a2|b1,f2).πAlarm(f2)].λ(a2) += [(0.992x0.343333) + (0.99x0.656667)]x0.5 ++ [(0.008x0.343333) + (0.01x0.656667)]x0.5 = 0.5 +λAlarm(b2) += [p(a1|b2,f1).πAlarm(f1) + p(a1|b2,f2).πAlarm(f2)].λ(a1) ++ [p(a2|b2,f1).πAlarm(f1) + p(a2|b2,f2).πAlarm(f2)].λ(a2) += [(0.2x0.343333) + (0.003x0.656667)]x0.5 ++ [(0.8x0.343333) + (0.997x0.656667)]x0.5 = 0.5 + +λ message Alarm --> FreightTruck +λAlarm(f1) += [p(a1|b1,f1).πAlarm(b1) + p(a1|b2,f1).πAlarm(b2)].λ(a1) ++ [p(a2|b1,f1).πAlarm(b1) + p(a2|b2,f1).πAlarm(b2)].λ(a2) += [(0.992x0.2525) + (0.2x0.7475)]x0.5 ++ [(0.008x0.2525) + (0.8x0.7475)]x0.5 = 0.5 +λAlarm(f2) += [p(a1|b1,f2).πAlarm(b1) + p(a1|b2,f2).πAlarm(b2)].λ(a1) ++ [p(a2|b1,f2).πAlarm(b1) + p(a2|b2,f2).πAlarm(b2)].λ(a2) += [(0.99x0.2525) + (0.003x0.7475)]x0.5 ++ [(0.01x0.2525) + (0.997x0.7475)]x0.5 = 0.5 + +λ message _Jn --> FreightTruck +λ_Jn(f1) += [p(_jn0|f1,a1).π_Jn(a1) + p(_jn0|f1,a2).π_Jn(a2)].λ(_jn0) ++ [p(_jn1|f1,a1).π_Jn(a1) + p(_jn1|f1,a2).π_Jn(a2)].λ(_jn1) ++ [p(_jn2|f1,a1).π_Jn(a1) + p(_jn2|f1,a2).π_Jn(a2)].λ(_jn2) ++ [p(_jn3|f1,a1).π_Jn(a1) + p(_jn3|f1,a2).π_Jn(a2)].λ(_jn3) += [(1x0.5) + (0x0.5)]x1 ++ [(0x0.5) + (1x0.5)]x1 ++ [(0x0.5) + (0x0.5)]x1 ++ [(0x0.5) + (0x0.5)]x1 = 1 +λ_Jn(f2) += [p(_jn0|f2,a1).π_Jn(a1) + p(_jn0|f2,a2).π_Jn(a2)].λ(_jn0) ++ [p(_jn1|f2,a1).π_Jn(a1) + p(_jn1|f2,a2).π_Jn(a2)].λ(_jn1) ++ [p(_jn2|f2,a1).π_Jn(a1) + p(_jn2|f2,a2).π_Jn(a2)].λ(_jn2) ++ [p(_jn3|f2,a1).π_Jn(a1) + p(_jn3|f2,a2).π_Jn(a2)].λ(_jn3) += [(0x0.5) + (0x0.5)]x1 ++ [(0x0.5) + (0x0.5)]x1 ++ [(1x0.5) + (0x0.5)]x1 ++ [(0x0.5) + (1x0.5)]x1 = 1 + +λ message _Jn --> Alarm +λ_Jn(a1) += [p(_jn0|f1,a1).π_Jn(f1) + p(_jn0|f2,a1).π_Jn(f2)].λ(_jn0) ++ [p(_jn1|f1,a1).π_Jn(f1) + p(_jn1|f2,a1).π_Jn(f2)].λ(_jn1) ++ [p(_jn2|f1,a1).π_Jn(f1) + p(_jn2|f2,a1).π_Jn(f2)].λ(_jn2) ++ [p(_jn3|f1,a1).π_Jn(f1) + p(_jn3|f2,a1).π_Jn(f2)].λ(_jn3) += [(1x0.343333) + (0x0.656667)]x1 ++ [(0x0.343333) + (0x0.656667)]x1 ++ [(0x0.343333) + (1x0.656667)]x1 ++ [(0x0.343333) + (0x0.656667)]x1 = 1 +λ_Jn(a2) += [p(_jn0|f1,a2).π_Jn(f1) + p(_jn0|f2,a2).π_Jn(f2)].λ(_jn0) ++ [p(_jn1|f1,a2).π_Jn(f1) + p(_jn1|f2,a2).π_Jn(f2)].λ(_jn1) ++ [p(_jn2|f1,a2).π_Jn(f1) + p(_jn2|f2,a2).π_Jn(f2)].λ(_jn2) ++ [p(_jn3|f1,a2).π_Jn(f1) + p(_jn3|f2,a2).π_Jn(f2)].λ(_jn3) += [(0x0.343333) + (0x0.656667)]x1 ++ [(1x0.343333) + (0x0.656667)]x1 ++ [(0x0.343333) + (0x0.656667)]x1 ++ [(0x0.343333) + (1x0.656667)]x1 = 1 + +π message Burglar --> Alarm +πAlarm(b1) = π(b1) = 0.005 = 0.005 +πAlarm(b2) = π(b2) = 0.995 = 0.995 + +π message FreightTruck --> Alarm +πAlarm(f1) = π(f1).λ_Jn(f1) = 0.03 x 0.5 = 0.015 +πAlarm(f2) = π(f2).λ_Jn(f2) = 0.97 x 0.5 = 0.485 + +π message FreightTruck --> _Jn +π_Jn(f1) = π(f1).λAlarm(f1) = 0.03 x 0.5 = 0.015 +π_Jn(f2) = π(f2).λAlarm(f2) = 0.97 x 0.5 = 0.485 + +π message Alarm --> _Jn +π_Jn(a1) = π(a1) = 0.302949 = 0.3029492917 +π_Jn(a2) = π(a2) = 0.697051 = 0.6970507083 + +var Burglar: +π(b1) += p(b1) += (0.005) = 0.005 +π(b2) += p(b2) += (0.995) = 0.995 +λ(b1) = λAlarm(b1) = 0.5 = 0.5 +λ(b2) = λAlarm(b2) = 0.5 = 0.5 +belief change = 8.67361738e-19 + +var FreightTruck: +π(f1) += p(f1) += (0.03) = 0.03 +π(f2) += p(f2) += (0.97) = 0.97 +λ(f1) = λAlarm(f1).λ_Jn(f1) = 0.5 x 0.5 = 0.25 +λ(f2) = λAlarm(f2).λ_Jn(f2) = 0.5 x 0.5 = 0.25 +belief change = 0 + +var Alarm: +π(a1) += p(a1|b1,f1).πAlarm(b1).πAlarm(f1) ++ p(a1|b1,f2).πAlarm(b1).πAlarm(f2) ++ p(a1|b2,f1).πAlarm(b2).πAlarm(f1) ++ p(a1|b2,f2).πAlarm(b2).πAlarm(f2) += (0.992x0.12875x0.238889) ++ (0.99x0.12875x0.761111) ++ (0.2x0.87125x0.238889) ++ (0.003x0.87125x0.761111) = 0.1711397569 +π(a2) += p(a2|b1,f1).πAlarm(b1).πAlarm(f1) ++ p(a2|b1,f2).πAlarm(b1).πAlarm(f2) ++ p(a2|b2,f1).πAlarm(b2).πAlarm(f1) ++ p(a2|b2,f2).πAlarm(b2).πAlarm(f2) += (0.008x0.12875x0.238889) ++ (0.01x0.12875x0.761111) ++ (0.8x0.87125x0.238889) ++ (0.997x0.87125x0.761111) = 0.8288602431 +λ(a1) = λ_Jn(a1) = 0.5 = 0.5 +λ(a2) = λ_Jn(a2) = 0.5 = 0.5 +belief change = 0.2636190694 + +var _Jn: +π(_jn0) += p(_jn0|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn0|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn0|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn0|f2,a2).π_Jn(f2).π_Jn(a2) += (1x0.238889x0.401475) ++ (0x0.238889x0.598525) ++ (0x0.761111x0.401475) ++ (0x0.761111x0.598525) = 0.09590783206 +π(_jn1) += p(_jn1|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn1|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn1|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn1|f2,a2).π_Jn(f2).π_Jn(a2) += (0x0.238889x0.401475) ++ (1x0.238889x0.598525) ++ (0x0.761111x0.401475) ++ (0x0.761111x0.598525) = 0.1429810568 +π(_jn2) += p(_jn2|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn2|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn2|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn2|f2,a2).π_Jn(f2).π_Jn(a2) += (0x0.238889x0.401475) ++ (0x0.238889x0.598525) ++ (1x0.761111x0.401475) ++ (0x0.761111x0.598525) = 0.3055668138 +π(_jn3) += p(_jn3|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn3|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn3|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn3|f2,a2).π_Jn(f2).π_Jn(a2) += (0x0.238889x0.401475) ++ (0x0.238889x0.598525) ++ (0x0.761111x0.401475) ++ (1x0.761111x0.598525) = 0.4555442973 +λ(_jn0) = 1 +λ(_jn1) = 1 +λ(_jn2) = 1 +λ(_jn3) = 1 +belief change = 0.254421928 + +domain π(Burglar) λ(Burglar) belief +---------------------------------------------------------------- +b1 0.005 0.5 0.005 +b2 0.995 0.5 0.995 + +domain πAlarm(Burglar) λAlarm(Burglar) +---------------------------------------------------------------- +b1 0.12875 0.5 +b2 0.87125 0.5 + +domain π(FreightTruck) λ(FreightTruck) belief +---------------------------------------------------------------- +f1 0.03 0.25 0.03 +f2 0.97 0.25 0.97 + +domain πAlarm(FreightTruck) λAlarm(FreightTruck) +---------------------------------------------------------------- +f1 0.2388888889 0.5 +f2 0.7611111111 0.5 + +domain π_Jn(FreightTruck) λ_Jn(FreightTruck) +---------------------------------------------------------------- +f1 0.2388888889 0.5 +f2 0.7611111111 0.5 + +domain π(Alarm) λ(Alarm) belief +---------------------------------------------------------------- +a1 0.1711397569 0.5 0.1711397569 +a2 0.8288602431 0.5 0.8288602431 + +domain π_Jn(Alarm) λ_Jn(Alarm) +---------------------------------------------------------------- +a1 0.4014746458 0.5 +a2 0.5985253542 0.5 + +domain π(_Jn) λ(_Jn) belief +---------------------------------------------------------------- +_jn0 0.09590783206 1 0.09590783206 +_jn1 0.1429810568 1 0.1429810568 +_jn2 0.3055668138 1 0.3055668138 +_jn3 0.4555442973 1 0.4555442973 + + + +******************************************************************************** + Iteration 3 +******************************************************************************** +λ message Alarm --> Burglar +λAlarm(b1) += [p(a1|b1,f1).πAlarm(f1) + p(a1|b1,f2).πAlarm(f2)].λ(a1) ++ [p(a2|b1,f1).πAlarm(f1) + p(a2|b1,f2).πAlarm(f2)].λ(a2) += [(0.992x0.238889) + (0.99x0.761111)]x0.5 ++ [(0.008x0.238889) + (0.01x0.761111)]x0.5 = 0.5 +λAlarm(b2) += [p(a1|b2,f1).πAlarm(f1) + p(a1|b2,f2).πAlarm(f2)].λ(a1) ++ [p(a2|b2,f1).πAlarm(f1) + p(a2|b2,f2).πAlarm(f2)].λ(a2) += [(0.2x0.238889) + (0.003x0.761111)]x0.5 ++ [(0.8x0.238889) + (0.997x0.761111)]x0.5 = 0.5 + +λ message Alarm --> FreightTruck +λAlarm(f1) += [p(a1|b1,f1).πAlarm(b1) + p(a1|b2,f1).πAlarm(b2)].λ(a1) ++ [p(a2|b1,f1).πAlarm(b1) + p(a2|b2,f1).πAlarm(b2)].λ(a2) += [(0.992x0.12875) + (0.2x0.87125)]x0.5 ++ [(0.008x0.12875) + (0.8x0.87125)]x0.5 = 0.5 +λAlarm(f2) += [p(a1|b1,f2).πAlarm(b1) + p(a1|b2,f2).πAlarm(b2)].λ(a1) ++ [p(a2|b1,f2).πAlarm(b1) + p(a2|b2,f2).πAlarm(b2)].λ(a2) += [(0.99x0.12875) + (0.003x0.87125)]x0.5 ++ [(0.01x0.12875) + (0.997x0.87125)]x0.5 = 0.5 + +λ message _Jn --> FreightTruck +λ_Jn(f1) += [p(_jn0|f1,a1).π_Jn(a1) + p(_jn0|f1,a2).π_Jn(a2)].λ(_jn0) ++ [p(_jn1|f1,a1).π_Jn(a1) + p(_jn1|f1,a2).π_Jn(a2)].λ(_jn1) ++ [p(_jn2|f1,a1).π_Jn(a1) + p(_jn2|f1,a2).π_Jn(a2)].λ(_jn2) ++ [p(_jn3|f1,a1).π_Jn(a1) + p(_jn3|f1,a2).π_Jn(a2)].λ(_jn3) += [(1x0.401475) + (0x0.598525)]x1 ++ [(0x0.401475) + (1x0.598525)]x1 ++ [(0x0.401475) + (0x0.598525)]x1 ++ [(0x0.401475) + (0x0.598525)]x1 = 1 +λ_Jn(f2) += [p(_jn0|f2,a1).π_Jn(a1) + p(_jn0|f2,a2).π_Jn(a2)].λ(_jn0) ++ [p(_jn1|f2,a1).π_Jn(a1) + p(_jn1|f2,a2).π_Jn(a2)].λ(_jn1) ++ [p(_jn2|f2,a1).π_Jn(a1) + p(_jn2|f2,a2).π_Jn(a2)].λ(_jn2) ++ [p(_jn3|f2,a1).π_Jn(a1) + p(_jn3|f2,a2).π_Jn(a2)].λ(_jn3) += [(0x0.401475) + (0x0.598525)]x1 ++ [(0x0.401475) + (0x0.598525)]x1 ++ [(1x0.401475) + (0x0.598525)]x1 ++ [(0x0.401475) + (1x0.598525)]x1 = 1 + +λ message _Jn --> Alarm +λ_Jn(a1) += [p(_jn0|f1,a1).π_Jn(f1) + p(_jn0|f2,a1).π_Jn(f2)].λ(_jn0) ++ [p(_jn1|f1,a1).π_Jn(f1) + p(_jn1|f2,a1).π_Jn(f2)].λ(_jn1) ++ [p(_jn2|f1,a1).π_Jn(f1) + p(_jn2|f2,a1).π_Jn(f2)].λ(_jn2) ++ [p(_jn3|f1,a1).π_Jn(f1) + p(_jn3|f2,a1).π_Jn(f2)].λ(_jn3) += [(1x0.238889) + (0x0.761111)]x1 ++ [(0x0.238889) + (0x0.761111)]x1 ++ [(0x0.238889) + (1x0.761111)]x1 ++ [(0x0.238889) + (0x0.761111)]x1 = 1 +λ_Jn(a2) += [p(_jn0|f1,a2).π_Jn(f1) + p(_jn0|f2,a2).π_Jn(f2)].λ(_jn0) ++ [p(_jn1|f1,a2).π_Jn(f1) + p(_jn1|f2,a2).π_Jn(f2)].λ(_jn1) ++ [p(_jn2|f1,a2).π_Jn(f1) + p(_jn2|f2,a2).π_Jn(f2)].λ(_jn2) ++ [p(_jn3|f1,a2).π_Jn(f1) + p(_jn3|f2,a2).π_Jn(f2)].λ(_jn3) += [(0x0.238889) + (0x0.761111)]x1 ++ [(1x0.238889) + (0x0.761111)]x1 ++ [(0x0.238889) + (0x0.761111)]x1 ++ [(0x0.238889) + (1x0.761111)]x1 = 1 + +π message Burglar --> Alarm +πAlarm(b1) = π(b1) = 0.005 = 0.005 +πAlarm(b2) = π(b2) = 0.995 = 0.995 + +π message FreightTruck --> Alarm +πAlarm(f1) = π(f1).λ_Jn(f1) = 0.03 x 0.5 = 0.015 +πAlarm(f2) = π(f2).λ_Jn(f2) = 0.97 x 0.5 = 0.485 + +π message FreightTruck --> _Jn +π_Jn(f1) = π(f1).λAlarm(f1) = 0.03 x 0.5 = 0.015 +π_Jn(f2) = π(f2).λAlarm(f2) = 0.97 x 0.5 = 0.485 + +π message Alarm --> _Jn +π_Jn(a1) = π(a1) = 0.17114 = 0.1711397569 +π_Jn(a2) = π(a2) = 0.82886 = 0.8288602431 + +var Burglar: +π(b1) += p(b1) += (0.005) = 0.005 +π(b2) += p(b2) += (0.995) = 0.995 +λ(b1) = λAlarm(b1) = 0.5 = 0.5 +λ(b2) = λAlarm(b2) = 0.5 = 0.5 +belief change = 8.67361738e-19 + +var FreightTruck: +π(f1) += p(f1) += (0.03) = 0.03 +π(f2) += p(f2) += (0.97) = 0.97 +λ(f1) = λAlarm(f1).λ_Jn(f1) = 0.5 x 0.5 = 0.25 +λ(f2) = λAlarm(f2).λ_Jn(f2) = 0.5 x 0.5 = 0.25 +belief change = 0 + +var Alarm: +π(a1) += p(a1|b1,f1).πAlarm(b1).πAlarm(f1) ++ p(a1|b1,f2).πAlarm(b1).πAlarm(f2) ++ p(a1|b2,f1).πAlarm(b2).πAlarm(f1) ++ p(a1|b2,f2).πAlarm(b2).πAlarm(f2) += (0.992x0.066875x0.169259) ++ (0.99x0.066875x0.830741) ++ (0.2x0.933125x0.169259) ++ (0.003x0.933125x0.830741) = 0.1001424525 +π(a2) += p(a2|b1,f1).πAlarm(b1).πAlarm(f1) ++ p(a2|b1,f2).πAlarm(b1).πAlarm(f2) ++ p(a2|b2,f1).πAlarm(b2).πAlarm(f1) ++ p(a2|b2,f2).πAlarm(b2).πAlarm(f2) += (0.008x0.066875x0.169259) ++ (0.01x0.066875x0.830741) ++ (0.8x0.933125x0.169259) ++ (0.997x0.933125x0.830741) = 0.8998575475 +λ(a1) = λ_Jn(a1) = 0.5 = 0.5 +λ(a2) = λ_Jn(a2) = 0.5 = 0.5 +belief change = 0.1419946088 + +var _Jn: +π(_jn0) += p(_jn0|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn0|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn0|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn0|f2,a2).π_Jn(f2).π_Jn(a2) += (1x0.169259x0.286307) ++ (0x0.169259x0.713693) ++ (0x0.830741x0.286307) ++ (0x0.830741x0.713693) = 0.04846014483 +π(_jn1) += p(_jn1|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn1|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn1|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn1|f2,a2).π_Jn(f2).π_Jn(a2) += (0x0.169259x0.286307) ++ (1x0.169259x0.713693) ++ (0x0.830741x0.286307) ++ (0x0.830741x0.713693) = 0.1207991144 +π(_jn2) += p(_jn2|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn2|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn2|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn2|f2,a2).π_Jn(f2).π_Jn(a2) += (0x0.169259x0.286307) ++ (0x0.169259x0.713693) ++ (1x0.830741x0.286307) ++ (0x0.830741x0.713693) = 0.2378470566 +π(_jn3) += p(_jn3|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn3|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn3|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn3|f2,a2).π_Jn(f2).π_Jn(a2) += (0x0.169259x0.286307) ++ (0x0.169259x0.713693) ++ (0x0.830741x0.286307) ++ (1x0.830741x0.713693) = 0.5928936842 +λ(_jn0) = 1 +λ(_jn1) = 1 +λ(_jn2) = 1 +λ(_jn3) = 1 +belief change = 0.2746987737 + +domain π(Burglar) λ(Burglar) belief +---------------------------------------------------------------- +b1 0.005 0.5 0.005 +b2 0.995 0.5 0.995 + +domain πAlarm(Burglar) λAlarm(Burglar) +---------------------------------------------------------------- +b1 0.066875 0.5 +b2 0.933125 0.5 + +domain π(FreightTruck) λ(FreightTruck) belief +---------------------------------------------------------------- +f1 0.03 0.25 0.03 +f2 0.97 0.25 0.97 + +domain πAlarm(FreightTruck) λAlarm(FreightTruck) +---------------------------------------------------------------- +f1 0.1692592593 0.5 +f2 0.8307407407 0.5 + +domain π_Jn(FreightTruck) λ_Jn(FreightTruck) +---------------------------------------------------------------- +f1 0.1692592593 0.5 +f2 0.8307407407 0.5 + +domain π(Alarm) λ(Alarm) belief +---------------------------------------------------------------- +a1 0.1001424525 0.5 0.1001424525 +a2 0.8998575475 0.5 0.8998575475 + +domain π_Jn(Alarm) λ_Jn(Alarm) +---------------------------------------------------------------- +a1 0.2863072014 0.5 +a2 0.7136927986 0.5 + +domain π(_Jn) λ(_Jn) belief +---------------------------------------------------------------- +_jn0 0.04846014483 1 0.04846014483 +_jn1 0.1207991144 1 0.1207991144 +_jn2 0.2378470566 1 0.2378470566 +_jn3 0.5928936842 1 0.5928936842 + + + +******************************************************************************** + Iteration 4 +******************************************************************************** +λ message Alarm --> Burglar +λAlarm(b1) += [p(a1|b1,f1).πAlarm(f1) + p(a1|b1,f2).πAlarm(f2)].λ(a1) ++ [p(a2|b1,f1).πAlarm(f1) + p(a2|b1,f2).πAlarm(f2)].λ(a2) += [(0.992x0.169259) + (0.99x0.830741)]x0.5 ++ [(0.008x0.169259) + (0.01x0.830741)]x0.5 = 0.5 +λAlarm(b2) += [p(a1|b2,f1).πAlarm(f1) + p(a1|b2,f2).πAlarm(f2)].λ(a1) ++ [p(a2|b2,f1).πAlarm(f1) + p(a2|b2,f2).πAlarm(f2)].λ(a2) += [(0.2x0.169259) + (0.003x0.830741)]x0.5 ++ [(0.8x0.169259) + (0.997x0.830741)]x0.5 = 0.5 + +λ message Alarm --> FreightTruck +λAlarm(f1) += [p(a1|b1,f1).πAlarm(b1) + p(a1|b2,f1).πAlarm(b2)].λ(a1) ++ [p(a2|b1,f1).πAlarm(b1) + p(a2|b2,f1).πAlarm(b2)].λ(a2) += [(0.992x0.066875) + (0.2x0.933125)]x0.5 ++ [(0.008x0.066875) + (0.8x0.933125)]x0.5 = 0.5 +λAlarm(f2) += [p(a1|b1,f2).πAlarm(b1) + p(a1|b2,f2).πAlarm(b2)].λ(a1) ++ [p(a2|b1,f2).πAlarm(b1) + p(a2|b2,f2).πAlarm(b2)].λ(a2) += [(0.99x0.066875) + (0.003x0.933125)]x0.5 ++ [(0.01x0.066875) + (0.997x0.933125)]x0.5 = 0.5 + +λ message _Jn --> FreightTruck +λ_Jn(f1) += [p(_jn0|f1,a1).π_Jn(a1) + p(_jn0|f1,a2).π_Jn(a2)].λ(_jn0) ++ [p(_jn1|f1,a1).π_Jn(a1) + p(_jn1|f1,a2).π_Jn(a2)].λ(_jn1) ++ [p(_jn2|f1,a1).π_Jn(a1) + p(_jn2|f1,a2).π_Jn(a2)].λ(_jn2) ++ [p(_jn3|f1,a1).π_Jn(a1) + p(_jn3|f1,a2).π_Jn(a2)].λ(_jn3) += [(1x0.286307) + (0x0.713693)]x1 ++ [(0x0.286307) + (1x0.713693)]x1 ++ [(0x0.286307) + (0x0.713693)]x1 ++ [(0x0.286307) + (0x0.713693)]x1 = 1 +λ_Jn(f2) += [p(_jn0|f2,a1).π_Jn(a1) + p(_jn0|f2,a2).π_Jn(a2)].λ(_jn0) ++ [p(_jn1|f2,a1).π_Jn(a1) + p(_jn1|f2,a2).π_Jn(a2)].λ(_jn1) ++ [p(_jn2|f2,a1).π_Jn(a1) + p(_jn2|f2,a2).π_Jn(a2)].λ(_jn2) ++ [p(_jn3|f2,a1).π_Jn(a1) + p(_jn3|f2,a2).π_Jn(a2)].λ(_jn3) += [(0x0.286307) + (0x0.713693)]x1 ++ [(0x0.286307) + (0x0.713693)]x1 ++ [(1x0.286307) + (0x0.713693)]x1 ++ [(0x0.286307) + (1x0.713693)]x1 = 1 + +λ message _Jn --> Alarm +λ_Jn(a1) += [p(_jn0|f1,a1).π_Jn(f1) + p(_jn0|f2,a1).π_Jn(f2)].λ(_jn0) ++ [p(_jn1|f1,a1).π_Jn(f1) + p(_jn1|f2,a1).π_Jn(f2)].λ(_jn1) ++ [p(_jn2|f1,a1).π_Jn(f1) + p(_jn2|f2,a1).π_Jn(f2)].λ(_jn2) ++ [p(_jn3|f1,a1).π_Jn(f1) + p(_jn3|f2,a1).π_Jn(f2)].λ(_jn3) += [(1x0.169259) + (0x0.830741)]x1 ++ [(0x0.169259) + (0x0.830741)]x1 ++ [(0x0.169259) + (1x0.830741)]x1 ++ [(0x0.169259) + (0x0.830741)]x1 = 1 +λ_Jn(a2) += [p(_jn0|f1,a2).π_Jn(f1) + p(_jn0|f2,a2).π_Jn(f2)].λ(_jn0) ++ [p(_jn1|f1,a2).π_Jn(f1) + p(_jn1|f2,a2).π_Jn(f2)].λ(_jn1) ++ [p(_jn2|f1,a2).π_Jn(f1) + p(_jn2|f2,a2).π_Jn(f2)].λ(_jn2) ++ [p(_jn3|f1,a2).π_Jn(f1) + p(_jn3|f2,a2).π_Jn(f2)].λ(_jn3) += [(0x0.169259) + (0x0.830741)]x1 ++ [(1x0.169259) + (0x0.830741)]x1 ++ [(0x0.169259) + (0x0.830741)]x1 ++ [(0x0.169259) + (1x0.830741)]x1 = 1 + +π message Burglar --> Alarm +πAlarm(b1) = π(b1) = 0.005 = 0.005 +πAlarm(b2) = π(b2) = 0.995 = 0.995 + +π message FreightTruck --> Alarm +πAlarm(f1) = π(f1).λ_Jn(f1) = 0.03 x 0.5 = 0.015 +πAlarm(f2) = π(f2).λ_Jn(f2) = 0.97 x 0.5 = 0.485 + +π message FreightTruck --> _Jn +π_Jn(f1) = π(f1).λAlarm(f1) = 0.03 x 0.5 = 0.015 +π_Jn(f2) = π(f2).λAlarm(f2) = 0.97 x 0.5 = 0.485 + +π message Alarm --> _Jn +π_Jn(a1) = π(a1) = 0.100142 = 0.1001424525 +π_Jn(a2) = π(a2) = 0.899858 = 0.8998575475 + +var Burglar: +π(b1) += p(b1) += (0.005) = 0.005 +π(b2) += p(b2) += (0.995) = 0.995 +λ(b1) = λAlarm(b1) = 0.5 = 0.5 +λ(b2) = λAlarm(b2) = 0.5 = 0.5 +belief change = 0 + +var FreightTruck: +π(f1) += p(f1) += (0.03) = 0.03 +π(f2) += p(f2) += (0.97) = 0.97 +λ(f1) = λAlarm(f1).λ_Jn(f1) = 0.5 x 0.5 = 0.25 +λ(f2) = λAlarm(f2).λ_Jn(f2) = 0.5 x 0.5 = 0.25 +belief change = 0 + +var Alarm: +π(a1) += p(a1|b1,f1).πAlarm(b1).πAlarm(f1) ++ p(a1|b1,f2).πAlarm(b1).πAlarm(f2) ++ p(a1|b2,f1).πAlarm(b2).πAlarm(f1) ++ p(a1|b2,f2).πAlarm(b2).πAlarm(f2) += (0.992x0.0359375x0.12284) ++ (0.99x0.0359375x0.87716) ++ (0.2x0.964063x0.12284) ++ (0.003x0.964063x0.87716) = 0.06180885899 +π(a2) += p(a2|b1,f1).πAlarm(b1).πAlarm(f1) ++ p(a2|b1,f2).πAlarm(b1).πAlarm(f2) ++ p(a2|b2,f1).πAlarm(b2).πAlarm(f1) ++ p(a2|b2,f2).πAlarm(b2).πAlarm(f2) += (0.008x0.0359375x0.12284) ++ (0.01x0.0359375x0.87716) ++ (0.8x0.964063x0.12284) ++ (0.997x0.964063x0.87716) = 0.938191141 +λ(a1) = λ_Jn(a1) = 0.5 = 0.5 +λ(a2) = λ_Jn(a2) = 0.5 = 0.5 +belief change = 0.07666718711 + +var _Jn: +π(_jn0) += p(_jn0|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn0|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn0|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn0|f2,a2).π_Jn(f2).π_Jn(a2) += (1x0.12284x0.193225) ++ (0x0.12284x0.806775) ++ (0x0.87716x0.193225) ++ (0x0.87716x0.806775) = 0.02373564233 +π(_jn1) += p(_jn1|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn1|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn1|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn1|f2,a2).π_Jn(f2).π_Jn(a2) += (0x0.12284x0.193225) ++ (1x0.12284x0.806775) ++ (0x0.87716x0.193225) ++ (0x0.87716x0.806775) = 0.09910386385 +π(_jn2) += p(_jn2|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn2|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn2|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn2|f2,a2).π_Jn(f2).π_Jn(a2) += (0x0.12284x0.193225) ++ (0x0.12284x0.806775) ++ (1x0.87716x0.193225) ++ (0x0.87716x0.806775) = 0.1694891846 +π(_jn3) += p(_jn3|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn3|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn3|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn3|f2,a2).π_Jn(f2).π_Jn(a2) += (0x0.12284x0.193225) ++ (0x0.12284x0.806775) ++ (0x0.87716x0.193225) ++ (1x0.87716x0.806775) = 0.7076713092 +λ(_jn0) = 1 +λ(_jn1) = 1 +λ(_jn2) = 1 +λ(_jn3) = 1 +belief change = 0.22955525 + +domain π(Burglar) λ(Burglar) belief +---------------------------------------------------------------- +b1 0.005 0.5 0.005 +b2 0.995 0.5 0.995 + +domain πAlarm(Burglar) λAlarm(Burglar) +---------------------------------------------------------------- +b1 0.0359375 0.5 +b2 0.9640625 0.5 + +domain π(FreightTruck) λ(FreightTruck) belief +---------------------------------------------------------------- +f1 0.03 0.25 0.03 +f2 0.97 0.25 0.97 + +domain πAlarm(FreightTruck) λAlarm(FreightTruck) +---------------------------------------------------------------- +f1 0.1228395062 0.5 +f2 0.8771604938 0.5 + +domain π_Jn(FreightTruck) λ_Jn(FreightTruck) +---------------------------------------------------------------- +f1 0.1228395062 0.5 +f2 0.8771604938 0.5 + +domain π(Alarm) λ(Alarm) belief +---------------------------------------------------------------- +a1 0.06180885899 0.5 0.06180885899 +a2 0.938191141 0.5 0.938191141 + +domain π_Jn(Alarm) λ_Jn(Alarm) +---------------------------------------------------------------- +a1 0.193224827 0.5 +a2 0.806775173 0.5 + +domain π(_Jn) λ(_Jn) belief +---------------------------------------------------------------- +_jn0 0.02373564233 1 0.02373564233 +_jn1 0.09910386385 1 0.09910386385 +_jn2 0.1694891846 1 0.1694891846 +_jn3 0.7076713092 1 0.7076713092 + + + +******************************************************************************** + Iteration 5 +******************************************************************************** +λ message Alarm --> Burglar +λAlarm(b1) += [p(a1|b1,f1).πAlarm(f1) + p(a1|b1,f2).πAlarm(f2)].λ(a1) ++ [p(a2|b1,f1).πAlarm(f1) + p(a2|b1,f2).πAlarm(f2)].λ(a2) += [(0.992x0.12284) + (0.99x0.87716)]x0.5 ++ [(0.008x0.12284) + (0.01x0.87716)]x0.5 = 0.5 +λAlarm(b2) += [p(a1|b2,f1).πAlarm(f1) + p(a1|b2,f2).πAlarm(f2)].λ(a1) ++ [p(a2|b2,f1).πAlarm(f1) + p(a2|b2,f2).πAlarm(f2)].λ(a2) += [(0.2x0.12284) + (0.003x0.87716)]x0.5 ++ [(0.8x0.12284) + (0.997x0.87716)]x0.5 = 0.5 + +λ message Alarm --> FreightTruck +λAlarm(f1) += [p(a1|b1,f1).πAlarm(b1) + p(a1|b2,f1).πAlarm(b2)].λ(a1) ++ [p(a2|b1,f1).πAlarm(b1) + p(a2|b2,f1).πAlarm(b2)].λ(a2) += [(0.992x0.0359375) + (0.2x0.964063)]x0.5 ++ [(0.008x0.0359375) + (0.8x0.964063)]x0.5 = 0.5 +λAlarm(f2) += [p(a1|b1,f2).πAlarm(b1) + p(a1|b2,f2).πAlarm(b2)].λ(a1) ++ [p(a2|b1,f2).πAlarm(b1) + p(a2|b2,f2).πAlarm(b2)].λ(a2) += [(0.99x0.0359375) + (0.003x0.964063)]x0.5 ++ [(0.01x0.0359375) + (0.997x0.964063)]x0.5 = 0.5 + +λ message _Jn --> FreightTruck +λ_Jn(f1) += [p(_jn0|f1,a1).π_Jn(a1) + p(_jn0|f1,a2).π_Jn(a2)].λ(_jn0) ++ [p(_jn1|f1,a1).π_Jn(a1) + p(_jn1|f1,a2).π_Jn(a2)].λ(_jn1) ++ [p(_jn2|f1,a1).π_Jn(a1) + p(_jn2|f1,a2).π_Jn(a2)].λ(_jn2) ++ [p(_jn3|f1,a1).π_Jn(a1) + p(_jn3|f1,a2).π_Jn(a2)].λ(_jn3) += [(1x0.193225) + (0x0.806775)]x1 ++ [(0x0.193225) + (1x0.806775)]x1 ++ [(0x0.193225) + (0x0.806775)]x1 ++ [(0x0.193225) + (0x0.806775)]x1 = 1 +λ_Jn(f2) += [p(_jn0|f2,a1).π_Jn(a1) + p(_jn0|f2,a2).π_Jn(a2)].λ(_jn0) ++ [p(_jn1|f2,a1).π_Jn(a1) + p(_jn1|f2,a2).π_Jn(a2)].λ(_jn1) ++ [p(_jn2|f2,a1).π_Jn(a1) + p(_jn2|f2,a2).π_Jn(a2)].λ(_jn2) ++ [p(_jn3|f2,a1).π_Jn(a1) + p(_jn3|f2,a2).π_Jn(a2)].λ(_jn3) += [(0x0.193225) + (0x0.806775)]x1 ++ [(0x0.193225) + (0x0.806775)]x1 ++ [(1x0.193225) + (0x0.806775)]x1 ++ [(0x0.193225) + (1x0.806775)]x1 = 1 + +λ message _Jn --> Alarm +λ_Jn(a1) += [p(_jn0|f1,a1).π_Jn(f1) + p(_jn0|f2,a1).π_Jn(f2)].λ(_jn0) ++ [p(_jn1|f1,a1).π_Jn(f1) + p(_jn1|f2,a1).π_Jn(f2)].λ(_jn1) ++ [p(_jn2|f1,a1).π_Jn(f1) + p(_jn2|f2,a1).π_Jn(f2)].λ(_jn2) ++ [p(_jn3|f1,a1).π_Jn(f1) + p(_jn3|f2,a1).π_Jn(f2)].λ(_jn3) += [(1x0.12284) + (0x0.87716)]x1 ++ [(0x0.12284) + (0x0.87716)]x1 ++ [(0x0.12284) + (1x0.87716)]x1 ++ [(0x0.12284) + (0x0.87716)]x1 = 1 +λ_Jn(a2) += [p(_jn0|f1,a2).π_Jn(f1) + p(_jn0|f2,a2).π_Jn(f2)].λ(_jn0) ++ [p(_jn1|f1,a2).π_Jn(f1) + p(_jn1|f2,a2).π_Jn(f2)].λ(_jn1) ++ [p(_jn2|f1,a2).π_Jn(f1) + p(_jn2|f2,a2).π_Jn(f2)].λ(_jn2) ++ [p(_jn3|f1,a2).π_Jn(f1) + p(_jn3|f2,a2).π_Jn(f2)].λ(_jn3) += [(0x0.12284) + (0x0.87716)]x1 ++ [(1x0.12284) + (0x0.87716)]x1 ++ [(0x0.12284) + (0x0.87716)]x1 ++ [(0x0.12284) + (1x0.87716)]x1 = 1 + +π message Burglar --> Alarm +πAlarm(b1) = π(b1) = 0.005 = 0.005 +πAlarm(b2) = π(b2) = 0.995 = 0.995 + +π message FreightTruck --> Alarm +πAlarm(f1) = π(f1).λ_Jn(f1) = 0.03 x 0.5 = 0.015 +πAlarm(f2) = π(f2).λ_Jn(f2) = 0.97 x 0.5 = 0.485 + +π message FreightTruck --> _Jn +π_Jn(f1) = π(f1).λAlarm(f1) = 0.03 x 0.5 = 0.015 +π_Jn(f2) = π(f2).λAlarm(f2) = 0.97 x 0.5 = 0.485 + +π message Alarm --> _Jn +π_Jn(a1) = π(a1) = 0.0618089 = 0.06180885899 +π_Jn(a2) = π(a2) = 0.938191 = 0.938191141 + +var Burglar: +π(b1) += p(b1) += (0.005) = 0.005 +π(b2) += p(b2) += (0.995) = 0.995 +λ(b1) = λAlarm(b1) = 0.5 = 0.5 +λ(b2) = λAlarm(b2) = 0.5 = 0.5 +belief change = 0 + +var FreightTruck: +π(f1) += p(f1) += (0.03) = 0.03 +π(f2) += p(f2) += (0.97) = 0.97 +λ(f1) = λAlarm(f1).λ_Jn(f1) = 0.5 x 0.5 = 0.25 +λ(f2) = λAlarm(f2).λ_Jn(f2) = 0.5 x 0.5 = 0.25 +belief change = 0 + +var Alarm: +π(a1) += p(a1|b1,f1).πAlarm(b1).πAlarm(f1) ++ p(a1|b1,f2).πAlarm(b1).πAlarm(f2) ++ p(a1|b2,f1).πAlarm(b2).πAlarm(f1) ++ p(a1|b2,f2).πAlarm(b2).πAlarm(f2) += (0.992x0.0204688x0.091893) ++ (0.99x0.0204688x0.908107) ++ (0.2x0.979531x0.091893) ++ (0.003x0.979531x0.908107) = 0.04093879575 +π(a2) += p(a2|b1,f1).πAlarm(b1).πAlarm(f1) ++ p(a2|b1,f2).πAlarm(b1).πAlarm(f2) ++ p(a2|b2,f1).πAlarm(b2).πAlarm(f1) ++ p(a2|b2,f2).πAlarm(b2).πAlarm(f2) += (0.008x0.0204688x0.091893) ++ (0.01x0.0204688x0.908107) ++ (0.8x0.979531x0.091893) ++ (0.997x0.979531x0.908107) = 0.9590612043 +λ(a1) = λ_Jn(a1) = 0.5 = 0.5 +λ(a2) = λ_Jn(a2) = 0.5 = 0.5 +belief change = 0.04174012648 + +var _Jn: +π(_jn0) += p(_jn0|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn0|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn0|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn0|f2,a2).π_Jn(f2).π_Jn(a2) += (1x0.091893x0.127517) ++ (0x0.091893x0.872483) ++ (0x0.908107x0.127517) ++ (0x0.908107x0.872483) = 0.01171790578 +π(_jn1) += p(_jn1|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn1|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn1|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn1|f2,a2).π_Jn(f2).π_Jn(a2) += (0x0.091893x0.127517) ++ (1x0.091893x0.872483) ++ (0x0.908107x0.127517) ++ (0x0.908107x0.872483) = 0.08017509834 +π(_jn2) += p(_jn2|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn2|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn2|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn2|f2,a2).π_Jn(f2).π_Jn(a2) += (0x0.091893x0.127517) ++ (0x0.091893x0.872483) ++ (1x0.908107x0.127517) ++ (0x0.908107x0.872483) = 0.1157989372 +π(_jn3) += p(_jn3|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn3|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn3|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn3|f2,a2).π_Jn(f2).π_Jn(a2) += (0x0.091893x0.127517) ++ (0x0.091893x0.872483) ++ (0x0.908107x0.127517) ++ (1x0.908107x0.872483) = 0.7923080587 +λ(_jn0) = 1 +λ(_jn1) = 1 +λ(_jn2) = 1 +λ(_jn3) = 1 +belief change = 0.169273499 + +domain π(Burglar) λ(Burglar) belief +---------------------------------------------------------------- +b1 0.005 0.5 0.005 +b2 0.995 0.5 0.995 + +domain πAlarm(Burglar) λAlarm(Burglar) +---------------------------------------------------------------- +b1 0.02046875 0.5 +b2 0.97953125 0.5 + +domain π(FreightTruck) λ(FreightTruck) belief +---------------------------------------------------------------- +f1 0.03 0.25 0.03 +f2 0.97 0.25 0.97 + +domain πAlarm(FreightTruck) λAlarm(FreightTruck) +---------------------------------------------------------------- +f1 0.09189300412 0.5 +f2 0.9081069959 0.5 + +domain π_Jn(FreightTruck) λ_Jn(FreightTruck) +---------------------------------------------------------------- +f1 0.09189300412 0.5 +f2 0.9081069959 0.5 + +domain π(Alarm) λ(Alarm) belief +---------------------------------------------------------------- +a1 0.04093879575 0.5 0.04093879575 +a2 0.9590612043 0.5 0.9590612043 + +domain π_Jn(Alarm) λ_Jn(Alarm) +---------------------------------------------------------------- +a1 0.127516843 0.5 +a2 0.872483157 0.5 + +domain π(_Jn) λ(_Jn) belief +---------------------------------------------------------------- +_jn0 0.01171790578 1 0.01171790578 +_jn1 0.08017509834 1 0.08017509834 +_jn2 0.1157989372 1 0.1157989372 +_jn3 0.7923080587 1 0.7923080587 + + + +******************************************************************************** + Iteration 6 +******************************************************************************** +λ message Alarm --> Burglar +λAlarm(b1) += [p(a1|b1,f1).πAlarm(f1) + p(a1|b1,f2).πAlarm(f2)].λ(a1) ++ [p(a2|b1,f1).πAlarm(f1) + p(a2|b1,f2).πAlarm(f2)].λ(a2) += [(0.992x0.091893) + (0.99x0.908107)]x0.5 ++ [(0.008x0.091893) + (0.01x0.908107)]x0.5 = 0.5 +λAlarm(b2) += [p(a1|b2,f1).πAlarm(f1) + p(a1|b2,f2).πAlarm(f2)].λ(a1) ++ [p(a2|b2,f1).πAlarm(f1) + p(a2|b2,f2).πAlarm(f2)].λ(a2) += [(0.2x0.091893) + (0.003x0.908107)]x0.5 ++ [(0.8x0.091893) + (0.997x0.908107)]x0.5 = 0.5 + +λ message Alarm --> FreightTruck +λAlarm(f1) += [p(a1|b1,f1).πAlarm(b1) + p(a1|b2,f1).πAlarm(b2)].λ(a1) ++ [p(a2|b1,f1).πAlarm(b1) + p(a2|b2,f1).πAlarm(b2)].λ(a2) += [(0.992x0.0204688) + (0.2x0.979531)]x0.5 ++ [(0.008x0.0204688) + (0.8x0.979531)]x0.5 = 0.5 +λAlarm(f2) += [p(a1|b1,f2).πAlarm(b1) + p(a1|b2,f2).πAlarm(b2)].λ(a1) ++ [p(a2|b1,f2).πAlarm(b1) + p(a2|b2,f2).πAlarm(b2)].λ(a2) += [(0.99x0.0204688) + (0.003x0.979531)]x0.5 ++ [(0.01x0.0204688) + (0.997x0.979531)]x0.5 = 0.5 + +λ message _Jn --> FreightTruck +λ_Jn(f1) += [p(_jn0|f1,a1).π_Jn(a1) + p(_jn0|f1,a2).π_Jn(a2)].λ(_jn0) ++ [p(_jn1|f1,a1).π_Jn(a1) + p(_jn1|f1,a2).π_Jn(a2)].λ(_jn1) ++ [p(_jn2|f1,a1).π_Jn(a1) + p(_jn2|f1,a2).π_Jn(a2)].λ(_jn2) ++ [p(_jn3|f1,a1).π_Jn(a1) + p(_jn3|f1,a2).π_Jn(a2)].λ(_jn3) += [(1x0.127517) + (0x0.872483)]x1 ++ [(0x0.127517) + (1x0.872483)]x1 ++ [(0x0.127517) + (0x0.872483)]x1 ++ [(0x0.127517) + (0x0.872483)]x1 = 1 +λ_Jn(f2) += [p(_jn0|f2,a1).π_Jn(a1) + p(_jn0|f2,a2).π_Jn(a2)].λ(_jn0) ++ [p(_jn1|f2,a1).π_Jn(a1) + p(_jn1|f2,a2).π_Jn(a2)].λ(_jn1) ++ [p(_jn2|f2,a1).π_Jn(a1) + p(_jn2|f2,a2).π_Jn(a2)].λ(_jn2) ++ [p(_jn3|f2,a1).π_Jn(a1) + p(_jn3|f2,a2).π_Jn(a2)].λ(_jn3) += [(0x0.127517) + (0x0.872483)]x1 ++ [(0x0.127517) + (0x0.872483)]x1 ++ [(1x0.127517) + (0x0.872483)]x1 ++ [(0x0.127517) + (1x0.872483)]x1 = 1 + +λ message _Jn --> Alarm +λ_Jn(a1) += [p(_jn0|f1,a1).π_Jn(f1) + p(_jn0|f2,a1).π_Jn(f2)].λ(_jn0) ++ [p(_jn1|f1,a1).π_Jn(f1) + p(_jn1|f2,a1).π_Jn(f2)].λ(_jn1) ++ [p(_jn2|f1,a1).π_Jn(f1) + p(_jn2|f2,a1).π_Jn(f2)].λ(_jn2) ++ [p(_jn3|f1,a1).π_Jn(f1) + p(_jn3|f2,a1).π_Jn(f2)].λ(_jn3) += [(1x0.091893) + (0x0.908107)]x1 ++ [(0x0.091893) + (0x0.908107)]x1 ++ [(0x0.091893) + (1x0.908107)]x1 ++ [(0x0.091893) + (0x0.908107)]x1 = 1 +λ_Jn(a2) += [p(_jn0|f1,a2).π_Jn(f1) + p(_jn0|f2,a2).π_Jn(f2)].λ(_jn0) ++ [p(_jn1|f1,a2).π_Jn(f1) + p(_jn1|f2,a2).π_Jn(f2)].λ(_jn1) ++ [p(_jn2|f1,a2).π_Jn(f1) + p(_jn2|f2,a2).π_Jn(f2)].λ(_jn2) ++ [p(_jn3|f1,a2).π_Jn(f1) + p(_jn3|f2,a2).π_Jn(f2)].λ(_jn3) += [(0x0.091893) + (0x0.908107)]x1 ++ [(1x0.091893) + (0x0.908107)]x1 ++ [(0x0.091893) + (0x0.908107)]x1 ++ [(0x0.091893) + (1x0.908107)]x1 = 1 + +π message Burglar --> Alarm +πAlarm(b1) = π(b1) = 0.005 = 0.005 +πAlarm(b2) = π(b2) = 0.995 = 0.995 + +π message FreightTruck --> Alarm +πAlarm(f1) = π(f1).λ_Jn(f1) = 0.03 x 0.5 = 0.015 +πAlarm(f2) = π(f2).λ_Jn(f2) = 0.97 x 0.5 = 0.485 + +π message FreightTruck --> _Jn +π_Jn(f1) = π(f1).λAlarm(f1) = 0.03 x 0.5 = 0.015 +π_Jn(f2) = π(f2).λAlarm(f2) = 0.97 x 0.5 = 0.485 + +π message Alarm --> _Jn +π_Jn(a1) = π(a1) = 0.0409388 = 0.04093879575 +π_Jn(a2) = π(a2) = 0.959061 = 0.9590612043 + +var Burglar: +π(b1) += p(b1) += (0.005) = 0.005 +π(b2) += p(b2) += (0.995) = 0.995 +λ(b1) = λAlarm(b1) = 0.5 = 0.5 +λ(b2) = λAlarm(b2) = 0.5 = 0.5 +belief change = 0 + +var FreightTruck: +π(f1) += p(f1) += (0.03) = 0.03 +π(f2) += p(f2) += (0.97) = 0.97 +λ(f1) = λAlarm(f1).λ_Jn(f1) = 0.5 x 0.5 = 0.25 +λ(f2) = λAlarm(f2).λ_Jn(f2) = 0.5 x 0.5 = 0.25 +belief change = 0 + +var Alarm: +π(a1) += p(a1|b1,f1).πAlarm(b1).πAlarm(f1) ++ p(a1|b1,f2).πAlarm(b1).πAlarm(f2) ++ p(a1|b2,f1).πAlarm(b2).πAlarm(f1) ++ p(a1|b2,f2).πAlarm(b2).πAlarm(f2) += (0.992x0.0127344x0.071262) ++ (0.99x0.0127344x0.928738) ++ (0.2x0.987266x0.071262) ++ (0.003x0.987266x0.928738) = 0.02943048464 +π(a2) += p(a2|b1,f1).πAlarm(b1).πAlarm(f1) ++ p(a2|b1,f2).πAlarm(b1).πAlarm(f2) ++ p(a2|b2,f1).πAlarm(b2).πAlarm(f1) ++ p(a2|b2,f2).πAlarm(b2).πAlarm(f2) += (0.008x0.0127344x0.071262) ++ (0.01x0.0127344x0.928738) ++ (0.8x0.987266x0.071262) ++ (0.997x0.987266x0.928738) = 0.9705695154 +λ(a1) = λ_Jn(a1) = 0.5 = 0.5 +λ(a2) = λ_Jn(a2) = 0.5 = 0.5 +belief change = 0.02301662222 + +var _Jn: +π(_jn0) += p(_jn0|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn0|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn0|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn0|f2,a2).π_Jn(f2).π_Jn(a2) += (1x0.071262x0.0842278) ++ (0x0.071262x0.915772) ++ (0x0.928738x0.0842278) ++ (0x0.928738x0.915772) = 0.006002243095 +π(_jn1) += p(_jn1|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn1|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn1|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn1|f2,a2).π_Jn(f2).π_Jn(a2) += (0x0.071262x0.0842278) ++ (1x0.071262x0.915772) ++ (0x0.928738x0.0842278) ++ (0x0.928738x0.915772) = 0.06525975965 +π(_jn2) += p(_jn2|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn2|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn2|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn2|f2,a2).π_Jn(f2).π_Jn(a2) += (0x0.071262x0.0842278) ++ (0x0.071262x0.915772) ++ (1x0.928738x0.0842278) ++ (0x0.928738x0.915772) = 0.07822557627 +π(_jn3) += p(_jn3|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn3|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn3|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn3|f2,a2).π_Jn(f2).π_Jn(a2) += (0x0.071262x0.0842278) ++ (0x0.071262x0.915772) ++ (0x0.928738x0.0842278) ++ (1x0.928738x0.915772) = 0.850512421 +λ(_jn0) = 1 +λ(_jn1) = 1 +λ(_jn2) = 1 +λ(_jn3) = 1 +belief change = 0.1164087246 + +domain π(Burglar) λ(Burglar) belief +---------------------------------------------------------------- +b1 0.005 0.5 0.005 +b2 0.995 0.5 0.995 + +domain πAlarm(Burglar) λAlarm(Burglar) +---------------------------------------------------------------- +b1 0.012734375 0.5 +b2 0.987265625 0.5 + +domain π(FreightTruck) λ(FreightTruck) belief +---------------------------------------------------------------- +f1 0.03 0.25 0.03 +f2 0.97 0.25 0.97 + +domain πAlarm(FreightTruck) λAlarm(FreightTruck) +---------------------------------------------------------------- +f1 0.07126200274 0.5 +f2 0.9287379973 0.5 + +domain π_Jn(FreightTruck) λ_Jn(FreightTruck) +---------------------------------------------------------------- +f1 0.07126200274 0.5 +f2 0.9287379973 0.5 + +domain π(Alarm) λ(Alarm) belief +---------------------------------------------------------------- +a1 0.02943048464 0.5 0.02943048464 +a2 0.9705695154 0.5 0.9705695154 + +domain π_Jn(Alarm) λ_Jn(Alarm) +---------------------------------------------------------------- +a1 0.08422781936 0.5 +a2 0.9157721806 0.5 + +domain π(_Jn) λ(_Jn) belief +---------------------------------------------------------------- +_jn0 0.006002243095 1 0.006002243095 +_jn1 0.06525975965 1 0.06525975965 +_jn2 0.07822557627 1 0.07822557627 +_jn3 0.850512421 1 0.850512421 + + + +******************************************************************************** + Iteration 7 +******************************************************************************** +λ message Alarm --> Burglar +λAlarm(b1) += [p(a1|b1,f1).πAlarm(f1) + p(a1|b1,f2).πAlarm(f2)].λ(a1) ++ [p(a2|b1,f1).πAlarm(f1) + p(a2|b1,f2).πAlarm(f2)].λ(a2) += [(0.992x0.071262) + (0.99x0.928738)]x0.5 ++ [(0.008x0.071262) + (0.01x0.928738)]x0.5 = 0.5 +λAlarm(b2) += [p(a1|b2,f1).πAlarm(f1) + p(a1|b2,f2).πAlarm(f2)].λ(a1) ++ [p(a2|b2,f1).πAlarm(f1) + p(a2|b2,f2).πAlarm(f2)].λ(a2) += [(0.2x0.071262) + (0.003x0.928738)]x0.5 ++ [(0.8x0.071262) + (0.997x0.928738)]x0.5 = 0.5 + +λ message Alarm --> FreightTruck +λAlarm(f1) += [p(a1|b1,f1).πAlarm(b1) + p(a1|b2,f1).πAlarm(b2)].λ(a1) ++ [p(a2|b1,f1).πAlarm(b1) + p(a2|b2,f1).πAlarm(b2)].λ(a2) += [(0.992x0.0127344) + (0.2x0.987266)]x0.5 ++ [(0.008x0.0127344) + (0.8x0.987266)]x0.5 = 0.5 +λAlarm(f2) += [p(a1|b1,f2).πAlarm(b1) + p(a1|b2,f2).πAlarm(b2)].λ(a1) ++ [p(a2|b1,f2).πAlarm(b1) + p(a2|b2,f2).πAlarm(b2)].λ(a2) += [(0.99x0.0127344) + (0.003x0.987266)]x0.5 ++ [(0.01x0.0127344) + (0.997x0.987266)]x0.5 = 0.5 + +λ message _Jn --> FreightTruck +λ_Jn(f1) += [p(_jn0|f1,a1).π_Jn(a1) + p(_jn0|f1,a2).π_Jn(a2)].λ(_jn0) ++ [p(_jn1|f1,a1).π_Jn(a1) + p(_jn1|f1,a2).π_Jn(a2)].λ(_jn1) ++ [p(_jn2|f1,a1).π_Jn(a1) + p(_jn2|f1,a2).π_Jn(a2)].λ(_jn2) ++ [p(_jn3|f1,a1).π_Jn(a1) + p(_jn3|f1,a2).π_Jn(a2)].λ(_jn3) += [(1x0.0842278) + (0x0.915772)]x1 ++ [(0x0.0842278) + (1x0.915772)]x1 ++ [(0x0.0842278) + (0x0.915772)]x1 ++ [(0x0.0842278) + (0x0.915772)]x1 = 1 +λ_Jn(f2) += [p(_jn0|f2,a1).π_Jn(a1) + p(_jn0|f2,a2).π_Jn(a2)].λ(_jn0) ++ [p(_jn1|f2,a1).π_Jn(a1) + p(_jn1|f2,a2).π_Jn(a2)].λ(_jn1) ++ [p(_jn2|f2,a1).π_Jn(a1) + p(_jn2|f2,a2).π_Jn(a2)].λ(_jn2) ++ [p(_jn3|f2,a1).π_Jn(a1) + p(_jn3|f2,a2).π_Jn(a2)].λ(_jn3) += [(0x0.0842278) + (0x0.915772)]x1 ++ [(0x0.0842278) + (0x0.915772)]x1 ++ [(1x0.0842278) + (0x0.915772)]x1 ++ [(0x0.0842278) + (1x0.915772)]x1 = 1 + +λ message _Jn --> Alarm +λ_Jn(a1) += [p(_jn0|f1,a1).π_Jn(f1) + p(_jn0|f2,a1).π_Jn(f2)].λ(_jn0) ++ [p(_jn1|f1,a1).π_Jn(f1) + p(_jn1|f2,a1).π_Jn(f2)].λ(_jn1) ++ [p(_jn2|f1,a1).π_Jn(f1) + p(_jn2|f2,a1).π_Jn(f2)].λ(_jn2) ++ [p(_jn3|f1,a1).π_Jn(f1) + p(_jn3|f2,a1).π_Jn(f2)].λ(_jn3) += [(1x0.071262) + (0x0.928738)]x1 ++ [(0x0.071262) + (0x0.928738)]x1 ++ [(0x0.071262) + (1x0.928738)]x1 ++ [(0x0.071262) + (0x0.928738)]x1 = 1 +λ_Jn(a2) += [p(_jn0|f1,a2).π_Jn(f1) + p(_jn0|f2,a2).π_Jn(f2)].λ(_jn0) ++ [p(_jn1|f1,a2).π_Jn(f1) + p(_jn1|f2,a2).π_Jn(f2)].λ(_jn1) ++ [p(_jn2|f1,a2).π_Jn(f1) + p(_jn2|f2,a2).π_Jn(f2)].λ(_jn2) ++ [p(_jn3|f1,a2).π_Jn(f1) + p(_jn3|f2,a2).π_Jn(f2)].λ(_jn3) += [(0x0.071262) + (0x0.928738)]x1 ++ [(1x0.071262) + (0x0.928738)]x1 ++ [(0x0.071262) + (0x0.928738)]x1 ++ [(0x0.071262) + (1x0.928738)]x1 = 1 + +π message Burglar --> Alarm +πAlarm(b1) = π(b1) = 0.005 = 0.005 +πAlarm(b2) = π(b2) = 0.995 = 0.995 + +π message FreightTruck --> Alarm +πAlarm(f1) = π(f1).λ_Jn(f1) = 0.03 x 0.5 = 0.015 +πAlarm(f2) = π(f2).λ_Jn(f2) = 0.97 x 0.5 = 0.485 + +π message FreightTruck --> _Jn +π_Jn(f1) = π(f1).λAlarm(f1) = 0.03 x 0.5 = 0.015 +π_Jn(f2) = π(f2).λAlarm(f2) = 0.97 x 0.5 = 0.485 + +π message Alarm --> _Jn +π_Jn(a1) = π(a1) = 0.0294305 = 0.02943048464 +π_Jn(a2) = π(a2) = 0.97057 = 0.9705695154 + +var Burglar: +π(b1) += p(b1) += (0.005) = 0.005 +π(b2) += p(b2) += (0.995) = 0.995 +λ(b1) = λAlarm(b1) = 0.5 = 0.5 +λ(b2) = λAlarm(b2) = 0.5 = 0.5 +belief change = 0 + +var FreightTruck: +π(f1) += p(f1) += (0.03) = 0.03 +π(f2) += p(f2) += (0.97) = 0.97 +λ(f1) = λAlarm(f1).λ_Jn(f1) = 0.5 x 0.5 = 0.25 +λ(f2) = λAlarm(f2).λ_Jn(f2) = 0.5 x 0.5 = 0.25 +belief change = 0 + +var Alarm: +π(a1) += p(a1|b1,f1).πAlarm(b1).πAlarm(f1) ++ p(a1|b1,f2).πAlarm(b1).πAlarm(f2) ++ p(a1|b2,f1).πAlarm(b2).πAlarm(f1) ++ p(a1|b2,f2).πAlarm(b2).πAlarm(f2) += (0.992x0.00886719x0.057508) ++ (0.99x0.00886719x0.942492) ++ (0.2x0.991133x0.057508) ++ (0.003x0.991133x0.942492) = 0.02298155325 +π(a2) += p(a2|b1,f1).πAlarm(b1).πAlarm(f1) ++ p(a2|b1,f2).πAlarm(b1).πAlarm(f2) ++ p(a2|b2,f1).πAlarm(b2).πAlarm(f1) ++ p(a2|b2,f2).πAlarm(b2).πAlarm(f2) += (0.008x0.00886719x0.057508) ++ (0.01x0.00886719x0.942492) ++ (0.8x0.991133x0.057508) ++ (0.997x0.991133x0.942492) = 0.9770184468 +λ(a1) = λ_Jn(a1) = 0.5 = 0.5 +λ(a2) = λ_Jn(a2) = 0.5 = 0.5 +belief change = 0.01289786278 + +var _Jn: +π(_jn0) += p(_jn0|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn0|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn0|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn0|f2,a2).π_Jn(f2).π_Jn(a2) += (1x0.057508x0.0568292) ++ (0x0.057508x0.943171) ++ (0x0.942492x0.0568292) ++ (0x0.942492x0.943171) = 0.003268130977 +π(_jn1) += p(_jn1|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn1|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn1|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn1|f2,a2).π_Jn(f2).π_Jn(a2) += (0x0.057508x0.0568292) ++ (1x0.057508x0.943171) ++ (0x0.942492x0.0568292) ++ (0x0.942492x0.943171) = 0.05423987085 +π(_jn2) += p(_jn2|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn2|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn2|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn2|f2,a2).π_Jn(f2).π_Jn(a2) += (0x0.057508x0.0568292) ++ (0x0.057508x0.943171) ++ (1x0.942492x0.0568292) ++ (0x0.942492x0.943171) = 0.05356102102 +π(_jn3) += p(_jn3|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn3|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn3|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn3|f2,a2).π_Jn(f2).π_Jn(a2) += (0x0.057508x0.0568292) ++ (0x0.057508x0.943171) ++ (0x0.942492x0.0568292) ++ (1x0.942492x0.943171) = 0.8889309771 +λ(_jn0) = 1 +λ(_jn1) = 1 +λ(_jn2) = 1 +λ(_jn3) = 1 +belief change = 0.07683711232 + +domain π(Burglar) λ(Burglar) belief +---------------------------------------------------------------- +b1 0.005 0.5 0.005 +b2 0.995 0.5 0.995 + +domain πAlarm(Burglar) λAlarm(Burglar) +---------------------------------------------------------------- +b1 0.0088671875 0.5 +b2 0.9911328125 0.5 + +domain π(FreightTruck) λ(FreightTruck) belief +---------------------------------------------------------------- +f1 0.03 0.25 0.03 +f2 0.97 0.25 0.97 + +domain πAlarm(FreightTruck) λAlarm(FreightTruck) +---------------------------------------------------------------- +f1 0.05750800183 0.5 +f2 0.9424919982 0.5 + +domain π_Jn(FreightTruck) λ_Jn(FreightTruck) +---------------------------------------------------------------- +f1 0.05750800183 0.5 +f2 0.9424919982 0.5 + +domain π(Alarm) λ(Alarm) belief +---------------------------------------------------------------- +a1 0.02298155325 0.5 0.02298155325 +a2 0.9770184468 0.5 0.9770184468 + +domain π_Jn(Alarm) λ_Jn(Alarm) +---------------------------------------------------------------- +a1 0.056829152 0.5 +a2 0.943170848 0.5 + +domain π(_Jn) λ(_Jn) belief +---------------------------------------------------------------- +_jn0 0.003268130977 1 0.003268130977 +_jn1 0.05423987085 1 0.05423987085 +_jn2 0.05356102102 1 0.05356102102 +_jn3 0.8889309771 1 0.8889309771 + + + +******************************************************************************** + Iteration 8 +******************************************************************************** +λ message Alarm --> Burglar +λAlarm(b1) += [p(a1|b1,f1).πAlarm(f1) + p(a1|b1,f2).πAlarm(f2)].λ(a1) ++ [p(a2|b1,f1).πAlarm(f1) + p(a2|b1,f2).πAlarm(f2)].λ(a2) += [(0.992x0.057508) + (0.99x0.942492)]x0.5 ++ [(0.008x0.057508) + (0.01x0.942492)]x0.5 = 0.5 +λAlarm(b2) += [p(a1|b2,f1).πAlarm(f1) + p(a1|b2,f2).πAlarm(f2)].λ(a1) ++ [p(a2|b2,f1).πAlarm(f1) + p(a2|b2,f2).πAlarm(f2)].λ(a2) += [(0.2x0.057508) + (0.003x0.942492)]x0.5 ++ [(0.8x0.057508) + (0.997x0.942492)]x0.5 = 0.5 + +λ message Alarm --> FreightTruck +λAlarm(f1) += [p(a1|b1,f1).πAlarm(b1) + p(a1|b2,f1).πAlarm(b2)].λ(a1) ++ [p(a2|b1,f1).πAlarm(b1) + p(a2|b2,f1).πAlarm(b2)].λ(a2) += [(0.992x0.00886719) + (0.2x0.991133)]x0.5 ++ [(0.008x0.00886719) + (0.8x0.991133)]x0.5 = 0.5 +λAlarm(f2) += [p(a1|b1,f2).πAlarm(b1) + p(a1|b2,f2).πAlarm(b2)].λ(a1) ++ [p(a2|b1,f2).πAlarm(b1) + p(a2|b2,f2).πAlarm(b2)].λ(a2) += [(0.99x0.00886719) + (0.003x0.991133)]x0.5 ++ [(0.01x0.00886719) + (0.997x0.991133)]x0.5 = 0.5 + +λ message _Jn --> FreightTruck +λ_Jn(f1) += [p(_jn0|f1,a1).π_Jn(a1) + p(_jn0|f1,a2).π_Jn(a2)].λ(_jn0) ++ [p(_jn1|f1,a1).π_Jn(a1) + p(_jn1|f1,a2).π_Jn(a2)].λ(_jn1) ++ [p(_jn2|f1,a1).π_Jn(a1) + p(_jn2|f1,a2).π_Jn(a2)].λ(_jn2) ++ [p(_jn3|f1,a1).π_Jn(a1) + p(_jn3|f1,a2).π_Jn(a2)].λ(_jn3) += [(1x0.0568292) + (0x0.943171)]x1 ++ [(0x0.0568292) + (1x0.943171)]x1 ++ [(0x0.0568292) + (0x0.943171)]x1 ++ [(0x0.0568292) + (0x0.943171)]x1 = 1 +λ_Jn(f2) += [p(_jn0|f2,a1).π_Jn(a1) + p(_jn0|f2,a2).π_Jn(a2)].λ(_jn0) ++ [p(_jn1|f2,a1).π_Jn(a1) + p(_jn1|f2,a2).π_Jn(a2)].λ(_jn1) ++ [p(_jn2|f2,a1).π_Jn(a1) + p(_jn2|f2,a2).π_Jn(a2)].λ(_jn2) ++ [p(_jn3|f2,a1).π_Jn(a1) + p(_jn3|f2,a2).π_Jn(a2)].λ(_jn3) += [(0x0.0568292) + (0x0.943171)]x1 ++ [(0x0.0568292) + (0x0.943171)]x1 ++ [(1x0.0568292) + (0x0.943171)]x1 ++ [(0x0.0568292) + (1x0.943171)]x1 = 1 + +λ message _Jn --> Alarm +λ_Jn(a1) += [p(_jn0|f1,a1).π_Jn(f1) + p(_jn0|f2,a1).π_Jn(f2)].λ(_jn0) ++ [p(_jn1|f1,a1).π_Jn(f1) + p(_jn1|f2,a1).π_Jn(f2)].λ(_jn1) ++ [p(_jn2|f1,a1).π_Jn(f1) + p(_jn2|f2,a1).π_Jn(f2)].λ(_jn2) ++ [p(_jn3|f1,a1).π_Jn(f1) + p(_jn3|f2,a1).π_Jn(f2)].λ(_jn3) += [(1x0.057508) + (0x0.942492)]x1 ++ [(0x0.057508) + (0x0.942492)]x1 ++ [(0x0.057508) + (1x0.942492)]x1 ++ [(0x0.057508) + (0x0.942492)]x1 = 1 +λ_Jn(a2) += [p(_jn0|f1,a2).π_Jn(f1) + p(_jn0|f2,a2).π_Jn(f2)].λ(_jn0) ++ [p(_jn1|f1,a2).π_Jn(f1) + p(_jn1|f2,a2).π_Jn(f2)].λ(_jn1) ++ [p(_jn2|f1,a2).π_Jn(f1) + p(_jn2|f2,a2).π_Jn(f2)].λ(_jn2) ++ [p(_jn3|f1,a2).π_Jn(f1) + p(_jn3|f2,a2).π_Jn(f2)].λ(_jn3) += [(0x0.057508) + (0x0.942492)]x1 ++ [(1x0.057508) + (0x0.942492)]x1 ++ [(0x0.057508) + (0x0.942492)]x1 ++ [(0x0.057508) + (1x0.942492)]x1 = 1 + +π message Burglar --> Alarm +πAlarm(b1) = π(b1) = 0.005 = 0.005 +πAlarm(b2) = π(b2) = 0.995 = 0.995 + +π message FreightTruck --> Alarm +πAlarm(f1) = π(f1).λ_Jn(f1) = 0.03 x 0.5 = 0.015 +πAlarm(f2) = π(f2).λ_Jn(f2) = 0.97 x 0.5 = 0.485 + +π message FreightTruck --> _Jn +π_Jn(f1) = π(f1).λAlarm(f1) = 0.03 x 0.5 = 0.015 +π_Jn(f2) = π(f2).λAlarm(f2) = 0.97 x 0.5 = 0.485 + +π message Alarm --> _Jn +π_Jn(a1) = π(a1) = 0.0229816 = 0.02298155325 +π_Jn(a2) = π(a2) = 0.977018 = 0.9770184468 + +var Burglar: +π(b1) += p(b1) += (0.005) = 0.005 +π(b2) += p(b2) += (0.995) = 0.995 +λ(b1) = λAlarm(b1) = 0.5 = 0.5 +λ(b2) = λAlarm(b2) = 0.5 = 0.5 +belief change = 0 + +var FreightTruck: +π(f1) += p(f1) += (0.03) = 0.03 +π(f2) += p(f2) += (0.97) = 0.97 +λ(f1) = λAlarm(f1).λ_Jn(f1) = 0.5 x 0.5 = 0.25 +λ(f2) = λAlarm(f2).λ_Jn(f2) = 0.5 x 0.5 = 0.25 +belief change = 0 + +var Alarm: +π(a1) += p(a1|b1,f1).πAlarm(b1).πAlarm(f1) ++ p(a1|b1,f2).πAlarm(b1).πAlarm(f2) ++ p(a1|b2,f1).πAlarm(b2).πAlarm(f1) ++ p(a1|b2,f2).πAlarm(b2).πAlarm(f2) += (0.992x0.00693359x0.0483387) ++ (0.99x0.00693359x0.951661) ++ (0.2x0.993066x0.0483387) ++ (0.003x0.993066x0.951661) = 0.01930081827 +π(a2) += p(a2|b1,f1).πAlarm(b1).πAlarm(f1) ++ p(a2|b1,f2).πAlarm(b1).πAlarm(f2) ++ p(a2|b2,f1).πAlarm(b2).πAlarm(f1) ++ p(a2|b2,f2).πAlarm(b2).πAlarm(f2) += (0.008x0.00693359x0.0483387) ++ (0.01x0.00693359x0.951661) ++ (0.8x0.993066x0.0483387) ++ (0.997x0.993066x0.951661) = 0.9806991817 +λ(a1) = λ_Jn(a1) = 0.5 = 0.5 +λ(a2) = λ_Jn(a2) = 0.5 = 0.5 +belief change = 0.007361469952 + +var _Jn: +π(_jn0) += p(_jn0|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn0|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn0|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn0|f2,a2).π_Jn(f2).π_Jn(a2) += (1x0.0483387x0.0399054) ++ (0x0.0483387x0.960095) ++ (0x0.951661x0.0399054) ++ (0x0.951661x0.960095) = 0.001928971587 +π(_jn1) += p(_jn1|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn1|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn1|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn1|f2,a2).π_Jn(f2).π_Jn(a2) += (0x0.0483387x0.0399054) ++ (1x0.0483387x0.960095) ++ (0x0.951661x0.0399054) ++ (0x0.951661x0.960095) = 0.0464096963 +π(_jn2) += p(_jn2|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn2|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn2|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn2|f2,a2).π_Jn(f2).π_Jn(a2) += (0x0.0483387x0.0399054) ++ (0x0.0483387x0.960095) ++ (1x0.951661x0.0399054) ++ (0x0.951661x0.960095) = 0.03797638104 +π(_jn3) += p(_jn3|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn3|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn3|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn3|f2,a2).π_Jn(f2).π_Jn(a2) += (0x0.0483387x0.0399054) ++ (0x0.0483387x0.960095) ++ (0x0.951661x0.0399054) ++ (1x0.951661x0.960095) = 0.9136849511 +λ(_jn0) = 1 +λ(_jn1) = 1 +λ(_jn2) = 1 +λ(_jn3) = 1 +belief change = 0.04950794786 + +domain π(Burglar) λ(Burglar) belief +---------------------------------------------------------------- +b1 0.005 0.5 0.005 +b2 0.995 0.5 0.995 + +domain πAlarm(Burglar) λAlarm(Burglar) +---------------------------------------------------------------- +b1 0.00693359375 0.5 +b2 0.9930664063 0.5 + +domain π(FreightTruck) λ(FreightTruck) belief +---------------------------------------------------------------- +f1 0.03 0.25 0.03 +f2 0.97 0.25 0.97 + +domain πAlarm(FreightTruck) λAlarm(FreightTruck) +---------------------------------------------------------------- +f1 0.04833866789 0.5 +f2 0.9516613321 0.5 + +domain π_Jn(FreightTruck) λ_Jn(FreightTruck) +---------------------------------------------------------------- +f1 0.04833866789 0.5 +f2 0.9516613321 0.5 + +domain π(Alarm) λ(Alarm) belief +---------------------------------------------------------------- +a1 0.01930081827 0.5 0.01930081827 +a2 0.9806991817 0.5 0.9806991817 + +domain π_Jn(Alarm) λ_Jn(Alarm) +---------------------------------------------------------------- +a1 0.03990535262 0.5 +a2 0.9600946474 0.5 + +domain π(_Jn) λ(_Jn) belief +---------------------------------------------------------------- +_jn0 0.001928971587 1 0.001928971587 +_jn1 0.0464096963 1 0.0464096963 +_jn2 0.03797638104 1 0.03797638104 +_jn3 0.9136849511 1 0.9136849511 + + + +******************************************************************************** + Iteration 9 +******************************************************************************** +λ message Alarm --> Burglar +λAlarm(b1) += [p(a1|b1,f1).πAlarm(f1) + p(a1|b1,f2).πAlarm(f2)].λ(a1) ++ [p(a2|b1,f1).πAlarm(f1) + p(a2|b1,f2).πAlarm(f2)].λ(a2) += [(0.992x0.0483387) + (0.99x0.951661)]x0.5 ++ [(0.008x0.0483387) + (0.01x0.951661)]x0.5 = 0.5 +λAlarm(b2) += [p(a1|b2,f1).πAlarm(f1) + p(a1|b2,f2).πAlarm(f2)].λ(a1) ++ [p(a2|b2,f1).πAlarm(f1) + p(a2|b2,f2).πAlarm(f2)].λ(a2) += [(0.2x0.0483387) + (0.003x0.951661)]x0.5 ++ [(0.8x0.0483387) + (0.997x0.951661)]x0.5 = 0.5 + +λ message Alarm --> FreightTruck +λAlarm(f1) += [p(a1|b1,f1).πAlarm(b1) + p(a1|b2,f1).πAlarm(b2)].λ(a1) ++ [p(a2|b1,f1).πAlarm(b1) + p(a2|b2,f1).πAlarm(b2)].λ(a2) += [(0.992x0.00693359) + (0.2x0.993066)]x0.5 ++ [(0.008x0.00693359) + (0.8x0.993066)]x0.5 = 0.5 +λAlarm(f2) += [p(a1|b1,f2).πAlarm(b1) + p(a1|b2,f2).πAlarm(b2)].λ(a1) ++ [p(a2|b1,f2).πAlarm(b1) + p(a2|b2,f2).πAlarm(b2)].λ(a2) += [(0.99x0.00693359) + (0.003x0.993066)]x0.5 ++ [(0.01x0.00693359) + (0.997x0.993066)]x0.5 = 0.5 + +λ message _Jn --> FreightTruck +λ_Jn(f1) += [p(_jn0|f1,a1).π_Jn(a1) + p(_jn0|f1,a2).π_Jn(a2)].λ(_jn0) ++ [p(_jn1|f1,a1).π_Jn(a1) + p(_jn1|f1,a2).π_Jn(a2)].λ(_jn1) ++ [p(_jn2|f1,a1).π_Jn(a1) + p(_jn2|f1,a2).π_Jn(a2)].λ(_jn2) ++ [p(_jn3|f1,a1).π_Jn(a1) + p(_jn3|f1,a2).π_Jn(a2)].λ(_jn3) += [(1x0.0399054) + (0x0.960095)]x1 ++ [(0x0.0399054) + (1x0.960095)]x1 ++ [(0x0.0399054) + (0x0.960095)]x1 ++ [(0x0.0399054) + (0x0.960095)]x1 = 1 +λ_Jn(f2) += [p(_jn0|f2,a1).π_Jn(a1) + p(_jn0|f2,a2).π_Jn(a2)].λ(_jn0) ++ [p(_jn1|f2,a1).π_Jn(a1) + p(_jn1|f2,a2).π_Jn(a2)].λ(_jn1) ++ [p(_jn2|f2,a1).π_Jn(a1) + p(_jn2|f2,a2).π_Jn(a2)].λ(_jn2) ++ [p(_jn3|f2,a1).π_Jn(a1) + p(_jn3|f2,a2).π_Jn(a2)].λ(_jn3) += [(0x0.0399054) + (0x0.960095)]x1 ++ [(0x0.0399054) + (0x0.960095)]x1 ++ [(1x0.0399054) + (0x0.960095)]x1 ++ [(0x0.0399054) + (1x0.960095)]x1 = 1 + +λ message _Jn --> Alarm +λ_Jn(a1) += [p(_jn0|f1,a1).π_Jn(f1) + p(_jn0|f2,a1).π_Jn(f2)].λ(_jn0) ++ [p(_jn1|f1,a1).π_Jn(f1) + p(_jn1|f2,a1).π_Jn(f2)].λ(_jn1) ++ [p(_jn2|f1,a1).π_Jn(f1) + p(_jn2|f2,a1).π_Jn(f2)].λ(_jn2) ++ [p(_jn3|f1,a1).π_Jn(f1) + p(_jn3|f2,a1).π_Jn(f2)].λ(_jn3) += [(1x0.0483387) + (0x0.951661)]x1 ++ [(0x0.0483387) + (0x0.951661)]x1 ++ [(0x0.0483387) + (1x0.951661)]x1 ++ [(0x0.0483387) + (0x0.951661)]x1 = 1 +λ_Jn(a2) += [p(_jn0|f1,a2).π_Jn(f1) + p(_jn0|f2,a2).π_Jn(f2)].λ(_jn0) ++ [p(_jn1|f1,a2).π_Jn(f1) + p(_jn1|f2,a2).π_Jn(f2)].λ(_jn1) ++ [p(_jn2|f1,a2).π_Jn(f1) + p(_jn2|f2,a2).π_Jn(f2)].λ(_jn2) ++ [p(_jn3|f1,a2).π_Jn(f1) + p(_jn3|f2,a2).π_Jn(f2)].λ(_jn3) += [(0x0.0483387) + (0x0.951661)]x1 ++ [(1x0.0483387) + (0x0.951661)]x1 ++ [(0x0.0483387) + (0x0.951661)]x1 ++ [(0x0.0483387) + (1x0.951661)]x1 = 1 + +π message Burglar --> Alarm +πAlarm(b1) = π(b1) = 0.005 = 0.005 +πAlarm(b2) = π(b2) = 0.995 = 0.995 + +π message FreightTruck --> Alarm +πAlarm(f1) = π(f1).λ_Jn(f1) = 0.03 x 0.5 = 0.015 +πAlarm(f2) = π(f2).λ_Jn(f2) = 0.97 x 0.5 = 0.485 + +π message FreightTruck --> _Jn +π_Jn(f1) = π(f1).λAlarm(f1) = 0.03 x 0.5 = 0.015 +π_Jn(f2) = π(f2).λAlarm(f2) = 0.97 x 0.5 = 0.485 + +π message Alarm --> _Jn +π_Jn(a1) = π(a1) = 0.0193008 = 0.01930081827 +π_Jn(a2) = π(a2) = 0.980699 = 0.9806991817 + +var Burglar: +π(b1) += p(b1) += (0.005) = 0.005 +π(b2) += p(b2) += (0.995) = 0.995 +λ(b1) = λAlarm(b1) = 0.5 = 0.5 +λ(b2) = λAlarm(b2) = 0.5 = 0.5 +belief change = 0 + +var FreightTruck: +π(f1) += p(f1) += (0.03) = 0.03 +π(f2) += p(f2) += (0.97) = 0.97 +λ(f1) = λAlarm(f1).λ_Jn(f1) = 0.5 x 0.5 = 0.25 +λ(f2) = λAlarm(f2).λ_Jn(f2) = 0.5 x 0.5 = 0.25 +belief change = 0 + +var Alarm: +π(a1) += p(a1|b1,f1).πAlarm(b1).πAlarm(f1) ++ p(a1|b1,f2).πAlarm(b1).πAlarm(f2) ++ p(a1|b2,f1).πAlarm(b2).πAlarm(f1) ++ p(a1|b2,f2).πAlarm(b2).πAlarm(f2) += (0.992x0.0059668x0.0422258) ++ (0.99x0.0059668x0.957774) ++ (0.2x0.994033x0.0422258) ++ (0.003x0.994033x0.957774) = 0.01715857613 +π(a2) += p(a2|b1,f1).πAlarm(b1).πAlarm(f1) ++ p(a2|b1,f2).πAlarm(b1).πAlarm(f2) ++ p(a2|b2,f1).πAlarm(b2).πAlarm(f1) ++ p(a2|b2,f2).πAlarm(b2).πAlarm(f2) += (0.008x0.0059668x0.0422258) ++ (0.01x0.0059668x0.957774) ++ (0.8x0.994033x0.0422258) ++ (0.997x0.994033x0.957774) = 0.9828414239 +λ(a1) = λ_Jn(a1) = 0.5 = 0.5 +λ(a2) = λ_Jn(a2) = 0.5 = 0.5 +belief change = 0.004284484277 + +var _Jn: +π(_jn0) += p(_jn0|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn0|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn0|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn0|f2,a2).π_Jn(f2).π_Jn(a2) += (1x0.0422258x0.0296031) ++ (0x0.0422258x0.970397) ++ (0x0.957774x0.0296031) ++ (0x0.957774x0.970397) = 0.001250013332 +π(_jn1) += p(_jn1|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn1|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn1|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn1|f2,a2).π_Jn(f2).π_Jn(a2) += (0x0.0422258x0.0296031) ++ (1x0.0422258x0.970397) ++ (0x0.957774x0.0296031) ++ (0x0.957774x0.970397) = 0.04097576526 +π(_jn2) += p(_jn2|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn2|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn2|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn2|f2,a2).π_Jn(f2).π_Jn(a2) += (0x0.0422258x0.0296031) ++ (0x0.0422258x0.970397) ++ (1x0.957774x0.0296031) ++ (0x0.957774x0.970397) = 0.02835307212 +π(_jn3) += p(_jn3|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn3|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn3|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn3|f2,a2).π_Jn(f2).π_Jn(a2) += (0x0.0422258x0.0296031) ++ (0x0.0422258x0.970397) ++ (0x0.957774x0.0296031) ++ (1x0.957774x0.970397) = 0.9294211493 +λ(_jn0) = 1 +λ(_jn1) = 1 +λ(_jn2) = 1 +λ(_jn3) = 1 +belief change = 0.03147239643 + +domain π(Burglar) λ(Burglar) belief +---------------------------------------------------------------- +b1 0.005 0.5 0.005 +b2 0.995 0.5 0.995 + +domain πAlarm(Burglar) λAlarm(Burglar) +---------------------------------------------------------------- +b1 0.005966796875 0.5 +b2 0.9940332031 0.5 + +domain π(FreightTruck) λ(FreightTruck) belief +---------------------------------------------------------------- +f1 0.03 0.25 0.03 +f2 0.97 0.25 0.97 + +domain πAlarm(FreightTruck) λAlarm(FreightTruck) +---------------------------------------------------------------- +f1 0.04222577859 0.5 +f2 0.9577742214 0.5 + +domain π_Jn(FreightTruck) λ_Jn(FreightTruck) +---------------------------------------------------------------- +f1 0.04222577859 0.5 +f2 0.9577742214 0.5 + +domain π(Alarm) λ(Alarm) belief +---------------------------------------------------------------- +a1 0.01715857613 0.5 0.01715857613 +a2 0.9828414239 0.5 0.9828414239 + +domain π_Jn(Alarm) λ_Jn(Alarm) +---------------------------------------------------------------- +a1 0.02960308545 0.5 +a2 0.9703969146 0.5 + +domain π(_Jn) λ(_Jn) belief +---------------------------------------------------------------- +_jn0 0.001250013332 1 0.001250013332 +_jn1 0.04097576526 1 0.04097576526 +_jn2 0.02835307212 1 0.02835307212 +_jn3 0.9294211493 1 0.9294211493 + + + +******************************************************************************** + Iteration 10 +******************************************************************************** +λ message Alarm --> Burglar +λAlarm(b1) += [p(a1|b1,f1).πAlarm(f1) + p(a1|b1,f2).πAlarm(f2)].λ(a1) ++ [p(a2|b1,f1).πAlarm(f1) + p(a2|b1,f2).πAlarm(f2)].λ(a2) += [(0.992x0.0422258) + (0.99x0.957774)]x0.5 ++ [(0.008x0.0422258) + (0.01x0.957774)]x0.5 = 0.5 +λAlarm(b2) += [p(a1|b2,f1).πAlarm(f1) + p(a1|b2,f2).πAlarm(f2)].λ(a1) ++ [p(a2|b2,f1).πAlarm(f1) + p(a2|b2,f2).πAlarm(f2)].λ(a2) += [(0.2x0.0422258) + (0.003x0.957774)]x0.5 ++ [(0.8x0.0422258) + (0.997x0.957774)]x0.5 = 0.5 + +λ message Alarm --> FreightTruck +λAlarm(f1) += [p(a1|b1,f1).πAlarm(b1) + p(a1|b2,f1).πAlarm(b2)].λ(a1) ++ [p(a2|b1,f1).πAlarm(b1) + p(a2|b2,f1).πAlarm(b2)].λ(a2) += [(0.992x0.0059668) + (0.2x0.994033)]x0.5 ++ [(0.008x0.0059668) + (0.8x0.994033)]x0.5 = 0.5 +λAlarm(f2) += [p(a1|b1,f2).πAlarm(b1) + p(a1|b2,f2).πAlarm(b2)].λ(a1) ++ [p(a2|b1,f2).πAlarm(b1) + p(a2|b2,f2).πAlarm(b2)].λ(a2) += [(0.99x0.0059668) + (0.003x0.994033)]x0.5 ++ [(0.01x0.0059668) + (0.997x0.994033)]x0.5 = 0.5 + +λ message _Jn --> FreightTruck +λ_Jn(f1) += [p(_jn0|f1,a1).π_Jn(a1) + p(_jn0|f1,a2).π_Jn(a2)].λ(_jn0) ++ [p(_jn1|f1,a1).π_Jn(a1) + p(_jn1|f1,a2).π_Jn(a2)].λ(_jn1) ++ [p(_jn2|f1,a1).π_Jn(a1) + p(_jn2|f1,a2).π_Jn(a2)].λ(_jn2) ++ [p(_jn3|f1,a1).π_Jn(a1) + p(_jn3|f1,a2).π_Jn(a2)].λ(_jn3) += [(1x0.0296031) + (0x0.970397)]x1 ++ [(0x0.0296031) + (1x0.970397)]x1 ++ [(0x0.0296031) + (0x0.970397)]x1 ++ [(0x0.0296031) + (0x0.970397)]x1 = 1 +λ_Jn(f2) += [p(_jn0|f2,a1).π_Jn(a1) + p(_jn0|f2,a2).π_Jn(a2)].λ(_jn0) ++ [p(_jn1|f2,a1).π_Jn(a1) + p(_jn1|f2,a2).π_Jn(a2)].λ(_jn1) ++ [p(_jn2|f2,a1).π_Jn(a1) + p(_jn2|f2,a2).π_Jn(a2)].λ(_jn2) ++ [p(_jn3|f2,a1).π_Jn(a1) + p(_jn3|f2,a2).π_Jn(a2)].λ(_jn3) += [(0x0.0296031) + (0x0.970397)]x1 ++ [(0x0.0296031) + (0x0.970397)]x1 ++ [(1x0.0296031) + (0x0.970397)]x1 ++ [(0x0.0296031) + (1x0.970397)]x1 = 1 + +λ message _Jn --> Alarm +λ_Jn(a1) += [p(_jn0|f1,a1).π_Jn(f1) + p(_jn0|f2,a1).π_Jn(f2)].λ(_jn0) ++ [p(_jn1|f1,a1).π_Jn(f1) + p(_jn1|f2,a1).π_Jn(f2)].λ(_jn1) ++ [p(_jn2|f1,a1).π_Jn(f1) + p(_jn2|f2,a1).π_Jn(f2)].λ(_jn2) ++ [p(_jn3|f1,a1).π_Jn(f1) + p(_jn3|f2,a1).π_Jn(f2)].λ(_jn3) += [(1x0.0422258) + (0x0.957774)]x1 ++ [(0x0.0422258) + (0x0.957774)]x1 ++ [(0x0.0422258) + (1x0.957774)]x1 ++ [(0x0.0422258) + (0x0.957774)]x1 = 1 +λ_Jn(a2) += [p(_jn0|f1,a2).π_Jn(f1) + p(_jn0|f2,a2).π_Jn(f2)].λ(_jn0) ++ [p(_jn1|f1,a2).π_Jn(f1) + p(_jn1|f2,a2).π_Jn(f2)].λ(_jn1) ++ [p(_jn2|f1,a2).π_Jn(f1) + p(_jn2|f2,a2).π_Jn(f2)].λ(_jn2) ++ [p(_jn3|f1,a2).π_Jn(f1) + p(_jn3|f2,a2).π_Jn(f2)].λ(_jn3) += [(0x0.0422258) + (0x0.957774)]x1 ++ [(1x0.0422258) + (0x0.957774)]x1 ++ [(0x0.0422258) + (0x0.957774)]x1 ++ [(0x0.0422258) + (1x0.957774)]x1 = 1 + +π message Burglar --> Alarm +πAlarm(b1) = π(b1) = 0.005 = 0.005 +πAlarm(b2) = π(b2) = 0.995 = 0.995 + +π message FreightTruck --> Alarm +πAlarm(f1) = π(f1).λ_Jn(f1) = 0.03 x 0.5 = 0.015 +πAlarm(f2) = π(f2).λ_Jn(f2) = 0.97 x 0.5 = 0.485 + +π message FreightTruck --> _Jn +π_Jn(f1) = π(f1).λAlarm(f1) = 0.03 x 0.5 = 0.015 +π_Jn(f2) = π(f2).λAlarm(f2) = 0.97 x 0.5 = 0.485 + +π message Alarm --> _Jn +π_Jn(a1) = π(a1) = 0.0171586 = 0.01715857613 +π_Jn(a2) = π(a2) = 0.982841 = 0.9828414239 + +var Burglar: +π(b1) += p(b1) += (0.005) = 0.005 +π(b2) += p(b2) += (0.995) = 0.995 +λ(b1) = λAlarm(b1) = 0.5 = 0.5 +λ(b2) = λAlarm(b2) = 0.5 = 0.5 +belief change = 0 + +var FreightTruck: +π(f1) += p(f1) += (0.03) = 0.03 +π(f2) += p(f2) += (0.97) = 0.97 +λ(f1) = λAlarm(f1).λ_Jn(f1) = 0.5 x 0.5 = 0.25 +λ(f2) = λAlarm(f2).λ_Jn(f2) = 0.5 x 0.5 = 0.25 +belief change = 0 + +var Alarm: +π(a1) += p(a1|b1,f1).πAlarm(b1).πAlarm(f1) ++ p(a1|b1,f2).πAlarm(b1).πAlarm(f2) ++ p(a1|b2,f1).πAlarm(b2).πAlarm(f1) ++ p(a1|b2,f2).πAlarm(b2).πAlarm(f2) += (0.992x0.0054834x0.0381505) ++ (0.99x0.0054834x0.961849) ++ (0.2x0.994517x0.0381505) ++ (0.003x0.994517x0.961849) = 0.01588697359 +π(a2) += p(a2|b1,f1).πAlarm(b1).πAlarm(f1) ++ p(a2|b1,f2).πAlarm(b1).πAlarm(f2) ++ p(a2|b2,f1).πAlarm(b2).πAlarm(f1) ++ p(a2|b2,f2).πAlarm(b2).πAlarm(f2) += (0.008x0.0054834x0.0381505) ++ (0.01x0.0054834x0.961849) ++ (0.8x0.994517x0.0381505) ++ (0.997x0.994517x0.961849) = 0.9841130264 +λ(a1) = λ_Jn(a1) = 0.5 = 0.5 +λ(a2) = λ_Jn(a2) = 0.5 = 0.5 +belief change = 0.002543205093 + +var _Jn: +π(_jn0) += p(_jn0|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn0|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn0|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn0|f2,a2).π_Jn(f2).π_Jn(a2) += (1x0.0381505x0.0233808) ++ (0x0.0381505x0.976619) ++ (0x0.961849x0.0233808) ++ (0x0.961849x0.976619) = 0.0008919908307 +π(_jn1) += p(_jn1|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn1|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn1|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn1|f2,a2).π_Jn(f2).π_Jn(a2) += (0x0.0381505x0.0233808) ++ (1x0.0381505x0.976619) ++ (0x0.961849x0.0233808) ++ (0x0.961849x0.976619) = 0.03725852823 +π(_jn2) += p(_jn2|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn2|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn2|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn2|f2,a2).π_Jn(f2).π_Jn(a2) += (0x0.0381505x0.0233808) ++ (0x0.0381505x0.976619) ++ (1x0.961849x0.0233808) ++ (0x0.961849x0.976619) = 0.02248883996 +π(_jn3) += p(_jn3|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn3|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn3|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn3|f2,a2).π_Jn(f2).π_Jn(a2) += (0x0.0381505x0.0233808) ++ (0x0.0381505x0.976619) ++ (0x0.961849x0.0233808) ++ (1x0.961849x0.976619) = 0.939360641 +λ(_jn0) = 1 +λ(_jn1) = 1 +λ(_jn2) = 1 +λ(_jn3) = 1 +belief change = 0.01987898337 + +domain π(Burglar) λ(Burglar) belief +---------------------------------------------------------------- +b1 0.005 0.5 0.005 +b2 0.995 0.5 0.995 + +domain πAlarm(Burglar) λAlarm(Burglar) +---------------------------------------------------------------- +b1 0.005483398438 0.5 +b2 0.9945166016 0.5 + +domain π(FreightTruck) λ(FreightTruck) belief +---------------------------------------------------------------- +f1 0.03 0.25 0.03 +f2 0.97 0.25 0.97 + +domain πAlarm(FreightTruck) λAlarm(FreightTruck) +---------------------------------------------------------------- +f1 0.03815051906 0.5 +f2 0.9618494809 0.5 + +domain π_Jn(FreightTruck) λ_Jn(FreightTruck) +---------------------------------------------------------------- +f1 0.03815051906 0.5 +f2 0.9618494809 0.5 + +domain π(Alarm) λ(Alarm) belief +---------------------------------------------------------------- +a1 0.01588697359 0.5 0.01588697359 +a2 0.9841130264 0.5 0.9841130264 + +domain π_Jn(Alarm) λ_Jn(Alarm) +---------------------------------------------------------------- +a1 0.02338083079 0.5 +a2 0.9766191692 0.5 + +domain π(_Jn) λ(_Jn) belief +---------------------------------------------------------------- +_jn0 0.0008919908307 1 0.0008919908307 +_jn1 0.03725852823 1 0.03725852823 +_jn2 0.02248883996 1 0.02248883996 +_jn3 0.939360641 1 0.939360641 + + + +******************************************************************************** + Iteration 11 +******************************************************************************** +λ message Alarm --> Burglar +λAlarm(b1) += [p(a1|b1,f1).πAlarm(f1) + p(a1|b1,f2).πAlarm(f2)].λ(a1) ++ [p(a2|b1,f1).πAlarm(f1) + p(a2|b1,f2).πAlarm(f2)].λ(a2) += [(0.992x0.0381505) + (0.99x0.961849)]x0.5 ++ [(0.008x0.0381505) + (0.01x0.961849)]x0.5 = 0.5 +λAlarm(b2) += [p(a1|b2,f1).πAlarm(f1) + p(a1|b2,f2).πAlarm(f2)].λ(a1) ++ [p(a2|b2,f1).πAlarm(f1) + p(a2|b2,f2).πAlarm(f2)].λ(a2) += [(0.2x0.0381505) + (0.003x0.961849)]x0.5 ++ [(0.8x0.0381505) + (0.997x0.961849)]x0.5 = 0.5 + +λ message Alarm --> FreightTruck +λAlarm(f1) += [p(a1|b1,f1).πAlarm(b1) + p(a1|b2,f1).πAlarm(b2)].λ(a1) ++ [p(a2|b1,f1).πAlarm(b1) + p(a2|b2,f1).πAlarm(b2)].λ(a2) += [(0.992x0.0054834) + (0.2x0.994517)]x0.5 ++ [(0.008x0.0054834) + (0.8x0.994517)]x0.5 = 0.5 +λAlarm(f2) += [p(a1|b1,f2).πAlarm(b1) + p(a1|b2,f2).πAlarm(b2)].λ(a1) ++ [p(a2|b1,f2).πAlarm(b1) + p(a2|b2,f2).πAlarm(b2)].λ(a2) += [(0.99x0.0054834) + (0.003x0.994517)]x0.5 ++ [(0.01x0.0054834) + (0.997x0.994517)]x0.5 = 0.5 + +λ message _Jn --> FreightTruck +λ_Jn(f1) += [p(_jn0|f1,a1).π_Jn(a1) + p(_jn0|f1,a2).π_Jn(a2)].λ(_jn0) ++ [p(_jn1|f1,a1).π_Jn(a1) + p(_jn1|f1,a2).π_Jn(a2)].λ(_jn1) ++ [p(_jn2|f1,a1).π_Jn(a1) + p(_jn2|f1,a2).π_Jn(a2)].λ(_jn2) ++ [p(_jn3|f1,a1).π_Jn(a1) + p(_jn3|f1,a2).π_Jn(a2)].λ(_jn3) += [(1x0.0233808) + (0x0.976619)]x1 ++ [(0x0.0233808) + (1x0.976619)]x1 ++ [(0x0.0233808) + (0x0.976619)]x1 ++ [(0x0.0233808) + (0x0.976619)]x1 = 1 +λ_Jn(f2) += [p(_jn0|f2,a1).π_Jn(a1) + p(_jn0|f2,a2).π_Jn(a2)].λ(_jn0) ++ [p(_jn1|f2,a1).π_Jn(a1) + p(_jn1|f2,a2).π_Jn(a2)].λ(_jn1) ++ [p(_jn2|f2,a1).π_Jn(a1) + p(_jn2|f2,a2).π_Jn(a2)].λ(_jn2) ++ [p(_jn3|f2,a1).π_Jn(a1) + p(_jn3|f2,a2).π_Jn(a2)].λ(_jn3) += [(0x0.0233808) + (0x0.976619)]x1 ++ [(0x0.0233808) + (0x0.976619)]x1 ++ [(1x0.0233808) + (0x0.976619)]x1 ++ [(0x0.0233808) + (1x0.976619)]x1 = 1 + +λ message _Jn --> Alarm +λ_Jn(a1) += [p(_jn0|f1,a1).π_Jn(f1) + p(_jn0|f2,a1).π_Jn(f2)].λ(_jn0) ++ [p(_jn1|f1,a1).π_Jn(f1) + p(_jn1|f2,a1).π_Jn(f2)].λ(_jn1) ++ [p(_jn2|f1,a1).π_Jn(f1) + p(_jn2|f2,a1).π_Jn(f2)].λ(_jn2) ++ [p(_jn3|f1,a1).π_Jn(f1) + p(_jn3|f2,a1).π_Jn(f2)].λ(_jn3) += [(1x0.0381505) + (0x0.961849)]x1 ++ [(0x0.0381505) + (0x0.961849)]x1 ++ [(0x0.0381505) + (1x0.961849)]x1 ++ [(0x0.0381505) + (0x0.961849)]x1 = 1 +λ_Jn(a2) += [p(_jn0|f1,a2).π_Jn(f1) + p(_jn0|f2,a2).π_Jn(f2)].λ(_jn0) ++ [p(_jn1|f1,a2).π_Jn(f1) + p(_jn1|f2,a2).π_Jn(f2)].λ(_jn1) ++ [p(_jn2|f1,a2).π_Jn(f1) + p(_jn2|f2,a2).π_Jn(f2)].λ(_jn2) ++ [p(_jn3|f1,a2).π_Jn(f1) + p(_jn3|f2,a2).π_Jn(f2)].λ(_jn3) += [(0x0.0381505) + (0x0.961849)]x1 ++ [(1x0.0381505) + (0x0.961849)]x1 ++ [(0x0.0381505) + (0x0.961849)]x1 ++ [(0x0.0381505) + (1x0.961849)]x1 = 1 + +π message Burglar --> Alarm +πAlarm(b1) = π(b1) = 0.005 = 0.005 +πAlarm(b2) = π(b2) = 0.995 = 0.995 + +π message FreightTruck --> Alarm +πAlarm(f1) = π(f1).λ_Jn(f1) = 0.03 x 0.5 = 0.015 +πAlarm(f2) = π(f2).λ_Jn(f2) = 0.97 x 0.5 = 0.485 + +π message FreightTruck --> _Jn +π_Jn(f1) = π(f1).λAlarm(f1) = 0.03 x 0.5 = 0.015 +π_Jn(f2) = π(f2).λAlarm(f2) = 0.97 x 0.5 = 0.485 + +π message Alarm --> _Jn +π_Jn(a1) = π(a1) = 0.015887 = 0.01588697359 +π_Jn(a2) = π(a2) = 0.984113 = 0.9841130264 + +var Burglar: +π(b1) += p(b1) += (0.005) = 0.005 +π(b2) += p(b2) += (0.995) = 0.995 +λ(b1) = λAlarm(b1) = 0.5 = 0.5 +λ(b2) = λAlarm(b2) = 0.5 = 0.5 +belief change = 0 + +var FreightTruck: +π(f1) += p(f1) += (0.03) = 0.03 +π(f2) += p(f2) += (0.97) = 0.97 +λ(f1) = λAlarm(f1).λ_Jn(f1) = 0.5 x 0.5 = 0.25 +λ(f2) = λAlarm(f2).λ_Jn(f2) = 0.5 x 0.5 = 0.25 +belief change = 0 + +var Alarm: +π(a1) += p(a1|b1,f1).πAlarm(b1).πAlarm(f1) ++ p(a1|b1,f2).πAlarm(b1).πAlarm(f2) ++ p(a1|b2,f1).πAlarm(b2).πAlarm(f1) ++ p(a1|b2,f2).πAlarm(b2).πAlarm(f2) += (0.992x0.0052417x0.0354337) ++ (0.99x0.0052417x0.964566) ++ (0.2x0.994758x0.0354337) ++ (0.003x0.994758x0.964566) = 0.01511777409 +π(a2) += p(a2|b1,f1).πAlarm(b1).πAlarm(f1) ++ p(a2|b1,f2).πAlarm(b1).πAlarm(f2) ++ p(a2|b2,f1).πAlarm(b2).πAlarm(f1) ++ p(a2|b2,f2).πAlarm(b2).πAlarm(f2) += (0.008x0.0052417x0.0354337) ++ (0.01x0.0052417x0.964566) ++ (0.8x0.994758x0.0354337) ++ (0.997x0.994758x0.964566) = 0.9848822259 +λ(a1) = λ_Jn(a1) = 0.5 = 0.5 +λ(a2) = λ_Jn(a2) = 0.5 = 0.5 +belief change = 0.00153839899 + +var _Jn: +π(_jn0) += p(_jn0|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn0|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn0|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn0|f2,a2).π_Jn(f2).π_Jn(a2) += (1x0.0354337x0.0196339) ++ (0x0.0354337x0.980366) ++ (0x0.964566x0.0196339) ++ (0x0.964566x0.980366) = 0.000695701395 +π(_jn1) += p(_jn1|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn1|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn1|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn1|f2,a2).π_Jn(f2).π_Jn(a2) += (0x0.0354337x0.0196339) ++ (1x0.0354337x0.980366) ++ (0x0.964566x0.0196339) ++ (0x0.964566x0.980366) = 0.03473797798 +π(_jn2) += p(_jn2|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn2|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn2|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn2|f2,a2).π_Jn(f2).π_Jn(a2) += (0x0.0354337x0.0196339) ++ (0x0.0354337x0.980366) ++ (1x0.964566x0.0196339) ++ (0x0.964566x0.980366) = 0.01893820079 +π(_jn3) += p(_jn3|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn3|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn3|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn3|f2,a2).π_Jn(f2).π_Jn(a2) += (0x0.0354337x0.0196339) ++ (0x0.0354337x0.980366) ++ (0x0.964566x0.0196339) ++ (1x0.964566x0.980366) = 0.9456281198 +λ(_jn0) = 1 +λ(_jn1) = 1 +λ(_jn2) = 1 +λ(_jn3) = 1 +belief change = 0.01253495771 + +domain π(Burglar) λ(Burglar) belief +---------------------------------------------------------------- +b1 0.005 0.5 0.005 +b2 0.995 0.5 0.995 + +domain πAlarm(Burglar) λAlarm(Burglar) +---------------------------------------------------------------- +b1 0.005241699219 0.5 +b2 0.9947583008 0.5 + +domain π(FreightTruck) λ(FreightTruck) belief +---------------------------------------------------------------- +f1 0.03 0.25 0.03 +f2 0.97 0.25 0.97 + +domain πAlarm(FreightTruck) λAlarm(FreightTruck) +---------------------------------------------------------------- +f1 0.03543367937 0.5 +f2 0.9645663206 0.5 + +domain π_Jn(FreightTruck) λ_Jn(FreightTruck) +---------------------------------------------------------------- +f1 0.03543367937 0.5 +f2 0.9645663206 0.5 + +domain π(Alarm) λ(Alarm) belief +---------------------------------------------------------------- +a1 0.01511777409 0.5 0.01511777409 +a2 0.9848822259 0.5 0.9848822259 + +domain π_Jn(Alarm) λ_Jn(Alarm) +---------------------------------------------------------------- +a1 0.01963390219 0.5 +a2 0.9803660978 0.5 + +domain π(_Jn) λ(_Jn) belief +---------------------------------------------------------------- +_jn0 0.000695701395 1 0.000695701395 +_jn1 0.03473797798 1 0.03473797798 +_jn2 0.01893820079 1 0.01893820079 +_jn3 0.9456281198 1 0.9456281198 + + + +******************************************************************************** + Iteration 12 +******************************************************************************** +λ message Alarm --> Burglar +λAlarm(b1) += [p(a1|b1,f1).πAlarm(f1) + p(a1|b1,f2).πAlarm(f2)].λ(a1) ++ [p(a2|b1,f1).πAlarm(f1) + p(a2|b1,f2).πAlarm(f2)].λ(a2) += [(0.992x0.0354337) + (0.99x0.964566)]x0.5 ++ [(0.008x0.0354337) + (0.01x0.964566)]x0.5 = 0.5 +λAlarm(b2) += [p(a1|b2,f1).πAlarm(f1) + p(a1|b2,f2).πAlarm(f2)].λ(a1) ++ [p(a2|b2,f1).πAlarm(f1) + p(a2|b2,f2).πAlarm(f2)].λ(a2) += [(0.2x0.0354337) + (0.003x0.964566)]x0.5 ++ [(0.8x0.0354337) + (0.997x0.964566)]x0.5 = 0.5 + +λ message Alarm --> FreightTruck +λAlarm(f1) += [p(a1|b1,f1).πAlarm(b1) + p(a1|b2,f1).πAlarm(b2)].λ(a1) ++ [p(a2|b1,f1).πAlarm(b1) + p(a2|b2,f1).πAlarm(b2)].λ(a2) += [(0.992x0.0052417) + (0.2x0.994758)]x0.5 ++ [(0.008x0.0052417) + (0.8x0.994758)]x0.5 = 0.5 +λAlarm(f2) += [p(a1|b1,f2).πAlarm(b1) + p(a1|b2,f2).πAlarm(b2)].λ(a1) ++ [p(a2|b1,f2).πAlarm(b1) + p(a2|b2,f2).πAlarm(b2)].λ(a2) += [(0.99x0.0052417) + (0.003x0.994758)]x0.5 ++ [(0.01x0.0052417) + (0.997x0.994758)]x0.5 = 0.5 + +λ message _Jn --> FreightTruck +λ_Jn(f1) += [p(_jn0|f1,a1).π_Jn(a1) + p(_jn0|f1,a2).π_Jn(a2)].λ(_jn0) ++ [p(_jn1|f1,a1).π_Jn(a1) + p(_jn1|f1,a2).π_Jn(a2)].λ(_jn1) ++ [p(_jn2|f1,a1).π_Jn(a1) + p(_jn2|f1,a2).π_Jn(a2)].λ(_jn2) ++ [p(_jn3|f1,a1).π_Jn(a1) + p(_jn3|f1,a2).π_Jn(a2)].λ(_jn3) += [(1x0.0196339) + (0x0.980366)]x1 ++ [(0x0.0196339) + (1x0.980366)]x1 ++ [(0x0.0196339) + (0x0.980366)]x1 ++ [(0x0.0196339) + (0x0.980366)]x1 = 1 +λ_Jn(f2) += [p(_jn0|f2,a1).π_Jn(a1) + p(_jn0|f2,a2).π_Jn(a2)].λ(_jn0) ++ [p(_jn1|f2,a1).π_Jn(a1) + p(_jn1|f2,a2).π_Jn(a2)].λ(_jn1) ++ [p(_jn2|f2,a1).π_Jn(a1) + p(_jn2|f2,a2).π_Jn(a2)].λ(_jn2) ++ [p(_jn3|f2,a1).π_Jn(a1) + p(_jn3|f2,a2).π_Jn(a2)].λ(_jn3) += [(0x0.0196339) + (0x0.980366)]x1 ++ [(0x0.0196339) + (0x0.980366)]x1 ++ [(1x0.0196339) + (0x0.980366)]x1 ++ [(0x0.0196339) + (1x0.980366)]x1 = 1 + +λ message _Jn --> Alarm +λ_Jn(a1) += [p(_jn0|f1,a1).π_Jn(f1) + p(_jn0|f2,a1).π_Jn(f2)].λ(_jn0) ++ [p(_jn1|f1,a1).π_Jn(f1) + p(_jn1|f2,a1).π_Jn(f2)].λ(_jn1) ++ [p(_jn2|f1,a1).π_Jn(f1) + p(_jn2|f2,a1).π_Jn(f2)].λ(_jn2) ++ [p(_jn3|f1,a1).π_Jn(f1) + p(_jn3|f2,a1).π_Jn(f2)].λ(_jn3) += [(1x0.0354337) + (0x0.964566)]x1 ++ [(0x0.0354337) + (0x0.964566)]x1 ++ [(0x0.0354337) + (1x0.964566)]x1 ++ [(0x0.0354337) + (0x0.964566)]x1 = 1 +λ_Jn(a2) += [p(_jn0|f1,a2).π_Jn(f1) + p(_jn0|f2,a2).π_Jn(f2)].λ(_jn0) ++ [p(_jn1|f1,a2).π_Jn(f1) + p(_jn1|f2,a2).π_Jn(f2)].λ(_jn1) ++ [p(_jn2|f1,a2).π_Jn(f1) + p(_jn2|f2,a2).π_Jn(f2)].λ(_jn2) ++ [p(_jn3|f1,a2).π_Jn(f1) + p(_jn3|f2,a2).π_Jn(f2)].λ(_jn3) += [(0x0.0354337) + (0x0.964566)]x1 ++ [(1x0.0354337) + (0x0.964566)]x1 ++ [(0x0.0354337) + (0x0.964566)]x1 ++ [(0x0.0354337) + (1x0.964566)]x1 = 1 + +π message Burglar --> Alarm +πAlarm(b1) = π(b1) = 0.005 = 0.005 +πAlarm(b2) = π(b2) = 0.995 = 0.995 + +π message FreightTruck --> Alarm +πAlarm(f1) = π(f1).λ_Jn(f1) = 0.03 x 0.5 = 0.015 +πAlarm(f2) = π(f2).λ_Jn(f2) = 0.97 x 0.5 = 0.485 + +π message FreightTruck --> _Jn +π_Jn(f1) = π(f1).λAlarm(f1) = 0.03 x 0.5 = 0.015 +π_Jn(f2) = π(f2).λAlarm(f2) = 0.97 x 0.5 = 0.485 + +π message Alarm --> _Jn +π_Jn(a1) = π(a1) = 0.0151178 = 0.01511777409 +π_Jn(a2) = π(a2) = 0.984882 = 0.9848822259 + +var Burglar: +π(b1) += p(b1) += (0.005) = 0.005 +π(b2) += p(b2) += (0.995) = 0.995 +λ(b1) = λAlarm(b1) = 0.5 = 0.5 +λ(b2) = λAlarm(b2) = 0.5 = 0.5 +belief change = 0 + +var FreightTruck: +π(f1) += p(f1) += (0.03) = 0.03 +π(f2) += p(f2) += (0.97) = 0.97 +λ(f1) = λAlarm(f1).λ_Jn(f1) = 0.5 x 0.5 = 0.25 +λ(f2) = λAlarm(f2).λ_Jn(f2) = 0.5 x 0.5 = 0.25 +belief change = 0 + +var Alarm: +π(a1) += p(a1|b1,f1).πAlarm(b1).πAlarm(f1) ++ p(a1|b1,f2).πAlarm(b1).πAlarm(f2) ++ p(a1|b2,f1).πAlarm(b2).πAlarm(f1) ++ p(a1|b2,f2).πAlarm(b2).πAlarm(f2) += (0.992x0.00512085x0.0336225) ++ (0.99x0.00512085x0.966378) ++ (0.2x0.994879x0.0336225) ++ (0.003x0.994879x0.966378) = 0.01464432756 +π(a2) += p(a2|b1,f1).πAlarm(b1).πAlarm(f1) ++ p(a2|b1,f2).πAlarm(b1).πAlarm(f2) ++ p(a2|b2,f1).πAlarm(b2).πAlarm(f1) ++ p(a2|b2,f2).πAlarm(b2).πAlarm(f2) += (0.008x0.00512085x0.0336225) ++ (0.01x0.00512085x0.966378) ++ (0.8x0.994879x0.0336225) ++ (0.997x0.994879x0.966378) = 0.9853556724 +λ(a1) = λ_Jn(a1) = 0.5 = 0.5 +λ(a2) = λ_Jn(a2) = 0.5 = 0.5 +belief change = 0.0009468930591 + +var _Jn: +π(_jn0) += p(_jn0|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn0|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn0|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn0|f2,a2).π_Jn(f2).π_Jn(a2) += (1x0.0336225x0.0173758) ++ (0x0.0336225x0.982624) ++ (0x0.966378x0.0173758) ++ (0x0.966378x0.982624) = 0.0005842182997 +π(_jn1) += p(_jn1|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn1|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn1|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn1|f2,a2).π_Jn(f2).π_Jn(a2) += (0x0.0336225x0.0173758) ++ (1x0.0336225x0.982624) ++ (0x0.966378x0.0173758) ++ (0x0.966378x0.982624) = 0.03303823462 +π(_jn2) += p(_jn2|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn2|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn2|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn2|f2,a2).π_Jn(f2).π_Jn(a2) += (0x0.0336225x0.0173758) ++ (0x0.0336225x0.982624) ++ (1x0.966378x0.0173758) ++ (0x0.966378x0.982624) = 0.01679161984 +π(_jn3) += p(_jn3|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn3|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn3|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn3|f2,a2).π_Jn(f2).π_Jn(a2) += (0x0.0336225x0.0173758) ++ (0x0.0336225x0.982624) ++ (0x0.966378x0.0173758) ++ (1x0.966378x0.982624) = 0.9495859272 +λ(_jn0) = 1 +λ(_jn1) = 1 +λ(_jn2) = 1 +λ(_jn3) = 1 +belief change = 0.007915614822 + +domain π(Burglar) λ(Burglar) belief +---------------------------------------------------------------- +b1 0.005 0.5 0.005 +b2 0.995 0.5 0.995 + +domain πAlarm(Burglar) λAlarm(Burglar) +---------------------------------------------------------------- +b1 0.005120849609 0.5 +b2 0.9948791504 0.5 + +domain π(FreightTruck) λ(FreightTruck) belief +---------------------------------------------------------------- +f1 0.03 0.25 0.03 +f2 0.97 0.25 0.97 + +domain πAlarm(FreightTruck) λAlarm(FreightTruck) +---------------------------------------------------------------- +f1 0.03362245292 0.5 +f2 0.9663775471 0.5 + +domain π_Jn(FreightTruck) λ_Jn(FreightTruck) +---------------------------------------------------------------- +f1 0.03362245292 0.5 +f2 0.9663775471 0.5 + +domain π(Alarm) λ(Alarm) belief +---------------------------------------------------------------- +a1 0.01464432756 0.5 0.01464432756 +a2 0.9853556724 0.5 0.9853556724 + +domain π_Jn(Alarm) λ_Jn(Alarm) +---------------------------------------------------------------- +a1 0.01737583814 0.5 +a2 0.9826241619 0.5 + +domain π(_Jn) λ(_Jn) belief +---------------------------------------------------------------- +_jn0 0.0005842182997 1 0.0005842182997 +_jn1 0.03303823462 1 0.03303823462 +_jn2 0.01679161984 1 0.01679161984 +_jn3 0.9495859272 1 0.9495859272 + + + +******************************************************************************** + Iteration 13 +******************************************************************************** +λ message Alarm --> Burglar +λAlarm(b1) += [p(a1|b1,f1).πAlarm(f1) + p(a1|b1,f2).πAlarm(f2)].λ(a1) ++ [p(a2|b1,f1).πAlarm(f1) + p(a2|b1,f2).πAlarm(f2)].λ(a2) += [(0.992x0.0336225) + (0.99x0.966378)]x0.5 ++ [(0.008x0.0336225) + (0.01x0.966378)]x0.5 = 0.5 +λAlarm(b2) += [p(a1|b2,f1).πAlarm(f1) + p(a1|b2,f2).πAlarm(f2)].λ(a1) ++ [p(a2|b2,f1).πAlarm(f1) + p(a2|b2,f2).πAlarm(f2)].λ(a2) += [(0.2x0.0336225) + (0.003x0.966378)]x0.5 ++ [(0.8x0.0336225) + (0.997x0.966378)]x0.5 = 0.5 + +λ message Alarm --> FreightTruck +λAlarm(f1) += [p(a1|b1,f1).πAlarm(b1) + p(a1|b2,f1).πAlarm(b2)].λ(a1) ++ [p(a2|b1,f1).πAlarm(b1) + p(a2|b2,f1).πAlarm(b2)].λ(a2) += [(0.992x0.00512085) + (0.2x0.994879)]x0.5 ++ [(0.008x0.00512085) + (0.8x0.994879)]x0.5 = 0.5 +λAlarm(f2) += [p(a1|b1,f2).πAlarm(b1) + p(a1|b2,f2).πAlarm(b2)].λ(a1) ++ [p(a2|b1,f2).πAlarm(b1) + p(a2|b2,f2).πAlarm(b2)].λ(a2) += [(0.99x0.00512085) + (0.003x0.994879)]x0.5 ++ [(0.01x0.00512085) + (0.997x0.994879)]x0.5 = 0.5 + +λ message _Jn --> FreightTruck +λ_Jn(f1) += [p(_jn0|f1,a1).π_Jn(a1) + p(_jn0|f1,a2).π_Jn(a2)].λ(_jn0) ++ [p(_jn1|f1,a1).π_Jn(a1) + p(_jn1|f1,a2).π_Jn(a2)].λ(_jn1) ++ [p(_jn2|f1,a1).π_Jn(a1) + p(_jn2|f1,a2).π_Jn(a2)].λ(_jn2) ++ [p(_jn3|f1,a1).π_Jn(a1) + p(_jn3|f1,a2).π_Jn(a2)].λ(_jn3) += [(1x0.0173758) + (0x0.982624)]x1 ++ [(0x0.0173758) + (1x0.982624)]x1 ++ [(0x0.0173758) + (0x0.982624)]x1 ++ [(0x0.0173758) + (0x0.982624)]x1 = 1 +λ_Jn(f2) += [p(_jn0|f2,a1).π_Jn(a1) + p(_jn0|f2,a2).π_Jn(a2)].λ(_jn0) ++ [p(_jn1|f2,a1).π_Jn(a1) + p(_jn1|f2,a2).π_Jn(a2)].λ(_jn1) ++ [p(_jn2|f2,a1).π_Jn(a1) + p(_jn2|f2,a2).π_Jn(a2)].λ(_jn2) ++ [p(_jn3|f2,a1).π_Jn(a1) + p(_jn3|f2,a2).π_Jn(a2)].λ(_jn3) += [(0x0.0173758) + (0x0.982624)]x1 ++ [(0x0.0173758) + (0x0.982624)]x1 ++ [(1x0.0173758) + (0x0.982624)]x1 ++ [(0x0.0173758) + (1x0.982624)]x1 = 1 + +λ message _Jn --> Alarm +λ_Jn(a1) += [p(_jn0|f1,a1).π_Jn(f1) + p(_jn0|f2,a1).π_Jn(f2)].λ(_jn0) ++ [p(_jn1|f1,a1).π_Jn(f1) + p(_jn1|f2,a1).π_Jn(f2)].λ(_jn1) ++ [p(_jn2|f1,a1).π_Jn(f1) + p(_jn2|f2,a1).π_Jn(f2)].λ(_jn2) ++ [p(_jn3|f1,a1).π_Jn(f1) + p(_jn3|f2,a1).π_Jn(f2)].λ(_jn3) += [(1x0.0336225) + (0x0.966378)]x1 ++ [(0x0.0336225) + (0x0.966378)]x1 ++ [(0x0.0336225) + (1x0.966378)]x1 ++ [(0x0.0336225) + (0x0.966378)]x1 = 1 +λ_Jn(a2) += [p(_jn0|f1,a2).π_Jn(f1) + p(_jn0|f2,a2).π_Jn(f2)].λ(_jn0) ++ [p(_jn1|f1,a2).π_Jn(f1) + p(_jn1|f2,a2).π_Jn(f2)].λ(_jn1) ++ [p(_jn2|f1,a2).π_Jn(f1) + p(_jn2|f2,a2).π_Jn(f2)].λ(_jn2) ++ [p(_jn3|f1,a2).π_Jn(f1) + p(_jn3|f2,a2).π_Jn(f2)].λ(_jn3) += [(0x0.0336225) + (0x0.966378)]x1 ++ [(1x0.0336225) + (0x0.966378)]x1 ++ [(0x0.0336225) + (0x0.966378)]x1 ++ [(0x0.0336225) + (1x0.966378)]x1 = 1 + +π message Burglar --> Alarm +πAlarm(b1) = π(b1) = 0.005 = 0.005 +πAlarm(b2) = π(b2) = 0.995 = 0.995 + +π message FreightTruck --> Alarm +πAlarm(f1) = π(f1).λ_Jn(f1) = 0.03 x 0.5 = 0.015 +πAlarm(f2) = π(f2).λ_Jn(f2) = 0.97 x 0.5 = 0.485 + +π message FreightTruck --> _Jn +π_Jn(f1) = π(f1).λAlarm(f1) = 0.03 x 0.5 = 0.015 +π_Jn(f2) = π(f2).λAlarm(f2) = 0.97 x 0.5 = 0.485 + +π message Alarm --> _Jn +π_Jn(a1) = π(a1) = 0.0146443 = 0.01464432756 +π_Jn(a2) = π(a2) = 0.985356 = 0.9853556724 + +var Burglar: +π(b1) += p(b1) += (0.005) = 0.005 +π(b2) += p(b2) += (0.995) = 0.995 +λ(b1) = λAlarm(b1) = 0.5 = 0.5 +λ(b2) = λAlarm(b2) = 0.5 = 0.5 +belief change = 0 + +var FreightTruck: +π(f1) += p(f1) += (0.03) = 0.03 +π(f2) += p(f2) += (0.97) = 0.97 +λ(f1) = λAlarm(f1).λ_Jn(f1) = 0.5 x 0.5 = 0.25 +λ(f2) = λAlarm(f2).λ_Jn(f2) = 0.5 x 0.5 = 0.25 +belief change = 0 + +var Alarm: +π(a1) += p(a1|b1,f1).πAlarm(b1).πAlarm(f1) ++ p(a1|b1,f2).πAlarm(b1).πAlarm(f2) ++ p(a1|b2,f1).πAlarm(b2).πAlarm(f1) ++ p(a1|b2,f2).πAlarm(b2).πAlarm(f2) += (0.992x0.00506042x0.032415) ++ (0.99x0.00506042x0.967585) ++ (0.2x0.99494x0.032415) ++ (0.003x0.99494x0.967585) = 0.01434840156 +π(a2) += p(a2|b1,f1).πAlarm(b1).πAlarm(f1) ++ p(a2|b1,f2).πAlarm(b1).πAlarm(f2) ++ p(a2|b2,f1).πAlarm(b2).πAlarm(f1) ++ p(a2|b2,f2).πAlarm(b2).πAlarm(f2) += (0.008x0.00506042x0.032415) ++ (0.01x0.00506042x0.967585) ++ (0.8x0.99494x0.032415) ++ (0.997x0.99494x0.967585) = 0.9856515984 +λ(a1) = λ_Jn(a1) = 0.5 = 0.5 +λ(a2) = λ_Jn(a2) = 0.5 = 0.5 +belief change = 0.0005918519954 + +var _Jn: +π(_jn0) += p(_jn0|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn0|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn0|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn0|f2,a2).π_Jn(f2).π_Jn(a2) += (1x0.032415x0.0160101) ++ (0x0.032415x0.98399) ++ (0x0.967585x0.0160101) ++ (0x0.967585x0.98399) = 0.0005189663331 +π(_jn1) += p(_jn1|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn1|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn1|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn1|f2,a2).π_Jn(f2).π_Jn(a2) += (0x0.032415x0.0160101) ++ (1x0.032415x0.98399) ++ (0x0.967585x0.0160101) ++ (0x0.967585x0.98399) = 0.03189600228 +π(_jn2) += p(_jn2|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn2|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn2|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn2|f2,a2).π_Jn(f2).π_Jn(a2) += (0x0.032415x0.0160101) ++ (0x0.032415x0.98399) ++ (1x0.967585x0.0160101) ++ (0x0.967585x0.98399) = 0.01549111652 +π(_jn3) += p(_jn3|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn3|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn3|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn3|f2,a2).π_Jn(f2).π_Jn(a2) += (0x0.032415x0.0160101) ++ (0x0.032415x0.98399) ++ (0x0.967585x0.0160101) ++ (1x0.967585x0.98399) = 0.9520939149 +λ(_jn0) = 1 +λ(_jn1) = 1 +λ(_jn2) = 1 +λ(_jn3) = 1 +belief change = 0.005015975255 + +domain π(Burglar) λ(Burglar) belief +---------------------------------------------------------------- +b1 0.005 0.5 0.005 +b2 0.995 0.5 0.995 + +domain πAlarm(Burglar) λAlarm(Burglar) +---------------------------------------------------------------- +b1 0.005060424805 0.5 +b2 0.9949395752 0.5 + +domain π(FreightTruck) λ(FreightTruck) belief +---------------------------------------------------------------- +f1 0.03 0.25 0.03 +f2 0.97 0.25 0.97 + +domain πAlarm(FreightTruck) λAlarm(FreightTruck) +---------------------------------------------------------------- +f1 0.03241496861 0.5 +f2 0.9675850314 0.5 + +domain π_Jn(FreightTruck) λ_Jn(FreightTruck) +---------------------------------------------------------------- +f1 0.03241496861 0.5 +f2 0.9675850314 0.5 + +domain π(Alarm) λ(Alarm) belief +---------------------------------------------------------------- +a1 0.01434840156 0.5 0.01434840156 +a2 0.9856515984 0.5 0.9856515984 + +domain π_Jn(Alarm) λ_Jn(Alarm) +---------------------------------------------------------------- +a1 0.01601008285 0.5 +a2 0.9839899171 0.5 + +domain π(_Jn) λ(_Jn) belief +---------------------------------------------------------------- +_jn0 0.0005189663331 1 0.0005189663331 +_jn1 0.03189600228 1 0.03189600228 +_jn2 0.01549111652 1 0.01549111652 +_jn3 0.9520939149 1 0.9520939149 + + + +******************************************************************************** + Iteration 14 +******************************************************************************** +λ message Alarm --> Burglar +λAlarm(b1) += [p(a1|b1,f1).πAlarm(f1) + p(a1|b1,f2).πAlarm(f2)].λ(a1) ++ [p(a2|b1,f1).πAlarm(f1) + p(a2|b1,f2).πAlarm(f2)].λ(a2) += [(0.992x0.032415) + (0.99x0.967585)]x0.5 ++ [(0.008x0.032415) + (0.01x0.967585)]x0.5 = 0.5 +λAlarm(b2) += [p(a1|b2,f1).πAlarm(f1) + p(a1|b2,f2).πAlarm(f2)].λ(a1) ++ [p(a2|b2,f1).πAlarm(f1) + p(a2|b2,f2).πAlarm(f2)].λ(a2) += [(0.2x0.032415) + (0.003x0.967585)]x0.5 ++ [(0.8x0.032415) + (0.997x0.967585)]x0.5 = 0.5 + +λ message Alarm --> FreightTruck +λAlarm(f1) += [p(a1|b1,f1).πAlarm(b1) + p(a1|b2,f1).πAlarm(b2)].λ(a1) ++ [p(a2|b1,f1).πAlarm(b1) + p(a2|b2,f1).πAlarm(b2)].λ(a2) += [(0.992x0.00506042) + (0.2x0.99494)]x0.5 ++ [(0.008x0.00506042) + (0.8x0.99494)]x0.5 = 0.5 +λAlarm(f2) += [p(a1|b1,f2).πAlarm(b1) + p(a1|b2,f2).πAlarm(b2)].λ(a1) ++ [p(a2|b1,f2).πAlarm(b1) + p(a2|b2,f2).πAlarm(b2)].λ(a2) += [(0.99x0.00506042) + (0.003x0.99494)]x0.5 ++ [(0.01x0.00506042) + (0.997x0.99494)]x0.5 = 0.5 + +λ message _Jn --> FreightTruck +λ_Jn(f1) += [p(_jn0|f1,a1).π_Jn(a1) + p(_jn0|f1,a2).π_Jn(a2)].λ(_jn0) ++ [p(_jn1|f1,a1).π_Jn(a1) + p(_jn1|f1,a2).π_Jn(a2)].λ(_jn1) ++ [p(_jn2|f1,a1).π_Jn(a1) + p(_jn2|f1,a2).π_Jn(a2)].λ(_jn2) ++ [p(_jn3|f1,a1).π_Jn(a1) + p(_jn3|f1,a2).π_Jn(a2)].λ(_jn3) += [(1x0.0160101) + (0x0.98399)]x1 ++ [(0x0.0160101) + (1x0.98399)]x1 ++ [(0x0.0160101) + (0x0.98399)]x1 ++ [(0x0.0160101) + (0x0.98399)]x1 = 1 +λ_Jn(f2) += [p(_jn0|f2,a1).π_Jn(a1) + p(_jn0|f2,a2).π_Jn(a2)].λ(_jn0) ++ [p(_jn1|f2,a1).π_Jn(a1) + p(_jn1|f2,a2).π_Jn(a2)].λ(_jn1) ++ [p(_jn2|f2,a1).π_Jn(a1) + p(_jn2|f2,a2).π_Jn(a2)].λ(_jn2) ++ [p(_jn3|f2,a1).π_Jn(a1) + p(_jn3|f2,a2).π_Jn(a2)].λ(_jn3) += [(0x0.0160101) + (0x0.98399)]x1 ++ [(0x0.0160101) + (0x0.98399)]x1 ++ [(1x0.0160101) + (0x0.98399)]x1 ++ [(0x0.0160101) + (1x0.98399)]x1 = 1 + +λ message _Jn --> Alarm +λ_Jn(a1) += [p(_jn0|f1,a1).π_Jn(f1) + p(_jn0|f2,a1).π_Jn(f2)].λ(_jn0) ++ [p(_jn1|f1,a1).π_Jn(f1) + p(_jn1|f2,a1).π_Jn(f2)].λ(_jn1) ++ [p(_jn2|f1,a1).π_Jn(f1) + p(_jn2|f2,a1).π_Jn(f2)].λ(_jn2) ++ [p(_jn3|f1,a1).π_Jn(f1) + p(_jn3|f2,a1).π_Jn(f2)].λ(_jn3) += [(1x0.032415) + (0x0.967585)]x1 ++ [(0x0.032415) + (0x0.967585)]x1 ++ [(0x0.032415) + (1x0.967585)]x1 ++ [(0x0.032415) + (0x0.967585)]x1 = 1 +λ_Jn(a2) += [p(_jn0|f1,a2).π_Jn(f1) + p(_jn0|f2,a2).π_Jn(f2)].λ(_jn0) ++ [p(_jn1|f1,a2).π_Jn(f1) + p(_jn1|f2,a2).π_Jn(f2)].λ(_jn1) ++ [p(_jn2|f1,a2).π_Jn(f1) + p(_jn2|f2,a2).π_Jn(f2)].λ(_jn2) ++ [p(_jn3|f1,a2).π_Jn(f1) + p(_jn3|f2,a2).π_Jn(f2)].λ(_jn3) += [(0x0.032415) + (0x0.967585)]x1 ++ [(1x0.032415) + (0x0.967585)]x1 ++ [(0x0.032415) + (0x0.967585)]x1 ++ [(0x0.032415) + (1x0.967585)]x1 = 1 + +π message Burglar --> Alarm +πAlarm(b1) = π(b1) = 0.005 = 0.005 +πAlarm(b2) = π(b2) = 0.995 = 0.995 + +π message FreightTruck --> Alarm +πAlarm(f1) = π(f1).λ_Jn(f1) = 0.03 x 0.5 = 0.015 +πAlarm(f2) = π(f2).λ_Jn(f2) = 0.97 x 0.5 = 0.485 + +π message FreightTruck --> _Jn +π_Jn(f1) = π(f1).λAlarm(f1) = 0.03 x 0.5 = 0.015 +π_Jn(f2) = π(f2).λAlarm(f2) = 0.97 x 0.5 = 0.485 + +π message Alarm --> _Jn +π_Jn(a1) = π(a1) = 0.0143484 = 0.01434840156 +π_Jn(a2) = π(a2) = 0.985652 = 0.9856515984 + +var Burglar: +π(b1) += p(b1) += (0.005) = 0.005 +π(b2) += p(b2) += (0.995) = 0.995 +λ(b1) = λAlarm(b1) = 0.5 = 0.5 +λ(b2) = λAlarm(b2) = 0.5 = 0.5 +belief change = 0 + +var FreightTruck: +π(f1) += p(f1) += (0.03) = 0.03 +π(f2) += p(f2) += (0.97) = 0.97 +λ(f1) = λAlarm(f1).λ_Jn(f1) = 0.5 x 0.5 = 0.25 +λ(f2) = λAlarm(f2).λ_Jn(f2) = 0.5 x 0.5 = 0.25 +belief change = 0 + +var Alarm: +π(a1) += p(a1|b1,f1).πAlarm(b1).πAlarm(f1) ++ p(a1|b1,f2).πAlarm(b1).πAlarm(f2) ++ p(a1|b2,f1).πAlarm(b2).πAlarm(f1) ++ p(a1|b2,f2).πAlarm(b2).πAlarm(f2) += (0.992x0.00503021x0.03161) ++ (0.99x0.00503021x0.96839) ++ (0.2x0.99497x0.03161) ++ (0.003x0.99497x0.96839) = 0.01416097956 +π(a2) += p(a2|b1,f1).πAlarm(b1).πAlarm(f1) ++ p(a2|b1,f2).πAlarm(b1).πAlarm(f2) ++ p(a2|b2,f1).πAlarm(b2).πAlarm(f1) ++ p(a2|b2,f2).πAlarm(b2).πAlarm(f2) += (0.008x0.00503021x0.03161) ++ (0.01x0.00503021x0.96839) ++ (0.8x0.99497x0.03161) ++ (0.997x0.99497x0.96839) = 0.9858390204 +λ(a1) = λ_Jn(a1) = 0.5 = 0.5 +λ(a2) = λ_Jn(a2) = 0.5 = 0.5 +belief change = 0.0003748440048 + +var _Jn: +π(_jn0) += p(_jn0|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn0|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn0|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn0|f2,a2).π_Jn(f2).π_Jn(a2) += (1x0.03161x0.0151792) ++ (0x0.03161x0.984821) ++ (0x0.96839x0.0151792) ++ (0x0.96839x0.984821) = 0.0004798155285 +π(_jn1) += p(_jn1|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn1|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn1|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn1|f2,a2).π_Jn(f2).π_Jn(a2) += (0x0.03161x0.0151792) ++ (1x0.03161x0.984821) ++ (0x0.96839x0.0151792) ++ (0x0.96839x0.984821) = 0.03113016355 +π(_jn2) += p(_jn2|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn2|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn2|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn2|f2,a2).π_Jn(f2).π_Jn(a2) += (0x0.03161x0.0151792) ++ (0x0.03161x0.984821) ++ (1x0.96839x0.0151792) ++ (0x0.96839x0.984821) = 0.01469942668 +π(_jn3) += p(_jn3|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn3|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn3|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn3|f2,a2).π_Jn(f2).π_Jn(a2) += (0x0.03161x0.0151792) ++ (0x0.03161x0.984821) ++ (0x0.96839x0.0151792) ++ (1x0.96839x0.984821) = 0.9536905942 +λ(_jn0) = 1 +λ(_jn1) = 1 +λ(_jn2) = 1 +λ(_jn3) = 1 +belief change = 0.003193358751 + +domain π(Burglar) λ(Burglar) belief +---------------------------------------------------------------- +b1 0.005 0.5 0.005 +b2 0.995 0.5 0.995 + +domain πAlarm(Burglar) λAlarm(Burglar) +---------------------------------------------------------------- +b1 0.005030212402 0.5 +b2 0.9949697876 0.5 + +domain π(FreightTruck) λ(FreightTruck) belief +---------------------------------------------------------------- +f1 0.03 0.25 0.03 +f2 0.97 0.25 0.97 + +domain πAlarm(FreightTruck) λAlarm(FreightTruck) +---------------------------------------------------------------- +f1 0.03160997907 0.5 +f2 0.9683900209 0.5 + +domain π_Jn(FreightTruck) λ_Jn(FreightTruck) +---------------------------------------------------------------- +f1 0.03160997907 0.5 +f2 0.9683900209 0.5 + +domain π(Alarm) λ(Alarm) belief +---------------------------------------------------------------- +a1 0.01416097956 0.5 0.01416097956 +a2 0.9858390204 0.5 0.9858390204 + +domain π_Jn(Alarm) λ_Jn(Alarm) +---------------------------------------------------------------- +a1 0.01517924221 0.5 +a2 0.9848207578 0.5 + +domain π(_Jn) λ(_Jn) belief +---------------------------------------------------------------- +_jn0 0.0004798155285 1 0.0004798155285 +_jn1 0.03113016355 1 0.03113016355 +_jn2 0.01469942668 1 0.01469942668 +_jn3 0.9536905942 1 0.9536905942 + + + +******************************************************************************** + Iteration 15 +******************************************************************************** +λ message Alarm --> Burglar +λAlarm(b1) += [p(a1|b1,f1).πAlarm(f1) + p(a1|b1,f2).πAlarm(f2)].λ(a1) ++ [p(a2|b1,f1).πAlarm(f1) + p(a2|b1,f2).πAlarm(f2)].λ(a2) += [(0.992x0.03161) + (0.99x0.96839)]x0.5 ++ [(0.008x0.03161) + (0.01x0.96839)]x0.5 = 0.5 +λAlarm(b2) += [p(a1|b2,f1).πAlarm(f1) + p(a1|b2,f2).πAlarm(f2)].λ(a1) ++ [p(a2|b2,f1).πAlarm(f1) + p(a2|b2,f2).πAlarm(f2)].λ(a2) += [(0.2x0.03161) + (0.003x0.96839)]x0.5 ++ [(0.8x0.03161) + (0.997x0.96839)]x0.5 = 0.5 + +λ message Alarm --> FreightTruck +λAlarm(f1) += [p(a1|b1,f1).πAlarm(b1) + p(a1|b2,f1).πAlarm(b2)].λ(a1) ++ [p(a2|b1,f1).πAlarm(b1) + p(a2|b2,f1).πAlarm(b2)].λ(a2) += [(0.992x0.00503021) + (0.2x0.99497)]x0.5 ++ [(0.008x0.00503021) + (0.8x0.99497)]x0.5 = 0.5 +λAlarm(f2) += [p(a1|b1,f2).πAlarm(b1) + p(a1|b2,f2).πAlarm(b2)].λ(a1) ++ [p(a2|b1,f2).πAlarm(b1) + p(a2|b2,f2).πAlarm(b2)].λ(a2) += [(0.99x0.00503021) + (0.003x0.99497)]x0.5 ++ [(0.01x0.00503021) + (0.997x0.99497)]x0.5 = 0.5 + +λ message _Jn --> FreightTruck +λ_Jn(f1) += [p(_jn0|f1,a1).π_Jn(a1) + p(_jn0|f1,a2).π_Jn(a2)].λ(_jn0) ++ [p(_jn1|f1,a1).π_Jn(a1) + p(_jn1|f1,a2).π_Jn(a2)].λ(_jn1) ++ [p(_jn2|f1,a1).π_Jn(a1) + p(_jn2|f1,a2).π_Jn(a2)].λ(_jn2) ++ [p(_jn3|f1,a1).π_Jn(a1) + p(_jn3|f1,a2).π_Jn(a2)].λ(_jn3) += [(1x0.0151792) + (0x0.984821)]x1 ++ [(0x0.0151792) + (1x0.984821)]x1 ++ [(0x0.0151792) + (0x0.984821)]x1 ++ [(0x0.0151792) + (0x0.984821)]x1 = 1 +λ_Jn(f2) += [p(_jn0|f2,a1).π_Jn(a1) + p(_jn0|f2,a2).π_Jn(a2)].λ(_jn0) ++ [p(_jn1|f2,a1).π_Jn(a1) + p(_jn1|f2,a2).π_Jn(a2)].λ(_jn1) ++ [p(_jn2|f2,a1).π_Jn(a1) + p(_jn2|f2,a2).π_Jn(a2)].λ(_jn2) ++ [p(_jn3|f2,a1).π_Jn(a1) + p(_jn3|f2,a2).π_Jn(a2)].λ(_jn3) += [(0x0.0151792) + (0x0.984821)]x1 ++ [(0x0.0151792) + (0x0.984821)]x1 ++ [(1x0.0151792) + (0x0.984821)]x1 ++ [(0x0.0151792) + (1x0.984821)]x1 = 1 + +λ message _Jn --> Alarm +λ_Jn(a1) += [p(_jn0|f1,a1).π_Jn(f1) + p(_jn0|f2,a1).π_Jn(f2)].λ(_jn0) ++ [p(_jn1|f1,a1).π_Jn(f1) + p(_jn1|f2,a1).π_Jn(f2)].λ(_jn1) ++ [p(_jn2|f1,a1).π_Jn(f1) + p(_jn2|f2,a1).π_Jn(f2)].λ(_jn2) ++ [p(_jn3|f1,a1).π_Jn(f1) + p(_jn3|f2,a1).π_Jn(f2)].λ(_jn3) += [(1x0.03161) + (0x0.96839)]x1 ++ [(0x0.03161) + (0x0.96839)]x1 ++ [(0x0.03161) + (1x0.96839)]x1 ++ [(0x0.03161) + (0x0.96839)]x1 = 1 +λ_Jn(a2) += [p(_jn0|f1,a2).π_Jn(f1) + p(_jn0|f2,a2).π_Jn(f2)].λ(_jn0) ++ [p(_jn1|f1,a2).π_Jn(f1) + p(_jn1|f2,a2).π_Jn(f2)].λ(_jn1) ++ [p(_jn2|f1,a2).π_Jn(f1) + p(_jn2|f2,a2).π_Jn(f2)].λ(_jn2) ++ [p(_jn3|f1,a2).π_Jn(f1) + p(_jn3|f2,a2).π_Jn(f2)].λ(_jn3) += [(0x0.03161) + (0x0.96839)]x1 ++ [(1x0.03161) + (0x0.96839)]x1 ++ [(0x0.03161) + (0x0.96839)]x1 ++ [(0x0.03161) + (1x0.96839)]x1 = 1 + +π message Burglar --> Alarm +πAlarm(b1) = π(b1) = 0.005 = 0.005 +πAlarm(b2) = π(b2) = 0.995 = 0.995 + +π message FreightTruck --> Alarm +πAlarm(f1) = π(f1).λ_Jn(f1) = 0.03 x 0.5 = 0.015 +πAlarm(f2) = π(f2).λ_Jn(f2) = 0.97 x 0.5 = 0.485 + +π message FreightTruck --> _Jn +π_Jn(f1) = π(f1).λAlarm(f1) = 0.03 x 0.5 = 0.015 +π_Jn(f2) = π(f2).λAlarm(f2) = 0.97 x 0.5 = 0.485 + +π message Alarm --> _Jn +π_Jn(a1) = π(a1) = 0.014161 = 0.01416097956 +π_Jn(a2) = π(a2) = 0.985839 = 0.9858390204 + +var Burglar: +π(b1) += p(b1) += (0.005) = 0.005 +π(b2) += p(b2) += (0.995) = 0.995 +λ(b1) = λAlarm(b1) = 0.5 = 0.5 +λ(b2) = λAlarm(b2) = 0.5 = 0.5 +belief change = 0 + +var FreightTruck: +π(f1) += p(f1) += (0.03) = 0.03 +π(f2) += p(f2) += (0.97) = 0.97 +λ(f1) = λAlarm(f1).λ_Jn(f1) = 0.5 x 0.5 = 0.25 +λ(f2) = λAlarm(f2).λ_Jn(f2) = 0.5 x 0.5 = 0.25 +belief change = 0 + +var Alarm: +π(a1) += p(a1|b1,f1).πAlarm(b1).πAlarm(f1) ++ p(a1|b1,f2).πAlarm(b1).πAlarm(f2) ++ p(a1|b2,f1).πAlarm(b2).πAlarm(f1) ++ p(a1|b2,f2).πAlarm(b2).πAlarm(f2) += (0.992x0.00501511x0.0310733) ++ (0.99x0.00501511x0.968927) ++ (0.2x0.994985x0.0310733) ++ (0.003x0.994985x0.968927) = 0.01404096572 +π(a2) += p(a2|b1,f1).πAlarm(b1).πAlarm(f1) ++ p(a2|b1,f2).πAlarm(b1).πAlarm(f2) ++ p(a2|b2,f1).πAlarm(b2).πAlarm(f1) ++ p(a2|b2,f2).πAlarm(b2).πAlarm(f2) += (0.008x0.00501511x0.0310733) ++ (0.01x0.00501511x0.968927) ++ (0.8x0.994985x0.0310733) ++ (0.997x0.994985x0.968927) = 0.9859590343 +λ(a1) = λ_Jn(a1) = 0.5 = 0.5 +λ(a2) = λ_Jn(a2) = 0.5 = 0.5 +belief change = 0.0002400276838 + +var _Jn: +π(_jn0) += p(_jn0|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn0|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn0|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn0|f2,a2).π_Jn(f2).π_Jn(a2) += (1x0.0310733x0.0146701) ++ (0x0.0310733x0.98533) ++ (0x0.968927x0.0146701) ++ (0x0.968927x0.98533) = 0.0004558490409 +π(_jn1) += p(_jn1|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn1|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn1|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn1|f2,a2).π_Jn(f2).π_Jn(a2) += (0x0.0310733x0.0146701) ++ (1x0.0310733x0.98533) ++ (0x0.968927x0.0146701) ++ (0x0.968927x0.98533) = 0.03061747034 +π(_jn2) += p(_jn2|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn2|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn2|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn2|f2,a2).π_Jn(f2).π_Jn(a2) += (0x0.0310733x0.0146701) ++ (0x0.0310733x0.98533) ++ (1x0.968927x0.0146701) ++ (0x0.968927x0.98533) = 0.01421426184 +π(_jn3) += p(_jn3|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn3|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn3|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn3|f2,a2).π_Jn(f2).π_Jn(a2) += (0x0.0310733x0.0146701) ++ (0x0.0310733x0.98533) ++ (0x0.968927x0.0146701) ++ (1x0.968927x0.98533) = 0.9547124188 +λ(_jn0) = 1 +λ(_jn1) = 1 +λ(_jn2) = 1 +λ(_jn3) = 1 +belief change = 0.002043649053 + +domain π(Burglar) λ(Burglar) belief +---------------------------------------------------------------- +b1 0.005 0.5 0.005 +b2 0.995 0.5 0.995 + +domain πAlarm(Burglar) λAlarm(Burglar) +---------------------------------------------------------------- +b1 0.005015106201 0.5 +b2 0.9949848938 0.5 + +domain π(FreightTruck) λ(FreightTruck) belief +---------------------------------------------------------------- +f1 0.03 0.25 0.03 +f2 0.97 0.25 0.97 + +domain πAlarm(FreightTruck) λAlarm(FreightTruck) +---------------------------------------------------------------- +f1 0.03107331938 0.5 +f2 0.9689266806 0.5 + +domain π_Jn(FreightTruck) λ_Jn(FreightTruck) +---------------------------------------------------------------- +f1 0.03107331938 0.5 +f2 0.9689266806 0.5 + +domain π(Alarm) λ(Alarm) belief +---------------------------------------------------------------- +a1 0.01404096572 0.5 0.01404096572 +a2 0.9859590343 0.5 0.9859590343 + +domain π_Jn(Alarm) λ_Jn(Alarm) +---------------------------------------------------------------- +a1 0.01467011088 0.5 +a2 0.9853298891 0.5 + +domain π(_Jn) λ(_Jn) belief +---------------------------------------------------------------- +_jn0 0.0004558490409 1 0.0004558490409 +_jn1 0.03061747034 1 0.03061747034 +_jn2 0.01421426184 1 0.01421426184 +_jn3 0.9547124188 1 0.9547124188 + + + +******************************************************************************** + Iteration 16 +******************************************************************************** +λ message Alarm --> Burglar +λAlarm(b1) += [p(a1|b1,f1).πAlarm(f1) + p(a1|b1,f2).πAlarm(f2)].λ(a1) ++ [p(a2|b1,f1).πAlarm(f1) + p(a2|b1,f2).πAlarm(f2)].λ(a2) += [(0.992x0.0310733) + (0.99x0.968927)]x0.5 ++ [(0.008x0.0310733) + (0.01x0.968927)]x0.5 = 0.5 +λAlarm(b2) += [p(a1|b2,f1).πAlarm(f1) + p(a1|b2,f2).πAlarm(f2)].λ(a1) ++ [p(a2|b2,f1).πAlarm(f1) + p(a2|b2,f2).πAlarm(f2)].λ(a2) += [(0.2x0.0310733) + (0.003x0.968927)]x0.5 ++ [(0.8x0.0310733) + (0.997x0.968927)]x0.5 = 0.5 + +λ message Alarm --> FreightTruck +λAlarm(f1) += [p(a1|b1,f1).πAlarm(b1) + p(a1|b2,f1).πAlarm(b2)].λ(a1) ++ [p(a2|b1,f1).πAlarm(b1) + p(a2|b2,f1).πAlarm(b2)].λ(a2) += [(0.992x0.00501511) + (0.2x0.994985)]x0.5 ++ [(0.008x0.00501511) + (0.8x0.994985)]x0.5 = 0.5 +λAlarm(f2) += [p(a1|b1,f2).πAlarm(b1) + p(a1|b2,f2).πAlarm(b2)].λ(a1) ++ [p(a2|b1,f2).πAlarm(b1) + p(a2|b2,f2).πAlarm(b2)].λ(a2) += [(0.99x0.00501511) + (0.003x0.994985)]x0.5 ++ [(0.01x0.00501511) + (0.997x0.994985)]x0.5 = 0.5 + +λ message _Jn --> FreightTruck +λ_Jn(f1) += [p(_jn0|f1,a1).π_Jn(a1) + p(_jn0|f1,a2).π_Jn(a2)].λ(_jn0) ++ [p(_jn1|f1,a1).π_Jn(a1) + p(_jn1|f1,a2).π_Jn(a2)].λ(_jn1) ++ [p(_jn2|f1,a1).π_Jn(a1) + p(_jn2|f1,a2).π_Jn(a2)].λ(_jn2) ++ [p(_jn3|f1,a1).π_Jn(a1) + p(_jn3|f1,a2).π_Jn(a2)].λ(_jn3) += [(1x0.0146701) + (0x0.98533)]x1 ++ [(0x0.0146701) + (1x0.98533)]x1 ++ [(0x0.0146701) + (0x0.98533)]x1 ++ [(0x0.0146701) + (0x0.98533)]x1 = 1 +λ_Jn(f2) += [p(_jn0|f2,a1).π_Jn(a1) + p(_jn0|f2,a2).π_Jn(a2)].λ(_jn0) ++ [p(_jn1|f2,a1).π_Jn(a1) + p(_jn1|f2,a2).π_Jn(a2)].λ(_jn1) ++ [p(_jn2|f2,a1).π_Jn(a1) + p(_jn2|f2,a2).π_Jn(a2)].λ(_jn2) ++ [p(_jn3|f2,a1).π_Jn(a1) + p(_jn3|f2,a2).π_Jn(a2)].λ(_jn3) += [(0x0.0146701) + (0x0.98533)]x1 ++ [(0x0.0146701) + (0x0.98533)]x1 ++ [(1x0.0146701) + (0x0.98533)]x1 ++ [(0x0.0146701) + (1x0.98533)]x1 = 1 + +λ message _Jn --> Alarm +λ_Jn(a1) += [p(_jn0|f1,a1).π_Jn(f1) + p(_jn0|f2,a1).π_Jn(f2)].λ(_jn0) ++ [p(_jn1|f1,a1).π_Jn(f1) + p(_jn1|f2,a1).π_Jn(f2)].λ(_jn1) ++ [p(_jn2|f1,a1).π_Jn(f1) + p(_jn2|f2,a1).π_Jn(f2)].λ(_jn2) ++ [p(_jn3|f1,a1).π_Jn(f1) + p(_jn3|f2,a1).π_Jn(f2)].λ(_jn3) += [(1x0.0310733) + (0x0.968927)]x1 ++ [(0x0.0310733) + (0x0.968927)]x1 ++ [(0x0.0310733) + (1x0.968927)]x1 ++ [(0x0.0310733) + (0x0.968927)]x1 = 1 +λ_Jn(a2) += [p(_jn0|f1,a2).π_Jn(f1) + p(_jn0|f2,a2).π_Jn(f2)].λ(_jn0) ++ [p(_jn1|f1,a2).π_Jn(f1) + p(_jn1|f2,a2).π_Jn(f2)].λ(_jn1) ++ [p(_jn2|f1,a2).π_Jn(f1) + p(_jn2|f2,a2).π_Jn(f2)].λ(_jn2) ++ [p(_jn3|f1,a2).π_Jn(f1) + p(_jn3|f2,a2).π_Jn(f2)].λ(_jn3) += [(0x0.0310733) + (0x0.968927)]x1 ++ [(1x0.0310733) + (0x0.968927)]x1 ++ [(0x0.0310733) + (0x0.968927)]x1 ++ [(0x0.0310733) + (1x0.968927)]x1 = 1 + +π message Burglar --> Alarm +πAlarm(b1) = π(b1) = 0.005 = 0.005 +πAlarm(b2) = π(b2) = 0.995 = 0.995 + +π message FreightTruck --> Alarm +πAlarm(f1) = π(f1).λ_Jn(f1) = 0.03 x 0.5 = 0.015 +πAlarm(f2) = π(f2).λ_Jn(f2) = 0.97 x 0.5 = 0.485 + +π message FreightTruck --> _Jn +π_Jn(f1) = π(f1).λAlarm(f1) = 0.03 x 0.5 = 0.015 +π_Jn(f2) = π(f2).λAlarm(f2) = 0.97 x 0.5 = 0.485 + +π message Alarm --> _Jn +π_Jn(a1) = π(a1) = 0.014041 = 0.01404096572 +π_Jn(a2) = π(a2) = 0.985959 = 0.9859590343 + +var Burglar: +π(b1) += p(b1) += (0.005) = 0.005 +π(b2) += p(b2) += (0.995) = 0.995 +λ(b1) = λAlarm(b1) = 0.5 = 0.5 +λ(b2) = λAlarm(b2) = 0.5 = 0.5 +belief change = 0 + +var FreightTruck: +π(f1) += p(f1) += (0.03) = 0.03 +π(f2) += p(f2) += (0.97) = 0.97 +λ(f1) = λAlarm(f1).λ_Jn(f1) = 0.5 x 0.5 = 0.25 +λ(f2) = λAlarm(f2).λ_Jn(f2) = 0.5 x 0.5 = 0.25 +belief change = 0 + +var Alarm: +π(a1) += p(a1|b1,f1).πAlarm(b1).πAlarm(f1) ++ p(a1|b1,f2).πAlarm(b1).πAlarm(f2) ++ p(a1|b2,f1).πAlarm(b2).πAlarm(f1) ++ p(a1|b2,f2).πAlarm(b2).πAlarm(f2) += (0.992x0.00500755x0.0307155) ++ (0.99x0.00500755x0.969284) ++ (0.2x0.994992x0.0307155) ++ (0.003x0.994992x0.969284) = 0.01396342463 +π(a2) += p(a2|b1,f1).πAlarm(b1).πAlarm(f1) ++ p(a2|b1,f2).πAlarm(b1).πAlarm(f2) ++ p(a2|b2,f1).πAlarm(b2).πAlarm(f1) ++ p(a2|b2,f2).πAlarm(b2).πAlarm(f2) += (0.008x0.00500755x0.0307155) ++ (0.01x0.00500755x0.969284) ++ (0.8x0.994992x0.0307155) ++ (0.997x0.994992x0.969284) = 0.9860365754 +λ(a1) = λ_Jn(a1) = 0.5 = 0.5 +λ(a2) = λ_Jn(a2) = 0.5 = 0.5 +belief change = 0.0001550821883 + +var _Jn: +π(_jn0) += p(_jn0|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn0|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn0|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn0|f2,a2).π_Jn(f2).π_Jn(a2) += (1x0.0307155x0.0143555) ++ (0x0.0307155x0.985644) ++ (0x0.969284x0.0143555) ++ (0x0.969284x0.985644) = 0.0004409382007 +π(_jn1) += p(_jn1|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn1|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn1|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn1|f2,a2).π_Jn(f2).π_Jn(a2) += (0x0.0307155x0.0143555) ++ (1x0.0307155x0.985644) ++ (0x0.969284x0.0143555) ++ (0x0.969284x0.985644) = 0.03027460805 +π(_jn2) += p(_jn2|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn2|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn2|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn2|f2,a2).π_Jn(f2).π_Jn(a2) += (0x0.0307155x0.0143555) ++ (0x0.0307155x0.985644) ++ (1x0.969284x0.0143555) ++ (0x0.969284x0.985644) = 0.0139146001 +π(_jn3) += p(_jn3|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn3|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn3|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn3|f2,a2).π_Jn(f2).π_Jn(a2) += (0x0.0307155x0.0143555) ++ (0x0.0307155x0.985644) ++ (0x0.969284x0.0143555) ++ (1x0.969284x0.985644) = 0.9553698536 +λ(_jn0) = 1 +λ(_jn1) = 1 +λ(_jn2) = 1 +λ(_jn3) = 1 +belief change = 0.001314869739 + +domain π(Burglar) λ(Burglar) belief +---------------------------------------------------------------- +b1 0.005 0.5 0.005 +b2 0.995 0.5 0.995 + +domain πAlarm(Burglar) λAlarm(Burglar) +---------------------------------------------------------------- +b1 0.005007553101 0.5 +b2 0.9949924469 0.5 + +domain π(FreightTruck) λ(FreightTruck) belief +---------------------------------------------------------------- +f1 0.03 0.25 0.03 +f2 0.97 0.25 0.97 + +domain πAlarm(FreightTruck) λAlarm(FreightTruck) +---------------------------------------------------------------- +f1 0.03071554625 0.5 +f2 0.9692844537 0.5 + +domain π_Jn(FreightTruck) λ_Jn(FreightTruck) +---------------------------------------------------------------- +f1 0.03071554625 0.5 +f2 0.9692844537 0.5 + +domain π(Alarm) λ(Alarm) belief +---------------------------------------------------------------- +a1 0.01396342463 0.5 0.01396342463 +a2 0.9860365754 0.5 0.9860365754 + +domain π_Jn(Alarm) λ_Jn(Alarm) +---------------------------------------------------------------- +a1 0.0143555383 0.5 +a2 0.9856444617 0.5 + +domain π(_Jn) λ(_Jn) belief +---------------------------------------------------------------- +_jn0 0.0004409382007 1 0.0004409382007 +_jn1 0.03027460805 1 0.03027460805 +_jn2 0.0139146001 1 0.0139146001 +_jn3 0.9553698536 1 0.9553698536 + + + +******************************************************************************** + Iteration 17 +******************************************************************************** +λ message Alarm --> Burglar +λAlarm(b1) += [p(a1|b1,f1).πAlarm(f1) + p(a1|b1,f2).πAlarm(f2)].λ(a1) ++ [p(a2|b1,f1).πAlarm(f1) + p(a2|b1,f2).πAlarm(f2)].λ(a2) += [(0.992x0.0307155) + (0.99x0.969284)]x0.5 ++ [(0.008x0.0307155) + (0.01x0.969284)]x0.5 = 0.5 +λAlarm(b2) += [p(a1|b2,f1).πAlarm(f1) + p(a1|b2,f2).πAlarm(f2)].λ(a1) ++ [p(a2|b2,f1).πAlarm(f1) + p(a2|b2,f2).πAlarm(f2)].λ(a2) += [(0.2x0.0307155) + (0.003x0.969284)]x0.5 ++ [(0.8x0.0307155) + (0.997x0.969284)]x0.5 = 0.5 + +λ message Alarm --> FreightTruck +λAlarm(f1) += [p(a1|b1,f1).πAlarm(b1) + p(a1|b2,f1).πAlarm(b2)].λ(a1) ++ [p(a2|b1,f1).πAlarm(b1) + p(a2|b2,f1).πAlarm(b2)].λ(a2) += [(0.992x0.00500755) + (0.2x0.994992)]x0.5 ++ [(0.008x0.00500755) + (0.8x0.994992)]x0.5 = 0.5 +λAlarm(f2) += [p(a1|b1,f2).πAlarm(b1) + p(a1|b2,f2).πAlarm(b2)].λ(a1) ++ [p(a2|b1,f2).πAlarm(b1) + p(a2|b2,f2).πAlarm(b2)].λ(a2) += [(0.99x0.00500755) + (0.003x0.994992)]x0.5 ++ [(0.01x0.00500755) + (0.997x0.994992)]x0.5 = 0.5 + +λ message _Jn --> FreightTruck +λ_Jn(f1) += [p(_jn0|f1,a1).π_Jn(a1) + p(_jn0|f1,a2).π_Jn(a2)].λ(_jn0) ++ [p(_jn1|f1,a1).π_Jn(a1) + p(_jn1|f1,a2).π_Jn(a2)].λ(_jn1) ++ [p(_jn2|f1,a1).π_Jn(a1) + p(_jn2|f1,a2).π_Jn(a2)].λ(_jn2) ++ [p(_jn3|f1,a1).π_Jn(a1) + p(_jn3|f1,a2).π_Jn(a2)].λ(_jn3) += [(1x0.0143555) + (0x0.985644)]x1 ++ [(0x0.0143555) + (1x0.985644)]x1 ++ [(0x0.0143555) + (0x0.985644)]x1 ++ [(0x0.0143555) + (0x0.985644)]x1 = 1 +λ_Jn(f2) += [p(_jn0|f2,a1).π_Jn(a1) + p(_jn0|f2,a2).π_Jn(a2)].λ(_jn0) ++ [p(_jn1|f2,a1).π_Jn(a1) + p(_jn1|f2,a2).π_Jn(a2)].λ(_jn1) ++ [p(_jn2|f2,a1).π_Jn(a1) + p(_jn2|f2,a2).π_Jn(a2)].λ(_jn2) ++ [p(_jn3|f2,a1).π_Jn(a1) + p(_jn3|f2,a2).π_Jn(a2)].λ(_jn3) += [(0x0.0143555) + (0x0.985644)]x1 ++ [(0x0.0143555) + (0x0.985644)]x1 ++ [(1x0.0143555) + (0x0.985644)]x1 ++ [(0x0.0143555) + (1x0.985644)]x1 = 1 + +λ message _Jn --> Alarm +λ_Jn(a1) += [p(_jn0|f1,a1).π_Jn(f1) + p(_jn0|f2,a1).π_Jn(f2)].λ(_jn0) ++ [p(_jn1|f1,a1).π_Jn(f1) + p(_jn1|f2,a1).π_Jn(f2)].λ(_jn1) ++ [p(_jn2|f1,a1).π_Jn(f1) + p(_jn2|f2,a1).π_Jn(f2)].λ(_jn2) ++ [p(_jn3|f1,a1).π_Jn(f1) + p(_jn3|f2,a1).π_Jn(f2)].λ(_jn3) += [(1x0.0307155) + (0x0.969284)]x1 ++ [(0x0.0307155) + (0x0.969284)]x1 ++ [(0x0.0307155) + (1x0.969284)]x1 ++ [(0x0.0307155) + (0x0.969284)]x1 = 1 +λ_Jn(a2) += [p(_jn0|f1,a2).π_Jn(f1) + p(_jn0|f2,a2).π_Jn(f2)].λ(_jn0) ++ [p(_jn1|f1,a2).π_Jn(f1) + p(_jn1|f2,a2).π_Jn(f2)].λ(_jn1) ++ [p(_jn2|f1,a2).π_Jn(f1) + p(_jn2|f2,a2).π_Jn(f2)].λ(_jn2) ++ [p(_jn3|f1,a2).π_Jn(f1) + p(_jn3|f2,a2).π_Jn(f2)].λ(_jn3) += [(0x0.0307155) + (0x0.969284)]x1 ++ [(1x0.0307155) + (0x0.969284)]x1 ++ [(0x0.0307155) + (0x0.969284)]x1 ++ [(0x0.0307155) + (1x0.969284)]x1 = 1 + +π message Burglar --> Alarm +πAlarm(b1) = π(b1) = 0.005 = 0.005 +πAlarm(b2) = π(b2) = 0.995 = 0.995 + +π message FreightTruck --> Alarm +πAlarm(f1) = π(f1).λ_Jn(f1) = 0.03 x 0.5 = 0.015 +πAlarm(f2) = π(f2).λ_Jn(f2) = 0.97 x 0.5 = 0.485 + +π message FreightTruck --> _Jn +π_Jn(f1) = π(f1).λAlarm(f1) = 0.03 x 0.5 = 0.015 +π_Jn(f2) = π(f2).λAlarm(f2) = 0.97 x 0.5 = 0.485 + +π message Alarm --> _Jn +π_Jn(a1) = π(a1) = 0.0139634 = 0.01396342463 +π_Jn(a2) = π(a2) = 0.986037 = 0.9860365754 + +var Burglar: +π(b1) += p(b1) += (0.005) = 0.005 +π(b2) += p(b2) += (0.995) = 0.995 +λ(b1) = λAlarm(b1) = 0.5 = 0.5 +λ(b2) = λAlarm(b2) = 0.5 = 0.5 +belief change = 0 + +var FreightTruck: +π(f1) += p(f1) += (0.03) = 0.03 +π(f2) += p(f2) += (0.97) = 0.97 +λ(f1) = λAlarm(f1).λ_Jn(f1) = 0.5 x 0.5 = 0.25 +λ(f2) = λAlarm(f2).λ_Jn(f2) = 0.5 x 0.5 = 0.25 +belief change = 0 + +var Alarm: +π(a1) += p(a1|b1,f1).πAlarm(b1).πAlarm(f1) ++ p(a1|b1,f2).πAlarm(b1).πAlarm(f2) ++ p(a1|b2,f1).πAlarm(b2).πAlarm(f1) ++ p(a1|b2,f2).πAlarm(b2).πAlarm(f2) += (0.992x0.00500378x0.030477) ++ (0.99x0.00500378x0.969523) ++ (0.2x0.994996x0.030477) ++ (0.003x0.994996x0.969523) = 0.01391296498 +π(a2) += p(a2|b1,f1).πAlarm(b1).πAlarm(f1) ++ p(a2|b1,f2).πAlarm(b1).πAlarm(f2) ++ p(a2|b2,f1).πAlarm(b2).πAlarm(f1) ++ p(a2|b2,f2).πAlarm(b2).πAlarm(f2) += (0.008x0.00500378x0.030477) ++ (0.01x0.00500378x0.969523) ++ (0.8x0.994996x0.030477) ++ (0.997x0.994996x0.969523) = 0.986087035 +λ(a1) = λ_Jn(a1) = 0.5 = 0.5 +λ(a2) = λ_Jn(a2) = 0.5 = 0.5 +belief change = 0.0001009192892 + +var _Jn: +π(_jn0) += p(_jn0|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn0|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn0|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn0|f2,a2).π_Jn(f2).π_Jn(a2) += (1x0.030477x0.0141595) ++ (0x0.030477x0.985841) ++ (0x0.969523x0.0141595) ++ (0x0.969523x0.985841) = 0.0004315389532 +π(_jn1) += p(_jn1|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn1|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn1|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn1|f2,a2).π_Jn(f2).π_Jn(a2) += (0x0.030477x0.0141595) ++ (1x0.030477x0.985841) ++ (0x0.969523x0.0141595) ++ (0x0.969523x0.985841) = 0.03004549188 +π(_jn2) += p(_jn2|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn2|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn2|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn2|f2,a2).π_Jn(f2).π_Jn(a2) += (0x0.030477x0.0141595) ++ (0x0.030477x0.985841) ++ (1x0.969523x0.0141595) ++ (0x0.969523x0.985841) = 0.01372794251 +π(_jn3) += p(_jn3|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn3|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn3|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn3|f2,a2).π_Jn(f2).π_Jn(a2) += (0x0.030477x0.0141595) ++ (0x0.030477x0.985841) ++ (0x0.969523x0.0141595) ++ (1x0.969523x0.985841) = 0.9557950267 +λ(_jn0) = 1 +λ(_jn1) = 1 +λ(_jn2) = 1 +λ(_jn3) = 1 +belief change = 0.0008503460181 + +domain π(Burglar) λ(Burglar) belief +---------------------------------------------------------------- +b1 0.005 0.5 0.005 +b2 0.995 0.5 0.995 + +domain πAlarm(Burglar) λAlarm(Burglar) +---------------------------------------------------------------- +b1 0.00500377655 0.5 +b2 0.9949962234 0.5 + +domain π(FreightTruck) λ(FreightTruck) belief +---------------------------------------------------------------- +f1 0.03 0.25 0.03 +f2 0.97 0.25 0.97 + +domain πAlarm(FreightTruck) λAlarm(FreightTruck) +---------------------------------------------------------------- +f1 0.03047703084 0.5 +f2 0.9695229692 0.5 + +domain π_Jn(FreightTruck) λ_Jn(FreightTruck) +---------------------------------------------------------------- +f1 0.03047703084 0.5 +f2 0.9695229692 0.5 + +domain π(Alarm) λ(Alarm) belief +---------------------------------------------------------------- +a1 0.01391296498 0.5 0.01391296498 +a2 0.986087035 0.5 0.986087035 + +domain π_Jn(Alarm) λ_Jn(Alarm) +---------------------------------------------------------------- +a1 0.01415948146 0.5 +a2 0.9858405185 0.5 + +domain π(_Jn) λ(_Jn) belief +---------------------------------------------------------------- +_jn0 0.0004315389532 1 0.0004315389532 +_jn1 0.03004549188 1 0.03004549188 +_jn2 0.01372794251 1 0.01372794251 +_jn3 0.9557950267 1 0.9557950267 + + + +******************************************************************************** + Iteration 18 +******************************************************************************** +λ message Alarm --> Burglar +λAlarm(b1) += [p(a1|b1,f1).πAlarm(f1) + p(a1|b1,f2).πAlarm(f2)].λ(a1) ++ [p(a2|b1,f1).πAlarm(f1) + p(a2|b1,f2).πAlarm(f2)].λ(a2) += [(0.992x0.030477) + (0.99x0.969523)]x0.5 ++ [(0.008x0.030477) + (0.01x0.969523)]x0.5 = 0.5 +λAlarm(b2) += [p(a1|b2,f1).πAlarm(f1) + p(a1|b2,f2).πAlarm(f2)].λ(a1) ++ [p(a2|b2,f1).πAlarm(f1) + p(a2|b2,f2).πAlarm(f2)].λ(a2) += [(0.2x0.030477) + (0.003x0.969523)]x0.5 ++ [(0.8x0.030477) + (0.997x0.969523)]x0.5 = 0.5 + +λ message Alarm --> FreightTruck +λAlarm(f1) += [p(a1|b1,f1).πAlarm(b1) + p(a1|b2,f1).πAlarm(b2)].λ(a1) ++ [p(a2|b1,f1).πAlarm(b1) + p(a2|b2,f1).πAlarm(b2)].λ(a2) += [(0.992x0.00500378) + (0.2x0.994996)]x0.5 ++ [(0.008x0.00500378) + (0.8x0.994996)]x0.5 = 0.5 +λAlarm(f2) += [p(a1|b1,f2).πAlarm(b1) + p(a1|b2,f2).πAlarm(b2)].λ(a1) ++ [p(a2|b1,f2).πAlarm(b1) + p(a2|b2,f2).πAlarm(b2)].λ(a2) += [(0.99x0.00500378) + (0.003x0.994996)]x0.5 ++ [(0.01x0.00500378) + (0.997x0.994996)]x0.5 = 0.5 + +λ message _Jn --> FreightTruck +λ_Jn(f1) += [p(_jn0|f1,a1).π_Jn(a1) + p(_jn0|f1,a2).π_Jn(a2)].λ(_jn0) ++ [p(_jn1|f1,a1).π_Jn(a1) + p(_jn1|f1,a2).π_Jn(a2)].λ(_jn1) ++ [p(_jn2|f1,a1).π_Jn(a1) + p(_jn2|f1,a2).π_Jn(a2)].λ(_jn2) ++ [p(_jn3|f1,a1).π_Jn(a1) + p(_jn3|f1,a2).π_Jn(a2)].λ(_jn3) += [(1x0.0141595) + (0x0.985841)]x1 ++ [(0x0.0141595) + (1x0.985841)]x1 ++ [(0x0.0141595) + (0x0.985841)]x1 ++ [(0x0.0141595) + (0x0.985841)]x1 = 1 +λ_Jn(f2) += [p(_jn0|f2,a1).π_Jn(a1) + p(_jn0|f2,a2).π_Jn(a2)].λ(_jn0) ++ [p(_jn1|f2,a1).π_Jn(a1) + p(_jn1|f2,a2).π_Jn(a2)].λ(_jn1) ++ [p(_jn2|f2,a1).π_Jn(a1) + p(_jn2|f2,a2).π_Jn(a2)].λ(_jn2) ++ [p(_jn3|f2,a1).π_Jn(a1) + p(_jn3|f2,a2).π_Jn(a2)].λ(_jn3) += [(0x0.0141595) + (0x0.985841)]x1 ++ [(0x0.0141595) + (0x0.985841)]x1 ++ [(1x0.0141595) + (0x0.985841)]x1 ++ [(0x0.0141595) + (1x0.985841)]x1 = 1 + +λ message _Jn --> Alarm +λ_Jn(a1) += [p(_jn0|f1,a1).π_Jn(f1) + p(_jn0|f2,a1).π_Jn(f2)].λ(_jn0) ++ [p(_jn1|f1,a1).π_Jn(f1) + p(_jn1|f2,a1).π_Jn(f2)].λ(_jn1) ++ [p(_jn2|f1,a1).π_Jn(f1) + p(_jn2|f2,a1).π_Jn(f2)].λ(_jn2) ++ [p(_jn3|f1,a1).π_Jn(f1) + p(_jn3|f2,a1).π_Jn(f2)].λ(_jn3) += [(1x0.030477) + (0x0.969523)]x1 ++ [(0x0.030477) + (0x0.969523)]x1 ++ [(0x0.030477) + (1x0.969523)]x1 ++ [(0x0.030477) + (0x0.969523)]x1 = 1 +λ_Jn(a2) += [p(_jn0|f1,a2).π_Jn(f1) + p(_jn0|f2,a2).π_Jn(f2)].λ(_jn0) ++ [p(_jn1|f1,a2).π_Jn(f1) + p(_jn1|f2,a2).π_Jn(f2)].λ(_jn1) ++ [p(_jn2|f1,a2).π_Jn(f1) + p(_jn2|f2,a2).π_Jn(f2)].λ(_jn2) ++ [p(_jn3|f1,a2).π_Jn(f1) + p(_jn3|f2,a2).π_Jn(f2)].λ(_jn3) += [(0x0.030477) + (0x0.969523)]x1 ++ [(1x0.030477) + (0x0.969523)]x1 ++ [(0x0.030477) + (0x0.969523)]x1 ++ [(0x0.030477) + (1x0.969523)]x1 = 1 + +π message Burglar --> Alarm +πAlarm(b1) = π(b1) = 0.005 = 0.005 +πAlarm(b2) = π(b2) = 0.995 = 0.995 + +π message FreightTruck --> Alarm +πAlarm(f1) = π(f1).λ_Jn(f1) = 0.03 x 0.5 = 0.015 +πAlarm(f2) = π(f2).λ_Jn(f2) = 0.97 x 0.5 = 0.485 + +π message FreightTruck --> _Jn +π_Jn(f1) = π(f1).λAlarm(f1) = 0.03 x 0.5 = 0.015 +π_Jn(f2) = π(f2).λAlarm(f2) = 0.97 x 0.5 = 0.485 + +π message Alarm --> _Jn +π_Jn(a1) = π(a1) = 0.013913 = 0.01391296498 +π_Jn(a2) = π(a2) = 0.986087 = 0.986087035 + +var Burglar: +π(b1) += p(b1) += (0.005) = 0.005 +π(b2) += p(b2) += (0.995) = 0.995 +λ(b1) = λAlarm(b1) = 0.5 = 0.5 +λ(b2) = λAlarm(b2) = 0.5 = 0.5 +belief change = 0 + +var FreightTruck: +π(f1) += p(f1) += (0.03) = 0.03 +π(f2) += p(f2) += (0.97) = 0.97 +λ(f1) = λAlarm(f1).λ_Jn(f1) = 0.5 x 0.5 = 0.25 +λ(f2) = λAlarm(f2).λ_Jn(f2) = 0.5 x 0.5 = 0.25 +belief change = 0 + +var Alarm: +π(a1) += p(a1|b1,f1).πAlarm(b1).πAlarm(f1) ++ p(a1|b1,f2).πAlarm(b1).πAlarm(f2) ++ p(a1|b2,f1).πAlarm(b2).πAlarm(f1) ++ p(a1|b2,f2).πAlarm(b2).πAlarm(f2) += (0.992x0.00500189x0.030318) ++ (0.99x0.00500189x0.969682) ++ (0.2x0.994998x0.030318) ++ (0.003x0.994998x0.969682) = 0.01387994254 +π(a2) += p(a2|b1,f1).πAlarm(b1).πAlarm(f1) ++ p(a2|b1,f2).πAlarm(b1).πAlarm(f2) ++ p(a2|b2,f1).πAlarm(b2).πAlarm(f1) ++ p(a2|b2,f2).πAlarm(b2).πAlarm(f2) += (0.008x0.00500189x0.030318) ++ (0.01x0.00500189x0.969682) ++ (0.8x0.994998x0.030318) ++ (0.997x0.994998x0.969682) = 0.9861200575 +λ(a1) = λ_Jn(a1) = 0.5 = 0.5 +λ(a2) = λ_Jn(a2) = 0.5 = 0.5 +belief change = 6.604487376e-05 + +var _Jn: +π(_jn0) += p(_jn0|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn0|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn0|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn0|f2,a2).π_Jn(f2).π_Jn(a2) += (1x0.030318x0.0140362) ++ (0x0.030318x0.985964) ++ (0x0.969682x0.0140362) ++ (0x0.969682x0.985964) = 0.0004255505042 +π(_jn1) += p(_jn1|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn1|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn1|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn1|f2,a2).π_Jn(f2).π_Jn(a2) += (0x0.030318x0.0140362) ++ (1x0.030318x0.985964) ++ (0x0.969682x0.0140362) ++ (0x0.969682x0.985964) = 0.02989247005 +π(_jn2) += p(_jn2|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn2|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn2|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn2|f2,a2).π_Jn(f2).π_Jn(a2) += (0x0.030318x0.0140362) ++ (0x0.030318x0.985964) ++ (1x0.969682x0.0140362) ++ (0x0.969682x0.985964) = 0.01361067272 +π(_jn3) += p(_jn3|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn3|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn3|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn3|f2,a2).π_Jn(f2).π_Jn(a2) += (0x0.030318x0.0140362) ++ (0x0.030318x0.985964) ++ (0x0.969682x0.0140362) ++ (1x0.969682x0.985964) = 0.9560713067 +λ(_jn0) = 1 +λ(_jn1) = 1 +λ(_jn2) = 1 +λ(_jn3) = 1 +belief change = 0.0005525601426 + +domain π(Burglar) λ(Burglar) belief +---------------------------------------------------------------- +b1 0.005 0.5 0.005 +b2 0.995 0.5 0.995 + +domain πAlarm(Burglar) λAlarm(Burglar) +---------------------------------------------------------------- +b1 0.005001888275 0.5 +b2 0.9949981117 0.5 + +domain π(FreightTruck) λ(FreightTruck) belief +---------------------------------------------------------------- +f1 0.03 0.25 0.03 +f2 0.97 0.25 0.97 + +domain πAlarm(FreightTruck) λAlarm(FreightTruck) +---------------------------------------------------------------- +f1 0.03031802056 0.5 +f2 0.9696819794 0.5 + +domain π_Jn(FreightTruck) λ_Jn(FreightTruck) +---------------------------------------------------------------- +f1 0.03031802056 0.5 +f2 0.9696819794 0.5 + +domain π(Alarm) λ(Alarm) belief +---------------------------------------------------------------- +a1 0.01387994254 0.5 0.01387994254 +a2 0.9861200575 0.5 0.9861200575 + +domain π_Jn(Alarm) λ_Jn(Alarm) +---------------------------------------------------------------- +a1 0.01403622322 0.5 +a2 0.9859637768 0.5 + +domain π(_Jn) λ(_Jn) belief +---------------------------------------------------------------- +_jn0 0.0004255505042 1 0.0004255505042 +_jn1 0.02989247005 1 0.02989247005 +_jn2 0.01361067272 1 0.01361067272 +_jn3 0.9560713067 1 0.9560713067 + + + +******************************************************************************** + Iteration 19 +******************************************************************************** +λ message Alarm --> Burglar +λAlarm(b1) += [p(a1|b1,f1).πAlarm(f1) + p(a1|b1,f2).πAlarm(f2)].λ(a1) ++ [p(a2|b1,f1).πAlarm(f1) + p(a2|b1,f2).πAlarm(f2)].λ(a2) += [(0.992x0.030318) + (0.99x0.969682)]x0.5 ++ [(0.008x0.030318) + (0.01x0.969682)]x0.5 = 0.5 +λAlarm(b2) += [p(a1|b2,f1).πAlarm(f1) + p(a1|b2,f2).πAlarm(f2)].λ(a1) ++ [p(a2|b2,f1).πAlarm(f1) + p(a2|b2,f2).πAlarm(f2)].λ(a2) += [(0.2x0.030318) + (0.003x0.969682)]x0.5 ++ [(0.8x0.030318) + (0.997x0.969682)]x0.5 = 0.5 + +λ message Alarm --> FreightTruck +λAlarm(f1) += [p(a1|b1,f1).πAlarm(b1) + p(a1|b2,f1).πAlarm(b2)].λ(a1) ++ [p(a2|b1,f1).πAlarm(b1) + p(a2|b2,f1).πAlarm(b2)].λ(a2) += [(0.992x0.00500189) + (0.2x0.994998)]x0.5 ++ [(0.008x0.00500189) + (0.8x0.994998)]x0.5 = 0.5 +λAlarm(f2) += [p(a1|b1,f2).πAlarm(b1) + p(a1|b2,f2).πAlarm(b2)].λ(a1) ++ [p(a2|b1,f2).πAlarm(b1) + p(a2|b2,f2).πAlarm(b2)].λ(a2) += [(0.99x0.00500189) + (0.003x0.994998)]x0.5 ++ [(0.01x0.00500189) + (0.997x0.994998)]x0.5 = 0.5 + +λ message _Jn --> FreightTruck +λ_Jn(f1) += [p(_jn0|f1,a1).π_Jn(a1) + p(_jn0|f1,a2).π_Jn(a2)].λ(_jn0) ++ [p(_jn1|f1,a1).π_Jn(a1) + p(_jn1|f1,a2).π_Jn(a2)].λ(_jn1) ++ [p(_jn2|f1,a1).π_Jn(a1) + p(_jn2|f1,a2).π_Jn(a2)].λ(_jn2) ++ [p(_jn3|f1,a1).π_Jn(a1) + p(_jn3|f1,a2).π_Jn(a2)].λ(_jn3) += [(1x0.0140362) + (0x0.985964)]x1 ++ [(0x0.0140362) + (1x0.985964)]x1 ++ [(0x0.0140362) + (0x0.985964)]x1 ++ [(0x0.0140362) + (0x0.985964)]x1 = 1 +λ_Jn(f2) += [p(_jn0|f2,a1).π_Jn(a1) + p(_jn0|f2,a2).π_Jn(a2)].λ(_jn0) ++ [p(_jn1|f2,a1).π_Jn(a1) + p(_jn1|f2,a2).π_Jn(a2)].λ(_jn1) ++ [p(_jn2|f2,a1).π_Jn(a1) + p(_jn2|f2,a2).π_Jn(a2)].λ(_jn2) ++ [p(_jn3|f2,a1).π_Jn(a1) + p(_jn3|f2,a2).π_Jn(a2)].λ(_jn3) += [(0x0.0140362) + (0x0.985964)]x1 ++ [(0x0.0140362) + (0x0.985964)]x1 ++ [(1x0.0140362) + (0x0.985964)]x1 ++ [(0x0.0140362) + (1x0.985964)]x1 = 1 + +λ message _Jn --> Alarm +λ_Jn(a1) += [p(_jn0|f1,a1).π_Jn(f1) + p(_jn0|f2,a1).π_Jn(f2)].λ(_jn0) ++ [p(_jn1|f1,a1).π_Jn(f1) + p(_jn1|f2,a1).π_Jn(f2)].λ(_jn1) ++ [p(_jn2|f1,a1).π_Jn(f1) + p(_jn2|f2,a1).π_Jn(f2)].λ(_jn2) ++ [p(_jn3|f1,a1).π_Jn(f1) + p(_jn3|f2,a1).π_Jn(f2)].λ(_jn3) += [(1x0.030318) + (0x0.969682)]x1 ++ [(0x0.030318) + (0x0.969682)]x1 ++ [(0x0.030318) + (1x0.969682)]x1 ++ [(0x0.030318) + (0x0.969682)]x1 = 1 +λ_Jn(a2) += [p(_jn0|f1,a2).π_Jn(f1) + p(_jn0|f2,a2).π_Jn(f2)].λ(_jn0) ++ [p(_jn1|f1,a2).π_Jn(f1) + p(_jn1|f2,a2).π_Jn(f2)].λ(_jn1) ++ [p(_jn2|f1,a2).π_Jn(f1) + p(_jn2|f2,a2).π_Jn(f2)].λ(_jn2) ++ [p(_jn3|f1,a2).π_Jn(f1) + p(_jn3|f2,a2).π_Jn(f2)].λ(_jn3) += [(0x0.030318) + (0x0.969682)]x1 ++ [(1x0.030318) + (0x0.969682)]x1 ++ [(0x0.030318) + (0x0.969682)]x1 ++ [(0x0.030318) + (1x0.969682)]x1 = 1 + +π message Burglar --> Alarm +πAlarm(b1) = π(b1) = 0.005 = 0.005 +πAlarm(b2) = π(b2) = 0.995 = 0.995 + +π message FreightTruck --> Alarm +πAlarm(f1) = π(f1).λ_Jn(f1) = 0.03 x 0.5 = 0.015 +πAlarm(f2) = π(f2).λ_Jn(f2) = 0.97 x 0.5 = 0.485 + +π message FreightTruck --> _Jn +π_Jn(f1) = π(f1).λAlarm(f1) = 0.03 x 0.5 = 0.015 +π_Jn(f2) = π(f2).λAlarm(f2) = 0.97 x 0.5 = 0.485 + +π message Alarm --> _Jn +π_Jn(a1) = π(a1) = 0.0138799 = 0.01387994254 +π_Jn(a2) = π(a2) = 0.98612 = 0.9861200575 + +var Burglar: +π(b1) += p(b1) += (0.005) = 0.005 +π(b2) += p(b2) += (0.995) = 0.995 +λ(b1) = λAlarm(b1) = 0.5 = 0.5 +λ(b2) = λAlarm(b2) = 0.5 = 0.5 +belief change = 0 + +var FreightTruck: +π(f1) += p(f1) += (0.03) = 0.03 +π(f2) += p(f2) += (0.97) = 0.97 +λ(f1) = λAlarm(f1).λ_Jn(f1) = 0.5 x 0.5 = 0.25 +λ(f2) = λAlarm(f2).λ_Jn(f2) = 0.5 x 0.5 = 0.25 +belief change = 0 + +var Alarm: +π(a1) += p(a1|b1,f1).πAlarm(b1).πAlarm(f1) ++ p(a1|b1,f2).πAlarm(b1).πAlarm(f2) ++ p(a1|b2,f1).πAlarm(b2).πAlarm(f1) ++ p(a1|b2,f2).πAlarm(b2).πAlarm(f2) += (0.992x0.00500094x0.030212) ++ (0.99x0.00500094x0.969788) ++ (0.2x0.994999x0.030212) ++ (0.003x0.994999x0.969788) = 0.01385823629 +π(a2) += p(a2|b1,f1).πAlarm(b1).πAlarm(f1) ++ p(a2|b1,f2).πAlarm(b1).πAlarm(f2) ++ p(a2|b2,f1).πAlarm(b2).πAlarm(f1) ++ p(a2|b2,f2).πAlarm(b2).πAlarm(f2) += (0.008x0.00500094x0.030212) ++ (0.01x0.00500094x0.969788) ++ (0.8x0.994999x0.030212) ++ (0.997x0.994999x0.969788) = 0.9861417637 +λ(a1) = λ_Jn(a1) = 0.5 = 0.5 +λ(a2) = λ_Jn(a2) = 0.5 = 0.5 +belief change = 4.341251158e-05 + +var _Jn: +π(_jn0) += p(_jn0|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn0|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn0|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn0|f2,a2).π_Jn(f2).π_Jn(a2) += (1x0.030212x0.0139581) ++ (0x0.030212x0.986042) ++ (0x0.969788x0.0139581) ++ (0x0.969788x0.986042) = 0.0004217017914 +π(_jn1) += p(_jn1|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn1|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn1|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn1|f2,a2).π_Jn(f2).π_Jn(a2) += (0x0.030212x0.0139581) ++ (1x0.030212x0.986042) ++ (0x0.969788x0.0139581) ++ (0x0.969788x0.986042) = 0.02979031191 +π(_jn2) += p(_jn2|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn2|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn2|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn2|f2,a2).π_Jn(f2).π_Jn(a2) += (0x0.030212x0.0139581) ++ (0x0.030212x0.986042) ++ (1x0.969788x0.0139581) ++ (0x0.969788x0.986042) = 0.01353638109 +π(_jn3) += p(_jn3|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn3|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn3|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn3|f2,a2).π_Jn(f2).π_Jn(a2) += (0x0.030212x0.0139581) ++ (0x0.030212x0.986042) ++ (0x0.969788x0.0139581) ++ (1x0.969788x0.986042) = 0.9562516052 +λ(_jn0) = 1 +λ(_jn1) = 1 +λ(_jn2) = 1 +λ(_jn3) = 1 +belief change = 0.0003605969578 + +domain π(Burglar) λ(Burglar) belief +---------------------------------------------------------------- +b1 0.005 0.5 0.005 +b2 0.995 0.5 0.995 + +domain πAlarm(Burglar) λAlarm(Burglar) +---------------------------------------------------------------- +b1 0.005000944138 0.5 +b2 0.9949990559 0.5 + +domain π(FreightTruck) λ(FreightTruck) belief +---------------------------------------------------------------- +f1 0.03 0.25 0.03 +f2 0.97 0.25 0.97 + +domain πAlarm(FreightTruck) λAlarm(FreightTruck) +---------------------------------------------------------------- +f1 0.03021201371 0.5 +f2 0.9697879863 0.5 + +domain π_Jn(FreightTruck) λ_Jn(FreightTruck) +---------------------------------------------------------------- +f1 0.03021201371 0.5 +f2 0.9697879863 0.5 + +domain π(Alarm) λ(Alarm) belief +---------------------------------------------------------------- +a1 0.01385823629 0.5 0.01385823629 +a2 0.9861417637 0.5 0.9861417637 + +domain π_Jn(Alarm) λ_Jn(Alarm) +---------------------------------------------------------------- +a1 0.01395808288 0.5 +a2 0.9860419171 0.5 + +domain π(_Jn) λ(_Jn) belief +---------------------------------------------------------------- +_jn0 0.0004217017914 1 0.0004217017914 +_jn1 0.02979031191 1 0.02979031191 +_jn2 0.01353638109 1 0.01353638109 +_jn3 0.9562516052 1 0.9562516052 + + + +******************************************************************************** + Iteration 20 +******************************************************************************** +λ message Alarm --> Burglar +λAlarm(b1) += [p(a1|b1,f1).πAlarm(f1) + p(a1|b1,f2).πAlarm(f2)].λ(a1) ++ [p(a2|b1,f1).πAlarm(f1) + p(a2|b1,f2).πAlarm(f2)].λ(a2) += [(0.992x0.030212) + (0.99x0.969788)]x0.5 ++ [(0.008x0.030212) + (0.01x0.969788)]x0.5 = 0.5 +λAlarm(b2) += [p(a1|b2,f1).πAlarm(f1) + p(a1|b2,f2).πAlarm(f2)].λ(a1) ++ [p(a2|b2,f1).πAlarm(f1) + p(a2|b2,f2).πAlarm(f2)].λ(a2) += [(0.2x0.030212) + (0.003x0.969788)]x0.5 ++ [(0.8x0.030212) + (0.997x0.969788)]x0.5 = 0.5 + +λ message Alarm --> FreightTruck +λAlarm(f1) += [p(a1|b1,f1).πAlarm(b1) + p(a1|b2,f1).πAlarm(b2)].λ(a1) ++ [p(a2|b1,f1).πAlarm(b1) + p(a2|b2,f1).πAlarm(b2)].λ(a2) += [(0.992x0.00500094) + (0.2x0.994999)]x0.5 ++ [(0.008x0.00500094) + (0.8x0.994999)]x0.5 = 0.5 +λAlarm(f2) += [p(a1|b1,f2).πAlarm(b1) + p(a1|b2,f2).πAlarm(b2)].λ(a1) ++ [p(a2|b1,f2).πAlarm(b1) + p(a2|b2,f2).πAlarm(b2)].λ(a2) += [(0.99x0.00500094) + (0.003x0.994999)]x0.5 ++ [(0.01x0.00500094) + (0.997x0.994999)]x0.5 = 0.5 + +λ message _Jn --> FreightTruck +λ_Jn(f1) += [p(_jn0|f1,a1).π_Jn(a1) + p(_jn0|f1,a2).π_Jn(a2)].λ(_jn0) ++ [p(_jn1|f1,a1).π_Jn(a1) + p(_jn1|f1,a2).π_Jn(a2)].λ(_jn1) ++ [p(_jn2|f1,a1).π_Jn(a1) + p(_jn2|f1,a2).π_Jn(a2)].λ(_jn2) ++ [p(_jn3|f1,a1).π_Jn(a1) + p(_jn3|f1,a2).π_Jn(a2)].λ(_jn3) += [(1x0.0139581) + (0x0.986042)]x1 ++ [(0x0.0139581) + (1x0.986042)]x1 ++ [(0x0.0139581) + (0x0.986042)]x1 ++ [(0x0.0139581) + (0x0.986042)]x1 = 1 +λ_Jn(f2) += [p(_jn0|f2,a1).π_Jn(a1) + p(_jn0|f2,a2).π_Jn(a2)].λ(_jn0) ++ [p(_jn1|f2,a1).π_Jn(a1) + p(_jn1|f2,a2).π_Jn(a2)].λ(_jn1) ++ [p(_jn2|f2,a1).π_Jn(a1) + p(_jn2|f2,a2).π_Jn(a2)].λ(_jn2) ++ [p(_jn3|f2,a1).π_Jn(a1) + p(_jn3|f2,a2).π_Jn(a2)].λ(_jn3) += [(0x0.0139581) + (0x0.986042)]x1 ++ [(0x0.0139581) + (0x0.986042)]x1 ++ [(1x0.0139581) + (0x0.986042)]x1 ++ [(0x0.0139581) + (1x0.986042)]x1 = 1 + +λ message _Jn --> Alarm +λ_Jn(a1) += [p(_jn0|f1,a1).π_Jn(f1) + p(_jn0|f2,a1).π_Jn(f2)].λ(_jn0) ++ [p(_jn1|f1,a1).π_Jn(f1) + p(_jn1|f2,a1).π_Jn(f2)].λ(_jn1) ++ [p(_jn2|f1,a1).π_Jn(f1) + p(_jn2|f2,a1).π_Jn(f2)].λ(_jn2) ++ [p(_jn3|f1,a1).π_Jn(f1) + p(_jn3|f2,a1).π_Jn(f2)].λ(_jn3) += [(1x0.030212) + (0x0.969788)]x1 ++ [(0x0.030212) + (0x0.969788)]x1 ++ [(0x0.030212) + (1x0.969788)]x1 ++ [(0x0.030212) + (0x0.969788)]x1 = 1 +λ_Jn(a2) += [p(_jn0|f1,a2).π_Jn(f1) + p(_jn0|f2,a2).π_Jn(f2)].λ(_jn0) ++ [p(_jn1|f1,a2).π_Jn(f1) + p(_jn1|f2,a2).π_Jn(f2)].λ(_jn1) ++ [p(_jn2|f1,a2).π_Jn(f1) + p(_jn2|f2,a2).π_Jn(f2)].λ(_jn2) ++ [p(_jn3|f1,a2).π_Jn(f1) + p(_jn3|f2,a2).π_Jn(f2)].λ(_jn3) += [(0x0.030212) + (0x0.969788)]x1 ++ [(1x0.030212) + (0x0.969788)]x1 ++ [(0x0.030212) + (0x0.969788)]x1 ++ [(0x0.030212) + (1x0.969788)]x1 = 1 + +π message Burglar --> Alarm +πAlarm(b1) = π(b1) = 0.005 = 0.005 +πAlarm(b2) = π(b2) = 0.995 = 0.995 + +π message FreightTruck --> Alarm +πAlarm(f1) = π(f1).λ_Jn(f1) = 0.03 x 0.5 = 0.015 +πAlarm(f2) = π(f2).λ_Jn(f2) = 0.97 x 0.5 = 0.485 + +π message FreightTruck --> _Jn +π_Jn(f1) = π(f1).λAlarm(f1) = 0.03 x 0.5 = 0.015 +π_Jn(f2) = π(f2).λAlarm(f2) = 0.97 x 0.5 = 0.485 + +π message Alarm --> _Jn +π_Jn(a1) = π(a1) = 0.0138582 = 0.01385823629 +π_Jn(a2) = π(a2) = 0.986142 = 0.9861417637 + +var Burglar: +π(b1) += p(b1) += (0.005) = 0.005 +π(b2) += p(b2) += (0.995) = 0.995 +λ(b1) = λAlarm(b1) = 0.5 = 0.5 +λ(b2) = λAlarm(b2) = 0.5 = 0.5 +belief change = 0 + +var FreightTruck: +π(f1) += p(f1) += (0.03) = 0.03 +π(f2) += p(f2) += (0.97) = 0.97 +λ(f1) = λAlarm(f1).λ_Jn(f1) = 0.5 x 0.5 = 0.25 +λ(f2) = λAlarm(f2).λ_Jn(f2) = 0.5 x 0.5 = 0.25 +belief change = 0 + +var Alarm: +π(a1) += p(a1|b1,f1).πAlarm(b1).πAlarm(f1) ++ p(a1|b1,f2).πAlarm(b1).πAlarm(f2) ++ p(a1|b2,f1).πAlarm(b2).πAlarm(f1) ++ p(a1|b2,f2).πAlarm(b2).πAlarm(f2) += (0.992x0.00500047x0.0301413) ++ (0.99x0.00500047x0.969859) ++ (0.2x0.995x0.0301413) ++ (0.003x0.995x0.969859) = 0.01384391981 +π(a2) += p(a2|b1,f1).πAlarm(b1).πAlarm(f1) ++ p(a2|b1,f2).πAlarm(b1).πAlarm(f2) ++ p(a2|b2,f1).πAlarm(b2).πAlarm(f1) ++ p(a2|b2,f2).πAlarm(b2).πAlarm(f2) += (0.008x0.00500047x0.0301413) ++ (0.01x0.00500047x0.969859) ++ (0.8x0.995x0.0301413) ++ (0.997x0.995x0.969859) = 0.9861560802 +λ(a1) = λ_Jn(a1) = 0.5 = 0.5 +λ(a2) = λ_Jn(a2) = 0.5 = 0.5 +belief change = 2.863294624e-05 + +var _Jn: +π(_jn0) += p(_jn0|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn0|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn0|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn0|f2,a2).π_Jn(f2).π_Jn(a2) += (1x0.0301413x0.0139082) ++ (0x0.0301413x0.986092) ++ (0x0.969859x0.0139082) ++ (0x0.969859x0.986092) = 0.0004192106012 +π(_jn1) += p(_jn1|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn1|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn1|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn1|f2,a2).π_Jn(f2).π_Jn(a2) += (0x0.0301413x0.0139082) ++ (1x0.0301413x0.986092) ++ (0x0.969859x0.0139082) ++ (0x0.969859x0.986092) = 0.02972213187 +π(_jn2) += p(_jn2|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn2|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn2|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn2|f2,a2).π_Jn(f2).π_Jn(a2) += (0x0.0301413x0.0139082) ++ (0x0.0301413x0.986092) ++ (1x0.969859x0.0139082) ++ (0x0.969859x0.986092) = 0.01348894898 +π(_jn3) += p(_jn3|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn3|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn3|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn3|f2,a2).π_Jn(f2).π_Jn(a2) += (0x0.0301413x0.0139082) ++ (0x0.0301413x0.986092) ++ (0x0.969859x0.0139082) ++ (1x0.969859x0.986092) = 0.9563697085 +λ(_jn0) = 1 +λ(_jn1) = 1 +λ(_jn2) = 1 +λ(_jn3) = 1 +belief change = 0.0002362066847 + +domain π(Burglar) λ(Burglar) belief +---------------------------------------------------------------- +b1 0.005 0.5 0.005 +b2 0.995 0.5 0.995 + +domain πAlarm(Burglar) λAlarm(Burglar) +---------------------------------------------------------------- +b1 0.005000472069 0.5 +b2 0.9949995279 0.5 + +domain π(FreightTruck) λ(FreightTruck) belief +---------------------------------------------------------------- +f1 0.03 0.25 0.03 +f2 0.97 0.25 0.97 + +domain πAlarm(FreightTruck) λAlarm(FreightTruck) +---------------------------------------------------------------- +f1 0.03014134247 0.5 +f2 0.9698586575 0.5 + +domain π_Jn(FreightTruck) λ_Jn(FreightTruck) +---------------------------------------------------------------- +f1 0.03014134247 0.5 +f2 0.9698586575 0.5 + +domain π(Alarm) λ(Alarm) belief +---------------------------------------------------------------- +a1 0.01384391981 0.5 0.01384391981 +a2 0.9861560802 0.5 0.9861560802 + +domain π_Jn(Alarm) λ_Jn(Alarm) +---------------------------------------------------------------- +a1 0.01390815959 0.5 +a2 0.9860918404 0.5 + +domain π(_Jn) λ(_Jn) belief +---------------------------------------------------------------- +_jn0 0.0004192106012 1 0.0004192106012 +_jn1 0.02972213187 1 0.02972213187 +_jn2 0.01348894898 1 0.01348894898 +_jn3 0.9563697085 1 0.9563697085 + + + +******************************************************************************** + Iteration 21 +******************************************************************************** +λ message Alarm --> Burglar +λAlarm(b1) += [p(a1|b1,f1).πAlarm(f1) + p(a1|b1,f2).πAlarm(f2)].λ(a1) ++ [p(a2|b1,f1).πAlarm(f1) + p(a2|b1,f2).πAlarm(f2)].λ(a2) += [(0.992x0.0301413) + (0.99x0.969859)]x0.5 ++ [(0.008x0.0301413) + (0.01x0.969859)]x0.5 = 0.5 +λAlarm(b2) += [p(a1|b2,f1).πAlarm(f1) + p(a1|b2,f2).πAlarm(f2)].λ(a1) ++ [p(a2|b2,f1).πAlarm(f1) + p(a2|b2,f2).πAlarm(f2)].λ(a2) += [(0.2x0.0301413) + (0.003x0.969859)]x0.5 ++ [(0.8x0.0301413) + (0.997x0.969859)]x0.5 = 0.5 + +λ message Alarm --> FreightTruck +λAlarm(f1) += [p(a1|b1,f1).πAlarm(b1) + p(a1|b2,f1).πAlarm(b2)].λ(a1) ++ [p(a2|b1,f1).πAlarm(b1) + p(a2|b2,f1).πAlarm(b2)].λ(a2) += [(0.992x0.00500047) + (0.2x0.995)]x0.5 ++ [(0.008x0.00500047) + (0.8x0.995)]x0.5 = 0.5 +λAlarm(f2) += [p(a1|b1,f2).πAlarm(b1) + p(a1|b2,f2).πAlarm(b2)].λ(a1) ++ [p(a2|b1,f2).πAlarm(b1) + p(a2|b2,f2).πAlarm(b2)].λ(a2) += [(0.99x0.00500047) + (0.003x0.995)]x0.5 ++ [(0.01x0.00500047) + (0.997x0.995)]x0.5 = 0.5 + +λ message _Jn --> FreightTruck +λ_Jn(f1) += [p(_jn0|f1,a1).π_Jn(a1) + p(_jn0|f1,a2).π_Jn(a2)].λ(_jn0) ++ [p(_jn1|f1,a1).π_Jn(a1) + p(_jn1|f1,a2).π_Jn(a2)].λ(_jn1) ++ [p(_jn2|f1,a1).π_Jn(a1) + p(_jn2|f1,a2).π_Jn(a2)].λ(_jn2) ++ [p(_jn3|f1,a1).π_Jn(a1) + p(_jn3|f1,a2).π_Jn(a2)].λ(_jn3) += [(1x0.0139082) + (0x0.986092)]x1 ++ [(0x0.0139082) + (1x0.986092)]x1 ++ [(0x0.0139082) + (0x0.986092)]x1 ++ [(0x0.0139082) + (0x0.986092)]x1 = 1 +λ_Jn(f2) += [p(_jn0|f2,a1).π_Jn(a1) + p(_jn0|f2,a2).π_Jn(a2)].λ(_jn0) ++ [p(_jn1|f2,a1).π_Jn(a1) + p(_jn1|f2,a2).π_Jn(a2)].λ(_jn1) ++ [p(_jn2|f2,a1).π_Jn(a1) + p(_jn2|f2,a2).π_Jn(a2)].λ(_jn2) ++ [p(_jn3|f2,a1).π_Jn(a1) + p(_jn3|f2,a2).π_Jn(a2)].λ(_jn3) += [(0x0.0139082) + (0x0.986092)]x1 ++ [(0x0.0139082) + (0x0.986092)]x1 ++ [(1x0.0139082) + (0x0.986092)]x1 ++ [(0x0.0139082) + (1x0.986092)]x1 = 1 + +λ message _Jn --> Alarm +λ_Jn(a1) += [p(_jn0|f1,a1).π_Jn(f1) + p(_jn0|f2,a1).π_Jn(f2)].λ(_jn0) ++ [p(_jn1|f1,a1).π_Jn(f1) + p(_jn1|f2,a1).π_Jn(f2)].λ(_jn1) ++ [p(_jn2|f1,a1).π_Jn(f1) + p(_jn2|f2,a1).π_Jn(f2)].λ(_jn2) ++ [p(_jn3|f1,a1).π_Jn(f1) + p(_jn3|f2,a1).π_Jn(f2)].λ(_jn3) += [(1x0.0301413) + (0x0.969859)]x1 ++ [(0x0.0301413) + (0x0.969859)]x1 ++ [(0x0.0301413) + (1x0.969859)]x1 ++ [(0x0.0301413) + (0x0.969859)]x1 = 1 +λ_Jn(a2) += [p(_jn0|f1,a2).π_Jn(f1) + p(_jn0|f2,a2).π_Jn(f2)].λ(_jn0) ++ [p(_jn1|f1,a2).π_Jn(f1) + p(_jn1|f2,a2).π_Jn(f2)].λ(_jn1) ++ [p(_jn2|f1,a2).π_Jn(f1) + p(_jn2|f2,a2).π_Jn(f2)].λ(_jn2) ++ [p(_jn3|f1,a2).π_Jn(f1) + p(_jn3|f2,a2).π_Jn(f2)].λ(_jn3) += [(0x0.0301413) + (0x0.969859)]x1 ++ [(1x0.0301413) + (0x0.969859)]x1 ++ [(0x0.0301413) + (0x0.969859)]x1 ++ [(0x0.0301413) + (1x0.969859)]x1 = 1 + +π message Burglar --> Alarm +πAlarm(b1) = π(b1) = 0.005 = 0.005 +πAlarm(b2) = π(b2) = 0.995 = 0.995 + +π message FreightTruck --> Alarm +πAlarm(f1) = π(f1).λ_Jn(f1) = 0.03 x 0.5 = 0.015 +πAlarm(f2) = π(f2).λ_Jn(f2) = 0.97 x 0.5 = 0.485 + +π message FreightTruck --> _Jn +π_Jn(f1) = π(f1).λAlarm(f1) = 0.03 x 0.5 = 0.015 +π_Jn(f2) = π(f2).λAlarm(f2) = 0.97 x 0.5 = 0.485 + +π message Alarm --> _Jn +π_Jn(a1) = π(a1) = 0.0138439 = 0.01384391981 +π_Jn(a2) = π(a2) = 0.986156 = 0.9861560802 + +var Burglar: +π(b1) += p(b1) += (0.005) = 0.005 +π(b2) += p(b2) += (0.995) = 0.995 +λ(b1) = λAlarm(b1) = 0.5 = 0.5 +λ(b2) = λAlarm(b2) = 0.5 = 0.5 +belief change = 0 + +var FreightTruck: +π(f1) += p(f1) += (0.03) = 0.03 +π(f2) += p(f2) += (0.97) = 0.97 +λ(f1) = λAlarm(f1).λ_Jn(f1) = 0.5 x 0.5 = 0.25 +λ(f2) = λAlarm(f2).λ_Jn(f2) = 0.5 x 0.5 = 0.25 +belief change = 0 + +var Alarm: +π(a1) += p(a1|b1,f1).πAlarm(b1).πAlarm(f1) ++ p(a1|b1,f2).πAlarm(b1).πAlarm(f2) ++ p(a1|b2,f1).πAlarm(b2).πAlarm(f1) ++ p(a1|b2,f2).πAlarm(b2).πAlarm(f2) += (0.992x0.00500024x0.0300942) ++ (0.99x0.00500024x0.969906) ++ (0.2x0.995x0.0300942) ++ (0.003x0.995x0.969906) = 0.01383445269 +π(a2) += p(a2|b1,f1).πAlarm(b1).πAlarm(f1) ++ p(a2|b1,f2).πAlarm(b1).πAlarm(f2) ++ p(a2|b2,f1).πAlarm(b2).πAlarm(f1) ++ p(a2|b2,f2).πAlarm(b2).πAlarm(f2) += (0.008x0.00500024x0.0300942) ++ (0.01x0.00500024x0.969906) ++ (0.8x0.995x0.0300942) ++ (0.997x0.995x0.969906) = 0.9861655473 +λ(a1) = λ_Jn(a1) = 0.5 = 0.5 +λ(a2) = λ_Jn(a2) = 0.5 = 0.5 +belief change = 1.893425808e-05 + +var _Jn: +π(_jn0) += p(_jn0|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn0|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn0|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn0|f2,a2).π_Jn(f2).π_Jn(a2) += (1x0.0300942x0.013876) ++ (0x0.0300942x0.986124) ++ (0x0.969906x0.013876) ++ (0x0.969906x0.986124) = 0.0004175887068 +π(_jn1) += p(_jn1|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn1|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn1|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn1|f2,a2).π_Jn(f2).π_Jn(a2) += (0x0.0300942x0.013876) ++ (1x0.0300942x0.986124) ++ (0x0.969906x0.013876) ++ (0x0.969906x0.986124) = 0.02967663961 +π(_jn2) += p(_jn2|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn2|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn2|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn2|f2,a2).π_Jn(f2).π_Jn(a2) += (0x0.0300942x0.013876) ++ (0x0.0300942x0.986124) ++ (1x0.969906x0.013876) ++ (0x0.969906x0.986124) = 0.01345845099 +π(_jn3) += p(_jn3|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn3|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn3|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn3|f2,a2).π_Jn(f2).π_Jn(a2) += (0x0.0300942x0.013876) ++ (0x0.0300942x0.986124) ++ (0x0.969906x0.013876) ++ (1x0.969906x0.986124) = 0.9564473207 +λ(_jn0) = 1 +λ(_jn1) = 1 +λ(_jn2) = 1 +λ(_jn3) = 1 +belief change = 0.0001552242953 + +domain π(Burglar) λ(Burglar) belief +---------------------------------------------------------------- +b1 0.005 0.5 0.005 +b2 0.995 0.5 0.995 + +domain πAlarm(Burglar) λAlarm(Burglar) +---------------------------------------------------------------- +b1 0.005000236034 0.5 +b2 0.994999764 0.5 + +domain π(FreightTruck) λ(FreightTruck) belief +---------------------------------------------------------------- +f1 0.03 0.25 0.03 +f2 0.97 0.25 0.97 + +domain πAlarm(FreightTruck) λAlarm(FreightTruck) +---------------------------------------------------------------- +f1 0.03009422831 0.5 +f2 0.9699057717 0.5 + +domain π_Jn(FreightTruck) λ_Jn(FreightTruck) +---------------------------------------------------------------- +f1 0.03009422831 0.5 +f2 0.9699057717 0.5 + +domain π(Alarm) λ(Alarm) belief +---------------------------------------------------------------- +a1 0.01383445269 0.5 0.01383445269 +a2 0.9861655473 0.5 0.9861655473 + +domain π_Jn(Alarm) λ_Jn(Alarm) +---------------------------------------------------------------- +a1 0.0138760397 0.5 +a2 0.9861239603 0.5 + +domain π(_Jn) λ(_Jn) belief +---------------------------------------------------------------- +_jn0 0.0004175887068 1 0.0004175887068 +_jn1 0.02967663961 1 0.02967663961 +_jn2 0.01345845099 1 0.01345845099 +_jn3 0.9564473207 1 0.9564473207 + + + +******************************************************************************** + Iteration 22 +******************************************************************************** +λ message Alarm --> Burglar +λAlarm(b1) += [p(a1|b1,f1).πAlarm(f1) + p(a1|b1,f2).πAlarm(f2)].λ(a1) ++ [p(a2|b1,f1).πAlarm(f1) + p(a2|b1,f2).πAlarm(f2)].λ(a2) += [(0.992x0.0300942) + (0.99x0.969906)]x0.5 ++ [(0.008x0.0300942) + (0.01x0.969906)]x0.5 = 0.5 +λAlarm(b2) += [p(a1|b2,f1).πAlarm(f1) + p(a1|b2,f2).πAlarm(f2)].λ(a1) ++ [p(a2|b2,f1).πAlarm(f1) + p(a2|b2,f2).πAlarm(f2)].λ(a2) += [(0.2x0.0300942) + (0.003x0.969906)]x0.5 ++ [(0.8x0.0300942) + (0.997x0.969906)]x0.5 = 0.5 + +λ message Alarm --> FreightTruck +λAlarm(f1) += [p(a1|b1,f1).πAlarm(b1) + p(a1|b2,f1).πAlarm(b2)].λ(a1) ++ [p(a2|b1,f1).πAlarm(b1) + p(a2|b2,f1).πAlarm(b2)].λ(a2) += [(0.992x0.00500024) + (0.2x0.995)]x0.5 ++ [(0.008x0.00500024) + (0.8x0.995)]x0.5 = 0.5 +λAlarm(f2) += [p(a1|b1,f2).πAlarm(b1) + p(a1|b2,f2).πAlarm(b2)].λ(a1) ++ [p(a2|b1,f2).πAlarm(b1) + p(a2|b2,f2).πAlarm(b2)].λ(a2) += [(0.99x0.00500024) + (0.003x0.995)]x0.5 ++ [(0.01x0.00500024) + (0.997x0.995)]x0.5 = 0.5 + +λ message _Jn --> FreightTruck +λ_Jn(f1) += [p(_jn0|f1,a1).π_Jn(a1) + p(_jn0|f1,a2).π_Jn(a2)].λ(_jn0) ++ [p(_jn1|f1,a1).π_Jn(a1) + p(_jn1|f1,a2).π_Jn(a2)].λ(_jn1) ++ [p(_jn2|f1,a1).π_Jn(a1) + p(_jn2|f1,a2).π_Jn(a2)].λ(_jn2) ++ [p(_jn3|f1,a1).π_Jn(a1) + p(_jn3|f1,a2).π_Jn(a2)].λ(_jn3) += [(1x0.013876) + (0x0.986124)]x1 ++ [(0x0.013876) + (1x0.986124)]x1 ++ [(0x0.013876) + (0x0.986124)]x1 ++ [(0x0.013876) + (0x0.986124)]x1 = 1 +λ_Jn(f2) += [p(_jn0|f2,a1).π_Jn(a1) + p(_jn0|f2,a2).π_Jn(a2)].λ(_jn0) ++ [p(_jn1|f2,a1).π_Jn(a1) + p(_jn1|f2,a2).π_Jn(a2)].λ(_jn1) ++ [p(_jn2|f2,a1).π_Jn(a1) + p(_jn2|f2,a2).π_Jn(a2)].λ(_jn2) ++ [p(_jn3|f2,a1).π_Jn(a1) + p(_jn3|f2,a2).π_Jn(a2)].λ(_jn3) += [(0x0.013876) + (0x0.986124)]x1 ++ [(0x0.013876) + (0x0.986124)]x1 ++ [(1x0.013876) + (0x0.986124)]x1 ++ [(0x0.013876) + (1x0.986124)]x1 = 1 + +λ message _Jn --> Alarm +λ_Jn(a1) += [p(_jn0|f1,a1).π_Jn(f1) + p(_jn0|f2,a1).π_Jn(f2)].λ(_jn0) ++ [p(_jn1|f1,a1).π_Jn(f1) + p(_jn1|f2,a1).π_Jn(f2)].λ(_jn1) ++ [p(_jn2|f1,a1).π_Jn(f1) + p(_jn2|f2,a1).π_Jn(f2)].λ(_jn2) ++ [p(_jn3|f1,a1).π_Jn(f1) + p(_jn3|f2,a1).π_Jn(f2)].λ(_jn3) += [(1x0.0300942) + (0x0.969906)]x1 ++ [(0x0.0300942) + (0x0.969906)]x1 ++ [(0x0.0300942) + (1x0.969906)]x1 ++ [(0x0.0300942) + (0x0.969906)]x1 = 1 +λ_Jn(a2) += [p(_jn0|f1,a2).π_Jn(f1) + p(_jn0|f2,a2).π_Jn(f2)].λ(_jn0) ++ [p(_jn1|f1,a2).π_Jn(f1) + p(_jn1|f2,a2).π_Jn(f2)].λ(_jn1) ++ [p(_jn2|f1,a2).π_Jn(f1) + p(_jn2|f2,a2).π_Jn(f2)].λ(_jn2) ++ [p(_jn3|f1,a2).π_Jn(f1) + p(_jn3|f2,a2).π_Jn(f2)].λ(_jn3) += [(0x0.0300942) + (0x0.969906)]x1 ++ [(1x0.0300942) + (0x0.969906)]x1 ++ [(0x0.0300942) + (0x0.969906)]x1 ++ [(0x0.0300942) + (1x0.969906)]x1 = 1 + +π message Burglar --> Alarm +πAlarm(b1) = π(b1) = 0.005 = 0.005 +πAlarm(b2) = π(b2) = 0.995 = 0.995 + +π message FreightTruck --> Alarm +πAlarm(f1) = π(f1).λ_Jn(f1) = 0.03 x 0.5 = 0.015 +πAlarm(f2) = π(f2).λ_Jn(f2) = 0.97 x 0.5 = 0.485 + +π message FreightTruck --> _Jn +π_Jn(f1) = π(f1).λAlarm(f1) = 0.03 x 0.5 = 0.015 +π_Jn(f2) = π(f2).λAlarm(f2) = 0.97 x 0.5 = 0.485 + +π message Alarm --> _Jn +π_Jn(a1) = π(a1) = 0.0138345 = 0.01383445269 +π_Jn(a2) = π(a2) = 0.986166 = 0.9861655473 + +var Burglar: +π(b1) += p(b1) += (0.005) = 0.005 +π(b2) += p(b2) += (0.995) = 0.995 +λ(b1) = λAlarm(b1) = 0.5 = 0.5 +λ(b2) = λAlarm(b2) = 0.5 = 0.5 +belief change = 0 + +var FreightTruck: +π(f1) += p(f1) += (0.03) = 0.03 +π(f2) += p(f2) += (0.97) = 0.97 +λ(f1) = λAlarm(f1).λ_Jn(f1) = 0.5 x 0.5 = 0.25 +λ(f2) = λAlarm(f2).λ_Jn(f2) = 0.5 x 0.5 = 0.25 +belief change = 0 + +var Alarm: +π(a1) += p(a1|b1,f1).πAlarm(b1).πAlarm(f1) ++ p(a1|b1,f2).πAlarm(b1).πAlarm(f2) ++ p(a1|b2,f1).πAlarm(b2).πAlarm(f1) ++ p(a1|b2,f2).πAlarm(b2).πAlarm(f2) += (0.992x0.00500012x0.0300628) ++ (0.99x0.00500012x0.969937) ++ (0.2x0.995x0.0300628) ++ (0.003x0.995x0.969937) = 0.01382817986 +π(a2) += p(a2|b1,f1).πAlarm(b1).πAlarm(f1) ++ p(a2|b1,f2).πAlarm(b1).πAlarm(f2) ++ p(a2|b2,f1).πAlarm(b2).πAlarm(f1) ++ p(a2|b2,f2).πAlarm(b2).πAlarm(f2) += (0.008x0.00500012x0.0300628) ++ (0.01x0.00500012x0.969937) ++ (0.8x0.995x0.0300628) ++ (0.997x0.995x0.969937) = 0.9861718201 +λ(a1) = λ_Jn(a1) = 0.5 = 0.5 +λ(a2) = λ_Jn(a2) = 0.5 = 0.5 +belief change = 1.254564945e-05 + +var _Jn: +π(_jn0) += p(_jn0|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn0|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn0|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn0|f2,a2).π_Jn(f2).π_Jn(a2) += (1x0.0300628x0.0138552) ++ (0x0.0300628x0.986145) ++ (0x0.969937x0.0138552) ++ (0x0.969937x0.986145) = 0.0004165277568 +π(_jn1) += p(_jn1|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn1|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn1|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn1|f2,a2).π_Jn(f2).π_Jn(a2) += (0x0.0300628x0.0138552) ++ (1x0.0300628x0.986145) ++ (0x0.969937x0.0138552) ++ (0x0.969937x0.986145) = 0.02964629112 +π(_jn2) += p(_jn2|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn2|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn2|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn2|f2,a2).π_Jn(f2).π_Jn(a2) += (0x0.0300628x0.0138552) ++ (0x0.0300628x0.986145) ++ (1x0.969937x0.0138552) ++ (0x0.969937x0.986145) = 0.01343871844 +π(_jn3) += p(_jn3|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn3|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn3|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn3|f2,a2).π_Jn(f2).π_Jn(a2) += (0x0.0300628x0.0138552) ++ (0x0.0300628x0.986145) ++ (0x0.969937x0.0138552) ++ (1x0.969937x0.986145) = 0.9564984627 +λ(_jn0) = 1 +λ(_jn1) = 1 +λ(_jn2) = 1 +λ(_jn3) = 1 +belief change = 0.0001022839899 + +domain π(Burglar) λ(Burglar) belief +---------------------------------------------------------------- +b1 0.005 0.5 0.005 +b2 0.995 0.5 0.995 + +domain πAlarm(Burglar) λAlarm(Burglar) +---------------------------------------------------------------- +b1 0.005000118017 0.5 +b2 0.994999882 0.5 + +domain π(FreightTruck) λ(FreightTruck) belief +---------------------------------------------------------------- +f1 0.03 0.25 0.03 +f2 0.97 0.25 0.97 + +domain πAlarm(FreightTruck) λAlarm(FreightTruck) +---------------------------------------------------------------- +f1 0.03006281888 0.5 +f2 0.9699371811 0.5 + +domain π_Jn(FreightTruck) λ_Jn(FreightTruck) +---------------------------------------------------------------- +f1 0.03006281888 0.5 +f2 0.9699371811 0.5 + +domain π(Alarm) λ(Alarm) belief +---------------------------------------------------------------- +a1 0.01382817986 0.5 0.01382817986 +a2 0.9861718201 0.5 0.9861718201 + +domain π_Jn(Alarm) λ_Jn(Alarm) +---------------------------------------------------------------- +a1 0.01385524619 0.5 +a2 0.9861447538 0.5 + +domain π(_Jn) λ(_Jn) belief +---------------------------------------------------------------- +_jn0 0.0004165277568 1 0.0004165277568 +_jn1 0.02964629112 1 0.02964629112 +_jn2 0.01343871844 1 0.01343871844 +_jn3 0.9564984627 1 0.9564984627 + + + +******************************************************************************** + Iteration 23 +******************************************************************************** +λ message Alarm --> Burglar +λAlarm(b1) += [p(a1|b1,f1).πAlarm(f1) + p(a1|b1,f2).πAlarm(f2)].λ(a1) ++ [p(a2|b1,f1).πAlarm(f1) + p(a2|b1,f2).πAlarm(f2)].λ(a2) += [(0.992x0.0300628) + (0.99x0.969937)]x0.5 ++ [(0.008x0.0300628) + (0.01x0.969937)]x0.5 = 0.5 +λAlarm(b2) += [p(a1|b2,f1).πAlarm(f1) + p(a1|b2,f2).πAlarm(f2)].λ(a1) ++ [p(a2|b2,f1).πAlarm(f1) + p(a2|b2,f2).πAlarm(f2)].λ(a2) += [(0.2x0.0300628) + (0.003x0.969937)]x0.5 ++ [(0.8x0.0300628) + (0.997x0.969937)]x0.5 = 0.5 + +λ message Alarm --> FreightTruck +λAlarm(f1) += [p(a1|b1,f1).πAlarm(b1) + p(a1|b2,f1).πAlarm(b2)].λ(a1) ++ [p(a2|b1,f1).πAlarm(b1) + p(a2|b2,f1).πAlarm(b2)].λ(a2) += [(0.992x0.00500012) + (0.2x0.995)]x0.5 ++ [(0.008x0.00500012) + (0.8x0.995)]x0.5 = 0.5 +λAlarm(f2) += [p(a1|b1,f2).πAlarm(b1) + p(a1|b2,f2).πAlarm(b2)].λ(a1) ++ [p(a2|b1,f2).πAlarm(b1) + p(a2|b2,f2).πAlarm(b2)].λ(a2) += [(0.99x0.00500012) + (0.003x0.995)]x0.5 ++ [(0.01x0.00500012) + (0.997x0.995)]x0.5 = 0.5 + +λ message _Jn --> FreightTruck +λ_Jn(f1) += [p(_jn0|f1,a1).π_Jn(a1) + p(_jn0|f1,a2).π_Jn(a2)].λ(_jn0) ++ [p(_jn1|f1,a1).π_Jn(a1) + p(_jn1|f1,a2).π_Jn(a2)].λ(_jn1) ++ [p(_jn2|f1,a1).π_Jn(a1) + p(_jn2|f1,a2).π_Jn(a2)].λ(_jn2) ++ [p(_jn3|f1,a1).π_Jn(a1) + p(_jn3|f1,a2).π_Jn(a2)].λ(_jn3) += [(1x0.0138552) + (0x0.986145)]x1 ++ [(0x0.0138552) + (1x0.986145)]x1 ++ [(0x0.0138552) + (0x0.986145)]x1 ++ [(0x0.0138552) + (0x0.986145)]x1 = 1 +λ_Jn(f2) += [p(_jn0|f2,a1).π_Jn(a1) + p(_jn0|f2,a2).π_Jn(a2)].λ(_jn0) ++ [p(_jn1|f2,a1).π_Jn(a1) + p(_jn1|f2,a2).π_Jn(a2)].λ(_jn1) ++ [p(_jn2|f2,a1).π_Jn(a1) + p(_jn2|f2,a2).π_Jn(a2)].λ(_jn2) ++ [p(_jn3|f2,a1).π_Jn(a1) + p(_jn3|f2,a2).π_Jn(a2)].λ(_jn3) += [(0x0.0138552) + (0x0.986145)]x1 ++ [(0x0.0138552) + (0x0.986145)]x1 ++ [(1x0.0138552) + (0x0.986145)]x1 ++ [(0x0.0138552) + (1x0.986145)]x1 = 1 + +λ message _Jn --> Alarm +λ_Jn(a1) += [p(_jn0|f1,a1).π_Jn(f1) + p(_jn0|f2,a1).π_Jn(f2)].λ(_jn0) ++ [p(_jn1|f1,a1).π_Jn(f1) + p(_jn1|f2,a1).π_Jn(f2)].λ(_jn1) ++ [p(_jn2|f1,a1).π_Jn(f1) + p(_jn2|f2,a1).π_Jn(f2)].λ(_jn2) ++ [p(_jn3|f1,a1).π_Jn(f1) + p(_jn3|f2,a1).π_Jn(f2)].λ(_jn3) += [(1x0.0300628) + (0x0.969937)]x1 ++ [(0x0.0300628) + (0x0.969937)]x1 ++ [(0x0.0300628) + (1x0.969937)]x1 ++ [(0x0.0300628) + (0x0.969937)]x1 = 1 +λ_Jn(a2) += [p(_jn0|f1,a2).π_Jn(f1) + p(_jn0|f2,a2).π_Jn(f2)].λ(_jn0) ++ [p(_jn1|f1,a2).π_Jn(f1) + p(_jn1|f2,a2).π_Jn(f2)].λ(_jn1) ++ [p(_jn2|f1,a2).π_Jn(f1) + p(_jn2|f2,a2).π_Jn(f2)].λ(_jn2) ++ [p(_jn3|f1,a2).π_Jn(f1) + p(_jn3|f2,a2).π_Jn(f2)].λ(_jn3) += [(0x0.0300628) + (0x0.969937)]x1 ++ [(1x0.0300628) + (0x0.969937)]x1 ++ [(0x0.0300628) + (0x0.969937)]x1 ++ [(0x0.0300628) + (1x0.969937)]x1 = 1 + +π message Burglar --> Alarm +πAlarm(b1) = π(b1) = 0.005 = 0.005 +πAlarm(b2) = π(b2) = 0.995 = 0.995 + +π message FreightTruck --> Alarm +πAlarm(f1) = π(f1).λ_Jn(f1) = 0.03 x 0.5 = 0.015 +πAlarm(f2) = π(f2).λ_Jn(f2) = 0.97 x 0.5 = 0.485 + +π message FreightTruck --> _Jn +π_Jn(f1) = π(f1).λAlarm(f1) = 0.03 x 0.5 = 0.015 +π_Jn(f2) = π(f2).λAlarm(f2) = 0.97 x 0.5 = 0.485 + +π message Alarm --> _Jn +π_Jn(a1) = π(a1) = 0.0138282 = 0.01382817986 +π_Jn(a2) = π(a2) = 0.986172 = 0.9861718201 + +var Burglar: +π(b1) += p(b1) += (0.005) = 0.005 +π(b2) += p(b2) += (0.995) = 0.995 +λ(b1) = λAlarm(b1) = 0.5 = 0.5 +λ(b2) = λAlarm(b2) = 0.5 = 0.5 +belief change = 0 + +var FreightTruck: +π(f1) += p(f1) += (0.03) = 0.03 +π(f2) += p(f2) += (0.97) = 0.97 +λ(f1) = λAlarm(f1).λ_Jn(f1) = 0.5 x 0.5 = 0.25 +λ(f2) = λAlarm(f2).λ_Jn(f2) = 0.5 x 0.5 = 0.25 +belief change = 0 + +var Alarm: +π(a1) += p(a1|b1,f1).πAlarm(b1).πAlarm(f1) ++ p(a1|b1,f2).πAlarm(b1).πAlarm(f2) ++ p(a1|b2,f1).πAlarm(b2).πAlarm(f1) ++ p(a1|b2,f2).πAlarm(b2).πAlarm(f2) += (0.992x0.00500006x0.0300419) ++ (0.99x0.00500006x0.969958) ++ (0.2x0.995x0.0300419) ++ (0.003x0.995x0.969958) = 0.01382401728 +π(a2) += p(a2|b1,f1).πAlarm(b1).πAlarm(f1) ++ p(a2|b1,f2).πAlarm(b1).πAlarm(f2) ++ p(a2|b2,f1).πAlarm(b2).πAlarm(f1) ++ p(a2|b2,f2).πAlarm(b2).πAlarm(f2) += (0.008x0.00500006x0.0300419) ++ (0.01x0.00500006x0.969958) ++ (0.8x0.995x0.0300419) ++ (0.997x0.995x0.969958) = 0.9861759827 +λ(a1) = λ_Jn(a1) = 0.5 = 0.5 +λ(a2) = λ_Jn(a2) = 0.5 = 0.5 +belief change = 8.325170706e-06 + +var _Jn: +π(_jn0) += p(_jn0|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn0|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn0|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn0|f2,a2).π_Jn(f2).π_Jn(a2) += (1x0.0300419x0.0138417) ++ (0x0.0300419x0.986158) ++ (0x0.969958x0.0138417) ++ (0x0.969958x0.986158) = 0.0004158310714 +π(_jn1) += p(_jn1|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn1|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn1|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn1|f2,a2).π_Jn(f2).π_Jn(a2) += (0x0.0300419x0.0138417) ++ (1x0.0300419x0.986158) ++ (0x0.969958x0.0138417) ++ (0x0.969958x0.986158) = 0.02962604818 +π(_jn2) += p(_jn2|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn2|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn2|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn2|f2,a2).π_Jn(f2).π_Jn(a2) += (0x0.0300419x0.0138417) ++ (0x0.0300419x0.986158) ++ (1x0.969958x0.0138417) ++ (0x0.969958x0.986158) = 0.01342588196 +π(_jn3) += p(_jn3|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn3|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn3|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn3|f2,a2).π_Jn(f2).π_Jn(a2) += (0x0.0300419x0.0138417) ++ (0x0.0300419x0.986158) ++ (0x0.969958x0.0138417) ++ (1x0.969958x0.986158) = 0.9565322388 +λ(_jn0) = 1 +λ(_jn1) = 1 +λ(_jn2) = 1 +λ(_jn3) = 1 +belief change = 6.75522115e-05 + +domain π(Burglar) λ(Burglar) belief +---------------------------------------------------------------- +b1 0.005 0.5 0.005 +b2 0.995 0.5 0.995 + +domain πAlarm(Burglar) λAlarm(Burglar) +---------------------------------------------------------------- +b1 0.005000059009 0.5 +b2 0.994999941 0.5 + +domain π(FreightTruck) λ(FreightTruck) belief +---------------------------------------------------------------- +f1 0.03 0.25 0.03 +f2 0.97 0.25 0.97 + +domain πAlarm(FreightTruck) λAlarm(FreightTruck) +---------------------------------------------------------------- +f1 0.03004187925 0.5 +f2 0.9699581207 0.5 + +domain π_Jn(FreightTruck) λ_Jn(FreightTruck) +---------------------------------------------------------------- +f1 0.03004187925 0.5 +f2 0.9699581207 0.5 + +domain π(Alarm) λ(Alarm) belief +---------------------------------------------------------------- +a1 0.01382401728 0.5 0.01382401728 +a2 0.9861759827 0.5 0.9861759827 + +domain π_Jn(Alarm) λ_Jn(Alarm) +---------------------------------------------------------------- +a1 0.01384171303 0.5 +a2 0.986158287 0.5 + +domain π(_Jn) λ(_Jn) belief +---------------------------------------------------------------- +_jn0 0.0004158310714 1 0.0004158310714 +_jn1 0.02962604818 1 0.02962604818 +_jn2 0.01342588196 1 0.01342588196 +_jn3 0.9565322388 1 0.9565322388 + + + +******************************************************************************** + Iteration 24 +******************************************************************************** +λ message Alarm --> Burglar +λAlarm(b1) += [p(a1|b1,f1).πAlarm(f1) + p(a1|b1,f2).πAlarm(f2)].λ(a1) ++ [p(a2|b1,f1).πAlarm(f1) + p(a2|b1,f2).πAlarm(f2)].λ(a2) += [(0.992x0.0300419) + (0.99x0.969958)]x0.5 ++ [(0.008x0.0300419) + (0.01x0.969958)]x0.5 = 0.5 +λAlarm(b2) += [p(a1|b2,f1).πAlarm(f1) + p(a1|b2,f2).πAlarm(f2)].λ(a1) ++ [p(a2|b2,f1).πAlarm(f1) + p(a2|b2,f2).πAlarm(f2)].λ(a2) += [(0.2x0.0300419) + (0.003x0.969958)]x0.5 ++ [(0.8x0.0300419) + (0.997x0.969958)]x0.5 = 0.5 + +λ message Alarm --> FreightTruck +λAlarm(f1) += [p(a1|b1,f1).πAlarm(b1) + p(a1|b2,f1).πAlarm(b2)].λ(a1) ++ [p(a2|b1,f1).πAlarm(b1) + p(a2|b2,f1).πAlarm(b2)].λ(a2) += [(0.992x0.00500006) + (0.2x0.995)]x0.5 ++ [(0.008x0.00500006) + (0.8x0.995)]x0.5 = 0.5 +λAlarm(f2) += [p(a1|b1,f2).πAlarm(b1) + p(a1|b2,f2).πAlarm(b2)].λ(a1) ++ [p(a2|b1,f2).πAlarm(b1) + p(a2|b2,f2).πAlarm(b2)].λ(a2) += [(0.99x0.00500006) + (0.003x0.995)]x0.5 ++ [(0.01x0.00500006) + (0.997x0.995)]x0.5 = 0.5 + +λ message _Jn --> FreightTruck +λ_Jn(f1) += [p(_jn0|f1,a1).π_Jn(a1) + p(_jn0|f1,a2).π_Jn(a2)].λ(_jn0) ++ [p(_jn1|f1,a1).π_Jn(a1) + p(_jn1|f1,a2).π_Jn(a2)].λ(_jn1) ++ [p(_jn2|f1,a1).π_Jn(a1) + p(_jn2|f1,a2).π_Jn(a2)].λ(_jn2) ++ [p(_jn3|f1,a1).π_Jn(a1) + p(_jn3|f1,a2).π_Jn(a2)].λ(_jn3) += [(1x0.0138417) + (0x0.986158)]x1 ++ [(0x0.0138417) + (1x0.986158)]x1 ++ [(0x0.0138417) + (0x0.986158)]x1 ++ [(0x0.0138417) + (0x0.986158)]x1 = 1 +λ_Jn(f2) += [p(_jn0|f2,a1).π_Jn(a1) + p(_jn0|f2,a2).π_Jn(a2)].λ(_jn0) ++ [p(_jn1|f2,a1).π_Jn(a1) + p(_jn1|f2,a2).π_Jn(a2)].λ(_jn1) ++ [p(_jn2|f2,a1).π_Jn(a1) + p(_jn2|f2,a2).π_Jn(a2)].λ(_jn2) ++ [p(_jn3|f2,a1).π_Jn(a1) + p(_jn3|f2,a2).π_Jn(a2)].λ(_jn3) += [(0x0.0138417) + (0x0.986158)]x1 ++ [(0x0.0138417) + (0x0.986158)]x1 ++ [(1x0.0138417) + (0x0.986158)]x1 ++ [(0x0.0138417) + (1x0.986158)]x1 = 1 + +λ message _Jn --> Alarm +λ_Jn(a1) += [p(_jn0|f1,a1).π_Jn(f1) + p(_jn0|f2,a1).π_Jn(f2)].λ(_jn0) ++ [p(_jn1|f1,a1).π_Jn(f1) + p(_jn1|f2,a1).π_Jn(f2)].λ(_jn1) ++ [p(_jn2|f1,a1).π_Jn(f1) + p(_jn2|f2,a1).π_Jn(f2)].λ(_jn2) ++ [p(_jn3|f1,a1).π_Jn(f1) + p(_jn3|f2,a1).π_Jn(f2)].λ(_jn3) += [(1x0.0300419) + (0x0.969958)]x1 ++ [(0x0.0300419) + (0x0.969958)]x1 ++ [(0x0.0300419) + (1x0.969958)]x1 ++ [(0x0.0300419) + (0x0.969958)]x1 = 1 +λ_Jn(a2) += [p(_jn0|f1,a2).π_Jn(f1) + p(_jn0|f2,a2).π_Jn(f2)].λ(_jn0) ++ [p(_jn1|f1,a2).π_Jn(f1) + p(_jn1|f2,a2).π_Jn(f2)].λ(_jn1) ++ [p(_jn2|f1,a2).π_Jn(f1) + p(_jn2|f2,a2).π_Jn(f2)].λ(_jn2) ++ [p(_jn3|f1,a2).π_Jn(f1) + p(_jn3|f2,a2).π_Jn(f2)].λ(_jn3) += [(0x0.0300419) + (0x0.969958)]x1 ++ [(1x0.0300419) + (0x0.969958)]x1 ++ [(0x0.0300419) + (0x0.969958)]x1 ++ [(0x0.0300419) + (1x0.969958)]x1 = 1 + +π message Burglar --> Alarm +πAlarm(b1) = π(b1) = 0.005 = 0.005 +πAlarm(b2) = π(b2) = 0.995 = 0.995 + +π message FreightTruck --> Alarm +πAlarm(f1) = π(f1).λ_Jn(f1) = 0.03 x 0.5 = 0.015 +πAlarm(f2) = π(f2).λ_Jn(f2) = 0.97 x 0.5 = 0.485 + +π message FreightTruck --> _Jn +π_Jn(f1) = π(f1).λAlarm(f1) = 0.03 x 0.5 = 0.015 +π_Jn(f2) = π(f2).λAlarm(f2) = 0.97 x 0.5 = 0.485 + +π message Alarm --> _Jn +π_Jn(a1) = π(a1) = 0.013824 = 0.01382401728 +π_Jn(a2) = π(a2) = 0.986176 = 0.9861759827 + +var Burglar: +π(b1) += p(b1) += (0.005) = 0.005 +π(b2) += p(b2) += (0.995) = 0.995 +λ(b1) = λAlarm(b1) = 0.5 = 0.5 +λ(b2) = λAlarm(b2) = 0.5 = 0.5 +belief change = 0 + +var FreightTruck: +π(f1) += p(f1) += (0.03) = 0.03 +π(f2) += p(f2) += (0.97) = 0.97 +λ(f1) = λAlarm(f1).λ_Jn(f1) = 0.5 x 0.5 = 0.25 +λ(f2) = λAlarm(f2).λ_Jn(f2) = 0.5 x 0.5 = 0.25 +belief change = 0 + +var Alarm: +π(a1) += p(a1|b1,f1).πAlarm(b1).πAlarm(f1) ++ p(a1|b1,f2).πAlarm(b1).πAlarm(f2) ++ p(a1|b2,f1).πAlarm(b2).πAlarm(f1) ++ p(a1|b2,f2).πAlarm(b2).πAlarm(f2) += (0.992x0.00500003x0.0300279) ++ (0.99x0.00500003x0.969972) ++ (0.2x0.995x0.0300279) ++ (0.003x0.995x0.969972) = 0.01382125187 +π(a2) += p(a2|b1,f1).πAlarm(b1).πAlarm(f1) ++ p(a2|b1,f2).πAlarm(b1).πAlarm(f2) ++ p(a2|b2,f1).πAlarm(b2).πAlarm(f1) ++ p(a2|b2,f2).πAlarm(b2).πAlarm(f2) += (0.008x0.00500003x0.0300279) ++ (0.01x0.00500003x0.969972) ++ (0.8x0.995x0.0300279) ++ (0.997x0.995x0.969972) = 0.9861787481 +λ(a1) = λ_Jn(a1) = 0.5 = 0.5 +λ(a2) = λ_Jn(a2) = 0.5 = 0.5 +belief change = 5.530815684e-06 + +var _Jn: +π(_jn0) += p(_jn0|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn0|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn0|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn0|f2,a2).π_Jn(f2).π_Jn(a2) += (1x0.0300279x0.0138329) ++ (0x0.0300279x0.986167) ++ (0x0.969972x0.0138329) ++ (0x0.969972x0.986167) = 0.0004153721612 +π(_jn1) += p(_jn1|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn1|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn1|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn1|f2,a2).π_Jn(f2).π_Jn(a2) += (0x0.0300279x0.0138329) ++ (1x0.0300279x0.986167) ++ (0x0.969972x0.0138329) ++ (0x0.969972x0.986167) = 0.02961254734 +π(_jn2) += p(_jn2|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn2|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn2|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn2|f2,a2).π_Jn(f2).π_Jn(a2) += (0x0.0300279x0.0138329) ++ (0x0.0300279x0.986167) ++ (1x0.969972x0.0138329) ++ (0x0.969972x0.986167) = 0.01341749299 +π(_jn3) += p(_jn3|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn3|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn3|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn3|f2,a2).π_Jn(f2).π_Jn(a2) += (0x0.0300279x0.0138329) ++ (0x0.0300279x0.986167) ++ (0x0.969972x0.0138329) ++ (1x0.969972x0.986167) = 0.9565545875 +λ(_jn0) = 1 +λ(_jn1) = 1 +λ(_jn2) = 1 +λ(_jn3) = 1 +belief change = 4.469743126e-05 + +domain π(Burglar) λ(Burglar) belief +---------------------------------------------------------------- +b1 0.005 0.5 0.005 +b2 0.995 0.5 0.995 + +domain πAlarm(Burglar) λAlarm(Burglar) +---------------------------------------------------------------- +b1 0.005000029504 0.5 +b2 0.9949999705 0.5 + +domain π(FreightTruck) λ(FreightTruck) belief +---------------------------------------------------------------- +f1 0.03 0.25 0.03 +f2 0.97 0.25 0.97 + +domain πAlarm(FreightTruck) λAlarm(FreightTruck) +---------------------------------------------------------------- +f1 0.0300279195 0.5 +f2 0.9699720805 0.5 + +domain π_Jn(FreightTruck) λ_Jn(FreightTruck) +---------------------------------------------------------------- +f1 0.0300279195 0.5 +f2 0.9699720805 0.5 + +domain π(Alarm) λ(Alarm) belief +---------------------------------------------------------------- +a1 0.01382125187 0.5 0.01382125187 +a2 0.9861787481 0.5 0.9861787481 + +domain π_Jn(Alarm) λ_Jn(Alarm) +---------------------------------------------------------------- +a1 0.01383286515 0.5 +a2 0.9861671348 0.5 + +domain π(_Jn) λ(_Jn) belief +---------------------------------------------------------------- +_jn0 0.0004153721612 1 0.0004153721612 +_jn1 0.02961254734 1 0.02961254734 +_jn2 0.01341749299 1 0.01341749299 +_jn3 0.9565545875 1 0.9565545875 + + + +******************************************************************************** + Iteration 25 +******************************************************************************** +λ message Alarm --> Burglar +λAlarm(b1) += [p(a1|b1,f1).πAlarm(f1) + p(a1|b1,f2).πAlarm(f2)].λ(a1) ++ [p(a2|b1,f1).πAlarm(f1) + p(a2|b1,f2).πAlarm(f2)].λ(a2) += [(0.992x0.0300279) + (0.99x0.969972)]x0.5 ++ [(0.008x0.0300279) + (0.01x0.969972)]x0.5 = 0.5 +λAlarm(b2) += [p(a1|b2,f1).πAlarm(f1) + p(a1|b2,f2).πAlarm(f2)].λ(a1) ++ [p(a2|b2,f1).πAlarm(f1) + p(a2|b2,f2).πAlarm(f2)].λ(a2) += [(0.2x0.0300279) + (0.003x0.969972)]x0.5 ++ [(0.8x0.0300279) + (0.997x0.969972)]x0.5 = 0.5 + +λ message Alarm --> FreightTruck +λAlarm(f1) += [p(a1|b1,f1).πAlarm(b1) + p(a1|b2,f1).πAlarm(b2)].λ(a1) ++ [p(a2|b1,f1).πAlarm(b1) + p(a2|b2,f1).πAlarm(b2)].λ(a2) += [(0.992x0.00500003) + (0.2x0.995)]x0.5 ++ [(0.008x0.00500003) + (0.8x0.995)]x0.5 = 0.5 +λAlarm(f2) += [p(a1|b1,f2).πAlarm(b1) + p(a1|b2,f2).πAlarm(b2)].λ(a1) ++ [p(a2|b1,f2).πAlarm(b1) + p(a2|b2,f2).πAlarm(b2)].λ(a2) += [(0.99x0.00500003) + (0.003x0.995)]x0.5 ++ [(0.01x0.00500003) + (0.997x0.995)]x0.5 = 0.5 + +λ message _Jn --> FreightTruck +λ_Jn(f1) += [p(_jn0|f1,a1).π_Jn(a1) + p(_jn0|f1,a2).π_Jn(a2)].λ(_jn0) ++ [p(_jn1|f1,a1).π_Jn(a1) + p(_jn1|f1,a2).π_Jn(a2)].λ(_jn1) ++ [p(_jn2|f1,a1).π_Jn(a1) + p(_jn2|f1,a2).π_Jn(a2)].λ(_jn2) ++ [p(_jn3|f1,a1).π_Jn(a1) + p(_jn3|f1,a2).π_Jn(a2)].λ(_jn3) += [(1x0.0138329) + (0x0.986167)]x1 ++ [(0x0.0138329) + (1x0.986167)]x1 ++ [(0x0.0138329) + (0x0.986167)]x1 ++ [(0x0.0138329) + (0x0.986167)]x1 = 1 +λ_Jn(f2) += [p(_jn0|f2,a1).π_Jn(a1) + p(_jn0|f2,a2).π_Jn(a2)].λ(_jn0) ++ [p(_jn1|f2,a1).π_Jn(a1) + p(_jn1|f2,a2).π_Jn(a2)].λ(_jn1) ++ [p(_jn2|f2,a1).π_Jn(a1) + p(_jn2|f2,a2).π_Jn(a2)].λ(_jn2) ++ [p(_jn3|f2,a1).π_Jn(a1) + p(_jn3|f2,a2).π_Jn(a2)].λ(_jn3) += [(0x0.0138329) + (0x0.986167)]x1 ++ [(0x0.0138329) + (0x0.986167)]x1 ++ [(1x0.0138329) + (0x0.986167)]x1 ++ [(0x0.0138329) + (1x0.986167)]x1 = 1 + +λ message _Jn --> Alarm +λ_Jn(a1) += [p(_jn0|f1,a1).π_Jn(f1) + p(_jn0|f2,a1).π_Jn(f2)].λ(_jn0) ++ [p(_jn1|f1,a1).π_Jn(f1) + p(_jn1|f2,a1).π_Jn(f2)].λ(_jn1) ++ [p(_jn2|f1,a1).π_Jn(f1) + p(_jn2|f2,a1).π_Jn(f2)].λ(_jn2) ++ [p(_jn3|f1,a1).π_Jn(f1) + p(_jn3|f2,a1).π_Jn(f2)].λ(_jn3) += [(1x0.0300279) + (0x0.969972)]x1 ++ [(0x0.0300279) + (0x0.969972)]x1 ++ [(0x0.0300279) + (1x0.969972)]x1 ++ [(0x0.0300279) + (0x0.969972)]x1 = 1 +λ_Jn(a2) += [p(_jn0|f1,a2).π_Jn(f1) + p(_jn0|f2,a2).π_Jn(f2)].λ(_jn0) ++ [p(_jn1|f1,a2).π_Jn(f1) + p(_jn1|f2,a2).π_Jn(f2)].λ(_jn1) ++ [p(_jn2|f1,a2).π_Jn(f1) + p(_jn2|f2,a2).π_Jn(f2)].λ(_jn2) ++ [p(_jn3|f1,a2).π_Jn(f1) + p(_jn3|f2,a2).π_Jn(f2)].λ(_jn3) += [(0x0.0300279) + (0x0.969972)]x1 ++ [(1x0.0300279) + (0x0.969972)]x1 ++ [(0x0.0300279) + (0x0.969972)]x1 ++ [(0x0.0300279) + (1x0.969972)]x1 = 1 + +π message Burglar --> Alarm +πAlarm(b1) = π(b1) = 0.005 = 0.005 +πAlarm(b2) = π(b2) = 0.995 = 0.995 + +π message FreightTruck --> Alarm +πAlarm(f1) = π(f1).λ_Jn(f1) = 0.03 x 0.5 = 0.015 +πAlarm(f2) = π(f2).λ_Jn(f2) = 0.97 x 0.5 = 0.485 + +π message FreightTruck --> _Jn +π_Jn(f1) = π(f1).λAlarm(f1) = 0.03 x 0.5 = 0.015 +π_Jn(f2) = π(f2).λAlarm(f2) = 0.97 x 0.5 = 0.485 + +π message Alarm --> _Jn +π_Jn(a1) = π(a1) = 0.0138213 = 0.01382125187 +π_Jn(a2) = π(a2) = 0.986179 = 0.9861787481 + +var Burglar: +π(b1) += p(b1) += (0.005) = 0.005 +π(b2) += p(b2) += (0.995) = 0.995 +λ(b1) = λAlarm(b1) = 0.5 = 0.5 +λ(b2) = λAlarm(b2) = 0.5 = 0.5 +belief change = 0 + +var FreightTruck: +π(f1) += p(f1) += (0.03) = 0.03 +π(f2) += p(f2) += (0.97) = 0.97 +λ(f1) = λAlarm(f1).λ_Jn(f1) = 0.5 x 0.5 = 0.25 +λ(f2) = λAlarm(f2).λ_Jn(f2) = 0.5 x 0.5 = 0.25 +belief change = 0 + +var Alarm: +π(a1) += p(a1|b1,f1).πAlarm(b1).πAlarm(f1) ++ p(a1|b1,f2).πAlarm(b1).πAlarm(f2) ++ p(a1|b2,f1).πAlarm(b2).πAlarm(f1) ++ p(a1|b2,f2).πAlarm(b2).πAlarm(f2) += (0.992x0.00500001x0.0300186) ++ (0.99x0.00500001x0.969981) ++ (0.2x0.995x0.0300186) ++ (0.003x0.995x0.969981) = 0.01381941309 +π(a2) += p(a2|b1,f1).πAlarm(b1).πAlarm(f1) ++ p(a2|b1,f2).πAlarm(b1).πAlarm(f2) ++ p(a2|b2,f1).πAlarm(b2).πAlarm(f1) ++ p(a2|b2,f2).πAlarm(b2).πAlarm(f2) += (0.008x0.00500001x0.0300186) ++ (0.01x0.00500001x0.969981) ++ (0.8x0.995x0.0300186) ++ (0.997x0.995x0.969981) = 0.9861805869 +λ(a1) = λ_Jn(a1) = 0.5 = 0.5 +λ(a2) = λ_Jn(a2) = 0.5 = 0.5 +belief change = 3.677561289e-06 + +var _Jn: +π(_jn0) += p(_jn0|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn0|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn0|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn0|f2,a2).π_Jn(f2).π_Jn(a2) += (1x0.0300186x0.0138271) ++ (0x0.0300186x0.986173) ++ (0x0.969981x0.0138271) ++ (0x0.969981x0.986173) = 0.0004150691183 +π(_jn1) += p(_jn1|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn1|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn1|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn1|f2,a2).π_Jn(f2).π_Jn(a2) += (0x0.0300186x0.0138271) ++ (1x0.0300186x0.986173) ++ (0x0.969981x0.0138271) ++ (0x0.969981x0.986173) = 0.02960354388 +π(_jn2) += p(_jn2|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn2|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn2|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn2|f2,a2).π_Jn(f2).π_Jn(a2) += (0x0.0300186x0.0138271) ++ (0x0.0300186x0.986173) ++ (1x0.969981x0.0138271) ++ (0x0.969981x0.986173) = 0.01341198939 +π(_jn3) += p(_jn3|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn3|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn3|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn3|f2,a2).π_Jn(f2).π_Jn(a2) += (0x0.0300186x0.0138271) ++ (0x0.0300186x0.986173) ++ (0x0.969981x0.0138271) ++ (1x0.969981x0.986173) = 0.9565693976 +λ(_jn0) = 1 +λ(_jn1) = 1 +λ(_jn2) = 1 +λ(_jn3) = 1 +belief change = 2.962019789e-05 + +domain π(Burglar) λ(Burglar) belief +---------------------------------------------------------------- +b1 0.005 0.5 0.005 +b2 0.995 0.5 0.995 + +domain πAlarm(Burglar) λAlarm(Burglar) +---------------------------------------------------------------- +b1 0.005000014752 0.5 +b2 0.9949999852 0.5 + +domain π(FreightTruck) λ(FreightTruck) belief +---------------------------------------------------------------- +f1 0.03 0.25 0.03 +f2 0.97 0.25 0.97 + +domain πAlarm(FreightTruck) λAlarm(FreightTruck) +---------------------------------------------------------------- +f1 0.030018613 0.5 +f2 0.969981387 0.5 + +domain π_Jn(FreightTruck) λ_Jn(FreightTruck) +---------------------------------------------------------------- +f1 0.030018613 0.5 +f2 0.969981387 0.5 + +domain π(Alarm) λ(Alarm) belief +---------------------------------------------------------------- +a1 0.01381941309 0.5 0.01381941309 +a2 0.9861805869 0.5 0.9861805869 + +domain π_Jn(Alarm) λ_Jn(Alarm) +---------------------------------------------------------------- +a1 0.01382705851 0.5 +a2 0.9861729415 0.5 + +domain π(_Jn) λ(_Jn) belief +---------------------------------------------------------------- +_jn0 0.0004150691183 1 0.0004150691183 +_jn1 0.02960354388 1 0.02960354388 +_jn2 0.01341198939 1 0.01341198939 +_jn3 0.9565693976 1 0.9565693976 + + + +******************************************************************************** + Iteration 26 +******************************************************************************** +λ message Alarm --> Burglar +λAlarm(b1) += [p(a1|b1,f1).πAlarm(f1) + p(a1|b1,f2).πAlarm(f2)].λ(a1) ++ [p(a2|b1,f1).πAlarm(f1) + p(a2|b1,f2).πAlarm(f2)].λ(a2) += [(0.992x0.0300186) + (0.99x0.969981)]x0.5 ++ [(0.008x0.0300186) + (0.01x0.969981)]x0.5 = 0.5 +λAlarm(b2) += [p(a1|b2,f1).πAlarm(f1) + p(a1|b2,f2).πAlarm(f2)].λ(a1) ++ [p(a2|b2,f1).πAlarm(f1) + p(a2|b2,f2).πAlarm(f2)].λ(a2) += [(0.2x0.0300186) + (0.003x0.969981)]x0.5 ++ [(0.8x0.0300186) + (0.997x0.969981)]x0.5 = 0.5 + +λ message Alarm --> FreightTruck +λAlarm(f1) += [p(a1|b1,f1).πAlarm(b1) + p(a1|b2,f1).πAlarm(b2)].λ(a1) ++ [p(a2|b1,f1).πAlarm(b1) + p(a2|b2,f1).πAlarm(b2)].λ(a2) += [(0.992x0.00500001) + (0.2x0.995)]x0.5 ++ [(0.008x0.00500001) + (0.8x0.995)]x0.5 = 0.5 +λAlarm(f2) += [p(a1|b1,f2).πAlarm(b1) + p(a1|b2,f2).πAlarm(b2)].λ(a1) ++ [p(a2|b1,f2).πAlarm(b1) + p(a2|b2,f2).πAlarm(b2)].λ(a2) += [(0.99x0.00500001) + (0.003x0.995)]x0.5 ++ [(0.01x0.00500001) + (0.997x0.995)]x0.5 = 0.5 + +λ message _Jn --> FreightTruck +λ_Jn(f1) += [p(_jn0|f1,a1).π_Jn(a1) + p(_jn0|f1,a2).π_Jn(a2)].λ(_jn0) ++ [p(_jn1|f1,a1).π_Jn(a1) + p(_jn1|f1,a2).π_Jn(a2)].λ(_jn1) ++ [p(_jn2|f1,a1).π_Jn(a1) + p(_jn2|f1,a2).π_Jn(a2)].λ(_jn2) ++ [p(_jn3|f1,a1).π_Jn(a1) + p(_jn3|f1,a2).π_Jn(a2)].λ(_jn3) += [(1x0.0138271) + (0x0.986173)]x1 ++ [(0x0.0138271) + (1x0.986173)]x1 ++ [(0x0.0138271) + (0x0.986173)]x1 ++ [(0x0.0138271) + (0x0.986173)]x1 = 1 +λ_Jn(f2) += [p(_jn0|f2,a1).π_Jn(a1) + p(_jn0|f2,a2).π_Jn(a2)].λ(_jn0) ++ [p(_jn1|f2,a1).π_Jn(a1) + p(_jn1|f2,a2).π_Jn(a2)].λ(_jn1) ++ [p(_jn2|f2,a1).π_Jn(a1) + p(_jn2|f2,a2).π_Jn(a2)].λ(_jn2) ++ [p(_jn3|f2,a1).π_Jn(a1) + p(_jn3|f2,a2).π_Jn(a2)].λ(_jn3) += [(0x0.0138271) + (0x0.986173)]x1 ++ [(0x0.0138271) + (0x0.986173)]x1 ++ [(1x0.0138271) + (0x0.986173)]x1 ++ [(0x0.0138271) + (1x0.986173)]x1 = 1 + +λ message _Jn --> Alarm +λ_Jn(a1) += [p(_jn0|f1,a1).π_Jn(f1) + p(_jn0|f2,a1).π_Jn(f2)].λ(_jn0) ++ [p(_jn1|f1,a1).π_Jn(f1) + p(_jn1|f2,a1).π_Jn(f2)].λ(_jn1) ++ [p(_jn2|f1,a1).π_Jn(f1) + p(_jn2|f2,a1).π_Jn(f2)].λ(_jn2) ++ [p(_jn3|f1,a1).π_Jn(f1) + p(_jn3|f2,a1).π_Jn(f2)].λ(_jn3) += [(1x0.0300186) + (0x0.969981)]x1 ++ [(0x0.0300186) + (0x0.969981)]x1 ++ [(0x0.0300186) + (1x0.969981)]x1 ++ [(0x0.0300186) + (0x0.969981)]x1 = 1 +λ_Jn(a2) += [p(_jn0|f1,a2).π_Jn(f1) + p(_jn0|f2,a2).π_Jn(f2)].λ(_jn0) ++ [p(_jn1|f1,a2).π_Jn(f1) + p(_jn1|f2,a2).π_Jn(f2)].λ(_jn1) ++ [p(_jn2|f1,a2).π_Jn(f1) + p(_jn2|f2,a2).π_Jn(f2)].λ(_jn2) ++ [p(_jn3|f1,a2).π_Jn(f1) + p(_jn3|f2,a2).π_Jn(f2)].λ(_jn3) += [(0x0.0300186) + (0x0.969981)]x1 ++ [(1x0.0300186) + (0x0.969981)]x1 ++ [(0x0.0300186) + (0x0.969981)]x1 ++ [(0x0.0300186) + (1x0.969981)]x1 = 1 + +π message Burglar --> Alarm +πAlarm(b1) = π(b1) = 0.005 = 0.005 +πAlarm(b2) = π(b2) = 0.995 = 0.995 + +π message FreightTruck --> Alarm +πAlarm(f1) = π(f1).λ_Jn(f1) = 0.03 x 0.5 = 0.015 +πAlarm(f2) = π(f2).λ_Jn(f2) = 0.97 x 0.5 = 0.485 + +π message FreightTruck --> _Jn +π_Jn(f1) = π(f1).λAlarm(f1) = 0.03 x 0.5 = 0.015 +π_Jn(f2) = π(f2).λAlarm(f2) = 0.97 x 0.5 = 0.485 + +π message Alarm --> _Jn +π_Jn(a1) = π(a1) = 0.0138194 = 0.01381941309 +π_Jn(a2) = π(a2) = 0.986181 = 0.9861805869 + +var Burglar: +π(b1) += p(b1) += (0.005) = 0.005 +π(b2) += p(b2) += (0.995) = 0.995 +λ(b1) = λAlarm(b1) = 0.5 = 0.5 +λ(b2) = λAlarm(b2) = 0.5 = 0.5 +belief change = 0 + +var FreightTruck: +π(f1) += p(f1) += (0.03) = 0.03 +π(f2) += p(f2) += (0.97) = 0.97 +λ(f1) = λAlarm(f1).λ_Jn(f1) = 0.5 x 0.5 = 0.25 +λ(f2) = λAlarm(f2).λ_Jn(f2) = 0.5 x 0.5 = 0.25 +belief change = 0 + +var Alarm: +π(a1) += p(a1|b1,f1).πAlarm(b1).πAlarm(f1) ++ p(a1|b1,f2).πAlarm(b1).πAlarm(f2) ++ p(a1|b2,f1).πAlarm(b2).πAlarm(f1) ++ p(a1|b2,f2).πAlarm(b2).πAlarm(f2) += (0.992x0.00500001x0.0300124) ++ (0.99x0.00500001x0.969988) ++ (0.2x0.995x0.0300124) ++ (0.003x0.995x0.969988) = 0.01381818965 +π(a2) += p(a2|b1,f1).πAlarm(b1).πAlarm(f1) ++ p(a2|b1,f2).πAlarm(b1).πAlarm(f2) ++ p(a2|b2,f1).πAlarm(b2).πAlarm(f1) ++ p(a2|b2,f2).πAlarm(b2).πAlarm(f2) += (0.008x0.00500001x0.0300124) ++ (0.01x0.00500001x0.969988) ++ (0.8x0.995x0.0300124) ++ (0.997x0.995x0.969988) = 0.9861818104 +λ(a1) = λ_Jn(a1) = 0.5 = 0.5 +λ(a2) = λ_Jn(a2) = 0.5 = 0.5 +belief change = 2.446882907e-06 + +var _Jn: +π(_jn0) += p(_jn0|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn0|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn0|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn0|f2,a2).π_Jn(f2).π_Jn(a2) += (1x0.0300124x0.0138232) ++ (0x0.0300124x0.986177) ++ (0x0.969988x0.0138232) ++ (0x0.969988x0.986177) = 0.0004148686019 +π(_jn1) += p(_jn1|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn1|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn1|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn1|f2,a2).π_Jn(f2).π_Jn(a2) += (0x0.0300124x0.0138232) ++ (1x0.0300124x0.986177) ++ (0x0.969988x0.0138232) ++ (0x0.969988x0.986177) = 0.02959754006 +π(_jn2) += p(_jn2|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn2|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn2|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn2|f2,a2).π_Jn(f2).π_Jn(a2) += (0x0.0300124x0.0138232) ++ (0x0.0300124x0.986177) ++ (1x0.969988x0.0138232) ++ (0x0.969988x0.986177) = 0.0134083672 +π(_jn3) += p(_jn3|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn3|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn3|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn3|f2,a2).π_Jn(f2).π_Jn(a2) += (0x0.0300124x0.0138232) ++ (0x0.0300124x0.986177) ++ (0x0.969988x0.0138232) ++ (1x0.969988x0.986177) = 0.9565792241 +λ(_jn0) = 1 +λ(_jn1) = 1 +λ(_jn2) = 1 +λ(_jn3) = 1 +belief change = 1.965305627e-05 + +domain π(Burglar) λ(Burglar) belief +---------------------------------------------------------------- +b1 0.005 0.5 0.005 +b2 0.995 0.5 0.995 + +domain πAlarm(Burglar) λAlarm(Burglar) +---------------------------------------------------------------- +b1 0.005000007376 0.5 +b2 0.9949999926 0.5 + +domain π(FreightTruck) λ(FreightTruck) belief +---------------------------------------------------------------- +f1 0.03 0.25 0.03 +f2 0.97 0.25 0.97 + +domain πAlarm(FreightTruck) λAlarm(FreightTruck) +---------------------------------------------------------------- +f1 0.03001240867 0.5 +f2 0.9699875913 0.5 + +domain π_Jn(FreightTruck) λ_Jn(FreightTruck) +---------------------------------------------------------------- +f1 0.03001240867 0.5 +f2 0.9699875913 0.5 + +domain π(Alarm) λ(Alarm) belief +---------------------------------------------------------------- +a1 0.01381818965 0.5 0.01381818965 +a2 0.9861818104 0.5 0.9861818104 + +domain π_Jn(Alarm) λ_Jn(Alarm) +---------------------------------------------------------------- +a1 0.0138232358 0.5 +a2 0.9861767642 0.5 + +domain π(_Jn) λ(_Jn) belief +---------------------------------------------------------------- +_jn0 0.0004148686019 1 0.0004148686019 +_jn1 0.02959754006 1 0.02959754006 +_jn2 0.0134083672 1 0.0134083672 +_jn3 0.9565792241 1 0.9565792241 + + + +******************************************************************************** + Iteration 27 +******************************************************************************** +λ message Alarm --> Burglar +λAlarm(b1) += [p(a1|b1,f1).πAlarm(f1) + p(a1|b1,f2).πAlarm(f2)].λ(a1) ++ [p(a2|b1,f1).πAlarm(f1) + p(a2|b1,f2).πAlarm(f2)].λ(a2) += [(0.992x0.0300124) + (0.99x0.969988)]x0.5 ++ [(0.008x0.0300124) + (0.01x0.969988)]x0.5 = 0.5 +λAlarm(b2) += [p(a1|b2,f1).πAlarm(f1) + p(a1|b2,f2).πAlarm(f2)].λ(a1) ++ [p(a2|b2,f1).πAlarm(f1) + p(a2|b2,f2).πAlarm(f2)].λ(a2) += [(0.2x0.0300124) + (0.003x0.969988)]x0.5 ++ [(0.8x0.0300124) + (0.997x0.969988)]x0.5 = 0.5 + +λ message Alarm --> FreightTruck +λAlarm(f1) += [p(a1|b1,f1).πAlarm(b1) + p(a1|b2,f1).πAlarm(b2)].λ(a1) ++ [p(a2|b1,f1).πAlarm(b1) + p(a2|b2,f1).πAlarm(b2)].λ(a2) += [(0.992x0.00500001) + (0.2x0.995)]x0.5 ++ [(0.008x0.00500001) + (0.8x0.995)]x0.5 = 0.5 +λAlarm(f2) += [p(a1|b1,f2).πAlarm(b1) + p(a1|b2,f2).πAlarm(b2)].λ(a1) ++ [p(a2|b1,f2).πAlarm(b1) + p(a2|b2,f2).πAlarm(b2)].λ(a2) += [(0.99x0.00500001) + (0.003x0.995)]x0.5 ++ [(0.01x0.00500001) + (0.997x0.995)]x0.5 = 0.5 + +λ message _Jn --> FreightTruck +λ_Jn(f1) += [p(_jn0|f1,a1).π_Jn(a1) + p(_jn0|f1,a2).π_Jn(a2)].λ(_jn0) ++ [p(_jn1|f1,a1).π_Jn(a1) + p(_jn1|f1,a2).π_Jn(a2)].λ(_jn1) ++ [p(_jn2|f1,a1).π_Jn(a1) + p(_jn2|f1,a2).π_Jn(a2)].λ(_jn2) ++ [p(_jn3|f1,a1).π_Jn(a1) + p(_jn3|f1,a2).π_Jn(a2)].λ(_jn3) += [(1x0.0138232) + (0x0.986177)]x1 ++ [(0x0.0138232) + (1x0.986177)]x1 ++ [(0x0.0138232) + (0x0.986177)]x1 ++ [(0x0.0138232) + (0x0.986177)]x1 = 1 +λ_Jn(f2) += [p(_jn0|f2,a1).π_Jn(a1) + p(_jn0|f2,a2).π_Jn(a2)].λ(_jn0) ++ [p(_jn1|f2,a1).π_Jn(a1) + p(_jn1|f2,a2).π_Jn(a2)].λ(_jn1) ++ [p(_jn2|f2,a1).π_Jn(a1) + p(_jn2|f2,a2).π_Jn(a2)].λ(_jn2) ++ [p(_jn3|f2,a1).π_Jn(a1) + p(_jn3|f2,a2).π_Jn(a2)].λ(_jn3) += [(0x0.0138232) + (0x0.986177)]x1 ++ [(0x0.0138232) + (0x0.986177)]x1 ++ [(1x0.0138232) + (0x0.986177)]x1 ++ [(0x0.0138232) + (1x0.986177)]x1 = 1 + +λ message _Jn --> Alarm +λ_Jn(a1) += [p(_jn0|f1,a1).π_Jn(f1) + p(_jn0|f2,a1).π_Jn(f2)].λ(_jn0) ++ [p(_jn1|f1,a1).π_Jn(f1) + p(_jn1|f2,a1).π_Jn(f2)].λ(_jn1) ++ [p(_jn2|f1,a1).π_Jn(f1) + p(_jn2|f2,a1).π_Jn(f2)].λ(_jn2) ++ [p(_jn3|f1,a1).π_Jn(f1) + p(_jn3|f2,a1).π_Jn(f2)].λ(_jn3) += [(1x0.0300124) + (0x0.969988)]x1 ++ [(0x0.0300124) + (0x0.969988)]x1 ++ [(0x0.0300124) + (1x0.969988)]x1 ++ [(0x0.0300124) + (0x0.969988)]x1 = 1 +λ_Jn(a2) += [p(_jn0|f1,a2).π_Jn(f1) + p(_jn0|f2,a2).π_Jn(f2)].λ(_jn0) ++ [p(_jn1|f1,a2).π_Jn(f1) + p(_jn1|f2,a2).π_Jn(f2)].λ(_jn1) ++ [p(_jn2|f1,a2).π_Jn(f1) + p(_jn2|f2,a2).π_Jn(f2)].λ(_jn2) ++ [p(_jn3|f1,a2).π_Jn(f1) + p(_jn3|f2,a2).π_Jn(f2)].λ(_jn3) += [(0x0.0300124) + (0x0.969988)]x1 ++ [(1x0.0300124) + (0x0.969988)]x1 ++ [(0x0.0300124) + (0x0.969988)]x1 ++ [(0x0.0300124) + (1x0.969988)]x1 = 1 + +π message Burglar --> Alarm +πAlarm(b1) = π(b1) = 0.005 = 0.005 +πAlarm(b2) = π(b2) = 0.995 = 0.995 + +π message FreightTruck --> Alarm +πAlarm(f1) = π(f1).λ_Jn(f1) = 0.03 x 0.5 = 0.015 +πAlarm(f2) = π(f2).λ_Jn(f2) = 0.97 x 0.5 = 0.485 + +π message FreightTruck --> _Jn +π_Jn(f1) = π(f1).λAlarm(f1) = 0.03 x 0.5 = 0.015 +π_Jn(f2) = π(f2).λAlarm(f2) = 0.97 x 0.5 = 0.485 + +π message Alarm --> _Jn +π_Jn(a1) = π(a1) = 0.0138182 = 0.01381818965 +π_Jn(a2) = π(a2) = 0.986182 = 0.9861818104 + +var Burglar: +π(b1) += p(b1) += (0.005) = 0.005 +π(b2) += p(b2) += (0.995) = 0.995 +λ(b1) = λAlarm(b1) = 0.5 = 0.5 +λ(b2) = λAlarm(b2) = 0.5 = 0.5 +belief change = 0 + +var FreightTruck: +π(f1) += p(f1) += (0.03) = 0.03 +π(f2) += p(f2) += (0.97) = 0.97 +λ(f1) = λAlarm(f1).λ_Jn(f1) = 0.5 x 0.5 = 0.25 +λ(f2) = λAlarm(f2).λ_Jn(f2) = 0.5 x 0.5 = 0.25 +belief change = 0 + +var Alarm: +π(a1) += p(a1|b1,f1).πAlarm(b1).πAlarm(f1) ++ p(a1|b1,f2).πAlarm(b1).πAlarm(f2) ++ p(a1|b2,f1).πAlarm(b2).πAlarm(f1) ++ p(a1|b2,f2).πAlarm(b2).πAlarm(f2) += (0.992x0.005x0.0300083) ++ (0.99x0.005x0.969992) ++ (0.2x0.995x0.0300083) ++ (0.003x0.995x0.969992) = 0.01381737522 +π(a2) += p(a2|b1,f1).πAlarm(b1).πAlarm(f1) ++ p(a2|b1,f2).πAlarm(b1).πAlarm(f2) ++ p(a2|b2,f1).πAlarm(b2).πAlarm(f1) ++ p(a2|b2,f2).πAlarm(b2).πAlarm(f2) += (0.008x0.005x0.0300083) ++ (0.01x0.005x0.969992) ++ (0.8x0.995x0.0300083) ++ (0.997x0.995x0.969992) = 0.9861826248 +λ(a1) = λ_Jn(a1) = 0.5 = 0.5 +λ(a2) = λ_Jn(a2) = 0.5 = 0.5 +belief change = 1.62884295e-06 + +var _Jn: +π(_jn0) += p(_jn0|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn0|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn0|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn0|f2,a2).π_Jn(f2).π_Jn(a2) += (1x0.0300083x0.0138207) ++ (0x0.0300083x0.986179) ++ (0x0.969992x0.0138207) ++ (0x0.969992x0.986179) = 0.0004147357127 +π(_jn1) += p(_jn1|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn1|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn1|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn1|f2,a2).π_Jn(f2).π_Jn(a2) += (0x0.0300083x0.0138207) ++ (1x0.0300083x0.986179) ++ (0x0.969992x0.0138207) ++ (0x0.969992x0.986179) = 0.02959353673 +π(_jn2) += p(_jn2|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn2|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn2|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn2|f2,a2).π_Jn(f2).π_Jn(a2) += (0x0.0300083x0.0138207) ++ (0x0.0300083x0.986179) ++ (1x0.969992x0.0138207) ++ (0x0.969992x0.986179) = 0.01340597701 +π(_jn3) += p(_jn3|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn3|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn3|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn3|f2,a2).π_Jn(f2).π_Jn(a2) += (0x0.0300083x0.0138207) ++ (0x0.0300083x0.986179) ++ (0x0.969992x0.0138207) ++ (1x0.969992x0.986179) = 0.9565857505 +λ(_jn0) = 1 +λ(_jn1) = 1 +λ(_jn2) = 1 +λ(_jn3) = 1 +belief change = 1.30528189e-05 + +domain π(Burglar) λ(Burglar) belief +---------------------------------------------------------------- +b1 0.005 0.5 0.005 +b2 0.995 0.5 0.995 + +domain πAlarm(Burglar) λAlarm(Burglar) +---------------------------------------------------------------- +b1 0.005000003688 0.5 +b2 0.9949999963 0.5 + +domain π(FreightTruck) λ(FreightTruck) belief +---------------------------------------------------------------- +f1 0.03 0.25 0.03 +f2 0.97 0.25 0.97 + +domain πAlarm(FreightTruck) λAlarm(FreightTruck) +---------------------------------------------------------------- +f1 0.03000827244 0.5 +f2 0.9699917276 0.5 + +domain π_Jn(FreightTruck) λ_Jn(FreightTruck) +---------------------------------------------------------------- +f1 0.03000827244 0.5 +f2 0.9699917276 0.5 + +domain π(Alarm) λ(Alarm) belief +---------------------------------------------------------------- +a1 0.01381737522 0.5 0.01381737522 +a2 0.9861826248 0.5 0.9861826248 + +domain π_Jn(Alarm) λ_Jn(Alarm) +---------------------------------------------------------------- +a1 0.01382071272 0.5 +a2 0.9861792873 0.5 + +domain π(_Jn) λ(_Jn) belief +---------------------------------------------------------------- +_jn0 0.0004147357127 1 0.0004147357127 +_jn1 0.02959353673 1 0.02959353673 +_jn2 0.01340597701 1 0.01340597701 +_jn3 0.9565857505 1 0.9565857505 + + + +******************************************************************************** + Iteration 28 +******************************************************************************** +λ message Alarm --> Burglar +λAlarm(b1) += [p(a1|b1,f1).πAlarm(f1) + p(a1|b1,f2).πAlarm(f2)].λ(a1) ++ [p(a2|b1,f1).πAlarm(f1) + p(a2|b1,f2).πAlarm(f2)].λ(a2) += [(0.992x0.0300083) + (0.99x0.969992)]x0.5 ++ [(0.008x0.0300083) + (0.01x0.969992)]x0.5 = 0.5 +λAlarm(b2) += [p(a1|b2,f1).πAlarm(f1) + p(a1|b2,f2).πAlarm(f2)].λ(a1) ++ [p(a2|b2,f1).πAlarm(f1) + p(a2|b2,f2).πAlarm(f2)].λ(a2) += [(0.2x0.0300083) + (0.003x0.969992)]x0.5 ++ [(0.8x0.0300083) + (0.997x0.969992)]x0.5 = 0.5 + +λ message Alarm --> FreightTruck +λAlarm(f1) += [p(a1|b1,f1).πAlarm(b1) + p(a1|b2,f1).πAlarm(b2)].λ(a1) ++ [p(a2|b1,f1).πAlarm(b1) + p(a2|b2,f1).πAlarm(b2)].λ(a2) += [(0.992x0.005) + (0.2x0.995)]x0.5 ++ [(0.008x0.005) + (0.8x0.995)]x0.5 = 0.5 +λAlarm(f2) += [p(a1|b1,f2).πAlarm(b1) + p(a1|b2,f2).πAlarm(b2)].λ(a1) ++ [p(a2|b1,f2).πAlarm(b1) + p(a2|b2,f2).πAlarm(b2)].λ(a2) += [(0.99x0.005) + (0.003x0.995)]x0.5 ++ [(0.01x0.005) + (0.997x0.995)]x0.5 = 0.5 + +λ message _Jn --> FreightTruck +λ_Jn(f1) += [p(_jn0|f1,a1).π_Jn(a1) + p(_jn0|f1,a2).π_Jn(a2)].λ(_jn0) ++ [p(_jn1|f1,a1).π_Jn(a1) + p(_jn1|f1,a2).π_Jn(a2)].λ(_jn1) ++ [p(_jn2|f1,a1).π_Jn(a1) + p(_jn2|f1,a2).π_Jn(a2)].λ(_jn2) ++ [p(_jn3|f1,a1).π_Jn(a1) + p(_jn3|f1,a2).π_Jn(a2)].λ(_jn3) += [(1x0.0138207) + (0x0.986179)]x1 ++ [(0x0.0138207) + (1x0.986179)]x1 ++ [(0x0.0138207) + (0x0.986179)]x1 ++ [(0x0.0138207) + (0x0.986179)]x1 = 1 +λ_Jn(f2) += [p(_jn0|f2,a1).π_Jn(a1) + p(_jn0|f2,a2).π_Jn(a2)].λ(_jn0) ++ [p(_jn1|f2,a1).π_Jn(a1) + p(_jn1|f2,a2).π_Jn(a2)].λ(_jn1) ++ [p(_jn2|f2,a1).π_Jn(a1) + p(_jn2|f2,a2).π_Jn(a2)].λ(_jn2) ++ [p(_jn3|f2,a1).π_Jn(a1) + p(_jn3|f2,a2).π_Jn(a2)].λ(_jn3) += [(0x0.0138207) + (0x0.986179)]x1 ++ [(0x0.0138207) + (0x0.986179)]x1 ++ [(1x0.0138207) + (0x0.986179)]x1 ++ [(0x0.0138207) + (1x0.986179)]x1 = 1 + +λ message _Jn --> Alarm +λ_Jn(a1) += [p(_jn0|f1,a1).π_Jn(f1) + p(_jn0|f2,a1).π_Jn(f2)].λ(_jn0) ++ [p(_jn1|f1,a1).π_Jn(f1) + p(_jn1|f2,a1).π_Jn(f2)].λ(_jn1) ++ [p(_jn2|f1,a1).π_Jn(f1) + p(_jn2|f2,a1).π_Jn(f2)].λ(_jn2) ++ [p(_jn3|f1,a1).π_Jn(f1) + p(_jn3|f2,a1).π_Jn(f2)].λ(_jn3) += [(1x0.0300083) + (0x0.969992)]x1 ++ [(0x0.0300083) + (0x0.969992)]x1 ++ [(0x0.0300083) + (1x0.969992)]x1 ++ [(0x0.0300083) + (0x0.969992)]x1 = 1 +λ_Jn(a2) += [p(_jn0|f1,a2).π_Jn(f1) + p(_jn0|f2,a2).π_Jn(f2)].λ(_jn0) ++ [p(_jn1|f1,a2).π_Jn(f1) + p(_jn1|f2,a2).π_Jn(f2)].λ(_jn1) ++ [p(_jn2|f1,a2).π_Jn(f1) + p(_jn2|f2,a2).π_Jn(f2)].λ(_jn2) ++ [p(_jn3|f1,a2).π_Jn(f1) + p(_jn3|f2,a2).π_Jn(f2)].λ(_jn3) += [(0x0.0300083) + (0x0.969992)]x1 ++ [(1x0.0300083) + (0x0.969992)]x1 ++ [(0x0.0300083) + (0x0.969992)]x1 ++ [(0x0.0300083) + (1x0.969992)]x1 = 1 + +π message Burglar --> Alarm +πAlarm(b1) = π(b1) = 0.005 = 0.005 +πAlarm(b2) = π(b2) = 0.995 = 0.995 + +π message FreightTruck --> Alarm +πAlarm(f1) = π(f1).λ_Jn(f1) = 0.03 x 0.5 = 0.015 +πAlarm(f2) = π(f2).λ_Jn(f2) = 0.97 x 0.5 = 0.485 + +π message FreightTruck --> _Jn +π_Jn(f1) = π(f1).λAlarm(f1) = 0.03 x 0.5 = 0.015 +π_Jn(f2) = π(f2).λAlarm(f2) = 0.97 x 0.5 = 0.485 + +π message Alarm --> _Jn +π_Jn(a1) = π(a1) = 0.0138174 = 0.01381737522 +π_Jn(a2) = π(a2) = 0.986183 = 0.9861826248 + +var Burglar: +π(b1) += p(b1) += (0.005) = 0.005 +π(b2) += p(b2) += (0.995) = 0.995 +λ(b1) = λAlarm(b1) = 0.5 = 0.5 +λ(b2) = λAlarm(b2) = 0.5 = 0.5 +belief change = 0 + +var FreightTruck: +π(f1) += p(f1) += (0.03) = 0.03 +π(f2) += p(f2) += (0.97) = 0.97 +λ(f1) = λAlarm(f1).λ_Jn(f1) = 0.5 x 0.5 = 0.25 +λ(f2) = λAlarm(f2).λ_Jn(f2) = 0.5 x 0.5 = 0.25 +belief change = 0 + +var Alarm: +π(a1) += p(a1|b1,f1).πAlarm(b1).πAlarm(f1) ++ p(a1|b1,f2).πAlarm(b1).πAlarm(f2) ++ p(a1|b2,f1).πAlarm(b2).πAlarm(f1) ++ p(a1|b2,f2).πAlarm(b2).πAlarm(f2) += (0.992x0.005x0.0300055) ++ (0.99x0.005x0.969994) ++ (0.2x0.995x0.0300055) ++ (0.003x0.995x0.969994) = 0.01381683288 +π(a2) += p(a2|b1,f1).πAlarm(b1).πAlarm(f1) ++ p(a2|b1,f2).πAlarm(b1).πAlarm(f2) ++ p(a2|b2,f1).πAlarm(b2).πAlarm(f1) ++ p(a2|b2,f2).πAlarm(b2).πAlarm(f2) += (0.008x0.005x0.0300055) ++ (0.01x0.005x0.969994) ++ (0.8x0.995x0.0300055) ++ (0.997x0.995x0.969994) = 0.9861831671 +λ(a1) = λ_Jn(a1) = 0.5 = 0.5 +λ(a2) = λ_Jn(a2) = 0.5 = 0.5 +belief change = 1.084689135e-06 + +var _Jn: +π(_jn0) += p(_jn0|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn0|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn0|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn0|f2,a2).π_Jn(f2).π_Jn(a2) += (1x0.0300055x0.013819) ++ (0x0.0300055x0.986181) ++ (0x0.969994x0.013819) ++ (0x0.969994x0.986181) = 0.0004146475307 +π(_jn1) += p(_jn1|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn1|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn1|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn1|f2,a2).π_Jn(f2).π_Jn(a2) += (0x0.0300055x0.013819) ++ (1x0.0300055x0.986181) ++ (0x0.969994x0.013819) ++ (0x0.969994x0.986181) = 0.02959086743 +π(_jn2) += p(_jn2|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn2|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn2|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn2|f2,a2).π_Jn(f2).π_Jn(a2) += (0x0.0300055x0.013819) ++ (0x0.0300055x0.986181) ++ (1x0.969994x0.013819) ++ (0x0.969994x0.986181) = 0.01340439644 +π(_jn3) += p(_jn3|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn3|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn3|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn3|f2,a2).π_Jn(f2).π_Jn(a2) += (0x0.0300055x0.013819) ++ (0x0.0300055x0.986181) ++ (0x0.969994x0.013819) ++ (1x0.969994x0.986181) = 0.9565900886 +λ(_jn0) = 1 +λ(_jn1) = 1 +λ(_jn2) = 1 +λ(_jn3) = 1 +belief change = 8.676096756e-06 + +domain π(Burglar) λ(Burglar) belief +---------------------------------------------------------------- +b1 0.005 0.5 0.005 +b2 0.995 0.5 0.995 + +domain πAlarm(Burglar) λAlarm(Burglar) +---------------------------------------------------------------- +b1 0.005000001844 0.5 +b2 0.9949999982 0.5 + +domain π(FreightTruck) λ(FreightTruck) belief +---------------------------------------------------------------- +f1 0.03 0.25 0.03 +f2 0.97 0.25 0.97 + +domain πAlarm(FreightTruck) λAlarm(FreightTruck) +---------------------------------------------------------------- +f1 0.03000551496 0.5 +f2 0.969994485 0.5 + +domain π_Jn(FreightTruck) λ_Jn(FreightTruck) +---------------------------------------------------------------- +f1 0.03000551496 0.5 +f2 0.969994485 0.5 + +domain π(Alarm) λ(Alarm) belief +---------------------------------------------------------------- +a1 0.01381683288 0.5 0.01381683288 +a2 0.9861831671 0.5 0.9861831671 + +domain π_Jn(Alarm) λ_Jn(Alarm) +---------------------------------------------------------------- +a1 0.01381904397 0.5 +a2 0.986180956 0.5 + +domain π(_Jn) λ(_Jn) belief +---------------------------------------------------------------- +_jn0 0.0004146475307 1 0.0004146475307 +_jn1 0.02959086743 1 0.02959086743 +_jn2 0.01340439644 1 0.01340439644 +_jn3 0.9565900886 1 0.9565900886 + + + +******************************************************************************** + Iteration 29 +******************************************************************************** +λ message Alarm --> Burglar +λAlarm(b1) += [p(a1|b1,f1).πAlarm(f1) + p(a1|b1,f2).πAlarm(f2)].λ(a1) ++ [p(a2|b1,f1).πAlarm(f1) + p(a2|b1,f2).πAlarm(f2)].λ(a2) += [(0.992x0.0300055) + (0.99x0.969994)]x0.5 ++ [(0.008x0.0300055) + (0.01x0.969994)]x0.5 = 0.5 +λAlarm(b2) += [p(a1|b2,f1).πAlarm(f1) + p(a1|b2,f2).πAlarm(f2)].λ(a1) ++ [p(a2|b2,f1).πAlarm(f1) + p(a2|b2,f2).πAlarm(f2)].λ(a2) += [(0.2x0.0300055) + (0.003x0.969994)]x0.5 ++ [(0.8x0.0300055) + (0.997x0.969994)]x0.5 = 0.5 + +λ message Alarm --> FreightTruck +λAlarm(f1) += [p(a1|b1,f1).πAlarm(b1) + p(a1|b2,f1).πAlarm(b2)].λ(a1) ++ [p(a2|b1,f1).πAlarm(b1) + p(a2|b2,f1).πAlarm(b2)].λ(a2) += [(0.992x0.005) + (0.2x0.995)]x0.5 ++ [(0.008x0.005) + (0.8x0.995)]x0.5 = 0.5 +λAlarm(f2) += [p(a1|b1,f2).πAlarm(b1) + p(a1|b2,f2).πAlarm(b2)].λ(a1) ++ [p(a2|b1,f2).πAlarm(b1) + p(a2|b2,f2).πAlarm(b2)].λ(a2) += [(0.99x0.005) + (0.003x0.995)]x0.5 ++ [(0.01x0.005) + (0.997x0.995)]x0.5 = 0.5 + +λ message _Jn --> FreightTruck +λ_Jn(f1) += [p(_jn0|f1,a1).π_Jn(a1) + p(_jn0|f1,a2).π_Jn(a2)].λ(_jn0) ++ [p(_jn1|f1,a1).π_Jn(a1) + p(_jn1|f1,a2).π_Jn(a2)].λ(_jn1) ++ [p(_jn2|f1,a1).π_Jn(a1) + p(_jn2|f1,a2).π_Jn(a2)].λ(_jn2) ++ [p(_jn3|f1,a1).π_Jn(a1) + p(_jn3|f1,a2).π_Jn(a2)].λ(_jn3) += [(1x0.013819) + (0x0.986181)]x1 ++ [(0x0.013819) + (1x0.986181)]x1 ++ [(0x0.013819) + (0x0.986181)]x1 ++ [(0x0.013819) + (0x0.986181)]x1 = 1 +λ_Jn(f2) += [p(_jn0|f2,a1).π_Jn(a1) + p(_jn0|f2,a2).π_Jn(a2)].λ(_jn0) ++ [p(_jn1|f2,a1).π_Jn(a1) + p(_jn1|f2,a2).π_Jn(a2)].λ(_jn1) ++ [p(_jn2|f2,a1).π_Jn(a1) + p(_jn2|f2,a2).π_Jn(a2)].λ(_jn2) ++ [p(_jn3|f2,a1).π_Jn(a1) + p(_jn3|f2,a2).π_Jn(a2)].λ(_jn3) += [(0x0.013819) + (0x0.986181)]x1 ++ [(0x0.013819) + (0x0.986181)]x1 ++ [(1x0.013819) + (0x0.986181)]x1 ++ [(0x0.013819) + (1x0.986181)]x1 = 1 + +λ message _Jn --> Alarm +λ_Jn(a1) += [p(_jn0|f1,a1).π_Jn(f1) + p(_jn0|f2,a1).π_Jn(f2)].λ(_jn0) ++ [p(_jn1|f1,a1).π_Jn(f1) + p(_jn1|f2,a1).π_Jn(f2)].λ(_jn1) ++ [p(_jn2|f1,a1).π_Jn(f1) + p(_jn2|f2,a1).π_Jn(f2)].λ(_jn2) ++ [p(_jn3|f1,a1).π_Jn(f1) + p(_jn3|f2,a1).π_Jn(f2)].λ(_jn3) += [(1x0.0300055) + (0x0.969994)]x1 ++ [(0x0.0300055) + (0x0.969994)]x1 ++ [(0x0.0300055) + (1x0.969994)]x1 ++ [(0x0.0300055) + (0x0.969994)]x1 = 1 +λ_Jn(a2) += [p(_jn0|f1,a2).π_Jn(f1) + p(_jn0|f2,a2).π_Jn(f2)].λ(_jn0) ++ [p(_jn1|f1,a2).π_Jn(f1) + p(_jn1|f2,a2).π_Jn(f2)].λ(_jn1) ++ [p(_jn2|f1,a2).π_Jn(f1) + p(_jn2|f2,a2).π_Jn(f2)].λ(_jn2) ++ [p(_jn3|f1,a2).π_Jn(f1) + p(_jn3|f2,a2).π_Jn(f2)].λ(_jn3) += [(0x0.0300055) + (0x0.969994)]x1 ++ [(1x0.0300055) + (0x0.969994)]x1 ++ [(0x0.0300055) + (0x0.969994)]x1 ++ [(0x0.0300055) + (1x0.969994)]x1 = 1 + +π message Burglar --> Alarm +πAlarm(b1) = π(b1) = 0.005 = 0.005 +πAlarm(b2) = π(b2) = 0.995 = 0.995 + +π message FreightTruck --> Alarm +πAlarm(f1) = π(f1).λ_Jn(f1) = 0.03 x 0.5 = 0.015 +πAlarm(f2) = π(f2).λ_Jn(f2) = 0.97 x 0.5 = 0.485 + +π message FreightTruck --> _Jn +π_Jn(f1) = π(f1).λAlarm(f1) = 0.03 x 0.5 = 0.015 +π_Jn(f2) = π(f2).λAlarm(f2) = 0.97 x 0.5 = 0.485 + +π message Alarm --> _Jn +π_Jn(a1) = π(a1) = 0.0138168 = 0.01381683288 +π_Jn(a2) = π(a2) = 0.986183 = 0.9861831671 + +var Burglar: +π(b1) += p(b1) += (0.005) = 0.005 +π(b2) += p(b2) += (0.995) = 0.995 +λ(b1) = λAlarm(b1) = 0.5 = 0.5 +λ(b2) = λAlarm(b2) = 0.5 = 0.5 +belief change = 0 + +var FreightTruck: +π(f1) += p(f1) += (0.03) = 0.03 +π(f2) += p(f2) += (0.97) = 0.97 +λ(f1) = λAlarm(f1).λ_Jn(f1) = 0.5 x 0.5 = 0.25 +λ(f2) = λAlarm(f2).λ_Jn(f2) = 0.5 x 0.5 = 0.25 +belief change = 0 + +var Alarm: +π(a1) += p(a1|b1,f1).πAlarm(b1).πAlarm(f1) ++ p(a1|b1,f2).πAlarm(b1).πAlarm(f2) ++ p(a1|b2,f1).πAlarm(b2).πAlarm(f1) ++ p(a1|b2,f2).πAlarm(b2).πAlarm(f2) += (0.992x0.005x0.0300037) ++ (0.99x0.005x0.969996) ++ (0.2x0.995x0.0300037) ++ (0.003x0.995x0.969996) = 0.01381647162 +π(a2) += p(a2|b1,f1).πAlarm(b1).πAlarm(f1) ++ p(a2|b1,f2).πAlarm(b1).πAlarm(f2) ++ p(a2|b2,f1).πAlarm(b2).πAlarm(f1) ++ p(a2|b2,f2).πAlarm(b2).πAlarm(f2) += (0.008x0.005x0.0300037) ++ (0.01x0.005x0.969996) ++ (0.8x0.995x0.0300037) ++ (0.997x0.995x0.969996) = 0.9861835284 +λ(a1) = λ_Jn(a1) = 0.5 = 0.5 +λ(a2) = λ_Jn(a2) = 0.5 = 0.5 +belief change = 7.225230066e-07 + +var _Jn: +π(_jn0) += p(_jn0|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn0|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn0|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn0|f2,a2).π_Jn(f2).π_Jn(a2) += (1x0.0300037x0.0138179) ++ (0x0.0300037x0.986182) ++ (0x0.969996x0.0138179) ++ (0x0.969996x0.986182) = 0.0004145889564 +π(_jn1) += p(_jn1|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn1|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn1|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn1|f2,a2).π_Jn(f2).π_Jn(a2) += (0x0.0300037x0.0138179) ++ (1x0.0300037x0.986182) ++ (0x0.969996x0.0138179) ++ (0x0.969996x0.986182) = 0.02958908769 +π(_jn2) += p(_jn2|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn2|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn2|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn2|f2,a2).π_Jn(f2).π_Jn(a2) += (0x0.0300037x0.0138179) ++ (0x0.0300037x0.986182) ++ (1x0.969996x0.0138179) ++ (0x0.969996x0.986182) = 0.01340334947 +π(_jn3) += p(_jn3|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn3|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn3|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn3|f2,a2).π_Jn(f2).π_Jn(a2) += (0x0.0300037x0.0138179) ++ (0x0.0300037x0.986182) ++ (0x0.969996x0.0138179) ++ (1x0.969996x0.986182) = 0.9565929739 +λ(_jn0) = 1 +λ(_jn1) = 1 +λ(_jn2) = 1 +λ(_jn3) = 1 +belief change = 5.770586867e-06 + +domain π(Burglar) λ(Burglar) belief +---------------------------------------------------------------- +b1 0.005 0.5 0.005 +b2 0.995 0.5 0.995 + +domain πAlarm(Burglar) λAlarm(Burglar) +---------------------------------------------------------------- +b1 0.005000000922 0.5 +b2 0.9949999991 0.5 + +domain π(FreightTruck) λ(FreightTruck) belief +---------------------------------------------------------------- +f1 0.03 0.25 0.03 +f2 0.97 0.25 0.97 + +domain πAlarm(FreightTruck) λAlarm(FreightTruck) +---------------------------------------------------------------- +f1 0.03000367664 0.5 +f2 0.9699963234 0.5 + +domain π_Jn(FreightTruck) λ_Jn(FreightTruck) +---------------------------------------------------------------- +f1 0.03000367664 0.5 +f2 0.9699963234 0.5 + +domain π(Alarm) λ(Alarm) belief +---------------------------------------------------------------- +a1 0.01381647162 0.5 0.01381647162 +a2 0.9861835284 0.5 0.9861835284 + +domain π_Jn(Alarm) λ_Jn(Alarm) +---------------------------------------------------------------- +a1 0.01381793843 0.5 +a2 0.9861820616 0.5 + +domain π(_Jn) λ(_Jn) belief +---------------------------------------------------------------- +_jn0 0.0004145889564 1 0.0004145889564 +_jn1 0.02958908769 1 0.02958908769 +_jn2 0.01340334947 1 0.01340334947 +_jn3 0.9565929739 1 0.9565929739 + + + +******************************************************************************** + Iteration 30 +******************************************************************************** +λ message Alarm --> Burglar +λAlarm(b1) += [p(a1|b1,f1).πAlarm(f1) + p(a1|b1,f2).πAlarm(f2)].λ(a1) ++ [p(a2|b1,f1).πAlarm(f1) + p(a2|b1,f2).πAlarm(f2)].λ(a2) += [(0.992x0.0300037) + (0.99x0.969996)]x0.5 ++ [(0.008x0.0300037) + (0.01x0.969996)]x0.5 = 0.5 +λAlarm(b2) += [p(a1|b2,f1).πAlarm(f1) + p(a1|b2,f2).πAlarm(f2)].λ(a1) ++ [p(a2|b2,f1).πAlarm(f1) + p(a2|b2,f2).πAlarm(f2)].λ(a2) += [(0.2x0.0300037) + (0.003x0.969996)]x0.5 ++ [(0.8x0.0300037) + (0.997x0.969996)]x0.5 = 0.5 + +λ message Alarm --> FreightTruck +λAlarm(f1) += [p(a1|b1,f1).πAlarm(b1) + p(a1|b2,f1).πAlarm(b2)].λ(a1) ++ [p(a2|b1,f1).πAlarm(b1) + p(a2|b2,f1).πAlarm(b2)].λ(a2) += [(0.992x0.005) + (0.2x0.995)]x0.5 ++ [(0.008x0.005) + (0.8x0.995)]x0.5 = 0.5 +λAlarm(f2) += [p(a1|b1,f2).πAlarm(b1) + p(a1|b2,f2).πAlarm(b2)].λ(a1) ++ [p(a2|b1,f2).πAlarm(b1) + p(a2|b2,f2).πAlarm(b2)].λ(a2) += [(0.99x0.005) + (0.003x0.995)]x0.5 ++ [(0.01x0.005) + (0.997x0.995)]x0.5 = 0.5 + +λ message _Jn --> FreightTruck +λ_Jn(f1) += [p(_jn0|f1,a1).π_Jn(a1) + p(_jn0|f1,a2).π_Jn(a2)].λ(_jn0) ++ [p(_jn1|f1,a1).π_Jn(a1) + p(_jn1|f1,a2).π_Jn(a2)].λ(_jn1) ++ [p(_jn2|f1,a1).π_Jn(a1) + p(_jn2|f1,a2).π_Jn(a2)].λ(_jn2) ++ [p(_jn3|f1,a1).π_Jn(a1) + p(_jn3|f1,a2).π_Jn(a2)].λ(_jn3) += [(1x0.0138179) + (0x0.986182)]x1 ++ [(0x0.0138179) + (1x0.986182)]x1 ++ [(0x0.0138179) + (0x0.986182)]x1 ++ [(0x0.0138179) + (0x0.986182)]x1 = 1 +λ_Jn(f2) += [p(_jn0|f2,a1).π_Jn(a1) + p(_jn0|f2,a2).π_Jn(a2)].λ(_jn0) ++ [p(_jn1|f2,a1).π_Jn(a1) + p(_jn1|f2,a2).π_Jn(a2)].λ(_jn1) ++ [p(_jn2|f2,a1).π_Jn(a1) + p(_jn2|f2,a2).π_Jn(a2)].λ(_jn2) ++ [p(_jn3|f2,a1).π_Jn(a1) + p(_jn3|f2,a2).π_Jn(a2)].λ(_jn3) += [(0x0.0138179) + (0x0.986182)]x1 ++ [(0x0.0138179) + (0x0.986182)]x1 ++ [(1x0.0138179) + (0x0.986182)]x1 ++ [(0x0.0138179) + (1x0.986182)]x1 = 1 + +λ message _Jn --> Alarm +λ_Jn(a1) += [p(_jn0|f1,a1).π_Jn(f1) + p(_jn0|f2,a1).π_Jn(f2)].λ(_jn0) ++ [p(_jn1|f1,a1).π_Jn(f1) + p(_jn1|f2,a1).π_Jn(f2)].λ(_jn1) ++ [p(_jn2|f1,a1).π_Jn(f1) + p(_jn2|f2,a1).π_Jn(f2)].λ(_jn2) ++ [p(_jn3|f1,a1).π_Jn(f1) + p(_jn3|f2,a1).π_Jn(f2)].λ(_jn3) += [(1x0.0300037) + (0x0.969996)]x1 ++ [(0x0.0300037) + (0x0.969996)]x1 ++ [(0x0.0300037) + (1x0.969996)]x1 ++ [(0x0.0300037) + (0x0.969996)]x1 = 1 +λ_Jn(a2) += [p(_jn0|f1,a2).π_Jn(f1) + p(_jn0|f2,a2).π_Jn(f2)].λ(_jn0) ++ [p(_jn1|f1,a2).π_Jn(f1) + p(_jn1|f2,a2).π_Jn(f2)].λ(_jn1) ++ [p(_jn2|f1,a2).π_Jn(f1) + p(_jn2|f2,a2).π_Jn(f2)].λ(_jn2) ++ [p(_jn3|f1,a2).π_Jn(f1) + p(_jn3|f2,a2).π_Jn(f2)].λ(_jn3) += [(0x0.0300037) + (0x0.969996)]x1 ++ [(1x0.0300037) + (0x0.969996)]x1 ++ [(0x0.0300037) + (0x0.969996)]x1 ++ [(0x0.0300037) + (1x0.969996)]x1 = 1 + +π message Burglar --> Alarm +πAlarm(b1) = π(b1) = 0.005 = 0.005 +πAlarm(b2) = π(b2) = 0.995 = 0.995 + +π message FreightTruck --> Alarm +πAlarm(f1) = π(f1).λ_Jn(f1) = 0.03 x 0.5 = 0.015 +πAlarm(f2) = π(f2).λ_Jn(f2) = 0.97 x 0.5 = 0.485 + +π message FreightTruck --> _Jn +π_Jn(f1) = π(f1).λAlarm(f1) = 0.03 x 0.5 = 0.015 +π_Jn(f2) = π(f2).λAlarm(f2) = 0.97 x 0.5 = 0.485 + +π message Alarm --> _Jn +π_Jn(a1) = π(a1) = 0.0138165 = 0.01381647162 +π_Jn(a2) = π(a2) = 0.986184 = 0.9861835284 + +var Burglar: +π(b1) += p(b1) += (0.005) = 0.005 +π(b2) += p(b2) += (0.995) = 0.995 +λ(b1) = λAlarm(b1) = 0.5 = 0.5 +λ(b2) = λAlarm(b2) = 0.5 = 0.5 +belief change = 0 + +var FreightTruck: +π(f1) += p(f1) += (0.03) = 0.03 +π(f2) += p(f2) += (0.97) = 0.97 +λ(f1) = λAlarm(f1).λ_Jn(f1) = 0.5 x 0.5 = 0.25 +λ(f2) = λAlarm(f2).λ_Jn(f2) = 0.5 x 0.5 = 0.25 +belief change = 0 + +var Alarm: +π(a1) += p(a1|b1,f1).πAlarm(b1).πAlarm(f1) ++ p(a1|b1,f2).πAlarm(b1).πAlarm(f2) ++ p(a1|b2,f1).πAlarm(b2).πAlarm(f1) ++ p(a1|b2,f2).πAlarm(b2).πAlarm(f2) += (0.992x0.005x0.0300025) ++ (0.99x0.005x0.969998) ++ (0.2x0.995x0.0300025) ++ (0.003x0.995x0.969998) = 0.01381623093 +π(a2) += p(a2|b1,f1).πAlarm(b1).πAlarm(f1) ++ p(a2|b1,f2).πAlarm(b1).πAlarm(f2) ++ p(a2|b2,f1).πAlarm(b2).πAlarm(f1) ++ p(a2|b2,f2).πAlarm(b2).πAlarm(f2) += (0.008x0.005x0.0300025) ++ (0.01x0.005x0.969998) ++ (0.8x0.995x0.0300025) ++ (0.997x0.995x0.969998) = 0.9861837691 +λ(a1) = λ_Jn(a1) = 0.5 = 0.5 +λ(a2) = λ_Jn(a2) = 0.5 = 0.5 +belief change = 4.813804621e-07 + +var _Jn: +π(_jn0) += p(_jn0|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn0|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn0|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn0|f2,a2).π_Jn(f2).π_Jn(a2) += (1x0.0300025x0.0138172) ++ (0x0.0300025x0.986183) ++ (0x0.969998x0.0138172) ++ (0x0.969998x0.986183) = 0.000414550018 +π(_jn1) += p(_jn1|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn1|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn1|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn1|f2,a2).π_Jn(f2).π_Jn(a2) += (0x0.0300025x0.0138172) ++ (1x0.0300025x0.986183) ++ (0x0.969998x0.0138172) ++ (0x0.969998x0.986183) = 0.02958790108 +π(_jn2) += p(_jn2|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn2|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn2|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn2|f2,a2).π_Jn(f2).π_Jn(a2) += (0x0.0300025x0.0138172) ++ (0x0.0300025x0.986183) ++ (1x0.969998x0.0138172) ++ (0x0.969998x0.986183) = 0.013402655 +π(_jn3) += p(_jn3|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn3|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn3|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn3|f2,a2).π_Jn(f2).π_Jn(a2) += (0x0.0300025x0.0138172) ++ (0x0.0300025x0.986183) ++ (0x0.969998x0.0138172) ++ (1x0.969998x0.986183) = 0.9565948939 +λ(_jn0) = 1 +λ(_jn1) = 1 +λ(_jn2) = 1 +λ(_jn3) = 1 +belief change = 3.840025993e-06 + +domain π(Burglar) λ(Burglar) belief +---------------------------------------------------------------- +b1 0.005 0.5 0.005 +b2 0.995 0.5 0.995 + +domain πAlarm(Burglar) λAlarm(Burglar) +---------------------------------------------------------------- +b1 0.005000000461 0.5 +b2 0.9949999995 0.5 + +domain π(FreightTruck) λ(FreightTruck) belief +---------------------------------------------------------------- +f1 0.03 0.25 0.03 +f2 0.97 0.25 0.97 + +domain πAlarm(FreightTruck) λAlarm(FreightTruck) +---------------------------------------------------------------- +f1 0.03000245109 0.5 +f2 0.9699975489 0.5 + +domain π_Jn(FreightTruck) λ_Jn(FreightTruck) +---------------------------------------------------------------- +f1 0.03000245109 0.5 +f2 0.9699975489 0.5 + +domain π(Alarm) λ(Alarm) belief +---------------------------------------------------------------- +a1 0.01381623093 0.5 0.01381623093 +a2 0.9861837691 0.5 0.9861837691 + +domain π_Jn(Alarm) λ_Jn(Alarm) +---------------------------------------------------------------- +a1 0.01381720502 0.5 +a2 0.986182795 0.5 + +domain π(_Jn) λ(_Jn) belief +---------------------------------------------------------------- +_jn0 0.000414550018 1 0.000414550018 +_jn1 0.02958790108 1 0.02958790108 +_jn2 0.013402655 1 0.013402655 +_jn3 0.9565948939 1 0.9565948939 + + + +******************************************************************************** + Iteration 31 +******************************************************************************** +λ message Alarm --> Burglar +λAlarm(b1) += [p(a1|b1,f1).πAlarm(f1) + p(a1|b1,f2).πAlarm(f2)].λ(a1) ++ [p(a2|b1,f1).πAlarm(f1) + p(a2|b1,f2).πAlarm(f2)].λ(a2) += [(0.992x0.0300025) + (0.99x0.969998)]x0.5 ++ [(0.008x0.0300025) + (0.01x0.969998)]x0.5 = 0.5 +λAlarm(b2) += [p(a1|b2,f1).πAlarm(f1) + p(a1|b2,f2).πAlarm(f2)].λ(a1) ++ [p(a2|b2,f1).πAlarm(f1) + p(a2|b2,f2).πAlarm(f2)].λ(a2) += [(0.2x0.0300025) + (0.003x0.969998)]x0.5 ++ [(0.8x0.0300025) + (0.997x0.969998)]x0.5 = 0.5 + +λ message Alarm --> FreightTruck +λAlarm(f1) += [p(a1|b1,f1).πAlarm(b1) + p(a1|b2,f1).πAlarm(b2)].λ(a1) ++ [p(a2|b1,f1).πAlarm(b1) + p(a2|b2,f1).πAlarm(b2)].λ(a2) += [(0.992x0.005) + (0.2x0.995)]x0.5 ++ [(0.008x0.005) + (0.8x0.995)]x0.5 = 0.5 +λAlarm(f2) += [p(a1|b1,f2).πAlarm(b1) + p(a1|b2,f2).πAlarm(b2)].λ(a1) ++ [p(a2|b1,f2).πAlarm(b1) + p(a2|b2,f2).πAlarm(b2)].λ(a2) += [(0.99x0.005) + (0.003x0.995)]x0.5 ++ [(0.01x0.005) + (0.997x0.995)]x0.5 = 0.5 + +λ message _Jn --> FreightTruck +λ_Jn(f1) += [p(_jn0|f1,a1).π_Jn(a1) + p(_jn0|f1,a2).π_Jn(a2)].λ(_jn0) ++ [p(_jn1|f1,a1).π_Jn(a1) + p(_jn1|f1,a2).π_Jn(a2)].λ(_jn1) ++ [p(_jn2|f1,a1).π_Jn(a1) + p(_jn2|f1,a2).π_Jn(a2)].λ(_jn2) ++ [p(_jn3|f1,a1).π_Jn(a1) + p(_jn3|f1,a2).π_Jn(a2)].λ(_jn3) += [(1x0.0138172) + (0x0.986183)]x1 ++ [(0x0.0138172) + (1x0.986183)]x1 ++ [(0x0.0138172) + (0x0.986183)]x1 ++ [(0x0.0138172) + (0x0.986183)]x1 = 1 +λ_Jn(f2) += [p(_jn0|f2,a1).π_Jn(a1) + p(_jn0|f2,a2).π_Jn(a2)].λ(_jn0) ++ [p(_jn1|f2,a1).π_Jn(a1) + p(_jn1|f2,a2).π_Jn(a2)].λ(_jn1) ++ [p(_jn2|f2,a1).π_Jn(a1) + p(_jn2|f2,a2).π_Jn(a2)].λ(_jn2) ++ [p(_jn3|f2,a1).π_Jn(a1) + p(_jn3|f2,a2).π_Jn(a2)].λ(_jn3) += [(0x0.0138172) + (0x0.986183)]x1 ++ [(0x0.0138172) + (0x0.986183)]x1 ++ [(1x0.0138172) + (0x0.986183)]x1 ++ [(0x0.0138172) + (1x0.986183)]x1 = 1 + +λ message _Jn --> Alarm +λ_Jn(a1) += [p(_jn0|f1,a1).π_Jn(f1) + p(_jn0|f2,a1).π_Jn(f2)].λ(_jn0) ++ [p(_jn1|f1,a1).π_Jn(f1) + p(_jn1|f2,a1).π_Jn(f2)].λ(_jn1) ++ [p(_jn2|f1,a1).π_Jn(f1) + p(_jn2|f2,a1).π_Jn(f2)].λ(_jn2) ++ [p(_jn3|f1,a1).π_Jn(f1) + p(_jn3|f2,a1).π_Jn(f2)].λ(_jn3) += [(1x0.0300025) + (0x0.969998)]x1 ++ [(0x0.0300025) + (0x0.969998)]x1 ++ [(0x0.0300025) + (1x0.969998)]x1 ++ [(0x0.0300025) + (0x0.969998)]x1 = 1 +λ_Jn(a2) += [p(_jn0|f1,a2).π_Jn(f1) + p(_jn0|f2,a2).π_Jn(f2)].λ(_jn0) ++ [p(_jn1|f1,a2).π_Jn(f1) + p(_jn1|f2,a2).π_Jn(f2)].λ(_jn1) ++ [p(_jn2|f1,a2).π_Jn(f1) + p(_jn2|f2,a2).π_Jn(f2)].λ(_jn2) ++ [p(_jn3|f1,a2).π_Jn(f1) + p(_jn3|f2,a2).π_Jn(f2)].λ(_jn3) += [(0x0.0300025) + (0x0.969998)]x1 ++ [(1x0.0300025) + (0x0.969998)]x1 ++ [(0x0.0300025) + (0x0.969998)]x1 ++ [(0x0.0300025) + (1x0.969998)]x1 = 1 + +π message Burglar --> Alarm +πAlarm(b1) = π(b1) = 0.005 = 0.005 +πAlarm(b2) = π(b2) = 0.995 = 0.995 + +π message FreightTruck --> Alarm +πAlarm(f1) = π(f1).λ_Jn(f1) = 0.03 x 0.5 = 0.015 +πAlarm(f2) = π(f2).λ_Jn(f2) = 0.97 x 0.5 = 0.485 + +π message FreightTruck --> _Jn +π_Jn(f1) = π(f1).λAlarm(f1) = 0.03 x 0.5 = 0.015 +π_Jn(f2) = π(f2).λAlarm(f2) = 0.97 x 0.5 = 0.485 + +π message Alarm --> _Jn +π_Jn(a1) = π(a1) = 0.0138162 = 0.01381623093 +π_Jn(a2) = π(a2) = 0.986184 = 0.9861837691 + +var Burglar: +π(b1) += p(b1) += (0.005) = 0.005 +π(b2) += p(b2) += (0.995) = 0.995 +λ(b1) = λAlarm(b1) = 0.5 = 0.5 +λ(b2) = λAlarm(b2) = 0.5 = 0.5 +belief change = 0 + +var FreightTruck: +π(f1) += p(f1) += (0.03) = 0.03 +π(f2) += p(f2) += (0.97) = 0.97 +λ(f1) = λAlarm(f1).λ_Jn(f1) = 0.5 x 0.5 = 0.25 +λ(f2) = λAlarm(f2).λ_Jn(f2) = 0.5 x 0.5 = 0.25 +belief change = 0 + +var Alarm: +π(a1) += p(a1|b1,f1).πAlarm(b1).πAlarm(f1) ++ p(a1|b1,f2).πAlarm(b1).πAlarm(f2) ++ p(a1|b2,f1).πAlarm(b2).πAlarm(f1) ++ p(a1|b2,f2).πAlarm(b2).πAlarm(f2) += (0.992x0.005x0.0300016) ++ (0.99x0.005x0.969998) ++ (0.2x0.995x0.0300016) ++ (0.003x0.995x0.969998) = 0.01381607054 +π(a2) += p(a2|b1,f1).πAlarm(b1).πAlarm(f1) ++ p(a2|b1,f2).πAlarm(b1).πAlarm(f2) ++ p(a2|b2,f1).πAlarm(b2).πAlarm(f1) ++ p(a2|b2,f2).πAlarm(b2).πAlarm(f2) += (0.008x0.005x0.0300016) ++ (0.01x0.005x0.969998) ++ (0.8x0.995x0.0300016) ++ (0.997x0.995x0.969998) = 0.9861839295 +λ(a1) = λ_Jn(a1) = 0.5 = 0.5 +λ(a2) = λ_Jn(a2) = 0.5 = 0.5 +belief change = 3.207695366e-07 + +var _Jn: +π(_jn0) += p(_jn0|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn0|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn0|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn0|f2,a2).π_Jn(f2).π_Jn(a2) += (1x0.0300016x0.0138167) ++ (0x0.0300016x0.986183) ++ (0x0.969998x0.0138167) ++ (0x0.969998x0.986183) = 0.0004145241166 +π(_jn1) += p(_jn1|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn1|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn1|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn1|f2,a2).π_Jn(f2).π_Jn(a2) += (0x0.0300016x0.0138167) ++ (1x0.0300016x0.986183) ++ (0x0.969998x0.0138167) ++ (0x0.969998x0.986183) = 0.02958710995 +π(_jn2) += p(_jn2|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn2|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn2|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn2|f2,a2).π_Jn(f2).π_Jn(a2) += (0x0.0300016x0.0138167) ++ (0x0.0300016x0.986183) ++ (1x0.969998x0.0138167) ++ (0x0.969998x0.986183) = 0.01340219386 +π(_jn3) += p(_jn3|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn3|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn3|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn3|f2,a2).π_Jn(f2).π_Jn(a2) += (0x0.0300016x0.0138167) ++ (0x0.0300016x0.986183) ++ (0x0.969998x0.0138167) ++ (1x0.969998x0.986183) = 0.9565961721 +λ(_jn0) = 1 +λ(_jn1) = 1 +λ(_jn2) = 1 +λ(_jn3) = 1 +belief change = 2.556354858e-06 + +domain π(Burglar) λ(Burglar) belief +---------------------------------------------------------------- +b1 0.005 0.5 0.005 +b2 0.995 0.5 0.995 + +domain πAlarm(Burglar) λAlarm(Burglar) +---------------------------------------------------------------- +b1 0.005000000231 0.5 +b2 0.9949999998 0.5 + +domain π(FreightTruck) λ(FreightTruck) belief +---------------------------------------------------------------- +f1 0.03 0.25 0.03 +f2 0.97 0.25 0.97 + +domain πAlarm(FreightTruck) λAlarm(FreightTruck) +---------------------------------------------------------------- +f1 0.03000163406 0.5 +f2 0.9699983659 0.5 + +domain π_Jn(FreightTruck) λ_Jn(FreightTruck) +---------------------------------------------------------------- +f1 0.03000163406 0.5 +f2 0.9699983659 0.5 + +domain π(Alarm) λ(Alarm) belief +---------------------------------------------------------------- +a1 0.01381607054 0.5 0.01381607054 +a2 0.9861839295 0.5 0.9861839295 + +domain π_Jn(Alarm) λ_Jn(Alarm) +---------------------------------------------------------------- +a1 0.01381671798 0.5 +a2 0.986183282 0.5 + +domain π(_Jn) λ(_Jn) belief +---------------------------------------------------------------- +_jn0 0.0004145241166 1 0.0004145241166 +_jn1 0.02958710995 1 0.02958710995 +_jn2 0.01340219386 1 0.01340219386 +_jn3 0.9565961721 1 0.9565961721 + + + +******************************************************************************** + Iteration 32 +******************************************************************************** +λ message Alarm --> Burglar +λAlarm(b1) += [p(a1|b1,f1).πAlarm(f1) + p(a1|b1,f2).πAlarm(f2)].λ(a1) ++ [p(a2|b1,f1).πAlarm(f1) + p(a2|b1,f2).πAlarm(f2)].λ(a2) += [(0.992x0.0300016) + (0.99x0.969998)]x0.5 ++ [(0.008x0.0300016) + (0.01x0.969998)]x0.5 = 0.5 +λAlarm(b2) += [p(a1|b2,f1).πAlarm(f1) + p(a1|b2,f2).πAlarm(f2)].λ(a1) ++ [p(a2|b2,f1).πAlarm(f1) + p(a2|b2,f2).πAlarm(f2)].λ(a2) += [(0.2x0.0300016) + (0.003x0.969998)]x0.5 ++ [(0.8x0.0300016) + (0.997x0.969998)]x0.5 = 0.5 + +λ message Alarm --> FreightTruck +λAlarm(f1) += [p(a1|b1,f1).πAlarm(b1) + p(a1|b2,f1).πAlarm(b2)].λ(a1) ++ [p(a2|b1,f1).πAlarm(b1) + p(a2|b2,f1).πAlarm(b2)].λ(a2) += [(0.992x0.005) + (0.2x0.995)]x0.5 ++ [(0.008x0.005) + (0.8x0.995)]x0.5 = 0.5 +λAlarm(f2) += [p(a1|b1,f2).πAlarm(b1) + p(a1|b2,f2).πAlarm(b2)].λ(a1) ++ [p(a2|b1,f2).πAlarm(b1) + p(a2|b2,f2).πAlarm(b2)].λ(a2) += [(0.99x0.005) + (0.003x0.995)]x0.5 ++ [(0.01x0.005) + (0.997x0.995)]x0.5 = 0.5 + +λ message _Jn --> FreightTruck +λ_Jn(f1) += [p(_jn0|f1,a1).π_Jn(a1) + p(_jn0|f1,a2).π_Jn(a2)].λ(_jn0) ++ [p(_jn1|f1,a1).π_Jn(a1) + p(_jn1|f1,a2).π_Jn(a2)].λ(_jn1) ++ [p(_jn2|f1,a1).π_Jn(a1) + p(_jn2|f1,a2).π_Jn(a2)].λ(_jn2) ++ [p(_jn3|f1,a1).π_Jn(a1) + p(_jn3|f1,a2).π_Jn(a2)].λ(_jn3) += [(1x0.0138167) + (0x0.986183)]x1 ++ [(0x0.0138167) + (1x0.986183)]x1 ++ [(0x0.0138167) + (0x0.986183)]x1 ++ [(0x0.0138167) + (0x0.986183)]x1 = 1 +λ_Jn(f2) += [p(_jn0|f2,a1).π_Jn(a1) + p(_jn0|f2,a2).π_Jn(a2)].λ(_jn0) ++ [p(_jn1|f2,a1).π_Jn(a1) + p(_jn1|f2,a2).π_Jn(a2)].λ(_jn1) ++ [p(_jn2|f2,a1).π_Jn(a1) + p(_jn2|f2,a2).π_Jn(a2)].λ(_jn2) ++ [p(_jn3|f2,a1).π_Jn(a1) + p(_jn3|f2,a2).π_Jn(a2)].λ(_jn3) += [(0x0.0138167) + (0x0.986183)]x1 ++ [(0x0.0138167) + (0x0.986183)]x1 ++ [(1x0.0138167) + (0x0.986183)]x1 ++ [(0x0.0138167) + (1x0.986183)]x1 = 1 + +λ message _Jn --> Alarm +λ_Jn(a1) += [p(_jn0|f1,a1).π_Jn(f1) + p(_jn0|f2,a1).π_Jn(f2)].λ(_jn0) ++ [p(_jn1|f1,a1).π_Jn(f1) + p(_jn1|f2,a1).π_Jn(f2)].λ(_jn1) ++ [p(_jn2|f1,a1).π_Jn(f1) + p(_jn2|f2,a1).π_Jn(f2)].λ(_jn2) ++ [p(_jn3|f1,a1).π_Jn(f1) + p(_jn3|f2,a1).π_Jn(f2)].λ(_jn3) += [(1x0.0300016) + (0x0.969998)]x1 ++ [(0x0.0300016) + (0x0.969998)]x1 ++ [(0x0.0300016) + (1x0.969998)]x1 ++ [(0x0.0300016) + (0x0.969998)]x1 = 1 +λ_Jn(a2) += [p(_jn0|f1,a2).π_Jn(f1) + p(_jn0|f2,a2).π_Jn(f2)].λ(_jn0) ++ [p(_jn1|f1,a2).π_Jn(f1) + p(_jn1|f2,a2).π_Jn(f2)].λ(_jn1) ++ [p(_jn2|f1,a2).π_Jn(f1) + p(_jn2|f2,a2).π_Jn(f2)].λ(_jn2) ++ [p(_jn3|f1,a2).π_Jn(f1) + p(_jn3|f2,a2).π_Jn(f2)].λ(_jn3) += [(0x0.0300016) + (0x0.969998)]x1 ++ [(1x0.0300016) + (0x0.969998)]x1 ++ [(0x0.0300016) + (0x0.969998)]x1 ++ [(0x0.0300016) + (1x0.969998)]x1 = 1 + +π message Burglar --> Alarm +πAlarm(b1) = π(b1) = 0.005 = 0.005 +πAlarm(b2) = π(b2) = 0.995 = 0.995 + +π message FreightTruck --> Alarm +πAlarm(f1) = π(f1).λ_Jn(f1) = 0.03 x 0.5 = 0.015 +πAlarm(f2) = π(f2).λ_Jn(f2) = 0.97 x 0.5 = 0.485 + +π message FreightTruck --> _Jn +π_Jn(f1) = π(f1).λAlarm(f1) = 0.03 x 0.5 = 0.015 +π_Jn(f2) = π(f2).λAlarm(f2) = 0.97 x 0.5 = 0.485 + +π message Alarm --> _Jn +π_Jn(a1) = π(a1) = 0.0138161 = 0.01381607054 +π_Jn(a2) = π(a2) = 0.986184 = 0.9861839295 + +var Burglar: +π(b1) += p(b1) += (0.005) = 0.005 +π(b2) += p(b2) += (0.995) = 0.995 +λ(b1) = λAlarm(b1) = 0.5 = 0.5 +λ(b2) = λAlarm(b2) = 0.5 = 0.5 +belief change = 0 + +var FreightTruck: +π(f1) += p(f1) += (0.03) = 0.03 +π(f2) += p(f2) += (0.97) = 0.97 +λ(f1) = λAlarm(f1).λ_Jn(f1) = 0.5 x 0.5 = 0.25 +λ(f2) = λAlarm(f2).λ_Jn(f2) = 0.5 x 0.5 = 0.25 +belief change = 0 + +var Alarm: +π(a1) += p(a1|b1,f1).πAlarm(b1).πAlarm(f1) ++ p(a1|b1,f2).πAlarm(b1).πAlarm(f2) ++ p(a1|b2,f1).πAlarm(b2).πAlarm(f1) ++ p(a1|b2,f2).πAlarm(b2).πAlarm(f2) += (0.992x0.005x0.0300011) ++ (0.99x0.005x0.969999) ++ (0.2x0.995x0.0300011) ++ (0.003x0.995x0.969999) = 0.01381596366 +π(a2) += p(a2|b1,f1).πAlarm(b1).πAlarm(f1) ++ p(a2|b1,f2).πAlarm(b1).πAlarm(f2) ++ p(a2|b2,f1).πAlarm(b2).πAlarm(f1) ++ p(a2|b2,f2).πAlarm(b2).πAlarm(f2) += (0.008x0.005x0.0300011) ++ (0.01x0.005x0.969999) ++ (0.8x0.995x0.0300011) ++ (0.997x0.995x0.969999) = 0.9861840363 +λ(a1) = λ_Jn(a1) = 0.5 = 0.5 +λ(a2) = λ_Jn(a2) = 0.5 = 0.5 +belief change = 2.137709722e-07 + +var _Jn: +π(_jn0) += p(_jn0|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn0|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn0|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn0|f2,a2).π_Jn(f2).π_Jn(a2) += (1x0.0300011x0.0138164) ++ (0x0.0300011x0.986184) ++ (0x0.969999x0.0138164) ++ (0x0.969999x0.986184) = 0.000414506879 +π(_jn1) += p(_jn1|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn1|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn1|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn1|f2,a2).π_Jn(f2).π_Jn(a2) += (0x0.0300011x0.0138164) ++ (1x0.0300011x0.986184) ++ (0x0.969999x0.0138164) ++ (0x0.969999x0.986184) = 0.0295865825 +π(_jn2) += p(_jn2|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn2|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn2|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn2|f2,a2).π_Jn(f2).π_Jn(a2) += (0x0.0300011x0.0138164) ++ (0x0.0300011x0.986184) ++ (1x0.969999x0.0138164) ++ (0x0.969999x0.986184) = 0.01340188738 +π(_jn3) += p(_jn3|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn3|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn3|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn3|f2,a2).π_Jn(f2).π_Jn(a2) += (0x0.0300011x0.0138164) ++ (0x0.0300011x0.986184) ++ (0x0.969999x0.0138164) ++ (1x0.969999x0.986184) = 0.9565970232 +λ(_jn0) = 1 +λ(_jn1) = 1 +λ(_jn2) = 1 +λ(_jn3) = 1 +belief change = 1.702332097e-06 + +domain π(Burglar) λ(Burglar) belief +---------------------------------------------------------------- +b1 0.005 0.5 0.005 +b2 0.995 0.5 0.995 + +domain πAlarm(Burglar) λAlarm(Burglar) +---------------------------------------------------------------- +b1 0.005000000115 0.5 +b2 0.9949999999 0.5 + +domain π(FreightTruck) λ(FreightTruck) belief +---------------------------------------------------------------- +f1 0.03 0.25 0.03 +f2 0.97 0.25 0.97 + +domain πAlarm(FreightTruck) λAlarm(FreightTruck) +---------------------------------------------------------------- +f1 0.03000108938 0.5 +f2 0.9699989106 0.5 + +domain π_Jn(FreightTruck) λ_Jn(FreightTruck) +---------------------------------------------------------------- +f1 0.03000108938 0.5 +f2 0.9699989106 0.5 + +domain π(Alarm) λ(Alarm) belief +---------------------------------------------------------------- +a1 0.01381596366 0.5 0.01381596366 +a2 0.9861840363 0.5 0.9861840363 + +domain π_Jn(Alarm) λ_Jn(Alarm) +---------------------------------------------------------------- +a1 0.01381639426 0.5 +a2 0.9861836057 0.5 + +domain π(_Jn) λ(_Jn) belief +---------------------------------------------------------------- +_jn0 0.000414506879 1 0.000414506879 +_jn1 0.0295865825 1 0.0295865825 +_jn2 0.01340188738 1 0.01340188738 +_jn3 0.9565970232 1 0.9565970232 + + + +******************************************************************************** + Iteration 33 +******************************************************************************** +λ message Alarm --> Burglar +λAlarm(b1) += [p(a1|b1,f1).πAlarm(f1) + p(a1|b1,f2).πAlarm(f2)].λ(a1) ++ [p(a2|b1,f1).πAlarm(f1) + p(a2|b1,f2).πAlarm(f2)].λ(a2) += [(0.992x0.0300011) + (0.99x0.969999)]x0.5 ++ [(0.008x0.0300011) + (0.01x0.969999)]x0.5 = 0.5 +λAlarm(b2) += [p(a1|b2,f1).πAlarm(f1) + p(a1|b2,f2).πAlarm(f2)].λ(a1) ++ [p(a2|b2,f1).πAlarm(f1) + p(a2|b2,f2).πAlarm(f2)].λ(a2) += [(0.2x0.0300011) + (0.003x0.969999)]x0.5 ++ [(0.8x0.0300011) + (0.997x0.969999)]x0.5 = 0.5 + +λ message Alarm --> FreightTruck +λAlarm(f1) += [p(a1|b1,f1).πAlarm(b1) + p(a1|b2,f1).πAlarm(b2)].λ(a1) ++ [p(a2|b1,f1).πAlarm(b1) + p(a2|b2,f1).πAlarm(b2)].λ(a2) += [(0.992x0.005) + (0.2x0.995)]x0.5 ++ [(0.008x0.005) + (0.8x0.995)]x0.5 = 0.5 +λAlarm(f2) += [p(a1|b1,f2).πAlarm(b1) + p(a1|b2,f2).πAlarm(b2)].λ(a1) ++ [p(a2|b1,f2).πAlarm(b1) + p(a2|b2,f2).πAlarm(b2)].λ(a2) += [(0.99x0.005) + (0.003x0.995)]x0.5 ++ [(0.01x0.005) + (0.997x0.995)]x0.5 = 0.5 + +λ message _Jn --> FreightTruck +λ_Jn(f1) += [p(_jn0|f1,a1).π_Jn(a1) + p(_jn0|f1,a2).π_Jn(a2)].λ(_jn0) ++ [p(_jn1|f1,a1).π_Jn(a1) + p(_jn1|f1,a2).π_Jn(a2)].λ(_jn1) ++ [p(_jn2|f1,a1).π_Jn(a1) + p(_jn2|f1,a2).π_Jn(a2)].λ(_jn2) ++ [p(_jn3|f1,a1).π_Jn(a1) + p(_jn3|f1,a2).π_Jn(a2)].λ(_jn3) += [(1x0.0138164) + (0x0.986184)]x1 ++ [(0x0.0138164) + (1x0.986184)]x1 ++ [(0x0.0138164) + (0x0.986184)]x1 ++ [(0x0.0138164) + (0x0.986184)]x1 = 1 +λ_Jn(f2) += [p(_jn0|f2,a1).π_Jn(a1) + p(_jn0|f2,a2).π_Jn(a2)].λ(_jn0) ++ [p(_jn1|f2,a1).π_Jn(a1) + p(_jn1|f2,a2).π_Jn(a2)].λ(_jn1) ++ [p(_jn2|f2,a1).π_Jn(a1) + p(_jn2|f2,a2).π_Jn(a2)].λ(_jn2) ++ [p(_jn3|f2,a1).π_Jn(a1) + p(_jn3|f2,a2).π_Jn(a2)].λ(_jn3) += [(0x0.0138164) + (0x0.986184)]x1 ++ [(0x0.0138164) + (0x0.986184)]x1 ++ [(1x0.0138164) + (0x0.986184)]x1 ++ [(0x0.0138164) + (1x0.986184)]x1 = 1 + +λ message _Jn --> Alarm +λ_Jn(a1) += [p(_jn0|f1,a1).π_Jn(f1) + p(_jn0|f2,a1).π_Jn(f2)].λ(_jn0) ++ [p(_jn1|f1,a1).π_Jn(f1) + p(_jn1|f2,a1).π_Jn(f2)].λ(_jn1) ++ [p(_jn2|f1,a1).π_Jn(f1) + p(_jn2|f2,a1).π_Jn(f2)].λ(_jn2) ++ [p(_jn3|f1,a1).π_Jn(f1) + p(_jn3|f2,a1).π_Jn(f2)].λ(_jn3) += [(1x0.0300011) + (0x0.969999)]x1 ++ [(0x0.0300011) + (0x0.969999)]x1 ++ [(0x0.0300011) + (1x0.969999)]x1 ++ [(0x0.0300011) + (0x0.969999)]x1 = 1 +λ_Jn(a2) += [p(_jn0|f1,a2).π_Jn(f1) + p(_jn0|f2,a2).π_Jn(f2)].λ(_jn0) ++ [p(_jn1|f1,a2).π_Jn(f1) + p(_jn1|f2,a2).π_Jn(f2)].λ(_jn1) ++ [p(_jn2|f1,a2).π_Jn(f1) + p(_jn2|f2,a2).π_Jn(f2)].λ(_jn2) ++ [p(_jn3|f1,a2).π_Jn(f1) + p(_jn3|f2,a2).π_Jn(f2)].λ(_jn3) += [(0x0.0300011) + (0x0.969999)]x1 ++ [(1x0.0300011) + (0x0.969999)]x1 ++ [(0x0.0300011) + (0x0.969999)]x1 ++ [(0x0.0300011) + (1x0.969999)]x1 = 1 + +π message Burglar --> Alarm +πAlarm(b1) = π(b1) = 0.005 = 0.005 +πAlarm(b2) = π(b2) = 0.995 = 0.995 + +π message FreightTruck --> Alarm +πAlarm(f1) = π(f1).λ_Jn(f1) = 0.03 x 0.5 = 0.015 +πAlarm(f2) = π(f2).λ_Jn(f2) = 0.97 x 0.5 = 0.485 + +π message FreightTruck --> _Jn +π_Jn(f1) = π(f1).λAlarm(f1) = 0.03 x 0.5 = 0.015 +π_Jn(f2) = π(f2).λAlarm(f2) = 0.97 x 0.5 = 0.485 + +π message Alarm --> _Jn +π_Jn(a1) = π(a1) = 0.013816 = 0.01381596366 +π_Jn(a2) = π(a2) = 0.986184 = 0.9861840363 + +var Burglar: +π(b1) += p(b1) += (0.005) = 0.005 +π(b2) += p(b2) += (0.995) = 0.995 +λ(b1) = λAlarm(b1) = 0.5 = 0.5 +λ(b2) = λAlarm(b2) = 0.5 = 0.5 +belief change = 0 + +var FreightTruck: +π(f1) += p(f1) += (0.03) = 0.03 +π(f2) += p(f2) += (0.97) = 0.97 +λ(f1) = λAlarm(f1).λ_Jn(f1) = 0.5 x 0.5 = 0.25 +λ(f2) = λAlarm(f2).λ_Jn(f2) = 0.5 x 0.5 = 0.25 +belief change = 0 + +var Alarm: +π(a1) += p(a1|b1,f1).πAlarm(b1).πAlarm(f1) ++ p(a1|b1,f2).πAlarm(b1).πAlarm(f2) ++ p(a1|b2,f1).πAlarm(b2).πAlarm(f1) ++ p(a1|b2,f2).πAlarm(b2).πAlarm(f2) += (0.992x0.005x0.0300007) ++ (0.99x0.005x0.969999) ++ (0.2x0.995x0.0300007) ++ (0.003x0.995x0.969999) = 0.01381589242 +π(a2) += p(a2|b1,f1).πAlarm(b1).πAlarm(f1) ++ p(a2|b1,f2).πAlarm(b1).πAlarm(f2) ++ p(a2|b2,f1).πAlarm(b2).πAlarm(f1) ++ p(a2|b2,f2).πAlarm(b2).πAlarm(f2) += (0.008x0.005x0.0300007) ++ (0.01x0.005x0.969999) ++ (0.8x0.995x0.0300007) ++ (0.997x0.995x0.969999) = 0.9861841076 +λ(a1) = λ_Jn(a1) = 0.5 = 0.5 +λ(a2) = λ_Jn(a2) = 0.5 = 0.5 +belief change = 1.424762886e-07 + +var _Jn: +π(_jn0) += p(_jn0|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn0|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn0|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn0|f2,a2).π_Jn(f2).π_Jn(a2) += (1x0.0300007x0.0138162) ++ (0x0.0300007x0.986184) ++ (0x0.969999x0.0138162) ++ (0x0.969999x0.986184) = 0.0004144954028 +π(_jn1) += p(_jn1|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn1|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn1|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn1|f2,a2).π_Jn(f2).π_Jn(a2) += (0x0.0300007x0.0138162) ++ (1x0.0300007x0.986184) ++ (0x0.969999x0.0138162) ++ (0x0.969999x0.986184) = 0.02958623085 +π(_jn2) += p(_jn2|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn2|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn2|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn2|f2,a2).π_Jn(f2).π_Jn(a2) += (0x0.0300007x0.0138162) ++ (0x0.0300007x0.986184) ++ (1x0.969999x0.0138162) ++ (0x0.969999x0.986184) = 0.01340168356 +π(_jn3) += p(_jn3|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn3|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn3|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn3|f2,a2).π_Jn(f2).π_Jn(a2) += (0x0.0300007x0.0138162) ++ (0x0.0300007x0.986184) ++ (0x0.969999x0.0138162) ++ (1x0.969999x0.986184) = 0.9565975902 +λ(_jn0) = 1 +λ(_jn1) = 1 +λ(_jn2) = 1 +λ(_jn3) = 1 +belief change = 1.133899215e-06 + +domain π(Burglar) λ(Burglar) belief +---------------------------------------------------------------- +b1 0.005 0.5 0.005 +b2 0.995 0.5 0.995 + +domain πAlarm(Burglar) λAlarm(Burglar) +---------------------------------------------------------------- +b1 0.005000000058 0.5 +b2 0.9949999999 0.5 + +domain π(FreightTruck) λ(FreightTruck) belief +---------------------------------------------------------------- +f1 0.03 0.25 0.03 +f2 0.97 0.25 0.97 + +domain πAlarm(FreightTruck) λAlarm(FreightTruck) +---------------------------------------------------------------- +f1 0.03000072625 0.5 +f2 0.9699992737 0.5 + +domain π_Jn(FreightTruck) λ_Jn(FreightTruck) +---------------------------------------------------------------- +f1 0.03000072625 0.5 +f2 0.9699992737 0.5 + +domain π(Alarm) λ(Alarm) belief +---------------------------------------------------------------- +a1 0.01381589242 0.5 0.01381589242 +a2 0.9861841076 0.5 0.9861841076 + +domain π_Jn(Alarm) λ_Jn(Alarm) +---------------------------------------------------------------- +a1 0.01381617896 0.5 +a2 0.986183821 0.5 + +domain π(_Jn) λ(_Jn) belief +---------------------------------------------------------------- +_jn0 0.0004144954028 1 0.0004144954028 +_jn1 0.02958623085 1 0.02958623085 +_jn2 0.01340168356 1 0.01340168356 +_jn3 0.9565975902 1 0.9565975902 + + + +******************************************************************************** + Iteration 34 +******************************************************************************** +λ message Alarm --> Burglar +λAlarm(b1) += [p(a1|b1,f1).πAlarm(f1) + p(a1|b1,f2).πAlarm(f2)].λ(a1) ++ [p(a2|b1,f1).πAlarm(f1) + p(a2|b1,f2).πAlarm(f2)].λ(a2) += [(0.992x0.0300007) + (0.99x0.969999)]x0.5 ++ [(0.008x0.0300007) + (0.01x0.969999)]x0.5 = 0.5 +λAlarm(b2) += [p(a1|b2,f1).πAlarm(f1) + p(a1|b2,f2).πAlarm(f2)].λ(a1) ++ [p(a2|b2,f1).πAlarm(f1) + p(a2|b2,f2).πAlarm(f2)].λ(a2) += [(0.2x0.0300007) + (0.003x0.969999)]x0.5 ++ [(0.8x0.0300007) + (0.997x0.969999)]x0.5 = 0.5 + +λ message Alarm --> FreightTruck +λAlarm(f1) += [p(a1|b1,f1).πAlarm(b1) + p(a1|b2,f1).πAlarm(b2)].λ(a1) ++ [p(a2|b1,f1).πAlarm(b1) + p(a2|b2,f1).πAlarm(b2)].λ(a2) += [(0.992x0.005) + (0.2x0.995)]x0.5 ++ [(0.008x0.005) + (0.8x0.995)]x0.5 = 0.5 +λAlarm(f2) += [p(a1|b1,f2).πAlarm(b1) + p(a1|b2,f2).πAlarm(b2)].λ(a1) ++ [p(a2|b1,f2).πAlarm(b1) + p(a2|b2,f2).πAlarm(b2)].λ(a2) += [(0.99x0.005) + (0.003x0.995)]x0.5 ++ [(0.01x0.005) + (0.997x0.995)]x0.5 = 0.5 + +λ message _Jn --> FreightTruck +λ_Jn(f1) += [p(_jn0|f1,a1).π_Jn(a1) + p(_jn0|f1,a2).π_Jn(a2)].λ(_jn0) ++ [p(_jn1|f1,a1).π_Jn(a1) + p(_jn1|f1,a2).π_Jn(a2)].λ(_jn1) ++ [p(_jn2|f1,a1).π_Jn(a1) + p(_jn2|f1,a2).π_Jn(a2)].λ(_jn2) ++ [p(_jn3|f1,a1).π_Jn(a1) + p(_jn3|f1,a2).π_Jn(a2)].λ(_jn3) += [(1x0.0138162) + (0x0.986184)]x1 ++ [(0x0.0138162) + (1x0.986184)]x1 ++ [(0x0.0138162) + (0x0.986184)]x1 ++ [(0x0.0138162) + (0x0.986184)]x1 = 1 +λ_Jn(f2) += [p(_jn0|f2,a1).π_Jn(a1) + p(_jn0|f2,a2).π_Jn(a2)].λ(_jn0) ++ [p(_jn1|f2,a1).π_Jn(a1) + p(_jn1|f2,a2).π_Jn(a2)].λ(_jn1) ++ [p(_jn2|f2,a1).π_Jn(a1) + p(_jn2|f2,a2).π_Jn(a2)].λ(_jn2) ++ [p(_jn3|f2,a1).π_Jn(a1) + p(_jn3|f2,a2).π_Jn(a2)].λ(_jn3) += [(0x0.0138162) + (0x0.986184)]x1 ++ [(0x0.0138162) + (0x0.986184)]x1 ++ [(1x0.0138162) + (0x0.986184)]x1 ++ [(0x0.0138162) + (1x0.986184)]x1 = 1 + +λ message _Jn --> Alarm +λ_Jn(a1) += [p(_jn0|f1,a1).π_Jn(f1) + p(_jn0|f2,a1).π_Jn(f2)].λ(_jn0) ++ [p(_jn1|f1,a1).π_Jn(f1) + p(_jn1|f2,a1).π_Jn(f2)].λ(_jn1) ++ [p(_jn2|f1,a1).π_Jn(f1) + p(_jn2|f2,a1).π_Jn(f2)].λ(_jn2) ++ [p(_jn3|f1,a1).π_Jn(f1) + p(_jn3|f2,a1).π_Jn(f2)].λ(_jn3) += [(1x0.0300007) + (0x0.969999)]x1 ++ [(0x0.0300007) + (0x0.969999)]x1 ++ [(0x0.0300007) + (1x0.969999)]x1 ++ [(0x0.0300007) + (0x0.969999)]x1 = 1 +λ_Jn(a2) += [p(_jn0|f1,a2).π_Jn(f1) + p(_jn0|f2,a2).π_Jn(f2)].λ(_jn0) ++ [p(_jn1|f1,a2).π_Jn(f1) + p(_jn1|f2,a2).π_Jn(f2)].λ(_jn1) ++ [p(_jn2|f1,a2).π_Jn(f1) + p(_jn2|f2,a2).π_Jn(f2)].λ(_jn2) ++ [p(_jn3|f1,a2).π_Jn(f1) + p(_jn3|f2,a2).π_Jn(f2)].λ(_jn3) += [(0x0.0300007) + (0x0.969999)]x1 ++ [(1x0.0300007) + (0x0.969999)]x1 ++ [(0x0.0300007) + (0x0.969999)]x1 ++ [(0x0.0300007) + (1x0.969999)]x1 = 1 + +π message Burglar --> Alarm +πAlarm(b1) = π(b1) = 0.005 = 0.005 +πAlarm(b2) = π(b2) = 0.995 = 0.995 + +π message FreightTruck --> Alarm +πAlarm(f1) = π(f1).λ_Jn(f1) = 0.03 x 0.5 = 0.015 +πAlarm(f2) = π(f2).λ_Jn(f2) = 0.97 x 0.5 = 0.485 + +π message FreightTruck --> _Jn +π_Jn(f1) = π(f1).λAlarm(f1) = 0.03 x 0.5 = 0.015 +π_Jn(f2) = π(f2).λAlarm(f2) = 0.97 x 0.5 = 0.485 + +π message Alarm --> _Jn +π_Jn(a1) = π(a1) = 0.0138159 = 0.01381589242 +π_Jn(a2) = π(a2) = 0.986184 = 0.9861841076 + +var Burglar: +π(b1) += p(b1) += (0.005) = 0.005 +π(b2) += p(b2) += (0.995) = 0.995 +λ(b1) = λAlarm(b1) = 0.5 = 0.5 +λ(b2) = λAlarm(b2) = 0.5 = 0.5 +belief change = 8.67361738e-19 + +var FreightTruck: +π(f1) += p(f1) += (0.03) = 0.03 +π(f2) += p(f2) += (0.97) = 0.97 +λ(f1) = λAlarm(f1).λ_Jn(f1) = 0.5 x 0.5 = 0.25 +λ(f2) = λAlarm(f2).λ_Jn(f2) = 0.5 x 0.5 = 0.25 +belief change = 0 + +var Alarm: +π(a1) += p(a1|b1,f1).πAlarm(b1).πAlarm(f1) ++ p(a1|b1,f2).πAlarm(b1).πAlarm(f2) ++ p(a1|b2,f1).πAlarm(b2).πAlarm(f1) ++ p(a1|b2,f2).πAlarm(b2).πAlarm(f2) += (0.992x0.005x0.0300005) ++ (0.99x0.005x0.97) ++ (0.2x0.995x0.0300005) ++ (0.003x0.995x0.97) = 0.01381584494 +π(a2) += p(a2|b1,f1).πAlarm(b1).πAlarm(f1) ++ p(a2|b1,f2).πAlarm(b1).πAlarm(f2) ++ p(a2|b2,f1).πAlarm(b2).πAlarm(f1) ++ p(a2|b2,f2).πAlarm(b2).πAlarm(f2) += (0.008x0.005x0.0300005) ++ (0.01x0.005x0.97) ++ (0.8x0.995x0.0300005) ++ (0.997x0.995x0.97) = 0.9861841551 +λ(a1) = λ_Jn(a1) = 0.5 = 0.5 +λ(a2) = λ_Jn(a2) = 0.5 = 0.5 +belief change = 9.496534587e-08 + +var _Jn: +π(_jn0) += p(_jn0|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn0|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn0|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn0|f2,a2).π_Jn(f2).π_Jn(a2) += (1x0.0300005x0.013816) ++ (0x0.0300005x0.986184) ++ (0x0.97x0.013816) ++ (0x0.97x0.986184) = 0.0004144877599 +π(_jn1) += p(_jn1|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn1|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn1|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn1|f2,a2).π_Jn(f2).π_Jn(a2) += (0x0.0300005x0.013816) ++ (1x0.0300005x0.986184) ++ (0x0.97x0.013816) ++ (0x0.97x0.986184) = 0.02958599641 +π(_jn2) += p(_jn2|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn2|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn2|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn2|f2,a2).π_Jn(f2).π_Jn(a2) += (0x0.0300005x0.013816) ++ (0x0.0300005x0.986184) ++ (1x0.97x0.013816) ++ (0x0.97x0.986184) = 0.01340154793 +π(_jn3) += p(_jn3|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn3|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn3|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn3|f2,a2).π_Jn(f2).π_Jn(a2) += (0x0.0300005x0.013816) ++ (0x0.0300005x0.986184) ++ (0x0.97x0.013816) ++ (1x0.97x0.986184) = 0.9565979679 +λ(_jn0) = 1 +λ(_jn1) = 1 +λ(_jn2) = 1 +λ(_jn3) = 1 +belief change = 7.554200814e-07 + +domain π(Burglar) λ(Burglar) belief +---------------------------------------------------------------- +b1 0.005 0.5 0.005 +b2 0.995 0.5 0.995 + +domain πAlarm(Burglar) λAlarm(Burglar) +---------------------------------------------------------------- +b1 0.005000000029 0.5 +b2 0.995 0.5 + +domain π(FreightTruck) λ(FreightTruck) belief +---------------------------------------------------------------- +f1 0.03 0.25 0.03 +f2 0.97 0.25 0.97 + +domain πAlarm(FreightTruck) λAlarm(FreightTruck) +---------------------------------------------------------------- +f1 0.03000048417 0.5 +f2 0.9699995158 0.5 + +domain π_Jn(FreightTruck) λ_Jn(FreightTruck) +---------------------------------------------------------------- +f1 0.03000048417 0.5 +f2 0.9699995158 0.5 + +domain π(Alarm) λ(Alarm) belief +---------------------------------------------------------------- +a1 0.01381584494 0.5 0.01381584494 +a2 0.9861841551 0.5 0.9861841551 + +domain π_Jn(Alarm) λ_Jn(Alarm) +---------------------------------------------------------------- +a1 0.01381603569 0.5 +a2 0.9861839643 0.5 + +domain π(_Jn) λ(_Jn) belief +---------------------------------------------------------------- +_jn0 0.0004144877599 1 0.0004144877599 +_jn1 0.02958599641 1 0.02958599641 +_jn2 0.01340154793 1 0.01340154793 +_jn3 0.9565979679 1 0.9565979679 + + + +******************************************************************************** + Iteration 35 +******************************************************************************** +λ message Alarm --> Burglar +λAlarm(b1) += [p(a1|b1,f1).πAlarm(f1) + p(a1|b1,f2).πAlarm(f2)].λ(a1) ++ [p(a2|b1,f1).πAlarm(f1) + p(a2|b1,f2).πAlarm(f2)].λ(a2) += [(0.992x0.0300005) + (0.99x0.97)]x0.5 ++ [(0.008x0.0300005) + (0.01x0.97)]x0.5 = 0.5 +λAlarm(b2) += [p(a1|b2,f1).πAlarm(f1) + p(a1|b2,f2).πAlarm(f2)].λ(a1) ++ [p(a2|b2,f1).πAlarm(f1) + p(a2|b2,f2).πAlarm(f2)].λ(a2) += [(0.2x0.0300005) + (0.003x0.97)]x0.5 ++ [(0.8x0.0300005) + (0.997x0.97)]x0.5 = 0.5 + +λ message Alarm --> FreightTruck +λAlarm(f1) += [p(a1|b1,f1).πAlarm(b1) + p(a1|b2,f1).πAlarm(b2)].λ(a1) ++ [p(a2|b1,f1).πAlarm(b1) + p(a2|b2,f1).πAlarm(b2)].λ(a2) += [(0.992x0.005) + (0.2x0.995)]x0.5 ++ [(0.008x0.005) + (0.8x0.995)]x0.5 = 0.5 +λAlarm(f2) += [p(a1|b1,f2).πAlarm(b1) + p(a1|b2,f2).πAlarm(b2)].λ(a1) ++ [p(a2|b1,f2).πAlarm(b1) + p(a2|b2,f2).πAlarm(b2)].λ(a2) += [(0.99x0.005) + (0.003x0.995)]x0.5 ++ [(0.01x0.005) + (0.997x0.995)]x0.5 = 0.5 + +λ message _Jn --> FreightTruck +λ_Jn(f1) += [p(_jn0|f1,a1).π_Jn(a1) + p(_jn0|f1,a2).π_Jn(a2)].λ(_jn0) ++ [p(_jn1|f1,a1).π_Jn(a1) + p(_jn1|f1,a2).π_Jn(a2)].λ(_jn1) ++ [p(_jn2|f1,a1).π_Jn(a1) + p(_jn2|f1,a2).π_Jn(a2)].λ(_jn2) ++ [p(_jn3|f1,a1).π_Jn(a1) + p(_jn3|f1,a2).π_Jn(a2)].λ(_jn3) += [(1x0.013816) + (0x0.986184)]x1 ++ [(0x0.013816) + (1x0.986184)]x1 ++ [(0x0.013816) + (0x0.986184)]x1 ++ [(0x0.013816) + (0x0.986184)]x1 = 1 +λ_Jn(f2) += [p(_jn0|f2,a1).π_Jn(a1) + p(_jn0|f2,a2).π_Jn(a2)].λ(_jn0) ++ [p(_jn1|f2,a1).π_Jn(a1) + p(_jn1|f2,a2).π_Jn(a2)].λ(_jn1) ++ [p(_jn2|f2,a1).π_Jn(a1) + p(_jn2|f2,a2).π_Jn(a2)].λ(_jn2) ++ [p(_jn3|f2,a1).π_Jn(a1) + p(_jn3|f2,a2).π_Jn(a2)].λ(_jn3) += [(0x0.013816) + (0x0.986184)]x1 ++ [(0x0.013816) + (0x0.986184)]x1 ++ [(1x0.013816) + (0x0.986184)]x1 ++ [(0x0.013816) + (1x0.986184)]x1 = 1 + +λ message _Jn --> Alarm +λ_Jn(a1) += [p(_jn0|f1,a1).π_Jn(f1) + p(_jn0|f2,a1).π_Jn(f2)].λ(_jn0) ++ [p(_jn1|f1,a1).π_Jn(f1) + p(_jn1|f2,a1).π_Jn(f2)].λ(_jn1) ++ [p(_jn2|f1,a1).π_Jn(f1) + p(_jn2|f2,a1).π_Jn(f2)].λ(_jn2) ++ [p(_jn3|f1,a1).π_Jn(f1) + p(_jn3|f2,a1).π_Jn(f2)].λ(_jn3) += [(1x0.0300005) + (0x0.97)]x1 ++ [(0x0.0300005) + (0x0.97)]x1 ++ [(0x0.0300005) + (1x0.97)]x1 ++ [(0x0.0300005) + (0x0.97)]x1 = 1 +λ_Jn(a2) += [p(_jn0|f1,a2).π_Jn(f1) + p(_jn0|f2,a2).π_Jn(f2)].λ(_jn0) ++ [p(_jn1|f1,a2).π_Jn(f1) + p(_jn1|f2,a2).π_Jn(f2)].λ(_jn1) ++ [p(_jn2|f1,a2).π_Jn(f1) + p(_jn2|f2,a2).π_Jn(f2)].λ(_jn2) ++ [p(_jn3|f1,a2).π_Jn(f1) + p(_jn3|f2,a2).π_Jn(f2)].λ(_jn3) += [(0x0.0300005) + (0x0.97)]x1 ++ [(1x0.0300005) + (0x0.97)]x1 ++ [(0x0.0300005) + (0x0.97)]x1 ++ [(0x0.0300005) + (1x0.97)]x1 = 1 + +π message Burglar --> Alarm +πAlarm(b1) = π(b1) = 0.005 = 0.005 +πAlarm(b2) = π(b2) = 0.995 = 0.995 + +π message FreightTruck --> Alarm +πAlarm(f1) = π(f1).λ_Jn(f1) = 0.03 x 0.5 = 0.015 +πAlarm(f2) = π(f2).λ_Jn(f2) = 0.97 x 0.5 = 0.485 + +π message FreightTruck --> _Jn +π_Jn(f1) = π(f1).λAlarm(f1) = 0.03 x 0.5 = 0.015 +π_Jn(f2) = π(f2).λAlarm(f2) = 0.97 x 0.5 = 0.485 + +π message Alarm --> _Jn +π_Jn(a1) = π(a1) = 0.0138158 = 0.01381584494 +π_Jn(a2) = π(a2) = 0.986184 = 0.9861841551 + +var Burglar: +π(b1) += p(b1) += (0.005) = 0.005 +π(b2) += p(b2) += (0.995) = 0.995 +λ(b1) = λAlarm(b1) = 0.5 = 0.5 +λ(b2) = λAlarm(b2) = 0.5 = 0.5 +belief change = 8.67361738e-19 + +var FreightTruck: +π(f1) += p(f1) += (0.03) = 0.03 +π(f2) += p(f2) += (0.97) = 0.97 +λ(f1) = λAlarm(f1).λ_Jn(f1) = 0.5 x 0.5 = 0.25 +λ(f2) = λAlarm(f2).λ_Jn(f2) = 0.5 x 0.5 = 0.25 +belief change = 0 + +var Alarm: +π(a1) += p(a1|b1,f1).πAlarm(b1).πAlarm(f1) ++ p(a1|b1,f2).πAlarm(b1).πAlarm(f2) ++ p(a1|b2,f1).πAlarm(b2).πAlarm(f1) ++ p(a1|b2,f2).πAlarm(b2).πAlarm(f2) += (0.992x0.005x0.0300003) ++ (0.99x0.005x0.97) ++ (0.2x0.995x0.0300003) ++ (0.003x0.995x0.97) = 0.01381581329 +π(a2) += p(a2|b1,f1).πAlarm(b1).πAlarm(f1) ++ p(a2|b1,f2).πAlarm(b1).πAlarm(f2) ++ p(a2|b2,f1).πAlarm(b2).πAlarm(f1) ++ p(a2|b2,f2).πAlarm(b2).πAlarm(f2) += (0.008x0.005x0.0300003) ++ (0.01x0.005x0.97) ++ (0.8x0.995x0.0300003) ++ (0.997x0.995x0.97) = 0.9861841867 +λ(a1) = λ_Jn(a1) = 0.5 = 0.5 +λ(a2) = λ_Jn(a2) = 0.5 = 0.5 +belief change = 6.330080745e-08 + +var _Jn: +π(_jn0) += p(_jn0|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn0|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn0|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn0|f2,a2).π_Jn(f2).π_Jn(a2) += (1x0.0300003x0.0138159) ++ (0x0.0300003x0.986184) ++ (0x0.97x0.0138159) ++ (0x0.97x0.986184) = 0.0004144826689 +π(_jn1) += p(_jn1|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn1|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn1|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn1|f2,a2).π_Jn(f2).π_Jn(a2) += (0x0.0300003x0.0138159) ++ (1x0.0300003x0.986184) ++ (0x0.97x0.0138159) ++ (0x0.97x0.986184) = 0.02958584011 +π(_jn2) += p(_jn2|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn2|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn2|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn2|f2,a2).π_Jn(f2).π_Jn(a2) += (0x0.0300003x0.0138159) ++ (0x0.0300003x0.986184) ++ (1x0.97x0.0138159) ++ (0x0.97x0.986184) = 0.01340145764 +π(_jn3) += p(_jn3|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn3|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn3|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn3|f2,a2).π_Jn(f2).π_Jn(a2) += (0x0.0300003x0.0138159) ++ (0x0.0300003x0.986184) ++ (0x0.97x0.0138159) ++ (1x0.97x0.986184) = 0.9565982196 +λ(_jn0) = 1 +λ(_jn1) = 1 +λ(_jn2) = 1 +λ(_jn3) = 1 +belief change = 5.033478731e-07 + +domain π(Burglar) λ(Burglar) belief +---------------------------------------------------------------- +b1 0.005 0.5 0.005 +b2 0.995 0.5 0.995 + +domain πAlarm(Burglar) λAlarm(Burglar) +---------------------------------------------------------------- +b1 0.005000000014 0.5 +b2 0.995 0.5 + +domain π(FreightTruck) λ(FreightTruck) belief +---------------------------------------------------------------- +f1 0.03 0.25 0.03 +f2 0.97 0.25 0.97 + +domain πAlarm(FreightTruck) λAlarm(FreightTruck) +---------------------------------------------------------------- +f1 0.03000032278 0.5 +f2 0.9699996772 0.5 + +domain π_Jn(FreightTruck) λ_Jn(FreightTruck) +---------------------------------------------------------------- +f1 0.03000032278 0.5 +f2 0.9699996772 0.5 + +domain π(Alarm) λ(Alarm) belief +---------------------------------------------------------------- +a1 0.01381581329 0.5 0.01381581329 +a2 0.9861841867 0.5 0.9861841867 + +domain π_Jn(Alarm) λ_Jn(Alarm) +---------------------------------------------------------------- +a1 0.01381594031 0.5 +a2 0.9861840597 0.5 + +domain π(_Jn) λ(_Jn) belief +---------------------------------------------------------------- +_jn0 0.0004144826689 1 0.0004144826689 +_jn1 0.02958584011 1 0.02958584011 +_jn2 0.01340145764 1 0.01340145764 +_jn3 0.9565982196 1 0.9565982196 + + + +******************************************************************************** + Iteration 36 +******************************************************************************** +λ message Alarm --> Burglar +λAlarm(b1) += [p(a1|b1,f1).πAlarm(f1) + p(a1|b1,f2).πAlarm(f2)].λ(a1) ++ [p(a2|b1,f1).πAlarm(f1) + p(a2|b1,f2).πAlarm(f2)].λ(a2) += [(0.992x0.0300003) + (0.99x0.97)]x0.5 ++ [(0.008x0.0300003) + (0.01x0.97)]x0.5 = 0.5 +λAlarm(b2) += [p(a1|b2,f1).πAlarm(f1) + p(a1|b2,f2).πAlarm(f2)].λ(a1) ++ [p(a2|b2,f1).πAlarm(f1) + p(a2|b2,f2).πAlarm(f2)].λ(a2) += [(0.2x0.0300003) + (0.003x0.97)]x0.5 ++ [(0.8x0.0300003) + (0.997x0.97)]x0.5 = 0.5 + +λ message Alarm --> FreightTruck +λAlarm(f1) += [p(a1|b1,f1).πAlarm(b1) + p(a1|b2,f1).πAlarm(b2)].λ(a1) ++ [p(a2|b1,f1).πAlarm(b1) + p(a2|b2,f1).πAlarm(b2)].λ(a2) += [(0.992x0.005) + (0.2x0.995)]x0.5 ++ [(0.008x0.005) + (0.8x0.995)]x0.5 = 0.5 +λAlarm(f2) += [p(a1|b1,f2).πAlarm(b1) + p(a1|b2,f2).πAlarm(b2)].λ(a1) ++ [p(a2|b1,f2).πAlarm(b1) + p(a2|b2,f2).πAlarm(b2)].λ(a2) += [(0.99x0.005) + (0.003x0.995)]x0.5 ++ [(0.01x0.005) + (0.997x0.995)]x0.5 = 0.5 + +λ message _Jn --> FreightTruck +λ_Jn(f1) += [p(_jn0|f1,a1).π_Jn(a1) + p(_jn0|f1,a2).π_Jn(a2)].λ(_jn0) ++ [p(_jn1|f1,a1).π_Jn(a1) + p(_jn1|f1,a2).π_Jn(a2)].λ(_jn1) ++ [p(_jn2|f1,a1).π_Jn(a1) + p(_jn2|f1,a2).π_Jn(a2)].λ(_jn2) ++ [p(_jn3|f1,a1).π_Jn(a1) + p(_jn3|f1,a2).π_Jn(a2)].λ(_jn3) += [(1x0.0138159) + (0x0.986184)]x1 ++ [(0x0.0138159) + (1x0.986184)]x1 ++ [(0x0.0138159) + (0x0.986184)]x1 ++ [(0x0.0138159) + (0x0.986184)]x1 = 1 +λ_Jn(f2) += [p(_jn0|f2,a1).π_Jn(a1) + p(_jn0|f2,a2).π_Jn(a2)].λ(_jn0) ++ [p(_jn1|f2,a1).π_Jn(a1) + p(_jn1|f2,a2).π_Jn(a2)].λ(_jn1) ++ [p(_jn2|f2,a1).π_Jn(a1) + p(_jn2|f2,a2).π_Jn(a2)].λ(_jn2) ++ [p(_jn3|f2,a1).π_Jn(a1) + p(_jn3|f2,a2).π_Jn(a2)].λ(_jn3) += [(0x0.0138159) + (0x0.986184)]x1 ++ [(0x0.0138159) + (0x0.986184)]x1 ++ [(1x0.0138159) + (0x0.986184)]x1 ++ [(0x0.0138159) + (1x0.986184)]x1 = 1 + +λ message _Jn --> Alarm +λ_Jn(a1) += [p(_jn0|f1,a1).π_Jn(f1) + p(_jn0|f2,a1).π_Jn(f2)].λ(_jn0) ++ [p(_jn1|f1,a1).π_Jn(f1) + p(_jn1|f2,a1).π_Jn(f2)].λ(_jn1) ++ [p(_jn2|f1,a1).π_Jn(f1) + p(_jn2|f2,a1).π_Jn(f2)].λ(_jn2) ++ [p(_jn3|f1,a1).π_Jn(f1) + p(_jn3|f2,a1).π_Jn(f2)].λ(_jn3) += [(1x0.0300003) + (0x0.97)]x1 ++ [(0x0.0300003) + (0x0.97)]x1 ++ [(0x0.0300003) + (1x0.97)]x1 ++ [(0x0.0300003) + (0x0.97)]x1 = 1 +λ_Jn(a2) += [p(_jn0|f1,a2).π_Jn(f1) + p(_jn0|f2,a2).π_Jn(f2)].λ(_jn0) ++ [p(_jn1|f1,a2).π_Jn(f1) + p(_jn1|f2,a2).π_Jn(f2)].λ(_jn1) ++ [p(_jn2|f1,a2).π_Jn(f1) + p(_jn2|f2,a2).π_Jn(f2)].λ(_jn2) ++ [p(_jn3|f1,a2).π_Jn(f1) + p(_jn3|f2,a2).π_Jn(f2)].λ(_jn3) += [(0x0.0300003) + (0x0.97)]x1 ++ [(1x0.0300003) + (0x0.97)]x1 ++ [(0x0.0300003) + (0x0.97)]x1 ++ [(0x0.0300003) + (1x0.97)]x1 = 1 + +π message Burglar --> Alarm +πAlarm(b1) = π(b1) = 0.005 = 0.005 +πAlarm(b2) = π(b2) = 0.995 = 0.995 + +π message FreightTruck --> Alarm +πAlarm(f1) = π(f1).λ_Jn(f1) = 0.03 x 0.5 = 0.015 +πAlarm(f2) = π(f2).λ_Jn(f2) = 0.97 x 0.5 = 0.485 + +π message FreightTruck --> _Jn +π_Jn(f1) = π(f1).λAlarm(f1) = 0.03 x 0.5 = 0.015 +π_Jn(f2) = π(f2).λAlarm(f2) = 0.97 x 0.5 = 0.485 + +π message Alarm --> _Jn +π_Jn(a1) = π(a1) = 0.0138158 = 0.01381581329 +π_Jn(a2) = π(a2) = 0.986184 = 0.9861841867 + +var Burglar: +π(b1) += p(b1) += (0.005) = 0.005 +π(b2) += p(b2) += (0.995) = 0.995 +λ(b1) = λAlarm(b1) = 0.5 = 0.5 +λ(b2) = λAlarm(b2) = 0.5 = 0.5 +belief change = 0 + +var FreightTruck: +π(f1) += p(f1) += (0.03) = 0.03 +π(f2) += p(f2) += (0.97) = 0.97 +λ(f1) = λAlarm(f1).λ_Jn(f1) = 0.5 x 0.5 = 0.25 +λ(f2) = λAlarm(f2).λ_Jn(f2) = 0.5 x 0.5 = 0.25 +belief change = 0 + +var Alarm: +π(a1) += p(a1|b1,f1).πAlarm(b1).πAlarm(f1) ++ p(a1|b1,f2).πAlarm(b1).πAlarm(f2) ++ p(a1|b2,f1).πAlarm(b2).πAlarm(f1) ++ p(a1|b2,f2).πAlarm(b2).πAlarm(f2) += (0.992x0.005x0.0300002) ++ (0.99x0.005x0.97) ++ (0.2x0.995x0.0300002) ++ (0.003x0.995x0.97) = 0.01381579219 +π(a2) += p(a2|b1,f1).πAlarm(b1).πAlarm(f1) ++ p(a2|b1,f2).πAlarm(b1).πAlarm(f2) ++ p(a2|b2,f1).πAlarm(b2).πAlarm(f1) ++ p(a2|b2,f2).πAlarm(b2).πAlarm(f2) += (0.008x0.005x0.0300002) ++ (0.01x0.005x0.97) ++ (0.8x0.995x0.0300002) ++ (0.997x0.995x0.97) = 0.9861842078 +λ(a1) = λ_Jn(a1) = 0.5 = 0.5 +λ(a2) = λ_Jn(a2) = 0.5 = 0.5 +belief change = 4.219582663e-08 + +var _Jn: +π(_jn0) += p(_jn0|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn0|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn0|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn0|f2,a2).π_Jn(f2).π_Jn(a2) += (1x0.0300002x0.0138159) ++ (0x0.0300002x0.986184) ++ (0x0.97x0.0138159) ++ (0x0.97x0.986184) = 0.000414479277 +π(_jn1) += p(_jn1|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn1|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn1|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn1|f2,a2).π_Jn(f2).π_Jn(a2) += (0x0.0300002x0.0138159) ++ (1x0.0300002x0.986184) ++ (0x0.97x0.0138159) ++ (0x0.97x0.986184) = 0.02958573591 +π(_jn2) += p(_jn2|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn2|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn2|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn2|f2,a2).π_Jn(f2).π_Jn(a2) += (0x0.0300002x0.0138159) ++ (0x0.0300002x0.986184) ++ (1x0.97x0.0138159) ++ (0x0.97x0.986184) = 0.01340139752 +π(_jn3) += p(_jn3|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn3|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn3|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn3|f2,a2).π_Jn(f2).π_Jn(a2) += (0x0.0300002x0.0138159) ++ (0x0.0300002x0.986184) ++ (0x0.97x0.0138159) ++ (1x0.97x0.986184) = 0.9565983873 +λ(_jn0) = 1 +λ(_jn1) = 1 +λ(_jn2) = 1 +λ(_jn3) = 1 +belief change = 3.354279168e-07 + +domain π(Burglar) λ(Burglar) belief +---------------------------------------------------------------- +b1 0.005 0.5 0.005 +b2 0.995 0.5 0.995 + +domain πAlarm(Burglar) λAlarm(Burglar) +---------------------------------------------------------------- +b1 0.005000000007 0.5 +b2 0.995 0.5 + +domain π(FreightTruck) λ(FreightTruck) belief +---------------------------------------------------------------- +f1 0.03 0.25 0.03 +f2 0.97 0.25 0.97 + +domain πAlarm(FreightTruck) λAlarm(FreightTruck) +---------------------------------------------------------------- +f1 0.03000021519 0.5 +f2 0.9699997848 0.5 + +domain π_Jn(FreightTruck) λ_Jn(FreightTruck) +---------------------------------------------------------------- +f1 0.03000021519 0.5 +f2 0.9699997848 0.5 + +domain π(Alarm) λ(Alarm) belief +---------------------------------------------------------------- +a1 0.01381579219 0.5 0.01381579219 +a2 0.9861842078 0.5 0.9861842078 + +domain π_Jn(Alarm) λ_Jn(Alarm) +---------------------------------------------------------------- +a1 0.0138158768 0.5 +a2 0.9861841232 0.5 + +domain π(_Jn) λ(_Jn) belief +---------------------------------------------------------------- +_jn0 0.000414479277 1 0.000414479277 +_jn1 0.02958573591 1 0.02958573591 +_jn2 0.01340139752 1 0.01340139752 +_jn3 0.9565983873 1 0.9565983873 + + + +******************************************************************************** + Iteration 37 +******************************************************************************** +λ message Alarm --> Burglar +λAlarm(b1) += [p(a1|b1,f1).πAlarm(f1) + p(a1|b1,f2).πAlarm(f2)].λ(a1) ++ [p(a2|b1,f1).πAlarm(f1) + p(a2|b1,f2).πAlarm(f2)].λ(a2) += [(0.992x0.0300002) + (0.99x0.97)]x0.5 ++ [(0.008x0.0300002) + (0.01x0.97)]x0.5 = 0.5 +λAlarm(b2) += [p(a1|b2,f1).πAlarm(f1) + p(a1|b2,f2).πAlarm(f2)].λ(a1) ++ [p(a2|b2,f1).πAlarm(f1) + p(a2|b2,f2).πAlarm(f2)].λ(a2) += [(0.2x0.0300002) + (0.003x0.97)]x0.5 ++ [(0.8x0.0300002) + (0.997x0.97)]x0.5 = 0.5 + +λ message Alarm --> FreightTruck +λAlarm(f1) += [p(a1|b1,f1).πAlarm(b1) + p(a1|b2,f1).πAlarm(b2)].λ(a1) ++ [p(a2|b1,f1).πAlarm(b1) + p(a2|b2,f1).πAlarm(b2)].λ(a2) += [(0.992x0.005) + (0.2x0.995)]x0.5 ++ [(0.008x0.005) + (0.8x0.995)]x0.5 = 0.5 +λAlarm(f2) += [p(a1|b1,f2).πAlarm(b1) + p(a1|b2,f2).πAlarm(b2)].λ(a1) ++ [p(a2|b1,f2).πAlarm(b1) + p(a2|b2,f2).πAlarm(b2)].λ(a2) += [(0.99x0.005) + (0.003x0.995)]x0.5 ++ [(0.01x0.005) + (0.997x0.995)]x0.5 = 0.5 + +λ message _Jn --> FreightTruck +λ_Jn(f1) += [p(_jn0|f1,a1).π_Jn(a1) + p(_jn0|f1,a2).π_Jn(a2)].λ(_jn0) ++ [p(_jn1|f1,a1).π_Jn(a1) + p(_jn1|f1,a2).π_Jn(a2)].λ(_jn1) ++ [p(_jn2|f1,a1).π_Jn(a1) + p(_jn2|f1,a2).π_Jn(a2)].λ(_jn2) ++ [p(_jn3|f1,a1).π_Jn(a1) + p(_jn3|f1,a2).π_Jn(a2)].λ(_jn3) += [(1x0.0138159) + (0x0.986184)]x1 ++ [(0x0.0138159) + (1x0.986184)]x1 ++ [(0x0.0138159) + (0x0.986184)]x1 ++ [(0x0.0138159) + (0x0.986184)]x1 = 1 +λ_Jn(f2) += [p(_jn0|f2,a1).π_Jn(a1) + p(_jn0|f2,a2).π_Jn(a2)].λ(_jn0) ++ [p(_jn1|f2,a1).π_Jn(a1) + p(_jn1|f2,a2).π_Jn(a2)].λ(_jn1) ++ [p(_jn2|f2,a1).π_Jn(a1) + p(_jn2|f2,a2).π_Jn(a2)].λ(_jn2) ++ [p(_jn3|f2,a1).π_Jn(a1) + p(_jn3|f2,a2).π_Jn(a2)].λ(_jn3) += [(0x0.0138159) + (0x0.986184)]x1 ++ [(0x0.0138159) + (0x0.986184)]x1 ++ [(1x0.0138159) + (0x0.986184)]x1 ++ [(0x0.0138159) + (1x0.986184)]x1 = 1 + +λ message _Jn --> Alarm +λ_Jn(a1) += [p(_jn0|f1,a1).π_Jn(f1) + p(_jn0|f2,a1).π_Jn(f2)].λ(_jn0) ++ [p(_jn1|f1,a1).π_Jn(f1) + p(_jn1|f2,a1).π_Jn(f2)].λ(_jn1) ++ [p(_jn2|f1,a1).π_Jn(f1) + p(_jn2|f2,a1).π_Jn(f2)].λ(_jn2) ++ [p(_jn3|f1,a1).π_Jn(f1) + p(_jn3|f2,a1).π_Jn(f2)].λ(_jn3) += [(1x0.0300002) + (0x0.97)]x1 ++ [(0x0.0300002) + (0x0.97)]x1 ++ [(0x0.0300002) + (1x0.97)]x1 ++ [(0x0.0300002) + (0x0.97)]x1 = 1 +λ_Jn(a2) += [p(_jn0|f1,a2).π_Jn(f1) + p(_jn0|f2,a2).π_Jn(f2)].λ(_jn0) ++ [p(_jn1|f1,a2).π_Jn(f1) + p(_jn1|f2,a2).π_Jn(f2)].λ(_jn1) ++ [p(_jn2|f1,a2).π_Jn(f1) + p(_jn2|f2,a2).π_Jn(f2)].λ(_jn2) ++ [p(_jn3|f1,a2).π_Jn(f1) + p(_jn3|f2,a2).π_Jn(f2)].λ(_jn3) += [(0x0.0300002) + (0x0.97)]x1 ++ [(1x0.0300002) + (0x0.97)]x1 ++ [(0x0.0300002) + (0x0.97)]x1 ++ [(0x0.0300002) + (1x0.97)]x1 = 1 + +π message Burglar --> Alarm +πAlarm(b1) = π(b1) = 0.005 = 0.005 +πAlarm(b2) = π(b2) = 0.995 = 0.995 + +π message FreightTruck --> Alarm +πAlarm(f1) = π(f1).λ_Jn(f1) = 0.03 x 0.5 = 0.015 +πAlarm(f2) = π(f2).λ_Jn(f2) = 0.97 x 0.5 = 0.485 + +π message FreightTruck --> _Jn +π_Jn(f1) = π(f1).λAlarm(f1) = 0.03 x 0.5 = 0.015 +π_Jn(f2) = π(f2).λAlarm(f2) = 0.97 x 0.5 = 0.485 + +π message Alarm --> _Jn +π_Jn(a1) = π(a1) = 0.0138158 = 0.01381579219 +π_Jn(a2) = π(a2) = 0.986184 = 0.9861842078 + +var Burglar: +π(b1) += p(b1) += (0.005) = 0.005 +π(b2) += p(b2) += (0.995) = 0.995 +λ(b1) = λAlarm(b1) = 0.5 = 0.5 +λ(b2) = λAlarm(b2) = 0.5 = 0.5 +belief change = 0 + +var FreightTruck: +π(f1) += p(f1) += (0.03) = 0.03 +π(f2) += p(f2) += (0.97) = 0.97 +λ(f1) = λAlarm(f1).λ_Jn(f1) = 0.5 x 0.5 = 0.25 +λ(f2) = λAlarm(f2).λ_Jn(f2) = 0.5 x 0.5 = 0.25 +belief change = 0 + +var Alarm: +π(a1) += p(a1|b1,f1).πAlarm(b1).πAlarm(f1) ++ p(a1|b1,f2).πAlarm(b1).πAlarm(f2) ++ p(a1|b2,f1).πAlarm(b2).πAlarm(f1) ++ p(a1|b2,f2).πAlarm(b2).πAlarm(f2) += (0.992x0.005x0.0300001) ++ (0.99x0.005x0.97) ++ (0.2x0.995x0.0300001) ++ (0.003x0.995x0.97) = 0.01381577812 +π(a2) += p(a2|b1,f1).πAlarm(b1).πAlarm(f1) ++ p(a2|b1,f2).πAlarm(b1).πAlarm(f2) ++ p(a2|b2,f1).πAlarm(b2).πAlarm(f1) ++ p(a2|b2,f2).πAlarm(b2).πAlarm(f2) += (0.008x0.005x0.0300001) ++ (0.01x0.005x0.97) ++ (0.8x0.995x0.0300001) ++ (0.997x0.995x0.97) = 0.9861842219 +λ(a1) = λ_Jn(a1) = 0.5 = 0.5 +λ(a2) = λ_Jn(a2) = 0.5 = 0.5 +belief change = 2.812819542e-08 + +var _Jn: +π(_jn0) += p(_jn0|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn0|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn0|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn0|f2,a2).π_Jn(f2).π_Jn(a2) += (1x0.0300001x0.0138158) ++ (0x0.0300001x0.986184) ++ (0x0.97x0.0138158) ++ (0x0.97x0.986184) = 0.0004144770168 +π(_jn1) += p(_jn1|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn1|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn1|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn1|f2,a2).π_Jn(f2).π_Jn(a2) += (0x0.0300001x0.0138158) ++ (1x0.0300001x0.986184) ++ (0x0.97x0.0138158) ++ (0x0.97x0.986184) = 0.02958566644 +π(_jn2) += p(_jn2|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn2|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn2|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn2|f2,a2).π_Jn(f2).π_Jn(a2) += (0x0.0300001x0.0138158) ++ (0x0.0300001x0.986184) ++ (1x0.97x0.0138158) ++ (0x0.97x0.986184) = 0.01340135748 +π(_jn3) += p(_jn3|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn3|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn3|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn3|f2,a2).π_Jn(f2).π_Jn(a2) += (0x0.0300001x0.0138158) ++ (0x0.0300001x0.986184) ++ (0x0.97x0.0138158) ++ (1x0.97x0.986184) = 0.9565984991 +λ(_jn0) = 1 +λ(_jn1) = 1 +λ(_jn2) = 1 +λ(_jn3) = 1 +belief change = 2.235476582e-07 + +domain π(Burglar) λ(Burglar) belief +---------------------------------------------------------------- +b1 0.005 0.5 0.005 +b2 0.995 0.5 0.995 + +domain πAlarm(Burglar) λAlarm(Burglar) +---------------------------------------------------------------- +b1 0.005000000004 0.5 +b2 0.995 0.5 + +domain π(FreightTruck) λ(FreightTruck) belief +---------------------------------------------------------------- +f1 0.03 0.25 0.03 +f2 0.97 0.25 0.97 + +domain πAlarm(FreightTruck) λAlarm(FreightTruck) +---------------------------------------------------------------- +f1 0.03000014346 0.5 +f2 0.9699998565 0.5 + +domain π_Jn(FreightTruck) λ_Jn(FreightTruck) +---------------------------------------------------------------- +f1 0.03000014346 0.5 +f2 0.9699998565 0.5 + +domain π(Alarm) λ(Alarm) belief +---------------------------------------------------------------- +a1 0.01381577812 0.5 0.01381577812 +a2 0.9861842219 0.5 0.9861842219 + +domain π_Jn(Alarm) λ_Jn(Alarm) +---------------------------------------------------------------- +a1 0.01381583449 0.5 +a2 0.9861841655 0.5 + +domain π(_Jn) λ(_Jn) belief +---------------------------------------------------------------- +_jn0 0.0004144770168 1 0.0004144770168 +_jn1 0.02958566644 1 0.02958566644 +_jn2 0.01340135748 1 0.01340135748 +_jn3 0.9565984991 1 0.9565984991 + + + +******************************************************************************** + Iteration 38 +******************************************************************************** +λ message Alarm --> Burglar +λAlarm(b1) += [p(a1|b1,f1).πAlarm(f1) + p(a1|b1,f2).πAlarm(f2)].λ(a1) ++ [p(a2|b1,f1).πAlarm(f1) + p(a2|b1,f2).πAlarm(f2)].λ(a2) += [(0.992x0.0300001) + (0.99x0.97)]x0.5 ++ [(0.008x0.0300001) + (0.01x0.97)]x0.5 = 0.5 +λAlarm(b2) += [p(a1|b2,f1).πAlarm(f1) + p(a1|b2,f2).πAlarm(f2)].λ(a1) ++ [p(a2|b2,f1).πAlarm(f1) + p(a2|b2,f2).πAlarm(f2)].λ(a2) += [(0.2x0.0300001) + (0.003x0.97)]x0.5 ++ [(0.8x0.0300001) + (0.997x0.97)]x0.5 = 0.5 + +λ message Alarm --> FreightTruck +λAlarm(f1) += [p(a1|b1,f1).πAlarm(b1) + p(a1|b2,f1).πAlarm(b2)].λ(a1) ++ [p(a2|b1,f1).πAlarm(b1) + p(a2|b2,f1).πAlarm(b2)].λ(a2) += [(0.992x0.005) + (0.2x0.995)]x0.5 ++ [(0.008x0.005) + (0.8x0.995)]x0.5 = 0.5 +λAlarm(f2) += [p(a1|b1,f2).πAlarm(b1) + p(a1|b2,f2).πAlarm(b2)].λ(a1) ++ [p(a2|b1,f2).πAlarm(b1) + p(a2|b2,f2).πAlarm(b2)].λ(a2) += [(0.99x0.005) + (0.003x0.995)]x0.5 ++ [(0.01x0.005) + (0.997x0.995)]x0.5 = 0.5 + +λ message _Jn --> FreightTruck +λ_Jn(f1) += [p(_jn0|f1,a1).π_Jn(a1) + p(_jn0|f1,a2).π_Jn(a2)].λ(_jn0) ++ [p(_jn1|f1,a1).π_Jn(a1) + p(_jn1|f1,a2).π_Jn(a2)].λ(_jn1) ++ [p(_jn2|f1,a1).π_Jn(a1) + p(_jn2|f1,a2).π_Jn(a2)].λ(_jn2) ++ [p(_jn3|f1,a1).π_Jn(a1) + p(_jn3|f1,a2).π_Jn(a2)].λ(_jn3) += [(1x0.0138158) + (0x0.986184)]x1 ++ [(0x0.0138158) + (1x0.986184)]x1 ++ [(0x0.0138158) + (0x0.986184)]x1 ++ [(0x0.0138158) + (0x0.986184)]x1 = 1 +λ_Jn(f2) += [p(_jn0|f2,a1).π_Jn(a1) + p(_jn0|f2,a2).π_Jn(a2)].λ(_jn0) ++ [p(_jn1|f2,a1).π_Jn(a1) + p(_jn1|f2,a2).π_Jn(a2)].λ(_jn1) ++ [p(_jn2|f2,a1).π_Jn(a1) + p(_jn2|f2,a2).π_Jn(a2)].λ(_jn2) ++ [p(_jn3|f2,a1).π_Jn(a1) + p(_jn3|f2,a2).π_Jn(a2)].λ(_jn3) += [(0x0.0138158) + (0x0.986184)]x1 ++ [(0x0.0138158) + (0x0.986184)]x1 ++ [(1x0.0138158) + (0x0.986184)]x1 ++ [(0x0.0138158) + (1x0.986184)]x1 = 1 + +λ message _Jn --> Alarm +λ_Jn(a1) += [p(_jn0|f1,a1).π_Jn(f1) + p(_jn0|f2,a1).π_Jn(f2)].λ(_jn0) ++ [p(_jn1|f1,a1).π_Jn(f1) + p(_jn1|f2,a1).π_Jn(f2)].λ(_jn1) ++ [p(_jn2|f1,a1).π_Jn(f1) + p(_jn2|f2,a1).π_Jn(f2)].λ(_jn2) ++ [p(_jn3|f1,a1).π_Jn(f1) + p(_jn3|f2,a1).π_Jn(f2)].λ(_jn3) += [(1x0.0300001) + (0x0.97)]x1 ++ [(0x0.0300001) + (0x0.97)]x1 ++ [(0x0.0300001) + (1x0.97)]x1 ++ [(0x0.0300001) + (0x0.97)]x1 = 1 +λ_Jn(a2) += [p(_jn0|f1,a2).π_Jn(f1) + p(_jn0|f2,a2).π_Jn(f2)].λ(_jn0) ++ [p(_jn1|f1,a2).π_Jn(f1) + p(_jn1|f2,a2).π_Jn(f2)].λ(_jn1) ++ [p(_jn2|f1,a2).π_Jn(f1) + p(_jn2|f2,a2).π_Jn(f2)].λ(_jn2) ++ [p(_jn3|f1,a2).π_Jn(f1) + p(_jn3|f2,a2).π_Jn(f2)].λ(_jn3) += [(0x0.0300001) + (0x0.97)]x1 ++ [(1x0.0300001) + (0x0.97)]x1 ++ [(0x0.0300001) + (0x0.97)]x1 ++ [(0x0.0300001) + (1x0.97)]x1 = 1 + +π message Burglar --> Alarm +πAlarm(b1) = π(b1) = 0.005 = 0.005 +πAlarm(b2) = π(b2) = 0.995 = 0.995 + +π message FreightTruck --> Alarm +πAlarm(f1) = π(f1).λ_Jn(f1) = 0.03 x 0.5 = 0.015 +πAlarm(f2) = π(f2).λ_Jn(f2) = 0.97 x 0.5 = 0.485 + +π message FreightTruck --> _Jn +π_Jn(f1) = π(f1).λAlarm(f1) = 0.03 x 0.5 = 0.015 +π_Jn(f2) = π(f2).λAlarm(f2) = 0.97 x 0.5 = 0.485 + +π message Alarm --> _Jn +π_Jn(a1) = π(a1) = 0.0138158 = 0.01381577812 +π_Jn(a2) = π(a2) = 0.986184 = 0.9861842219 + +var Burglar: +π(b1) += p(b1) += (0.005) = 0.005 +π(b2) += p(b2) += (0.995) = 0.995 +λ(b1) = λAlarm(b1) = 0.5 = 0.5 +λ(b2) = λAlarm(b2) = 0.5 = 0.5 +belief change = 0 + +var FreightTruck: +π(f1) += p(f1) += (0.03) = 0.03 +π(f2) += p(f2) += (0.97) = 0.97 +λ(f1) = λAlarm(f1).λ_Jn(f1) = 0.5 x 0.5 = 0.25 +λ(f2) = λAlarm(f2).λ_Jn(f2) = 0.5 x 0.5 = 0.25 +belief change = 0 + +var Alarm: +π(a1) += p(a1|b1,f1).πAlarm(b1).πAlarm(f1) ++ p(a1|b1,f2).πAlarm(b1).πAlarm(f2) ++ p(a1|b2,f1).πAlarm(b2).πAlarm(f1) ++ p(a1|b2,f2).πAlarm(b2).πAlarm(f2) += (0.992x0.005x0.0300001) ++ (0.99x0.005x0.97) ++ (0.2x0.995x0.0300001) ++ (0.003x0.995x0.97) = 0.01381576875 +π(a2) += p(a2|b1,f1).πAlarm(b1).πAlarm(f1) ++ p(a2|b1,f2).πAlarm(b1).πAlarm(f2) ++ p(a2|b2,f1).πAlarm(b2).πAlarm(f1) ++ p(a2|b2,f2).πAlarm(b2).πAlarm(f2) += (0.008x0.005x0.0300001) ++ (0.01x0.005x0.97) ++ (0.8x0.995x0.0300001) ++ (0.997x0.995x0.97) = 0.9861842313 +λ(a1) = λ_Jn(a1) = 0.5 = 0.5 +λ(a2) = λ_Jn(a2) = 0.5 = 0.5 +belief change = 1.875095211e-08 + +var _Jn: +π(_jn0) += p(_jn0|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn0|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn0|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn0|f2,a2).π_Jn(f2).π_Jn(a2) += (1x0.0300001x0.0138158) ++ (0x0.0300001x0.986184) ++ (0x0.97x0.0138158) ++ (0x0.97x0.986184) = 0.0004144755106 +π(_jn1) += p(_jn1|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn1|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn1|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn1|f2,a2).π_Jn(f2).π_Jn(a2) += (0x0.0300001x0.0138158) ++ (1x0.0300001x0.986184) ++ (0x0.97x0.0138158) ++ (0x0.97x0.986184) = 0.02958562013 +π(_jn2) += p(_jn2|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn2|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn2|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn2|f2,a2).π_Jn(f2).π_Jn(a2) += (0x0.0300001x0.0138158) ++ (0x0.0300001x0.986184) ++ (1x0.97x0.0138158) ++ (0x0.97x0.986184) = 0.0134013308 +π(_jn3) += p(_jn3|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn3|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn3|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn3|f2,a2).π_Jn(f2).π_Jn(a2) += (0x0.0300001x0.0138158) ++ (0x0.0300001x0.986184) ++ (0x0.97x0.0138158) ++ (1x0.97x0.986184) = 0.9565985736 +λ(_jn0) = 1 +λ(_jn1) = 1 +λ(_jn2) = 1 +λ(_jn3) = 1 +belief change = 1.489951524e-07 + +domain π(Burglar) λ(Burglar) belief +---------------------------------------------------------------- +b1 0.005 0.5 0.005 +b2 0.995 0.5 0.995 + +domain πAlarm(Burglar) λAlarm(Burglar) +---------------------------------------------------------------- +b1 0.005000000002 0.5 +b2 0.995 0.5 + +domain π(FreightTruck) λ(FreightTruck) belief +---------------------------------------------------------------- +f1 0.03 0.25 0.03 +f2 0.97 0.25 0.97 + +domain πAlarm(FreightTruck) λAlarm(FreightTruck) +---------------------------------------------------------------- +f1 0.03000009564 0.5 +f2 0.9699999044 0.5 + +domain π_Jn(FreightTruck) λ_Jn(FreightTruck) +---------------------------------------------------------------- +f1 0.03000009564 0.5 +f2 0.9699999044 0.5 + +domain π(Alarm) λ(Alarm) belief +---------------------------------------------------------------- +a1 0.01381576875 0.5 0.01381576875 +a2 0.9861842313 0.5 0.9861842313 + +domain π_Jn(Alarm) λ_Jn(Alarm) +---------------------------------------------------------------- +a1 0.01381580631 0.5 +a2 0.9861841937 0.5 + +domain π(_Jn) λ(_Jn) belief +---------------------------------------------------------------- +_jn0 0.0004144755106 1 0.0004144755106 +_jn1 0.02958562013 1 0.02958562013 +_jn2 0.0134013308 1 0.0134013308 +_jn3 0.9565985736 1 0.9565985736 + + + +******************************************************************************** + Iteration 39 +******************************************************************************** +λ message Alarm --> Burglar +λAlarm(b1) += [p(a1|b1,f1).πAlarm(f1) + p(a1|b1,f2).πAlarm(f2)].λ(a1) ++ [p(a2|b1,f1).πAlarm(f1) + p(a2|b1,f2).πAlarm(f2)].λ(a2) += [(0.992x0.0300001) + (0.99x0.97)]x0.5 ++ [(0.008x0.0300001) + (0.01x0.97)]x0.5 = 0.5 +λAlarm(b2) += [p(a1|b2,f1).πAlarm(f1) + p(a1|b2,f2).πAlarm(f2)].λ(a1) ++ [p(a2|b2,f1).πAlarm(f1) + p(a2|b2,f2).πAlarm(f2)].λ(a2) += [(0.2x0.0300001) + (0.003x0.97)]x0.5 ++ [(0.8x0.0300001) + (0.997x0.97)]x0.5 = 0.5 + +λ message Alarm --> FreightTruck +λAlarm(f1) += [p(a1|b1,f1).πAlarm(b1) + p(a1|b2,f1).πAlarm(b2)].λ(a1) ++ [p(a2|b1,f1).πAlarm(b1) + p(a2|b2,f1).πAlarm(b2)].λ(a2) += [(0.992x0.005) + (0.2x0.995)]x0.5 ++ [(0.008x0.005) + (0.8x0.995)]x0.5 = 0.5 +λAlarm(f2) += [p(a1|b1,f2).πAlarm(b1) + p(a1|b2,f2).πAlarm(b2)].λ(a1) ++ [p(a2|b1,f2).πAlarm(b1) + p(a2|b2,f2).πAlarm(b2)].λ(a2) += [(0.99x0.005) + (0.003x0.995)]x0.5 ++ [(0.01x0.005) + (0.997x0.995)]x0.5 = 0.5 + +λ message _Jn --> FreightTruck +λ_Jn(f1) += [p(_jn0|f1,a1).π_Jn(a1) + p(_jn0|f1,a2).π_Jn(a2)].λ(_jn0) ++ [p(_jn1|f1,a1).π_Jn(a1) + p(_jn1|f1,a2).π_Jn(a2)].λ(_jn1) ++ [p(_jn2|f1,a1).π_Jn(a1) + p(_jn2|f1,a2).π_Jn(a2)].λ(_jn2) ++ [p(_jn3|f1,a1).π_Jn(a1) + p(_jn3|f1,a2).π_Jn(a2)].λ(_jn3) += [(1x0.0138158) + (0x0.986184)]x1 ++ [(0x0.0138158) + (1x0.986184)]x1 ++ [(0x0.0138158) + (0x0.986184)]x1 ++ [(0x0.0138158) + (0x0.986184)]x1 = 1 +λ_Jn(f2) += [p(_jn0|f2,a1).π_Jn(a1) + p(_jn0|f2,a2).π_Jn(a2)].λ(_jn0) ++ [p(_jn1|f2,a1).π_Jn(a1) + p(_jn1|f2,a2).π_Jn(a2)].λ(_jn1) ++ [p(_jn2|f2,a1).π_Jn(a1) + p(_jn2|f2,a2).π_Jn(a2)].λ(_jn2) ++ [p(_jn3|f2,a1).π_Jn(a1) + p(_jn3|f2,a2).π_Jn(a2)].λ(_jn3) += [(0x0.0138158) + (0x0.986184)]x1 ++ [(0x0.0138158) + (0x0.986184)]x1 ++ [(1x0.0138158) + (0x0.986184)]x1 ++ [(0x0.0138158) + (1x0.986184)]x1 = 1 + +λ message _Jn --> Alarm +λ_Jn(a1) += [p(_jn0|f1,a1).π_Jn(f1) + p(_jn0|f2,a1).π_Jn(f2)].λ(_jn0) ++ [p(_jn1|f1,a1).π_Jn(f1) + p(_jn1|f2,a1).π_Jn(f2)].λ(_jn1) ++ [p(_jn2|f1,a1).π_Jn(f1) + p(_jn2|f2,a1).π_Jn(f2)].λ(_jn2) ++ [p(_jn3|f1,a1).π_Jn(f1) + p(_jn3|f2,a1).π_Jn(f2)].λ(_jn3) += [(1x0.0300001) + (0x0.97)]x1 ++ [(0x0.0300001) + (0x0.97)]x1 ++ [(0x0.0300001) + (1x0.97)]x1 ++ [(0x0.0300001) + (0x0.97)]x1 = 1 +λ_Jn(a2) += [p(_jn0|f1,a2).π_Jn(f1) + p(_jn0|f2,a2).π_Jn(f2)].λ(_jn0) ++ [p(_jn1|f1,a2).π_Jn(f1) + p(_jn1|f2,a2).π_Jn(f2)].λ(_jn1) ++ [p(_jn2|f1,a2).π_Jn(f1) + p(_jn2|f2,a2).π_Jn(f2)].λ(_jn2) ++ [p(_jn3|f1,a2).π_Jn(f1) + p(_jn3|f2,a2).π_Jn(f2)].λ(_jn3) += [(0x0.0300001) + (0x0.97)]x1 ++ [(1x0.0300001) + (0x0.97)]x1 ++ [(0x0.0300001) + (0x0.97)]x1 ++ [(0x0.0300001) + (1x0.97)]x1 = 1 + +π message Burglar --> Alarm +πAlarm(b1) = π(b1) = 0.005 = 0.005 +πAlarm(b2) = π(b2) = 0.995 = 0.995 + +π message FreightTruck --> Alarm +πAlarm(f1) = π(f1).λ_Jn(f1) = 0.03 x 0.5 = 0.015 +πAlarm(f2) = π(f2).λ_Jn(f2) = 0.97 x 0.5 = 0.485 + +π message FreightTruck --> _Jn +π_Jn(f1) = π(f1).λAlarm(f1) = 0.03 x 0.5 = 0.015 +π_Jn(f2) = π(f2).λAlarm(f2) = 0.97 x 0.5 = 0.485 + +π message Alarm --> _Jn +π_Jn(a1) = π(a1) = 0.0138158 = 0.01381576875 +π_Jn(a2) = π(a2) = 0.986184 = 0.9861842313 + +var Burglar: +π(b1) += p(b1) += (0.005) = 0.005 +π(b2) += p(b2) += (0.995) = 0.995 +λ(b1) = λAlarm(b1) = 0.5 = 0.5 +λ(b2) = λAlarm(b2) = 0.5 = 0.5 +belief change = 0 + +var FreightTruck: +π(f1) += p(f1) += (0.03) = 0.03 +π(f2) += p(f2) += (0.97) = 0.97 +λ(f1) = λAlarm(f1).λ_Jn(f1) = 0.5 x 0.5 = 0.25 +λ(f2) = λAlarm(f2).λ_Jn(f2) = 0.5 x 0.5 = 0.25 +belief change = 0 + +var Alarm: +π(a1) += p(a1|b1,f1).πAlarm(b1).πAlarm(f1) ++ p(a1|b1,f2).πAlarm(b1).πAlarm(f2) ++ p(a1|b2,f1).πAlarm(b2).πAlarm(f1) ++ p(a1|b2,f2).πAlarm(b2).πAlarm(f2) += (0.992x0.005x0.0300001) ++ (0.99x0.005x0.97) ++ (0.2x0.995x0.0300001) ++ (0.003x0.995x0.97) = 0.0138157625 +π(a2) += p(a2|b1,f1).πAlarm(b1).πAlarm(f1) ++ p(a2|b1,f2).πAlarm(b1).πAlarm(f2) ++ p(a2|b2,f1).πAlarm(b2).πAlarm(f1) ++ p(a2|b2,f2).πAlarm(b2).πAlarm(f2) += (0.008x0.005x0.0300001) ++ (0.01x0.005x0.97) ++ (0.8x0.995x0.0300001) ++ (0.997x0.995x0.97) = 0.9861842375 +λ(a1) = λ_Jn(a1) = 0.5 = 0.5 +λ(a2) = λ_Jn(a2) = 0.5 = 0.5 +belief change = 1.250004601e-08 + +var _Jn: +π(_jn0) += p(_jn0|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn0|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn0|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn0|f2,a2).π_Jn(f2).π_Jn(a2) += (1x0.0300001x0.0138158) ++ (0x0.0300001x0.986184) ++ (0x0.97x0.0138158) ++ (0x0.97x0.986184) = 0.0004144745068 +π(_jn1) += p(_jn1|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn1|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn1|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn1|f2,a2).π_Jn(f2).π_Jn(a2) += (0x0.0300001x0.0138158) ++ (1x0.0300001x0.986184) ++ (0x0.97x0.0138158) ++ (0x0.97x0.986184) = 0.02958558925 +π(_jn2) += p(_jn2|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn2|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn2|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn2|f2,a2).π_Jn(f2).π_Jn(a2) += (0x0.0300001x0.0138158) ++ (0x0.0300001x0.986184) ++ (1x0.97x0.0138158) ++ (0x0.97x0.986184) = 0.01340131302 +π(_jn3) += p(_jn3|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn3|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn3|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn3|f2,a2).π_Jn(f2).π_Jn(a2) += (0x0.0300001x0.0138158) ++ (0x0.0300001x0.986184) ++ (0x0.97x0.0138158) ++ (1x0.97x0.986184) = 0.9565986232 +λ(_jn0) = 1 +λ(_jn1) = 1 +λ(_jn2) = 1 +λ(_jn3) = 1 +belief change = 9.931121969e-08 + +domain π(Burglar) λ(Burglar) belief +---------------------------------------------------------------- +b1 0.005 0.5 0.005 +b2 0.995 0.5 0.995 + +domain πAlarm(Burglar) λAlarm(Burglar) +---------------------------------------------------------------- +b1 0.005000000001 0.5 +b2 0.995 0.5 + +domain π(FreightTruck) λ(FreightTruck) belief +---------------------------------------------------------------- +f1 0.03 0.25 0.03 +f2 0.97 0.25 0.97 + +domain πAlarm(FreightTruck) λAlarm(FreightTruck) +---------------------------------------------------------------- +f1 0.03000006376 0.5 +f2 0.9699999362 0.5 + +domain π_Jn(FreightTruck) λ_Jn(FreightTruck) +---------------------------------------------------------------- +f1 0.03000006376 0.5 +f2 0.9699999362 0.5 + +domain π(Alarm) λ(Alarm) belief +---------------------------------------------------------------- +a1 0.0138157625 0.5 0.0138157625 +a2 0.9861842375 0.5 0.9861842375 + +domain π_Jn(Alarm) λ_Jn(Alarm) +---------------------------------------------------------------- +a1 0.01381578753 0.5 +a2 0.9861842125 0.5 + +domain π(_Jn) λ(_Jn) belief +---------------------------------------------------------------- +_jn0 0.0004144745068 1 0.0004144745068 +_jn1 0.02958558925 1 0.02958558925 +_jn2 0.01340131302 1 0.01340131302 +_jn3 0.9565986232 1 0.9565986232 + + + +******************************************************************************** + Iteration 40 +******************************************************************************** +λ message Alarm --> Burglar +λAlarm(b1) += [p(a1|b1,f1).πAlarm(f1) + p(a1|b1,f2).πAlarm(f2)].λ(a1) ++ [p(a2|b1,f1).πAlarm(f1) + p(a2|b1,f2).πAlarm(f2)].λ(a2) += [(0.992x0.0300001) + (0.99x0.97)]x0.5 ++ [(0.008x0.0300001) + (0.01x0.97)]x0.5 = 0.5 +λAlarm(b2) += [p(a1|b2,f1).πAlarm(f1) + p(a1|b2,f2).πAlarm(f2)].λ(a1) ++ [p(a2|b2,f1).πAlarm(f1) + p(a2|b2,f2).πAlarm(f2)].λ(a2) += [(0.2x0.0300001) + (0.003x0.97)]x0.5 ++ [(0.8x0.0300001) + (0.997x0.97)]x0.5 = 0.5 + +λ message Alarm --> FreightTruck +λAlarm(f1) += [p(a1|b1,f1).πAlarm(b1) + p(a1|b2,f1).πAlarm(b2)].λ(a1) ++ [p(a2|b1,f1).πAlarm(b1) + p(a2|b2,f1).πAlarm(b2)].λ(a2) += [(0.992x0.005) + (0.2x0.995)]x0.5 ++ [(0.008x0.005) + (0.8x0.995)]x0.5 = 0.5 +λAlarm(f2) += [p(a1|b1,f2).πAlarm(b1) + p(a1|b2,f2).πAlarm(b2)].λ(a1) ++ [p(a2|b1,f2).πAlarm(b1) + p(a2|b2,f2).πAlarm(b2)].λ(a2) += [(0.99x0.005) + (0.003x0.995)]x0.5 ++ [(0.01x0.005) + (0.997x0.995)]x0.5 = 0.5 + +λ message _Jn --> FreightTruck +λ_Jn(f1) += [p(_jn0|f1,a1).π_Jn(a1) + p(_jn0|f1,a2).π_Jn(a2)].λ(_jn0) ++ [p(_jn1|f1,a1).π_Jn(a1) + p(_jn1|f1,a2).π_Jn(a2)].λ(_jn1) ++ [p(_jn2|f1,a1).π_Jn(a1) + p(_jn2|f1,a2).π_Jn(a2)].λ(_jn2) ++ [p(_jn3|f1,a1).π_Jn(a1) + p(_jn3|f1,a2).π_Jn(a2)].λ(_jn3) += [(1x0.0138158) + (0x0.986184)]x1 ++ [(0x0.0138158) + (1x0.986184)]x1 ++ [(0x0.0138158) + (0x0.986184)]x1 ++ [(0x0.0138158) + (0x0.986184)]x1 = 1 +λ_Jn(f2) += [p(_jn0|f2,a1).π_Jn(a1) + p(_jn0|f2,a2).π_Jn(a2)].λ(_jn0) ++ [p(_jn1|f2,a1).π_Jn(a1) + p(_jn1|f2,a2).π_Jn(a2)].λ(_jn1) ++ [p(_jn2|f2,a1).π_Jn(a1) + p(_jn2|f2,a2).π_Jn(a2)].λ(_jn2) ++ [p(_jn3|f2,a1).π_Jn(a1) + p(_jn3|f2,a2).π_Jn(a2)].λ(_jn3) += [(0x0.0138158) + (0x0.986184)]x1 ++ [(0x0.0138158) + (0x0.986184)]x1 ++ [(1x0.0138158) + (0x0.986184)]x1 ++ [(0x0.0138158) + (1x0.986184)]x1 = 1 + +λ message _Jn --> Alarm +λ_Jn(a1) += [p(_jn0|f1,a1).π_Jn(f1) + p(_jn0|f2,a1).π_Jn(f2)].λ(_jn0) ++ [p(_jn1|f1,a1).π_Jn(f1) + p(_jn1|f2,a1).π_Jn(f2)].λ(_jn1) ++ [p(_jn2|f1,a1).π_Jn(f1) + p(_jn2|f2,a1).π_Jn(f2)].λ(_jn2) ++ [p(_jn3|f1,a1).π_Jn(f1) + p(_jn3|f2,a1).π_Jn(f2)].λ(_jn3) += [(1x0.0300001) + (0x0.97)]x1 ++ [(0x0.0300001) + (0x0.97)]x1 ++ [(0x0.0300001) + (1x0.97)]x1 ++ [(0x0.0300001) + (0x0.97)]x1 = 1 +λ_Jn(a2) += [p(_jn0|f1,a2).π_Jn(f1) + p(_jn0|f2,a2).π_Jn(f2)].λ(_jn0) ++ [p(_jn1|f1,a2).π_Jn(f1) + p(_jn1|f2,a2).π_Jn(f2)].λ(_jn1) ++ [p(_jn2|f1,a2).π_Jn(f1) + p(_jn2|f2,a2).π_Jn(f2)].λ(_jn2) ++ [p(_jn3|f1,a2).π_Jn(f1) + p(_jn3|f2,a2).π_Jn(f2)].λ(_jn3) += [(0x0.0300001) + (0x0.97)]x1 ++ [(1x0.0300001) + (0x0.97)]x1 ++ [(0x0.0300001) + (0x0.97)]x1 ++ [(0x0.0300001) + (1x0.97)]x1 = 1 + +π message Burglar --> Alarm +πAlarm(b1) = π(b1) = 0.005 = 0.005 +πAlarm(b2) = π(b2) = 0.995 = 0.995 + +π message FreightTruck --> Alarm +πAlarm(f1) = π(f1).λ_Jn(f1) = 0.03 x 0.5 = 0.015 +πAlarm(f2) = π(f2).λ_Jn(f2) = 0.97 x 0.5 = 0.485 + +π message FreightTruck --> _Jn +π_Jn(f1) = π(f1).λAlarm(f1) = 0.03 x 0.5 = 0.015 +π_Jn(f2) = π(f2).λAlarm(f2) = 0.97 x 0.5 = 0.485 + +π message Alarm --> _Jn +π_Jn(a1) = π(a1) = 0.0138158 = 0.0138157625 +π_Jn(a2) = π(a2) = 0.986184 = 0.9861842375 + +var Burglar: +π(b1) += p(b1) += (0.005) = 0.005 +π(b2) += p(b2) += (0.995) = 0.995 +λ(b1) = λAlarm(b1) = 0.5 = 0.5 +λ(b2) = λAlarm(b2) = 0.5 = 0.5 +belief change = 0 + +var FreightTruck: +π(f1) += p(f1) += (0.03) = 0.03 +π(f2) += p(f2) += (0.97) = 0.97 +λ(f1) = λAlarm(f1).λ_Jn(f1) = 0.5 x 0.5 = 0.25 +λ(f2) = λAlarm(f2).λ_Jn(f2) = 0.5 x 0.5 = 0.25 +belief change = 0 + +var Alarm: +π(a1) += p(a1|b1,f1).πAlarm(b1).πAlarm(f1) ++ p(a1|b1,f2).πAlarm(b1).πAlarm(f2) ++ p(a1|b2,f1).πAlarm(b2).πAlarm(f1) ++ p(a1|b2,f2).πAlarm(b2).πAlarm(f2) += (0.992x0.005x0.03) ++ (0.99x0.005x0.97) ++ (0.2x0.995x0.03) ++ (0.003x0.995x0.97) = 0.01381575833 +π(a2) += p(a2|b1,f1).πAlarm(b1).πAlarm(f1) ++ p(a2|b1,f2).πAlarm(b1).πAlarm(f2) ++ p(a2|b2,f1).πAlarm(b2).πAlarm(f1) ++ p(a2|b2,f2).πAlarm(b2).πAlarm(f2) += (0.008x0.005x0.03) ++ (0.01x0.005x0.97) ++ (0.8x0.995x0.03) ++ (0.997x0.995x0.97) = 0.9861842417 +λ(a1) = λ_Jn(a1) = 0.5 = 0.5 +λ(a2) = λ_Jn(a2) = 0.5 = 0.5 +belief change = 8.333069516e-09 + +var _Jn: +π(_jn0) += p(_jn0|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn0|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn0|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn0|f2,a2).π_Jn(f2).π_Jn(a2) += (1x0.03x0.0138158) ++ (0x0.03x0.986184) ++ (0x0.97x0.0138158) ++ (0x0.97x0.986184) = 0.0004144738377 +π(_jn1) += p(_jn1|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn1|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn1|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn1|f2,a2).π_Jn(f2).π_Jn(a2) += (0x0.03x0.0138158) ++ (1x0.03x0.986184) ++ (0x0.97x0.0138158) ++ (0x0.97x0.986184) = 0.02958556867 +π(_jn2) += p(_jn2|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn2|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn2|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn2|f2,a2).π_Jn(f2).π_Jn(a2) += (0x0.03x0.0138158) ++ (0x0.03x0.986184) ++ (1x0.97x0.0138158) ++ (0x0.97x0.986184) = 0.01340130118 +π(_jn3) += p(_jn3|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn3|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn3|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn3|f2,a2).π_Jn(f2).π_Jn(a2) += (0x0.03x0.0138158) ++ (0x0.03x0.986184) ++ (0x0.97x0.0138158) ++ (1x0.97x0.986184) = 0.9565986563 +λ(_jn0) = 1 +λ(_jn1) = 1 +λ(_jn2) = 1 +λ(_jn3) = 1 +belief change = 6.61977534e-08 + +domain π(Burglar) λ(Burglar) belief +---------------------------------------------------------------- +b1 0.005 0.5 0.005 +b2 0.995 0.5 0.995 + +domain πAlarm(Burglar) λAlarm(Burglar) +---------------------------------------------------------------- +b1 0.005 0.5 +b2 0.995 0.5 + +domain π(FreightTruck) λ(FreightTruck) belief +---------------------------------------------------------------- +f1 0.03 0.25 0.03 +f2 0.97 0.25 0.97 + +domain πAlarm(FreightTruck) λAlarm(FreightTruck) +---------------------------------------------------------------- +f1 0.03000004251 0.5 +f2 0.9699999575 0.5 + +domain π_Jn(FreightTruck) λ_Jn(FreightTruck) +---------------------------------------------------------------- +f1 0.03000004251 0.5 +f2 0.9699999575 0.5 + +domain π(Alarm) λ(Alarm) belief +---------------------------------------------------------------- +a1 0.01381575833 0.5 0.01381575833 +a2 0.9861842417 0.5 0.9861842417 + +domain π_Jn(Alarm) λ_Jn(Alarm) +---------------------------------------------------------------- +a1 0.01381577501 0.5 +a2 0.986184225 0.5 + +domain π(_Jn) λ(_Jn) belief +---------------------------------------------------------------- +_jn0 0.0004144738377 1 0.0004144738377 +_jn1 0.02958556867 1 0.02958556867 +_jn2 0.01340130118 1 0.01340130118 +_jn3 0.9565986563 1 0.9565986563 + + + +******************************************************************************** + Iteration 41 +******************************************************************************** +λ message Alarm --> Burglar +λAlarm(b1) += [p(a1|b1,f1).πAlarm(f1) + p(a1|b1,f2).πAlarm(f2)].λ(a1) ++ [p(a2|b1,f1).πAlarm(f1) + p(a2|b1,f2).πAlarm(f2)].λ(a2) += [(0.992x0.03) + (0.99x0.97)]x0.5 ++ [(0.008x0.03) + (0.01x0.97)]x0.5 = 0.5 +λAlarm(b2) += [p(a1|b2,f1).πAlarm(f1) + p(a1|b2,f2).πAlarm(f2)].λ(a1) ++ [p(a2|b2,f1).πAlarm(f1) + p(a2|b2,f2).πAlarm(f2)].λ(a2) += [(0.2x0.03) + (0.003x0.97)]x0.5 ++ [(0.8x0.03) + (0.997x0.97)]x0.5 = 0.5 + +λ message Alarm --> FreightTruck +λAlarm(f1) += [p(a1|b1,f1).πAlarm(b1) + p(a1|b2,f1).πAlarm(b2)].λ(a1) ++ [p(a2|b1,f1).πAlarm(b1) + p(a2|b2,f1).πAlarm(b2)].λ(a2) += [(0.992x0.005) + (0.2x0.995)]x0.5 ++ [(0.008x0.005) + (0.8x0.995)]x0.5 = 0.5 +λAlarm(f2) += [p(a1|b1,f2).πAlarm(b1) + p(a1|b2,f2).πAlarm(b2)].λ(a1) ++ [p(a2|b1,f2).πAlarm(b1) + p(a2|b2,f2).πAlarm(b2)].λ(a2) += [(0.99x0.005) + (0.003x0.995)]x0.5 ++ [(0.01x0.005) + (0.997x0.995)]x0.5 = 0.5 + +λ message _Jn --> FreightTruck +λ_Jn(f1) += [p(_jn0|f1,a1).π_Jn(a1) + p(_jn0|f1,a2).π_Jn(a2)].λ(_jn0) ++ [p(_jn1|f1,a1).π_Jn(a1) + p(_jn1|f1,a2).π_Jn(a2)].λ(_jn1) ++ [p(_jn2|f1,a1).π_Jn(a1) + p(_jn2|f1,a2).π_Jn(a2)].λ(_jn2) ++ [p(_jn3|f1,a1).π_Jn(a1) + p(_jn3|f1,a2).π_Jn(a2)].λ(_jn3) += [(1x0.0138158) + (0x0.986184)]x1 ++ [(0x0.0138158) + (1x0.986184)]x1 ++ [(0x0.0138158) + (0x0.986184)]x1 ++ [(0x0.0138158) + (0x0.986184)]x1 = 1 +λ_Jn(f2) += [p(_jn0|f2,a1).π_Jn(a1) + p(_jn0|f2,a2).π_Jn(a2)].λ(_jn0) ++ [p(_jn1|f2,a1).π_Jn(a1) + p(_jn1|f2,a2).π_Jn(a2)].λ(_jn1) ++ [p(_jn2|f2,a1).π_Jn(a1) + p(_jn2|f2,a2).π_Jn(a2)].λ(_jn2) ++ [p(_jn3|f2,a1).π_Jn(a1) + p(_jn3|f2,a2).π_Jn(a2)].λ(_jn3) += [(0x0.0138158) + (0x0.986184)]x1 ++ [(0x0.0138158) + (0x0.986184)]x1 ++ [(1x0.0138158) + (0x0.986184)]x1 ++ [(0x0.0138158) + (1x0.986184)]x1 = 1 + +λ message _Jn --> Alarm +λ_Jn(a1) += [p(_jn0|f1,a1).π_Jn(f1) + p(_jn0|f2,a1).π_Jn(f2)].λ(_jn0) ++ [p(_jn1|f1,a1).π_Jn(f1) + p(_jn1|f2,a1).π_Jn(f2)].λ(_jn1) ++ [p(_jn2|f1,a1).π_Jn(f1) + p(_jn2|f2,a1).π_Jn(f2)].λ(_jn2) ++ [p(_jn3|f1,a1).π_Jn(f1) + p(_jn3|f2,a1).π_Jn(f2)].λ(_jn3) += [(1x0.03) + (0x0.97)]x1 ++ [(0x0.03) + (0x0.97)]x1 ++ [(0x0.03) + (1x0.97)]x1 ++ [(0x0.03) + (0x0.97)]x1 = 1 +λ_Jn(a2) += [p(_jn0|f1,a2).π_Jn(f1) + p(_jn0|f2,a2).π_Jn(f2)].λ(_jn0) ++ [p(_jn1|f1,a2).π_Jn(f1) + p(_jn1|f2,a2).π_Jn(f2)].λ(_jn1) ++ [p(_jn2|f1,a2).π_Jn(f1) + p(_jn2|f2,a2).π_Jn(f2)].λ(_jn2) ++ [p(_jn3|f1,a2).π_Jn(f1) + p(_jn3|f2,a2).π_Jn(f2)].λ(_jn3) += [(0x0.03) + (0x0.97)]x1 ++ [(1x0.03) + (0x0.97)]x1 ++ [(0x0.03) + (0x0.97)]x1 ++ [(0x0.03) + (1x0.97)]x1 = 1 + +π message Burglar --> Alarm +πAlarm(b1) = π(b1) = 0.005 = 0.005 +πAlarm(b2) = π(b2) = 0.995 = 0.995 + +π message FreightTruck --> Alarm +πAlarm(f1) = π(f1).λ_Jn(f1) = 0.03 x 0.5 = 0.015 +πAlarm(f2) = π(f2).λ_Jn(f2) = 0.97 x 0.5 = 0.485 + +π message FreightTruck --> _Jn +π_Jn(f1) = π(f1).λAlarm(f1) = 0.03 x 0.5 = 0.015 +π_Jn(f2) = π(f2).λAlarm(f2) = 0.97 x 0.5 = 0.485 + +π message Alarm --> _Jn +π_Jn(a1) = π(a1) = 0.0138158 = 0.01381575833 +π_Jn(a2) = π(a2) = 0.986184 = 0.9861842417 + +var Burglar: +π(b1) += p(b1) += (0.005) = 0.005 +π(b2) += p(b2) += (0.995) = 0.995 +λ(b1) = λAlarm(b1) = 0.5 = 0.5 +λ(b2) = λAlarm(b2) = 0.5 = 0.5 +belief change = 0 + +var FreightTruck: +π(f1) += p(f1) += (0.03) = 0.03 +π(f2) += p(f2) += (0.97) = 0.97 +λ(f1) = λAlarm(f1).λ_Jn(f1) = 0.5 x 0.5 = 0.25 +λ(f2) = λAlarm(f2).λ_Jn(f2) = 0.5 x 0.5 = 0.25 +belief change = 0 + +var Alarm: +π(a1) += p(a1|b1,f1).πAlarm(b1).πAlarm(f1) ++ p(a1|b1,f2).πAlarm(b1).πAlarm(f2) ++ p(a1|b2,f1).πAlarm(b2).πAlarm(f1) ++ p(a1|b2,f2).πAlarm(b2).πAlarm(f2) += (0.992x0.005x0.03) ++ (0.99x0.005x0.97) ++ (0.2x0.995x0.03) ++ (0.003x0.995x0.97) = 0.01381575556 +π(a2) += p(a2|b1,f1).πAlarm(b1).πAlarm(f1) ++ p(a2|b1,f2).πAlarm(b1).πAlarm(f2) ++ p(a2|b2,f1).πAlarm(b2).πAlarm(f1) ++ p(a2|b2,f2).πAlarm(b2).πAlarm(f2) += (0.008x0.005x0.03) ++ (0.01x0.005x0.97) ++ (0.8x0.995x0.03) ++ (0.997x0.995x0.97) = 0.9861842444 +λ(a1) = λ_Jn(a1) = 0.5 = 0.5 +λ(a2) = λ_Jn(a2) = 0.5 = 0.5 +belief change = 5.555232455e-09 + +var _Jn: +π(_jn0) += p(_jn0|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn0|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn0|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn0|f2,a2).π_Jn(f2).π_Jn(a2) += (1x0.03x0.0138158) ++ (0x0.03x0.986184) ++ (0x0.97x0.0138158) ++ (0x0.97x0.986184) = 0.0004144733917 +π(_jn1) += p(_jn1|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn1|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn1|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn1|f2,a2).π_Jn(f2).π_Jn(a2) += (0x0.03x0.0138158) ++ (1x0.03x0.986184) ++ (0x0.97x0.0138158) ++ (0x0.97x0.986184) = 0.02958555495 +π(_jn2) += p(_jn2|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn2|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn2|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn2|f2,a2).π_Jn(f2).π_Jn(a2) += (0x0.03x0.0138158) ++ (0x0.03x0.986184) ++ (1x0.97x0.0138158) ++ (0x0.97x0.986184) = 0.01340129328 +π(_jn3) += p(_jn3|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn3|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn3|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn3|f2,a2).π_Jn(f2).π_Jn(a2) += (0x0.03x0.0138158) ++ (0x0.03x0.986184) ++ (0x0.97x0.0138158) ++ (1x0.97x0.986184) = 0.9565986784 +λ(_jn0) = 1 +λ(_jn1) = 1 +λ(_jn2) = 1 +λ(_jn3) = 1 +belief change = 4.412682933e-08 + +domain π(Burglar) λ(Burglar) belief +---------------------------------------------------------------- +b1 0.005 0.5 0.005 +b2 0.995 0.5 0.995 + +domain πAlarm(Burglar) λAlarm(Burglar) +---------------------------------------------------------------- +b1 0.005 0.5 +b2 0.995 0.5 + +domain π(FreightTruck) λ(FreightTruck) belief +---------------------------------------------------------------- +f1 0.03 0.25 0.03 +f2 0.97 0.25 0.97 + +domain πAlarm(FreightTruck) λAlarm(FreightTruck) +---------------------------------------------------------------- +f1 0.03000002834 0.5 +f2 0.9699999717 0.5 + +domain π_Jn(FreightTruck) λ_Jn(FreightTruck) +---------------------------------------------------------------- +f1 0.03000002834 0.5 +f2 0.9699999717 0.5 + +domain π(Alarm) λ(Alarm) belief +---------------------------------------------------------------- +a1 0.01381575556 0.5 0.01381575556 +a2 0.9861842444 0.5 0.9861842444 + +domain π_Jn(Alarm) λ_Jn(Alarm) +---------------------------------------------------------------- +a1 0.01381576667 0.5 +a2 0.9861842333 0.5 + +domain π(_Jn) λ(_Jn) belief +---------------------------------------------------------------- +_jn0 0.0004144733917 1 0.0004144733917 +_jn1 0.02958555495 1 0.02958555495 +_jn2 0.01340129328 1 0.01340129328 +_jn3 0.9565986784 1 0.9565986784 + + + +******************************************************************************** + Iteration 42 +******************************************************************************** +λ message Alarm --> Burglar +λAlarm(b1) += [p(a1|b1,f1).πAlarm(f1) + p(a1|b1,f2).πAlarm(f2)].λ(a1) ++ [p(a2|b1,f1).πAlarm(f1) + p(a2|b1,f2).πAlarm(f2)].λ(a2) += [(0.992x0.03) + (0.99x0.97)]x0.5 ++ [(0.008x0.03) + (0.01x0.97)]x0.5 = 0.5 +λAlarm(b2) += [p(a1|b2,f1).πAlarm(f1) + p(a1|b2,f2).πAlarm(f2)].λ(a1) ++ [p(a2|b2,f1).πAlarm(f1) + p(a2|b2,f2).πAlarm(f2)].λ(a2) += [(0.2x0.03) + (0.003x0.97)]x0.5 ++ [(0.8x0.03) + (0.997x0.97)]x0.5 = 0.5 + +λ message Alarm --> FreightTruck +λAlarm(f1) += [p(a1|b1,f1).πAlarm(b1) + p(a1|b2,f1).πAlarm(b2)].λ(a1) ++ [p(a2|b1,f1).πAlarm(b1) + p(a2|b2,f1).πAlarm(b2)].λ(a2) += [(0.992x0.005) + (0.2x0.995)]x0.5 ++ [(0.008x0.005) + (0.8x0.995)]x0.5 = 0.5 +λAlarm(f2) += [p(a1|b1,f2).πAlarm(b1) + p(a1|b2,f2).πAlarm(b2)].λ(a1) ++ [p(a2|b1,f2).πAlarm(b1) + p(a2|b2,f2).πAlarm(b2)].λ(a2) += [(0.99x0.005) + (0.003x0.995)]x0.5 ++ [(0.01x0.005) + (0.997x0.995)]x0.5 = 0.5 + +λ message _Jn --> FreightTruck +λ_Jn(f1) += [p(_jn0|f1,a1).π_Jn(a1) + p(_jn0|f1,a2).π_Jn(a2)].λ(_jn0) ++ [p(_jn1|f1,a1).π_Jn(a1) + p(_jn1|f1,a2).π_Jn(a2)].λ(_jn1) ++ [p(_jn2|f1,a1).π_Jn(a1) + p(_jn2|f1,a2).π_Jn(a2)].λ(_jn2) ++ [p(_jn3|f1,a1).π_Jn(a1) + p(_jn3|f1,a2).π_Jn(a2)].λ(_jn3) += [(1x0.0138158) + (0x0.986184)]x1 ++ [(0x0.0138158) + (1x0.986184)]x1 ++ [(0x0.0138158) + (0x0.986184)]x1 ++ [(0x0.0138158) + (0x0.986184)]x1 = 1 +λ_Jn(f2) += [p(_jn0|f2,a1).π_Jn(a1) + p(_jn0|f2,a2).π_Jn(a2)].λ(_jn0) ++ [p(_jn1|f2,a1).π_Jn(a1) + p(_jn1|f2,a2).π_Jn(a2)].λ(_jn1) ++ [p(_jn2|f2,a1).π_Jn(a1) + p(_jn2|f2,a2).π_Jn(a2)].λ(_jn2) ++ [p(_jn3|f2,a1).π_Jn(a1) + p(_jn3|f2,a2).π_Jn(a2)].λ(_jn3) += [(0x0.0138158) + (0x0.986184)]x1 ++ [(0x0.0138158) + (0x0.986184)]x1 ++ [(1x0.0138158) + (0x0.986184)]x1 ++ [(0x0.0138158) + (1x0.986184)]x1 = 1 + +λ message _Jn --> Alarm +λ_Jn(a1) += [p(_jn0|f1,a1).π_Jn(f1) + p(_jn0|f2,a1).π_Jn(f2)].λ(_jn0) ++ [p(_jn1|f1,a1).π_Jn(f1) + p(_jn1|f2,a1).π_Jn(f2)].λ(_jn1) ++ [p(_jn2|f1,a1).π_Jn(f1) + p(_jn2|f2,a1).π_Jn(f2)].λ(_jn2) ++ [p(_jn3|f1,a1).π_Jn(f1) + p(_jn3|f2,a1).π_Jn(f2)].λ(_jn3) += [(1x0.03) + (0x0.97)]x1 ++ [(0x0.03) + (0x0.97)]x1 ++ [(0x0.03) + (1x0.97)]x1 ++ [(0x0.03) + (0x0.97)]x1 = 1 +λ_Jn(a2) += [p(_jn0|f1,a2).π_Jn(f1) + p(_jn0|f2,a2).π_Jn(f2)].λ(_jn0) ++ [p(_jn1|f1,a2).π_Jn(f1) + p(_jn1|f2,a2).π_Jn(f2)].λ(_jn1) ++ [p(_jn2|f1,a2).π_Jn(f1) + p(_jn2|f2,a2).π_Jn(f2)].λ(_jn2) ++ [p(_jn3|f1,a2).π_Jn(f1) + p(_jn3|f2,a2).π_Jn(f2)].λ(_jn3) += [(0x0.03) + (0x0.97)]x1 ++ [(1x0.03) + (0x0.97)]x1 ++ [(0x0.03) + (0x0.97)]x1 ++ [(0x0.03) + (1x0.97)]x1 = 1 + +π message Burglar --> Alarm +πAlarm(b1) = π(b1) = 0.005 = 0.005 +πAlarm(b2) = π(b2) = 0.995 = 0.995 + +π message FreightTruck --> Alarm +πAlarm(f1) = π(f1).λ_Jn(f1) = 0.03 x 0.5 = 0.015 +πAlarm(f2) = π(f2).λ_Jn(f2) = 0.97 x 0.5 = 0.485 + +π message FreightTruck --> _Jn +π_Jn(f1) = π(f1).λAlarm(f1) = 0.03 x 0.5 = 0.015 +π_Jn(f2) = π(f2).λAlarm(f2) = 0.97 x 0.5 = 0.485 + +π message Alarm --> _Jn +π_Jn(a1) = π(a1) = 0.0138158 = 0.01381575556 +π_Jn(a2) = π(a2) = 0.986184 = 0.9861842444 + +var Burglar: +π(b1) += p(b1) += (0.005) = 0.005 +π(b2) += p(b2) += (0.995) = 0.995 +λ(b1) = λAlarm(b1) = 0.5 = 0.5 +λ(b2) = λAlarm(b2) = 0.5 = 0.5 +belief change = 0 + +var FreightTruck: +π(f1) += p(f1) += (0.03) = 0.03 +π(f2) += p(f2) += (0.97) = 0.97 +λ(f1) = λAlarm(f1).λ_Jn(f1) = 0.5 x 0.5 = 0.25 +λ(f2) = λAlarm(f2).λ_Jn(f2) = 0.5 x 0.5 = 0.25 +belief change = 0 + +var Alarm: +π(a1) += p(a1|b1,f1).πAlarm(b1).πAlarm(f1) ++ p(a1|b1,f2).πAlarm(b1).πAlarm(f2) ++ p(a1|b2,f1).πAlarm(b2).πAlarm(f1) ++ p(a1|b2,f2).πAlarm(b2).πAlarm(f2) += (0.992x0.005x0.03) ++ (0.99x0.005x0.97) ++ (0.2x0.995x0.03) ++ (0.003x0.995x0.97) = 0.0138157537 +π(a2) += p(a2|b1,f1).πAlarm(b1).πAlarm(f1) ++ p(a2|b1,f2).πAlarm(b1).πAlarm(f2) ++ p(a2|b2,f1).πAlarm(b2).πAlarm(f1) ++ p(a2|b2,f2).πAlarm(b2).πAlarm(f2) += (0.008x0.005x0.03) ++ (0.01x0.005x0.97) ++ (0.8x0.995x0.03) ++ (0.997x0.995x0.97) = 0.9861842463 +λ(a1) = λ_Jn(a1) = 0.5 = 0.5 +λ(a2) = λ_Jn(a2) = 0.5 = 0.5 +belief change = 3.703414561e-09 + +var _Jn: +π(_jn0) += p(_jn0|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn0|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn0|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn0|f2,a2).π_Jn(f2).π_Jn(a2) += (1x0.03x0.0138158) ++ (0x0.03x0.986184) ++ (0x0.97x0.0138158) ++ (0x0.97x0.986184) = 0.0004144730944 +π(_jn1) += p(_jn1|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn1|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn1|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn1|f2,a2).π_Jn(f2).π_Jn(a2) += (0x0.03x0.0138158) ++ (1x0.03x0.986184) ++ (0x0.97x0.0138158) ++ (0x0.97x0.986184) = 0.0295855458 +π(_jn2) += p(_jn2|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn2|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn2|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn2|f2,a2).π_Jn(f2).π_Jn(a2) += (0x0.03x0.0138158) ++ (0x0.03x0.986184) ++ (1x0.97x0.0138158) ++ (0x0.97x0.986184) = 0.01340128802 +π(_jn3) += p(_jn3|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn3|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn3|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn3|f2,a2).π_Jn(f2).π_Jn(a2) += (0x0.03x0.0138158) ++ (0x0.03x0.986184) ++ (0x0.97x0.0138158) ++ (1x0.97x0.986184) = 0.9565986931 +λ(_jn0) = 1 +λ(_jn1) = 1 +λ(_jn2) = 1 +λ(_jn3) = 1 +belief change = 2.941531181e-08 + +domain π(Burglar) λ(Burglar) belief +---------------------------------------------------------------- +b1 0.005 0.5 0.005 +b2 0.995 0.5 0.995 + +domain πAlarm(Burglar) λAlarm(Burglar) +---------------------------------------------------------------- +b1 0.005 0.5 +b2 0.995 0.5 + +domain π(FreightTruck) λ(FreightTruck) belief +---------------------------------------------------------------- +f1 0.03 0.25 0.03 +f2 0.97 0.25 0.97 + +domain πAlarm(FreightTruck) λAlarm(FreightTruck) +---------------------------------------------------------------- +f1 0.03000001889 0.5 +f2 0.9699999811 0.5 + +domain π_Jn(FreightTruck) λ_Jn(FreightTruck) +---------------------------------------------------------------- +f1 0.03000001889 0.5 +f2 0.9699999811 0.5 + +domain π(Alarm) λ(Alarm) belief +---------------------------------------------------------------- +a1 0.0138157537 0.5 0.0138157537 +a2 0.9861842463 0.5 0.9861842463 + +domain π_Jn(Alarm) λ_Jn(Alarm) +---------------------------------------------------------------- +a1 0.01381576111 0.5 +a2 0.9861842389 0.5 + +domain π(_Jn) λ(_Jn) belief +---------------------------------------------------------------- +_jn0 0.0004144730944 1 0.0004144730944 +_jn1 0.0295855458 1 0.0295855458 +_jn2 0.01340128802 1 0.01340128802 +_jn3 0.9565986931 1 0.9565986931 + + + +******************************************************************************** + Iteration 43 +******************************************************************************** +λ message Alarm --> Burglar +λAlarm(b1) += [p(a1|b1,f1).πAlarm(f1) + p(a1|b1,f2).πAlarm(f2)].λ(a1) ++ [p(a2|b1,f1).πAlarm(f1) + p(a2|b1,f2).πAlarm(f2)].λ(a2) += [(0.992x0.03) + (0.99x0.97)]x0.5 ++ [(0.008x0.03) + (0.01x0.97)]x0.5 = 0.5 +λAlarm(b2) += [p(a1|b2,f1).πAlarm(f1) + p(a1|b2,f2).πAlarm(f2)].λ(a1) ++ [p(a2|b2,f1).πAlarm(f1) + p(a2|b2,f2).πAlarm(f2)].λ(a2) += [(0.2x0.03) + (0.003x0.97)]x0.5 ++ [(0.8x0.03) + (0.997x0.97)]x0.5 = 0.5 + +λ message Alarm --> FreightTruck +λAlarm(f1) += [p(a1|b1,f1).πAlarm(b1) + p(a1|b2,f1).πAlarm(b2)].λ(a1) ++ [p(a2|b1,f1).πAlarm(b1) + p(a2|b2,f1).πAlarm(b2)].λ(a2) += [(0.992x0.005) + (0.2x0.995)]x0.5 ++ [(0.008x0.005) + (0.8x0.995)]x0.5 = 0.5 +λAlarm(f2) += [p(a1|b1,f2).πAlarm(b1) + p(a1|b2,f2).πAlarm(b2)].λ(a1) ++ [p(a2|b1,f2).πAlarm(b1) + p(a2|b2,f2).πAlarm(b2)].λ(a2) += [(0.99x0.005) + (0.003x0.995)]x0.5 ++ [(0.01x0.005) + (0.997x0.995)]x0.5 = 0.5 + +λ message _Jn --> FreightTruck +λ_Jn(f1) += [p(_jn0|f1,a1).π_Jn(a1) + p(_jn0|f1,a2).π_Jn(a2)].λ(_jn0) ++ [p(_jn1|f1,a1).π_Jn(a1) + p(_jn1|f1,a2).π_Jn(a2)].λ(_jn1) ++ [p(_jn2|f1,a1).π_Jn(a1) + p(_jn2|f1,a2).π_Jn(a2)].λ(_jn2) ++ [p(_jn3|f1,a1).π_Jn(a1) + p(_jn3|f1,a2).π_Jn(a2)].λ(_jn3) += [(1x0.0138158) + (0x0.986184)]x1 ++ [(0x0.0138158) + (1x0.986184)]x1 ++ [(0x0.0138158) + (0x0.986184)]x1 ++ [(0x0.0138158) + (0x0.986184)]x1 = 1 +λ_Jn(f2) += [p(_jn0|f2,a1).π_Jn(a1) + p(_jn0|f2,a2).π_Jn(a2)].λ(_jn0) ++ [p(_jn1|f2,a1).π_Jn(a1) + p(_jn1|f2,a2).π_Jn(a2)].λ(_jn1) ++ [p(_jn2|f2,a1).π_Jn(a1) + p(_jn2|f2,a2).π_Jn(a2)].λ(_jn2) ++ [p(_jn3|f2,a1).π_Jn(a1) + p(_jn3|f2,a2).π_Jn(a2)].λ(_jn3) += [(0x0.0138158) + (0x0.986184)]x1 ++ [(0x0.0138158) + (0x0.986184)]x1 ++ [(1x0.0138158) + (0x0.986184)]x1 ++ [(0x0.0138158) + (1x0.986184)]x1 = 1 + +λ message _Jn --> Alarm +λ_Jn(a1) += [p(_jn0|f1,a1).π_Jn(f1) + p(_jn0|f2,a1).π_Jn(f2)].λ(_jn0) ++ [p(_jn1|f1,a1).π_Jn(f1) + p(_jn1|f2,a1).π_Jn(f2)].λ(_jn1) ++ [p(_jn2|f1,a1).π_Jn(f1) + p(_jn2|f2,a1).π_Jn(f2)].λ(_jn2) ++ [p(_jn3|f1,a1).π_Jn(f1) + p(_jn3|f2,a1).π_Jn(f2)].λ(_jn3) += [(1x0.03) + (0x0.97)]x1 ++ [(0x0.03) + (0x0.97)]x1 ++ [(0x0.03) + (1x0.97)]x1 ++ [(0x0.03) + (0x0.97)]x1 = 1 +λ_Jn(a2) += [p(_jn0|f1,a2).π_Jn(f1) + p(_jn0|f2,a2).π_Jn(f2)].λ(_jn0) ++ [p(_jn1|f1,a2).π_Jn(f1) + p(_jn1|f2,a2).π_Jn(f2)].λ(_jn1) ++ [p(_jn2|f1,a2).π_Jn(f1) + p(_jn2|f2,a2).π_Jn(f2)].λ(_jn2) ++ [p(_jn3|f1,a2).π_Jn(f1) + p(_jn3|f2,a2).π_Jn(f2)].λ(_jn3) += [(0x0.03) + (0x0.97)]x1 ++ [(1x0.03) + (0x0.97)]x1 ++ [(0x0.03) + (0x0.97)]x1 ++ [(0x0.03) + (1x0.97)]x1 = 1 + +π message Burglar --> Alarm +πAlarm(b1) = π(b1) = 0.005 = 0.005 +πAlarm(b2) = π(b2) = 0.995 = 0.995 + +π message FreightTruck --> Alarm +πAlarm(f1) = π(f1).λ_Jn(f1) = 0.03 x 0.5 = 0.015 +πAlarm(f2) = π(f2).λ_Jn(f2) = 0.97 x 0.5 = 0.485 + +π message FreightTruck --> _Jn +π_Jn(f1) = π(f1).λAlarm(f1) = 0.03 x 0.5 = 0.015 +π_Jn(f2) = π(f2).λAlarm(f2) = 0.97 x 0.5 = 0.485 + +π message Alarm --> _Jn +π_Jn(a1) = π(a1) = 0.0138158 = 0.0138157537 +π_Jn(a2) = π(a2) = 0.986184 = 0.9861842463 + +var Burglar: +π(b1) += p(b1) += (0.005) = 0.005 +π(b2) += p(b2) += (0.995) = 0.995 +λ(b1) = λAlarm(b1) = 0.5 = 0.5 +λ(b2) = λAlarm(b2) = 0.5 = 0.5 +belief change = 0 + +var FreightTruck: +π(f1) += p(f1) += (0.03) = 0.03 +π(f2) += p(f2) += (0.97) = 0.97 +λ(f1) = λAlarm(f1).λ_Jn(f1) = 0.5 x 0.5 = 0.25 +λ(f2) = λAlarm(f2).λ_Jn(f2) = 0.5 x 0.5 = 0.25 +belief change = 0 + +var Alarm: +π(a1) += p(a1|b1,f1).πAlarm(b1).πAlarm(f1) ++ p(a1|b1,f2).πAlarm(b1).πAlarm(f2) ++ p(a1|b2,f1).πAlarm(b2).πAlarm(f1) ++ p(a1|b2,f2).πAlarm(b2).πAlarm(f2) += (0.992x0.005x0.03) ++ (0.99x0.005x0.97) ++ (0.2x0.995x0.03) ++ (0.003x0.995x0.97) = 0.01381575247 +π(a2) += p(a2|b1,f1).πAlarm(b1).πAlarm(f1) ++ p(a2|b1,f2).πAlarm(b1).πAlarm(f2) ++ p(a2|b2,f1).πAlarm(b2).πAlarm(f1) ++ p(a2|b2,f2).πAlarm(b2).πAlarm(f2) += (0.008x0.005x0.03) ++ (0.01x0.005x0.97) ++ (0.8x0.995x0.03) ++ (0.997x0.995x0.97) = 0.9861842475 +λ(a1) = λ_Jn(a1) = 0.5 = 0.5 +λ(a2) = λ_Jn(a2) = 0.5 = 0.5 +belief change = 2.46890635e-09 + +var _Jn: +π(_jn0) += p(_jn0|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn0|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn0|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn0|f2,a2).π_Jn(f2).π_Jn(a2) += (1x0.03x0.0138158) ++ (0x0.03x0.986184) ++ (0x0.97x0.0138158) ++ (0x0.97x0.986184) = 0.0004144728963 +π(_jn1) += p(_jn1|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn1|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn1|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn1|f2,a2).π_Jn(f2).π_Jn(a2) += (0x0.03x0.0138158) ++ (1x0.03x0.986184) ++ (0x0.97x0.0138158) ++ (0x0.97x0.986184) = 0.0295855397 +π(_jn2) += p(_jn2|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn2|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn2|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn2|f2,a2).π_Jn(f2).π_Jn(a2) += (0x0.03x0.0138158) ++ (0x0.03x0.986184) ++ (1x0.97x0.0138158) ++ (0x0.97x0.986184) = 0.01340128451 +π(_jn3) += p(_jn3|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn3|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn3|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn3|f2,a2).π_Jn(f2).π_Jn(a2) += (0x0.03x0.0138158) ++ (0x0.03x0.986184) ++ (0x0.97x0.0138158) ++ (1x0.97x0.986184) = 0.9565987029 +λ(_jn0) = 1 +λ(_jn1) = 1 +λ(_jn2) = 1 +λ(_jn3) = 1 +belief change = 1.960888467e-08 + +domain π(Burglar) λ(Burglar) belief +---------------------------------------------------------------- +b1 0.005 0.5 0.005 +b2 0.995 0.5 0.995 + +domain πAlarm(Burglar) λAlarm(Burglar) +---------------------------------------------------------------- +b1 0.005 0.5 +b2 0.995 0.5 + +domain π(FreightTruck) λ(FreightTruck) belief +---------------------------------------------------------------- +f1 0.03 0.25 0.03 +f2 0.97 0.25 0.97 + +domain πAlarm(FreightTruck) λAlarm(FreightTruck) +---------------------------------------------------------------- +f1 0.03000001259 0.5 +f2 0.9699999874 0.5 + +domain π_Jn(FreightTruck) λ_Jn(FreightTruck) +---------------------------------------------------------------- +f1 0.03000001259 0.5 +f2 0.9699999874 0.5 + +domain π(Alarm) λ(Alarm) belief +---------------------------------------------------------------- +a1 0.01381575247 0.5 0.01381575247 +a2 0.9861842475 0.5 0.9861842475 + +domain π_Jn(Alarm) λ_Jn(Alarm) +---------------------------------------------------------------- +a1 0.01381575741 0.5 +a2 0.9861842426 0.5 + +domain π(_Jn) λ(_Jn) belief +---------------------------------------------------------------- +_jn0 0.0004144728963 1 0.0004144728963 +_jn1 0.0295855397 1 0.0295855397 +_jn2 0.01340128451 1 0.01340128451 +_jn3 0.9565987029 1 0.9565987029 + + + +******************************************************************************** + Iteration 44 +******************************************************************************** +λ message Alarm --> Burglar +λAlarm(b1) += [p(a1|b1,f1).πAlarm(f1) + p(a1|b1,f2).πAlarm(f2)].λ(a1) ++ [p(a2|b1,f1).πAlarm(f1) + p(a2|b1,f2).πAlarm(f2)].λ(a2) += [(0.992x0.03) + (0.99x0.97)]x0.5 ++ [(0.008x0.03) + (0.01x0.97)]x0.5 = 0.5 +λAlarm(b2) += [p(a1|b2,f1).πAlarm(f1) + p(a1|b2,f2).πAlarm(f2)].λ(a1) ++ [p(a2|b2,f1).πAlarm(f1) + p(a2|b2,f2).πAlarm(f2)].λ(a2) += [(0.2x0.03) + (0.003x0.97)]x0.5 ++ [(0.8x0.03) + (0.997x0.97)]x0.5 = 0.5 + +λ message Alarm --> FreightTruck +λAlarm(f1) += [p(a1|b1,f1).πAlarm(b1) + p(a1|b2,f1).πAlarm(b2)].λ(a1) ++ [p(a2|b1,f1).πAlarm(b1) + p(a2|b2,f1).πAlarm(b2)].λ(a2) += [(0.992x0.005) + (0.2x0.995)]x0.5 ++ [(0.008x0.005) + (0.8x0.995)]x0.5 = 0.5 +λAlarm(f2) += [p(a1|b1,f2).πAlarm(b1) + p(a1|b2,f2).πAlarm(b2)].λ(a1) ++ [p(a2|b1,f2).πAlarm(b1) + p(a2|b2,f2).πAlarm(b2)].λ(a2) += [(0.99x0.005) + (0.003x0.995)]x0.5 ++ [(0.01x0.005) + (0.997x0.995)]x0.5 = 0.5 + +λ message _Jn --> FreightTruck +λ_Jn(f1) += [p(_jn0|f1,a1).π_Jn(a1) + p(_jn0|f1,a2).π_Jn(a2)].λ(_jn0) ++ [p(_jn1|f1,a1).π_Jn(a1) + p(_jn1|f1,a2).π_Jn(a2)].λ(_jn1) ++ [p(_jn2|f1,a1).π_Jn(a1) + p(_jn2|f1,a2).π_Jn(a2)].λ(_jn2) ++ [p(_jn3|f1,a1).π_Jn(a1) + p(_jn3|f1,a2).π_Jn(a2)].λ(_jn3) += [(1x0.0138158) + (0x0.986184)]x1 ++ [(0x0.0138158) + (1x0.986184)]x1 ++ [(0x0.0138158) + (0x0.986184)]x1 ++ [(0x0.0138158) + (0x0.986184)]x1 = 1 +λ_Jn(f2) += [p(_jn0|f2,a1).π_Jn(a1) + p(_jn0|f2,a2).π_Jn(a2)].λ(_jn0) ++ [p(_jn1|f2,a1).π_Jn(a1) + p(_jn1|f2,a2).π_Jn(a2)].λ(_jn1) ++ [p(_jn2|f2,a1).π_Jn(a1) + p(_jn2|f2,a2).π_Jn(a2)].λ(_jn2) ++ [p(_jn3|f2,a1).π_Jn(a1) + p(_jn3|f2,a2).π_Jn(a2)].λ(_jn3) += [(0x0.0138158) + (0x0.986184)]x1 ++ [(0x0.0138158) + (0x0.986184)]x1 ++ [(1x0.0138158) + (0x0.986184)]x1 ++ [(0x0.0138158) + (1x0.986184)]x1 = 1 + +λ message _Jn --> Alarm +λ_Jn(a1) += [p(_jn0|f1,a1).π_Jn(f1) + p(_jn0|f2,a1).π_Jn(f2)].λ(_jn0) ++ [p(_jn1|f1,a1).π_Jn(f1) + p(_jn1|f2,a1).π_Jn(f2)].λ(_jn1) ++ [p(_jn2|f1,a1).π_Jn(f1) + p(_jn2|f2,a1).π_Jn(f2)].λ(_jn2) ++ [p(_jn3|f1,a1).π_Jn(f1) + p(_jn3|f2,a1).π_Jn(f2)].λ(_jn3) += [(1x0.03) + (0x0.97)]x1 ++ [(0x0.03) + (0x0.97)]x1 ++ [(0x0.03) + (1x0.97)]x1 ++ [(0x0.03) + (0x0.97)]x1 = 1 +λ_Jn(a2) += [p(_jn0|f1,a2).π_Jn(f1) + p(_jn0|f2,a2).π_Jn(f2)].λ(_jn0) ++ [p(_jn1|f1,a2).π_Jn(f1) + p(_jn1|f2,a2).π_Jn(f2)].λ(_jn1) ++ [p(_jn2|f1,a2).π_Jn(f1) + p(_jn2|f2,a2).π_Jn(f2)].λ(_jn2) ++ [p(_jn3|f1,a2).π_Jn(f1) + p(_jn3|f2,a2).π_Jn(f2)].λ(_jn3) += [(0x0.03) + (0x0.97)]x1 ++ [(1x0.03) + (0x0.97)]x1 ++ [(0x0.03) + (0x0.97)]x1 ++ [(0x0.03) + (1x0.97)]x1 = 1 + +π message Burglar --> Alarm +πAlarm(b1) = π(b1) = 0.005 = 0.005 +πAlarm(b2) = π(b2) = 0.995 = 0.995 + +π message FreightTruck --> Alarm +πAlarm(f1) = π(f1).λ_Jn(f1) = 0.03 x 0.5 = 0.015 +πAlarm(f2) = π(f2).λ_Jn(f2) = 0.97 x 0.5 = 0.485 + +π message FreightTruck --> _Jn +π_Jn(f1) = π(f1).λAlarm(f1) = 0.03 x 0.5 = 0.015 +π_Jn(f2) = π(f2).λAlarm(f2) = 0.97 x 0.5 = 0.485 + +π message Alarm --> _Jn +π_Jn(a1) = π(a1) = 0.0138158 = 0.01381575247 +π_Jn(a2) = π(a2) = 0.986184 = 0.9861842475 + +var Burglar: +π(b1) += p(b1) += (0.005) = 0.005 +π(b2) += p(b2) += (0.995) = 0.995 +λ(b1) = λAlarm(b1) = 0.5 = 0.5 +λ(b2) = λAlarm(b2) = 0.5 = 0.5 +belief change = 0 + +var FreightTruck: +π(f1) += p(f1) += (0.03) = 0.03 +π(f2) += p(f2) += (0.97) = 0.97 +λ(f1) = λAlarm(f1).λ_Jn(f1) = 0.5 x 0.5 = 0.25 +λ(f2) = λAlarm(f2).λ_Jn(f2) = 0.5 x 0.5 = 0.25 +belief change = 0 + +var Alarm: +π(a1) += p(a1|b1,f1).πAlarm(b1).πAlarm(f1) ++ p(a1|b1,f2).πAlarm(b1).πAlarm(f2) ++ p(a1|b2,f1).πAlarm(b2).πAlarm(f1) ++ p(a1|b2,f2).πAlarm(b2).πAlarm(f2) += (0.992x0.005x0.03) ++ (0.99x0.005x0.97) ++ (0.2x0.995x0.03) ++ (0.003x0.995x0.97) = 0.01381575165 +π(a2) += p(a2|b1,f1).πAlarm(b1).πAlarm(f1) ++ p(a2|b1,f2).πAlarm(b1).πAlarm(f2) ++ p(a2|b2,f1).πAlarm(b2).πAlarm(f1) ++ p(a2|b2,f2).πAlarm(b2).πAlarm(f2) += (0.008x0.005x0.03) ++ (0.01x0.005x0.97) ++ (0.8x0.995x0.03) ++ (0.997x0.995x0.97) = 0.9861842484 +λ(a1) = λ_Jn(a1) = 0.5 = 0.5 +λ(a2) = λ_Jn(a2) = 0.5 = 0.5 +belief change = 1.645919151e-09 + +var _Jn: +π(_jn0) += p(_jn0|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn0|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn0|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn0|f2,a2).π_Jn(f2).π_Jn(a2) += (1x0.03x0.0138158) ++ (0x0.03x0.986184) ++ (0x0.97x0.0138158) ++ (0x0.97x0.986184) = 0.0004144727642 +π(_jn1) += p(_jn1|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn1|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn1|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn1|f2,a2).π_Jn(f2).π_Jn(a2) += (0x0.03x0.0138158) ++ (1x0.03x0.986184) ++ (0x0.97x0.0138158) ++ (0x0.97x0.986184) = 0.02958553563 +π(_jn2) += p(_jn2|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn2|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn2|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn2|f2,a2).π_Jn(f2).π_Jn(a2) += (0x0.03x0.0138158) ++ (0x0.03x0.986184) ++ (1x0.97x0.0138158) ++ (0x0.97x0.986184) = 0.01340128217 +π(_jn3) += p(_jn3|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn3|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn3|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn3|f2,a2).π_Jn(f2).π_Jn(a2) += (0x0.03x0.0138158) ++ (0x0.03x0.986184) ++ (0x0.97x0.0138158) ++ (1x0.97x0.986184) = 0.9565987094 +λ(_jn0) = 1 +λ(_jn1) = 1 +λ(_jn2) = 1 +λ(_jn3) = 1 +belief change = 1.307191058e-08 + +domain π(Burglar) λ(Burglar) belief +---------------------------------------------------------------- +b1 0.005 0.5 0.005 +b2 0.995 0.5 0.995 + +domain πAlarm(Burglar) λAlarm(Burglar) +---------------------------------------------------------------- +b1 0.005 0.5 +b2 0.995 0.5 + +domain π(FreightTruck) λ(FreightTruck) belief +---------------------------------------------------------------- +f1 0.03 0.25 0.03 +f2 0.97 0.25 0.97 + +domain πAlarm(FreightTruck) λAlarm(FreightTruck) +---------------------------------------------------------------- +f1 0.0300000084 0.5 +f2 0.9699999916 0.5 + +domain π_Jn(FreightTruck) λ_Jn(FreightTruck) +---------------------------------------------------------------- +f1 0.0300000084 0.5 +f2 0.9699999916 0.5 + +domain π(Alarm) λ(Alarm) belief +---------------------------------------------------------------- +a1 0.01381575165 0.5 0.01381575165 +a2 0.9861842484 0.5 0.9861842484 + +domain π_Jn(Alarm) λ_Jn(Alarm) +---------------------------------------------------------------- +a1 0.01381575494 0.5 +a2 0.9861842451 0.5 + +domain π(_Jn) λ(_Jn) belief +---------------------------------------------------------------- +_jn0 0.0004144727642 1 0.0004144727642 +_jn1 0.02958553563 1 0.02958553563 +_jn2 0.01340128217 1 0.01340128217 +_jn3 0.9565987094 1 0.9565987094 + + + +******************************************************************************** + Iteration 45 +******************************************************************************** +λ message Alarm --> Burglar +λAlarm(b1) += [p(a1|b1,f1).πAlarm(f1) + p(a1|b1,f2).πAlarm(f2)].λ(a1) ++ [p(a2|b1,f1).πAlarm(f1) + p(a2|b1,f2).πAlarm(f2)].λ(a2) += [(0.992x0.03) + (0.99x0.97)]x0.5 ++ [(0.008x0.03) + (0.01x0.97)]x0.5 = 0.5 +λAlarm(b2) += [p(a1|b2,f1).πAlarm(f1) + p(a1|b2,f2).πAlarm(f2)].λ(a1) ++ [p(a2|b2,f1).πAlarm(f1) + p(a2|b2,f2).πAlarm(f2)].λ(a2) += [(0.2x0.03) + (0.003x0.97)]x0.5 ++ [(0.8x0.03) + (0.997x0.97)]x0.5 = 0.5 + +λ message Alarm --> FreightTruck +λAlarm(f1) += [p(a1|b1,f1).πAlarm(b1) + p(a1|b2,f1).πAlarm(b2)].λ(a1) ++ [p(a2|b1,f1).πAlarm(b1) + p(a2|b2,f1).πAlarm(b2)].λ(a2) += [(0.992x0.005) + (0.2x0.995)]x0.5 ++ [(0.008x0.005) + (0.8x0.995)]x0.5 = 0.5 +λAlarm(f2) += [p(a1|b1,f2).πAlarm(b1) + p(a1|b2,f2).πAlarm(b2)].λ(a1) ++ [p(a2|b1,f2).πAlarm(b1) + p(a2|b2,f2).πAlarm(b2)].λ(a2) += [(0.99x0.005) + (0.003x0.995)]x0.5 ++ [(0.01x0.005) + (0.997x0.995)]x0.5 = 0.5 + +λ message _Jn --> FreightTruck +λ_Jn(f1) += [p(_jn0|f1,a1).π_Jn(a1) + p(_jn0|f1,a2).π_Jn(a2)].λ(_jn0) ++ [p(_jn1|f1,a1).π_Jn(a1) + p(_jn1|f1,a2).π_Jn(a2)].λ(_jn1) ++ [p(_jn2|f1,a1).π_Jn(a1) + p(_jn2|f1,a2).π_Jn(a2)].λ(_jn2) ++ [p(_jn3|f1,a1).π_Jn(a1) + p(_jn3|f1,a2).π_Jn(a2)].λ(_jn3) += [(1x0.0138158) + (0x0.986184)]x1 ++ [(0x0.0138158) + (1x0.986184)]x1 ++ [(0x0.0138158) + (0x0.986184)]x1 ++ [(0x0.0138158) + (0x0.986184)]x1 = 1 +λ_Jn(f2) += [p(_jn0|f2,a1).π_Jn(a1) + p(_jn0|f2,a2).π_Jn(a2)].λ(_jn0) ++ [p(_jn1|f2,a1).π_Jn(a1) + p(_jn1|f2,a2).π_Jn(a2)].λ(_jn1) ++ [p(_jn2|f2,a1).π_Jn(a1) + p(_jn2|f2,a2).π_Jn(a2)].λ(_jn2) ++ [p(_jn3|f2,a1).π_Jn(a1) + p(_jn3|f2,a2).π_Jn(a2)].λ(_jn3) += [(0x0.0138158) + (0x0.986184)]x1 ++ [(0x0.0138158) + (0x0.986184)]x1 ++ [(1x0.0138158) + (0x0.986184)]x1 ++ [(0x0.0138158) + (1x0.986184)]x1 = 1 + +λ message _Jn --> Alarm +λ_Jn(a1) += [p(_jn0|f1,a1).π_Jn(f1) + p(_jn0|f2,a1).π_Jn(f2)].λ(_jn0) ++ [p(_jn1|f1,a1).π_Jn(f1) + p(_jn1|f2,a1).π_Jn(f2)].λ(_jn1) ++ [p(_jn2|f1,a1).π_Jn(f1) + p(_jn2|f2,a1).π_Jn(f2)].λ(_jn2) ++ [p(_jn3|f1,a1).π_Jn(f1) + p(_jn3|f2,a1).π_Jn(f2)].λ(_jn3) += [(1x0.03) + (0x0.97)]x1 ++ [(0x0.03) + (0x0.97)]x1 ++ [(0x0.03) + (1x0.97)]x1 ++ [(0x0.03) + (0x0.97)]x1 = 1 +λ_Jn(a2) += [p(_jn0|f1,a2).π_Jn(f1) + p(_jn0|f2,a2).π_Jn(f2)].λ(_jn0) ++ [p(_jn1|f1,a2).π_Jn(f1) + p(_jn1|f2,a2).π_Jn(f2)].λ(_jn1) ++ [p(_jn2|f1,a2).π_Jn(f1) + p(_jn2|f2,a2).π_Jn(f2)].λ(_jn2) ++ [p(_jn3|f1,a2).π_Jn(f1) + p(_jn3|f2,a2).π_Jn(f2)].λ(_jn3) += [(0x0.03) + (0x0.97)]x1 ++ [(1x0.03) + (0x0.97)]x1 ++ [(0x0.03) + (0x0.97)]x1 ++ [(0x0.03) + (1x0.97)]x1 = 1 + +π message Burglar --> Alarm +πAlarm(b1) = π(b1) = 0.005 = 0.005 +πAlarm(b2) = π(b2) = 0.995 = 0.995 + +π message FreightTruck --> Alarm +πAlarm(f1) = π(f1).λ_Jn(f1) = 0.03 x 0.5 = 0.015 +πAlarm(f2) = π(f2).λ_Jn(f2) = 0.97 x 0.5 = 0.485 + +π message FreightTruck --> _Jn +π_Jn(f1) = π(f1).λAlarm(f1) = 0.03 x 0.5 = 0.015 +π_Jn(f2) = π(f2).λAlarm(f2) = 0.97 x 0.5 = 0.485 + +π message Alarm --> _Jn +π_Jn(a1) = π(a1) = 0.0138158 = 0.01381575165 +π_Jn(a2) = π(a2) = 0.986184 = 0.9861842484 + +var Burglar: +π(b1) += p(b1) += (0.005) = 0.005 +π(b2) += p(b2) += (0.995) = 0.995 +λ(b1) = λAlarm(b1) = 0.5 = 0.5 +λ(b2) = λAlarm(b2) = 0.5 = 0.5 +belief change = 0 + +var FreightTruck: +π(f1) += p(f1) += (0.03) = 0.03 +π(f2) += p(f2) += (0.97) = 0.97 +λ(f1) = λAlarm(f1).λ_Jn(f1) = 0.5 x 0.5 = 0.25 +λ(f2) = λAlarm(f2).λ_Jn(f2) = 0.5 x 0.5 = 0.25 +belief change = 0 + +var Alarm: +π(a1) += p(a1|b1,f1).πAlarm(b1).πAlarm(f1) ++ p(a1|b1,f2).πAlarm(b1).πAlarm(f2) ++ p(a1|b2,f1).πAlarm(b2).πAlarm(f1) ++ p(a1|b2,f2).πAlarm(b2).πAlarm(f2) += (0.992x0.005x0.03) ++ (0.99x0.005x0.97) ++ (0.2x0.995x0.03) ++ (0.003x0.995x0.97) = 0.0138157511 +π(a2) += p(a2|b1,f1).πAlarm(b1).πAlarm(f1) ++ p(a2|b1,f2).πAlarm(b1).πAlarm(f2) ++ p(a2|b2,f1).πAlarm(b2).πAlarm(f1) ++ p(a2|b2,f2).πAlarm(b2).πAlarm(f2) += (0.008x0.005x0.03) ++ (0.01x0.005x0.97) ++ (0.8x0.995x0.03) ++ (0.997x0.995x0.97) = 0.9861842489 +λ(a1) = λ_Jn(a1) = 0.5 = 0.5 +λ(a2) = λ_Jn(a2) = 0.5 = 0.5 +belief change = 1.097270131e-09 + +var _Jn: +π(_jn0) += p(_jn0|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn0|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn0|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn0|f2,a2).π_Jn(f2).π_Jn(a2) += (1x0.03x0.0138158) ++ (0x0.03x0.986184) ++ (0x0.97x0.0138158) ++ (0x0.97x0.986184) = 0.0004144726761 +π(_jn1) += p(_jn1|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn1|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn1|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn1|f2,a2).π_Jn(f2).π_Jn(a2) += (0x0.03x0.0138158) ++ (1x0.03x0.986184) ++ (0x0.97x0.0138158) ++ (0x0.97x0.986184) = 0.02958553292 +π(_jn2) += p(_jn2|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn2|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn2|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn2|f2,a2).π_Jn(f2).π_Jn(a2) += (0x0.03x0.0138158) ++ (0x0.03x0.986184) ++ (1x0.97x0.0138158) ++ (0x0.97x0.986184) = 0.01340128062 +π(_jn3) += p(_jn3|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn3|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn3|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn3|f2,a2).π_Jn(f2).π_Jn(a2) += (0x0.03x0.0138158) ++ (0x0.03x0.986184) ++ (0x0.97x0.0138158) ++ (1x0.97x0.986184) = 0.9565987138 +λ(_jn0) = 1 +λ(_jn1) = 1 +λ(_jn2) = 1 +λ(_jn3) = 1 +belief change = 8.714258307e-09 + +domain π(Burglar) λ(Burglar) belief +---------------------------------------------------------------- +b1 0.005 0.5 0.005 +b2 0.995 0.5 0.995 + +domain πAlarm(Burglar) λAlarm(Burglar) +---------------------------------------------------------------- +b1 0.005 0.5 +b2 0.995 0.5 + +domain π(FreightTruck) λ(FreightTruck) belief +---------------------------------------------------------------- +f1 0.03 0.25 0.03 +f2 0.97 0.25 0.97 + +domain πAlarm(FreightTruck) λAlarm(FreightTruck) +---------------------------------------------------------------- +f1 0.0300000056 0.5 +f2 0.9699999944 0.5 + +domain π_Jn(FreightTruck) λ_Jn(FreightTruck) +---------------------------------------------------------------- +f1 0.0300000056 0.5 +f2 0.9699999944 0.5 + +domain π(Alarm) λ(Alarm) belief +---------------------------------------------------------------- +a1 0.0138157511 0.5 0.0138157511 +a2 0.9861842489 0.5 0.9861842489 + +domain π_Jn(Alarm) λ_Jn(Alarm) +---------------------------------------------------------------- +a1 0.01381575329 0.5 +a2 0.9861842467 0.5 + +domain π(_Jn) λ(_Jn) belief +---------------------------------------------------------------- +_jn0 0.0004144726761 1 0.0004144726761 +_jn1 0.02958553292 1 0.02958553292 +_jn2 0.01340128062 1 0.01340128062 +_jn3 0.9565987138 1 0.9565987138 + + + +******************************************************************************** + Iteration 46 +******************************************************************************** +λ message Alarm --> Burglar +λAlarm(b1) += [p(a1|b1,f1).πAlarm(f1) + p(a1|b1,f2).πAlarm(f2)].λ(a1) ++ [p(a2|b1,f1).πAlarm(f1) + p(a2|b1,f2).πAlarm(f2)].λ(a2) += [(0.992x0.03) + (0.99x0.97)]x0.5 ++ [(0.008x0.03) + (0.01x0.97)]x0.5 = 0.5 +λAlarm(b2) += [p(a1|b2,f1).πAlarm(f1) + p(a1|b2,f2).πAlarm(f2)].λ(a1) ++ [p(a2|b2,f1).πAlarm(f1) + p(a2|b2,f2).πAlarm(f2)].λ(a2) += [(0.2x0.03) + (0.003x0.97)]x0.5 ++ [(0.8x0.03) + (0.997x0.97)]x0.5 = 0.5 + +λ message Alarm --> FreightTruck +λAlarm(f1) += [p(a1|b1,f1).πAlarm(b1) + p(a1|b2,f1).πAlarm(b2)].λ(a1) ++ [p(a2|b1,f1).πAlarm(b1) + p(a2|b2,f1).πAlarm(b2)].λ(a2) += [(0.992x0.005) + (0.2x0.995)]x0.5 ++ [(0.008x0.005) + (0.8x0.995)]x0.5 = 0.5 +λAlarm(f2) += [p(a1|b1,f2).πAlarm(b1) + p(a1|b2,f2).πAlarm(b2)].λ(a1) ++ [p(a2|b1,f2).πAlarm(b1) + p(a2|b2,f2).πAlarm(b2)].λ(a2) += [(0.99x0.005) + (0.003x0.995)]x0.5 ++ [(0.01x0.005) + (0.997x0.995)]x0.5 = 0.5 + +λ message _Jn --> FreightTruck +λ_Jn(f1) += [p(_jn0|f1,a1).π_Jn(a1) + p(_jn0|f1,a2).π_Jn(a2)].λ(_jn0) ++ [p(_jn1|f1,a1).π_Jn(a1) + p(_jn1|f1,a2).π_Jn(a2)].λ(_jn1) ++ [p(_jn2|f1,a1).π_Jn(a1) + p(_jn2|f1,a2).π_Jn(a2)].λ(_jn2) ++ [p(_jn3|f1,a1).π_Jn(a1) + p(_jn3|f1,a2).π_Jn(a2)].λ(_jn3) += [(1x0.0138158) + (0x0.986184)]x1 ++ [(0x0.0138158) + (1x0.986184)]x1 ++ [(0x0.0138158) + (0x0.986184)]x1 ++ [(0x0.0138158) + (0x0.986184)]x1 = 1 +λ_Jn(f2) += [p(_jn0|f2,a1).π_Jn(a1) + p(_jn0|f2,a2).π_Jn(a2)].λ(_jn0) ++ [p(_jn1|f2,a1).π_Jn(a1) + p(_jn1|f2,a2).π_Jn(a2)].λ(_jn1) ++ [p(_jn2|f2,a1).π_Jn(a1) + p(_jn2|f2,a2).π_Jn(a2)].λ(_jn2) ++ [p(_jn3|f2,a1).π_Jn(a1) + p(_jn3|f2,a2).π_Jn(a2)].λ(_jn3) += [(0x0.0138158) + (0x0.986184)]x1 ++ [(0x0.0138158) + (0x0.986184)]x1 ++ [(1x0.0138158) + (0x0.986184)]x1 ++ [(0x0.0138158) + (1x0.986184)]x1 = 1 + +λ message _Jn --> Alarm +λ_Jn(a1) += [p(_jn0|f1,a1).π_Jn(f1) + p(_jn0|f2,a1).π_Jn(f2)].λ(_jn0) ++ [p(_jn1|f1,a1).π_Jn(f1) + p(_jn1|f2,a1).π_Jn(f2)].λ(_jn1) ++ [p(_jn2|f1,a1).π_Jn(f1) + p(_jn2|f2,a1).π_Jn(f2)].λ(_jn2) ++ [p(_jn3|f1,a1).π_Jn(f1) + p(_jn3|f2,a1).π_Jn(f2)].λ(_jn3) += [(1x0.03) + (0x0.97)]x1 ++ [(0x0.03) + (0x0.97)]x1 ++ [(0x0.03) + (1x0.97)]x1 ++ [(0x0.03) + (0x0.97)]x1 = 1 +λ_Jn(a2) += [p(_jn0|f1,a2).π_Jn(f1) + p(_jn0|f2,a2).π_Jn(f2)].λ(_jn0) ++ [p(_jn1|f1,a2).π_Jn(f1) + p(_jn1|f2,a2).π_Jn(f2)].λ(_jn1) ++ [p(_jn2|f1,a2).π_Jn(f1) + p(_jn2|f2,a2).π_Jn(f2)].λ(_jn2) ++ [p(_jn3|f1,a2).π_Jn(f1) + p(_jn3|f2,a2).π_Jn(f2)].λ(_jn3) += [(0x0.03) + (0x0.97)]x1 ++ [(1x0.03) + (0x0.97)]x1 ++ [(0x0.03) + (0x0.97)]x1 ++ [(0x0.03) + (1x0.97)]x1 = 1 + +π message Burglar --> Alarm +πAlarm(b1) = π(b1) = 0.005 = 0.005 +πAlarm(b2) = π(b2) = 0.995 = 0.995 + +π message FreightTruck --> Alarm +πAlarm(f1) = π(f1).λ_Jn(f1) = 0.03 x 0.5 = 0.015 +πAlarm(f2) = π(f2).λ_Jn(f2) = 0.97 x 0.5 = 0.485 + +π message FreightTruck --> _Jn +π_Jn(f1) = π(f1).λAlarm(f1) = 0.03 x 0.5 = 0.015 +π_Jn(f2) = π(f2).λAlarm(f2) = 0.97 x 0.5 = 0.485 + +π message Alarm --> _Jn +π_Jn(a1) = π(a1) = 0.0138158 = 0.0138157511 +π_Jn(a2) = π(a2) = 0.986184 = 0.9861842489 + +var Burglar: +π(b1) += p(b1) += (0.005) = 0.005 +π(b2) += p(b2) += (0.995) = 0.995 +λ(b1) = λAlarm(b1) = 0.5 = 0.5 +λ(b2) = λAlarm(b2) = 0.5 = 0.5 +belief change = 0 + +var FreightTruck: +π(f1) += p(f1) += (0.03) = 0.03 +π(f2) += p(f2) += (0.97) = 0.97 +λ(f1) = λAlarm(f1).λ_Jn(f1) = 0.5 x 0.5 = 0.25 +λ(f2) = λAlarm(f2).λ_Jn(f2) = 0.5 x 0.5 = 0.25 +belief change = 0 + +var Alarm: +π(a1) += p(a1|b1,f1).πAlarm(b1).πAlarm(f1) ++ p(a1|b1,f2).πAlarm(b1).πAlarm(f2) ++ p(a1|b2,f1).πAlarm(b2).πAlarm(f1) ++ p(a1|b2,f2).πAlarm(b2).πAlarm(f2) += (0.992x0.005x0.03) ++ (0.99x0.005x0.97) ++ (0.2x0.995x0.03) ++ (0.003x0.995x0.97) = 0.01381575073 +π(a2) += p(a2|b1,f1).πAlarm(b1).πAlarm(f1) ++ p(a2|b1,f2).πAlarm(b1).πAlarm(f2) ++ p(a2|b2,f1).πAlarm(b2).πAlarm(f1) ++ p(a2|b2,f2).πAlarm(b2).πAlarm(f2) += (0.008x0.005x0.03) ++ (0.01x0.005x0.97) ++ (0.8x0.995x0.03) ++ (0.997x0.995x0.97) = 0.9861842493 +λ(a1) = λ_Jn(a1) = 0.5 = 0.5 +λ(a2) = λ_Jn(a2) = 0.5 = 0.5 +belief change = 7.315088656e-10 + +var _Jn: +π(_jn0) += p(_jn0|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn0|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn0|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn0|f2,a2).π_Jn(f2).π_Jn(a2) += (1x0.03x0.0138158) ++ (0x0.03x0.986184) ++ (0x0.97x0.0138158) ++ (0x0.97x0.986184) = 0.0004144726174 +π(_jn1) += p(_jn1|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn1|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn1|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn1|f2,a2).π_Jn(f2).π_Jn(a2) += (0x0.03x0.0138158) ++ (1x0.03x0.986184) ++ (0x0.97x0.0138158) ++ (0x0.97x0.986184) = 0.02958553111 +π(_jn2) += p(_jn2|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn2|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn2|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn2|f2,a2).π_Jn(f2).π_Jn(a2) += (0x0.03x0.0138158) ++ (0x0.03x0.986184) ++ (1x0.97x0.0138158) ++ (0x0.97x0.986184) = 0.01340127958 +π(_jn3) += p(_jn3|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn3|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn3|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn3|f2,a2).π_Jn(f2).π_Jn(a2) += (0x0.03x0.0138158) ++ (0x0.03x0.986184) ++ (0x0.97x0.0138158) ++ (1x0.97x0.986184) = 0.9565987167 +λ(_jn0) = 1 +λ(_jn1) = 1 +λ(_jn2) = 1 +λ(_jn3) = 1 +belief change = 5.809326921e-09 + +domain π(Burglar) λ(Burglar) belief +---------------------------------------------------------------- +b1 0.005 0.5 0.005 +b2 0.995 0.5 0.995 + +domain πAlarm(Burglar) λAlarm(Burglar) +---------------------------------------------------------------- +b1 0.005 0.5 +b2 0.995 0.5 + +domain π(FreightTruck) λ(FreightTruck) belief +---------------------------------------------------------------- +f1 0.03 0.25 0.03 +f2 0.97 0.25 0.97 + +domain πAlarm(FreightTruck) λAlarm(FreightTruck) +---------------------------------------------------------------- +f1 0.03000000373 0.5 +f2 0.9699999963 0.5 + +domain π_Jn(FreightTruck) λ_Jn(FreightTruck) +---------------------------------------------------------------- +f1 0.03000000373 0.5 +f2 0.9699999963 0.5 + +domain π(Alarm) λ(Alarm) belief +---------------------------------------------------------------- +a1 0.01381575073 0.5 0.01381575073 +a2 0.9861842493 0.5 0.9861842493 + +domain π_Jn(Alarm) λ_Jn(Alarm) +---------------------------------------------------------------- +a1 0.01381575219 0.5 +a2 0.9861842478 0.5 + +domain π(_Jn) λ(_Jn) belief +---------------------------------------------------------------- +_jn0 0.0004144726174 1 0.0004144726174 +_jn1 0.02958553111 1 0.02958553111 +_jn2 0.01340127958 1 0.01340127958 +_jn3 0.9565987167 1 0.9565987167 + + + +******************************************************************************** + Iteration 47 +******************************************************************************** +λ message Alarm --> Burglar +λAlarm(b1) += [p(a1|b1,f1).πAlarm(f1) + p(a1|b1,f2).πAlarm(f2)].λ(a1) ++ [p(a2|b1,f1).πAlarm(f1) + p(a2|b1,f2).πAlarm(f2)].λ(a2) += [(0.992x0.03) + (0.99x0.97)]x0.5 ++ [(0.008x0.03) + (0.01x0.97)]x0.5 = 0.5 +λAlarm(b2) += [p(a1|b2,f1).πAlarm(f1) + p(a1|b2,f2).πAlarm(f2)].λ(a1) ++ [p(a2|b2,f1).πAlarm(f1) + p(a2|b2,f2).πAlarm(f2)].λ(a2) += [(0.2x0.03) + (0.003x0.97)]x0.5 ++ [(0.8x0.03) + (0.997x0.97)]x0.5 = 0.5 + +λ message Alarm --> FreightTruck +λAlarm(f1) += [p(a1|b1,f1).πAlarm(b1) + p(a1|b2,f1).πAlarm(b2)].λ(a1) ++ [p(a2|b1,f1).πAlarm(b1) + p(a2|b2,f1).πAlarm(b2)].λ(a2) += [(0.992x0.005) + (0.2x0.995)]x0.5 ++ [(0.008x0.005) + (0.8x0.995)]x0.5 = 0.5 +λAlarm(f2) += [p(a1|b1,f2).πAlarm(b1) + p(a1|b2,f2).πAlarm(b2)].λ(a1) ++ [p(a2|b1,f2).πAlarm(b1) + p(a2|b2,f2).πAlarm(b2)].λ(a2) += [(0.99x0.005) + (0.003x0.995)]x0.5 ++ [(0.01x0.005) + (0.997x0.995)]x0.5 = 0.5 + +λ message _Jn --> FreightTruck +λ_Jn(f1) += [p(_jn0|f1,a1).π_Jn(a1) + p(_jn0|f1,a2).π_Jn(a2)].λ(_jn0) ++ [p(_jn1|f1,a1).π_Jn(a1) + p(_jn1|f1,a2).π_Jn(a2)].λ(_jn1) ++ [p(_jn2|f1,a1).π_Jn(a1) + p(_jn2|f1,a2).π_Jn(a2)].λ(_jn2) ++ [p(_jn3|f1,a1).π_Jn(a1) + p(_jn3|f1,a2).π_Jn(a2)].λ(_jn3) += [(1x0.0138158) + (0x0.986184)]x1 ++ [(0x0.0138158) + (1x0.986184)]x1 ++ [(0x0.0138158) + (0x0.986184)]x1 ++ [(0x0.0138158) + (0x0.986184)]x1 = 1 +λ_Jn(f2) += [p(_jn0|f2,a1).π_Jn(a1) + p(_jn0|f2,a2).π_Jn(a2)].λ(_jn0) ++ [p(_jn1|f2,a1).π_Jn(a1) + p(_jn1|f2,a2).π_Jn(a2)].λ(_jn1) ++ [p(_jn2|f2,a1).π_Jn(a1) + p(_jn2|f2,a2).π_Jn(a2)].λ(_jn2) ++ [p(_jn3|f2,a1).π_Jn(a1) + p(_jn3|f2,a2).π_Jn(a2)].λ(_jn3) += [(0x0.0138158) + (0x0.986184)]x1 ++ [(0x0.0138158) + (0x0.986184)]x1 ++ [(1x0.0138158) + (0x0.986184)]x1 ++ [(0x0.0138158) + (1x0.986184)]x1 = 1 + +λ message _Jn --> Alarm +λ_Jn(a1) += [p(_jn0|f1,a1).π_Jn(f1) + p(_jn0|f2,a1).π_Jn(f2)].λ(_jn0) ++ [p(_jn1|f1,a1).π_Jn(f1) + p(_jn1|f2,a1).π_Jn(f2)].λ(_jn1) ++ [p(_jn2|f1,a1).π_Jn(f1) + p(_jn2|f2,a1).π_Jn(f2)].λ(_jn2) ++ [p(_jn3|f1,a1).π_Jn(f1) + p(_jn3|f2,a1).π_Jn(f2)].λ(_jn3) += [(1x0.03) + (0x0.97)]x1 ++ [(0x0.03) + (0x0.97)]x1 ++ [(0x0.03) + (1x0.97)]x1 ++ [(0x0.03) + (0x0.97)]x1 = 1 +λ_Jn(a2) += [p(_jn0|f1,a2).π_Jn(f1) + p(_jn0|f2,a2).π_Jn(f2)].λ(_jn0) ++ [p(_jn1|f1,a2).π_Jn(f1) + p(_jn1|f2,a2).π_Jn(f2)].λ(_jn1) ++ [p(_jn2|f1,a2).π_Jn(f1) + p(_jn2|f2,a2).π_Jn(f2)].λ(_jn2) ++ [p(_jn3|f1,a2).π_Jn(f1) + p(_jn3|f2,a2).π_Jn(f2)].λ(_jn3) += [(0x0.03) + (0x0.97)]x1 ++ [(1x0.03) + (0x0.97)]x1 ++ [(0x0.03) + (0x0.97)]x1 ++ [(0x0.03) + (1x0.97)]x1 = 1 + +π message Burglar --> Alarm +πAlarm(b1) = π(b1) = 0.005 = 0.005 +πAlarm(b2) = π(b2) = 0.995 = 0.995 + +π message FreightTruck --> Alarm +πAlarm(f1) = π(f1).λ_Jn(f1) = 0.03 x 0.5 = 0.015 +πAlarm(f2) = π(f2).λ_Jn(f2) = 0.97 x 0.5 = 0.485 + +π message FreightTruck --> _Jn +π_Jn(f1) = π(f1).λAlarm(f1) = 0.03 x 0.5 = 0.015 +π_Jn(f2) = π(f2).λAlarm(f2) = 0.97 x 0.5 = 0.485 + +π message Alarm --> _Jn +π_Jn(a1) = π(a1) = 0.0138158 = 0.01381575073 +π_Jn(a2) = π(a2) = 0.986184 = 0.9861842493 + +var Burglar: +π(b1) += p(b1) += (0.005) = 0.005 +π(b2) += p(b2) += (0.995) = 0.995 +λ(b1) = λAlarm(b1) = 0.5 = 0.5 +λ(b2) = λAlarm(b2) = 0.5 = 0.5 +belief change = 0 + +var FreightTruck: +π(f1) += p(f1) += (0.03) = 0.03 +π(f2) += p(f2) += (0.97) = 0.97 +λ(f1) = λAlarm(f1).λ_Jn(f1) = 0.5 x 0.5 = 0.25 +λ(f2) = λAlarm(f2).λ_Jn(f2) = 0.5 x 0.5 = 0.25 +belief change = 0 + +var Alarm: +π(a1) += p(a1|b1,f1).πAlarm(b1).πAlarm(f1) ++ p(a1|b1,f2).πAlarm(b1).πAlarm(f2) ++ p(a1|b2,f1).πAlarm(b2).πAlarm(f1) ++ p(a1|b2,f2).πAlarm(b2).πAlarm(f2) += (0.992x0.005x0.03) ++ (0.99x0.005x0.97) ++ (0.2x0.995x0.03) ++ (0.003x0.995x0.97) = 0.01381575049 +π(a2) += p(a2|b1,f1).πAlarm(b1).πAlarm(f1) ++ p(a2|b1,f2).πAlarm(b1).πAlarm(f2) ++ p(a2|b2,f1).πAlarm(b2).πAlarm(f1) ++ p(a2|b2,f2).πAlarm(b2).πAlarm(f2) += (0.008x0.005x0.03) ++ (0.01x0.005x0.97) ++ (0.8x0.995x0.03) ++ (0.997x0.995x0.97) = 0.9861842495 +λ(a1) = λ_Jn(a1) = 0.5 = 0.5 +λ(a2) = λ_Jn(a2) = 0.5 = 0.5 +belief change = 4.876703156e-10 + +var _Jn: +π(_jn0) += p(_jn0|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn0|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn0|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn0|f2,a2).π_Jn(f2).π_Jn(a2) += (1x0.03x0.0138158) ++ (0x0.03x0.986184) ++ (0x0.97x0.0138158) ++ (0x0.97x0.986184) = 0.0004144725783 +π(_jn1) += p(_jn1|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn1|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn1|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn1|f2,a2).π_Jn(f2).π_Jn(a2) += (0x0.03x0.0138158) ++ (1x0.03x0.986184) ++ (0x0.97x0.0138158) ++ (0x0.97x0.986184) = 0.02958552991 +π(_jn2) += p(_jn2|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn2|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn2|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn2|f2,a2).π_Jn(f2).π_Jn(a2) += (0x0.03x0.0138158) ++ (0x0.03x0.986184) ++ (1x0.97x0.0138158) ++ (0x0.97x0.986184) = 0.01340127888 +π(_jn3) += p(_jn3|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn3|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn3|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn3|f2,a2).π_Jn(f2).π_Jn(a2) += (0x0.03x0.0138158) ++ (0x0.03x0.986184) ++ (0x0.97x0.0138158) ++ (1x0.97x0.986184) = 0.9565987186 +λ(_jn0) = 1 +λ(_jn1) = 1 +λ(_jn2) = 1 +λ(_jn3) = 1 +belief change = 3.872792849e-09 + +domain π(Burglar) λ(Burglar) belief +---------------------------------------------------------------- +b1 0.005 0.5 0.005 +b2 0.995 0.5 0.995 + +domain πAlarm(Burglar) λAlarm(Burglar) +---------------------------------------------------------------- +b1 0.005 0.5 +b2 0.995 0.5 + +domain π(FreightTruck) λ(FreightTruck) belief +---------------------------------------------------------------- +f1 0.03 0.25 0.03 +f2 0.97 0.25 0.97 + +domain πAlarm(FreightTruck) λAlarm(FreightTruck) +---------------------------------------------------------------- +f1 0.03000000249 0.5 +f2 0.9699999975 0.5 + +domain π_Jn(FreightTruck) λ_Jn(FreightTruck) +---------------------------------------------------------------- +f1 0.03000000249 0.5 +f2 0.9699999975 0.5 + +domain π(Alarm) λ(Alarm) belief +---------------------------------------------------------------- +a1 0.01381575049 0.5 0.01381575049 +a2 0.9861842495 0.5 0.9861842495 + +domain π_Jn(Alarm) λ_Jn(Alarm) +---------------------------------------------------------------- +a1 0.01381575146 0.5 +a2 0.9861842485 0.5 + +domain π(_Jn) λ(_Jn) belief +---------------------------------------------------------------- +_jn0 0.0004144725783 1 0.0004144725783 +_jn1 0.02958552991 1 0.02958552991 +_jn2 0.01340127888 1 0.01340127888 +_jn3 0.9565987186 1 0.9565987186 + + + +******************************************************************************** + Iteration 48 +******************************************************************************** +λ message Alarm --> Burglar +λAlarm(b1) += [p(a1|b1,f1).πAlarm(f1) + p(a1|b1,f2).πAlarm(f2)].λ(a1) ++ [p(a2|b1,f1).πAlarm(f1) + p(a2|b1,f2).πAlarm(f2)].λ(a2) += [(0.992x0.03) + (0.99x0.97)]x0.5 ++ [(0.008x0.03) + (0.01x0.97)]x0.5 = 0.5 +λAlarm(b2) += [p(a1|b2,f1).πAlarm(f1) + p(a1|b2,f2).πAlarm(f2)].λ(a1) ++ [p(a2|b2,f1).πAlarm(f1) + p(a2|b2,f2).πAlarm(f2)].λ(a2) += [(0.2x0.03) + (0.003x0.97)]x0.5 ++ [(0.8x0.03) + (0.997x0.97)]x0.5 = 0.5 + +λ message Alarm --> FreightTruck +λAlarm(f1) += [p(a1|b1,f1).πAlarm(b1) + p(a1|b2,f1).πAlarm(b2)].λ(a1) ++ [p(a2|b1,f1).πAlarm(b1) + p(a2|b2,f1).πAlarm(b2)].λ(a2) += [(0.992x0.005) + (0.2x0.995)]x0.5 ++ [(0.008x0.005) + (0.8x0.995)]x0.5 = 0.5 +λAlarm(f2) += [p(a1|b1,f2).πAlarm(b1) + p(a1|b2,f2).πAlarm(b2)].λ(a1) ++ [p(a2|b1,f2).πAlarm(b1) + p(a2|b2,f2).πAlarm(b2)].λ(a2) += [(0.99x0.005) + (0.003x0.995)]x0.5 ++ [(0.01x0.005) + (0.997x0.995)]x0.5 = 0.5 + +λ message _Jn --> FreightTruck +λ_Jn(f1) += [p(_jn0|f1,a1).π_Jn(a1) + p(_jn0|f1,a2).π_Jn(a2)].λ(_jn0) ++ [p(_jn1|f1,a1).π_Jn(a1) + p(_jn1|f1,a2).π_Jn(a2)].λ(_jn1) ++ [p(_jn2|f1,a1).π_Jn(a1) + p(_jn2|f1,a2).π_Jn(a2)].λ(_jn2) ++ [p(_jn3|f1,a1).π_Jn(a1) + p(_jn3|f1,a2).π_Jn(a2)].λ(_jn3) += [(1x0.0138158) + (0x0.986184)]x1 ++ [(0x0.0138158) + (1x0.986184)]x1 ++ [(0x0.0138158) + (0x0.986184)]x1 ++ [(0x0.0138158) + (0x0.986184)]x1 = 1 +λ_Jn(f2) += [p(_jn0|f2,a1).π_Jn(a1) + p(_jn0|f2,a2).π_Jn(a2)].λ(_jn0) ++ [p(_jn1|f2,a1).π_Jn(a1) + p(_jn1|f2,a2).π_Jn(a2)].λ(_jn1) ++ [p(_jn2|f2,a1).π_Jn(a1) + p(_jn2|f2,a2).π_Jn(a2)].λ(_jn2) ++ [p(_jn3|f2,a1).π_Jn(a1) + p(_jn3|f2,a2).π_Jn(a2)].λ(_jn3) += [(0x0.0138158) + (0x0.986184)]x1 ++ [(0x0.0138158) + (0x0.986184)]x1 ++ [(1x0.0138158) + (0x0.986184)]x1 ++ [(0x0.0138158) + (1x0.986184)]x1 = 1 + +λ message _Jn --> Alarm +λ_Jn(a1) += [p(_jn0|f1,a1).π_Jn(f1) + p(_jn0|f2,a1).π_Jn(f2)].λ(_jn0) ++ [p(_jn1|f1,a1).π_Jn(f1) + p(_jn1|f2,a1).π_Jn(f2)].λ(_jn1) ++ [p(_jn2|f1,a1).π_Jn(f1) + p(_jn2|f2,a1).π_Jn(f2)].λ(_jn2) ++ [p(_jn3|f1,a1).π_Jn(f1) + p(_jn3|f2,a1).π_Jn(f2)].λ(_jn3) += [(1x0.03) + (0x0.97)]x1 ++ [(0x0.03) + (0x0.97)]x1 ++ [(0x0.03) + (1x0.97)]x1 ++ [(0x0.03) + (0x0.97)]x1 = 1 +λ_Jn(a2) += [p(_jn0|f1,a2).π_Jn(f1) + p(_jn0|f2,a2).π_Jn(f2)].λ(_jn0) ++ [p(_jn1|f1,a2).π_Jn(f1) + p(_jn1|f2,a2).π_Jn(f2)].λ(_jn1) ++ [p(_jn2|f1,a2).π_Jn(f1) + p(_jn2|f2,a2).π_Jn(f2)].λ(_jn2) ++ [p(_jn3|f1,a2).π_Jn(f1) + p(_jn3|f2,a2).π_Jn(f2)].λ(_jn3) += [(0x0.03) + (0x0.97)]x1 ++ [(1x0.03) + (0x0.97)]x1 ++ [(0x0.03) + (0x0.97)]x1 ++ [(0x0.03) + (1x0.97)]x1 = 1 + +π message Burglar --> Alarm +πAlarm(b1) = π(b1) = 0.005 = 0.005 +πAlarm(b2) = π(b2) = 0.995 = 0.995 + +π message FreightTruck --> Alarm +πAlarm(f1) = π(f1).λ_Jn(f1) = 0.03 x 0.5 = 0.015 +πAlarm(f2) = π(f2).λ_Jn(f2) = 0.97 x 0.5 = 0.485 + +π message FreightTruck --> _Jn +π_Jn(f1) = π(f1).λAlarm(f1) = 0.03 x 0.5 = 0.015 +π_Jn(f2) = π(f2).λAlarm(f2) = 0.97 x 0.5 = 0.485 + +π message Alarm --> _Jn +π_Jn(a1) = π(a1) = 0.0138158 = 0.01381575049 +π_Jn(a2) = π(a2) = 0.986184 = 0.9861842495 + +var Burglar: +π(b1) += p(b1) += (0.005) = 0.005 +π(b2) += p(b2) += (0.995) = 0.995 +λ(b1) = λAlarm(b1) = 0.5 = 0.5 +λ(b2) = λAlarm(b2) = 0.5 = 0.5 +belief change = 0 + +var FreightTruck: +π(f1) += p(f1) += (0.03) = 0.03 +π(f2) += p(f2) += (0.97) = 0.97 +λ(f1) = λAlarm(f1).λ_Jn(f1) = 0.5 x 0.5 = 0.25 +λ(f2) = λAlarm(f2).λ_Jn(f2) = 0.5 x 0.5 = 0.25 +belief change = 0 + +var Alarm: +π(a1) += p(a1|b1,f1).πAlarm(b1).πAlarm(f1) ++ p(a1|b1,f2).πAlarm(b1).πAlarm(f2) ++ p(a1|b2,f1).πAlarm(b2).πAlarm(f1) ++ p(a1|b2,f2).πAlarm(b2).πAlarm(f2) += (0.992x0.005x0.03) ++ (0.99x0.005x0.97) ++ (0.2x0.995x0.03) ++ (0.003x0.995x0.97) = 0.01381575033 +π(a2) += p(a2|b1,f1).πAlarm(b1).πAlarm(f1) ++ p(a2|b1,f2).πAlarm(b1).πAlarm(f2) ++ p(a2|b2,f1).πAlarm(b2).πAlarm(f1) ++ p(a2|b2,f2).πAlarm(b2).πAlarm(f2) += (0.008x0.005x0.03) ++ (0.01x0.005x0.97) ++ (0.8x0.995x0.03) ++ (0.997x0.995x0.97) = 0.9861842497 +λ(a1) = λ_Jn(a1) = 0.5 = 0.5 +λ(a2) = λ_Jn(a2) = 0.5 = 0.5 +belief change = 3.25112378e-10 + +var _Jn: +π(_jn0) += p(_jn0|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn0|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn0|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn0|f2,a2).π_Jn(f2).π_Jn(a2) += (1x0.03x0.0138158) ++ (0x0.03x0.986184) ++ (0x0.97x0.0138158) ++ (0x0.97x0.986184) = 0.0004144725522 +π(_jn1) += p(_jn1|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn1|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn1|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn1|f2,a2).π_Jn(f2).π_Jn(a2) += (0x0.03x0.0138158) ++ (1x0.03x0.986184) ++ (0x0.97x0.0138158) ++ (0x0.97x0.986184) = 0.02958552911 +π(_jn2) += p(_jn2|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn2|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn2|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn2|f2,a2).π_Jn(f2).π_Jn(a2) += (0x0.03x0.0138158) ++ (0x0.03x0.986184) ++ (1x0.97x0.0138158) ++ (0x0.97x0.986184) = 0.01340127842 +π(_jn3) += p(_jn3|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn3|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn3|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn3|f2,a2).π_Jn(f2).π_Jn(a2) += (0x0.03x0.0138158) ++ (0x0.03x0.986184) ++ (0x0.97x0.0138158) ++ (1x0.97x0.986184) = 0.9565987199 +λ(_jn0) = 1 +λ(_jn1) = 1 +λ(_jn2) = 1 +λ(_jn3) = 1 +belief change = 2.58181512e-09 + +domain π(Burglar) λ(Burglar) belief +---------------------------------------------------------------- +b1 0.005 0.5 0.005 +b2 0.995 0.5 0.995 + +domain πAlarm(Burglar) λAlarm(Burglar) +---------------------------------------------------------------- +b1 0.005 0.5 +b2 0.995 0.5 + +domain π(FreightTruck) λ(FreightTruck) belief +---------------------------------------------------------------- +f1 0.03 0.25 0.03 +f2 0.97 0.25 0.97 + +domain πAlarm(FreightTruck) λAlarm(FreightTruck) +---------------------------------------------------------------- +f1 0.03000000166 0.5 +f2 0.9699999983 0.5 + +domain π_Jn(FreightTruck) λ_Jn(FreightTruck) +---------------------------------------------------------------- +f1 0.03000000166 0.5 +f2 0.9699999983 0.5 + +domain π(Alarm) λ(Alarm) belief +---------------------------------------------------------------- +a1 0.01381575033 0.5 0.01381575033 +a2 0.9861842497 0.5 0.9861842497 + +domain π_Jn(Alarm) λ_Jn(Alarm) +---------------------------------------------------------------- +a1 0.01381575098 0.5 +a2 0.986184249 0.5 + +domain π(_Jn) λ(_Jn) belief +---------------------------------------------------------------- +_jn0 0.0004144725522 1 0.0004144725522 +_jn1 0.02958552911 1 0.02958552911 +_jn2 0.01340127842 1 0.01340127842 +_jn3 0.9565987199 1 0.9565987199 + + + +******************************************************************************** + Iteration 49 +******************************************************************************** +λ message Alarm --> Burglar +λAlarm(b1) += [p(a1|b1,f1).πAlarm(f1) + p(a1|b1,f2).πAlarm(f2)].λ(a1) ++ [p(a2|b1,f1).πAlarm(f1) + p(a2|b1,f2).πAlarm(f2)].λ(a2) += [(0.992x0.03) + (0.99x0.97)]x0.5 ++ [(0.008x0.03) + (0.01x0.97)]x0.5 = 0.5 +λAlarm(b2) += [p(a1|b2,f1).πAlarm(f1) + p(a1|b2,f2).πAlarm(f2)].λ(a1) ++ [p(a2|b2,f1).πAlarm(f1) + p(a2|b2,f2).πAlarm(f2)].λ(a2) += [(0.2x0.03) + (0.003x0.97)]x0.5 ++ [(0.8x0.03) + (0.997x0.97)]x0.5 = 0.5 + +λ message Alarm --> FreightTruck +λAlarm(f1) += [p(a1|b1,f1).πAlarm(b1) + p(a1|b2,f1).πAlarm(b2)].λ(a1) ++ [p(a2|b1,f1).πAlarm(b1) + p(a2|b2,f1).πAlarm(b2)].λ(a2) += [(0.992x0.005) + (0.2x0.995)]x0.5 ++ [(0.008x0.005) + (0.8x0.995)]x0.5 = 0.5 +λAlarm(f2) += [p(a1|b1,f2).πAlarm(b1) + p(a1|b2,f2).πAlarm(b2)].λ(a1) ++ [p(a2|b1,f2).πAlarm(b1) + p(a2|b2,f2).πAlarm(b2)].λ(a2) += [(0.99x0.005) + (0.003x0.995)]x0.5 ++ [(0.01x0.005) + (0.997x0.995)]x0.5 = 0.5 + +λ message _Jn --> FreightTruck +λ_Jn(f1) += [p(_jn0|f1,a1).π_Jn(a1) + p(_jn0|f1,a2).π_Jn(a2)].λ(_jn0) ++ [p(_jn1|f1,a1).π_Jn(a1) + p(_jn1|f1,a2).π_Jn(a2)].λ(_jn1) ++ [p(_jn2|f1,a1).π_Jn(a1) + p(_jn2|f1,a2).π_Jn(a2)].λ(_jn2) ++ [p(_jn3|f1,a1).π_Jn(a1) + p(_jn3|f1,a2).π_Jn(a2)].λ(_jn3) += [(1x0.0138158) + (0x0.986184)]x1 ++ [(0x0.0138158) + (1x0.986184)]x1 ++ [(0x0.0138158) + (0x0.986184)]x1 ++ [(0x0.0138158) + (0x0.986184)]x1 = 1 +λ_Jn(f2) += [p(_jn0|f2,a1).π_Jn(a1) + p(_jn0|f2,a2).π_Jn(a2)].λ(_jn0) ++ [p(_jn1|f2,a1).π_Jn(a1) + p(_jn1|f2,a2).π_Jn(a2)].λ(_jn1) ++ [p(_jn2|f2,a1).π_Jn(a1) + p(_jn2|f2,a2).π_Jn(a2)].λ(_jn2) ++ [p(_jn3|f2,a1).π_Jn(a1) + p(_jn3|f2,a2).π_Jn(a2)].λ(_jn3) += [(0x0.0138158) + (0x0.986184)]x1 ++ [(0x0.0138158) + (0x0.986184)]x1 ++ [(1x0.0138158) + (0x0.986184)]x1 ++ [(0x0.0138158) + (1x0.986184)]x1 = 1 + +λ message _Jn --> Alarm +λ_Jn(a1) += [p(_jn0|f1,a1).π_Jn(f1) + p(_jn0|f2,a1).π_Jn(f2)].λ(_jn0) ++ [p(_jn1|f1,a1).π_Jn(f1) + p(_jn1|f2,a1).π_Jn(f2)].λ(_jn1) ++ [p(_jn2|f1,a1).π_Jn(f1) + p(_jn2|f2,a1).π_Jn(f2)].λ(_jn2) ++ [p(_jn3|f1,a1).π_Jn(f1) + p(_jn3|f2,a1).π_Jn(f2)].λ(_jn3) += [(1x0.03) + (0x0.97)]x1 ++ [(0x0.03) + (0x0.97)]x1 ++ [(0x0.03) + (1x0.97)]x1 ++ [(0x0.03) + (0x0.97)]x1 = 1 +λ_Jn(a2) += [p(_jn0|f1,a2).π_Jn(f1) + p(_jn0|f2,a2).π_Jn(f2)].λ(_jn0) ++ [p(_jn1|f1,a2).π_Jn(f1) + p(_jn1|f2,a2).π_Jn(f2)].λ(_jn1) ++ [p(_jn2|f1,a2).π_Jn(f1) + p(_jn2|f2,a2).π_Jn(f2)].λ(_jn2) ++ [p(_jn3|f1,a2).π_Jn(f1) + p(_jn3|f2,a2).π_Jn(f2)].λ(_jn3) += [(0x0.03) + (0x0.97)]x1 ++ [(1x0.03) + (0x0.97)]x1 ++ [(0x0.03) + (0x0.97)]x1 ++ [(0x0.03) + (1x0.97)]x1 = 1 + +π message Burglar --> Alarm +πAlarm(b1) = π(b1) = 0.005 = 0.005 +πAlarm(b2) = π(b2) = 0.995 = 0.995 + +π message FreightTruck --> Alarm +πAlarm(f1) = π(f1).λ_Jn(f1) = 0.03 x 0.5 = 0.015 +πAlarm(f2) = π(f2).λ_Jn(f2) = 0.97 x 0.5 = 0.485 + +π message FreightTruck --> _Jn +π_Jn(f1) = π(f1).λAlarm(f1) = 0.03 x 0.5 = 0.015 +π_Jn(f2) = π(f2).λAlarm(f2) = 0.97 x 0.5 = 0.485 + +π message Alarm --> _Jn +π_Jn(a1) = π(a1) = 0.0138158 = 0.01381575033 +π_Jn(a2) = π(a2) = 0.986184 = 0.9861842497 + +var Burglar: +π(b1) += p(b1) += (0.005) = 0.005 +π(b2) += p(b2) += (0.995) = 0.995 +λ(b1) = λAlarm(b1) = 0.5 = 0.5 +λ(b2) = λAlarm(b2) = 0.5 = 0.5 +belief change = 0 + +var FreightTruck: +π(f1) += p(f1) += (0.03) = 0.03 +π(f2) += p(f2) += (0.97) = 0.97 +λ(f1) = λAlarm(f1).λ_Jn(f1) = 0.5 x 0.5 = 0.25 +λ(f2) = λAlarm(f2).λ_Jn(f2) = 0.5 x 0.5 = 0.25 +belief change = 0 + +var Alarm: +π(a1) += p(a1|b1,f1).πAlarm(b1).πAlarm(f1) ++ p(a1|b1,f2).πAlarm(b1).πAlarm(f2) ++ p(a1|b2,f1).πAlarm(b2).πAlarm(f1) ++ p(a1|b2,f2).πAlarm(b2).πAlarm(f2) += (0.992x0.005x0.03) ++ (0.99x0.005x0.97) ++ (0.2x0.995x0.03) ++ (0.003x0.995x0.97) = 0.01381575022 +π(a2) += p(a2|b1,f1).πAlarm(b1).πAlarm(f1) ++ p(a2|b1,f2).πAlarm(b1).πAlarm(f2) ++ p(a2|b2,f1).πAlarm(b2).πAlarm(f1) ++ p(a2|b2,f2).πAlarm(b2).πAlarm(f2) += (0.008x0.005x0.03) ++ (0.01x0.005x0.97) ++ (0.8x0.995x0.03) ++ (0.997x0.995x0.97) = 0.9861842498 +λ(a1) = λ_Jn(a1) = 0.5 = 0.5 +λ(a2) = λ_Jn(a2) = 0.5 = 0.5 +belief change = 2.167409273e-10 + +var _Jn: +π(_jn0) += p(_jn0|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn0|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn0|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn0|f2,a2).π_Jn(f2).π_Jn(a2) += (1x0.03x0.0138158) ++ (0x0.03x0.986184) ++ (0x0.97x0.0138158) ++ (0x0.97x0.986184) = 0.0004144725348 +π(_jn1) += p(_jn1|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn1|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn1|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn1|f2,a2).π_Jn(f2).π_Jn(a2) += (0x0.03x0.0138158) ++ (1x0.03x0.986184) ++ (0x0.97x0.0138158) ++ (0x0.97x0.986184) = 0.02958552857 +π(_jn2) += p(_jn2|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn2|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn2|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn2|f2,a2).π_Jn(f2).π_Jn(a2) += (0x0.03x0.0138158) ++ (0x0.03x0.986184) ++ (1x0.97x0.0138158) ++ (0x0.97x0.986184) = 0.01340127812 +π(_jn3) += p(_jn3|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn3|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn3|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn3|f2,a2).π_Jn(f2).π_Jn(a2) += (0x0.03x0.0138158) ++ (0x0.03x0.986184) ++ (0x0.97x0.0138158) ++ (1x0.97x0.986184) = 0.9565987208 +λ(_jn0) = 1 +λ(_jn1) = 1 +λ(_jn2) = 1 +λ(_jn3) = 1 +belief change = 1.721185934e-09 + +domain π(Burglar) λ(Burglar) belief +---------------------------------------------------------------- +b1 0.005 0.5 0.005 +b2 0.995 0.5 0.995 + +domain πAlarm(Burglar) λAlarm(Burglar) +---------------------------------------------------------------- +b1 0.005 0.5 +b2 0.995 0.5 + +domain π(FreightTruck) λ(FreightTruck) belief +---------------------------------------------------------------- +f1 0.03 0.25 0.03 +f2 0.97 0.25 0.97 + +domain πAlarm(FreightTruck) λAlarm(FreightTruck) +---------------------------------------------------------------- +f1 0.03000000111 0.5 +f2 0.9699999989 0.5 + +domain π_Jn(FreightTruck) λ_Jn(FreightTruck) +---------------------------------------------------------------- +f1 0.03000000111 0.5 +f2 0.9699999989 0.5 + +domain π(Alarm) λ(Alarm) belief +---------------------------------------------------------------- +a1 0.01381575022 0.5 0.01381575022 +a2 0.9861842498 0.5 0.9861842498 + +domain π_Jn(Alarm) λ_Jn(Alarm) +---------------------------------------------------------------- +a1 0.01381575065 0.5 +a2 0.9861842493 0.5 + +domain π(_Jn) λ(_Jn) belief +---------------------------------------------------------------- +_jn0 0.0004144725348 1 0.0004144725348 +_jn1 0.02958552857 1 0.02958552857 +_jn2 0.01340127812 1 0.01340127812 +_jn3 0.9565987208 1 0.9565987208 + + + +******************************************************************************** + Iteration 50 +******************************************************************************** +λ message Alarm --> Burglar +λAlarm(b1) += [p(a1|b1,f1).πAlarm(f1) + p(a1|b1,f2).πAlarm(f2)].λ(a1) ++ [p(a2|b1,f1).πAlarm(f1) + p(a2|b1,f2).πAlarm(f2)].λ(a2) += [(0.992x0.03) + (0.99x0.97)]x0.5 ++ [(0.008x0.03) + (0.01x0.97)]x0.5 = 0.5 +λAlarm(b2) += [p(a1|b2,f1).πAlarm(f1) + p(a1|b2,f2).πAlarm(f2)].λ(a1) ++ [p(a2|b2,f1).πAlarm(f1) + p(a2|b2,f2).πAlarm(f2)].λ(a2) += [(0.2x0.03) + (0.003x0.97)]x0.5 ++ [(0.8x0.03) + (0.997x0.97)]x0.5 = 0.5 + +λ message Alarm --> FreightTruck +λAlarm(f1) += [p(a1|b1,f1).πAlarm(b1) + p(a1|b2,f1).πAlarm(b2)].λ(a1) ++ [p(a2|b1,f1).πAlarm(b1) + p(a2|b2,f1).πAlarm(b2)].λ(a2) += [(0.992x0.005) + (0.2x0.995)]x0.5 ++ [(0.008x0.005) + (0.8x0.995)]x0.5 = 0.5 +λAlarm(f2) += [p(a1|b1,f2).πAlarm(b1) + p(a1|b2,f2).πAlarm(b2)].λ(a1) ++ [p(a2|b1,f2).πAlarm(b1) + p(a2|b2,f2).πAlarm(b2)].λ(a2) += [(0.99x0.005) + (0.003x0.995)]x0.5 ++ [(0.01x0.005) + (0.997x0.995)]x0.5 = 0.5 + +λ message _Jn --> FreightTruck +λ_Jn(f1) += [p(_jn0|f1,a1).π_Jn(a1) + p(_jn0|f1,a2).π_Jn(a2)].λ(_jn0) ++ [p(_jn1|f1,a1).π_Jn(a1) + p(_jn1|f1,a2).π_Jn(a2)].λ(_jn1) ++ [p(_jn2|f1,a1).π_Jn(a1) + p(_jn2|f1,a2).π_Jn(a2)].λ(_jn2) ++ [p(_jn3|f1,a1).π_Jn(a1) + p(_jn3|f1,a2).π_Jn(a2)].λ(_jn3) += [(1x0.0138158) + (0x0.986184)]x1 ++ [(0x0.0138158) + (1x0.986184)]x1 ++ [(0x0.0138158) + (0x0.986184)]x1 ++ [(0x0.0138158) + (0x0.986184)]x1 = 1 +λ_Jn(f2) += [p(_jn0|f2,a1).π_Jn(a1) + p(_jn0|f2,a2).π_Jn(a2)].λ(_jn0) ++ [p(_jn1|f2,a1).π_Jn(a1) + p(_jn1|f2,a2).π_Jn(a2)].λ(_jn1) ++ [p(_jn2|f2,a1).π_Jn(a1) + p(_jn2|f2,a2).π_Jn(a2)].λ(_jn2) ++ [p(_jn3|f2,a1).π_Jn(a1) + p(_jn3|f2,a2).π_Jn(a2)].λ(_jn3) += [(0x0.0138158) + (0x0.986184)]x1 ++ [(0x0.0138158) + (0x0.986184)]x1 ++ [(1x0.0138158) + (0x0.986184)]x1 ++ [(0x0.0138158) + (1x0.986184)]x1 = 1 + +λ message _Jn --> Alarm +λ_Jn(a1) += [p(_jn0|f1,a1).π_Jn(f1) + p(_jn0|f2,a1).π_Jn(f2)].λ(_jn0) ++ [p(_jn1|f1,a1).π_Jn(f1) + p(_jn1|f2,a1).π_Jn(f2)].λ(_jn1) ++ [p(_jn2|f1,a1).π_Jn(f1) + p(_jn2|f2,a1).π_Jn(f2)].λ(_jn2) ++ [p(_jn3|f1,a1).π_Jn(f1) + p(_jn3|f2,a1).π_Jn(f2)].λ(_jn3) += [(1x0.03) + (0x0.97)]x1 ++ [(0x0.03) + (0x0.97)]x1 ++ [(0x0.03) + (1x0.97)]x1 ++ [(0x0.03) + (0x0.97)]x1 = 1 +λ_Jn(a2) += [p(_jn0|f1,a2).π_Jn(f1) + p(_jn0|f2,a2).π_Jn(f2)].λ(_jn0) ++ [p(_jn1|f1,a2).π_Jn(f1) + p(_jn1|f2,a2).π_Jn(f2)].λ(_jn1) ++ [p(_jn2|f1,a2).π_Jn(f1) + p(_jn2|f2,a2).π_Jn(f2)].λ(_jn2) ++ [p(_jn3|f1,a2).π_Jn(f1) + p(_jn3|f2,a2).π_Jn(f2)].λ(_jn3) += [(0x0.03) + (0x0.97)]x1 ++ [(1x0.03) + (0x0.97)]x1 ++ [(0x0.03) + (0x0.97)]x1 ++ [(0x0.03) + (1x0.97)]x1 = 1 + +π message Burglar --> Alarm +πAlarm(b1) = π(b1) = 0.005 = 0.005 +πAlarm(b2) = π(b2) = 0.995 = 0.995 + +π message FreightTruck --> Alarm +πAlarm(f1) = π(f1).λ_Jn(f1) = 0.03 x 0.5 = 0.015 +πAlarm(f2) = π(f2).λ_Jn(f2) = 0.97 x 0.5 = 0.485 + +π message FreightTruck --> _Jn +π_Jn(f1) = π(f1).λAlarm(f1) = 0.03 x 0.5 = 0.015 +π_Jn(f2) = π(f2).λAlarm(f2) = 0.97 x 0.5 = 0.485 + +π message Alarm --> _Jn +π_Jn(a1) = π(a1) = 0.0138158 = 0.01381575022 +π_Jn(a2) = π(a2) = 0.986184 = 0.9861842498 + +var Burglar: +π(b1) += p(b1) += (0.005) = 0.005 +π(b2) += p(b2) += (0.995) = 0.995 +λ(b1) = λAlarm(b1) = 0.5 = 0.5 +λ(b2) = λAlarm(b2) = 0.5 = 0.5 +belief change = 8.67361738e-19 + +var FreightTruck: +π(f1) += p(f1) += (0.03) = 0.03 +π(f2) += p(f2) += (0.97) = 0.97 +λ(f1) = λAlarm(f1).λ_Jn(f1) = 0.5 x 0.5 = 0.25 +λ(f2) = λAlarm(f2).λ_Jn(f2) = 0.5 x 0.5 = 0.25 +belief change = 0 + +var Alarm: +π(a1) += p(a1|b1,f1).πAlarm(b1).πAlarm(f1) ++ p(a1|b1,f2).πAlarm(b1).πAlarm(f2) ++ p(a1|b2,f1).πAlarm(b2).πAlarm(f1) ++ p(a1|b2,f2).πAlarm(b2).πAlarm(f2) += (0.992x0.005x0.03) ++ (0.99x0.005x0.97) ++ (0.2x0.995x0.03) ++ (0.003x0.995x0.97) = 0.01381575014 +π(a2) += p(a2|b1,f1).πAlarm(b1).πAlarm(f1) ++ p(a2|b1,f2).πAlarm(b1).πAlarm(f2) ++ p(a2|b2,f1).πAlarm(b2).πAlarm(f1) ++ p(a2|b2,f2).πAlarm(b2).πAlarm(f2) += (0.008x0.005x0.03) ++ (0.01x0.005x0.97) ++ (0.8x0.995x0.03) ++ (0.997x0.995x0.97) = 0.9861842499 +λ(a1) = λ_Jn(a1) = 0.5 = 0.5 +λ(a2) = λ_Jn(a2) = 0.5 = 0.5 +belief change = 1.444937295e-10 + +var _Jn: +π(_jn0) += p(_jn0|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn0|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn0|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn0|f2,a2).π_Jn(f2).π_Jn(a2) += (1x0.03x0.0138158) ++ (0x0.03x0.986184) ++ (0x0.97x0.0138158) ++ (0x0.97x0.986184) = 0.0004144725232 +π(_jn1) += p(_jn1|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn1|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn1|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn1|f2,a2).π_Jn(f2).π_Jn(a2) += (0x0.03x0.0138158) ++ (1x0.03x0.986184) ++ (0x0.97x0.0138158) ++ (0x0.97x0.986184) = 0.02958552821 +π(_jn2) += p(_jn2|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn2|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn2|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn2|f2,a2).π_Jn(f2).π_Jn(a2) += (0x0.03x0.0138158) ++ (0x0.03x0.986184) ++ (1x0.97x0.0138158) ++ (0x0.97x0.986184) = 0.01340127791 +π(_jn3) += p(_jn3|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn3|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn3|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn3|f2,a2).π_Jn(f2).π_Jn(a2) += (0x0.03x0.0138158) ++ (0x0.03x0.986184) ++ (0x0.97x0.0138158) ++ (1x0.97x0.986184) = 0.9565987214 +λ(_jn0) = 1 +λ(_jn1) = 1 +λ(_jn2) = 1 +λ(_jn3) = 1 +belief change = 1.147445038e-09 + +domain π(Burglar) λ(Burglar) belief +---------------------------------------------------------------- +b1 0.005 0.5 0.005 +b2 0.995 0.5 0.995 + +domain πAlarm(Burglar) λAlarm(Burglar) +---------------------------------------------------------------- +b1 0.005 0.5 +b2 0.995 0.5 + +domain π(FreightTruck) λ(FreightTruck) belief +---------------------------------------------------------------- +f1 0.03 0.25 0.03 +f2 0.97 0.25 0.97 + +domain πAlarm(FreightTruck) λAlarm(FreightTruck) +---------------------------------------------------------------- +f1 0.03000000074 0.5 +f2 0.9699999993 0.5 + +domain π_Jn(FreightTruck) λ_Jn(FreightTruck) +---------------------------------------------------------------- +f1 0.03000000074 0.5 +f2 0.9699999993 0.5 + +domain π(Alarm) λ(Alarm) belief +---------------------------------------------------------------- +a1 0.01381575014 0.5 0.01381575014 +a2 0.9861842499 0.5 0.9861842499 + +domain π_Jn(Alarm) λ_Jn(Alarm) +---------------------------------------------------------------- +a1 0.01381575043 0.5 +a2 0.9861842496 0.5 + +domain π(_Jn) λ(_Jn) belief +---------------------------------------------------------------- +_jn0 0.0004144725232 1 0.0004144725232 +_jn1 0.02958552821 1 0.02958552821 +_jn2 0.01340127791 1 0.01340127791 +_jn3 0.9565987214 1 0.9565987214 + + + +******************************************************************************** + Iteration 51 +******************************************************************************** +λ message Alarm --> Burglar +λAlarm(b1) += [p(a1|b1,f1).πAlarm(f1) + p(a1|b1,f2).πAlarm(f2)].λ(a1) ++ [p(a2|b1,f1).πAlarm(f1) + p(a2|b1,f2).πAlarm(f2)].λ(a2) += [(0.992x0.03) + (0.99x0.97)]x0.5 ++ [(0.008x0.03) + (0.01x0.97)]x0.5 = 0.5 +λAlarm(b2) += [p(a1|b2,f1).πAlarm(f1) + p(a1|b2,f2).πAlarm(f2)].λ(a1) ++ [p(a2|b2,f1).πAlarm(f1) + p(a2|b2,f2).πAlarm(f2)].λ(a2) += [(0.2x0.03) + (0.003x0.97)]x0.5 ++ [(0.8x0.03) + (0.997x0.97)]x0.5 = 0.5 + +λ message Alarm --> FreightTruck +λAlarm(f1) += [p(a1|b1,f1).πAlarm(b1) + p(a1|b2,f1).πAlarm(b2)].λ(a1) ++ [p(a2|b1,f1).πAlarm(b1) + p(a2|b2,f1).πAlarm(b2)].λ(a2) += [(0.992x0.005) + (0.2x0.995)]x0.5 ++ [(0.008x0.005) + (0.8x0.995)]x0.5 = 0.5 +λAlarm(f2) += [p(a1|b1,f2).πAlarm(b1) + p(a1|b2,f2).πAlarm(b2)].λ(a1) ++ [p(a2|b1,f2).πAlarm(b1) + p(a2|b2,f2).πAlarm(b2)].λ(a2) += [(0.99x0.005) + (0.003x0.995)]x0.5 ++ [(0.01x0.005) + (0.997x0.995)]x0.5 = 0.5 + +λ message _Jn --> FreightTruck +λ_Jn(f1) += [p(_jn0|f1,a1).π_Jn(a1) + p(_jn0|f1,a2).π_Jn(a2)].λ(_jn0) ++ [p(_jn1|f1,a1).π_Jn(a1) + p(_jn1|f1,a2).π_Jn(a2)].λ(_jn1) ++ [p(_jn2|f1,a1).π_Jn(a1) + p(_jn2|f1,a2).π_Jn(a2)].λ(_jn2) ++ [p(_jn3|f1,a1).π_Jn(a1) + p(_jn3|f1,a2).π_Jn(a2)].λ(_jn3) += [(1x0.0138158) + (0x0.986184)]x1 ++ [(0x0.0138158) + (1x0.986184)]x1 ++ [(0x0.0138158) + (0x0.986184)]x1 ++ [(0x0.0138158) + (0x0.986184)]x1 = 1 +λ_Jn(f2) += [p(_jn0|f2,a1).π_Jn(a1) + p(_jn0|f2,a2).π_Jn(a2)].λ(_jn0) ++ [p(_jn1|f2,a1).π_Jn(a1) + p(_jn1|f2,a2).π_Jn(a2)].λ(_jn1) ++ [p(_jn2|f2,a1).π_Jn(a1) + p(_jn2|f2,a2).π_Jn(a2)].λ(_jn2) ++ [p(_jn3|f2,a1).π_Jn(a1) + p(_jn3|f2,a2).π_Jn(a2)].λ(_jn3) += [(0x0.0138158) + (0x0.986184)]x1 ++ [(0x0.0138158) + (0x0.986184)]x1 ++ [(1x0.0138158) + (0x0.986184)]x1 ++ [(0x0.0138158) + (1x0.986184)]x1 = 1 + +λ message _Jn --> Alarm +λ_Jn(a1) += [p(_jn0|f1,a1).π_Jn(f1) + p(_jn0|f2,a1).π_Jn(f2)].λ(_jn0) ++ [p(_jn1|f1,a1).π_Jn(f1) + p(_jn1|f2,a1).π_Jn(f2)].λ(_jn1) ++ [p(_jn2|f1,a1).π_Jn(f1) + p(_jn2|f2,a1).π_Jn(f2)].λ(_jn2) ++ [p(_jn3|f1,a1).π_Jn(f1) + p(_jn3|f2,a1).π_Jn(f2)].λ(_jn3) += [(1x0.03) + (0x0.97)]x1 ++ [(0x0.03) + (0x0.97)]x1 ++ [(0x0.03) + (1x0.97)]x1 ++ [(0x0.03) + (0x0.97)]x1 = 1 +λ_Jn(a2) += [p(_jn0|f1,a2).π_Jn(f1) + p(_jn0|f2,a2).π_Jn(f2)].λ(_jn0) ++ [p(_jn1|f1,a2).π_Jn(f1) + p(_jn1|f2,a2).π_Jn(f2)].λ(_jn1) ++ [p(_jn2|f1,a2).π_Jn(f1) + p(_jn2|f2,a2).π_Jn(f2)].λ(_jn2) ++ [p(_jn3|f1,a2).π_Jn(f1) + p(_jn3|f2,a2).π_Jn(f2)].λ(_jn3) += [(0x0.03) + (0x0.97)]x1 ++ [(1x0.03) + (0x0.97)]x1 ++ [(0x0.03) + (0x0.97)]x1 ++ [(0x0.03) + (1x0.97)]x1 = 1 + +π message Burglar --> Alarm +πAlarm(b1) = π(b1) = 0.005 = 0.005 +πAlarm(b2) = π(b2) = 0.995 = 0.995 + +π message FreightTruck --> Alarm +πAlarm(f1) = π(f1).λ_Jn(f1) = 0.03 x 0.5 = 0.015 +πAlarm(f2) = π(f2).λ_Jn(f2) = 0.97 x 0.5 = 0.485 + +π message FreightTruck --> _Jn +π_Jn(f1) = π(f1).λAlarm(f1) = 0.03 x 0.5 = 0.015 +π_Jn(f2) = π(f2).λAlarm(f2) = 0.97 x 0.5 = 0.485 + +π message Alarm --> _Jn +π_Jn(a1) = π(a1) = 0.0138158 = 0.01381575014 +π_Jn(a2) = π(a2) = 0.986184 = 0.9861842499 + +var Burglar: +π(b1) += p(b1) += (0.005) = 0.005 +π(b2) += p(b2) += (0.995) = 0.995 +λ(b1) = λAlarm(b1) = 0.5 = 0.5 +λ(b2) = λAlarm(b2) = 0.5 = 0.5 +belief change = 8.67361738e-19 + +var FreightTruck: +π(f1) += p(f1) += (0.03) = 0.03 +π(f2) += p(f2) += (0.97) = 0.97 +λ(f1) = λAlarm(f1).λ_Jn(f1) = 0.5 x 0.5 = 0.25 +λ(f2) = λAlarm(f2).λ_Jn(f2) = 0.5 x 0.5 = 0.25 +belief change = 0 + +var Alarm: +π(a1) += p(a1|b1,f1).πAlarm(b1).πAlarm(f1) ++ p(a1|b1,f2).πAlarm(b1).πAlarm(f2) ++ p(a1|b2,f1).πAlarm(b2).πAlarm(f1) ++ p(a1|b2,f2).πAlarm(b2).πAlarm(f2) += (0.992x0.005x0.03) ++ (0.99x0.005x0.97) ++ (0.2x0.995x0.03) ++ (0.003x0.995x0.97) = 0.0138157501 +π(a2) += p(a2|b1,f1).πAlarm(b1).πAlarm(f1) ++ p(a2|b1,f2).πAlarm(b1).πAlarm(f2) ++ p(a2|b2,f1).πAlarm(b2).πAlarm(f1) ++ p(a2|b2,f2).πAlarm(b2).πAlarm(f2) += (0.008x0.005x0.03) ++ (0.01x0.005x0.97) ++ (0.8x0.995x0.03) ++ (0.997x0.995x0.97) = 0.9861842499 +λ(a1) = λ_Jn(a1) = 0.5 = 0.5 +λ(a2) = λ_Jn(a2) = 0.5 = 0.5 +belief change = 9.632908707e-11 + +var _Jn: +π(_jn0) += p(_jn0|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn0|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn0|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn0|f2,a2).π_Jn(f2).π_Jn(a2) += (1x0.03x0.0138158) ++ (0x0.03x0.986184) ++ (0x0.97x0.0138158) ++ (0x0.97x0.986184) = 0.0004144725155 +π(_jn1) += p(_jn1|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn1|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn1|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn1|f2,a2).π_Jn(f2).π_Jn(a2) += (0x0.03x0.0138158) ++ (1x0.03x0.986184) ++ (0x0.97x0.0138158) ++ (0x0.97x0.986184) = 0.02958552798 +π(_jn2) += p(_jn2|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn2|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn2|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn2|f2,a2).π_Jn(f2).π_Jn(a2) += (0x0.03x0.0138158) ++ (0x0.03x0.986184) ++ (1x0.97x0.0138158) ++ (0x0.97x0.986184) = 0.01340127777 +π(_jn3) += p(_jn3|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn3|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn3|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn3|f2,a2).π_Jn(f2).π_Jn(a2) += (0x0.03x0.0138158) ++ (0x0.03x0.986184) ++ (0x0.97x0.0138158) ++ (1x0.97x0.986184) = 0.9565987217 +λ(_jn0) = 1 +λ(_jn1) = 1 +λ(_jn2) = 1 +λ(_jn3) = 1 +belief change = 7.649571397e-10 + +domain π(Burglar) λ(Burglar) belief +---------------------------------------------------------------- +b1 0.005 0.5 0.005 +b2 0.995 0.5 0.995 + +domain πAlarm(Burglar) λAlarm(Burglar) +---------------------------------------------------------------- +b1 0.005 0.5 +b2 0.995 0.5 + +domain π(FreightTruck) λ(FreightTruck) belief +---------------------------------------------------------------- +f1 0.03 0.25 0.03 +f2 0.97 0.25 0.97 + +domain πAlarm(FreightTruck) λAlarm(FreightTruck) +---------------------------------------------------------------- +f1 0.03000000049 0.5 +f2 0.9699999995 0.5 + +domain π_Jn(FreightTruck) λ_Jn(FreightTruck) +---------------------------------------------------------------- +f1 0.03000000049 0.5 +f2 0.9699999995 0.5 + +domain π(Alarm) λ(Alarm) belief +---------------------------------------------------------------- +a1 0.0138157501 0.5 0.0138157501 +a2 0.9861842499 0.5 0.9861842499 + +domain π_Jn(Alarm) λ_Jn(Alarm) +---------------------------------------------------------------- +a1 0.01381575029 0.5 +a2 0.9861842497 0.5 + +domain π(_Jn) λ(_Jn) belief +---------------------------------------------------------------- +_jn0 0.0004144725155 1 0.0004144725155 +_jn1 0.02958552798 1 0.02958552798 +_jn2 0.01340127777 1 0.01340127777 +_jn3 0.9565987217 1 0.9565987217 + + + +******************************************************************************** + Iteration 52 +******************************************************************************** +λ message Alarm --> Burglar +λAlarm(b1) += [p(a1|b1,f1).πAlarm(f1) + p(a1|b1,f2).πAlarm(f2)].λ(a1) ++ [p(a2|b1,f1).πAlarm(f1) + p(a2|b1,f2).πAlarm(f2)].λ(a2) += [(0.992x0.03) + (0.99x0.97)]x0.5 ++ [(0.008x0.03) + (0.01x0.97)]x0.5 = 0.5 +λAlarm(b2) += [p(a1|b2,f1).πAlarm(f1) + p(a1|b2,f2).πAlarm(f2)].λ(a1) ++ [p(a2|b2,f1).πAlarm(f1) + p(a2|b2,f2).πAlarm(f2)].λ(a2) += [(0.2x0.03) + (0.003x0.97)]x0.5 ++ [(0.8x0.03) + (0.997x0.97)]x0.5 = 0.5 + +λ message Alarm --> FreightTruck +λAlarm(f1) += [p(a1|b1,f1).πAlarm(b1) + p(a1|b2,f1).πAlarm(b2)].λ(a1) ++ [p(a2|b1,f1).πAlarm(b1) + p(a2|b2,f1).πAlarm(b2)].λ(a2) += [(0.992x0.005) + (0.2x0.995)]x0.5 ++ [(0.008x0.005) + (0.8x0.995)]x0.5 = 0.5 +λAlarm(f2) += [p(a1|b1,f2).πAlarm(b1) + p(a1|b2,f2).πAlarm(b2)].λ(a1) ++ [p(a2|b1,f2).πAlarm(b1) + p(a2|b2,f2).πAlarm(b2)].λ(a2) += [(0.99x0.005) + (0.003x0.995)]x0.5 ++ [(0.01x0.005) + (0.997x0.995)]x0.5 = 0.5 + +λ message _Jn --> FreightTruck +λ_Jn(f1) += [p(_jn0|f1,a1).π_Jn(a1) + p(_jn0|f1,a2).π_Jn(a2)].λ(_jn0) ++ [p(_jn1|f1,a1).π_Jn(a1) + p(_jn1|f1,a2).π_Jn(a2)].λ(_jn1) ++ [p(_jn2|f1,a1).π_Jn(a1) + p(_jn2|f1,a2).π_Jn(a2)].λ(_jn2) ++ [p(_jn3|f1,a1).π_Jn(a1) + p(_jn3|f1,a2).π_Jn(a2)].λ(_jn3) += [(1x0.0138158) + (0x0.986184)]x1 ++ [(0x0.0138158) + (1x0.986184)]x1 ++ [(0x0.0138158) + (0x0.986184)]x1 ++ [(0x0.0138158) + (0x0.986184)]x1 = 1 +λ_Jn(f2) += [p(_jn0|f2,a1).π_Jn(a1) + p(_jn0|f2,a2).π_Jn(a2)].λ(_jn0) ++ [p(_jn1|f2,a1).π_Jn(a1) + p(_jn1|f2,a2).π_Jn(a2)].λ(_jn1) ++ [p(_jn2|f2,a1).π_Jn(a1) + p(_jn2|f2,a2).π_Jn(a2)].λ(_jn2) ++ [p(_jn3|f2,a1).π_Jn(a1) + p(_jn3|f2,a2).π_Jn(a2)].λ(_jn3) += [(0x0.0138158) + (0x0.986184)]x1 ++ [(0x0.0138158) + (0x0.986184)]x1 ++ [(1x0.0138158) + (0x0.986184)]x1 ++ [(0x0.0138158) + (1x0.986184)]x1 = 1 + +λ message _Jn --> Alarm +λ_Jn(a1) += [p(_jn0|f1,a1).π_Jn(f1) + p(_jn0|f2,a1).π_Jn(f2)].λ(_jn0) ++ [p(_jn1|f1,a1).π_Jn(f1) + p(_jn1|f2,a1).π_Jn(f2)].λ(_jn1) ++ [p(_jn2|f1,a1).π_Jn(f1) + p(_jn2|f2,a1).π_Jn(f2)].λ(_jn2) ++ [p(_jn3|f1,a1).π_Jn(f1) + p(_jn3|f2,a1).π_Jn(f2)].λ(_jn3) += [(1x0.03) + (0x0.97)]x1 ++ [(0x0.03) + (0x0.97)]x1 ++ [(0x0.03) + (1x0.97)]x1 ++ [(0x0.03) + (0x0.97)]x1 = 1 +λ_Jn(a2) += [p(_jn0|f1,a2).π_Jn(f1) + p(_jn0|f2,a2).π_Jn(f2)].λ(_jn0) ++ [p(_jn1|f1,a2).π_Jn(f1) + p(_jn1|f2,a2).π_Jn(f2)].λ(_jn1) ++ [p(_jn2|f1,a2).π_Jn(f1) + p(_jn2|f2,a2).π_Jn(f2)].λ(_jn2) ++ [p(_jn3|f1,a2).π_Jn(f1) + p(_jn3|f2,a2).π_Jn(f2)].λ(_jn3) += [(0x0.03) + (0x0.97)]x1 ++ [(1x0.03) + (0x0.97)]x1 ++ [(0x0.03) + (0x0.97)]x1 ++ [(0x0.03) + (1x0.97)]x1 = 1 + +π message Burglar --> Alarm +πAlarm(b1) = π(b1) = 0.005 = 0.005 +πAlarm(b2) = π(b2) = 0.995 = 0.995 + +π message FreightTruck --> Alarm +πAlarm(f1) = π(f1).λ_Jn(f1) = 0.03 x 0.5 = 0.015 +πAlarm(f2) = π(f2).λ_Jn(f2) = 0.97 x 0.5 = 0.485 + +π message FreightTruck --> _Jn +π_Jn(f1) = π(f1).λAlarm(f1) = 0.03 x 0.5 = 0.015 +π_Jn(f2) = π(f2).λAlarm(f2) = 0.97 x 0.5 = 0.485 + +π message Alarm --> _Jn +π_Jn(a1) = π(a1) = 0.0138158 = 0.0138157501 +π_Jn(a2) = π(a2) = 0.986184 = 0.9861842499 + +var Burglar: +π(b1) += p(b1) += (0.005) = 0.005 +π(b2) += p(b2) += (0.995) = 0.995 +λ(b1) = λAlarm(b1) = 0.5 = 0.5 +λ(b2) = λAlarm(b2) = 0.5 = 0.5 +belief change = 8.67361738e-19 + +var FreightTruck: +π(f1) += p(f1) += (0.03) = 0.03 +π(f2) += p(f2) += (0.97) = 0.97 +λ(f1) = λAlarm(f1).λ_Jn(f1) = 0.5 x 0.5 = 0.25 +λ(f2) = λAlarm(f2).λ_Jn(f2) = 0.5 x 0.5 = 0.25 +belief change = 0 + +var Alarm: +π(a1) += p(a1|b1,f1).πAlarm(b1).πAlarm(f1) ++ p(a1|b1,f2).πAlarm(b1).πAlarm(f2) ++ p(a1|b2,f1).πAlarm(b2).πAlarm(f1) ++ p(a1|b2,f2).πAlarm(b2).πAlarm(f2) += (0.992x0.005x0.03) ++ (0.99x0.005x0.97) ++ (0.2x0.995x0.03) ++ (0.003x0.995x0.97) = 0.01381575006 +π(a2) += p(a2|b1,f1).πAlarm(b1).πAlarm(f1) ++ p(a2|b1,f2).πAlarm(b1).πAlarm(f2) ++ p(a2|b2,f1).πAlarm(b2).πAlarm(f1) ++ p(a2|b2,f2).πAlarm(b2).πAlarm(f2) += (0.008x0.005x0.03) ++ (0.01x0.005x0.97) ++ (0.8x0.995x0.03) ++ (0.997x0.995x0.97) = 0.9861842499 +λ(a1) = λ_Jn(a1) = 0.5 = 0.5 +λ(a2) = λ_Jn(a2) = 0.5 = 0.5 +belief change = 6.421927573e-11 + +var _Jn: +π(_jn0) += p(_jn0|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn0|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn0|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn0|f2,a2).π_Jn(f2).π_Jn(a2) += (1x0.03x0.0138158) ++ (0x0.03x0.986184) ++ (0x0.97x0.0138158) ++ (0x0.97x0.986184) = 0.0004144725103 +π(_jn1) += p(_jn1|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn1|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn1|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn1|f2,a2).π_Jn(f2).π_Jn(a2) += (0x0.03x0.0138158) ++ (1x0.03x0.986184) ++ (0x0.97x0.0138158) ++ (0x0.97x0.986184) = 0.02958552782 +π(_jn2) += p(_jn2|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn2|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn2|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn2|f2,a2).π_Jn(f2).π_Jn(a2) += (0x0.03x0.0138158) ++ (0x0.03x0.986184) ++ (1x0.97x0.0138158) ++ (0x0.97x0.986184) = 0.01340127768 +π(_jn3) += p(_jn3|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn3|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn3|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn3|f2,a2).π_Jn(f2).π_Jn(a2) += (0x0.03x0.0138158) ++ (0x0.03x0.986184) ++ (0x0.97x0.0138158) ++ (1x0.97x0.986184) = 0.956598722 +λ(_jn0) = 1 +λ(_jn1) = 1 +λ(_jn2) = 1 +λ(_jn3) = 1 +belief change = 5.099682295e-10 + +domain π(Burglar) λ(Burglar) belief +---------------------------------------------------------------- +b1 0.005 0.5 0.005 +b2 0.995 0.5 0.995 + +domain πAlarm(Burglar) λAlarm(Burglar) +---------------------------------------------------------------- +b1 0.005 0.5 +b2 0.995 0.5 + +domain π(FreightTruck) λ(FreightTruck) belief +---------------------------------------------------------------- +f1 0.03 0.25 0.03 +f2 0.97 0.25 0.97 + +domain πAlarm(FreightTruck) λAlarm(FreightTruck) +---------------------------------------------------------------- +f1 0.03000000033 0.5 +f2 0.9699999997 0.5 + +domain π_Jn(FreightTruck) λ_Jn(FreightTruck) +---------------------------------------------------------------- +f1 0.03000000033 0.5 +f2 0.9699999997 0.5 + +domain π(Alarm) λ(Alarm) belief +---------------------------------------------------------------- +a1 0.01381575006 0.5 0.01381575006 +a2 0.9861842499 0.5 0.9861842499 + +domain π_Jn(Alarm) λ_Jn(Alarm) +---------------------------------------------------------------- +a1 0.01381575019 0.5 +a2 0.9861842498 0.5 + +domain π(_Jn) λ(_Jn) belief +---------------------------------------------------------------- +_jn0 0.0004144725103 1 0.0004144725103 +_jn1 0.02958552782 1 0.02958552782 +_jn2 0.01340127768 1 0.01340127768 +_jn3 0.956598722 1 0.956598722 + + + +******************************************************************************** + Iteration 53 +******************************************************************************** +λ message Alarm --> Burglar +λAlarm(b1) += [p(a1|b1,f1).πAlarm(f1) + p(a1|b1,f2).πAlarm(f2)].λ(a1) ++ [p(a2|b1,f1).πAlarm(f1) + p(a2|b1,f2).πAlarm(f2)].λ(a2) += [(0.992x0.03) + (0.99x0.97)]x0.5 ++ [(0.008x0.03) + (0.01x0.97)]x0.5 = 0.5 +λAlarm(b2) += [p(a1|b2,f1).πAlarm(f1) + p(a1|b2,f2).πAlarm(f2)].λ(a1) ++ [p(a2|b2,f1).πAlarm(f1) + p(a2|b2,f2).πAlarm(f2)].λ(a2) += [(0.2x0.03) + (0.003x0.97)]x0.5 ++ [(0.8x0.03) + (0.997x0.97)]x0.5 = 0.5 + +λ message Alarm --> FreightTruck +λAlarm(f1) += [p(a1|b1,f1).πAlarm(b1) + p(a1|b2,f1).πAlarm(b2)].λ(a1) ++ [p(a2|b1,f1).πAlarm(b1) + p(a2|b2,f1).πAlarm(b2)].λ(a2) += [(0.992x0.005) + (0.2x0.995)]x0.5 ++ [(0.008x0.005) + (0.8x0.995)]x0.5 = 0.5 +λAlarm(f2) += [p(a1|b1,f2).πAlarm(b1) + p(a1|b2,f2).πAlarm(b2)].λ(a1) ++ [p(a2|b1,f2).πAlarm(b1) + p(a2|b2,f2).πAlarm(b2)].λ(a2) += [(0.99x0.005) + (0.003x0.995)]x0.5 ++ [(0.01x0.005) + (0.997x0.995)]x0.5 = 0.5 + +λ message _Jn --> FreightTruck +λ_Jn(f1) += [p(_jn0|f1,a1).π_Jn(a1) + p(_jn0|f1,a2).π_Jn(a2)].λ(_jn0) ++ [p(_jn1|f1,a1).π_Jn(a1) + p(_jn1|f1,a2).π_Jn(a2)].λ(_jn1) ++ [p(_jn2|f1,a1).π_Jn(a1) + p(_jn2|f1,a2).π_Jn(a2)].λ(_jn2) ++ [p(_jn3|f1,a1).π_Jn(a1) + p(_jn3|f1,a2).π_Jn(a2)].λ(_jn3) += [(1x0.0138158) + (0x0.986184)]x1 ++ [(0x0.0138158) + (1x0.986184)]x1 ++ [(0x0.0138158) + (0x0.986184)]x1 ++ [(0x0.0138158) + (0x0.986184)]x1 = 1 +λ_Jn(f2) += [p(_jn0|f2,a1).π_Jn(a1) + p(_jn0|f2,a2).π_Jn(a2)].λ(_jn0) ++ [p(_jn1|f2,a1).π_Jn(a1) + p(_jn1|f2,a2).π_Jn(a2)].λ(_jn1) ++ [p(_jn2|f2,a1).π_Jn(a1) + p(_jn2|f2,a2).π_Jn(a2)].λ(_jn2) ++ [p(_jn3|f2,a1).π_Jn(a1) + p(_jn3|f2,a2).π_Jn(a2)].λ(_jn3) += [(0x0.0138158) + (0x0.986184)]x1 ++ [(0x0.0138158) + (0x0.986184)]x1 ++ [(1x0.0138158) + (0x0.986184)]x1 ++ [(0x0.0138158) + (1x0.986184)]x1 = 1 + +λ message _Jn --> Alarm +λ_Jn(a1) += [p(_jn0|f1,a1).π_Jn(f1) + p(_jn0|f2,a1).π_Jn(f2)].λ(_jn0) ++ [p(_jn1|f1,a1).π_Jn(f1) + p(_jn1|f2,a1).π_Jn(f2)].λ(_jn1) ++ [p(_jn2|f1,a1).π_Jn(f1) + p(_jn2|f2,a1).π_Jn(f2)].λ(_jn2) ++ [p(_jn3|f1,a1).π_Jn(f1) + p(_jn3|f2,a1).π_Jn(f2)].λ(_jn3) += [(1x0.03) + (0x0.97)]x1 ++ [(0x0.03) + (0x0.97)]x1 ++ [(0x0.03) + (1x0.97)]x1 ++ [(0x0.03) + (0x0.97)]x1 = 1 +λ_Jn(a2) += [p(_jn0|f1,a2).π_Jn(f1) + p(_jn0|f2,a2).π_Jn(f2)].λ(_jn0) ++ [p(_jn1|f1,a2).π_Jn(f1) + p(_jn1|f2,a2).π_Jn(f2)].λ(_jn1) ++ [p(_jn2|f1,a2).π_Jn(f1) + p(_jn2|f2,a2).π_Jn(f2)].λ(_jn2) ++ [p(_jn3|f1,a2).π_Jn(f1) + p(_jn3|f2,a2).π_Jn(f2)].λ(_jn3) += [(0x0.03) + (0x0.97)]x1 ++ [(1x0.03) + (0x0.97)]x1 ++ [(0x0.03) + (0x0.97)]x1 ++ [(0x0.03) + (1x0.97)]x1 = 1 + +π message Burglar --> Alarm +πAlarm(b1) = π(b1) = 0.005 = 0.005 +πAlarm(b2) = π(b2) = 0.995 = 0.995 + +π message FreightTruck --> Alarm +πAlarm(f1) = π(f1).λ_Jn(f1) = 0.03 x 0.5 = 0.015 +πAlarm(f2) = π(f2).λ_Jn(f2) = 0.97 x 0.5 = 0.485 + +π message FreightTruck --> _Jn +π_Jn(f1) = π(f1).λAlarm(f1) = 0.03 x 0.5 = 0.015 +π_Jn(f2) = π(f2).λAlarm(f2) = 0.97 x 0.5 = 0.485 + +π message Alarm --> _Jn +π_Jn(a1) = π(a1) = 0.0138158 = 0.01381575006 +π_Jn(a2) = π(a2) = 0.986184 = 0.9861842499 + +var Burglar: +π(b1) += p(b1) += (0.005) = 0.005 +π(b2) += p(b2) += (0.995) = 0.995 +λ(b1) = λAlarm(b1) = 0.5 = 0.5 +λ(b2) = λAlarm(b2) = 0.5 = 0.5 +belief change = 8.67361738e-19 + +var FreightTruck: +π(f1) += p(f1) += (0.03) = 0.03 +π(f2) += p(f2) += (0.97) = 0.97 +λ(f1) = λAlarm(f1).λ_Jn(f1) = 0.5 x 0.5 = 0.25 +λ(f2) = λAlarm(f2).λ_Jn(f2) = 0.5 x 0.5 = 0.25 +belief change = 0 + +var Alarm: +π(a1) += p(a1|b1,f1).πAlarm(b1).πAlarm(f1) ++ p(a1|b1,f2).πAlarm(b1).πAlarm(f2) ++ p(a1|b2,f1).πAlarm(b2).πAlarm(f1) ++ p(a1|b2,f2).πAlarm(b2).πAlarm(f2) += (0.992x0.005x0.03) ++ (0.99x0.005x0.97) ++ (0.2x0.995x0.03) ++ (0.003x0.995x0.97) = 0.01381575004 +π(a2) += p(a2|b1,f1).πAlarm(b1).πAlarm(f1) ++ p(a2|b1,f2).πAlarm(b1).πAlarm(f2) ++ p(a2|b2,f1).πAlarm(b2).πAlarm(f1) ++ p(a2|b2,f2).πAlarm(b2).πAlarm(f2) += (0.008x0.005x0.03) ++ (0.01x0.005x0.97) ++ (0.8x0.995x0.03) ++ (0.997x0.995x0.97) = 0.98618425 +λ(a1) = λ_Jn(a1) = 0.5 = 0.5 +λ(a2) = λ_Jn(a2) = 0.5 = 0.5 +belief change = 4.281283314e-11 + +var _Jn: +π(_jn0) += p(_jn0|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn0|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn0|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn0|f2,a2).π_Jn(f2).π_Jn(a2) += (1x0.03x0.0138158) ++ (0x0.03x0.986184) ++ (0x0.97x0.0138158) ++ (0x0.97x0.986184) = 0.0004144725069 +π(_jn1) += p(_jn1|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn1|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn1|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn1|f2,a2).π_Jn(f2).π_Jn(a2) += (0x0.03x0.0138158) ++ (1x0.03x0.986184) ++ (0x0.97x0.0138158) ++ (0x0.97x0.986184) = 0.02958552771 +π(_jn2) += p(_jn2|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn2|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn2|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn2|f2,a2).π_Jn(f2).π_Jn(a2) += (0x0.03x0.0138158) ++ (0x0.03x0.986184) ++ (1x0.97x0.0138158) ++ (0x0.97x0.986184) = 0.01340127762 +π(_jn3) += p(_jn3|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn3|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn3|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn3|f2,a2).π_Jn(f2).π_Jn(a2) += (0x0.03x0.0138158) ++ (0x0.03x0.986184) ++ (0x0.97x0.0138158) ++ (1x0.97x0.986184) = 0.9565987222 +λ(_jn0) = 1 +λ(_jn1) = 1 +λ(_jn2) = 1 +λ(_jn3) = 1 +belief change = 3.399771473e-10 + +domain π(Burglar) λ(Burglar) belief +---------------------------------------------------------------- +b1 0.005 0.5 0.005 +b2 0.995 0.5 0.995 + +domain πAlarm(Burglar) λAlarm(Burglar) +---------------------------------------------------------------- +b1 0.005 0.5 +b2 0.995 0.5 + +domain π(FreightTruck) λ(FreightTruck) belief +---------------------------------------------------------------- +f1 0.03 0.25 0.03 +f2 0.97 0.25 0.97 + +domain πAlarm(FreightTruck) λAlarm(FreightTruck) +---------------------------------------------------------------- +f1 0.03000000022 0.5 +f2 0.9699999998 0.5 + +domain π_Jn(FreightTruck) λ_Jn(FreightTruck) +---------------------------------------------------------------- +f1 0.03000000022 0.5 +f2 0.9699999998 0.5 + +domain π(Alarm) λ(Alarm) belief +---------------------------------------------------------------- +a1 0.01381575004 0.5 0.01381575004 +a2 0.98618425 0.5 0.98618425 + +domain π_Jn(Alarm) λ_Jn(Alarm) +---------------------------------------------------------------- +a1 0.01381575013 0.5 +a2 0.9861842499 0.5 + +domain π(_Jn) λ(_Jn) belief +---------------------------------------------------------------- +_jn0 0.0004144725069 1 0.0004144725069 +_jn1 0.02958552771 1 0.02958552771 +_jn2 0.01340127762 1 0.01340127762 +_jn3 0.9565987222 1 0.9565987222 + + + +******************************************************************************** + Iteration 54 +******************************************************************************** +λ message Alarm --> Burglar +λAlarm(b1) += [p(a1|b1,f1).πAlarm(f1) + p(a1|b1,f2).πAlarm(f2)].λ(a1) ++ [p(a2|b1,f1).πAlarm(f1) + p(a2|b1,f2).πAlarm(f2)].λ(a2) += [(0.992x0.03) + (0.99x0.97)]x0.5 ++ [(0.008x0.03) + (0.01x0.97)]x0.5 = 0.5 +λAlarm(b2) += [p(a1|b2,f1).πAlarm(f1) + p(a1|b2,f2).πAlarm(f2)].λ(a1) ++ [p(a2|b2,f1).πAlarm(f1) + p(a2|b2,f2).πAlarm(f2)].λ(a2) += [(0.2x0.03) + (0.003x0.97)]x0.5 ++ [(0.8x0.03) + (0.997x0.97)]x0.5 = 0.5 + +λ message Alarm --> FreightTruck +λAlarm(f1) += [p(a1|b1,f1).πAlarm(b1) + p(a1|b2,f1).πAlarm(b2)].λ(a1) ++ [p(a2|b1,f1).πAlarm(b1) + p(a2|b2,f1).πAlarm(b2)].λ(a2) += [(0.992x0.005) + (0.2x0.995)]x0.5 ++ [(0.008x0.005) + (0.8x0.995)]x0.5 = 0.5 +λAlarm(f2) += [p(a1|b1,f2).πAlarm(b1) + p(a1|b2,f2).πAlarm(b2)].λ(a1) ++ [p(a2|b1,f2).πAlarm(b1) + p(a2|b2,f2).πAlarm(b2)].λ(a2) += [(0.99x0.005) + (0.003x0.995)]x0.5 ++ [(0.01x0.005) + (0.997x0.995)]x0.5 = 0.5 + +λ message _Jn --> FreightTruck +λ_Jn(f1) += [p(_jn0|f1,a1).π_Jn(a1) + p(_jn0|f1,a2).π_Jn(a2)].λ(_jn0) ++ [p(_jn1|f1,a1).π_Jn(a1) + p(_jn1|f1,a2).π_Jn(a2)].λ(_jn1) ++ [p(_jn2|f1,a1).π_Jn(a1) + p(_jn2|f1,a2).π_Jn(a2)].λ(_jn2) ++ [p(_jn3|f1,a1).π_Jn(a1) + p(_jn3|f1,a2).π_Jn(a2)].λ(_jn3) += [(1x0.0138158) + (0x0.986184)]x1 ++ [(0x0.0138158) + (1x0.986184)]x1 ++ [(0x0.0138158) + (0x0.986184)]x1 ++ [(0x0.0138158) + (0x0.986184)]x1 = 1 +λ_Jn(f2) += [p(_jn0|f2,a1).π_Jn(a1) + p(_jn0|f2,a2).π_Jn(a2)].λ(_jn0) ++ [p(_jn1|f2,a1).π_Jn(a1) + p(_jn1|f2,a2).π_Jn(a2)].λ(_jn1) ++ [p(_jn2|f2,a1).π_Jn(a1) + p(_jn2|f2,a2).π_Jn(a2)].λ(_jn2) ++ [p(_jn3|f2,a1).π_Jn(a1) + p(_jn3|f2,a2).π_Jn(a2)].λ(_jn3) += [(0x0.0138158) + (0x0.986184)]x1 ++ [(0x0.0138158) + (0x0.986184)]x1 ++ [(1x0.0138158) + (0x0.986184)]x1 ++ [(0x0.0138158) + (1x0.986184)]x1 = 1 + +λ message _Jn --> Alarm +λ_Jn(a1) += [p(_jn0|f1,a1).π_Jn(f1) + p(_jn0|f2,a1).π_Jn(f2)].λ(_jn0) ++ [p(_jn1|f1,a1).π_Jn(f1) + p(_jn1|f2,a1).π_Jn(f2)].λ(_jn1) ++ [p(_jn2|f1,a1).π_Jn(f1) + p(_jn2|f2,a1).π_Jn(f2)].λ(_jn2) ++ [p(_jn3|f1,a1).π_Jn(f1) + p(_jn3|f2,a1).π_Jn(f2)].λ(_jn3) += [(1x0.03) + (0x0.97)]x1 ++ [(0x0.03) + (0x0.97)]x1 ++ [(0x0.03) + (1x0.97)]x1 ++ [(0x0.03) + (0x0.97)]x1 = 1 +λ_Jn(a2) += [p(_jn0|f1,a2).π_Jn(f1) + p(_jn0|f2,a2).π_Jn(f2)].λ(_jn0) ++ [p(_jn1|f1,a2).π_Jn(f1) + p(_jn1|f2,a2).π_Jn(f2)].λ(_jn1) ++ [p(_jn2|f1,a2).π_Jn(f1) + p(_jn2|f2,a2).π_Jn(f2)].λ(_jn2) ++ [p(_jn3|f1,a2).π_Jn(f1) + p(_jn3|f2,a2).π_Jn(f2)].λ(_jn3) += [(0x0.03) + (0x0.97)]x1 ++ [(1x0.03) + (0x0.97)]x1 ++ [(0x0.03) + (0x0.97)]x1 ++ [(0x0.03) + (1x0.97)]x1 = 1 + +π message Burglar --> Alarm +πAlarm(b1) = π(b1) = 0.005 = 0.005 +πAlarm(b2) = π(b2) = 0.995 = 0.995 + +π message FreightTruck --> Alarm +πAlarm(f1) = π(f1).λ_Jn(f1) = 0.03 x 0.5 = 0.015 +πAlarm(f2) = π(f2).λ_Jn(f2) = 0.97 x 0.5 = 0.485 + +π message FreightTruck --> _Jn +π_Jn(f1) = π(f1).λAlarm(f1) = 0.03 x 0.5 = 0.015 +π_Jn(f2) = π(f2).λAlarm(f2) = 0.97 x 0.5 = 0.485 + +π message Alarm --> _Jn +π_Jn(a1) = π(a1) = 0.0138158 = 0.01381575004 +π_Jn(a2) = π(a2) = 0.986184 = 0.98618425 + +var Burglar: +π(b1) += p(b1) += (0.005) = 0.005 +π(b2) += p(b2) += (0.995) = 0.995 +λ(b1) = λAlarm(b1) = 0.5 = 0.5 +λ(b2) = λAlarm(b2) = 0.5 = 0.5 +belief change = 0 + +var FreightTruck: +π(f1) += p(f1) += (0.03) = 0.03 +π(f2) += p(f2) += (0.97) = 0.97 +λ(f1) = λAlarm(f1).λ_Jn(f1) = 0.5 x 0.5 = 0.25 +λ(f2) = λAlarm(f2).λ_Jn(f2) = 0.5 x 0.5 = 0.25 +belief change = 0 + +var Alarm: +π(a1) += p(a1|b1,f1).πAlarm(b1).πAlarm(f1) ++ p(a1|b1,f2).πAlarm(b1).πAlarm(f2) ++ p(a1|b2,f1).πAlarm(b2).πAlarm(f1) ++ p(a1|b2,f2).πAlarm(b2).πAlarm(f2) += (0.992x0.005x0.03) ++ (0.99x0.005x0.97) ++ (0.2x0.995x0.03) ++ (0.003x0.995x0.97) = 0.01381575003 +π(a2) += p(a2|b1,f1).πAlarm(b1).πAlarm(f1) ++ p(a2|b1,f2).πAlarm(b1).πAlarm(f2) ++ p(a2|b2,f1).πAlarm(b2).πAlarm(f1) ++ p(a2|b2,f2).πAlarm(b2).πAlarm(f2) += (0.008x0.005x0.03) ++ (0.01x0.005x0.97) ++ (0.8x0.995x0.03) ++ (0.997x0.995x0.97) = 0.98618425 +λ(a1) = λ_Jn(a1) = 0.5 = 0.5 +λ(a2) = λ_Jn(a2) = 0.5 = 0.5 +belief change = 2.854173495e-11 + +var _Jn: +π(_jn0) += p(_jn0|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn0|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn0|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn0|f2,a2).π_Jn(f2).π_Jn(a2) += (1x0.03x0.0138158) ++ (0x0.03x0.986184) ++ (0x0.97x0.0138158) ++ (0x0.97x0.986184) = 0.0004144725046 +π(_jn1) += p(_jn1|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn1|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn1|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn1|f2,a2).π_Jn(f2).π_Jn(a2) += (0x0.03x0.0138158) ++ (1x0.03x0.986184) ++ (0x0.97x0.0138158) ++ (0x0.97x0.986184) = 0.02958552764 +π(_jn2) += p(_jn2|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn2|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn2|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn2|f2,a2).π_Jn(f2).π_Jn(a2) += (0x0.03x0.0138158) ++ (0x0.03x0.986184) ++ (1x0.97x0.0138158) ++ (0x0.97x0.986184) = 0.01340127758 +π(_jn3) += p(_jn3|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn3|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn3|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn3|f2,a2).π_Jn(f2).π_Jn(a2) += (0x0.03x0.0138158) ++ (0x0.03x0.986184) ++ (0x0.97x0.0138158) ++ (1x0.97x0.986184) = 0.9565987223 +λ(_jn0) = 1 +λ(_jn1) = 1 +λ(_jn2) = 1 +λ(_jn3) = 1 +belief change = 2.26650527e-10 + +domain π(Burglar) λ(Burglar) belief +---------------------------------------------------------------- +b1 0.005 0.5 0.005 +b2 0.995 0.5 0.995 + +domain πAlarm(Burglar) λAlarm(Burglar) +---------------------------------------------------------------- +b1 0.005 0.5 +b2 0.995 0.5 + +domain π(FreightTruck) λ(FreightTruck) belief +---------------------------------------------------------------- +f1 0.03 0.25 0.03 +f2 0.97 0.25 0.97 + +domain πAlarm(FreightTruck) λAlarm(FreightTruck) +---------------------------------------------------------------- +f1 0.03000000015 0.5 +f2 0.9699999999 0.5 + +domain π_Jn(FreightTruck) λ_Jn(FreightTruck) +---------------------------------------------------------------- +f1 0.03000000015 0.5 +f2 0.9699999999 0.5 + +domain π(Alarm) λ(Alarm) belief +---------------------------------------------------------------- +a1 0.01381575003 0.5 0.01381575003 +a2 0.98618425 0.5 0.98618425 + +domain π_Jn(Alarm) λ_Jn(Alarm) +---------------------------------------------------------------- +a1 0.01381575009 0.5 +a2 0.9861842499 0.5 + +domain π(_Jn) λ(_Jn) belief +---------------------------------------------------------------- +_jn0 0.0004144725046 1 0.0004144725046 +_jn1 0.02958552764 1 0.02958552764 +_jn2 0.01340127758 1 0.01340127758 +_jn3 0.9565987223 1 0.9565987223 + + + +******************************************************************************** + Iteration 55 +******************************************************************************** +λ message Alarm --> Burglar +λAlarm(b1) += [p(a1|b1,f1).πAlarm(f1) + p(a1|b1,f2).πAlarm(f2)].λ(a1) ++ [p(a2|b1,f1).πAlarm(f1) + p(a2|b1,f2).πAlarm(f2)].λ(a2) += [(0.992x0.03) + (0.99x0.97)]x0.5 ++ [(0.008x0.03) + (0.01x0.97)]x0.5 = 0.5 +λAlarm(b2) += [p(a1|b2,f1).πAlarm(f1) + p(a1|b2,f2).πAlarm(f2)].λ(a1) ++ [p(a2|b2,f1).πAlarm(f1) + p(a2|b2,f2).πAlarm(f2)].λ(a2) += [(0.2x0.03) + (0.003x0.97)]x0.5 ++ [(0.8x0.03) + (0.997x0.97)]x0.5 = 0.5 + +λ message Alarm --> FreightTruck +λAlarm(f1) += [p(a1|b1,f1).πAlarm(b1) + p(a1|b2,f1).πAlarm(b2)].λ(a1) ++ [p(a2|b1,f1).πAlarm(b1) + p(a2|b2,f1).πAlarm(b2)].λ(a2) += [(0.992x0.005) + (0.2x0.995)]x0.5 ++ [(0.008x0.005) + (0.8x0.995)]x0.5 = 0.5 +λAlarm(f2) += [p(a1|b1,f2).πAlarm(b1) + p(a1|b2,f2).πAlarm(b2)].λ(a1) ++ [p(a2|b1,f2).πAlarm(b1) + p(a2|b2,f2).πAlarm(b2)].λ(a2) += [(0.99x0.005) + (0.003x0.995)]x0.5 ++ [(0.01x0.005) + (0.997x0.995)]x0.5 = 0.5 + +λ message _Jn --> FreightTruck +λ_Jn(f1) += [p(_jn0|f1,a1).π_Jn(a1) + p(_jn0|f1,a2).π_Jn(a2)].λ(_jn0) ++ [p(_jn1|f1,a1).π_Jn(a1) + p(_jn1|f1,a2).π_Jn(a2)].λ(_jn1) ++ [p(_jn2|f1,a1).π_Jn(a1) + p(_jn2|f1,a2).π_Jn(a2)].λ(_jn2) ++ [p(_jn3|f1,a1).π_Jn(a1) + p(_jn3|f1,a2).π_Jn(a2)].λ(_jn3) += [(1x0.0138158) + (0x0.986184)]x1 ++ [(0x0.0138158) + (1x0.986184)]x1 ++ [(0x0.0138158) + (0x0.986184)]x1 ++ [(0x0.0138158) + (0x0.986184)]x1 = 1 +λ_Jn(f2) += [p(_jn0|f2,a1).π_Jn(a1) + p(_jn0|f2,a2).π_Jn(a2)].λ(_jn0) ++ [p(_jn1|f2,a1).π_Jn(a1) + p(_jn1|f2,a2).π_Jn(a2)].λ(_jn1) ++ [p(_jn2|f2,a1).π_Jn(a1) + p(_jn2|f2,a2).π_Jn(a2)].λ(_jn2) ++ [p(_jn3|f2,a1).π_Jn(a1) + p(_jn3|f2,a2).π_Jn(a2)].λ(_jn3) += [(0x0.0138158) + (0x0.986184)]x1 ++ [(0x0.0138158) + (0x0.986184)]x1 ++ [(1x0.0138158) + (0x0.986184)]x1 ++ [(0x0.0138158) + (1x0.986184)]x1 = 1 + +λ message _Jn --> Alarm +λ_Jn(a1) += [p(_jn0|f1,a1).π_Jn(f1) + p(_jn0|f2,a1).π_Jn(f2)].λ(_jn0) ++ [p(_jn1|f1,a1).π_Jn(f1) + p(_jn1|f2,a1).π_Jn(f2)].λ(_jn1) ++ [p(_jn2|f1,a1).π_Jn(f1) + p(_jn2|f2,a1).π_Jn(f2)].λ(_jn2) ++ [p(_jn3|f1,a1).π_Jn(f1) + p(_jn3|f2,a1).π_Jn(f2)].λ(_jn3) += [(1x0.03) + (0x0.97)]x1 ++ [(0x0.03) + (0x0.97)]x1 ++ [(0x0.03) + (1x0.97)]x1 ++ [(0x0.03) + (0x0.97)]x1 = 1 +λ_Jn(a2) += [p(_jn0|f1,a2).π_Jn(f1) + p(_jn0|f2,a2).π_Jn(f2)].λ(_jn0) ++ [p(_jn1|f1,a2).π_Jn(f1) + p(_jn1|f2,a2).π_Jn(f2)].λ(_jn1) ++ [p(_jn2|f1,a2).π_Jn(f1) + p(_jn2|f2,a2).π_Jn(f2)].λ(_jn2) ++ [p(_jn3|f1,a2).π_Jn(f1) + p(_jn3|f2,a2).π_Jn(f2)].λ(_jn3) += [(0x0.03) + (0x0.97)]x1 ++ [(1x0.03) + (0x0.97)]x1 ++ [(0x0.03) + (0x0.97)]x1 ++ [(0x0.03) + (1x0.97)]x1 = 1 + +π message Burglar --> Alarm +πAlarm(b1) = π(b1) = 0.005 = 0.005 +πAlarm(b2) = π(b2) = 0.995 = 0.995 + +π message FreightTruck --> Alarm +πAlarm(f1) = π(f1).λ_Jn(f1) = 0.03 x 0.5 = 0.015 +πAlarm(f2) = π(f2).λ_Jn(f2) = 0.97 x 0.5 = 0.485 + +π message FreightTruck --> _Jn +π_Jn(f1) = π(f1).λAlarm(f1) = 0.03 x 0.5 = 0.015 +π_Jn(f2) = π(f2).λAlarm(f2) = 0.97 x 0.5 = 0.485 + +π message Alarm --> _Jn +π_Jn(a1) = π(a1) = 0.0138158 = 0.01381575003 +π_Jn(a2) = π(a2) = 0.986184 = 0.98618425 + +var Burglar: +π(b1) += p(b1) += (0.005) = 0.005 +π(b2) += p(b2) += (0.995) = 0.995 +λ(b1) = λAlarm(b1) = 0.5 = 0.5 +λ(b2) = λAlarm(b2) = 0.5 = 0.5 +belief change = 0 + +var FreightTruck: +π(f1) += p(f1) += (0.03) = 0.03 +π(f2) += p(f2) += (0.97) = 0.97 +λ(f1) = λAlarm(f1).λ_Jn(f1) = 0.5 x 0.5 = 0.25 +λ(f2) = λAlarm(f2).λ_Jn(f2) = 0.5 x 0.5 = 0.25 +belief change = 0 + +var Alarm: +π(a1) += p(a1|b1,f1).πAlarm(b1).πAlarm(f1) ++ p(a1|b1,f2).πAlarm(b1).πAlarm(f2) ++ p(a1|b2,f1).πAlarm(b2).πAlarm(f1) ++ p(a1|b2,f2).πAlarm(b2).πAlarm(f2) += (0.992x0.005x0.03) ++ (0.99x0.005x0.97) ++ (0.2x0.995x0.03) ++ (0.003x0.995x0.97) = 0.01381575002 +π(a2) += p(a2|b1,f1).πAlarm(b1).πAlarm(f1) ++ p(a2|b1,f2).πAlarm(b1).πAlarm(f2) ++ p(a2|b2,f1).πAlarm(b2).πAlarm(f1) ++ p(a2|b2,f2).πAlarm(b2).πAlarm(f2) += (0.008x0.005x0.03) ++ (0.01x0.005x0.97) ++ (0.8x0.995x0.03) ++ (0.997x0.995x0.97) = 0.98618425 +λ(a1) = λ_Jn(a1) = 0.5 = 0.5 +λ(a2) = λ_Jn(a2) = 0.5 = 0.5 +belief change = 1.90280014e-11 + +var _Jn: +π(_jn0) += p(_jn0|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn0|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn0|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn0|f2,a2).π_Jn(f2).π_Jn(a2) += (1x0.03x0.0138158) ++ (0x0.03x0.986184) ++ (0x0.97x0.0138158) ++ (0x0.97x0.986184) = 0.0004144725031 +π(_jn1) += p(_jn1|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn1|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn1|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn1|f2,a2).π_Jn(f2).π_Jn(a2) += (0x0.03x0.0138158) ++ (1x0.03x0.986184) ++ (0x0.97x0.0138158) ++ (0x0.97x0.986184) = 0.02958552759 +π(_jn2) += p(_jn2|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn2|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn2|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn2|f2,a2).π_Jn(f2).π_Jn(a2) += (0x0.03x0.0138158) ++ (0x0.03x0.986184) ++ (1x0.97x0.0138158) ++ (0x0.97x0.986184) = 0.01340127755 +π(_jn3) += p(_jn3|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn3|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn3|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn3|f2,a2).π_Jn(f2).π_Jn(a2) += (0x0.03x0.0138158) ++ (0x0.03x0.986184) ++ (0x0.97x0.0138158) ++ (1x0.97x0.986184) = 0.9565987223 +λ(_jn0) = 1 +λ(_jn1) = 1 +λ(_jn2) = 1 +λ(_jn3) = 1 +belief change = 1.510999967e-10 + +domain π(Burglar) λ(Burglar) belief +---------------------------------------------------------------- +b1 0.005 0.5 0.005 +b2 0.995 0.5 0.995 + +domain πAlarm(Burglar) λAlarm(Burglar) +---------------------------------------------------------------- +b1 0.005 0.5 +b2 0.995 0.5 + +domain π(FreightTruck) λ(FreightTruck) belief +---------------------------------------------------------------- +f1 0.03 0.25 0.03 +f2 0.97 0.25 0.97 + +domain πAlarm(FreightTruck) λAlarm(FreightTruck) +---------------------------------------------------------------- +f1 0.0300000001 0.5 +f2 0.9699999999 0.5 + +domain π_Jn(FreightTruck) λ_Jn(FreightTruck) +---------------------------------------------------------------- +f1 0.0300000001 0.5 +f2 0.9699999999 0.5 + +domain π(Alarm) λ(Alarm) belief +---------------------------------------------------------------- +a1 0.01381575002 0.5 0.01381575002 +a2 0.98618425 0.5 0.98618425 + +domain π_Jn(Alarm) λ_Jn(Alarm) +---------------------------------------------------------------- +a1 0.01381575006 0.5 +a2 0.9861842499 0.5 + +domain π(_Jn) λ(_Jn) belief +---------------------------------------------------------------- +_jn0 0.0004144725031 1 0.0004144725031 +_jn1 0.02958552759 1 0.02958552759 +_jn2 0.01340127755 1 0.01340127755 +_jn3 0.9565987223 1 0.9565987223 + + + +******************************************************************************** + Iteration 56 +******************************************************************************** +λ message Alarm --> Burglar +λAlarm(b1) += [p(a1|b1,f1).πAlarm(f1) + p(a1|b1,f2).πAlarm(f2)].λ(a1) ++ [p(a2|b1,f1).πAlarm(f1) + p(a2|b1,f2).πAlarm(f2)].λ(a2) += [(0.992x0.03) + (0.99x0.97)]x0.5 ++ [(0.008x0.03) + (0.01x0.97)]x0.5 = 0.5 +λAlarm(b2) += [p(a1|b2,f1).πAlarm(f1) + p(a1|b2,f2).πAlarm(f2)].λ(a1) ++ [p(a2|b2,f1).πAlarm(f1) + p(a2|b2,f2).πAlarm(f2)].λ(a2) += [(0.2x0.03) + (0.003x0.97)]x0.5 ++ [(0.8x0.03) + (0.997x0.97)]x0.5 = 0.5 + +λ message Alarm --> FreightTruck +λAlarm(f1) += [p(a1|b1,f1).πAlarm(b1) + p(a1|b2,f1).πAlarm(b2)].λ(a1) ++ [p(a2|b1,f1).πAlarm(b1) + p(a2|b2,f1).πAlarm(b2)].λ(a2) += [(0.992x0.005) + (0.2x0.995)]x0.5 ++ [(0.008x0.005) + (0.8x0.995)]x0.5 = 0.5 +λAlarm(f2) += [p(a1|b1,f2).πAlarm(b1) + p(a1|b2,f2).πAlarm(b2)].λ(a1) ++ [p(a2|b1,f2).πAlarm(b1) + p(a2|b2,f2).πAlarm(b2)].λ(a2) += [(0.99x0.005) + (0.003x0.995)]x0.5 ++ [(0.01x0.005) + (0.997x0.995)]x0.5 = 0.5 + +λ message _Jn --> FreightTruck +λ_Jn(f1) += [p(_jn0|f1,a1).π_Jn(a1) + p(_jn0|f1,a2).π_Jn(a2)].λ(_jn0) ++ [p(_jn1|f1,a1).π_Jn(a1) + p(_jn1|f1,a2).π_Jn(a2)].λ(_jn1) ++ [p(_jn2|f1,a1).π_Jn(a1) + p(_jn2|f1,a2).π_Jn(a2)].λ(_jn2) ++ [p(_jn3|f1,a1).π_Jn(a1) + p(_jn3|f1,a2).π_Jn(a2)].λ(_jn3) += [(1x0.0138158) + (0x0.986184)]x1 ++ [(0x0.0138158) + (1x0.986184)]x1 ++ [(0x0.0138158) + (0x0.986184)]x1 ++ [(0x0.0138158) + (0x0.986184)]x1 = 1 +λ_Jn(f2) += [p(_jn0|f2,a1).π_Jn(a1) + p(_jn0|f2,a2).π_Jn(a2)].λ(_jn0) ++ [p(_jn1|f2,a1).π_Jn(a1) + p(_jn1|f2,a2).π_Jn(a2)].λ(_jn1) ++ [p(_jn2|f2,a1).π_Jn(a1) + p(_jn2|f2,a2).π_Jn(a2)].λ(_jn2) ++ [p(_jn3|f2,a1).π_Jn(a1) + p(_jn3|f2,a2).π_Jn(a2)].λ(_jn3) += [(0x0.0138158) + (0x0.986184)]x1 ++ [(0x0.0138158) + (0x0.986184)]x1 ++ [(1x0.0138158) + (0x0.986184)]x1 ++ [(0x0.0138158) + (1x0.986184)]x1 = 1 + +λ message _Jn --> Alarm +λ_Jn(a1) += [p(_jn0|f1,a1).π_Jn(f1) + p(_jn0|f2,a1).π_Jn(f2)].λ(_jn0) ++ [p(_jn1|f1,a1).π_Jn(f1) + p(_jn1|f2,a1).π_Jn(f2)].λ(_jn1) ++ [p(_jn2|f1,a1).π_Jn(f1) + p(_jn2|f2,a1).π_Jn(f2)].λ(_jn2) ++ [p(_jn3|f1,a1).π_Jn(f1) + p(_jn3|f2,a1).π_Jn(f2)].λ(_jn3) += [(1x0.03) + (0x0.97)]x1 ++ [(0x0.03) + (0x0.97)]x1 ++ [(0x0.03) + (1x0.97)]x1 ++ [(0x0.03) + (0x0.97)]x1 = 1 +λ_Jn(a2) += [p(_jn0|f1,a2).π_Jn(f1) + p(_jn0|f2,a2).π_Jn(f2)].λ(_jn0) ++ [p(_jn1|f1,a2).π_Jn(f1) + p(_jn1|f2,a2).π_Jn(f2)].λ(_jn1) ++ [p(_jn2|f1,a2).π_Jn(f1) + p(_jn2|f2,a2).π_Jn(f2)].λ(_jn2) ++ [p(_jn3|f1,a2).π_Jn(f1) + p(_jn3|f2,a2).π_Jn(f2)].λ(_jn3) += [(0x0.03) + (0x0.97)]x1 ++ [(1x0.03) + (0x0.97)]x1 ++ [(0x0.03) + (0x0.97)]x1 ++ [(0x0.03) + (1x0.97)]x1 = 1 + +π message Burglar --> Alarm +πAlarm(b1) = π(b1) = 0.005 = 0.005 +πAlarm(b2) = π(b2) = 0.995 = 0.995 + +π message FreightTruck --> Alarm +πAlarm(f1) = π(f1).λ_Jn(f1) = 0.03 x 0.5 = 0.015 +πAlarm(f2) = π(f2).λ_Jn(f2) = 0.97 x 0.5 = 0.485 + +π message FreightTruck --> _Jn +π_Jn(f1) = π(f1).λAlarm(f1) = 0.03 x 0.5 = 0.015 +π_Jn(f2) = π(f2).λAlarm(f2) = 0.97 x 0.5 = 0.485 + +π message Alarm --> _Jn +π_Jn(a1) = π(a1) = 0.0138158 = 0.01381575002 +π_Jn(a2) = π(a2) = 0.986184 = 0.98618425 + +var Burglar: +π(b1) += p(b1) += (0.005) = 0.005 +π(b2) += p(b2) += (0.995) = 0.995 +λ(b1) = λAlarm(b1) = 0.5 = 0.5 +λ(b2) = λAlarm(b2) = 0.5 = 0.5 +belief change = 0 + +var FreightTruck: +π(f1) += p(f1) += (0.03) = 0.03 +π(f2) += p(f2) += (0.97) = 0.97 +λ(f1) = λAlarm(f1).λ_Jn(f1) = 0.5 x 0.5 = 0.25 +λ(f2) = λAlarm(f2).λ_Jn(f2) = 0.5 x 0.5 = 0.25 +belief change = 0 + +var Alarm: +π(a1) += p(a1|b1,f1).πAlarm(b1).πAlarm(f1) ++ p(a1|b1,f2).πAlarm(b1).πAlarm(f2) ++ p(a1|b2,f1).πAlarm(b2).πAlarm(f1) ++ p(a1|b2,f2).πAlarm(b2).πAlarm(f2) += (0.992x0.005x0.03) ++ (0.99x0.005x0.97) ++ (0.2x0.995x0.03) ++ (0.003x0.995x0.97) = 0.01381575001 +π(a2) += p(a2|b1,f1).πAlarm(b1).πAlarm(f1) ++ p(a2|b1,f2).πAlarm(b1).πAlarm(f2) ++ p(a2|b2,f1).πAlarm(b2).πAlarm(f1) ++ p(a2|b2,f2).πAlarm(b2).πAlarm(f2) += (0.008x0.005x0.03) ++ (0.01x0.005x0.97) ++ (0.8x0.995x0.03) ++ (0.997x0.995x0.97) = 0.98618425 +λ(a1) = λ_Jn(a1) = 0.5 = 0.5 +λ(a2) = λ_Jn(a2) = 0.5 = 0.5 +belief change = 1.268522093e-11 + +var _Jn: +π(_jn0) += p(_jn0|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn0|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn0|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn0|f2,a2).π_Jn(f2).π_Jn(a2) += (1x0.03x0.0138158) ++ (0x0.03x0.986184) ++ (0x0.97x0.0138158) ++ (0x0.97x0.986184) = 0.000414472502 +π(_jn1) += p(_jn1|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn1|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn1|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn1|f2,a2).π_Jn(f2).π_Jn(a2) += (0x0.03x0.0138158) ++ (1x0.03x0.986184) ++ (0x0.97x0.0138158) ++ (0x0.97x0.986184) = 0.02958552756 +π(_jn2) += p(_jn2|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn2|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn2|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn2|f2,a2).π_Jn(f2).π_Jn(a2) += (0x0.03x0.0138158) ++ (0x0.03x0.986184) ++ (1x0.97x0.0138158) ++ (0x0.97x0.986184) = 0.01340127754 +π(_jn3) += p(_jn3|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn3|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn3|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn3|f2,a2).π_Jn(f2).π_Jn(a2) += (0x0.03x0.0138158) ++ (0x0.03x0.986184) ++ (0x0.97x0.0138158) ++ (1x0.97x0.986184) = 0.9565987224 +λ(_jn0) = 1 +λ(_jn1) = 1 +λ(_jn2) = 1 +λ(_jn3) = 1 +belief change = 1.007329311e-10 + +domain π(Burglar) λ(Burglar) belief +---------------------------------------------------------------- +b1 0.005 0.5 0.005 +b2 0.995 0.5 0.995 + +domain πAlarm(Burglar) λAlarm(Burglar) +---------------------------------------------------------------- +b1 0.005 0.5 +b2 0.995 0.5 + +domain π(FreightTruck) λ(FreightTruck) belief +---------------------------------------------------------------- +f1 0.03 0.25 0.03 +f2 0.97 0.25 0.97 + +domain πAlarm(FreightTruck) λAlarm(FreightTruck) +---------------------------------------------------------------- +f1 0.03000000006 0.5 +f2 0.9699999999 0.5 + +domain π_Jn(FreightTruck) λ_Jn(FreightTruck) +---------------------------------------------------------------- +f1 0.03000000006 0.5 +f2 0.9699999999 0.5 + +domain π(Alarm) λ(Alarm) belief +---------------------------------------------------------------- +a1 0.01381575001 0.5 0.01381575001 +a2 0.98618425 0.5 0.98618425 + +domain π_Jn(Alarm) λ_Jn(Alarm) +---------------------------------------------------------------- +a1 0.01381575004 0.5 +a2 0.98618425 0.5 + +domain π(_Jn) λ(_Jn) belief +---------------------------------------------------------------- +_jn0 0.000414472502 1 0.000414472502 +_jn1 0.02958552756 1 0.02958552756 +_jn2 0.01340127754 1 0.01340127754 +_jn3 0.9565987224 1 0.9565987224 + + + +******************************************************************************** + Iteration 57 +******************************************************************************** +λ message Alarm --> Burglar +λAlarm(b1) += [p(a1|b1,f1).πAlarm(f1) + p(a1|b1,f2).πAlarm(f2)].λ(a1) ++ [p(a2|b1,f1).πAlarm(f1) + p(a2|b1,f2).πAlarm(f2)].λ(a2) += [(0.992x0.03) + (0.99x0.97)]x0.5 ++ [(0.008x0.03) + (0.01x0.97)]x0.5 = 0.5 +λAlarm(b2) += [p(a1|b2,f1).πAlarm(f1) + p(a1|b2,f2).πAlarm(f2)].λ(a1) ++ [p(a2|b2,f1).πAlarm(f1) + p(a2|b2,f2).πAlarm(f2)].λ(a2) += [(0.2x0.03) + (0.003x0.97)]x0.5 ++ [(0.8x0.03) + (0.997x0.97)]x0.5 = 0.5 + +λ message Alarm --> FreightTruck +λAlarm(f1) += [p(a1|b1,f1).πAlarm(b1) + p(a1|b2,f1).πAlarm(b2)].λ(a1) ++ [p(a2|b1,f1).πAlarm(b1) + p(a2|b2,f1).πAlarm(b2)].λ(a2) += [(0.992x0.005) + (0.2x0.995)]x0.5 ++ [(0.008x0.005) + (0.8x0.995)]x0.5 = 0.5 +λAlarm(f2) += [p(a1|b1,f2).πAlarm(b1) + p(a1|b2,f2).πAlarm(b2)].λ(a1) ++ [p(a2|b1,f2).πAlarm(b1) + p(a2|b2,f2).πAlarm(b2)].λ(a2) += [(0.99x0.005) + (0.003x0.995)]x0.5 ++ [(0.01x0.005) + (0.997x0.995)]x0.5 = 0.5 + +λ message _Jn --> FreightTruck +λ_Jn(f1) += [p(_jn0|f1,a1).π_Jn(a1) + p(_jn0|f1,a2).π_Jn(a2)].λ(_jn0) ++ [p(_jn1|f1,a1).π_Jn(a1) + p(_jn1|f1,a2).π_Jn(a2)].λ(_jn1) ++ [p(_jn2|f1,a1).π_Jn(a1) + p(_jn2|f1,a2).π_Jn(a2)].λ(_jn2) ++ [p(_jn3|f1,a1).π_Jn(a1) + p(_jn3|f1,a2).π_Jn(a2)].λ(_jn3) += [(1x0.0138158) + (0x0.986184)]x1 ++ [(0x0.0138158) + (1x0.986184)]x1 ++ [(0x0.0138158) + (0x0.986184)]x1 ++ [(0x0.0138158) + (0x0.986184)]x1 = 1 +λ_Jn(f2) += [p(_jn0|f2,a1).π_Jn(a1) + p(_jn0|f2,a2).π_Jn(a2)].λ(_jn0) ++ [p(_jn1|f2,a1).π_Jn(a1) + p(_jn1|f2,a2).π_Jn(a2)].λ(_jn1) ++ [p(_jn2|f2,a1).π_Jn(a1) + p(_jn2|f2,a2).π_Jn(a2)].λ(_jn2) ++ [p(_jn3|f2,a1).π_Jn(a1) + p(_jn3|f2,a2).π_Jn(a2)].λ(_jn3) += [(0x0.0138158) + (0x0.986184)]x1 ++ [(0x0.0138158) + (0x0.986184)]x1 ++ [(1x0.0138158) + (0x0.986184)]x1 ++ [(0x0.0138158) + (1x0.986184)]x1 = 1 + +λ message _Jn --> Alarm +λ_Jn(a1) += [p(_jn0|f1,a1).π_Jn(f1) + p(_jn0|f2,a1).π_Jn(f2)].λ(_jn0) ++ [p(_jn1|f1,a1).π_Jn(f1) + p(_jn1|f2,a1).π_Jn(f2)].λ(_jn1) ++ [p(_jn2|f1,a1).π_Jn(f1) + p(_jn2|f2,a1).π_Jn(f2)].λ(_jn2) ++ [p(_jn3|f1,a1).π_Jn(f1) + p(_jn3|f2,a1).π_Jn(f2)].λ(_jn3) += [(1x0.03) + (0x0.97)]x1 ++ [(0x0.03) + (0x0.97)]x1 ++ [(0x0.03) + (1x0.97)]x1 ++ [(0x0.03) + (0x0.97)]x1 = 1 +λ_Jn(a2) += [p(_jn0|f1,a2).π_Jn(f1) + p(_jn0|f2,a2).π_Jn(f2)].λ(_jn0) ++ [p(_jn1|f1,a2).π_Jn(f1) + p(_jn1|f2,a2).π_Jn(f2)].λ(_jn1) ++ [p(_jn2|f1,a2).π_Jn(f1) + p(_jn2|f2,a2).π_Jn(f2)].λ(_jn2) ++ [p(_jn3|f1,a2).π_Jn(f1) + p(_jn3|f2,a2).π_Jn(f2)].λ(_jn3) += [(0x0.03) + (0x0.97)]x1 ++ [(1x0.03) + (0x0.97)]x1 ++ [(0x0.03) + (0x0.97)]x1 ++ [(0x0.03) + (1x0.97)]x1 = 1 + +π message Burglar --> Alarm +πAlarm(b1) = π(b1) = 0.005 = 0.005 +πAlarm(b2) = π(b2) = 0.995 = 0.995 + +π message FreightTruck --> Alarm +πAlarm(f1) = π(f1).λ_Jn(f1) = 0.03 x 0.5 = 0.015 +πAlarm(f2) = π(f2).λ_Jn(f2) = 0.97 x 0.5 = 0.485 + +π message FreightTruck --> _Jn +π_Jn(f1) = π(f1).λAlarm(f1) = 0.03 x 0.5 = 0.015 +π_Jn(f2) = π(f2).λAlarm(f2) = 0.97 x 0.5 = 0.485 + +π message Alarm --> _Jn +π_Jn(a1) = π(a1) = 0.0138158 = 0.01381575001 +π_Jn(a2) = π(a2) = 0.986184 = 0.98618425 + +var Burglar: +π(b1) += p(b1) += (0.005) = 0.005 +π(b2) += p(b2) += (0.995) = 0.995 +λ(b1) = λAlarm(b1) = 0.5 = 0.5 +λ(b2) = λAlarm(b2) = 0.5 = 0.5 +belief change = 0 + +var FreightTruck: +π(f1) += p(f1) += (0.03) = 0.03 +π(f2) += p(f2) += (0.97) = 0.97 +λ(f1) = λAlarm(f1).λ_Jn(f1) = 0.5 x 0.5 = 0.25 +λ(f2) = λAlarm(f2).λ_Jn(f2) = 0.5 x 0.5 = 0.25 +belief change = 0 + +var Alarm: +π(a1) += p(a1|b1,f1).πAlarm(b1).πAlarm(f1) ++ p(a1|b1,f2).πAlarm(b1).πAlarm(f2) ++ p(a1|b2,f1).πAlarm(b2).πAlarm(f1) ++ p(a1|b2,f2).πAlarm(b2).πAlarm(f2) += (0.992x0.005x0.03) ++ (0.99x0.005x0.97) ++ (0.2x0.995x0.03) ++ (0.003x0.995x0.97) = 0.01381575001 +π(a2) += p(a2|b1,f1).πAlarm(b1).πAlarm(f1) ++ p(a2|b1,f2).πAlarm(b1).πAlarm(f2) ++ p(a2|b2,f1).πAlarm(b2).πAlarm(f1) ++ p(a2|b2,f2).πAlarm(b2).πAlarm(f2) += (0.008x0.005x0.03) ++ (0.01x0.005x0.97) ++ (0.8x0.995x0.03) ++ (0.997x0.995x0.97) = 0.98618425 +λ(a1) = λ_Jn(a1) = 0.5 = 0.5 +λ(a2) = λ_Jn(a2) = 0.5 = 0.5 +belief change = 8.456813375e-12 + +var _Jn: +π(_jn0) += p(_jn0|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn0|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn0|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn0|f2,a2).π_Jn(f2).π_Jn(a2) += (1x0.03x0.0138158) ++ (0x0.03x0.986184) ++ (0x0.97x0.0138158) ++ (0x0.97x0.986184) = 0.0004144725014 +π(_jn1) += p(_jn1|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn1|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn1|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn1|f2,a2).π_Jn(f2).π_Jn(a2) += (0x0.03x0.0138158) ++ (1x0.03x0.986184) ++ (0x0.97x0.0138158) ++ (0x0.97x0.986184) = 0.02958552754 +π(_jn2) += p(_jn2|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn2|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn2|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn2|f2,a2).π_Jn(f2).π_Jn(a2) += (0x0.03x0.0138158) ++ (0x0.03x0.986184) ++ (1x0.97x0.0138158) ++ (0x0.97x0.986184) = 0.01340127752 +π(_jn3) += p(_jn3|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn3|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn3|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn3|f2,a2).π_Jn(f2).π_Jn(a2) += (0x0.03x0.0138158) ++ (0x0.03x0.986184) ++ (0x0.97x0.0138158) ++ (1x0.97x0.986184) = 0.9565987224 +λ(_jn0) = 1 +λ(_jn1) = 1 +λ(_jn2) = 1 +λ(_jn3) = 1 +belief change = 6.715544169e-11 + +domain π(Burglar) λ(Burglar) belief +---------------------------------------------------------------- +b1 0.005 0.5 0.005 +b2 0.995 0.5 0.995 + +domain πAlarm(Burglar) λAlarm(Burglar) +---------------------------------------------------------------- +b1 0.005 0.5 +b2 0.995 0.5 + +domain π(FreightTruck) λ(FreightTruck) belief +---------------------------------------------------------------- +f1 0.03 0.25 0.03 +f2 0.97 0.25 0.97 + +domain πAlarm(FreightTruck) λAlarm(FreightTruck) +---------------------------------------------------------------- +f1 0.03000000004 0.5 +f2 0.97 0.5 + +domain π_Jn(FreightTruck) λ_Jn(FreightTruck) +---------------------------------------------------------------- +f1 0.03000000004 0.5 +f2 0.97 0.5 + +domain π(Alarm) λ(Alarm) belief +---------------------------------------------------------------- +a1 0.01381575001 0.5 0.01381575001 +a2 0.98618425 0.5 0.98618425 + +domain π_Jn(Alarm) λ_Jn(Alarm) +---------------------------------------------------------------- +a1 0.01381575003 0.5 +a2 0.98618425 0.5 + +domain π(_Jn) λ(_Jn) belief +---------------------------------------------------------------- +_jn0 0.0004144725014 1 0.0004144725014 +_jn1 0.02958552754 1 0.02958552754 +_jn2 0.01340127752 1 0.01340127752 +_jn3 0.9565987224 1 0.9565987224 + + + +******************************************************************************** + Iteration 58 +******************************************************************************** +λ message Alarm --> Burglar +λAlarm(b1) += [p(a1|b1,f1).πAlarm(f1) + p(a1|b1,f2).πAlarm(f2)].λ(a1) ++ [p(a2|b1,f1).πAlarm(f1) + p(a2|b1,f2).πAlarm(f2)].λ(a2) += [(0.992x0.03) + (0.99x0.97)]x0.5 ++ [(0.008x0.03) + (0.01x0.97)]x0.5 = 0.5 +λAlarm(b2) += [p(a1|b2,f1).πAlarm(f1) + p(a1|b2,f2).πAlarm(f2)].λ(a1) ++ [p(a2|b2,f1).πAlarm(f1) + p(a2|b2,f2).πAlarm(f2)].λ(a2) += [(0.2x0.03) + (0.003x0.97)]x0.5 ++ [(0.8x0.03) + (0.997x0.97)]x0.5 = 0.5 + +λ message Alarm --> FreightTruck +λAlarm(f1) += [p(a1|b1,f1).πAlarm(b1) + p(a1|b2,f1).πAlarm(b2)].λ(a1) ++ [p(a2|b1,f1).πAlarm(b1) + p(a2|b2,f1).πAlarm(b2)].λ(a2) += [(0.992x0.005) + (0.2x0.995)]x0.5 ++ [(0.008x0.005) + (0.8x0.995)]x0.5 = 0.5 +λAlarm(f2) += [p(a1|b1,f2).πAlarm(b1) + p(a1|b2,f2).πAlarm(b2)].λ(a1) ++ [p(a2|b1,f2).πAlarm(b1) + p(a2|b2,f2).πAlarm(b2)].λ(a2) += [(0.99x0.005) + (0.003x0.995)]x0.5 ++ [(0.01x0.005) + (0.997x0.995)]x0.5 = 0.5 + +λ message _Jn --> FreightTruck +λ_Jn(f1) += [p(_jn0|f1,a1).π_Jn(a1) + p(_jn0|f1,a2).π_Jn(a2)].λ(_jn0) ++ [p(_jn1|f1,a1).π_Jn(a1) + p(_jn1|f1,a2).π_Jn(a2)].λ(_jn1) ++ [p(_jn2|f1,a1).π_Jn(a1) + p(_jn2|f1,a2).π_Jn(a2)].λ(_jn2) ++ [p(_jn3|f1,a1).π_Jn(a1) + p(_jn3|f1,a2).π_Jn(a2)].λ(_jn3) += [(1x0.0138158) + (0x0.986184)]x1 ++ [(0x0.0138158) + (1x0.986184)]x1 ++ [(0x0.0138158) + (0x0.986184)]x1 ++ [(0x0.0138158) + (0x0.986184)]x1 = 1 +λ_Jn(f2) += [p(_jn0|f2,a1).π_Jn(a1) + p(_jn0|f2,a2).π_Jn(a2)].λ(_jn0) ++ [p(_jn1|f2,a1).π_Jn(a1) + p(_jn1|f2,a2).π_Jn(a2)].λ(_jn1) ++ [p(_jn2|f2,a1).π_Jn(a1) + p(_jn2|f2,a2).π_Jn(a2)].λ(_jn2) ++ [p(_jn3|f2,a1).π_Jn(a1) + p(_jn3|f2,a2).π_Jn(a2)].λ(_jn3) += [(0x0.0138158) + (0x0.986184)]x1 ++ [(0x0.0138158) + (0x0.986184)]x1 ++ [(1x0.0138158) + (0x0.986184)]x1 ++ [(0x0.0138158) + (1x0.986184)]x1 = 1 + +λ message _Jn --> Alarm +λ_Jn(a1) += [p(_jn0|f1,a1).π_Jn(f1) + p(_jn0|f2,a1).π_Jn(f2)].λ(_jn0) ++ [p(_jn1|f1,a1).π_Jn(f1) + p(_jn1|f2,a1).π_Jn(f2)].λ(_jn1) ++ [p(_jn2|f1,a1).π_Jn(f1) + p(_jn2|f2,a1).π_Jn(f2)].λ(_jn2) ++ [p(_jn3|f1,a1).π_Jn(f1) + p(_jn3|f2,a1).π_Jn(f2)].λ(_jn3) += [(1x0.03) + (0x0.97)]x1 ++ [(0x0.03) + (0x0.97)]x1 ++ [(0x0.03) + (1x0.97)]x1 ++ [(0x0.03) + (0x0.97)]x1 = 1 +λ_Jn(a2) += [p(_jn0|f1,a2).π_Jn(f1) + p(_jn0|f2,a2).π_Jn(f2)].λ(_jn0) ++ [p(_jn1|f1,a2).π_Jn(f1) + p(_jn1|f2,a2).π_Jn(f2)].λ(_jn1) ++ [p(_jn2|f1,a2).π_Jn(f1) + p(_jn2|f2,a2).π_Jn(f2)].λ(_jn2) ++ [p(_jn3|f1,a2).π_Jn(f1) + p(_jn3|f2,a2).π_Jn(f2)].λ(_jn3) += [(0x0.03) + (0x0.97)]x1 ++ [(1x0.03) + (0x0.97)]x1 ++ [(0x0.03) + (0x0.97)]x1 ++ [(0x0.03) + (1x0.97)]x1 = 1 + +π message Burglar --> Alarm +πAlarm(b1) = π(b1) = 0.005 = 0.005 +πAlarm(b2) = π(b2) = 0.995 = 0.995 + +π message FreightTruck --> Alarm +πAlarm(f1) = π(f1).λ_Jn(f1) = 0.03 x 0.5 = 0.015 +πAlarm(f2) = π(f2).λ_Jn(f2) = 0.97 x 0.5 = 0.485 + +π message FreightTruck --> _Jn +π_Jn(f1) = π(f1).λAlarm(f1) = 0.03 x 0.5 = 0.015 +π_Jn(f2) = π(f2).λAlarm(f2) = 0.97 x 0.5 = 0.485 + +π message Alarm --> _Jn +π_Jn(a1) = π(a1) = 0.0138158 = 0.01381575001 +π_Jn(a2) = π(a2) = 0.986184 = 0.98618425 + +var Burglar: +π(b1) += p(b1) += (0.005) = 0.005 +π(b2) += p(b2) += (0.995) = 0.995 +λ(b1) = λAlarm(b1) = 0.5 = 0.5 +λ(b2) = λAlarm(b2) = 0.5 = 0.5 +belief change = 0 + +var FreightTruck: +π(f1) += p(f1) += (0.03) = 0.03 +π(f2) += p(f2) += (0.97) = 0.97 +λ(f1) = λAlarm(f1).λ_Jn(f1) = 0.5 x 0.5 = 0.25 +λ(f2) = λAlarm(f2).λ_Jn(f2) = 0.5 x 0.5 = 0.25 +belief change = 0 + +var Alarm: +π(a1) += p(a1|b1,f1).πAlarm(b1).πAlarm(f1) ++ p(a1|b1,f2).πAlarm(b1).πAlarm(f2) ++ p(a1|b2,f1).πAlarm(b2).πAlarm(f1) ++ p(a1|b2,f2).πAlarm(b2).πAlarm(f2) += (0.992x0.005x0.03) ++ (0.99x0.005x0.97) ++ (0.2x0.995x0.03) ++ (0.003x0.995x0.97) = 0.01381575001 +π(a2) += p(a2|b1,f1).πAlarm(b1).πAlarm(f1) ++ p(a2|b1,f2).πAlarm(b1).πAlarm(f2) ++ p(a2|b2,f1).πAlarm(b2).πAlarm(f1) ++ p(a2|b2,f2).πAlarm(b2).πAlarm(f2) += (0.008x0.005x0.03) ++ (0.01x0.005x0.97) ++ (0.8x0.995x0.03) ++ (0.997x0.995x0.97) = 0.98618425 +λ(a1) = λ_Jn(a1) = 0.5 = 0.5 +λ(a2) = λ_Jn(a2) = 0.5 = 0.5 +belief change = 5.637913747e-12 + +var _Jn: +π(_jn0) += p(_jn0|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn0|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn0|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn0|f2,a2).π_Jn(f2).π_Jn(a2) += (1x0.03x0.0138158) ++ (0x0.03x0.986184) ++ (0x0.97x0.0138158) ++ (0x0.97x0.986184) = 0.0004144725009 +π(_jn1) += p(_jn1|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn1|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn1|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn1|f2,a2).π_Jn(f2).π_Jn(a2) += (0x0.03x0.0138158) ++ (1x0.03x0.986184) ++ (0x0.97x0.0138158) ++ (0x0.97x0.986184) = 0.02958552753 +π(_jn2) += p(_jn2|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn2|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn2|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn2|f2,a2).π_Jn(f2).π_Jn(a2) += (0x0.03x0.0138158) ++ (0x0.03x0.986184) ++ (1x0.97x0.0138158) ++ (0x0.97x0.986184) = 0.01340127752 +π(_jn3) += p(_jn3|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn3|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn3|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn3|f2,a2).π_Jn(f2).π_Jn(a2) += (0x0.03x0.0138158) ++ (0x0.03x0.986184) ++ (0x0.97x0.0138158) ++ (1x0.97x0.986184) = 0.9565987225 +λ(_jn0) = 1 +λ(_jn1) = 1 +λ(_jn2) = 1 +λ(_jn3) = 1 +belief change = 4.477005312e-11 + +domain π(Burglar) λ(Burglar) belief +---------------------------------------------------------------- +b1 0.005 0.5 0.005 +b2 0.995 0.5 0.995 + +domain πAlarm(Burglar) λAlarm(Burglar) +---------------------------------------------------------------- +b1 0.005 0.5 +b2 0.995 0.5 + +domain π(FreightTruck) λ(FreightTruck) belief +---------------------------------------------------------------- +f1 0.03 0.25 0.03 +f2 0.97 0.25 0.97 + +domain πAlarm(FreightTruck) λAlarm(FreightTruck) +---------------------------------------------------------------- +f1 0.03000000003 0.5 +f2 0.97 0.5 + +domain π_Jn(FreightTruck) λ_Jn(FreightTruck) +---------------------------------------------------------------- +f1 0.03000000003 0.5 +f2 0.97 0.5 + +domain π(Alarm) λ(Alarm) belief +---------------------------------------------------------------- +a1 0.01381575001 0.5 0.01381575001 +a2 0.98618425 0.5 0.98618425 + +domain π_Jn(Alarm) λ_Jn(Alarm) +---------------------------------------------------------------- +a1 0.01381575002 0.5 +a2 0.98618425 0.5 + +domain π(_Jn) λ(_Jn) belief +---------------------------------------------------------------- +_jn0 0.0004144725009 1 0.0004144725009 +_jn1 0.02958552753 1 0.02958552753 +_jn2 0.01340127752 1 0.01340127752 +_jn3 0.9565987225 1 0.9565987225 + + + +******************************************************************************** + Iteration 59 +******************************************************************************** +λ message Alarm --> Burglar +λAlarm(b1) += [p(a1|b1,f1).πAlarm(f1) + p(a1|b1,f2).πAlarm(f2)].λ(a1) ++ [p(a2|b1,f1).πAlarm(f1) + p(a2|b1,f2).πAlarm(f2)].λ(a2) += [(0.992x0.03) + (0.99x0.97)]x0.5 ++ [(0.008x0.03) + (0.01x0.97)]x0.5 = 0.5 +λAlarm(b2) += [p(a1|b2,f1).πAlarm(f1) + p(a1|b2,f2).πAlarm(f2)].λ(a1) ++ [p(a2|b2,f1).πAlarm(f1) + p(a2|b2,f2).πAlarm(f2)].λ(a2) += [(0.2x0.03) + (0.003x0.97)]x0.5 ++ [(0.8x0.03) + (0.997x0.97)]x0.5 = 0.5 + +λ message Alarm --> FreightTruck +λAlarm(f1) += [p(a1|b1,f1).πAlarm(b1) + p(a1|b2,f1).πAlarm(b2)].λ(a1) ++ [p(a2|b1,f1).πAlarm(b1) + p(a2|b2,f1).πAlarm(b2)].λ(a2) += [(0.992x0.005) + (0.2x0.995)]x0.5 ++ [(0.008x0.005) + (0.8x0.995)]x0.5 = 0.5 +λAlarm(f2) += [p(a1|b1,f2).πAlarm(b1) + p(a1|b2,f2).πAlarm(b2)].λ(a1) ++ [p(a2|b1,f2).πAlarm(b1) + p(a2|b2,f2).πAlarm(b2)].λ(a2) += [(0.99x0.005) + (0.003x0.995)]x0.5 ++ [(0.01x0.005) + (0.997x0.995)]x0.5 = 0.5 + +λ message _Jn --> FreightTruck +λ_Jn(f1) += [p(_jn0|f1,a1).π_Jn(a1) + p(_jn0|f1,a2).π_Jn(a2)].λ(_jn0) ++ [p(_jn1|f1,a1).π_Jn(a1) + p(_jn1|f1,a2).π_Jn(a2)].λ(_jn1) ++ [p(_jn2|f1,a1).π_Jn(a1) + p(_jn2|f1,a2).π_Jn(a2)].λ(_jn2) ++ [p(_jn3|f1,a1).π_Jn(a1) + p(_jn3|f1,a2).π_Jn(a2)].λ(_jn3) += [(1x0.0138158) + (0x0.986184)]x1 ++ [(0x0.0138158) + (1x0.986184)]x1 ++ [(0x0.0138158) + (0x0.986184)]x1 ++ [(0x0.0138158) + (0x0.986184)]x1 = 1 +λ_Jn(f2) += [p(_jn0|f2,a1).π_Jn(a1) + p(_jn0|f2,a2).π_Jn(a2)].λ(_jn0) ++ [p(_jn1|f2,a1).π_Jn(a1) + p(_jn1|f2,a2).π_Jn(a2)].λ(_jn1) ++ [p(_jn2|f2,a1).π_Jn(a1) + p(_jn2|f2,a2).π_Jn(a2)].λ(_jn2) ++ [p(_jn3|f2,a1).π_Jn(a1) + p(_jn3|f2,a2).π_Jn(a2)].λ(_jn3) += [(0x0.0138158) + (0x0.986184)]x1 ++ [(0x0.0138158) + (0x0.986184)]x1 ++ [(1x0.0138158) + (0x0.986184)]x1 ++ [(0x0.0138158) + (1x0.986184)]x1 = 1 + +λ message _Jn --> Alarm +λ_Jn(a1) += [p(_jn0|f1,a1).π_Jn(f1) + p(_jn0|f2,a1).π_Jn(f2)].λ(_jn0) ++ [p(_jn1|f1,a1).π_Jn(f1) + p(_jn1|f2,a1).π_Jn(f2)].λ(_jn1) ++ [p(_jn2|f1,a1).π_Jn(f1) + p(_jn2|f2,a1).π_Jn(f2)].λ(_jn2) ++ [p(_jn3|f1,a1).π_Jn(f1) + p(_jn3|f2,a1).π_Jn(f2)].λ(_jn3) += [(1x0.03) + (0x0.97)]x1 ++ [(0x0.03) + (0x0.97)]x1 ++ [(0x0.03) + (1x0.97)]x1 ++ [(0x0.03) + (0x0.97)]x1 = 1 +λ_Jn(a2) += [p(_jn0|f1,a2).π_Jn(f1) + p(_jn0|f2,a2).π_Jn(f2)].λ(_jn0) ++ [p(_jn1|f1,a2).π_Jn(f1) + p(_jn1|f2,a2).π_Jn(f2)].λ(_jn1) ++ [p(_jn2|f1,a2).π_Jn(f1) + p(_jn2|f2,a2).π_Jn(f2)].λ(_jn2) ++ [p(_jn3|f1,a2).π_Jn(f1) + p(_jn3|f2,a2).π_Jn(f2)].λ(_jn3) += [(0x0.03) + (0x0.97)]x1 ++ [(1x0.03) + (0x0.97)]x1 ++ [(0x0.03) + (0x0.97)]x1 ++ [(0x0.03) + (1x0.97)]x1 = 1 + +π message Burglar --> Alarm +πAlarm(b1) = π(b1) = 0.005 = 0.005 +πAlarm(b2) = π(b2) = 0.995 = 0.995 + +π message FreightTruck --> Alarm +πAlarm(f1) = π(f1).λ_Jn(f1) = 0.03 x 0.5 = 0.015 +πAlarm(f2) = π(f2).λ_Jn(f2) = 0.97 x 0.5 = 0.485 + +π message FreightTruck --> _Jn +π_Jn(f1) = π(f1).λAlarm(f1) = 0.03 x 0.5 = 0.015 +π_Jn(f2) = π(f2).λAlarm(f2) = 0.97 x 0.5 = 0.485 + +π message Alarm --> _Jn +π_Jn(a1) = π(a1) = 0.0138158 = 0.01381575001 +π_Jn(a2) = π(a2) = 0.986184 = 0.98618425 + +var Burglar: +π(b1) += p(b1) += (0.005) = 0.005 +π(b2) += p(b2) += (0.995) = 0.995 +λ(b1) = λAlarm(b1) = 0.5 = 0.5 +λ(b2) = λAlarm(b2) = 0.5 = 0.5 +belief change = 0 + +var FreightTruck: +π(f1) += p(f1) += (0.03) = 0.03 +π(f2) += p(f2) += (0.97) = 0.97 +λ(f1) = λAlarm(f1).λ_Jn(f1) = 0.5 x 0.5 = 0.25 +λ(f2) = λAlarm(f2).λ_Jn(f2) = 0.5 x 0.5 = 0.25 +belief change = 0 + +var Alarm: +π(a1) += p(a1|b1,f1).πAlarm(b1).πAlarm(f1) ++ p(a1|b1,f2).πAlarm(b1).πAlarm(f2) ++ p(a1|b2,f1).πAlarm(b2).πAlarm(f1) ++ p(a1|b2,f2).πAlarm(b2).πAlarm(f2) += (0.992x0.005x0.03) ++ (0.99x0.005x0.97) ++ (0.2x0.995x0.03) ++ (0.003x0.995x0.97) = 0.01381575 +π(a2) += p(a2|b1,f1).πAlarm(b1).πAlarm(f1) ++ p(a2|b1,f2).πAlarm(b1).πAlarm(f2) ++ p(a2|b2,f1).πAlarm(b2).πAlarm(f1) ++ p(a2|b2,f2).πAlarm(b2).πAlarm(f2) += (0.008x0.005x0.03) ++ (0.01x0.005x0.97) ++ (0.8x0.995x0.03) ++ (0.997x0.995x0.97) = 0.98618425 +λ(a1) = λ_Jn(a1) = 0.5 = 0.5 +λ(a2) = λ_Jn(a2) = 0.5 = 0.5 +belief change = 3.75856811e-12 + +var _Jn: +π(_jn0) += p(_jn0|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn0|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn0|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn0|f2,a2).π_Jn(f2).π_Jn(a2) += (1x0.03x0.0138158) ++ (0x0.03x0.986184) ++ (0x0.97x0.0138158) ++ (0x0.97x0.986184) = 0.0004144725006 +π(_jn1) += p(_jn1|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn1|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn1|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn1|f2,a2).π_Jn(f2).π_Jn(a2) += (0x0.03x0.0138158) ++ (1x0.03x0.986184) ++ (0x0.97x0.0138158) ++ (0x0.97x0.986184) = 0.02958552752 +π(_jn2) += p(_jn2|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn2|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn2|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn2|f2,a2).π_Jn(f2).π_Jn(a2) += (0x0.03x0.0138158) ++ (0x0.03x0.986184) ++ (1x0.97x0.0138158) ++ (0x0.97x0.986184) = 0.01340127751 +π(_jn3) += p(_jn3|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn3|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn3|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn3|f2,a2).π_Jn(f2).π_Jn(a2) += (0x0.03x0.0138158) ++ (0x0.03x0.986184) ++ (0x0.97x0.0138158) ++ (1x0.97x0.986184) = 0.9565987225 +λ(_jn0) = 1 +λ(_jn1) = 1 +λ(_jn2) = 1 +λ(_jn3) = 1 +belief change = 2.984675652e-11 + +domain π(Burglar) λ(Burglar) belief +---------------------------------------------------------------- +b1 0.005 0.5 0.005 +b2 0.995 0.5 0.995 + +domain πAlarm(Burglar) λAlarm(Burglar) +---------------------------------------------------------------- +b1 0.005 0.5 +b2 0.995 0.5 + +domain π(FreightTruck) λ(FreightTruck) belief +---------------------------------------------------------------- +f1 0.03 0.25 0.03 +f2 0.97 0.25 0.97 + +domain πAlarm(FreightTruck) λAlarm(FreightTruck) +---------------------------------------------------------------- +f1 0.03000000002 0.5 +f2 0.97 0.5 + +domain π_Jn(FreightTruck) λ_Jn(FreightTruck) +---------------------------------------------------------------- +f1 0.03000000002 0.5 +f2 0.97 0.5 + +domain π(Alarm) λ(Alarm) belief +---------------------------------------------------------------- +a1 0.01381575 0.5 0.01381575 +a2 0.98618425 0.5 0.98618425 + +domain π_Jn(Alarm) λ_Jn(Alarm) +---------------------------------------------------------------- +a1 0.01381575001 0.5 +a2 0.98618425 0.5 + +domain π(_Jn) λ(_Jn) belief +---------------------------------------------------------------- +_jn0 0.0004144725006 1 0.0004144725006 +_jn1 0.02958552752 1 0.02958552752 +_jn2 0.01340127751 1 0.01340127751 +_jn3 0.9565987225 1 0.9565987225 + + + +******************************************************************************** + Iteration 60 +******************************************************************************** +λ message Alarm --> Burglar +λAlarm(b1) += [p(a1|b1,f1).πAlarm(f1) + p(a1|b1,f2).πAlarm(f2)].λ(a1) ++ [p(a2|b1,f1).πAlarm(f1) + p(a2|b1,f2).πAlarm(f2)].λ(a2) += [(0.992x0.03) + (0.99x0.97)]x0.5 ++ [(0.008x0.03) + (0.01x0.97)]x0.5 = 0.5 +λAlarm(b2) += [p(a1|b2,f1).πAlarm(f1) + p(a1|b2,f2).πAlarm(f2)].λ(a1) ++ [p(a2|b2,f1).πAlarm(f1) + p(a2|b2,f2).πAlarm(f2)].λ(a2) += [(0.2x0.03) + (0.003x0.97)]x0.5 ++ [(0.8x0.03) + (0.997x0.97)]x0.5 = 0.5 + +λ message Alarm --> FreightTruck +λAlarm(f1) += [p(a1|b1,f1).πAlarm(b1) + p(a1|b2,f1).πAlarm(b2)].λ(a1) ++ [p(a2|b1,f1).πAlarm(b1) + p(a2|b2,f1).πAlarm(b2)].λ(a2) += [(0.992x0.005) + (0.2x0.995)]x0.5 ++ [(0.008x0.005) + (0.8x0.995)]x0.5 = 0.5 +λAlarm(f2) += [p(a1|b1,f2).πAlarm(b1) + p(a1|b2,f2).πAlarm(b2)].λ(a1) ++ [p(a2|b1,f2).πAlarm(b1) + p(a2|b2,f2).πAlarm(b2)].λ(a2) += [(0.99x0.005) + (0.003x0.995)]x0.5 ++ [(0.01x0.005) + (0.997x0.995)]x0.5 = 0.5 + +λ message _Jn --> FreightTruck +λ_Jn(f1) += [p(_jn0|f1,a1).π_Jn(a1) + p(_jn0|f1,a2).π_Jn(a2)].λ(_jn0) ++ [p(_jn1|f1,a1).π_Jn(a1) + p(_jn1|f1,a2).π_Jn(a2)].λ(_jn1) ++ [p(_jn2|f1,a1).π_Jn(a1) + p(_jn2|f1,a2).π_Jn(a2)].λ(_jn2) ++ [p(_jn3|f1,a1).π_Jn(a1) + p(_jn3|f1,a2).π_Jn(a2)].λ(_jn3) += [(1x0.0138158) + (0x0.986184)]x1 ++ [(0x0.0138158) + (1x0.986184)]x1 ++ [(0x0.0138158) + (0x0.986184)]x1 ++ [(0x0.0138158) + (0x0.986184)]x1 = 1 +λ_Jn(f2) += [p(_jn0|f2,a1).π_Jn(a1) + p(_jn0|f2,a2).π_Jn(a2)].λ(_jn0) ++ [p(_jn1|f2,a1).π_Jn(a1) + p(_jn1|f2,a2).π_Jn(a2)].λ(_jn1) ++ [p(_jn2|f2,a1).π_Jn(a1) + p(_jn2|f2,a2).π_Jn(a2)].λ(_jn2) ++ [p(_jn3|f2,a1).π_Jn(a1) + p(_jn3|f2,a2).π_Jn(a2)].λ(_jn3) += [(0x0.0138158) + (0x0.986184)]x1 ++ [(0x0.0138158) + (0x0.986184)]x1 ++ [(1x0.0138158) + (0x0.986184)]x1 ++ [(0x0.0138158) + (1x0.986184)]x1 = 1 + +λ message _Jn --> Alarm +λ_Jn(a1) += [p(_jn0|f1,a1).π_Jn(f1) + p(_jn0|f2,a1).π_Jn(f2)].λ(_jn0) ++ [p(_jn1|f1,a1).π_Jn(f1) + p(_jn1|f2,a1).π_Jn(f2)].λ(_jn1) ++ [p(_jn2|f1,a1).π_Jn(f1) + p(_jn2|f2,a1).π_Jn(f2)].λ(_jn2) ++ [p(_jn3|f1,a1).π_Jn(f1) + p(_jn3|f2,a1).π_Jn(f2)].λ(_jn3) += [(1x0.03) + (0x0.97)]x1 ++ [(0x0.03) + (0x0.97)]x1 ++ [(0x0.03) + (1x0.97)]x1 ++ [(0x0.03) + (0x0.97)]x1 = 1 +λ_Jn(a2) += [p(_jn0|f1,a2).π_Jn(f1) + p(_jn0|f2,a2).π_Jn(f2)].λ(_jn0) ++ [p(_jn1|f1,a2).π_Jn(f1) + p(_jn1|f2,a2).π_Jn(f2)].λ(_jn1) ++ [p(_jn2|f1,a2).π_Jn(f1) + p(_jn2|f2,a2).π_Jn(f2)].λ(_jn2) ++ [p(_jn3|f1,a2).π_Jn(f1) + p(_jn3|f2,a2).π_Jn(f2)].λ(_jn3) += [(0x0.03) + (0x0.97)]x1 ++ [(1x0.03) + (0x0.97)]x1 ++ [(0x0.03) + (0x0.97)]x1 ++ [(0x0.03) + (1x0.97)]x1 = 1 + +π message Burglar --> Alarm +πAlarm(b1) = π(b1) = 0.005 = 0.005 +πAlarm(b2) = π(b2) = 0.995 = 0.995 + +π message FreightTruck --> Alarm +πAlarm(f1) = π(f1).λ_Jn(f1) = 0.03 x 0.5 = 0.015 +πAlarm(f2) = π(f2).λ_Jn(f2) = 0.97 x 0.5 = 0.485 + +π message FreightTruck --> _Jn +π_Jn(f1) = π(f1).λAlarm(f1) = 0.03 x 0.5 = 0.015 +π_Jn(f2) = π(f2).λAlarm(f2) = 0.97 x 0.5 = 0.485 + +π message Alarm --> _Jn +π_Jn(a1) = π(a1) = 0.0138158 = 0.01381575 +π_Jn(a2) = π(a2) = 0.986184 = 0.98618425 + +var Burglar: +π(b1) += p(b1) += (0.005) = 0.005 +π(b2) += p(b2) += (0.995) = 0.995 +λ(b1) = λAlarm(b1) = 0.5 = 0.5 +λ(b2) = λAlarm(b2) = 0.5 = 0.5 +belief change = 0 + +var FreightTruck: +π(f1) += p(f1) += (0.03) = 0.03 +π(f2) += p(f2) += (0.97) = 0.97 +λ(f1) = λAlarm(f1).λ_Jn(f1) = 0.5 x 0.5 = 0.25 +λ(f2) = λAlarm(f2).λ_Jn(f2) = 0.5 x 0.5 = 0.25 +belief change = 0 + +var Alarm: +π(a1) += p(a1|b1,f1).πAlarm(b1).πAlarm(f1) ++ p(a1|b1,f2).πAlarm(b1).πAlarm(f2) ++ p(a1|b2,f1).πAlarm(b2).πAlarm(f1) ++ p(a1|b2,f2).πAlarm(b2).πAlarm(f2) += (0.992x0.005x0.03) ++ (0.99x0.005x0.97) ++ (0.2x0.995x0.03) ++ (0.003x0.995x0.97) = 0.01381575 +π(a2) += p(a2|b1,f1).πAlarm(b1).πAlarm(f1) ++ p(a2|b1,f2).πAlarm(b1).πAlarm(f2) ++ p(a2|b2,f1).πAlarm(b2).πAlarm(f1) ++ p(a2|b2,f2).πAlarm(b2).πAlarm(f2) += (0.008x0.005x0.03) ++ (0.01x0.005x0.97) ++ (0.8x0.995x0.03) ++ (0.997x0.995x0.97) = 0.98618425 +λ(a1) = λ_Jn(a1) = 0.5 = 0.5 +λ(a2) = λ_Jn(a2) = 0.5 = 0.5 +belief change = 2.50575255e-12 + +var _Jn: +π(_jn0) += p(_jn0|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn0|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn0|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn0|f2,a2).π_Jn(f2).π_Jn(a2) += (1x0.03x0.0138158) ++ (0x0.03x0.986184) ++ (0x0.97x0.0138158) ++ (0x0.97x0.986184) = 0.0004144725004 +π(_jn1) += p(_jn1|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn1|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn1|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn1|f2,a2).π_Jn(f2).π_Jn(a2) += (0x0.03x0.0138158) ++ (1x0.03x0.986184) ++ (0x0.97x0.0138158) ++ (0x0.97x0.986184) = 0.02958552751 +π(_jn2) += p(_jn2|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn2|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn2|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn2|f2,a2).π_Jn(f2).π_Jn(a2) += (0x0.03x0.0138158) ++ (0x0.03x0.986184) ++ (1x0.97x0.0138158) ++ (0x0.97x0.986184) = 0.01340127751 +π(_jn3) += p(_jn3|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn3|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn3|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn3|f2,a2).π_Jn(f2).π_Jn(a2) += (0x0.03x0.0138158) ++ (0x0.03x0.986184) ++ (0x0.97x0.0138158) ++ (1x0.97x0.986184) = 0.9565987225 +λ(_jn0) = 1 +λ(_jn1) = 1 +λ(_jn2) = 1 +λ(_jn3) = 1 +belief change = 1.98978317e-11 + +domain π(Burglar) λ(Burglar) belief +---------------------------------------------------------------- +b1 0.005 0.5 0.005 +b2 0.995 0.5 0.995 + +domain πAlarm(Burglar) λAlarm(Burglar) +---------------------------------------------------------------- +b1 0.005 0.5 +b2 0.995 0.5 + +domain π(FreightTruck) λ(FreightTruck) belief +---------------------------------------------------------------- +f1 0.03 0.25 0.03 +f2 0.97 0.25 0.97 + +domain πAlarm(FreightTruck) λAlarm(FreightTruck) +---------------------------------------------------------------- +f1 0.03000000001 0.5 +f2 0.97 0.5 + +domain π_Jn(FreightTruck) λ_Jn(FreightTruck) +---------------------------------------------------------------- +f1 0.03000000001 0.5 +f2 0.97 0.5 + +domain π(Alarm) λ(Alarm) belief +---------------------------------------------------------------- +a1 0.01381575 0.5 0.01381575 +a2 0.98618425 0.5 0.98618425 + +domain π_Jn(Alarm) λ_Jn(Alarm) +---------------------------------------------------------------- +a1 0.01381575001 0.5 +a2 0.98618425 0.5 + +domain π(_Jn) λ(_Jn) belief +---------------------------------------------------------------- +_jn0 0.0004144725004 1 0.0004144725004 +_jn1 0.02958552751 1 0.02958552751 +_jn2 0.01340127751 1 0.01340127751 +_jn3 0.9565987225 1 0.9565987225 + + + +******************************************************************************** + Iteration 61 +******************************************************************************** +λ message Alarm --> Burglar +λAlarm(b1) += [p(a1|b1,f1).πAlarm(f1) + p(a1|b1,f2).πAlarm(f2)].λ(a1) ++ [p(a2|b1,f1).πAlarm(f1) + p(a2|b1,f2).πAlarm(f2)].λ(a2) += [(0.992x0.03) + (0.99x0.97)]x0.5 ++ [(0.008x0.03) + (0.01x0.97)]x0.5 = 0.5 +λAlarm(b2) += [p(a1|b2,f1).πAlarm(f1) + p(a1|b2,f2).πAlarm(f2)].λ(a1) ++ [p(a2|b2,f1).πAlarm(f1) + p(a2|b2,f2).πAlarm(f2)].λ(a2) += [(0.2x0.03) + (0.003x0.97)]x0.5 ++ [(0.8x0.03) + (0.997x0.97)]x0.5 = 0.5 + +λ message Alarm --> FreightTruck +λAlarm(f1) += [p(a1|b1,f1).πAlarm(b1) + p(a1|b2,f1).πAlarm(b2)].λ(a1) ++ [p(a2|b1,f1).πAlarm(b1) + p(a2|b2,f1).πAlarm(b2)].λ(a2) += [(0.992x0.005) + (0.2x0.995)]x0.5 ++ [(0.008x0.005) + (0.8x0.995)]x0.5 = 0.5 +λAlarm(f2) += [p(a1|b1,f2).πAlarm(b1) + p(a1|b2,f2).πAlarm(b2)].λ(a1) ++ [p(a2|b1,f2).πAlarm(b1) + p(a2|b2,f2).πAlarm(b2)].λ(a2) += [(0.99x0.005) + (0.003x0.995)]x0.5 ++ [(0.01x0.005) + (0.997x0.995)]x0.5 = 0.5 + +λ message _Jn --> FreightTruck +λ_Jn(f1) += [p(_jn0|f1,a1).π_Jn(a1) + p(_jn0|f1,a2).π_Jn(a2)].λ(_jn0) ++ [p(_jn1|f1,a1).π_Jn(a1) + p(_jn1|f1,a2).π_Jn(a2)].λ(_jn1) ++ [p(_jn2|f1,a1).π_Jn(a1) + p(_jn2|f1,a2).π_Jn(a2)].λ(_jn2) ++ [p(_jn3|f1,a1).π_Jn(a1) + p(_jn3|f1,a2).π_Jn(a2)].λ(_jn3) += [(1x0.0138158) + (0x0.986184)]x1 ++ [(0x0.0138158) + (1x0.986184)]x1 ++ [(0x0.0138158) + (0x0.986184)]x1 ++ [(0x0.0138158) + (0x0.986184)]x1 = 1 +λ_Jn(f2) += [p(_jn0|f2,a1).π_Jn(a1) + p(_jn0|f2,a2).π_Jn(a2)].λ(_jn0) ++ [p(_jn1|f2,a1).π_Jn(a1) + p(_jn1|f2,a2).π_Jn(a2)].λ(_jn1) ++ [p(_jn2|f2,a1).π_Jn(a1) + p(_jn2|f2,a2).π_Jn(a2)].λ(_jn2) ++ [p(_jn3|f2,a1).π_Jn(a1) + p(_jn3|f2,a2).π_Jn(a2)].λ(_jn3) += [(0x0.0138158) + (0x0.986184)]x1 ++ [(0x0.0138158) + (0x0.986184)]x1 ++ [(1x0.0138158) + (0x0.986184)]x1 ++ [(0x0.0138158) + (1x0.986184)]x1 = 1 + +λ message _Jn --> Alarm +λ_Jn(a1) += [p(_jn0|f1,a1).π_Jn(f1) + p(_jn0|f2,a1).π_Jn(f2)].λ(_jn0) ++ [p(_jn1|f1,a1).π_Jn(f1) + p(_jn1|f2,a1).π_Jn(f2)].λ(_jn1) ++ [p(_jn2|f1,a1).π_Jn(f1) + p(_jn2|f2,a1).π_Jn(f2)].λ(_jn2) ++ [p(_jn3|f1,a1).π_Jn(f1) + p(_jn3|f2,a1).π_Jn(f2)].λ(_jn3) += [(1x0.03) + (0x0.97)]x1 ++ [(0x0.03) + (0x0.97)]x1 ++ [(0x0.03) + (1x0.97)]x1 ++ [(0x0.03) + (0x0.97)]x1 = 1 +λ_Jn(a2) += [p(_jn0|f1,a2).π_Jn(f1) + p(_jn0|f2,a2).π_Jn(f2)].λ(_jn0) ++ [p(_jn1|f1,a2).π_Jn(f1) + p(_jn1|f2,a2).π_Jn(f2)].λ(_jn1) ++ [p(_jn2|f1,a2).π_Jn(f1) + p(_jn2|f2,a2).π_Jn(f2)].λ(_jn2) ++ [p(_jn3|f1,a2).π_Jn(f1) + p(_jn3|f2,a2).π_Jn(f2)].λ(_jn3) += [(0x0.03) + (0x0.97)]x1 ++ [(1x0.03) + (0x0.97)]x1 ++ [(0x0.03) + (0x0.97)]x1 ++ [(0x0.03) + (1x0.97)]x1 = 1 + +π message Burglar --> Alarm +πAlarm(b1) = π(b1) = 0.005 = 0.005 +πAlarm(b2) = π(b2) = 0.995 = 0.995 + +π message FreightTruck --> Alarm +πAlarm(f1) = π(f1).λ_Jn(f1) = 0.03 x 0.5 = 0.015 +πAlarm(f2) = π(f2).λ_Jn(f2) = 0.97 x 0.5 = 0.485 + +π message FreightTruck --> _Jn +π_Jn(f1) = π(f1).λAlarm(f1) = 0.03 x 0.5 = 0.015 +π_Jn(f2) = π(f2).λAlarm(f2) = 0.97 x 0.5 = 0.485 + +π message Alarm --> _Jn +π_Jn(a1) = π(a1) = 0.0138158 = 0.01381575 +π_Jn(a2) = π(a2) = 0.986184 = 0.98618425 + +var Burglar: +π(b1) += p(b1) += (0.005) = 0.005 +π(b2) += p(b2) += (0.995) = 0.995 +λ(b1) = λAlarm(b1) = 0.5 = 0.5 +λ(b2) = λAlarm(b2) = 0.5 = 0.5 +belief change = 0 + +var FreightTruck: +π(f1) += p(f1) += (0.03) = 0.03 +π(f2) += p(f2) += (0.97) = 0.97 +λ(f1) = λAlarm(f1).λ_Jn(f1) = 0.5 x 0.5 = 0.25 +λ(f2) = λAlarm(f2).λ_Jn(f2) = 0.5 x 0.5 = 0.25 +belief change = 0 + +var Alarm: +π(a1) += p(a1|b1,f1).πAlarm(b1).πAlarm(f1) ++ p(a1|b1,f2).πAlarm(b1).πAlarm(f2) ++ p(a1|b2,f1).πAlarm(b2).πAlarm(f1) ++ p(a1|b2,f2).πAlarm(b2).πAlarm(f2) += (0.992x0.005x0.03) ++ (0.99x0.005x0.97) ++ (0.2x0.995x0.03) ++ (0.003x0.995x0.97) = 0.01381575 +π(a2) += p(a2|b1,f1).πAlarm(b1).πAlarm(f1) ++ p(a2|b1,f2).πAlarm(b1).πAlarm(f2) ++ p(a2|b2,f1).πAlarm(b2).πAlarm(f1) ++ p(a2|b2,f2).πAlarm(b2).πAlarm(f2) += (0.008x0.005x0.03) ++ (0.01x0.005x0.97) ++ (0.8x0.995x0.03) ++ (0.997x0.995x0.97) = 0.98618425 +λ(a1) = λ_Jn(a1) = 0.5 = 0.5 +λ(a2) = λ_Jn(a2) = 0.5 = 0.5 +belief change = 1.67046238e-12 + +var _Jn: +π(_jn0) += p(_jn0|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn0|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn0|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn0|f2,a2).π_Jn(f2).π_Jn(a2) += (1x0.03x0.0138158) ++ (0x0.03x0.986184) ++ (0x0.97x0.0138158) ++ (0x0.97x0.986184) = 0.0004144725003 +π(_jn1) += p(_jn1|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn1|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn1|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn1|f2,a2).π_Jn(f2).π_Jn(a2) += (0x0.03x0.0138158) ++ (1x0.03x0.986184) ++ (0x0.97x0.0138158) ++ (0x0.97x0.986184) = 0.02958552751 +π(_jn2) += p(_jn2|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn2|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn2|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn2|f2,a2).π_Jn(f2).π_Jn(a2) += (0x0.03x0.0138158) ++ (0x0.03x0.986184) ++ (1x0.97x0.0138158) ++ (0x0.97x0.986184) = 0.0134012775 +π(_jn3) += p(_jn3|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn3|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn3|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn3|f2,a2).π_Jn(f2).π_Jn(a2) += (0x0.03x0.0138158) ++ (0x0.03x0.986184) ++ (0x0.97x0.0138158) ++ (1x0.97x0.986184) = 0.9565987225 +λ(_jn0) = 1 +λ(_jn1) = 1 +λ(_jn2) = 1 +λ(_jn3) = 1 +belief change = 1.326518344e-11 + +domain π(Burglar) λ(Burglar) belief +---------------------------------------------------------------- +b1 0.005 0.5 0.005 +b2 0.995 0.5 0.995 + +domain πAlarm(Burglar) λAlarm(Burglar) +---------------------------------------------------------------- +b1 0.005 0.5 +b2 0.995 0.5 + +domain π(FreightTruck) λ(FreightTruck) belief +---------------------------------------------------------------- +f1 0.03 0.25 0.03 +f2 0.97 0.25 0.97 + +domain πAlarm(FreightTruck) λAlarm(FreightTruck) +---------------------------------------------------------------- +f1 0.03000000001 0.5 +f2 0.97 0.5 + +domain π_Jn(FreightTruck) λ_Jn(FreightTruck) +---------------------------------------------------------------- +f1 0.03000000001 0.5 +f2 0.97 0.5 + +domain π(Alarm) λ(Alarm) belief +---------------------------------------------------------------- +a1 0.01381575 0.5 0.01381575 +a2 0.98618425 0.5 0.98618425 + +domain π_Jn(Alarm) λ_Jn(Alarm) +---------------------------------------------------------------- +a1 0.01381575001 0.5 +a2 0.98618425 0.5 + +domain π(_Jn) λ(_Jn) belief +---------------------------------------------------------------- +_jn0 0.0004144725003 1 0.0004144725003 +_jn1 0.02958552751 1 0.02958552751 +_jn2 0.0134012775 1 0.0134012775 +_jn3 0.9565987225 1 0.9565987225 + + + +******************************************************************************** + Iteration 62 +******************************************************************************** +λ message Alarm --> Burglar +λAlarm(b1) += [p(a1|b1,f1).πAlarm(f1) + p(a1|b1,f2).πAlarm(f2)].λ(a1) ++ [p(a2|b1,f1).πAlarm(f1) + p(a2|b1,f2).πAlarm(f2)].λ(a2) += [(0.992x0.03) + (0.99x0.97)]x0.5 ++ [(0.008x0.03) + (0.01x0.97)]x0.5 = 0.5 +λAlarm(b2) += [p(a1|b2,f1).πAlarm(f1) + p(a1|b2,f2).πAlarm(f2)].λ(a1) ++ [p(a2|b2,f1).πAlarm(f1) + p(a2|b2,f2).πAlarm(f2)].λ(a2) += [(0.2x0.03) + (0.003x0.97)]x0.5 ++ [(0.8x0.03) + (0.997x0.97)]x0.5 = 0.5 + +λ message Alarm --> FreightTruck +λAlarm(f1) += [p(a1|b1,f1).πAlarm(b1) + p(a1|b2,f1).πAlarm(b2)].λ(a1) ++ [p(a2|b1,f1).πAlarm(b1) + p(a2|b2,f1).πAlarm(b2)].λ(a2) += [(0.992x0.005) + (0.2x0.995)]x0.5 ++ [(0.008x0.005) + (0.8x0.995)]x0.5 = 0.5 +λAlarm(f2) += [p(a1|b1,f2).πAlarm(b1) + p(a1|b2,f2).πAlarm(b2)].λ(a1) ++ [p(a2|b1,f2).πAlarm(b1) + p(a2|b2,f2).πAlarm(b2)].λ(a2) += [(0.99x0.005) + (0.003x0.995)]x0.5 ++ [(0.01x0.005) + (0.997x0.995)]x0.5 = 0.5 + +λ message _Jn --> FreightTruck +λ_Jn(f1) += [p(_jn0|f1,a1).π_Jn(a1) + p(_jn0|f1,a2).π_Jn(a2)].λ(_jn0) ++ [p(_jn1|f1,a1).π_Jn(a1) + p(_jn1|f1,a2).π_Jn(a2)].λ(_jn1) ++ [p(_jn2|f1,a1).π_Jn(a1) + p(_jn2|f1,a2).π_Jn(a2)].λ(_jn2) ++ [p(_jn3|f1,a1).π_Jn(a1) + p(_jn3|f1,a2).π_Jn(a2)].λ(_jn3) += [(1x0.0138158) + (0x0.986184)]x1 ++ [(0x0.0138158) + (1x0.986184)]x1 ++ [(0x0.0138158) + (0x0.986184)]x1 ++ [(0x0.0138158) + (0x0.986184)]x1 = 1 +λ_Jn(f2) += [p(_jn0|f2,a1).π_Jn(a1) + p(_jn0|f2,a2).π_Jn(a2)].λ(_jn0) ++ [p(_jn1|f2,a1).π_Jn(a1) + p(_jn1|f2,a2).π_Jn(a2)].λ(_jn1) ++ [p(_jn2|f2,a1).π_Jn(a1) + p(_jn2|f2,a2).π_Jn(a2)].λ(_jn2) ++ [p(_jn3|f2,a1).π_Jn(a1) + p(_jn3|f2,a2).π_Jn(a2)].λ(_jn3) += [(0x0.0138158) + (0x0.986184)]x1 ++ [(0x0.0138158) + (0x0.986184)]x1 ++ [(1x0.0138158) + (0x0.986184)]x1 ++ [(0x0.0138158) + (1x0.986184)]x1 = 1 + +λ message _Jn --> Alarm +λ_Jn(a1) += [p(_jn0|f1,a1).π_Jn(f1) + p(_jn0|f2,a1).π_Jn(f2)].λ(_jn0) ++ [p(_jn1|f1,a1).π_Jn(f1) + p(_jn1|f2,a1).π_Jn(f2)].λ(_jn1) ++ [p(_jn2|f1,a1).π_Jn(f1) + p(_jn2|f2,a1).π_Jn(f2)].λ(_jn2) ++ [p(_jn3|f1,a1).π_Jn(f1) + p(_jn3|f2,a1).π_Jn(f2)].λ(_jn3) += [(1x0.03) + (0x0.97)]x1 ++ [(0x0.03) + (0x0.97)]x1 ++ [(0x0.03) + (1x0.97)]x1 ++ [(0x0.03) + (0x0.97)]x1 = 1 +λ_Jn(a2) += [p(_jn0|f1,a2).π_Jn(f1) + p(_jn0|f2,a2).π_Jn(f2)].λ(_jn0) ++ [p(_jn1|f1,a2).π_Jn(f1) + p(_jn1|f2,a2).π_Jn(f2)].λ(_jn1) ++ [p(_jn2|f1,a2).π_Jn(f1) + p(_jn2|f2,a2).π_Jn(f2)].λ(_jn2) ++ [p(_jn3|f1,a2).π_Jn(f1) + p(_jn3|f2,a2).π_Jn(f2)].λ(_jn3) += [(0x0.03) + (0x0.97)]x1 ++ [(1x0.03) + (0x0.97)]x1 ++ [(0x0.03) + (0x0.97)]x1 ++ [(0x0.03) + (1x0.97)]x1 = 1 + +π message Burglar --> Alarm +πAlarm(b1) = π(b1) = 0.005 = 0.005 +πAlarm(b2) = π(b2) = 0.995 = 0.995 + +π message FreightTruck --> Alarm +πAlarm(f1) = π(f1).λ_Jn(f1) = 0.03 x 0.5 = 0.015 +πAlarm(f2) = π(f2).λ_Jn(f2) = 0.97 x 0.5 = 0.485 + +π message FreightTruck --> _Jn +π_Jn(f1) = π(f1).λAlarm(f1) = 0.03 x 0.5 = 0.015 +π_Jn(f2) = π(f2).λAlarm(f2) = 0.97 x 0.5 = 0.485 + +π message Alarm --> _Jn +π_Jn(a1) = π(a1) = 0.0138158 = 0.01381575 +π_Jn(a2) = π(a2) = 0.986184 = 0.98618425 + +var Burglar: +π(b1) += p(b1) += (0.005) = 0.005 +π(b2) += p(b2) += (0.995) = 0.995 +λ(b1) = λAlarm(b1) = 0.5 = 0.5 +λ(b2) = λAlarm(b2) = 0.5 = 0.5 +belief change = 0 + +var FreightTruck: +π(f1) += p(f1) += (0.03) = 0.03 +π(f2) += p(f2) += (0.97) = 0.97 +λ(f1) = λAlarm(f1).λ_Jn(f1) = 0.5 x 0.5 = 0.25 +λ(f2) = λAlarm(f2).λ_Jn(f2) = 0.5 x 0.5 = 0.25 +belief change = 0 + +var Alarm: +π(a1) += p(a1|b1,f1).πAlarm(b1).πAlarm(f1) ++ p(a1|b1,f2).πAlarm(b1).πAlarm(f2) ++ p(a1|b2,f1).πAlarm(b2).πAlarm(f1) ++ p(a1|b2,f2).πAlarm(b2).πAlarm(f2) += (0.992x0.005x0.03) ++ (0.99x0.005x0.97) ++ (0.2x0.995x0.03) ++ (0.003x0.995x0.97) = 0.01381575 +π(a2) += p(a2|b1,f1).πAlarm(b1).πAlarm(f1) ++ p(a2|b1,f2).πAlarm(b1).πAlarm(f2) ++ p(a2|b2,f1).πAlarm(b2).πAlarm(f1) ++ p(a2|b2,f2).πAlarm(b2).πAlarm(f2) += (0.008x0.005x0.03) ++ (0.01x0.005x0.97) ++ (0.8x0.995x0.03) ++ (0.997x0.995x0.97) = 0.98618425 +λ(a1) = λ_Jn(a1) = 0.5 = 0.5 +λ(a2) = λ_Jn(a2) = 0.5 = 0.5 +belief change = 1.113716758e-12 + +var _Jn: +π(_jn0) += p(_jn0|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn0|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn0|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn0|f2,a2).π_Jn(f2).π_Jn(a2) += (1x0.03x0.0138158) ++ (0x0.03x0.986184) ++ (0x0.97x0.0138158) ++ (0x0.97x0.986184) = 0.0004144725002 +π(_jn1) += p(_jn1|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn1|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn1|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn1|f2,a2).π_Jn(f2).π_Jn(a2) += (0x0.03x0.0138158) ++ (1x0.03x0.986184) ++ (0x0.97x0.0138158) ++ (0x0.97x0.986184) = 0.02958552751 +π(_jn2) += p(_jn2|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn2|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn2|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn2|f2,a2).π_Jn(f2).π_Jn(a2) += (0x0.03x0.0138158) ++ (0x0.03x0.986184) ++ (1x0.97x0.0138158) ++ (0x0.97x0.986184) = 0.0134012775 +π(_jn3) += p(_jn3|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn3|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn3|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn3|f2,a2).π_Jn(f2).π_Jn(a2) += (0x0.03x0.0138158) ++ (0x0.03x0.986184) ++ (0x0.97x0.0138158) ++ (1x0.97x0.986184) = 0.9565987225 +λ(_jn0) = 1 +λ(_jn1) = 1 +λ(_jn2) = 1 +λ(_jn3) = 1 +belief change = 8.843527364e-12 + +domain π(Burglar) λ(Burglar) belief +---------------------------------------------------------------- +b1 0.005 0.5 0.005 +b2 0.995 0.5 0.995 + +domain πAlarm(Burglar) λAlarm(Burglar) +---------------------------------------------------------------- +b1 0.005 0.5 +b2 0.995 0.5 + +domain π(FreightTruck) λ(FreightTruck) belief +---------------------------------------------------------------- +f1 0.03 0.25 0.03 +f2 0.97 0.25 0.97 + +domain πAlarm(FreightTruck) λAlarm(FreightTruck) +---------------------------------------------------------------- +f1 0.03000000001 0.5 +f2 0.97 0.5 + +domain π_Jn(FreightTruck) λ_Jn(FreightTruck) +---------------------------------------------------------------- +f1 0.03000000001 0.5 +f2 0.97 0.5 + +domain π(Alarm) λ(Alarm) belief +---------------------------------------------------------------- +a1 0.01381575 0.5 0.01381575 +a2 0.98618425 0.5 0.98618425 + +domain π_Jn(Alarm) λ_Jn(Alarm) +---------------------------------------------------------------- +a1 0.01381575 0.5 +a2 0.98618425 0.5 + +domain π(_Jn) λ(_Jn) belief +---------------------------------------------------------------- +_jn0 0.0004144725002 1 0.0004144725002 +_jn1 0.02958552751 1 0.02958552751 +_jn2 0.0134012775 1 0.0134012775 +_jn3 0.9565987225 1 0.9565987225 + + + +******************************************************************************** + Iteration 63 +******************************************************************************** +λ message Alarm --> Burglar +λAlarm(b1) += [p(a1|b1,f1).πAlarm(f1) + p(a1|b1,f2).πAlarm(f2)].λ(a1) ++ [p(a2|b1,f1).πAlarm(f1) + p(a2|b1,f2).πAlarm(f2)].λ(a2) += [(0.992x0.03) + (0.99x0.97)]x0.5 ++ [(0.008x0.03) + (0.01x0.97)]x0.5 = 0.5 +λAlarm(b2) += [p(a1|b2,f1).πAlarm(f1) + p(a1|b2,f2).πAlarm(f2)].λ(a1) ++ [p(a2|b2,f1).πAlarm(f1) + p(a2|b2,f2).πAlarm(f2)].λ(a2) += [(0.2x0.03) + (0.003x0.97)]x0.5 ++ [(0.8x0.03) + (0.997x0.97)]x0.5 = 0.5 + +λ message Alarm --> FreightTruck +λAlarm(f1) += [p(a1|b1,f1).πAlarm(b1) + p(a1|b2,f1).πAlarm(b2)].λ(a1) ++ [p(a2|b1,f1).πAlarm(b1) + p(a2|b2,f1).πAlarm(b2)].λ(a2) += [(0.992x0.005) + (0.2x0.995)]x0.5 ++ [(0.008x0.005) + (0.8x0.995)]x0.5 = 0.5 +λAlarm(f2) += [p(a1|b1,f2).πAlarm(b1) + p(a1|b2,f2).πAlarm(b2)].λ(a1) ++ [p(a2|b1,f2).πAlarm(b1) + p(a2|b2,f2).πAlarm(b2)].λ(a2) += [(0.99x0.005) + (0.003x0.995)]x0.5 ++ [(0.01x0.005) + (0.997x0.995)]x0.5 = 0.5 + +λ message _Jn --> FreightTruck +λ_Jn(f1) += [p(_jn0|f1,a1).π_Jn(a1) + p(_jn0|f1,a2).π_Jn(a2)].λ(_jn0) ++ [p(_jn1|f1,a1).π_Jn(a1) + p(_jn1|f1,a2).π_Jn(a2)].λ(_jn1) ++ [p(_jn2|f1,a1).π_Jn(a1) + p(_jn2|f1,a2).π_Jn(a2)].λ(_jn2) ++ [p(_jn3|f1,a1).π_Jn(a1) + p(_jn3|f1,a2).π_Jn(a2)].λ(_jn3) += [(1x0.0138158) + (0x0.986184)]x1 ++ [(0x0.0138158) + (1x0.986184)]x1 ++ [(0x0.0138158) + (0x0.986184)]x1 ++ [(0x0.0138158) + (0x0.986184)]x1 = 1 +λ_Jn(f2) += [p(_jn0|f2,a1).π_Jn(a1) + p(_jn0|f2,a2).π_Jn(a2)].λ(_jn0) ++ [p(_jn1|f2,a1).π_Jn(a1) + p(_jn1|f2,a2).π_Jn(a2)].λ(_jn1) ++ [p(_jn2|f2,a1).π_Jn(a1) + p(_jn2|f2,a2).π_Jn(a2)].λ(_jn2) ++ [p(_jn3|f2,a1).π_Jn(a1) + p(_jn3|f2,a2).π_Jn(a2)].λ(_jn3) += [(0x0.0138158) + (0x0.986184)]x1 ++ [(0x0.0138158) + (0x0.986184)]x1 ++ [(1x0.0138158) + (0x0.986184)]x1 ++ [(0x0.0138158) + (1x0.986184)]x1 = 1 + +λ message _Jn --> Alarm +λ_Jn(a1) += [p(_jn0|f1,a1).π_Jn(f1) + p(_jn0|f2,a1).π_Jn(f2)].λ(_jn0) ++ [p(_jn1|f1,a1).π_Jn(f1) + p(_jn1|f2,a1).π_Jn(f2)].λ(_jn1) ++ [p(_jn2|f1,a1).π_Jn(f1) + p(_jn2|f2,a1).π_Jn(f2)].λ(_jn2) ++ [p(_jn3|f1,a1).π_Jn(f1) + p(_jn3|f2,a1).π_Jn(f2)].λ(_jn3) += [(1x0.03) + (0x0.97)]x1 ++ [(0x0.03) + (0x0.97)]x1 ++ [(0x0.03) + (1x0.97)]x1 ++ [(0x0.03) + (0x0.97)]x1 = 1 +λ_Jn(a2) += [p(_jn0|f1,a2).π_Jn(f1) + p(_jn0|f2,a2).π_Jn(f2)].λ(_jn0) ++ [p(_jn1|f1,a2).π_Jn(f1) + p(_jn1|f2,a2).π_Jn(f2)].λ(_jn1) ++ [p(_jn2|f1,a2).π_Jn(f1) + p(_jn2|f2,a2).π_Jn(f2)].λ(_jn2) ++ [p(_jn3|f1,a2).π_Jn(f1) + p(_jn3|f2,a2).π_Jn(f2)].λ(_jn3) += [(0x0.03) + (0x0.97)]x1 ++ [(1x0.03) + (0x0.97)]x1 ++ [(0x0.03) + (0x0.97)]x1 ++ [(0x0.03) + (1x0.97)]x1 = 1 + +π message Burglar --> Alarm +πAlarm(b1) = π(b1) = 0.005 = 0.005 +πAlarm(b2) = π(b2) = 0.995 = 0.995 + +π message FreightTruck --> Alarm +πAlarm(f1) = π(f1).λ_Jn(f1) = 0.03 x 0.5 = 0.015 +πAlarm(f2) = π(f2).λ_Jn(f2) = 0.97 x 0.5 = 0.485 + +π message FreightTruck --> _Jn +π_Jn(f1) = π(f1).λAlarm(f1) = 0.03 x 0.5 = 0.015 +π_Jn(f2) = π(f2).λAlarm(f2) = 0.97 x 0.5 = 0.485 + +π message Alarm --> _Jn +π_Jn(a1) = π(a1) = 0.0138158 = 0.01381575 +π_Jn(a2) = π(a2) = 0.986184 = 0.98618425 + +var Burglar: +π(b1) += p(b1) += (0.005) = 0.005 +π(b2) += p(b2) += (0.995) = 0.995 +λ(b1) = λAlarm(b1) = 0.5 = 0.5 +λ(b2) = λAlarm(b2) = 0.5 = 0.5 +belief change = 0 + +var FreightTruck: +π(f1) += p(f1) += (0.03) = 0.03 +π(f2) += p(f2) += (0.97) = 0.97 +λ(f1) = λAlarm(f1).λ_Jn(f1) = 0.5 x 0.5 = 0.25 +λ(f2) = λAlarm(f2).λ_Jn(f2) = 0.5 x 0.5 = 0.25 +belief change = 0 + +var Alarm: +π(a1) += p(a1|b1,f1).πAlarm(b1).πAlarm(f1) ++ p(a1|b1,f2).πAlarm(b1).πAlarm(f2) ++ p(a1|b2,f1).πAlarm(b2).πAlarm(f1) ++ p(a1|b2,f2).πAlarm(b2).πAlarm(f2) += (0.992x0.005x0.03) ++ (0.99x0.005x0.97) ++ (0.2x0.995x0.03) ++ (0.003x0.995x0.97) = 0.01381575 +π(a2) += p(a2|b1,f1).πAlarm(b1).πAlarm(f1) ++ p(a2|b1,f2).πAlarm(b1).πAlarm(f2) ++ p(a2|b2,f1).πAlarm(b2).πAlarm(f1) ++ p(a2|b2,f2).πAlarm(b2).πAlarm(f2) += (0.008x0.005x0.03) ++ (0.01x0.005x0.97) ++ (0.8x0.995x0.03) ++ (0.997x0.995x0.97) = 0.98618425 +λ(a1) = λ_Jn(a1) = 0.5 = 0.5 +λ(a2) = λ_Jn(a2) = 0.5 = 0.5 +belief change = 7.423679727e-13 + +var _Jn: +π(_jn0) += p(_jn0|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn0|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn0|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn0|f2,a2).π_Jn(f2).π_Jn(a2) += (1x0.03x0.0138158) ++ (0x0.03x0.986184) ++ (0x0.97x0.0138158) ++ (0x0.97x0.986184) = 0.0004144725001 +π(_jn1) += p(_jn1|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn1|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn1|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn1|f2,a2).π_Jn(f2).π_Jn(a2) += (0x0.03x0.0138158) ++ (1x0.03x0.986184) ++ (0x0.97x0.0138158) ++ (0x0.97x0.986184) = 0.0295855275 +π(_jn2) += p(_jn2|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn2|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn2|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn2|f2,a2).π_Jn(f2).π_Jn(a2) += (0x0.03x0.0138158) ++ (0x0.03x0.986184) ++ (1x0.97x0.0138158) ++ (0x0.97x0.986184) = 0.0134012775 +π(_jn3) += p(_jn3|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn3|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn3|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn3|f2,a2).π_Jn(f2).π_Jn(a2) += (0x0.03x0.0138158) ++ (0x0.03x0.986184) ++ (0x0.97x0.0138158) ++ (1x0.97x0.986184) = 0.9565987225 +λ(_jn0) = 1 +λ(_jn1) = 1 +λ(_jn2) = 1 +λ(_jn3) = 1 +belief change = 5.89547443e-12 + +domain π(Burglar) λ(Burglar) belief +---------------------------------------------------------------- +b1 0.005 0.5 0.005 +b2 0.995 0.5 0.995 + +domain πAlarm(Burglar) λAlarm(Burglar) +---------------------------------------------------------------- +b1 0.005 0.5 +b2 0.995 0.5 + +domain π(FreightTruck) λ(FreightTruck) belief +---------------------------------------------------------------- +f1 0.03 0.25 0.03 +f2 0.97 0.25 0.97 + +domain πAlarm(FreightTruck) λAlarm(FreightTruck) +---------------------------------------------------------------- +f1 0.03 0.5 +f2 0.97 0.5 + +domain π_Jn(FreightTruck) λ_Jn(FreightTruck) +---------------------------------------------------------------- +f1 0.03 0.5 +f2 0.97 0.5 + +domain π(Alarm) λ(Alarm) belief +---------------------------------------------------------------- +a1 0.01381575 0.5 0.01381575 +a2 0.98618425 0.5 0.98618425 + +domain π_Jn(Alarm) λ_Jn(Alarm) +---------------------------------------------------------------- +a1 0.01381575 0.5 +a2 0.98618425 0.5 + +domain π(_Jn) λ(_Jn) belief +---------------------------------------------------------------- +_jn0 0.0004144725001 1 0.0004144725001 +_jn1 0.0295855275 1 0.0295855275 +_jn2 0.0134012775 1 0.0134012775 +_jn3 0.9565987225 1 0.9565987225 + + + +******************************************************************************** + Iteration 64 +******************************************************************************** +λ message Alarm --> Burglar +λAlarm(b1) += [p(a1|b1,f1).πAlarm(f1) + p(a1|b1,f2).πAlarm(f2)].λ(a1) ++ [p(a2|b1,f1).πAlarm(f1) + p(a2|b1,f2).πAlarm(f2)].λ(a2) += [(0.992x0.03) + (0.99x0.97)]x0.5 ++ [(0.008x0.03) + (0.01x0.97)]x0.5 = 0.5 +λAlarm(b2) += [p(a1|b2,f1).πAlarm(f1) + p(a1|b2,f2).πAlarm(f2)].λ(a1) ++ [p(a2|b2,f1).πAlarm(f1) + p(a2|b2,f2).πAlarm(f2)].λ(a2) += [(0.2x0.03) + (0.003x0.97)]x0.5 ++ [(0.8x0.03) + (0.997x0.97)]x0.5 = 0.5 + +λ message Alarm --> FreightTruck +λAlarm(f1) += [p(a1|b1,f1).πAlarm(b1) + p(a1|b2,f1).πAlarm(b2)].λ(a1) ++ [p(a2|b1,f1).πAlarm(b1) + p(a2|b2,f1).πAlarm(b2)].λ(a2) += [(0.992x0.005) + (0.2x0.995)]x0.5 ++ [(0.008x0.005) + (0.8x0.995)]x0.5 = 0.5 +λAlarm(f2) += [p(a1|b1,f2).πAlarm(b1) + p(a1|b2,f2).πAlarm(b2)].λ(a1) ++ [p(a2|b1,f2).πAlarm(b1) + p(a2|b2,f2).πAlarm(b2)].λ(a2) += [(0.99x0.005) + (0.003x0.995)]x0.5 ++ [(0.01x0.005) + (0.997x0.995)]x0.5 = 0.5 + +λ message _Jn --> FreightTruck +λ_Jn(f1) += [p(_jn0|f1,a1).π_Jn(a1) + p(_jn0|f1,a2).π_Jn(a2)].λ(_jn0) ++ [p(_jn1|f1,a1).π_Jn(a1) + p(_jn1|f1,a2).π_Jn(a2)].λ(_jn1) ++ [p(_jn2|f1,a1).π_Jn(a1) + p(_jn2|f1,a2).π_Jn(a2)].λ(_jn2) ++ [p(_jn3|f1,a1).π_Jn(a1) + p(_jn3|f1,a2).π_Jn(a2)].λ(_jn3) += [(1x0.0138158) + (0x0.986184)]x1 ++ [(0x0.0138158) + (1x0.986184)]x1 ++ [(0x0.0138158) + (0x0.986184)]x1 ++ [(0x0.0138158) + (0x0.986184)]x1 = 1 +λ_Jn(f2) += [p(_jn0|f2,a1).π_Jn(a1) + p(_jn0|f2,a2).π_Jn(a2)].λ(_jn0) ++ [p(_jn1|f2,a1).π_Jn(a1) + p(_jn1|f2,a2).π_Jn(a2)].λ(_jn1) ++ [p(_jn2|f2,a1).π_Jn(a1) + p(_jn2|f2,a2).π_Jn(a2)].λ(_jn2) ++ [p(_jn3|f2,a1).π_Jn(a1) + p(_jn3|f2,a2).π_Jn(a2)].λ(_jn3) += [(0x0.0138158) + (0x0.986184)]x1 ++ [(0x0.0138158) + (0x0.986184)]x1 ++ [(1x0.0138158) + (0x0.986184)]x1 ++ [(0x0.0138158) + (1x0.986184)]x1 = 1 + +λ message _Jn --> Alarm +λ_Jn(a1) += [p(_jn0|f1,a1).π_Jn(f1) + p(_jn0|f2,a1).π_Jn(f2)].λ(_jn0) ++ [p(_jn1|f1,a1).π_Jn(f1) + p(_jn1|f2,a1).π_Jn(f2)].λ(_jn1) ++ [p(_jn2|f1,a1).π_Jn(f1) + p(_jn2|f2,a1).π_Jn(f2)].λ(_jn2) ++ [p(_jn3|f1,a1).π_Jn(f1) + p(_jn3|f2,a1).π_Jn(f2)].λ(_jn3) += [(1x0.03) + (0x0.97)]x1 ++ [(0x0.03) + (0x0.97)]x1 ++ [(0x0.03) + (1x0.97)]x1 ++ [(0x0.03) + (0x0.97)]x1 = 1 +λ_Jn(a2) += [p(_jn0|f1,a2).π_Jn(f1) + p(_jn0|f2,a2).π_Jn(f2)].λ(_jn0) ++ [p(_jn1|f1,a2).π_Jn(f1) + p(_jn1|f2,a2).π_Jn(f2)].λ(_jn1) ++ [p(_jn2|f1,a2).π_Jn(f1) + p(_jn2|f2,a2).π_Jn(f2)].λ(_jn2) ++ [p(_jn3|f1,a2).π_Jn(f1) + p(_jn3|f2,a2).π_Jn(f2)].λ(_jn3) += [(0x0.03) + (0x0.97)]x1 ++ [(1x0.03) + (0x0.97)]x1 ++ [(0x0.03) + (0x0.97)]x1 ++ [(0x0.03) + (1x0.97)]x1 = 1 + +π message Burglar --> Alarm +πAlarm(b1) = π(b1) = 0.005 = 0.005 +πAlarm(b2) = π(b2) = 0.995 = 0.995 + +π message FreightTruck --> Alarm +πAlarm(f1) = π(f1).λ_Jn(f1) = 0.03 x 0.5 = 0.015 +πAlarm(f2) = π(f2).λ_Jn(f2) = 0.97 x 0.5 = 0.485 + +π message FreightTruck --> _Jn +π_Jn(f1) = π(f1).λAlarm(f1) = 0.03 x 0.5 = 0.015 +π_Jn(f2) = π(f2).λAlarm(f2) = 0.97 x 0.5 = 0.485 + +π message Alarm --> _Jn +π_Jn(a1) = π(a1) = 0.0138158 = 0.01381575 +π_Jn(a2) = π(a2) = 0.986184 = 0.98618425 + +var Burglar: +π(b1) += p(b1) += (0.005) = 0.005 +π(b2) += p(b2) += (0.995) = 0.995 +λ(b1) = λAlarm(b1) = 0.5 = 0.5 +λ(b2) = λAlarm(b2) = 0.5 = 0.5 +belief change = 0 + +var FreightTruck: +π(f1) += p(f1) += (0.03) = 0.03 +π(f2) += p(f2) += (0.97) = 0.97 +λ(f1) = λAlarm(f1).λ_Jn(f1) = 0.5 x 0.5 = 0.25 +λ(f2) = λAlarm(f2).λ_Jn(f2) = 0.5 x 0.5 = 0.25 +belief change = 0 + +var Alarm: +π(a1) += p(a1|b1,f1).πAlarm(b1).πAlarm(f1) ++ p(a1|b1,f2).πAlarm(b1).πAlarm(f2) ++ p(a1|b2,f1).πAlarm(b2).πAlarm(f1) ++ p(a1|b2,f2).πAlarm(b2).πAlarm(f2) += (0.992x0.005x0.03) ++ (0.99x0.005x0.97) ++ (0.2x0.995x0.03) ++ (0.003x0.995x0.97) = 0.01381575 +π(a2) += p(a2|b1,f1).πAlarm(b1).πAlarm(f1) ++ p(a2|b1,f2).πAlarm(b1).πAlarm(f2) ++ p(a2|b2,f1).πAlarm(b2).πAlarm(f1) ++ p(a2|b2,f2).πAlarm(b2).πAlarm(f2) += (0.008x0.005x0.03) ++ (0.01x0.005x0.97) ++ (0.8x0.995x0.03) ++ (0.997x0.995x0.97) = 0.98618425 +λ(a1) = λ_Jn(a1) = 0.5 = 0.5 +λ(a2) = λ_Jn(a2) = 0.5 = 0.5 +belief change = 4.949495674e-13 + +var _Jn: +π(_jn0) += p(_jn0|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn0|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn0|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn0|f2,a2).π_Jn(f2).π_Jn(a2) += (1x0.03x0.0138158) ++ (0x0.03x0.986184) ++ (0x0.97x0.0138158) ++ (0x0.97x0.986184) = 0.0004144725001 +π(_jn1) += p(_jn1|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn1|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn1|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn1|f2,a2).π_Jn(f2).π_Jn(a2) += (0x0.03x0.0138158) ++ (1x0.03x0.986184) ++ (0x0.97x0.0138158) ++ (0x0.97x0.986184) = 0.0295855275 +π(_jn2) += p(_jn2|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn2|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn2|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn2|f2,a2).π_Jn(f2).π_Jn(a2) += (0x0.03x0.0138158) ++ (0x0.03x0.986184) ++ (1x0.97x0.0138158) ++ (0x0.97x0.986184) = 0.0134012775 +π(_jn3) += p(_jn3|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn3|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn3|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn3|f2,a2).π_Jn(f2).π_Jn(a2) += (0x0.03x0.0138158) ++ (0x0.03x0.986184) ++ (0x0.97x0.0138158) ++ (1x0.97x0.986184) = 0.9565987225 +λ(_jn0) = 1 +λ(_jn1) = 1 +λ(_jn2) = 1 +λ(_jn3) = 1 +belief change = 3.930521381e-12 + +domain π(Burglar) λ(Burglar) belief +---------------------------------------------------------------- +b1 0.005 0.5 0.005 +b2 0.995 0.5 0.995 + +domain πAlarm(Burglar) λAlarm(Burglar) +---------------------------------------------------------------- +b1 0.005 0.5 +b2 0.995 0.5 + +domain π(FreightTruck) λ(FreightTruck) belief +---------------------------------------------------------------- +f1 0.03 0.25 0.03 +f2 0.97 0.25 0.97 + +domain πAlarm(FreightTruck) λAlarm(FreightTruck) +---------------------------------------------------------------- +f1 0.03 0.5 +f2 0.97 0.5 + +domain π_Jn(FreightTruck) λ_Jn(FreightTruck) +---------------------------------------------------------------- +f1 0.03 0.5 +f2 0.97 0.5 + +domain π(Alarm) λ(Alarm) belief +---------------------------------------------------------------- +a1 0.01381575 0.5 0.01381575 +a2 0.98618425 0.5 0.98618425 + +domain π_Jn(Alarm) λ_Jn(Alarm) +---------------------------------------------------------------- +a1 0.01381575 0.5 +a2 0.98618425 0.5 + +domain π(_Jn) λ(_Jn) belief +---------------------------------------------------------------- +_jn0 0.0004144725001 1 0.0004144725001 +_jn1 0.0295855275 1 0.0295855275 +_jn2 0.0134012775 1 0.0134012775 +_jn3 0.9565987225 1 0.9565987225 + + + +******************************************************************************** + Iteration 65 +******************************************************************************** +λ message Alarm --> Burglar +λAlarm(b1) += [p(a1|b1,f1).πAlarm(f1) + p(a1|b1,f2).πAlarm(f2)].λ(a1) ++ [p(a2|b1,f1).πAlarm(f1) + p(a2|b1,f2).πAlarm(f2)].λ(a2) += [(0.992x0.03) + (0.99x0.97)]x0.5 ++ [(0.008x0.03) + (0.01x0.97)]x0.5 = 0.5 +λAlarm(b2) += [p(a1|b2,f1).πAlarm(f1) + p(a1|b2,f2).πAlarm(f2)].λ(a1) ++ [p(a2|b2,f1).πAlarm(f1) + p(a2|b2,f2).πAlarm(f2)].λ(a2) += [(0.2x0.03) + (0.003x0.97)]x0.5 ++ [(0.8x0.03) + (0.997x0.97)]x0.5 = 0.5 + +λ message Alarm --> FreightTruck +λAlarm(f1) += [p(a1|b1,f1).πAlarm(b1) + p(a1|b2,f1).πAlarm(b2)].λ(a1) ++ [p(a2|b1,f1).πAlarm(b1) + p(a2|b2,f1).πAlarm(b2)].λ(a2) += [(0.992x0.005) + (0.2x0.995)]x0.5 ++ [(0.008x0.005) + (0.8x0.995)]x0.5 = 0.5 +λAlarm(f2) += [p(a1|b1,f2).πAlarm(b1) + p(a1|b2,f2).πAlarm(b2)].λ(a1) ++ [p(a2|b1,f2).πAlarm(b1) + p(a2|b2,f2).πAlarm(b2)].λ(a2) += [(0.99x0.005) + (0.003x0.995)]x0.5 ++ [(0.01x0.005) + (0.997x0.995)]x0.5 = 0.5 + +λ message _Jn --> FreightTruck +λ_Jn(f1) += [p(_jn0|f1,a1).π_Jn(a1) + p(_jn0|f1,a2).π_Jn(a2)].λ(_jn0) ++ [p(_jn1|f1,a1).π_Jn(a1) + p(_jn1|f1,a2).π_Jn(a2)].λ(_jn1) ++ [p(_jn2|f1,a1).π_Jn(a1) + p(_jn2|f1,a2).π_Jn(a2)].λ(_jn2) ++ [p(_jn3|f1,a1).π_Jn(a1) + p(_jn3|f1,a2).π_Jn(a2)].λ(_jn3) += [(1x0.0138158) + (0x0.986184)]x1 ++ [(0x0.0138158) + (1x0.986184)]x1 ++ [(0x0.0138158) + (0x0.986184)]x1 ++ [(0x0.0138158) + (0x0.986184)]x1 = 1 +λ_Jn(f2) += [p(_jn0|f2,a1).π_Jn(a1) + p(_jn0|f2,a2).π_Jn(a2)].λ(_jn0) ++ [p(_jn1|f2,a1).π_Jn(a1) + p(_jn1|f2,a2).π_Jn(a2)].λ(_jn1) ++ [p(_jn2|f2,a1).π_Jn(a1) + p(_jn2|f2,a2).π_Jn(a2)].λ(_jn2) ++ [p(_jn3|f2,a1).π_Jn(a1) + p(_jn3|f2,a2).π_Jn(a2)].λ(_jn3) += [(0x0.0138158) + (0x0.986184)]x1 ++ [(0x0.0138158) + (0x0.986184)]x1 ++ [(1x0.0138158) + (0x0.986184)]x1 ++ [(0x0.0138158) + (1x0.986184)]x1 = 1 + +λ message _Jn --> Alarm +λ_Jn(a1) += [p(_jn0|f1,a1).π_Jn(f1) + p(_jn0|f2,a1).π_Jn(f2)].λ(_jn0) ++ [p(_jn1|f1,a1).π_Jn(f1) + p(_jn1|f2,a1).π_Jn(f2)].λ(_jn1) ++ [p(_jn2|f1,a1).π_Jn(f1) + p(_jn2|f2,a1).π_Jn(f2)].λ(_jn2) ++ [p(_jn3|f1,a1).π_Jn(f1) + p(_jn3|f2,a1).π_Jn(f2)].λ(_jn3) += [(1x0.03) + (0x0.97)]x1 ++ [(0x0.03) + (0x0.97)]x1 ++ [(0x0.03) + (1x0.97)]x1 ++ [(0x0.03) + (0x0.97)]x1 = 1 +λ_Jn(a2) += [p(_jn0|f1,a2).π_Jn(f1) + p(_jn0|f2,a2).π_Jn(f2)].λ(_jn0) ++ [p(_jn1|f1,a2).π_Jn(f1) + p(_jn1|f2,a2).π_Jn(f2)].λ(_jn1) ++ [p(_jn2|f1,a2).π_Jn(f1) + p(_jn2|f2,a2).π_Jn(f2)].λ(_jn2) ++ [p(_jn3|f1,a2).π_Jn(f1) + p(_jn3|f2,a2).π_Jn(f2)].λ(_jn3) += [(0x0.03) + (0x0.97)]x1 ++ [(1x0.03) + (0x0.97)]x1 ++ [(0x0.03) + (0x0.97)]x1 ++ [(0x0.03) + (1x0.97)]x1 = 1 + +π message Burglar --> Alarm +πAlarm(b1) = π(b1) = 0.005 = 0.005 +πAlarm(b2) = π(b2) = 0.995 = 0.995 + +π message FreightTruck --> Alarm +πAlarm(f1) = π(f1).λ_Jn(f1) = 0.03 x 0.5 = 0.015 +πAlarm(f2) = π(f2).λ_Jn(f2) = 0.97 x 0.5 = 0.485 + +π message FreightTruck --> _Jn +π_Jn(f1) = π(f1).λAlarm(f1) = 0.03 x 0.5 = 0.015 +π_Jn(f2) = π(f2).λAlarm(f2) = 0.97 x 0.5 = 0.485 + +π message Alarm --> _Jn +π_Jn(a1) = π(a1) = 0.0138158 = 0.01381575 +π_Jn(a2) = π(a2) = 0.986184 = 0.98618425 + +var Burglar: +π(b1) += p(b1) += (0.005) = 0.005 +π(b2) += p(b2) += (0.995) = 0.995 +λ(b1) = λAlarm(b1) = 0.5 = 0.5 +λ(b2) = λAlarm(b2) = 0.5 = 0.5 +belief change = 0 + +var FreightTruck: +π(f1) += p(f1) += (0.03) = 0.03 +π(f2) += p(f2) += (0.97) = 0.97 +λ(f1) = λAlarm(f1).λ_Jn(f1) = 0.5 x 0.5 = 0.25 +λ(f2) = λAlarm(f2).λ_Jn(f2) = 0.5 x 0.5 = 0.25 +belief change = 0 + +var Alarm: +π(a1) += p(a1|b1,f1).πAlarm(b1).πAlarm(f1) ++ p(a1|b1,f2).πAlarm(b1).πAlarm(f2) ++ p(a1|b2,f1).πAlarm(b2).πAlarm(f1) ++ p(a1|b2,f2).πAlarm(b2).πAlarm(f2) += (0.992x0.005x0.03) ++ (0.99x0.005x0.97) ++ (0.2x0.995x0.03) ++ (0.003x0.995x0.97) = 0.01381575 +π(a2) += p(a2|b1,f1).πAlarm(b1).πAlarm(f1) ++ p(a2|b1,f2).πAlarm(b1).πAlarm(f2) ++ p(a2|b2,f1).πAlarm(b2).πAlarm(f1) ++ p(a2|b2,f2).πAlarm(b2).πAlarm(f2) += (0.008x0.005x0.03) ++ (0.01x0.005x0.97) ++ (0.8x0.995x0.03) ++ (0.997x0.995x0.97) = 0.98618425 +λ(a1) = λ_Jn(a1) = 0.5 = 0.5 +λ(a2) = λ_Jn(a2) = 0.5 = 0.5 +belief change = 3.299634871e-13 + +var _Jn: +π(_jn0) += p(_jn0|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn0|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn0|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn0|f2,a2).π_Jn(f2).π_Jn(a2) += (1x0.03x0.0138158) ++ (0x0.03x0.986184) ++ (0x0.97x0.0138158) ++ (0x0.97x0.986184) = 0.0004144725001 +π(_jn1) += p(_jn1|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn1|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn1|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn1|f2,a2).π_Jn(f2).π_Jn(a2) += (0x0.03x0.0138158) ++ (1x0.03x0.986184) ++ (0x0.97x0.0138158) ++ (0x0.97x0.986184) = 0.0295855275 +π(_jn2) += p(_jn2|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn2|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn2|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn2|f2,a2).π_Jn(f2).π_Jn(a2) += (0x0.03x0.0138158) ++ (0x0.03x0.986184) ++ (1x0.97x0.0138158) ++ (0x0.97x0.986184) = 0.0134012775 +π(_jn3) += p(_jn3|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn3|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn3|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn3|f2,a2).π_Jn(f2).π_Jn(a2) += (0x0.03x0.0138158) ++ (0x0.03x0.986184) ++ (0x0.97x0.0138158) ++ (1x0.97x0.986184) = 0.9565987225 +λ(_jn0) = 1 +λ(_jn1) = 1 +λ(_jn2) = 1 +λ(_jn3) = 1 +belief change = 2.620320573e-12 + +domain π(Burglar) λ(Burglar) belief +---------------------------------------------------------------- +b1 0.005 0.5 0.005 +b2 0.995 0.5 0.995 + +domain πAlarm(Burglar) λAlarm(Burglar) +---------------------------------------------------------------- +b1 0.005 0.5 +b2 0.995 0.5 + +domain π(FreightTruck) λ(FreightTruck) belief +---------------------------------------------------------------- +f1 0.03 0.25 0.03 +f2 0.97 0.25 0.97 + +domain πAlarm(FreightTruck) λAlarm(FreightTruck) +---------------------------------------------------------------- +f1 0.03 0.5 +f2 0.97 0.5 + +domain π_Jn(FreightTruck) λ_Jn(FreightTruck) +---------------------------------------------------------------- +f1 0.03 0.5 +f2 0.97 0.5 + +domain π(Alarm) λ(Alarm) belief +---------------------------------------------------------------- +a1 0.01381575 0.5 0.01381575 +a2 0.98618425 0.5 0.98618425 + +domain π_Jn(Alarm) λ_Jn(Alarm) +---------------------------------------------------------------- +a1 0.01381575 0.5 +a2 0.98618425 0.5 + +domain π(_Jn) λ(_Jn) belief +---------------------------------------------------------------- +_jn0 0.0004144725001 1 0.0004144725001 +_jn1 0.0295855275 1 0.0295855275 +_jn2 0.0134012775 1 0.0134012775 +_jn3 0.9565987225 1 0.9565987225 + + + +******************************************************************************** + Iteration 66 +******************************************************************************** +λ message Alarm --> Burglar +λAlarm(b1) += [p(a1|b1,f1).πAlarm(f1) + p(a1|b1,f2).πAlarm(f2)].λ(a1) ++ [p(a2|b1,f1).πAlarm(f1) + p(a2|b1,f2).πAlarm(f2)].λ(a2) += [(0.992x0.03) + (0.99x0.97)]x0.5 ++ [(0.008x0.03) + (0.01x0.97)]x0.5 = 0.5 +λAlarm(b2) += [p(a1|b2,f1).πAlarm(f1) + p(a1|b2,f2).πAlarm(f2)].λ(a1) ++ [p(a2|b2,f1).πAlarm(f1) + p(a2|b2,f2).πAlarm(f2)].λ(a2) += [(0.2x0.03) + (0.003x0.97)]x0.5 ++ [(0.8x0.03) + (0.997x0.97)]x0.5 = 0.5 + +λ message Alarm --> FreightTruck +λAlarm(f1) += [p(a1|b1,f1).πAlarm(b1) + p(a1|b2,f1).πAlarm(b2)].λ(a1) ++ [p(a2|b1,f1).πAlarm(b1) + p(a2|b2,f1).πAlarm(b2)].λ(a2) += [(0.992x0.005) + (0.2x0.995)]x0.5 ++ [(0.008x0.005) + (0.8x0.995)]x0.5 = 0.5 +λAlarm(f2) += [p(a1|b1,f2).πAlarm(b1) + p(a1|b2,f2).πAlarm(b2)].λ(a1) ++ [p(a2|b1,f2).πAlarm(b1) + p(a2|b2,f2).πAlarm(b2)].λ(a2) += [(0.99x0.005) + (0.003x0.995)]x0.5 ++ [(0.01x0.005) + (0.997x0.995)]x0.5 = 0.5 + +λ message _Jn --> FreightTruck +λ_Jn(f1) += [p(_jn0|f1,a1).π_Jn(a1) + p(_jn0|f1,a2).π_Jn(a2)].λ(_jn0) ++ [p(_jn1|f1,a1).π_Jn(a1) + p(_jn1|f1,a2).π_Jn(a2)].λ(_jn1) ++ [p(_jn2|f1,a1).π_Jn(a1) + p(_jn2|f1,a2).π_Jn(a2)].λ(_jn2) ++ [p(_jn3|f1,a1).π_Jn(a1) + p(_jn3|f1,a2).π_Jn(a2)].λ(_jn3) += [(1x0.0138158) + (0x0.986184)]x1 ++ [(0x0.0138158) + (1x0.986184)]x1 ++ [(0x0.0138158) + (0x0.986184)]x1 ++ [(0x0.0138158) + (0x0.986184)]x1 = 1 +λ_Jn(f2) += [p(_jn0|f2,a1).π_Jn(a1) + p(_jn0|f2,a2).π_Jn(a2)].λ(_jn0) ++ [p(_jn1|f2,a1).π_Jn(a1) + p(_jn1|f2,a2).π_Jn(a2)].λ(_jn1) ++ [p(_jn2|f2,a1).π_Jn(a1) + p(_jn2|f2,a2).π_Jn(a2)].λ(_jn2) ++ [p(_jn3|f2,a1).π_Jn(a1) + p(_jn3|f2,a2).π_Jn(a2)].λ(_jn3) += [(0x0.0138158) + (0x0.986184)]x1 ++ [(0x0.0138158) + (0x0.986184)]x1 ++ [(1x0.0138158) + (0x0.986184)]x1 ++ [(0x0.0138158) + (1x0.986184)]x1 = 1 + +λ message _Jn --> Alarm +λ_Jn(a1) += [p(_jn0|f1,a1).π_Jn(f1) + p(_jn0|f2,a1).π_Jn(f2)].λ(_jn0) ++ [p(_jn1|f1,a1).π_Jn(f1) + p(_jn1|f2,a1).π_Jn(f2)].λ(_jn1) ++ [p(_jn2|f1,a1).π_Jn(f1) + p(_jn2|f2,a1).π_Jn(f2)].λ(_jn2) ++ [p(_jn3|f1,a1).π_Jn(f1) + p(_jn3|f2,a1).π_Jn(f2)].λ(_jn3) += [(1x0.03) + (0x0.97)]x1 ++ [(0x0.03) + (0x0.97)]x1 ++ [(0x0.03) + (1x0.97)]x1 ++ [(0x0.03) + (0x0.97)]x1 = 1 +λ_Jn(a2) += [p(_jn0|f1,a2).π_Jn(f1) + p(_jn0|f2,a2).π_Jn(f2)].λ(_jn0) ++ [p(_jn1|f1,a2).π_Jn(f1) + p(_jn1|f2,a2).π_Jn(f2)].λ(_jn1) ++ [p(_jn2|f1,a2).π_Jn(f1) + p(_jn2|f2,a2).π_Jn(f2)].λ(_jn2) ++ [p(_jn3|f1,a2).π_Jn(f1) + p(_jn3|f2,a2).π_Jn(f2)].λ(_jn3) += [(0x0.03) + (0x0.97)]x1 ++ [(1x0.03) + (0x0.97)]x1 ++ [(0x0.03) + (0x0.97)]x1 ++ [(0x0.03) + (1x0.97)]x1 = 1 + +π message Burglar --> Alarm +πAlarm(b1) = π(b1) = 0.005 = 0.005 +πAlarm(b2) = π(b2) = 0.995 = 0.995 + +π message FreightTruck --> Alarm +πAlarm(f1) = π(f1).λ_Jn(f1) = 0.03 x 0.5 = 0.015 +πAlarm(f2) = π(f2).λ_Jn(f2) = 0.97 x 0.5 = 0.485 + +π message FreightTruck --> _Jn +π_Jn(f1) = π(f1).λAlarm(f1) = 0.03 x 0.5 = 0.015 +π_Jn(f2) = π(f2).λAlarm(f2) = 0.97 x 0.5 = 0.485 + +π message Alarm --> _Jn +π_Jn(a1) = π(a1) = 0.0138158 = 0.01381575 +π_Jn(a2) = π(a2) = 0.986184 = 0.98618425 + +var Burglar: +π(b1) += p(b1) += (0.005) = 0.005 +π(b2) += p(b2) += (0.995) = 0.995 +λ(b1) = λAlarm(b1) = 0.5 = 0.5 +λ(b2) = λAlarm(b2) = 0.5 = 0.5 +belief change = 0 + +var FreightTruck: +π(f1) += p(f1) += (0.03) = 0.03 +π(f2) += p(f2) += (0.97) = 0.97 +λ(f1) = λAlarm(f1).λ_Jn(f1) = 0.5 x 0.5 = 0.25 +λ(f2) = λAlarm(f2).λ_Jn(f2) = 0.5 x 0.5 = 0.25 +belief change = 0 + +var Alarm: +π(a1) += p(a1|b1,f1).πAlarm(b1).πAlarm(f1) ++ p(a1|b1,f2).πAlarm(b1).πAlarm(f2) ++ p(a1|b2,f1).πAlarm(b2).πAlarm(f1) ++ p(a1|b2,f2).πAlarm(b2).πAlarm(f2) += (0.992x0.005x0.03) ++ (0.99x0.005x0.97) ++ (0.2x0.995x0.03) ++ (0.003x0.995x0.97) = 0.01381575 +π(a2) += p(a2|b1,f1).πAlarm(b1).πAlarm(f1) ++ p(a2|b1,f2).πAlarm(b1).πAlarm(f2) ++ p(a2|b2,f1).πAlarm(b2).πAlarm(f1) ++ p(a2|b2,f2).πAlarm(b2).πAlarm(f2) += (0.008x0.005x0.03) ++ (0.01x0.005x0.97) ++ (0.8x0.995x0.03) ++ (0.997x0.995x0.97) = 0.98618425 +λ(a1) = λ_Jn(a1) = 0.5 = 0.5 +λ(a2) = λ_Jn(a2) = 0.5 = 0.5 +belief change = 2.200132437e-13 + +var _Jn: +π(_jn0) += p(_jn0|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn0|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn0|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn0|f2,a2).π_Jn(f2).π_Jn(a2) += (1x0.03x0.0138158) ++ (0x0.03x0.986184) ++ (0x0.97x0.0138158) ++ (0x0.97x0.986184) = 0.0004144725 +π(_jn1) += p(_jn1|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn1|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn1|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn1|f2,a2).π_Jn(f2).π_Jn(a2) += (0x0.03x0.0138158) ++ (1x0.03x0.986184) ++ (0x0.97x0.0138158) ++ (0x0.97x0.986184) = 0.0295855275 +π(_jn2) += p(_jn2|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn2|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn2|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn2|f2,a2).π_Jn(f2).π_Jn(a2) += (0x0.03x0.0138158) ++ (0x0.03x0.986184) ++ (1x0.97x0.0138158) ++ (0x0.97x0.986184) = 0.0134012775 +π(_jn3) += p(_jn3|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn3|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn3|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn3|f2,a2).π_Jn(f2).π_Jn(a2) += (0x0.03x0.0138158) ++ (0x0.03x0.986184) ++ (0x0.97x0.0138158) ++ (1x0.97x0.986184) = 0.9565987225 +λ(_jn0) = 1 +λ(_jn1) = 1 +λ(_jn2) = 1 +λ(_jn3) = 1 +belief change = 1.746729985e-12 + +domain π(Burglar) λ(Burglar) belief +---------------------------------------------------------------- +b1 0.005 0.5 0.005 +b2 0.995 0.5 0.995 + +domain πAlarm(Burglar) λAlarm(Burglar) +---------------------------------------------------------------- +b1 0.005 0.5 +b2 0.995 0.5 + +domain π(FreightTruck) λ(FreightTruck) belief +---------------------------------------------------------------- +f1 0.03 0.25 0.03 +f2 0.97 0.25 0.97 + +domain πAlarm(FreightTruck) λAlarm(FreightTruck) +---------------------------------------------------------------- +f1 0.03 0.5 +f2 0.97 0.5 + +domain π_Jn(FreightTruck) λ_Jn(FreightTruck) +---------------------------------------------------------------- +f1 0.03 0.5 +f2 0.97 0.5 + +domain π(Alarm) λ(Alarm) belief +---------------------------------------------------------------- +a1 0.01381575 0.5 0.01381575 +a2 0.98618425 0.5 0.98618425 + +domain π_Jn(Alarm) λ_Jn(Alarm) +---------------------------------------------------------------- +a1 0.01381575 0.5 +a2 0.98618425 0.5 + +domain π(_Jn) λ(_Jn) belief +---------------------------------------------------------------- +_jn0 0.0004144725 1 0.0004144725 +_jn1 0.0295855275 1 0.0295855275 +_jn2 0.0134012775 1 0.0134012775 +_jn3 0.9565987225 1 0.9565987225 + + + +******************************************************************************** + Iteration 67 +******************************************************************************** +λ message Alarm --> Burglar +λAlarm(b1) += [p(a1|b1,f1).πAlarm(f1) + p(a1|b1,f2).πAlarm(f2)].λ(a1) ++ [p(a2|b1,f1).πAlarm(f1) + p(a2|b1,f2).πAlarm(f2)].λ(a2) += [(0.992x0.03) + (0.99x0.97)]x0.5 ++ [(0.008x0.03) + (0.01x0.97)]x0.5 = 0.5 +λAlarm(b2) += [p(a1|b2,f1).πAlarm(f1) + p(a1|b2,f2).πAlarm(f2)].λ(a1) ++ [p(a2|b2,f1).πAlarm(f1) + p(a2|b2,f2).πAlarm(f2)].λ(a2) += [(0.2x0.03) + (0.003x0.97)]x0.5 ++ [(0.8x0.03) + (0.997x0.97)]x0.5 = 0.5 + +λ message Alarm --> FreightTruck +λAlarm(f1) += [p(a1|b1,f1).πAlarm(b1) + p(a1|b2,f1).πAlarm(b2)].λ(a1) ++ [p(a2|b1,f1).πAlarm(b1) + p(a2|b2,f1).πAlarm(b2)].λ(a2) += [(0.992x0.005) + (0.2x0.995)]x0.5 ++ [(0.008x0.005) + (0.8x0.995)]x0.5 = 0.5 +λAlarm(f2) += [p(a1|b1,f2).πAlarm(b1) + p(a1|b2,f2).πAlarm(b2)].λ(a1) ++ [p(a2|b1,f2).πAlarm(b1) + p(a2|b2,f2).πAlarm(b2)].λ(a2) += [(0.99x0.005) + (0.003x0.995)]x0.5 ++ [(0.01x0.005) + (0.997x0.995)]x0.5 = 0.5 + +λ message _Jn --> FreightTruck +λ_Jn(f1) += [p(_jn0|f1,a1).π_Jn(a1) + p(_jn0|f1,a2).π_Jn(a2)].λ(_jn0) ++ [p(_jn1|f1,a1).π_Jn(a1) + p(_jn1|f1,a2).π_Jn(a2)].λ(_jn1) ++ [p(_jn2|f1,a1).π_Jn(a1) + p(_jn2|f1,a2).π_Jn(a2)].λ(_jn2) ++ [p(_jn3|f1,a1).π_Jn(a1) + p(_jn3|f1,a2).π_Jn(a2)].λ(_jn3) += [(1x0.0138158) + (0x0.986184)]x1 ++ [(0x0.0138158) + (1x0.986184)]x1 ++ [(0x0.0138158) + (0x0.986184)]x1 ++ [(0x0.0138158) + (0x0.986184)]x1 = 1 +λ_Jn(f2) += [p(_jn0|f2,a1).π_Jn(a1) + p(_jn0|f2,a2).π_Jn(a2)].λ(_jn0) ++ [p(_jn1|f2,a1).π_Jn(a1) + p(_jn1|f2,a2).π_Jn(a2)].λ(_jn1) ++ [p(_jn2|f2,a1).π_Jn(a1) + p(_jn2|f2,a2).π_Jn(a2)].λ(_jn2) ++ [p(_jn3|f2,a1).π_Jn(a1) + p(_jn3|f2,a2).π_Jn(a2)].λ(_jn3) += [(0x0.0138158) + (0x0.986184)]x1 ++ [(0x0.0138158) + (0x0.986184)]x1 ++ [(1x0.0138158) + (0x0.986184)]x1 ++ [(0x0.0138158) + (1x0.986184)]x1 = 1 + +λ message _Jn --> Alarm +λ_Jn(a1) += [p(_jn0|f1,a1).π_Jn(f1) + p(_jn0|f2,a1).π_Jn(f2)].λ(_jn0) ++ [p(_jn1|f1,a1).π_Jn(f1) + p(_jn1|f2,a1).π_Jn(f2)].λ(_jn1) ++ [p(_jn2|f1,a1).π_Jn(f1) + p(_jn2|f2,a1).π_Jn(f2)].λ(_jn2) ++ [p(_jn3|f1,a1).π_Jn(f1) + p(_jn3|f2,a1).π_Jn(f2)].λ(_jn3) += [(1x0.03) + (0x0.97)]x1 ++ [(0x0.03) + (0x0.97)]x1 ++ [(0x0.03) + (1x0.97)]x1 ++ [(0x0.03) + (0x0.97)]x1 = 1 +λ_Jn(a2) += [p(_jn0|f1,a2).π_Jn(f1) + p(_jn0|f2,a2).π_Jn(f2)].λ(_jn0) ++ [p(_jn1|f1,a2).π_Jn(f1) + p(_jn1|f2,a2).π_Jn(f2)].λ(_jn1) ++ [p(_jn2|f1,a2).π_Jn(f1) + p(_jn2|f2,a2).π_Jn(f2)].λ(_jn2) ++ [p(_jn3|f1,a2).π_Jn(f1) + p(_jn3|f2,a2).π_Jn(f2)].λ(_jn3) += [(0x0.03) + (0x0.97)]x1 ++ [(1x0.03) + (0x0.97)]x1 ++ [(0x0.03) + (0x0.97)]x1 ++ [(0x0.03) + (1x0.97)]x1 = 1 + +π message Burglar --> Alarm +πAlarm(b1) = π(b1) = 0.005 = 0.005 +πAlarm(b2) = π(b2) = 0.995 = 0.995 + +π message FreightTruck --> Alarm +πAlarm(f1) = π(f1).λ_Jn(f1) = 0.03 x 0.5 = 0.015 +πAlarm(f2) = π(f2).λ_Jn(f2) = 0.97 x 0.5 = 0.485 + +π message FreightTruck --> _Jn +π_Jn(f1) = π(f1).λAlarm(f1) = 0.03 x 0.5 = 0.015 +π_Jn(f2) = π(f2).λAlarm(f2) = 0.97 x 0.5 = 0.485 + +π message Alarm --> _Jn +π_Jn(a1) = π(a1) = 0.0138158 = 0.01381575 +π_Jn(a2) = π(a2) = 0.986184 = 0.98618425 + +var Burglar: +π(b1) += p(b1) += (0.005) = 0.005 +π(b2) += p(b2) += (0.995) = 0.995 +λ(b1) = λAlarm(b1) = 0.5 = 0.5 +λ(b2) = λAlarm(b2) = 0.5 = 0.5 +belief change = 0 + +var FreightTruck: +π(f1) += p(f1) += (0.03) = 0.03 +π(f2) += p(f2) += (0.97) = 0.97 +λ(f1) = λAlarm(f1).λ_Jn(f1) = 0.5 x 0.5 = 0.25 +λ(f2) = λAlarm(f2).λ_Jn(f2) = 0.5 x 0.5 = 0.25 +belief change = 0 + +var Alarm: +π(a1) += p(a1|b1,f1).πAlarm(b1).πAlarm(f1) ++ p(a1|b1,f2).πAlarm(b1).πAlarm(f2) ++ p(a1|b2,f1).πAlarm(b2).πAlarm(f1) ++ p(a1|b2,f2).πAlarm(b2).πAlarm(f2) += (0.992x0.005x0.03) ++ (0.99x0.005x0.97) ++ (0.2x0.995x0.03) ++ (0.003x0.995x0.97) = 0.01381575 +π(a2) += p(a2|b1,f1).πAlarm(b1).πAlarm(f1) ++ p(a2|b1,f2).πAlarm(b1).πAlarm(f2) ++ p(a2|b2,f1).πAlarm(b2).πAlarm(f1) ++ p(a2|b2,f2).πAlarm(b2).πAlarm(f2) += (0.008x0.005x0.03) ++ (0.01x0.005x0.97) ++ (0.8x0.995x0.03) ++ (0.997x0.995x0.97) = 0.98618425 +λ(a1) = λ_Jn(a1) = 0.5 = 0.5 +λ(a2) = λ_Jn(a2) = 0.5 = 0.5 +belief change = 1.466032157e-13 + +var _Jn: +π(_jn0) += p(_jn0|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn0|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn0|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn0|f2,a2).π_Jn(f2).π_Jn(a2) += (1x0.03x0.0138158) ++ (0x0.03x0.986184) ++ (0x0.97x0.0138158) ++ (0x0.97x0.986184) = 0.0004144725 +π(_jn1) += p(_jn1|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn1|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn1|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn1|f2,a2).π_Jn(f2).π_Jn(a2) += (0x0.03x0.0138158) ++ (1x0.03x0.986184) ++ (0x0.97x0.0138158) ++ (0x0.97x0.986184) = 0.0295855275 +π(_jn2) += p(_jn2|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn2|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn2|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn2|f2,a2).π_Jn(f2).π_Jn(a2) += (0x0.03x0.0138158) ++ (0x0.03x0.986184) ++ (1x0.97x0.0138158) ++ (0x0.97x0.986184) = 0.0134012775 +π(_jn3) += p(_jn3|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn3|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn3|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn3|f2,a2).π_Jn(f2).π_Jn(a2) += (0x0.03x0.0138158) ++ (0x0.03x0.986184) ++ (0x0.97x0.0138158) ++ (1x0.97x0.986184) = 0.9565987225 +λ(_jn0) = 1 +λ(_jn1) = 1 +λ(_jn2) = 1 +λ(_jn3) = 1 +belief change = 1.164591806e-12 + +domain π(Burglar) λ(Burglar) belief +---------------------------------------------------------------- +b1 0.005 0.5 0.005 +b2 0.995 0.5 0.995 + +domain πAlarm(Burglar) λAlarm(Burglar) +---------------------------------------------------------------- +b1 0.005 0.5 +b2 0.995 0.5 + +domain π(FreightTruck) λ(FreightTruck) belief +---------------------------------------------------------------- +f1 0.03 0.25 0.03 +f2 0.97 0.25 0.97 + +domain πAlarm(FreightTruck) λAlarm(FreightTruck) +---------------------------------------------------------------- +f1 0.03 0.5 +f2 0.97 0.5 + +domain π_Jn(FreightTruck) λ_Jn(FreightTruck) +---------------------------------------------------------------- +f1 0.03 0.5 +f2 0.97 0.5 + +domain π(Alarm) λ(Alarm) belief +---------------------------------------------------------------- +a1 0.01381575 0.5 0.01381575 +a2 0.98618425 0.5 0.98618425 + +domain π_Jn(Alarm) λ_Jn(Alarm) +---------------------------------------------------------------- +a1 0.01381575 0.5 +a2 0.98618425 0.5 + +domain π(_Jn) λ(_Jn) belief +---------------------------------------------------------------- +_jn0 0.0004144725 1 0.0004144725 +_jn1 0.0295855275 1 0.0295855275 +_jn2 0.0134012775 1 0.0134012775 +_jn3 0.9565987225 1 0.9565987225 + + + +******************************************************************************** + Iteration 68 +******************************************************************************** +λ message Alarm --> Burglar +λAlarm(b1) += [p(a1|b1,f1).πAlarm(f1) + p(a1|b1,f2).πAlarm(f2)].λ(a1) ++ [p(a2|b1,f1).πAlarm(f1) + p(a2|b1,f2).πAlarm(f2)].λ(a2) += [(0.992x0.03) + (0.99x0.97)]x0.5 ++ [(0.008x0.03) + (0.01x0.97)]x0.5 = 0.5 +λAlarm(b2) += [p(a1|b2,f1).πAlarm(f1) + p(a1|b2,f2).πAlarm(f2)].λ(a1) ++ [p(a2|b2,f1).πAlarm(f1) + p(a2|b2,f2).πAlarm(f2)].λ(a2) += [(0.2x0.03) + (0.003x0.97)]x0.5 ++ [(0.8x0.03) + (0.997x0.97)]x0.5 = 0.5 + +λ message Alarm --> FreightTruck +λAlarm(f1) += [p(a1|b1,f1).πAlarm(b1) + p(a1|b2,f1).πAlarm(b2)].λ(a1) ++ [p(a2|b1,f1).πAlarm(b1) + p(a2|b2,f1).πAlarm(b2)].λ(a2) += [(0.992x0.005) + (0.2x0.995)]x0.5 ++ [(0.008x0.005) + (0.8x0.995)]x0.5 = 0.5 +λAlarm(f2) += [p(a1|b1,f2).πAlarm(b1) + p(a1|b2,f2).πAlarm(b2)].λ(a1) ++ [p(a2|b1,f2).πAlarm(b1) + p(a2|b2,f2).πAlarm(b2)].λ(a2) += [(0.99x0.005) + (0.003x0.995)]x0.5 ++ [(0.01x0.005) + (0.997x0.995)]x0.5 = 0.5 + +λ message _Jn --> FreightTruck +λ_Jn(f1) += [p(_jn0|f1,a1).π_Jn(a1) + p(_jn0|f1,a2).π_Jn(a2)].λ(_jn0) ++ [p(_jn1|f1,a1).π_Jn(a1) + p(_jn1|f1,a2).π_Jn(a2)].λ(_jn1) ++ [p(_jn2|f1,a1).π_Jn(a1) + p(_jn2|f1,a2).π_Jn(a2)].λ(_jn2) ++ [p(_jn3|f1,a1).π_Jn(a1) + p(_jn3|f1,a2).π_Jn(a2)].λ(_jn3) += [(1x0.0138158) + (0x0.986184)]x1 ++ [(0x0.0138158) + (1x0.986184)]x1 ++ [(0x0.0138158) + (0x0.986184)]x1 ++ [(0x0.0138158) + (0x0.986184)]x1 = 1 +λ_Jn(f2) += [p(_jn0|f2,a1).π_Jn(a1) + p(_jn0|f2,a2).π_Jn(a2)].λ(_jn0) ++ [p(_jn1|f2,a1).π_Jn(a1) + p(_jn1|f2,a2).π_Jn(a2)].λ(_jn1) ++ [p(_jn2|f2,a1).π_Jn(a1) + p(_jn2|f2,a2).π_Jn(a2)].λ(_jn2) ++ [p(_jn3|f2,a1).π_Jn(a1) + p(_jn3|f2,a2).π_Jn(a2)].λ(_jn3) += [(0x0.0138158) + (0x0.986184)]x1 ++ [(0x0.0138158) + (0x0.986184)]x1 ++ [(1x0.0138158) + (0x0.986184)]x1 ++ [(0x0.0138158) + (1x0.986184)]x1 = 1 + +λ message _Jn --> Alarm +λ_Jn(a1) += [p(_jn0|f1,a1).π_Jn(f1) + p(_jn0|f2,a1).π_Jn(f2)].λ(_jn0) ++ [p(_jn1|f1,a1).π_Jn(f1) + p(_jn1|f2,a1).π_Jn(f2)].λ(_jn1) ++ [p(_jn2|f1,a1).π_Jn(f1) + p(_jn2|f2,a1).π_Jn(f2)].λ(_jn2) ++ [p(_jn3|f1,a1).π_Jn(f1) + p(_jn3|f2,a1).π_Jn(f2)].λ(_jn3) += [(1x0.03) + (0x0.97)]x1 ++ [(0x0.03) + (0x0.97)]x1 ++ [(0x0.03) + (1x0.97)]x1 ++ [(0x0.03) + (0x0.97)]x1 = 1 +λ_Jn(a2) += [p(_jn0|f1,a2).π_Jn(f1) + p(_jn0|f2,a2).π_Jn(f2)].λ(_jn0) ++ [p(_jn1|f1,a2).π_Jn(f1) + p(_jn1|f2,a2).π_Jn(f2)].λ(_jn1) ++ [p(_jn2|f1,a2).π_Jn(f1) + p(_jn2|f2,a2).π_Jn(f2)].λ(_jn2) ++ [p(_jn3|f1,a2).π_Jn(f1) + p(_jn3|f2,a2).π_Jn(f2)].λ(_jn3) += [(0x0.03) + (0x0.97)]x1 ++ [(1x0.03) + (0x0.97)]x1 ++ [(0x0.03) + (0x0.97)]x1 ++ [(0x0.03) + (1x0.97)]x1 = 1 + +π message Burglar --> Alarm +πAlarm(b1) = π(b1) = 0.005 = 0.005 +πAlarm(b2) = π(b2) = 0.995 = 0.995 + +π message FreightTruck --> Alarm +πAlarm(f1) = π(f1).λ_Jn(f1) = 0.03 x 0.5 = 0.015 +πAlarm(f2) = π(f2).λ_Jn(f2) = 0.97 x 0.5 = 0.485 + +π message FreightTruck --> _Jn +π_Jn(f1) = π(f1).λAlarm(f1) = 0.03 x 0.5 = 0.015 +π_Jn(f2) = π(f2).λAlarm(f2) = 0.97 x 0.5 = 0.485 + +π message Alarm --> _Jn +π_Jn(a1) = π(a1) = 0.0138158 = 0.01381575 +π_Jn(a2) = π(a2) = 0.986184 = 0.98618425 + +var Burglar: +π(b1) += p(b1) += (0.005) = 0.005 +π(b2) += p(b2) += (0.995) = 0.995 +λ(b1) = λAlarm(b1) = 0.5 = 0.5 +λ(b2) = λAlarm(b2) = 0.5 = 0.5 +belief change = 0 + +var FreightTruck: +π(f1) += p(f1) += (0.03) = 0.03 +π(f2) += p(f2) += (0.97) = 0.97 +λ(f1) = λAlarm(f1).λ_Jn(f1) = 0.5 x 0.5 = 0.25 +λ(f2) = λAlarm(f2).λ_Jn(f2) = 0.5 x 0.5 = 0.25 +belief change = 0 + +var Alarm: +π(a1) += p(a1|b1,f1).πAlarm(b1).πAlarm(f1) ++ p(a1|b1,f2).πAlarm(b1).πAlarm(f2) ++ p(a1|b2,f1).πAlarm(b2).πAlarm(f1) ++ p(a1|b2,f2).πAlarm(b2).πAlarm(f2) += (0.992x0.005x0.03) ++ (0.99x0.005x0.97) ++ (0.2x0.995x0.03) ++ (0.003x0.995x0.97) = 0.01381575 +π(a2) += p(a2|b1,f1).πAlarm(b1).πAlarm(f1) ++ p(a2|b1,f2).πAlarm(b1).πAlarm(f2) ++ p(a2|b2,f1).πAlarm(b2).πAlarm(f1) ++ p(a2|b2,f2).πAlarm(b2).πAlarm(f2) += (0.008x0.005x0.03) ++ (0.01x0.005x0.97) ++ (0.8x0.995x0.03) ++ (0.997x0.995x0.97) = 0.98618425 +λ(a1) = λ_Jn(a1) = 0.5 = 0.5 +λ(a2) = λ_Jn(a2) = 0.5 = 0.5 +belief change = 9.784360822e-14 + +var _Jn: +π(_jn0) += p(_jn0|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn0|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn0|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn0|f2,a2).π_Jn(f2).π_Jn(a2) += (1x0.03x0.0138158) ++ (0x0.03x0.986184) ++ (0x0.97x0.0138158) ++ (0x0.97x0.986184) = 0.0004144725 +π(_jn1) += p(_jn1|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn1|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn1|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn1|f2,a2).π_Jn(f2).π_Jn(a2) += (0x0.03x0.0138158) ++ (1x0.03x0.986184) ++ (0x0.97x0.0138158) ++ (0x0.97x0.986184) = 0.0295855275 +π(_jn2) += p(_jn2|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn2|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn2|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn2|f2,a2).π_Jn(f2).π_Jn(a2) += (0x0.03x0.0138158) ++ (0x0.03x0.986184) ++ (1x0.97x0.0138158) ++ (0x0.97x0.986184) = 0.0134012775 +π(_jn3) += p(_jn3|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn3|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn3|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn3|f2,a2).π_Jn(f2).π_Jn(a2) += (0x0.03x0.0138158) ++ (0x0.03x0.986184) ++ (0x0.97x0.0138158) ++ (1x0.97x0.986184) = 0.9565987225 +λ(_jn0) = 1 +λ(_jn1) = 1 +λ(_jn2) = 1 +λ(_jn3) = 1 +belief change = 7.76429756e-13 + +domain π(Burglar) λ(Burglar) belief +---------------------------------------------------------------- +b1 0.005 0.5 0.005 +b2 0.995 0.5 0.995 + +domain πAlarm(Burglar) λAlarm(Burglar) +---------------------------------------------------------------- +b1 0.005 0.5 +b2 0.995 0.5 + +domain π(FreightTruck) λ(FreightTruck) belief +---------------------------------------------------------------- +f1 0.03 0.25 0.03 +f2 0.97 0.25 0.97 + +domain πAlarm(FreightTruck) λAlarm(FreightTruck) +---------------------------------------------------------------- +f1 0.03 0.5 +f2 0.97 0.5 + +domain π_Jn(FreightTruck) λ_Jn(FreightTruck) +---------------------------------------------------------------- +f1 0.03 0.5 +f2 0.97 0.5 + +domain π(Alarm) λ(Alarm) belief +---------------------------------------------------------------- +a1 0.01381575 0.5 0.01381575 +a2 0.98618425 0.5 0.98618425 + +domain π_Jn(Alarm) λ_Jn(Alarm) +---------------------------------------------------------------- +a1 0.01381575 0.5 +a2 0.98618425 0.5 + +domain π(_Jn) λ(_Jn) belief +---------------------------------------------------------------- +_jn0 0.0004144725 1 0.0004144725 +_jn1 0.0295855275 1 0.0295855275 +_jn2 0.0134012775 1 0.0134012775 +_jn3 0.9565987225 1 0.9565987225 + + + +******************************************************************************** + Iteration 69 +******************************************************************************** +λ message Alarm --> Burglar +λAlarm(b1) += [p(a1|b1,f1).πAlarm(f1) + p(a1|b1,f2).πAlarm(f2)].λ(a1) ++ [p(a2|b1,f1).πAlarm(f1) + p(a2|b1,f2).πAlarm(f2)].λ(a2) += [(0.992x0.03) + (0.99x0.97)]x0.5 ++ [(0.008x0.03) + (0.01x0.97)]x0.5 = 0.5 +λAlarm(b2) += [p(a1|b2,f1).πAlarm(f1) + p(a1|b2,f2).πAlarm(f2)].λ(a1) ++ [p(a2|b2,f1).πAlarm(f1) + p(a2|b2,f2).πAlarm(f2)].λ(a2) += [(0.2x0.03) + (0.003x0.97)]x0.5 ++ [(0.8x0.03) + (0.997x0.97)]x0.5 = 0.5 + +λ message Alarm --> FreightTruck +λAlarm(f1) += [p(a1|b1,f1).πAlarm(b1) + p(a1|b2,f1).πAlarm(b2)].λ(a1) ++ [p(a2|b1,f1).πAlarm(b1) + p(a2|b2,f1).πAlarm(b2)].λ(a2) += [(0.992x0.005) + (0.2x0.995)]x0.5 ++ [(0.008x0.005) + (0.8x0.995)]x0.5 = 0.5 +λAlarm(f2) += [p(a1|b1,f2).πAlarm(b1) + p(a1|b2,f2).πAlarm(b2)].λ(a1) ++ [p(a2|b1,f2).πAlarm(b1) + p(a2|b2,f2).πAlarm(b2)].λ(a2) += [(0.99x0.005) + (0.003x0.995)]x0.5 ++ [(0.01x0.005) + (0.997x0.995)]x0.5 = 0.5 + +λ message _Jn --> FreightTruck +λ_Jn(f1) += [p(_jn0|f1,a1).π_Jn(a1) + p(_jn0|f1,a2).π_Jn(a2)].λ(_jn0) ++ [p(_jn1|f1,a1).π_Jn(a1) + p(_jn1|f1,a2).π_Jn(a2)].λ(_jn1) ++ [p(_jn2|f1,a1).π_Jn(a1) + p(_jn2|f1,a2).π_Jn(a2)].λ(_jn2) ++ [p(_jn3|f1,a1).π_Jn(a1) + p(_jn3|f1,a2).π_Jn(a2)].λ(_jn3) += [(1x0.0138158) + (0x0.986184)]x1 ++ [(0x0.0138158) + (1x0.986184)]x1 ++ [(0x0.0138158) + (0x0.986184)]x1 ++ [(0x0.0138158) + (0x0.986184)]x1 = 1 +λ_Jn(f2) += [p(_jn0|f2,a1).π_Jn(a1) + p(_jn0|f2,a2).π_Jn(a2)].λ(_jn0) ++ [p(_jn1|f2,a1).π_Jn(a1) + p(_jn1|f2,a2).π_Jn(a2)].λ(_jn1) ++ [p(_jn2|f2,a1).π_Jn(a1) + p(_jn2|f2,a2).π_Jn(a2)].λ(_jn2) ++ [p(_jn3|f2,a1).π_Jn(a1) + p(_jn3|f2,a2).π_Jn(a2)].λ(_jn3) += [(0x0.0138158) + (0x0.986184)]x1 ++ [(0x0.0138158) + (0x0.986184)]x1 ++ [(1x0.0138158) + (0x0.986184)]x1 ++ [(0x0.0138158) + (1x0.986184)]x1 = 1 + +λ message _Jn --> Alarm +λ_Jn(a1) += [p(_jn0|f1,a1).π_Jn(f1) + p(_jn0|f2,a1).π_Jn(f2)].λ(_jn0) ++ [p(_jn1|f1,a1).π_Jn(f1) + p(_jn1|f2,a1).π_Jn(f2)].λ(_jn1) ++ [p(_jn2|f1,a1).π_Jn(f1) + p(_jn2|f2,a1).π_Jn(f2)].λ(_jn2) ++ [p(_jn3|f1,a1).π_Jn(f1) + p(_jn3|f2,a1).π_Jn(f2)].λ(_jn3) += [(1x0.03) + (0x0.97)]x1 ++ [(0x0.03) + (0x0.97)]x1 ++ [(0x0.03) + (1x0.97)]x1 ++ [(0x0.03) + (0x0.97)]x1 = 1 +λ_Jn(a2) += [p(_jn0|f1,a2).π_Jn(f1) + p(_jn0|f2,a2).π_Jn(f2)].λ(_jn0) ++ [p(_jn1|f1,a2).π_Jn(f1) + p(_jn1|f2,a2).π_Jn(f2)].λ(_jn1) ++ [p(_jn2|f1,a2).π_Jn(f1) + p(_jn2|f2,a2).π_Jn(f2)].λ(_jn2) ++ [p(_jn3|f1,a2).π_Jn(f1) + p(_jn3|f2,a2).π_Jn(f2)].λ(_jn3) += [(0x0.03) + (0x0.97)]x1 ++ [(1x0.03) + (0x0.97)]x1 ++ [(0x0.03) + (0x0.97)]x1 ++ [(0x0.03) + (1x0.97)]x1 = 1 + +π message Burglar --> Alarm +πAlarm(b1) = π(b1) = 0.005 = 0.005 +πAlarm(b2) = π(b2) = 0.995 = 0.995 + +π message FreightTruck --> Alarm +πAlarm(f1) = π(f1).λ_Jn(f1) = 0.03 x 0.5 = 0.015 +πAlarm(f2) = π(f2).λ_Jn(f2) = 0.97 x 0.5 = 0.485 + +π message FreightTruck --> _Jn +π_Jn(f1) = π(f1).λAlarm(f1) = 0.03 x 0.5 = 0.015 +π_Jn(f2) = π(f2).λAlarm(f2) = 0.97 x 0.5 = 0.485 + +π message Alarm --> _Jn +π_Jn(a1) = π(a1) = 0.0138158 = 0.01381575 +π_Jn(a2) = π(a2) = 0.986184 = 0.98618425 + +var Burglar: +π(b1) += p(b1) += (0.005) = 0.005 +π(b2) += p(b2) += (0.995) = 0.995 +λ(b1) = λAlarm(b1) = 0.5 = 0.5 +λ(b2) = λAlarm(b2) = 0.5 = 0.5 +belief change = 8.67361738e-19 + +var FreightTruck: +π(f1) += p(f1) += (0.03) = 0.03 +π(f2) += p(f2) += (0.97) = 0.97 +λ(f1) = λAlarm(f1).λ_Jn(f1) = 0.5 x 0.5 = 0.25 +λ(f2) = λAlarm(f2).λ_Jn(f2) = 0.5 x 0.5 = 0.25 +belief change = 0 + +var Alarm: +π(a1) += p(a1|b1,f1).πAlarm(b1).πAlarm(f1) ++ p(a1|b1,f2).πAlarm(b1).πAlarm(f2) ++ p(a1|b2,f1).πAlarm(b2).πAlarm(f1) ++ p(a1|b2,f2).πAlarm(b2).πAlarm(f2) += (0.992x0.005x0.03) ++ (0.99x0.005x0.97) ++ (0.2x0.995x0.03) ++ (0.003x0.995x0.97) = 0.01381575 +π(a2) += p(a2|b1,f1).πAlarm(b1).πAlarm(f1) ++ p(a2|b1,f2).πAlarm(b1).πAlarm(f2) ++ p(a2|b2,f1).πAlarm(b2).πAlarm(f1) ++ p(a2|b2,f2).πAlarm(b2).πAlarm(f2) += (0.008x0.005x0.03) ++ (0.01x0.005x0.97) ++ (0.8x0.995x0.03) ++ (0.997x0.995x0.97) = 0.98618425 +λ(a1) = λ_Jn(a1) = 0.5 = 0.5 +λ(a2) = λ_Jn(a2) = 0.5 = 0.5 +belief change = 6.512151929e-14 + +var _Jn: +π(_jn0) += p(_jn0|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn0|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn0|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn0|f2,a2).π_Jn(f2).π_Jn(a2) += (1x0.03x0.0138158) ++ (0x0.03x0.986184) ++ (0x0.97x0.0138158) ++ (0x0.97x0.986184) = 0.0004144725 +π(_jn1) += p(_jn1|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn1|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn1|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn1|f2,a2).π_Jn(f2).π_Jn(a2) += (0x0.03x0.0138158) ++ (1x0.03x0.986184) ++ (0x0.97x0.0138158) ++ (0x0.97x0.986184) = 0.0295855275 +π(_jn2) += p(_jn2|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn2|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn2|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn2|f2,a2).π_Jn(f2).π_Jn(a2) += (0x0.03x0.0138158) ++ (0x0.03x0.986184) ++ (1x0.97x0.0138158) ++ (0x0.97x0.986184) = 0.0134012775 +π(_jn3) += p(_jn3|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn3|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn3|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn3|f2,a2).π_Jn(f2).π_Jn(a2) += (0x0.03x0.0138158) ++ (0x0.03x0.986184) ++ (0x0.97x0.0138158) ++ (1x0.97x0.986184) = 0.9565987225 +λ(_jn0) = 1 +λ(_jn1) = 1 +λ(_jn2) = 1 +λ(_jn3) = 1 +belief change = 5.175910698e-13 + +domain π(Burglar) λ(Burglar) belief +---------------------------------------------------------------- +b1 0.005 0.5 0.005 +b2 0.995 0.5 0.995 + +domain πAlarm(Burglar) λAlarm(Burglar) +---------------------------------------------------------------- +b1 0.005 0.5 +b2 0.995 0.5 + +domain π(FreightTruck) λ(FreightTruck) belief +---------------------------------------------------------------- +f1 0.03 0.25 0.03 +f2 0.97 0.25 0.97 + +domain πAlarm(FreightTruck) λAlarm(FreightTruck) +---------------------------------------------------------------- +f1 0.03 0.5 +f2 0.97 0.5 + +domain π_Jn(FreightTruck) λ_Jn(FreightTruck) +---------------------------------------------------------------- +f1 0.03 0.5 +f2 0.97 0.5 + +domain π(Alarm) λ(Alarm) belief +---------------------------------------------------------------- +a1 0.01381575 0.5 0.01381575 +a2 0.98618425 0.5 0.98618425 + +domain π_Jn(Alarm) λ_Jn(Alarm) +---------------------------------------------------------------- +a1 0.01381575 0.5 +a2 0.98618425 0.5 + +domain π(_Jn) λ(_Jn) belief +---------------------------------------------------------------- +_jn0 0.0004144725 1 0.0004144725 +_jn1 0.0295855275 1 0.0295855275 +_jn2 0.0134012775 1 0.0134012775 +_jn3 0.9565987225 1 0.9565987225 + + + +******************************************************************************** + Iteration 70 +******************************************************************************** +λ message Alarm --> Burglar +λAlarm(b1) += [p(a1|b1,f1).πAlarm(f1) + p(a1|b1,f2).πAlarm(f2)].λ(a1) ++ [p(a2|b1,f1).πAlarm(f1) + p(a2|b1,f2).πAlarm(f2)].λ(a2) += [(0.992x0.03) + (0.99x0.97)]x0.5 ++ [(0.008x0.03) + (0.01x0.97)]x0.5 = 0.5 +λAlarm(b2) += [p(a1|b2,f1).πAlarm(f1) + p(a1|b2,f2).πAlarm(f2)].λ(a1) ++ [p(a2|b2,f1).πAlarm(f1) + p(a2|b2,f2).πAlarm(f2)].λ(a2) += [(0.2x0.03) + (0.003x0.97)]x0.5 ++ [(0.8x0.03) + (0.997x0.97)]x0.5 = 0.5 + +λ message Alarm --> FreightTruck +λAlarm(f1) += [p(a1|b1,f1).πAlarm(b1) + p(a1|b2,f1).πAlarm(b2)].λ(a1) ++ [p(a2|b1,f1).πAlarm(b1) + p(a2|b2,f1).πAlarm(b2)].λ(a2) += [(0.992x0.005) + (0.2x0.995)]x0.5 ++ [(0.008x0.005) + (0.8x0.995)]x0.5 = 0.5 +λAlarm(f2) += [p(a1|b1,f2).πAlarm(b1) + p(a1|b2,f2).πAlarm(b2)].λ(a1) ++ [p(a2|b1,f2).πAlarm(b1) + p(a2|b2,f2).πAlarm(b2)].λ(a2) += [(0.99x0.005) + (0.003x0.995)]x0.5 ++ [(0.01x0.005) + (0.997x0.995)]x0.5 = 0.5 + +λ message _Jn --> FreightTruck +λ_Jn(f1) += [p(_jn0|f1,a1).π_Jn(a1) + p(_jn0|f1,a2).π_Jn(a2)].λ(_jn0) ++ [p(_jn1|f1,a1).π_Jn(a1) + p(_jn1|f1,a2).π_Jn(a2)].λ(_jn1) ++ [p(_jn2|f1,a1).π_Jn(a1) + p(_jn2|f1,a2).π_Jn(a2)].λ(_jn2) ++ [p(_jn3|f1,a1).π_Jn(a1) + p(_jn3|f1,a2).π_Jn(a2)].λ(_jn3) += [(1x0.0138158) + (0x0.986184)]x1 ++ [(0x0.0138158) + (1x0.986184)]x1 ++ [(0x0.0138158) + (0x0.986184)]x1 ++ [(0x0.0138158) + (0x0.986184)]x1 = 1 +λ_Jn(f2) += [p(_jn0|f2,a1).π_Jn(a1) + p(_jn0|f2,a2).π_Jn(a2)].λ(_jn0) ++ [p(_jn1|f2,a1).π_Jn(a1) + p(_jn1|f2,a2).π_Jn(a2)].λ(_jn1) ++ [p(_jn2|f2,a1).π_Jn(a1) + p(_jn2|f2,a2).π_Jn(a2)].λ(_jn2) ++ [p(_jn3|f2,a1).π_Jn(a1) + p(_jn3|f2,a2).π_Jn(a2)].λ(_jn3) += [(0x0.0138158) + (0x0.986184)]x1 ++ [(0x0.0138158) + (0x0.986184)]x1 ++ [(1x0.0138158) + (0x0.986184)]x1 ++ [(0x0.0138158) + (1x0.986184)]x1 = 1 + +λ message _Jn --> Alarm +λ_Jn(a1) += [p(_jn0|f1,a1).π_Jn(f1) + p(_jn0|f2,a1).π_Jn(f2)].λ(_jn0) ++ [p(_jn1|f1,a1).π_Jn(f1) + p(_jn1|f2,a1).π_Jn(f2)].λ(_jn1) ++ [p(_jn2|f1,a1).π_Jn(f1) + p(_jn2|f2,a1).π_Jn(f2)].λ(_jn2) ++ [p(_jn3|f1,a1).π_Jn(f1) + p(_jn3|f2,a1).π_Jn(f2)].λ(_jn3) += [(1x0.03) + (0x0.97)]x1 ++ [(0x0.03) + (0x0.97)]x1 ++ [(0x0.03) + (1x0.97)]x1 ++ [(0x0.03) + (0x0.97)]x1 = 1 +λ_Jn(a2) += [p(_jn0|f1,a2).π_Jn(f1) + p(_jn0|f2,a2).π_Jn(f2)].λ(_jn0) ++ [p(_jn1|f1,a2).π_Jn(f1) + p(_jn1|f2,a2).π_Jn(f2)].λ(_jn1) ++ [p(_jn2|f1,a2).π_Jn(f1) + p(_jn2|f2,a2).π_Jn(f2)].λ(_jn2) ++ [p(_jn3|f1,a2).π_Jn(f1) + p(_jn3|f2,a2).π_Jn(f2)].λ(_jn3) += [(0x0.03) + (0x0.97)]x1 ++ [(1x0.03) + (0x0.97)]x1 ++ [(0x0.03) + (0x0.97)]x1 ++ [(0x0.03) + (1x0.97)]x1 = 1 + +π message Burglar --> Alarm +πAlarm(b1) = π(b1) = 0.005 = 0.005 +πAlarm(b2) = π(b2) = 0.995 = 0.995 + +π message FreightTruck --> Alarm +πAlarm(f1) = π(f1).λ_Jn(f1) = 0.03 x 0.5 = 0.015 +πAlarm(f2) = π(f2).λ_Jn(f2) = 0.97 x 0.5 = 0.485 + +π message FreightTruck --> _Jn +π_Jn(f1) = π(f1).λAlarm(f1) = 0.03 x 0.5 = 0.015 +π_Jn(f2) = π(f2).λAlarm(f2) = 0.97 x 0.5 = 0.485 + +π message Alarm --> _Jn +π_Jn(a1) = π(a1) = 0.0138158 = 0.01381575 +π_Jn(a2) = π(a2) = 0.986184 = 0.98618425 + +var Burglar: +π(b1) += p(b1) += (0.005) = 0.005 +π(b2) += p(b2) += (0.995) = 0.995 +λ(b1) = λAlarm(b1) = 0.5 = 0.5 +λ(b2) = λAlarm(b2) = 0.5 = 0.5 +belief change = 0 + +var FreightTruck: +π(f1) += p(f1) += (0.03) = 0.03 +π(f2) += p(f2) += (0.97) = 0.97 +λ(f1) = λAlarm(f1).λ_Jn(f1) = 0.5 x 0.5 = 0.25 +λ(f2) = λAlarm(f2).λ_Jn(f2) = 0.5 x 0.5 = 0.25 +belief change = 0 + +var Alarm: +π(a1) += p(a1|b1,f1).πAlarm(b1).πAlarm(f1) ++ p(a1|b1,f2).πAlarm(b1).πAlarm(f2) ++ p(a1|b2,f1).πAlarm(b2).πAlarm(f1) ++ p(a1|b2,f2).πAlarm(b2).πAlarm(f2) += (0.992x0.005x0.03) ++ (0.99x0.005x0.97) ++ (0.2x0.995x0.03) ++ (0.003x0.995x0.97) = 0.01381575 +π(a2) += p(a2|b1,f1).πAlarm(b1).πAlarm(f1) ++ p(a2|b1,f2).πAlarm(b1).πAlarm(f2) ++ p(a2|b2,f1).πAlarm(b2).πAlarm(f1) ++ p(a2|b2,f2).πAlarm(b2).πAlarm(f2) += (0.008x0.005x0.03) ++ (0.01x0.005x0.97) ++ (0.8x0.995x0.03) ++ (0.997x0.995x0.97) = 0.98618425 +λ(a1) = λ_Jn(a1) = 0.5 = 0.5 +λ(a2) = λ_Jn(a2) = 0.5 = 0.5 +belief change = 4.34860481e-14 + +var _Jn: +π(_jn0) += p(_jn0|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn0|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn0|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn0|f2,a2).π_Jn(f2).π_Jn(a2) += (1x0.03x0.0138158) ++ (0x0.03x0.986184) ++ (0x0.97x0.0138158) ++ (0x0.97x0.986184) = 0.0004144725 +π(_jn1) += p(_jn1|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn1|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn1|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn1|f2,a2).π_Jn(f2).π_Jn(a2) += (0x0.03x0.0138158) ++ (1x0.03x0.986184) ++ (0x0.97x0.0138158) ++ (0x0.97x0.986184) = 0.0295855275 +π(_jn2) += p(_jn2|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn2|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn2|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn2|f2,a2).π_Jn(f2).π_Jn(a2) += (0x0.03x0.0138158) ++ (0x0.03x0.986184) ++ (1x0.97x0.0138158) ++ (0x0.97x0.986184) = 0.0134012775 +π(_jn3) += p(_jn3|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn3|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn3|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn3|f2,a2).π_Jn(f2).π_Jn(a2) += (0x0.03x0.0138158) ++ (0x0.03x0.986184) ++ (0x0.97x0.0138158) ++ (1x0.97x0.986184) = 0.9565987225 +λ(_jn0) = 1 +λ(_jn1) = 1 +λ(_jn2) = 1 +λ(_jn3) = 1 +belief change = 3.450537382e-13 + +domain π(Burglar) λ(Burglar) belief +---------------------------------------------------------------- +b1 0.005 0.5 0.005 +b2 0.995 0.5 0.995 + +domain πAlarm(Burglar) λAlarm(Burglar) +---------------------------------------------------------------- +b1 0.005 0.5 +b2 0.995 0.5 + +domain π(FreightTruck) λ(FreightTruck) belief +---------------------------------------------------------------- +f1 0.03 0.25 0.03 +f2 0.97 0.25 0.97 + +domain πAlarm(FreightTruck) λAlarm(FreightTruck) +---------------------------------------------------------------- +f1 0.03 0.5 +f2 0.97 0.5 + +domain π_Jn(FreightTruck) λ_Jn(FreightTruck) +---------------------------------------------------------------- +f1 0.03 0.5 +f2 0.97 0.5 + +domain π(Alarm) λ(Alarm) belief +---------------------------------------------------------------- +a1 0.01381575 0.5 0.01381575 +a2 0.98618425 0.5 0.98618425 + +domain π_Jn(Alarm) λ_Jn(Alarm) +---------------------------------------------------------------- +a1 0.01381575 0.5 +a2 0.98618425 0.5 + +domain π(_Jn) λ(_Jn) belief +---------------------------------------------------------------- +_jn0 0.0004144725 1 0.0004144725 +_jn1 0.0295855275 1 0.0295855275 +_jn2 0.0134012775 1 0.0134012775 +_jn3 0.9565987225 1 0.9565987225 + + + +******************************************************************************** + Iteration 71 +******************************************************************************** +λ message Alarm --> Burglar +λAlarm(b1) += [p(a1|b1,f1).πAlarm(f1) + p(a1|b1,f2).πAlarm(f2)].λ(a1) ++ [p(a2|b1,f1).πAlarm(f1) + p(a2|b1,f2).πAlarm(f2)].λ(a2) += [(0.992x0.03) + (0.99x0.97)]x0.5 ++ [(0.008x0.03) + (0.01x0.97)]x0.5 = 0.5 +λAlarm(b2) += [p(a1|b2,f1).πAlarm(f1) + p(a1|b2,f2).πAlarm(f2)].λ(a1) ++ [p(a2|b2,f1).πAlarm(f1) + p(a2|b2,f2).πAlarm(f2)].λ(a2) += [(0.2x0.03) + (0.003x0.97)]x0.5 ++ [(0.8x0.03) + (0.997x0.97)]x0.5 = 0.5 + +λ message Alarm --> FreightTruck +λAlarm(f1) += [p(a1|b1,f1).πAlarm(b1) + p(a1|b2,f1).πAlarm(b2)].λ(a1) ++ [p(a2|b1,f1).πAlarm(b1) + p(a2|b2,f1).πAlarm(b2)].λ(a2) += [(0.992x0.005) + (0.2x0.995)]x0.5 ++ [(0.008x0.005) + (0.8x0.995)]x0.5 = 0.5 +λAlarm(f2) += [p(a1|b1,f2).πAlarm(b1) + p(a1|b2,f2).πAlarm(b2)].λ(a1) ++ [p(a2|b1,f2).πAlarm(b1) + p(a2|b2,f2).πAlarm(b2)].λ(a2) += [(0.99x0.005) + (0.003x0.995)]x0.5 ++ [(0.01x0.005) + (0.997x0.995)]x0.5 = 0.5 + +λ message _Jn --> FreightTruck +λ_Jn(f1) += [p(_jn0|f1,a1).π_Jn(a1) + p(_jn0|f1,a2).π_Jn(a2)].λ(_jn0) ++ [p(_jn1|f1,a1).π_Jn(a1) + p(_jn1|f1,a2).π_Jn(a2)].λ(_jn1) ++ [p(_jn2|f1,a1).π_Jn(a1) + p(_jn2|f1,a2).π_Jn(a2)].λ(_jn2) ++ [p(_jn3|f1,a1).π_Jn(a1) + p(_jn3|f1,a2).π_Jn(a2)].λ(_jn3) += [(1x0.0138158) + (0x0.986184)]x1 ++ [(0x0.0138158) + (1x0.986184)]x1 ++ [(0x0.0138158) + (0x0.986184)]x1 ++ [(0x0.0138158) + (0x0.986184)]x1 = 1 +λ_Jn(f2) += [p(_jn0|f2,a1).π_Jn(a1) + p(_jn0|f2,a2).π_Jn(a2)].λ(_jn0) ++ [p(_jn1|f2,a1).π_Jn(a1) + p(_jn1|f2,a2).π_Jn(a2)].λ(_jn1) ++ [p(_jn2|f2,a1).π_Jn(a1) + p(_jn2|f2,a2).π_Jn(a2)].λ(_jn2) ++ [p(_jn3|f2,a1).π_Jn(a1) + p(_jn3|f2,a2).π_Jn(a2)].λ(_jn3) += [(0x0.0138158) + (0x0.986184)]x1 ++ [(0x0.0138158) + (0x0.986184)]x1 ++ [(1x0.0138158) + (0x0.986184)]x1 ++ [(0x0.0138158) + (1x0.986184)]x1 = 1 + +λ message _Jn --> Alarm +λ_Jn(a1) += [p(_jn0|f1,a1).π_Jn(f1) + p(_jn0|f2,a1).π_Jn(f2)].λ(_jn0) ++ [p(_jn1|f1,a1).π_Jn(f1) + p(_jn1|f2,a1).π_Jn(f2)].λ(_jn1) ++ [p(_jn2|f1,a1).π_Jn(f1) + p(_jn2|f2,a1).π_Jn(f2)].λ(_jn2) ++ [p(_jn3|f1,a1).π_Jn(f1) + p(_jn3|f2,a1).π_Jn(f2)].λ(_jn3) += [(1x0.03) + (0x0.97)]x1 ++ [(0x0.03) + (0x0.97)]x1 ++ [(0x0.03) + (1x0.97)]x1 ++ [(0x0.03) + (0x0.97)]x1 = 1 +λ_Jn(a2) += [p(_jn0|f1,a2).π_Jn(f1) + p(_jn0|f2,a2).π_Jn(f2)].λ(_jn0) ++ [p(_jn1|f1,a2).π_Jn(f1) + p(_jn1|f2,a2).π_Jn(f2)].λ(_jn1) ++ [p(_jn2|f1,a2).π_Jn(f1) + p(_jn2|f2,a2).π_Jn(f2)].λ(_jn2) ++ [p(_jn3|f1,a2).π_Jn(f1) + p(_jn3|f2,a2).π_Jn(f2)].λ(_jn3) += [(0x0.03) + (0x0.97)]x1 ++ [(1x0.03) + (0x0.97)]x1 ++ [(0x0.03) + (0x0.97)]x1 ++ [(0x0.03) + (1x0.97)]x1 = 1 + +π message Burglar --> Alarm +πAlarm(b1) = π(b1) = 0.005 = 0.005 +πAlarm(b2) = π(b2) = 0.995 = 0.995 + +π message FreightTruck --> Alarm +πAlarm(f1) = π(f1).λ_Jn(f1) = 0.03 x 0.5 = 0.015 +πAlarm(f2) = π(f2).λ_Jn(f2) = 0.97 x 0.5 = 0.485 + +π message FreightTruck --> _Jn +π_Jn(f1) = π(f1).λAlarm(f1) = 0.03 x 0.5 = 0.015 +π_Jn(f2) = π(f2).λAlarm(f2) = 0.97 x 0.5 = 0.485 + +π message Alarm --> _Jn +π_Jn(a1) = π(a1) = 0.0138158 = 0.01381575 +π_Jn(a2) = π(a2) = 0.986184 = 0.98618425 + +var Burglar: +π(b1) += p(b1) += (0.005) = 0.005 +π(b2) += p(b2) += (0.995) = 0.995 +λ(b1) = λAlarm(b1) = 0.5 = 0.5 +λ(b2) = λAlarm(b2) = 0.5 = 0.5 +belief change = 0 + +var FreightTruck: +π(f1) += p(f1) += (0.03) = 0.03 +π(f2) += p(f2) += (0.97) = 0.97 +λ(f1) = λAlarm(f1).λ_Jn(f1) = 0.5 x 0.5 = 0.25 +λ(f2) = λAlarm(f2).λ_Jn(f2) = 0.5 x 0.5 = 0.25 +belief change = 0 + +var Alarm: +π(a1) += p(a1|b1,f1).πAlarm(b1).πAlarm(f1) ++ p(a1|b1,f2).πAlarm(b1).πAlarm(f2) ++ p(a1|b2,f1).πAlarm(b2).πAlarm(f1) ++ p(a1|b2,f2).πAlarm(b2).πAlarm(f2) += (0.992x0.005x0.03) ++ (0.99x0.005x0.97) ++ (0.2x0.995x0.03) ++ (0.003x0.995x0.97) = 0.01381575 +π(a2) += p(a2|b1,f1).πAlarm(b1).πAlarm(f1) ++ p(a2|b1,f2).πAlarm(b1).πAlarm(f2) ++ p(a2|b2,f1).πAlarm(b2).πAlarm(f1) ++ p(a2|b2,f2).πAlarm(b2).πAlarm(f2) += (0.008x0.005x0.03) ++ (0.01x0.005x0.97) ++ (0.8x0.995x0.03) ++ (0.997x0.995x0.97) = 0.98618425 +λ(a1) = λ_Jn(a1) = 0.5 = 0.5 +λ(a2) = λ_Jn(a2) = 0.5 = 0.5 +belief change = 2.891784034e-14 + +var _Jn: +π(_jn0) += p(_jn0|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn0|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn0|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn0|f2,a2).π_Jn(f2).π_Jn(a2) += (1x0.03x0.0138158) ++ (0x0.03x0.986184) ++ (0x0.97x0.0138158) ++ (0x0.97x0.986184) = 0.0004144725 +π(_jn1) += p(_jn1|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn1|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn1|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn1|f2,a2).π_Jn(f2).π_Jn(a2) += (0x0.03x0.0138158) ++ (1x0.03x0.986184) ++ (0x0.97x0.0138158) ++ (0x0.97x0.986184) = 0.0295855275 +π(_jn2) += p(_jn2|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn2|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn2|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn2|f2,a2).π_Jn(f2).π_Jn(a2) += (0x0.03x0.0138158) ++ (0x0.03x0.986184) ++ (1x0.97x0.0138158) ++ (0x0.97x0.986184) = 0.0134012775 +π(_jn3) += p(_jn3|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn3|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn3|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn3|f2,a2).π_Jn(f2).π_Jn(a2) += (0x0.03x0.0138158) ++ (0x0.03x0.986184) ++ (0x0.97x0.0138158) ++ (1x0.97x0.986184) = 0.9565987225 +λ(_jn0) = 1 +λ(_jn1) = 1 +λ(_jn2) = 1 +λ(_jn3) = 1 +belief change = 2.300415717e-13 + +domain π(Burglar) λ(Burglar) belief +---------------------------------------------------------------- +b1 0.005 0.5 0.005 +b2 0.995 0.5 0.995 + +domain πAlarm(Burglar) λAlarm(Burglar) +---------------------------------------------------------------- +b1 0.005 0.5 +b2 0.995 0.5 + +domain π(FreightTruck) λ(FreightTruck) belief +---------------------------------------------------------------- +f1 0.03 0.25 0.03 +f2 0.97 0.25 0.97 + +domain πAlarm(FreightTruck) λAlarm(FreightTruck) +---------------------------------------------------------------- +f1 0.03 0.5 +f2 0.97 0.5 + +domain π_Jn(FreightTruck) λ_Jn(FreightTruck) +---------------------------------------------------------------- +f1 0.03 0.5 +f2 0.97 0.5 + +domain π(Alarm) λ(Alarm) belief +---------------------------------------------------------------- +a1 0.01381575 0.5 0.01381575 +a2 0.98618425 0.5 0.98618425 + +domain π_Jn(Alarm) λ_Jn(Alarm) +---------------------------------------------------------------- +a1 0.01381575 0.5 +a2 0.98618425 0.5 + +domain π(_Jn) λ(_Jn) belief +---------------------------------------------------------------- +_jn0 0.0004144725 1 0.0004144725 +_jn1 0.0295855275 1 0.0295855275 +_jn2 0.0134012775 1 0.0134012775 +_jn3 0.9565987225 1 0.9565987225 + + + +******************************************************************************** + Iteration 72 +******************************************************************************** +λ message Alarm --> Burglar +λAlarm(b1) += [p(a1|b1,f1).πAlarm(f1) + p(a1|b1,f2).πAlarm(f2)].λ(a1) ++ [p(a2|b1,f1).πAlarm(f1) + p(a2|b1,f2).πAlarm(f2)].λ(a2) += [(0.992x0.03) + (0.99x0.97)]x0.5 ++ [(0.008x0.03) + (0.01x0.97)]x0.5 = 0.5 +λAlarm(b2) += [p(a1|b2,f1).πAlarm(f1) + p(a1|b2,f2).πAlarm(f2)].λ(a1) ++ [p(a2|b2,f1).πAlarm(f1) + p(a2|b2,f2).πAlarm(f2)].λ(a2) += [(0.2x0.03) + (0.003x0.97)]x0.5 ++ [(0.8x0.03) + (0.997x0.97)]x0.5 = 0.5 + +λ message Alarm --> FreightTruck +λAlarm(f1) += [p(a1|b1,f1).πAlarm(b1) + p(a1|b2,f1).πAlarm(b2)].λ(a1) ++ [p(a2|b1,f1).πAlarm(b1) + p(a2|b2,f1).πAlarm(b2)].λ(a2) += [(0.992x0.005) + (0.2x0.995)]x0.5 ++ [(0.008x0.005) + (0.8x0.995)]x0.5 = 0.5 +λAlarm(f2) += [p(a1|b1,f2).πAlarm(b1) + p(a1|b2,f2).πAlarm(b2)].λ(a1) ++ [p(a2|b1,f2).πAlarm(b1) + p(a2|b2,f2).πAlarm(b2)].λ(a2) += [(0.99x0.005) + (0.003x0.995)]x0.5 ++ [(0.01x0.005) + (0.997x0.995)]x0.5 = 0.5 + +λ message _Jn --> FreightTruck +λ_Jn(f1) += [p(_jn0|f1,a1).π_Jn(a1) + p(_jn0|f1,a2).π_Jn(a2)].λ(_jn0) ++ [p(_jn1|f1,a1).π_Jn(a1) + p(_jn1|f1,a2).π_Jn(a2)].λ(_jn1) ++ [p(_jn2|f1,a1).π_Jn(a1) + p(_jn2|f1,a2).π_Jn(a2)].λ(_jn2) ++ [p(_jn3|f1,a1).π_Jn(a1) + p(_jn3|f1,a2).π_Jn(a2)].λ(_jn3) += [(1x0.0138158) + (0x0.986184)]x1 ++ [(0x0.0138158) + (1x0.986184)]x1 ++ [(0x0.0138158) + (0x0.986184)]x1 ++ [(0x0.0138158) + (0x0.986184)]x1 = 1 +λ_Jn(f2) += [p(_jn0|f2,a1).π_Jn(a1) + p(_jn0|f2,a2).π_Jn(a2)].λ(_jn0) ++ [p(_jn1|f2,a1).π_Jn(a1) + p(_jn1|f2,a2).π_Jn(a2)].λ(_jn1) ++ [p(_jn2|f2,a1).π_Jn(a1) + p(_jn2|f2,a2).π_Jn(a2)].λ(_jn2) ++ [p(_jn3|f2,a1).π_Jn(a1) + p(_jn3|f2,a2).π_Jn(a2)].λ(_jn3) += [(0x0.0138158) + (0x0.986184)]x1 ++ [(0x0.0138158) + (0x0.986184)]x1 ++ [(1x0.0138158) + (0x0.986184)]x1 ++ [(0x0.0138158) + (1x0.986184)]x1 = 1 + +λ message _Jn --> Alarm +λ_Jn(a1) += [p(_jn0|f1,a1).π_Jn(f1) + p(_jn0|f2,a1).π_Jn(f2)].λ(_jn0) ++ [p(_jn1|f1,a1).π_Jn(f1) + p(_jn1|f2,a1).π_Jn(f2)].λ(_jn1) ++ [p(_jn2|f1,a1).π_Jn(f1) + p(_jn2|f2,a1).π_Jn(f2)].λ(_jn2) ++ [p(_jn3|f1,a1).π_Jn(f1) + p(_jn3|f2,a1).π_Jn(f2)].λ(_jn3) += [(1x0.03) + (0x0.97)]x1 ++ [(0x0.03) + (0x0.97)]x1 ++ [(0x0.03) + (1x0.97)]x1 ++ [(0x0.03) + (0x0.97)]x1 = 1 +λ_Jn(a2) += [p(_jn0|f1,a2).π_Jn(f1) + p(_jn0|f2,a2).π_Jn(f2)].λ(_jn0) ++ [p(_jn1|f1,a2).π_Jn(f1) + p(_jn1|f2,a2).π_Jn(f2)].λ(_jn1) ++ [p(_jn2|f1,a2).π_Jn(f1) + p(_jn2|f2,a2).π_Jn(f2)].λ(_jn2) ++ [p(_jn3|f1,a2).π_Jn(f1) + p(_jn3|f2,a2).π_Jn(f2)].λ(_jn3) += [(0x0.03) + (0x0.97)]x1 ++ [(1x0.03) + (0x0.97)]x1 ++ [(0x0.03) + (0x0.97)]x1 ++ [(0x0.03) + (1x0.97)]x1 = 1 + +π message Burglar --> Alarm +πAlarm(b1) = π(b1) = 0.005 = 0.005 +πAlarm(b2) = π(b2) = 0.995 = 0.995 + +π message FreightTruck --> Alarm +πAlarm(f1) = π(f1).λ_Jn(f1) = 0.03 x 0.5 = 0.015 +πAlarm(f2) = π(f2).λ_Jn(f2) = 0.97 x 0.5 = 0.485 + +π message FreightTruck --> _Jn +π_Jn(f1) = π(f1).λAlarm(f1) = 0.03 x 0.5 = 0.015 +π_Jn(f2) = π(f2).λAlarm(f2) = 0.97 x 0.5 = 0.485 + +π message Alarm --> _Jn +π_Jn(a1) = π(a1) = 0.0138158 = 0.01381575 +π_Jn(a2) = π(a2) = 0.986184 = 0.98618425 + +var Burglar: +π(b1) += p(b1) += (0.005) = 0.005 +π(b2) += p(b2) += (0.995) = 0.995 +λ(b1) = λAlarm(b1) = 0.5 = 0.5 +λ(b2) = λAlarm(b2) = 0.5 = 0.5 +belief change = 8.67361738e-19 + +var FreightTruck: +π(f1) += p(f1) += (0.03) = 0.03 +π(f2) += p(f2) += (0.97) = 0.97 +λ(f1) = λAlarm(f1).λ_Jn(f1) = 0.5 x 0.5 = 0.25 +λ(f2) = λAlarm(f2).λ_Jn(f2) = 0.5 x 0.5 = 0.25 +belief change = 0 + +var Alarm: +π(a1) += p(a1|b1,f1).πAlarm(b1).πAlarm(f1) ++ p(a1|b1,f2).πAlarm(b1).πAlarm(f2) ++ p(a1|b2,f1).πAlarm(b2).πAlarm(f1) ++ p(a1|b2,f2).πAlarm(b2).πAlarm(f2) += (0.992x0.005x0.03) ++ (0.99x0.005x0.97) ++ (0.2x0.995x0.03) ++ (0.003x0.995x0.97) = 0.01381575 +π(a2) += p(a2|b1,f1).πAlarm(b1).πAlarm(f1) ++ p(a2|b1,f2).πAlarm(b1).πAlarm(f2) ++ p(a2|b2,f1).πAlarm(b2).πAlarm(f1) ++ p(a2|b2,f2).πAlarm(b2).πAlarm(f2) += (0.008x0.005x0.03) ++ (0.01x0.005x0.97) ++ (0.8x0.995x0.03) ++ (0.997x0.995x0.97) = 0.98618425 +λ(a1) = λ_Jn(a1) = 0.5 = 0.5 +λ(a2) = λ_Jn(a2) = 0.5 = 0.5 +belief change = 1.931441118e-14 + +var _Jn: +π(_jn0) += p(_jn0|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn0|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn0|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn0|f2,a2).π_Jn(f2).π_Jn(a2) += (1x0.03x0.0138158) ++ (0x0.03x0.986184) ++ (0x0.97x0.0138158) ++ (0x0.97x0.986184) = 0.0004144725 +π(_jn1) += p(_jn1|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn1|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn1|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn1|f2,a2).π_Jn(f2).π_Jn(a2) += (0x0.03x0.0138158) ++ (1x0.03x0.986184) ++ (0x0.97x0.0138158) ++ (0x0.97x0.986184) = 0.0295855275 +π(_jn2) += p(_jn2|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn2|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn2|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn2|f2,a2).π_Jn(f2).π_Jn(a2) += (0x0.03x0.0138158) ++ (0x0.03x0.986184) ++ (1x0.97x0.0138158) ++ (0x0.97x0.986184) = 0.0134012775 +π(_jn3) += p(_jn3|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn3|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn3|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn3|f2,a2).π_Jn(f2).π_Jn(a2) += (0x0.03x0.0138158) ++ (0x0.03x0.986184) ++ (0x0.97x0.0138158) ++ (1x0.97x0.986184) = 0.9565987225 +λ(_jn0) = 1 +λ(_jn1) = 1 +λ(_jn2) = 1 +λ(_jn3) = 1 +belief change = 1.533916765e-13 + +domain π(Burglar) λ(Burglar) belief +---------------------------------------------------------------- +b1 0.005 0.5 0.005 +b2 0.995 0.5 0.995 + +domain πAlarm(Burglar) λAlarm(Burglar) +---------------------------------------------------------------- +b1 0.005 0.5 +b2 0.995 0.5 + +domain π(FreightTruck) λ(FreightTruck) belief +---------------------------------------------------------------- +f1 0.03 0.25 0.03 +f2 0.97 0.25 0.97 + +domain πAlarm(FreightTruck) λAlarm(FreightTruck) +---------------------------------------------------------------- +f1 0.03 0.5 +f2 0.97 0.5 + +domain π_Jn(FreightTruck) λ_Jn(FreightTruck) +---------------------------------------------------------------- +f1 0.03 0.5 +f2 0.97 0.5 + +domain π(Alarm) λ(Alarm) belief +---------------------------------------------------------------- +a1 0.01381575 0.5 0.01381575 +a2 0.98618425 0.5 0.98618425 + +domain π_Jn(Alarm) λ_Jn(Alarm) +---------------------------------------------------------------- +a1 0.01381575 0.5 +a2 0.98618425 0.5 + +domain π(_Jn) λ(_Jn) belief +---------------------------------------------------------------- +_jn0 0.0004144725 1 0.0004144725 +_jn1 0.0295855275 1 0.0295855275 +_jn2 0.0134012775 1 0.0134012775 +_jn3 0.9565987225 1 0.9565987225 + + + +******************************************************************************** + Iteration 73 +******************************************************************************** +λ message Alarm --> Burglar +λAlarm(b1) += [p(a1|b1,f1).πAlarm(f1) + p(a1|b1,f2).πAlarm(f2)].λ(a1) ++ [p(a2|b1,f1).πAlarm(f1) + p(a2|b1,f2).πAlarm(f2)].λ(a2) += [(0.992x0.03) + (0.99x0.97)]x0.5 ++ [(0.008x0.03) + (0.01x0.97)]x0.5 = 0.5 +λAlarm(b2) += [p(a1|b2,f1).πAlarm(f1) + p(a1|b2,f2).πAlarm(f2)].λ(a1) ++ [p(a2|b2,f1).πAlarm(f1) + p(a2|b2,f2).πAlarm(f2)].λ(a2) += [(0.2x0.03) + (0.003x0.97)]x0.5 ++ [(0.8x0.03) + (0.997x0.97)]x0.5 = 0.5 + +λ message Alarm --> FreightTruck +λAlarm(f1) += [p(a1|b1,f1).πAlarm(b1) + p(a1|b2,f1).πAlarm(b2)].λ(a1) ++ [p(a2|b1,f1).πAlarm(b1) + p(a2|b2,f1).πAlarm(b2)].λ(a2) += [(0.992x0.005) + (0.2x0.995)]x0.5 ++ [(0.008x0.005) + (0.8x0.995)]x0.5 = 0.5 +λAlarm(f2) += [p(a1|b1,f2).πAlarm(b1) + p(a1|b2,f2).πAlarm(b2)].λ(a1) ++ [p(a2|b1,f2).πAlarm(b1) + p(a2|b2,f2).πAlarm(b2)].λ(a2) += [(0.99x0.005) + (0.003x0.995)]x0.5 ++ [(0.01x0.005) + (0.997x0.995)]x0.5 = 0.5 + +λ message _Jn --> FreightTruck +λ_Jn(f1) += [p(_jn0|f1,a1).π_Jn(a1) + p(_jn0|f1,a2).π_Jn(a2)].λ(_jn0) ++ [p(_jn1|f1,a1).π_Jn(a1) + p(_jn1|f1,a2).π_Jn(a2)].λ(_jn1) ++ [p(_jn2|f1,a1).π_Jn(a1) + p(_jn2|f1,a2).π_Jn(a2)].λ(_jn2) ++ [p(_jn3|f1,a1).π_Jn(a1) + p(_jn3|f1,a2).π_Jn(a2)].λ(_jn3) += [(1x0.0138158) + (0x0.986184)]x1 ++ [(0x0.0138158) + (1x0.986184)]x1 ++ [(0x0.0138158) + (0x0.986184)]x1 ++ [(0x0.0138158) + (0x0.986184)]x1 = 1 +λ_Jn(f2) += [p(_jn0|f2,a1).π_Jn(a1) + p(_jn0|f2,a2).π_Jn(a2)].λ(_jn0) ++ [p(_jn1|f2,a1).π_Jn(a1) + p(_jn1|f2,a2).π_Jn(a2)].λ(_jn1) ++ [p(_jn2|f2,a1).π_Jn(a1) + p(_jn2|f2,a2).π_Jn(a2)].λ(_jn2) ++ [p(_jn3|f2,a1).π_Jn(a1) + p(_jn3|f2,a2).π_Jn(a2)].λ(_jn3) += [(0x0.0138158) + (0x0.986184)]x1 ++ [(0x0.0138158) + (0x0.986184)]x1 ++ [(1x0.0138158) + (0x0.986184)]x1 ++ [(0x0.0138158) + (1x0.986184)]x1 = 1 + +λ message _Jn --> Alarm +λ_Jn(a1) += [p(_jn0|f1,a1).π_Jn(f1) + p(_jn0|f2,a1).π_Jn(f2)].λ(_jn0) ++ [p(_jn1|f1,a1).π_Jn(f1) + p(_jn1|f2,a1).π_Jn(f2)].λ(_jn1) ++ [p(_jn2|f1,a1).π_Jn(f1) + p(_jn2|f2,a1).π_Jn(f2)].λ(_jn2) ++ [p(_jn3|f1,a1).π_Jn(f1) + p(_jn3|f2,a1).π_Jn(f2)].λ(_jn3) += [(1x0.03) + (0x0.97)]x1 ++ [(0x0.03) + (0x0.97)]x1 ++ [(0x0.03) + (1x0.97)]x1 ++ [(0x0.03) + (0x0.97)]x1 = 1 +λ_Jn(a2) += [p(_jn0|f1,a2).π_Jn(f1) + p(_jn0|f2,a2).π_Jn(f2)].λ(_jn0) ++ [p(_jn1|f1,a2).π_Jn(f1) + p(_jn1|f2,a2).π_Jn(f2)].λ(_jn1) ++ [p(_jn2|f1,a2).π_Jn(f1) + p(_jn2|f2,a2).π_Jn(f2)].λ(_jn2) ++ [p(_jn3|f1,a2).π_Jn(f1) + p(_jn3|f2,a2).π_Jn(f2)].λ(_jn3) += [(0x0.03) + (0x0.97)]x1 ++ [(1x0.03) + (0x0.97)]x1 ++ [(0x0.03) + (0x0.97)]x1 ++ [(0x0.03) + (1x0.97)]x1 = 1 + +π message Burglar --> Alarm +πAlarm(b1) = π(b1) = 0.005 = 0.005 +πAlarm(b2) = π(b2) = 0.995 = 0.995 + +π message FreightTruck --> Alarm +πAlarm(f1) = π(f1).λ_Jn(f1) = 0.03 x 0.5 = 0.015 +πAlarm(f2) = π(f2).λ_Jn(f2) = 0.97 x 0.5 = 0.485 + +π message FreightTruck --> _Jn +π_Jn(f1) = π(f1).λAlarm(f1) = 0.03 x 0.5 = 0.015 +π_Jn(f2) = π(f2).λAlarm(f2) = 0.97 x 0.5 = 0.485 + +π message Alarm --> _Jn +π_Jn(a1) = π(a1) = 0.0138158 = 0.01381575 +π_Jn(a2) = π(a2) = 0.986184 = 0.98618425 + +var Burglar: +π(b1) += p(b1) += (0.005) = 0.005 +π(b2) += p(b2) += (0.995) = 0.995 +λ(b1) = λAlarm(b1) = 0.5 = 0.5 +λ(b2) = λAlarm(b2) = 0.5 = 0.5 +belief change = 0 + +var FreightTruck: +π(f1) += p(f1) += (0.03) = 0.03 +π(f2) += p(f2) += (0.97) = 0.97 +λ(f1) = λAlarm(f1).λ_Jn(f1) = 0.5 x 0.5 = 0.25 +λ(f2) = λAlarm(f2).λ_Jn(f2) = 0.5 x 0.5 = 0.25 +belief change = 0 + +var Alarm: +π(a1) += p(a1|b1,f1).πAlarm(b1).πAlarm(f1) ++ p(a1|b1,f2).πAlarm(b1).πAlarm(f2) ++ p(a1|b2,f1).πAlarm(b2).πAlarm(f1) ++ p(a1|b2,f2).πAlarm(b2).πAlarm(f2) += (0.992x0.005x0.03) ++ (0.99x0.005x0.97) ++ (0.2x0.995x0.03) ++ (0.003x0.995x0.97) = 0.01381575 +π(a2) += p(a2|b1,f1).πAlarm(b1).πAlarm(f1) ++ p(a2|b1,f2).πAlarm(b1).πAlarm(f2) ++ p(a2|b2,f1).πAlarm(b2).πAlarm(f1) ++ p(a2|b2,f2).πAlarm(b2).πAlarm(f2) += (0.008x0.005x0.03) ++ (0.01x0.005x0.97) ++ (0.8x0.995x0.03) ++ (0.997x0.995x0.97) = 0.98618425 +λ(a1) = λ_Jn(a1) = 0.5 = 0.5 +λ(a2) = λ_Jn(a2) = 0.5 = 0.5 +belief change = 1.287511764e-14 + +var _Jn: +π(_jn0) += p(_jn0|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn0|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn0|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn0|f2,a2).π_Jn(f2).π_Jn(a2) += (1x0.03x0.0138158) ++ (0x0.03x0.986184) ++ (0x0.97x0.0138158) ++ (0x0.97x0.986184) = 0.0004144725 +π(_jn1) += p(_jn1|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn1|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn1|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn1|f2,a2).π_Jn(f2).π_Jn(a2) += (0x0.03x0.0138158) ++ (1x0.03x0.986184) ++ (0x0.97x0.0138158) ++ (0x0.97x0.986184) = 0.0295855275 +π(_jn2) += p(_jn2|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn2|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn2|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn2|f2,a2).π_Jn(f2).π_Jn(a2) += (0x0.03x0.0138158) ++ (0x0.03x0.986184) ++ (1x0.97x0.0138158) ++ (0x0.97x0.986184) = 0.0134012775 +π(_jn3) += p(_jn3|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn3|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn3|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn3|f2,a2).π_Jn(f2).π_Jn(a2) += (0x0.03x0.0138158) ++ (0x0.03x0.986184) ++ (0x0.97x0.0138158) ++ (1x0.97x0.986184) = 0.9565987225 +λ(_jn0) = 1 +λ(_jn1) = 1 +λ(_jn2) = 1 +λ(_jn3) = 1 +belief change = 1.021882774e-13 + +domain π(Burglar) λ(Burglar) belief +---------------------------------------------------------------- +b1 0.005 0.5 0.005 +b2 0.995 0.5 0.995 + +domain πAlarm(Burglar) λAlarm(Burglar) +---------------------------------------------------------------- +b1 0.005 0.5 +b2 0.995 0.5 + +domain π(FreightTruck) λ(FreightTruck) belief +---------------------------------------------------------------- +f1 0.03 0.25 0.03 +f2 0.97 0.25 0.97 + +domain πAlarm(FreightTruck) λAlarm(FreightTruck) +---------------------------------------------------------------- +f1 0.03 0.5 +f2 0.97 0.5 + +domain π_Jn(FreightTruck) λ_Jn(FreightTruck) +---------------------------------------------------------------- +f1 0.03 0.5 +f2 0.97 0.5 + +domain π(Alarm) λ(Alarm) belief +---------------------------------------------------------------- +a1 0.01381575 0.5 0.01381575 +a2 0.98618425 0.5 0.98618425 + +domain π_Jn(Alarm) λ_Jn(Alarm) +---------------------------------------------------------------- +a1 0.01381575 0.5 +a2 0.98618425 0.5 + +domain π(_Jn) λ(_Jn) belief +---------------------------------------------------------------- +_jn0 0.0004144725 1 0.0004144725 +_jn1 0.0295855275 1 0.0295855275 +_jn2 0.0134012775 1 0.0134012775 +_jn3 0.9565987225 1 0.9565987225 + + + +******************************************************************************** + Iteration 74 +******************************************************************************** +λ message Alarm --> Burglar +λAlarm(b1) += [p(a1|b1,f1).πAlarm(f1) + p(a1|b1,f2).πAlarm(f2)].λ(a1) ++ [p(a2|b1,f1).πAlarm(f1) + p(a2|b1,f2).πAlarm(f2)].λ(a2) += [(0.992x0.03) + (0.99x0.97)]x0.5 ++ [(0.008x0.03) + (0.01x0.97)]x0.5 = 0.5 +λAlarm(b2) += [p(a1|b2,f1).πAlarm(f1) + p(a1|b2,f2).πAlarm(f2)].λ(a1) ++ [p(a2|b2,f1).πAlarm(f1) + p(a2|b2,f2).πAlarm(f2)].λ(a2) += [(0.2x0.03) + (0.003x0.97)]x0.5 ++ [(0.8x0.03) + (0.997x0.97)]x0.5 = 0.5 + +λ message Alarm --> FreightTruck +λAlarm(f1) += [p(a1|b1,f1).πAlarm(b1) + p(a1|b2,f1).πAlarm(b2)].λ(a1) ++ [p(a2|b1,f1).πAlarm(b1) + p(a2|b2,f1).πAlarm(b2)].λ(a2) += [(0.992x0.005) + (0.2x0.995)]x0.5 ++ [(0.008x0.005) + (0.8x0.995)]x0.5 = 0.5 +λAlarm(f2) += [p(a1|b1,f2).πAlarm(b1) + p(a1|b2,f2).πAlarm(b2)].λ(a1) ++ [p(a2|b1,f2).πAlarm(b1) + p(a2|b2,f2).πAlarm(b2)].λ(a2) += [(0.99x0.005) + (0.003x0.995)]x0.5 ++ [(0.01x0.005) + (0.997x0.995)]x0.5 = 0.5 + +λ message _Jn --> FreightTruck +λ_Jn(f1) += [p(_jn0|f1,a1).π_Jn(a1) + p(_jn0|f1,a2).π_Jn(a2)].λ(_jn0) ++ [p(_jn1|f1,a1).π_Jn(a1) + p(_jn1|f1,a2).π_Jn(a2)].λ(_jn1) ++ [p(_jn2|f1,a1).π_Jn(a1) + p(_jn2|f1,a2).π_Jn(a2)].λ(_jn2) ++ [p(_jn3|f1,a1).π_Jn(a1) + p(_jn3|f1,a2).π_Jn(a2)].λ(_jn3) += [(1x0.0138158) + (0x0.986184)]x1 ++ [(0x0.0138158) + (1x0.986184)]x1 ++ [(0x0.0138158) + (0x0.986184)]x1 ++ [(0x0.0138158) + (0x0.986184)]x1 = 1 +λ_Jn(f2) += [p(_jn0|f2,a1).π_Jn(a1) + p(_jn0|f2,a2).π_Jn(a2)].λ(_jn0) ++ [p(_jn1|f2,a1).π_Jn(a1) + p(_jn1|f2,a2).π_Jn(a2)].λ(_jn1) ++ [p(_jn2|f2,a1).π_Jn(a1) + p(_jn2|f2,a2).π_Jn(a2)].λ(_jn2) ++ [p(_jn3|f2,a1).π_Jn(a1) + p(_jn3|f2,a2).π_Jn(a2)].λ(_jn3) += [(0x0.0138158) + (0x0.986184)]x1 ++ [(0x0.0138158) + (0x0.986184)]x1 ++ [(1x0.0138158) + (0x0.986184)]x1 ++ [(0x0.0138158) + (1x0.986184)]x1 = 1 + +λ message _Jn --> Alarm +λ_Jn(a1) += [p(_jn0|f1,a1).π_Jn(f1) + p(_jn0|f2,a1).π_Jn(f2)].λ(_jn0) ++ [p(_jn1|f1,a1).π_Jn(f1) + p(_jn1|f2,a1).π_Jn(f2)].λ(_jn1) ++ [p(_jn2|f1,a1).π_Jn(f1) + p(_jn2|f2,a1).π_Jn(f2)].λ(_jn2) ++ [p(_jn3|f1,a1).π_Jn(f1) + p(_jn3|f2,a1).π_Jn(f2)].λ(_jn3) += [(1x0.03) + (0x0.97)]x1 ++ [(0x0.03) + (0x0.97)]x1 ++ [(0x0.03) + (1x0.97)]x1 ++ [(0x0.03) + (0x0.97)]x1 = 1 +λ_Jn(a2) += [p(_jn0|f1,a2).π_Jn(f1) + p(_jn0|f2,a2).π_Jn(f2)].λ(_jn0) ++ [p(_jn1|f1,a2).π_Jn(f1) + p(_jn1|f2,a2).π_Jn(f2)].λ(_jn1) ++ [p(_jn2|f1,a2).π_Jn(f1) + p(_jn2|f2,a2).π_Jn(f2)].λ(_jn2) ++ [p(_jn3|f1,a2).π_Jn(f1) + p(_jn3|f2,a2).π_Jn(f2)].λ(_jn3) += [(0x0.03) + (0x0.97)]x1 ++ [(1x0.03) + (0x0.97)]x1 ++ [(0x0.03) + (0x0.97)]x1 ++ [(0x0.03) + (1x0.97)]x1 = 1 + +π message Burglar --> Alarm +πAlarm(b1) = π(b1) = 0.005 = 0.005 +πAlarm(b2) = π(b2) = 0.995 = 0.995 + +π message FreightTruck --> Alarm +πAlarm(f1) = π(f1).λ_Jn(f1) = 0.03 x 0.5 = 0.015 +πAlarm(f2) = π(f2).λ_Jn(f2) = 0.97 x 0.5 = 0.485 + +π message FreightTruck --> _Jn +π_Jn(f1) = π(f1).λAlarm(f1) = 0.03 x 0.5 = 0.015 +π_Jn(f2) = π(f2).λAlarm(f2) = 0.97 x 0.5 = 0.485 + +π message Alarm --> _Jn +π_Jn(a1) = π(a1) = 0.0138158 = 0.01381575 +π_Jn(a2) = π(a2) = 0.986184 = 0.98618425 + +var Burglar: +π(b1) += p(b1) += (0.005) = 0.005 +π(b2) += p(b2) += (0.995) = 0.995 +λ(b1) = λAlarm(b1) = 0.5 = 0.5 +λ(b2) = λAlarm(b2) = 0.5 = 0.5 +belief change = 0 + +var FreightTruck: +π(f1) += p(f1) += (0.03) = 0.03 +π(f2) += p(f2) += (0.97) = 0.97 +λ(f1) = λAlarm(f1).λ_Jn(f1) = 0.5 x 0.5 = 0.25 +λ(f2) = λAlarm(f2).λ_Jn(f2) = 0.5 x 0.5 = 0.25 +belief change = 0 + +var Alarm: +π(a1) += p(a1|b1,f1).πAlarm(b1).πAlarm(f1) ++ p(a1|b1,f2).πAlarm(b1).πAlarm(f2) ++ p(a1|b2,f1).πAlarm(b2).πAlarm(f1) ++ p(a1|b2,f2).πAlarm(b2).πAlarm(f2) += (0.992x0.005x0.03) ++ (0.99x0.005x0.97) ++ (0.2x0.995x0.03) ++ (0.003x0.995x0.97) = 0.01381575 +π(a2) += p(a2|b1,f1).πAlarm(b1).πAlarm(f1) ++ p(a2|b1,f2).πAlarm(b1).πAlarm(f2) ++ p(a2|b2,f1).πAlarm(b2).πAlarm(f1) ++ p(a2|b2,f2).πAlarm(b2).πAlarm(f2) += (0.008x0.005x0.03) ++ (0.01x0.005x0.97) ++ (0.8x0.995x0.03) ++ (0.997x0.995x0.97) = 0.98618425 +λ(a1) = λ_Jn(a1) = 0.5 = 0.5 +λ(a2) = λ_Jn(a2) = 0.5 = 0.5 +belief change = 8.621575676e-15 + +var _Jn: +π(_jn0) += p(_jn0|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn0|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn0|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn0|f2,a2).π_Jn(f2).π_Jn(a2) += (1x0.03x0.0138158) ++ (0x0.03x0.986184) ++ (0x0.97x0.0138158) ++ (0x0.97x0.986184) = 0.0004144725 +π(_jn1) += p(_jn1|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn1|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn1|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn1|f2,a2).π_Jn(f2).π_Jn(a2) += (0x0.03x0.0138158) ++ (1x0.03x0.986184) ++ (0x0.97x0.0138158) ++ (0x0.97x0.986184) = 0.0295855275 +π(_jn2) += p(_jn2|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn2|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn2|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn2|f2,a2).π_Jn(f2).π_Jn(a2) += (0x0.03x0.0138158) ++ (0x0.03x0.986184) ++ (1x0.97x0.0138158) ++ (0x0.97x0.986184) = 0.0134012775 +π(_jn3) += p(_jn3|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn3|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn3|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn3|f2,a2).π_Jn(f2).π_Jn(a2) += (0x0.03x0.0138158) ++ (0x0.03x0.986184) ++ (0x0.97x0.0138158) ++ (1x0.97x0.986184) = 0.9565987225 +λ(_jn0) = 1 +λ(_jn1) = 1 +λ(_jn2) = 1 +λ(_jn3) = 1 +belief change = 6.816595899e-14 + +domain π(Burglar) λ(Burglar) belief +---------------------------------------------------------------- +b1 0.005 0.5 0.005 +b2 0.995 0.5 0.995 + +domain πAlarm(Burglar) λAlarm(Burglar) +---------------------------------------------------------------- +b1 0.005 0.5 +b2 0.995 0.5 + +domain π(FreightTruck) λ(FreightTruck) belief +---------------------------------------------------------------- +f1 0.03 0.25 0.03 +f2 0.97 0.25 0.97 + +domain πAlarm(FreightTruck) λAlarm(FreightTruck) +---------------------------------------------------------------- +f1 0.03 0.5 +f2 0.97 0.5 + +domain π_Jn(FreightTruck) λ_Jn(FreightTruck) +---------------------------------------------------------------- +f1 0.03 0.5 +f2 0.97 0.5 + +domain π(Alarm) λ(Alarm) belief +---------------------------------------------------------------- +a1 0.01381575 0.5 0.01381575 +a2 0.98618425 0.5 0.98618425 + +domain π_Jn(Alarm) λ_Jn(Alarm) +---------------------------------------------------------------- +a1 0.01381575 0.5 +a2 0.98618425 0.5 + +domain π(_Jn) λ(_Jn) belief +---------------------------------------------------------------- +_jn0 0.0004144725 1 0.0004144725 +_jn1 0.0295855275 1 0.0295855275 +_jn2 0.0134012775 1 0.0134012775 +_jn3 0.9565987225 1 0.9565987225 + + + +******************************************************************************** + Iteration 75 +******************************************************************************** +λ message Alarm --> Burglar +λAlarm(b1) += [p(a1|b1,f1).πAlarm(f1) + p(a1|b1,f2).πAlarm(f2)].λ(a1) ++ [p(a2|b1,f1).πAlarm(f1) + p(a2|b1,f2).πAlarm(f2)].λ(a2) += [(0.992x0.03) + (0.99x0.97)]x0.5 ++ [(0.008x0.03) + (0.01x0.97)]x0.5 = 0.5 +λAlarm(b2) += [p(a1|b2,f1).πAlarm(f1) + p(a1|b2,f2).πAlarm(f2)].λ(a1) ++ [p(a2|b2,f1).πAlarm(f1) + p(a2|b2,f2).πAlarm(f2)].λ(a2) += [(0.2x0.03) + (0.003x0.97)]x0.5 ++ [(0.8x0.03) + (0.997x0.97)]x0.5 = 0.5 + +λ message Alarm --> FreightTruck +λAlarm(f1) += [p(a1|b1,f1).πAlarm(b1) + p(a1|b2,f1).πAlarm(b2)].λ(a1) ++ [p(a2|b1,f1).πAlarm(b1) + p(a2|b2,f1).πAlarm(b2)].λ(a2) += [(0.992x0.005) + (0.2x0.995)]x0.5 ++ [(0.008x0.005) + (0.8x0.995)]x0.5 = 0.5 +λAlarm(f2) += [p(a1|b1,f2).πAlarm(b1) + p(a1|b2,f2).πAlarm(b2)].λ(a1) ++ [p(a2|b1,f2).πAlarm(b1) + p(a2|b2,f2).πAlarm(b2)].λ(a2) += [(0.99x0.005) + (0.003x0.995)]x0.5 ++ [(0.01x0.005) + (0.997x0.995)]x0.5 = 0.5 + +λ message _Jn --> FreightTruck +λ_Jn(f1) += [p(_jn0|f1,a1).π_Jn(a1) + p(_jn0|f1,a2).π_Jn(a2)].λ(_jn0) ++ [p(_jn1|f1,a1).π_Jn(a1) + p(_jn1|f1,a2).π_Jn(a2)].λ(_jn1) ++ [p(_jn2|f1,a1).π_Jn(a1) + p(_jn2|f1,a2).π_Jn(a2)].λ(_jn2) ++ [p(_jn3|f1,a1).π_Jn(a1) + p(_jn3|f1,a2).π_Jn(a2)].λ(_jn3) += [(1x0.0138158) + (0x0.986184)]x1 ++ [(0x0.0138158) + (1x0.986184)]x1 ++ [(0x0.0138158) + (0x0.986184)]x1 ++ [(0x0.0138158) + (0x0.986184)]x1 = 1 +λ_Jn(f2) += [p(_jn0|f2,a1).π_Jn(a1) + p(_jn0|f2,a2).π_Jn(a2)].λ(_jn0) ++ [p(_jn1|f2,a1).π_Jn(a1) + p(_jn1|f2,a2).π_Jn(a2)].λ(_jn1) ++ [p(_jn2|f2,a1).π_Jn(a1) + p(_jn2|f2,a2).π_Jn(a2)].λ(_jn2) ++ [p(_jn3|f2,a1).π_Jn(a1) + p(_jn3|f2,a2).π_Jn(a2)].λ(_jn3) += [(0x0.0138158) + (0x0.986184)]x1 ++ [(0x0.0138158) + (0x0.986184)]x1 ++ [(1x0.0138158) + (0x0.986184)]x1 ++ [(0x0.0138158) + (1x0.986184)]x1 = 1 + +λ message _Jn --> Alarm +λ_Jn(a1) += [p(_jn0|f1,a1).π_Jn(f1) + p(_jn0|f2,a1).π_Jn(f2)].λ(_jn0) ++ [p(_jn1|f1,a1).π_Jn(f1) + p(_jn1|f2,a1).π_Jn(f2)].λ(_jn1) ++ [p(_jn2|f1,a1).π_Jn(f1) + p(_jn2|f2,a1).π_Jn(f2)].λ(_jn2) ++ [p(_jn3|f1,a1).π_Jn(f1) + p(_jn3|f2,a1).π_Jn(f2)].λ(_jn3) += [(1x0.03) + (0x0.97)]x1 ++ [(0x0.03) + (0x0.97)]x1 ++ [(0x0.03) + (1x0.97)]x1 ++ [(0x0.03) + (0x0.97)]x1 = 1 +λ_Jn(a2) += [p(_jn0|f1,a2).π_Jn(f1) + p(_jn0|f2,a2).π_Jn(f2)].λ(_jn0) ++ [p(_jn1|f1,a2).π_Jn(f1) + p(_jn1|f2,a2).π_Jn(f2)].λ(_jn1) ++ [p(_jn2|f1,a2).π_Jn(f1) + p(_jn2|f2,a2).π_Jn(f2)].λ(_jn2) ++ [p(_jn3|f1,a2).π_Jn(f1) + p(_jn3|f2,a2).π_Jn(f2)].λ(_jn3) += [(0x0.03) + (0x0.97)]x1 ++ [(1x0.03) + (0x0.97)]x1 ++ [(0x0.03) + (0x0.97)]x1 ++ [(0x0.03) + (1x0.97)]x1 = 1 + +π message Burglar --> Alarm +πAlarm(b1) = π(b1) = 0.005 = 0.005 +πAlarm(b2) = π(b2) = 0.995 = 0.995 + +π message FreightTruck --> Alarm +πAlarm(f1) = π(f1).λ_Jn(f1) = 0.03 x 0.5 = 0.015 +πAlarm(f2) = π(f2).λ_Jn(f2) = 0.97 x 0.5 = 0.485 + +π message FreightTruck --> _Jn +π_Jn(f1) = π(f1).λAlarm(f1) = 0.03 x 0.5 = 0.015 +π_Jn(f2) = π(f2).λAlarm(f2) = 0.97 x 0.5 = 0.485 + +π message Alarm --> _Jn +π_Jn(a1) = π(a1) = 0.0138158 = 0.01381575 +π_Jn(a2) = π(a2) = 0.986184 = 0.98618425 + +var Burglar: +π(b1) += p(b1) += (0.005) = 0.005 +π(b2) += p(b2) += (0.995) = 0.995 +λ(b1) = λAlarm(b1) = 0.5 = 0.5 +λ(b2) = λAlarm(b2) = 0.5 = 0.5 +belief change = 0 + +var FreightTruck: +π(f1) += p(f1) += (0.03) = 0.03 +π(f2) += p(f2) += (0.97) = 0.97 +λ(f1) = λAlarm(f1).λ_Jn(f1) = 0.5 x 0.5 = 0.25 +λ(f2) = λAlarm(f2).λ_Jn(f2) = 0.5 x 0.5 = 0.25 +belief change = 0 + +var Alarm: +π(a1) += p(a1|b1,f1).πAlarm(b1).πAlarm(f1) ++ p(a1|b1,f2).πAlarm(b1).πAlarm(f2) ++ p(a1|b2,f1).πAlarm(b2).πAlarm(f1) ++ p(a1|b2,f2).πAlarm(b2).πAlarm(f2) += (0.992x0.005x0.03) ++ (0.99x0.005x0.97) ++ (0.2x0.995x0.03) ++ (0.003x0.995x0.97) = 0.01381575 +π(a2) += p(a2|b1,f1).πAlarm(b1).πAlarm(f1) ++ p(a2|b1,f2).πAlarm(b1).πAlarm(f2) ++ p(a2|b2,f1).πAlarm(b2).πAlarm(f1) ++ p(a2|b2,f2).πAlarm(b2).πAlarm(f2) += (0.008x0.005x0.03) ++ (0.01x0.005x0.97) ++ (0.8x0.995x0.03) ++ (0.997x0.995x0.97) = 0.98618425 +λ(a1) = λ_Jn(a1) = 0.5 = 0.5 +λ(a2) = λ_Jn(a2) = 0.5 = 0.5 +belief change = 5.748873599e-15 + +var _Jn: +π(_jn0) += p(_jn0|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn0|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn0|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn0|f2,a2).π_Jn(f2).π_Jn(a2) += (1x0.03x0.0138158) ++ (0x0.03x0.986184) ++ (0x0.97x0.0138158) ++ (0x0.97x0.986184) = 0.0004144725 +π(_jn1) += p(_jn1|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn1|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn1|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn1|f2,a2).π_Jn(f2).π_Jn(a2) += (0x0.03x0.0138158) ++ (1x0.03x0.986184) ++ (0x0.97x0.0138158) ++ (0x0.97x0.986184) = 0.0295855275 +π(_jn2) += p(_jn2|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn2|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn2|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn2|f2,a2).π_Jn(f2).π_Jn(a2) += (0x0.03x0.0138158) ++ (0x0.03x0.986184) ++ (1x0.97x0.0138158) ++ (0x0.97x0.986184) = 0.0134012775 +π(_jn3) += p(_jn3|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn3|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn3|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn3|f2,a2).π_Jn(f2).π_Jn(a2) += (0x0.03x0.0138158) ++ (0x0.03x0.986184) ++ (0x0.97x0.0138158) ++ (1x0.97x0.986184) = 0.9565987225 +λ(_jn0) = 1 +λ(_jn1) = 1 +λ(_jn2) = 1 +λ(_jn3) = 1 +belief change = 4.547870327e-14 + +domain π(Burglar) λ(Burglar) belief +---------------------------------------------------------------- +b1 0.005 0.5 0.005 +b2 0.995 0.5 0.995 + +domain πAlarm(Burglar) λAlarm(Burglar) +---------------------------------------------------------------- +b1 0.005 0.5 +b2 0.995 0.5 + +domain π(FreightTruck) λ(FreightTruck) belief +---------------------------------------------------------------- +f1 0.03 0.25 0.03 +f2 0.97 0.25 0.97 + +domain πAlarm(FreightTruck) λAlarm(FreightTruck) +---------------------------------------------------------------- +f1 0.03 0.5 +f2 0.97 0.5 + +domain π_Jn(FreightTruck) λ_Jn(FreightTruck) +---------------------------------------------------------------- +f1 0.03 0.5 +f2 0.97 0.5 + +domain π(Alarm) λ(Alarm) belief +---------------------------------------------------------------- +a1 0.01381575 0.5 0.01381575 +a2 0.98618425 0.5 0.98618425 + +domain π_Jn(Alarm) λ_Jn(Alarm) +---------------------------------------------------------------- +a1 0.01381575 0.5 +a2 0.98618425 0.5 + +domain π(_Jn) λ(_Jn) belief +---------------------------------------------------------------- +_jn0 0.0004144725 1 0.0004144725 +_jn1 0.0295855275 1 0.0295855275 +_jn2 0.0134012775 1 0.0134012775 +_jn3 0.9565987225 1 0.9565987225 + + + +******************************************************************************** + Iteration 76 +******************************************************************************** +λ message Alarm --> Burglar +λAlarm(b1) += [p(a1|b1,f1).πAlarm(f1) + p(a1|b1,f2).πAlarm(f2)].λ(a1) ++ [p(a2|b1,f1).πAlarm(f1) + p(a2|b1,f2).πAlarm(f2)].λ(a2) += [(0.992x0.03) + (0.99x0.97)]x0.5 ++ [(0.008x0.03) + (0.01x0.97)]x0.5 = 0.5 +λAlarm(b2) += [p(a1|b2,f1).πAlarm(f1) + p(a1|b2,f2).πAlarm(f2)].λ(a1) ++ [p(a2|b2,f1).πAlarm(f1) + p(a2|b2,f2).πAlarm(f2)].λ(a2) += [(0.2x0.03) + (0.003x0.97)]x0.5 ++ [(0.8x0.03) + (0.997x0.97)]x0.5 = 0.5 + +λ message Alarm --> FreightTruck +λAlarm(f1) += [p(a1|b1,f1).πAlarm(b1) + p(a1|b2,f1).πAlarm(b2)].λ(a1) ++ [p(a2|b1,f1).πAlarm(b1) + p(a2|b2,f1).πAlarm(b2)].λ(a2) += [(0.992x0.005) + (0.2x0.995)]x0.5 ++ [(0.008x0.005) + (0.8x0.995)]x0.5 = 0.5 +λAlarm(f2) += [p(a1|b1,f2).πAlarm(b1) + p(a1|b2,f2).πAlarm(b2)].λ(a1) ++ [p(a2|b1,f2).πAlarm(b1) + p(a2|b2,f2).πAlarm(b2)].λ(a2) += [(0.99x0.005) + (0.003x0.995)]x0.5 ++ [(0.01x0.005) + (0.997x0.995)]x0.5 = 0.5 + +λ message _Jn --> FreightTruck +λ_Jn(f1) += [p(_jn0|f1,a1).π_Jn(a1) + p(_jn0|f1,a2).π_Jn(a2)].λ(_jn0) ++ [p(_jn1|f1,a1).π_Jn(a1) + p(_jn1|f1,a2).π_Jn(a2)].λ(_jn1) ++ [p(_jn2|f1,a1).π_Jn(a1) + p(_jn2|f1,a2).π_Jn(a2)].λ(_jn2) ++ [p(_jn3|f1,a1).π_Jn(a1) + p(_jn3|f1,a2).π_Jn(a2)].λ(_jn3) += [(1x0.0138158) + (0x0.986184)]x1 ++ [(0x0.0138158) + (1x0.986184)]x1 ++ [(0x0.0138158) + (0x0.986184)]x1 ++ [(0x0.0138158) + (0x0.986184)]x1 = 1 +λ_Jn(f2) += [p(_jn0|f2,a1).π_Jn(a1) + p(_jn0|f2,a2).π_Jn(a2)].λ(_jn0) ++ [p(_jn1|f2,a1).π_Jn(a1) + p(_jn1|f2,a2).π_Jn(a2)].λ(_jn1) ++ [p(_jn2|f2,a1).π_Jn(a1) + p(_jn2|f2,a2).π_Jn(a2)].λ(_jn2) ++ [p(_jn3|f2,a1).π_Jn(a1) + p(_jn3|f2,a2).π_Jn(a2)].λ(_jn3) += [(0x0.0138158) + (0x0.986184)]x1 ++ [(0x0.0138158) + (0x0.986184)]x1 ++ [(1x0.0138158) + (0x0.986184)]x1 ++ [(0x0.0138158) + (1x0.986184)]x1 = 1 + +λ message _Jn --> Alarm +λ_Jn(a1) += [p(_jn0|f1,a1).π_Jn(f1) + p(_jn0|f2,a1).π_Jn(f2)].λ(_jn0) ++ [p(_jn1|f1,a1).π_Jn(f1) + p(_jn1|f2,a1).π_Jn(f2)].λ(_jn1) ++ [p(_jn2|f1,a1).π_Jn(f1) + p(_jn2|f2,a1).π_Jn(f2)].λ(_jn2) ++ [p(_jn3|f1,a1).π_Jn(f1) + p(_jn3|f2,a1).π_Jn(f2)].λ(_jn3) += [(1x0.03) + (0x0.97)]x1 ++ [(0x0.03) + (0x0.97)]x1 ++ [(0x0.03) + (1x0.97)]x1 ++ [(0x0.03) + (0x0.97)]x1 = 1 +λ_Jn(a2) += [p(_jn0|f1,a2).π_Jn(f1) + p(_jn0|f2,a2).π_Jn(f2)].λ(_jn0) ++ [p(_jn1|f1,a2).π_Jn(f1) + p(_jn1|f2,a2).π_Jn(f2)].λ(_jn1) ++ [p(_jn2|f1,a2).π_Jn(f1) + p(_jn2|f2,a2).π_Jn(f2)].λ(_jn2) ++ [p(_jn3|f1,a2).π_Jn(f1) + p(_jn3|f2,a2).π_Jn(f2)].λ(_jn3) += [(0x0.03) + (0x0.97)]x1 ++ [(1x0.03) + (0x0.97)]x1 ++ [(0x0.03) + (0x0.97)]x1 ++ [(0x0.03) + (1x0.97)]x1 = 1 + +π message Burglar --> Alarm +πAlarm(b1) = π(b1) = 0.005 = 0.005 +πAlarm(b2) = π(b2) = 0.995 = 0.995 + +π message FreightTruck --> Alarm +πAlarm(f1) = π(f1).λ_Jn(f1) = 0.03 x 0.5 = 0.015 +πAlarm(f2) = π(f2).λ_Jn(f2) = 0.97 x 0.5 = 0.485 + +π message FreightTruck --> _Jn +π_Jn(f1) = π(f1).λAlarm(f1) = 0.03 x 0.5 = 0.015 +π_Jn(f2) = π(f2).λAlarm(f2) = 0.97 x 0.5 = 0.485 + +π message Alarm --> _Jn +π_Jn(a1) = π(a1) = 0.0138158 = 0.01381575 +π_Jn(a2) = π(a2) = 0.986184 = 0.98618425 + +var Burglar: +π(b1) += p(b1) += (0.005) = 0.005 +π(b2) += p(b2) += (0.995) = 0.995 +λ(b1) = λAlarm(b1) = 0.5 = 0.5 +λ(b2) = λAlarm(b2) = 0.5 = 0.5 +belief change = 0 + +var FreightTruck: +π(f1) += p(f1) += (0.03) = 0.03 +π(f2) += p(f2) += (0.97) = 0.97 +λ(f1) = λAlarm(f1).λ_Jn(f1) = 0.5 x 0.5 = 0.25 +λ(f2) = λAlarm(f2).λ_Jn(f2) = 0.5 x 0.5 = 0.25 +belief change = 0 + +var Alarm: +π(a1) += p(a1|b1,f1).πAlarm(b1).πAlarm(f1) ++ p(a1|b1,f2).πAlarm(b1).πAlarm(f2) ++ p(a1|b2,f1).πAlarm(b2).πAlarm(f1) ++ p(a1|b2,f2).πAlarm(b2).πAlarm(f2) += (0.992x0.005x0.03) ++ (0.99x0.005x0.97) ++ (0.2x0.995x0.03) ++ (0.003x0.995x0.97) = 0.01381575 +π(a2) += p(a2|b1,f1).πAlarm(b1).πAlarm(f1) ++ p(a2|b1,f2).πAlarm(b1).πAlarm(f2) ++ p(a2|b2,f1).πAlarm(b2).πAlarm(f1) ++ p(a2|b2,f2).πAlarm(b2).πAlarm(f2) += (0.008x0.005x0.03) ++ (0.01x0.005x0.97) ++ (0.8x0.995x0.03) ++ (0.997x0.995x0.97) = 0.98618425 +λ(a1) = λ_Jn(a1) = 0.5 = 0.5 +λ(a2) = λ_Jn(a2) = 0.5 = 0.5 +belief change = 3.797309689e-15 + +var _Jn: +π(_jn0) += p(_jn0|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn0|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn0|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn0|f2,a2).π_Jn(f2).π_Jn(a2) += (1x0.03x0.0138158) ++ (0x0.03x0.986184) ++ (0x0.97x0.0138158) ++ (0x0.97x0.986184) = 0.0004144725 +π(_jn1) += p(_jn1|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn1|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn1|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn1|f2,a2).π_Jn(f2).π_Jn(a2) += (0x0.03x0.0138158) ++ (1x0.03x0.986184) ++ (0x0.97x0.0138158) ++ (0x0.97x0.986184) = 0.0295855275 +π(_jn2) += p(_jn2|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn2|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn2|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn2|f2,a2).π_Jn(f2).π_Jn(a2) += (0x0.03x0.0138158) ++ (0x0.03x0.986184) ++ (1x0.97x0.0138158) ++ (0x0.97x0.986184) = 0.0134012775 +π(_jn3) += p(_jn3|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn3|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn3|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn3|f2,a2).π_Jn(f2).π_Jn(a2) += (0x0.03x0.0138158) ++ (0x0.03x0.986184) ++ (0x0.97x0.0138158) ++ (1x0.97x0.986184) = 0.9565987225 +λ(_jn0) = 1 +λ(_jn1) = 1 +λ(_jn2) = 1 +λ(_jn3) = 1 +belief change = 3.024924061e-14 + +domain π(Burglar) λ(Burglar) belief +---------------------------------------------------------------- +b1 0.005 0.5 0.005 +b2 0.995 0.5 0.995 + +domain πAlarm(Burglar) λAlarm(Burglar) +---------------------------------------------------------------- +b1 0.005 0.5 +b2 0.995 0.5 + +domain π(FreightTruck) λ(FreightTruck) belief +---------------------------------------------------------------- +f1 0.03 0.25 0.03 +f2 0.97 0.25 0.97 + +domain πAlarm(FreightTruck) λAlarm(FreightTruck) +---------------------------------------------------------------- +f1 0.03 0.5 +f2 0.97 0.5 + +domain π_Jn(FreightTruck) λ_Jn(FreightTruck) +---------------------------------------------------------------- +f1 0.03 0.5 +f2 0.97 0.5 + +domain π(Alarm) λ(Alarm) belief +---------------------------------------------------------------- +a1 0.01381575 0.5 0.01381575 +a2 0.98618425 0.5 0.98618425 + +domain π_Jn(Alarm) λ_Jn(Alarm) +---------------------------------------------------------------- +a1 0.01381575 0.5 +a2 0.98618425 0.5 + +domain π(_Jn) λ(_Jn) belief +---------------------------------------------------------------- +_jn0 0.0004144725 1 0.0004144725 +_jn1 0.0295855275 1 0.0295855275 +_jn2 0.0134012775 1 0.0134012775 +_jn3 0.9565987225 1 0.9565987225 + + + +******************************************************************************** + Iteration 77 +******************************************************************************** +λ message Alarm --> Burglar +λAlarm(b1) += [p(a1|b1,f1).πAlarm(f1) + p(a1|b1,f2).πAlarm(f2)].λ(a1) ++ [p(a2|b1,f1).πAlarm(f1) + p(a2|b1,f2).πAlarm(f2)].λ(a2) += [(0.992x0.03) + (0.99x0.97)]x0.5 ++ [(0.008x0.03) + (0.01x0.97)]x0.5 = 0.5 +λAlarm(b2) += [p(a1|b2,f1).πAlarm(f1) + p(a1|b2,f2).πAlarm(f2)].λ(a1) ++ [p(a2|b2,f1).πAlarm(f1) + p(a2|b2,f2).πAlarm(f2)].λ(a2) += [(0.2x0.03) + (0.003x0.97)]x0.5 ++ [(0.8x0.03) + (0.997x0.97)]x0.5 = 0.5 + +λ message Alarm --> FreightTruck +λAlarm(f1) += [p(a1|b1,f1).πAlarm(b1) + p(a1|b2,f1).πAlarm(b2)].λ(a1) ++ [p(a2|b1,f1).πAlarm(b1) + p(a2|b2,f1).πAlarm(b2)].λ(a2) += [(0.992x0.005) + (0.2x0.995)]x0.5 ++ [(0.008x0.005) + (0.8x0.995)]x0.5 = 0.5 +λAlarm(f2) += [p(a1|b1,f2).πAlarm(b1) + p(a1|b2,f2).πAlarm(b2)].λ(a1) ++ [p(a2|b1,f2).πAlarm(b1) + p(a2|b2,f2).πAlarm(b2)].λ(a2) += [(0.99x0.005) + (0.003x0.995)]x0.5 ++ [(0.01x0.005) + (0.997x0.995)]x0.5 = 0.5 + +λ message _Jn --> FreightTruck +λ_Jn(f1) += [p(_jn0|f1,a1).π_Jn(a1) + p(_jn0|f1,a2).π_Jn(a2)].λ(_jn0) ++ [p(_jn1|f1,a1).π_Jn(a1) + p(_jn1|f1,a2).π_Jn(a2)].λ(_jn1) ++ [p(_jn2|f1,a1).π_Jn(a1) + p(_jn2|f1,a2).π_Jn(a2)].λ(_jn2) ++ [p(_jn3|f1,a1).π_Jn(a1) + p(_jn3|f1,a2).π_Jn(a2)].λ(_jn3) += [(1x0.0138158) + (0x0.986184)]x1 ++ [(0x0.0138158) + (1x0.986184)]x1 ++ [(0x0.0138158) + (0x0.986184)]x1 ++ [(0x0.0138158) + (0x0.986184)]x1 = 1 +λ_Jn(f2) += [p(_jn0|f2,a1).π_Jn(a1) + p(_jn0|f2,a2).π_Jn(a2)].λ(_jn0) ++ [p(_jn1|f2,a1).π_Jn(a1) + p(_jn1|f2,a2).π_Jn(a2)].λ(_jn1) ++ [p(_jn2|f2,a1).π_Jn(a1) + p(_jn2|f2,a2).π_Jn(a2)].λ(_jn2) ++ [p(_jn3|f2,a1).π_Jn(a1) + p(_jn3|f2,a2).π_Jn(a2)].λ(_jn3) += [(0x0.0138158) + (0x0.986184)]x1 ++ [(0x0.0138158) + (0x0.986184)]x1 ++ [(1x0.0138158) + (0x0.986184)]x1 ++ [(0x0.0138158) + (1x0.986184)]x1 = 1 + +λ message _Jn --> Alarm +λ_Jn(a1) += [p(_jn0|f1,a1).π_Jn(f1) + p(_jn0|f2,a1).π_Jn(f2)].λ(_jn0) ++ [p(_jn1|f1,a1).π_Jn(f1) + p(_jn1|f2,a1).π_Jn(f2)].λ(_jn1) ++ [p(_jn2|f1,a1).π_Jn(f1) + p(_jn2|f2,a1).π_Jn(f2)].λ(_jn2) ++ [p(_jn3|f1,a1).π_Jn(f1) + p(_jn3|f2,a1).π_Jn(f2)].λ(_jn3) += [(1x0.03) + (0x0.97)]x1 ++ [(0x0.03) + (0x0.97)]x1 ++ [(0x0.03) + (1x0.97)]x1 ++ [(0x0.03) + (0x0.97)]x1 = 1 +λ_Jn(a2) += [p(_jn0|f1,a2).π_Jn(f1) + p(_jn0|f2,a2).π_Jn(f2)].λ(_jn0) ++ [p(_jn1|f1,a2).π_Jn(f1) + p(_jn1|f2,a2).π_Jn(f2)].λ(_jn1) ++ [p(_jn2|f1,a2).π_Jn(f1) + p(_jn2|f2,a2).π_Jn(f2)].λ(_jn2) ++ [p(_jn3|f1,a2).π_Jn(f1) + p(_jn3|f2,a2).π_Jn(f2)].λ(_jn3) += [(0x0.03) + (0x0.97)]x1 ++ [(1x0.03) + (0x0.97)]x1 ++ [(0x0.03) + (0x0.97)]x1 ++ [(0x0.03) + (1x0.97)]x1 = 1 + +π message Burglar --> Alarm +πAlarm(b1) = π(b1) = 0.005 = 0.005 +πAlarm(b2) = π(b2) = 0.995 = 0.995 + +π message FreightTruck --> Alarm +πAlarm(f1) = π(f1).λ_Jn(f1) = 0.03 x 0.5 = 0.015 +πAlarm(f2) = π(f2).λ_Jn(f2) = 0.97 x 0.5 = 0.485 + +π message FreightTruck --> _Jn +π_Jn(f1) = π(f1).λAlarm(f1) = 0.03 x 0.5 = 0.015 +π_Jn(f2) = π(f2).λAlarm(f2) = 0.97 x 0.5 = 0.485 + +π message Alarm --> _Jn +π_Jn(a1) = π(a1) = 0.0138158 = 0.01381575 +π_Jn(a2) = π(a2) = 0.986184 = 0.98618425 + +var Burglar: +π(b1) += p(b1) += (0.005) = 0.005 +π(b2) += p(b2) += (0.995) = 0.995 +λ(b1) = λAlarm(b1) = 0.5 = 0.5 +λ(b2) = λAlarm(b2) = 0.5 = 0.5 +belief change = 0 + +var FreightTruck: +π(f1) += p(f1) += (0.03) = 0.03 +π(f2) += p(f2) += (0.97) = 0.97 +λ(f1) = λAlarm(f1).λ_Jn(f1) = 0.5 x 0.5 = 0.25 +λ(f2) = λAlarm(f2).λ_Jn(f2) = 0.5 x 0.5 = 0.25 +belief change = 0 + +var Alarm: +π(a1) += p(a1|b1,f1).πAlarm(b1).πAlarm(f1) ++ p(a1|b1,f2).πAlarm(b1).πAlarm(f2) ++ p(a1|b2,f1).πAlarm(b2).πAlarm(f1) ++ p(a1|b2,f2).πAlarm(b2).πAlarm(f2) += (0.992x0.005x0.03) ++ (0.99x0.005x0.97) ++ (0.2x0.995x0.03) ++ (0.003x0.995x0.97) = 0.01381575 +π(a2) += p(a2|b1,f1).πAlarm(b1).πAlarm(f1) ++ p(a2|b1,f2).πAlarm(b1).πAlarm(f2) ++ p(a2|b2,f1).πAlarm(b2).πAlarm(f1) ++ p(a2|b2,f2).πAlarm(b2).πAlarm(f2) += (0.008x0.005x0.03) ++ (0.01x0.005x0.97) ++ (0.8x0.995x0.03) ++ (0.997x0.995x0.97) = 0.98618425 +λ(a1) = λ_Jn(a1) = 0.5 = 0.5 +λ(a2) = λ_Jn(a2) = 0.5 = 0.5 +belief change = 2.492797635e-15 + +var _Jn: +π(_jn0) += p(_jn0|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn0|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn0|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn0|f2,a2).π_Jn(f2).π_Jn(a2) += (1x0.03x0.0138158) ++ (0x0.03x0.986184) ++ (0x0.97x0.0138158) ++ (0x0.97x0.986184) = 0.0004144725 +π(_jn1) += p(_jn1|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn1|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn1|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn1|f2,a2).π_Jn(f2).π_Jn(a2) += (0x0.03x0.0138158) ++ (1x0.03x0.986184) ++ (0x0.97x0.0138158) ++ (0x0.97x0.986184) = 0.0295855275 +π(_jn2) += p(_jn2|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn2|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn2|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn2|f2,a2).π_Jn(f2).π_Jn(a2) += (0x0.03x0.0138158) ++ (0x0.03x0.986184) ++ (1x0.97x0.0138158) ++ (0x0.97x0.986184) = 0.0134012775 +π(_jn3) += p(_jn3|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn3|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn3|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn3|f2,a2).π_Jn(f2).π_Jn(a2) += (0x0.03x0.0138158) ++ (0x0.03x0.986184) ++ (0x0.97x0.0138158) ++ (1x0.97x0.986184) = 0.9565987225 +λ(_jn0) = 1 +λ(_jn1) = 1 +λ(_jn2) = 1 +λ(_jn3) = 1 +belief change = 2.019500019e-14 + +domain π(Burglar) λ(Burglar) belief +---------------------------------------------------------------- +b1 0.005 0.5 0.005 +b2 0.995 0.5 0.995 + +domain πAlarm(Burglar) λAlarm(Burglar) +---------------------------------------------------------------- +b1 0.005 0.5 +b2 0.995 0.5 + +domain π(FreightTruck) λ(FreightTruck) belief +---------------------------------------------------------------- +f1 0.03 0.25 0.03 +f2 0.97 0.25 0.97 + +domain πAlarm(FreightTruck) λAlarm(FreightTruck) +---------------------------------------------------------------- +f1 0.03 0.5 +f2 0.97 0.5 + +domain π_Jn(FreightTruck) λ_Jn(FreightTruck) +---------------------------------------------------------------- +f1 0.03 0.5 +f2 0.97 0.5 + +domain π(Alarm) λ(Alarm) belief +---------------------------------------------------------------- +a1 0.01381575 0.5 0.01381575 +a2 0.98618425 0.5 0.98618425 + +domain π_Jn(Alarm) λ_Jn(Alarm) +---------------------------------------------------------------- +a1 0.01381575 0.5 +a2 0.98618425 0.5 + +domain π(_Jn) λ(_Jn) belief +---------------------------------------------------------------- +_jn0 0.0004144725 1 0.0004144725 +_jn1 0.0295855275 1 0.0295855275 +_jn2 0.0134012775 1 0.0134012775 +_jn3 0.9565987225 1 0.9565987225 + + + +******************************************************************************** + Iteration 78 +******************************************************************************** +λ message Alarm --> Burglar +λAlarm(b1) += [p(a1|b1,f1).πAlarm(f1) + p(a1|b1,f2).πAlarm(f2)].λ(a1) ++ [p(a2|b1,f1).πAlarm(f1) + p(a2|b1,f2).πAlarm(f2)].λ(a2) += [(0.992x0.03) + (0.99x0.97)]x0.5 ++ [(0.008x0.03) + (0.01x0.97)]x0.5 = 0.5 +λAlarm(b2) += [p(a1|b2,f1).πAlarm(f1) + p(a1|b2,f2).πAlarm(f2)].λ(a1) ++ [p(a2|b2,f1).πAlarm(f1) + p(a2|b2,f2).πAlarm(f2)].λ(a2) += [(0.2x0.03) + (0.003x0.97)]x0.5 ++ [(0.8x0.03) + (0.997x0.97)]x0.5 = 0.5 + +λ message Alarm --> FreightTruck +λAlarm(f1) += [p(a1|b1,f1).πAlarm(b1) + p(a1|b2,f1).πAlarm(b2)].λ(a1) ++ [p(a2|b1,f1).πAlarm(b1) + p(a2|b2,f1).πAlarm(b2)].λ(a2) += [(0.992x0.005) + (0.2x0.995)]x0.5 ++ [(0.008x0.005) + (0.8x0.995)]x0.5 = 0.5 +λAlarm(f2) += [p(a1|b1,f2).πAlarm(b1) + p(a1|b2,f2).πAlarm(b2)].λ(a1) ++ [p(a2|b1,f2).πAlarm(b1) + p(a2|b2,f2).πAlarm(b2)].λ(a2) += [(0.99x0.005) + (0.003x0.995)]x0.5 ++ [(0.01x0.005) + (0.997x0.995)]x0.5 = 0.5 + +λ message _Jn --> FreightTruck +λ_Jn(f1) += [p(_jn0|f1,a1).π_Jn(a1) + p(_jn0|f1,a2).π_Jn(a2)].λ(_jn0) ++ [p(_jn1|f1,a1).π_Jn(a1) + p(_jn1|f1,a2).π_Jn(a2)].λ(_jn1) ++ [p(_jn2|f1,a1).π_Jn(a1) + p(_jn2|f1,a2).π_Jn(a2)].λ(_jn2) ++ [p(_jn3|f1,a1).π_Jn(a1) + p(_jn3|f1,a2).π_Jn(a2)].λ(_jn3) += [(1x0.0138158) + (0x0.986184)]x1 ++ [(0x0.0138158) + (1x0.986184)]x1 ++ [(0x0.0138158) + (0x0.986184)]x1 ++ [(0x0.0138158) + (0x0.986184)]x1 = 1 +λ_Jn(f2) += [p(_jn0|f2,a1).π_Jn(a1) + p(_jn0|f2,a2).π_Jn(a2)].λ(_jn0) ++ [p(_jn1|f2,a1).π_Jn(a1) + p(_jn1|f2,a2).π_Jn(a2)].λ(_jn1) ++ [p(_jn2|f2,a1).π_Jn(a1) + p(_jn2|f2,a2).π_Jn(a2)].λ(_jn2) ++ [p(_jn3|f2,a1).π_Jn(a1) + p(_jn3|f2,a2).π_Jn(a2)].λ(_jn3) += [(0x0.0138158) + (0x0.986184)]x1 ++ [(0x0.0138158) + (0x0.986184)]x1 ++ [(1x0.0138158) + (0x0.986184)]x1 ++ [(0x0.0138158) + (1x0.986184)]x1 = 1 + +λ message _Jn --> Alarm +λ_Jn(a1) += [p(_jn0|f1,a1).π_Jn(f1) + p(_jn0|f2,a1).π_Jn(f2)].λ(_jn0) ++ [p(_jn1|f1,a1).π_Jn(f1) + p(_jn1|f2,a1).π_Jn(f2)].λ(_jn1) ++ [p(_jn2|f1,a1).π_Jn(f1) + p(_jn2|f2,a1).π_Jn(f2)].λ(_jn2) ++ [p(_jn3|f1,a1).π_Jn(f1) + p(_jn3|f2,a1).π_Jn(f2)].λ(_jn3) += [(1x0.03) + (0x0.97)]x1 ++ [(0x0.03) + (0x0.97)]x1 ++ [(0x0.03) + (1x0.97)]x1 ++ [(0x0.03) + (0x0.97)]x1 = 1 +λ_Jn(a2) += [p(_jn0|f1,a2).π_Jn(f1) + p(_jn0|f2,a2).π_Jn(f2)].λ(_jn0) ++ [p(_jn1|f1,a2).π_Jn(f1) + p(_jn1|f2,a2).π_Jn(f2)].λ(_jn1) ++ [p(_jn2|f1,a2).π_Jn(f1) + p(_jn2|f2,a2).π_Jn(f2)].λ(_jn2) ++ [p(_jn3|f1,a2).π_Jn(f1) + p(_jn3|f2,a2).π_Jn(f2)].λ(_jn3) += [(0x0.03) + (0x0.97)]x1 ++ [(1x0.03) + (0x0.97)]x1 ++ [(0x0.03) + (0x0.97)]x1 ++ [(0x0.03) + (1x0.97)]x1 = 1 + +π message Burglar --> Alarm +πAlarm(b1) = π(b1) = 0.005 = 0.005 +πAlarm(b2) = π(b2) = 0.995 = 0.995 + +π message FreightTruck --> Alarm +πAlarm(f1) = π(f1).λ_Jn(f1) = 0.03 x 0.5 = 0.015 +πAlarm(f2) = π(f2).λ_Jn(f2) = 0.97 x 0.5 = 0.485 + +π message FreightTruck --> _Jn +π_Jn(f1) = π(f1).λAlarm(f1) = 0.03 x 0.5 = 0.015 +π_Jn(f2) = π(f2).λAlarm(f2) = 0.97 x 0.5 = 0.485 + +π message Alarm --> _Jn +π_Jn(a1) = π(a1) = 0.0138158 = 0.01381575 +π_Jn(a2) = π(a2) = 0.986184 = 0.98618425 + +var Burglar: +π(b1) += p(b1) += (0.005) = 0.005 +π(b2) += p(b2) += (0.995) = 0.995 +λ(b1) = λAlarm(b1) = 0.5 = 0.5 +λ(b2) = λAlarm(b2) = 0.5 = 0.5 +belief change = 0 + +var FreightTruck: +π(f1) += p(f1) += (0.03) = 0.03 +π(f2) += p(f2) += (0.97) = 0.97 +λ(f1) = λAlarm(f1).λ_Jn(f1) = 0.5 x 0.5 = 0.25 +λ(f2) = λAlarm(f2).λ_Jn(f2) = 0.5 x 0.5 = 0.25 +belief change = 0 + +var Alarm: +π(a1) += p(a1|b1,f1).πAlarm(b1).πAlarm(f1) ++ p(a1|b1,f2).πAlarm(b1).πAlarm(f2) ++ p(a1|b2,f1).πAlarm(b2).πAlarm(f1) ++ p(a1|b2,f2).πAlarm(b2).πAlarm(f2) += (0.992x0.005x0.03) ++ (0.99x0.005x0.97) ++ (0.2x0.995x0.03) ++ (0.003x0.995x0.97) = 0.01381575 +π(a2) += p(a2|b1,f1).πAlarm(b1).πAlarm(f1) ++ p(a2|b1,f2).πAlarm(b1).πAlarm(f2) ++ p(a2|b2,f1).πAlarm(b2).πAlarm(f1) ++ p(a2|b2,f2).πAlarm(b2).πAlarm(f2) += (0.008x0.005x0.03) ++ (0.01x0.005x0.97) ++ (0.8x0.995x0.03) ++ (0.997x0.995x0.97) = 0.98618425 +λ(a1) = λ_Jn(a1) = 0.5 = 0.5 +λ(a2) = λ_Jn(a2) = 0.5 = 0.5 +belief change = 1.734723476e-15 + +var _Jn: +π(_jn0) += p(_jn0|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn0|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn0|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn0|f2,a2).π_Jn(f2).π_Jn(a2) += (1x0.03x0.0138158) ++ (0x0.03x0.986184) ++ (0x0.97x0.0138158) ++ (0x0.97x0.986184) = 0.0004144725 +π(_jn1) += p(_jn1|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn1|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn1|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn1|f2,a2).π_Jn(f2).π_Jn(a2) += (0x0.03x0.0138158) ++ (1x0.03x0.986184) ++ (0x0.97x0.0138158) ++ (0x0.97x0.986184) = 0.0295855275 +π(_jn2) += p(_jn2|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn2|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn2|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn2|f2,a2).π_Jn(f2).π_Jn(a2) += (0x0.03x0.0138158) ++ (0x0.03x0.986184) ++ (1x0.97x0.0138158) ++ (0x0.97x0.986184) = 0.0134012775 +π(_jn3) += p(_jn3|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn3|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn3|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn3|f2,a2).π_Jn(f2).π_Jn(a2) += (0x0.03x0.0138158) ++ (0x0.03x0.986184) ++ (0x0.97x0.0138158) ++ (1x0.97x0.986184) = 0.9565987225 +λ(_jn0) = 1 +λ(_jn1) = 1 +λ(_jn2) = 1 +λ(_jn3) = 1 +belief change = 1.350200333e-14 + +domain π(Burglar) λ(Burglar) belief +---------------------------------------------------------------- +b1 0.005 0.5 0.005 +b2 0.995 0.5 0.995 + +domain πAlarm(Burglar) λAlarm(Burglar) +---------------------------------------------------------------- +b1 0.005 0.5 +b2 0.995 0.5 + +domain π(FreightTruck) λ(FreightTruck) belief +---------------------------------------------------------------- +f1 0.03 0.25 0.03 +f2 0.97 0.25 0.97 + +domain πAlarm(FreightTruck) λAlarm(FreightTruck) +---------------------------------------------------------------- +f1 0.03 0.5 +f2 0.97 0.5 + +domain π_Jn(FreightTruck) λ_Jn(FreightTruck) +---------------------------------------------------------------- +f1 0.03 0.5 +f2 0.97 0.5 + +domain π(Alarm) λ(Alarm) belief +---------------------------------------------------------------- +a1 0.01381575 0.5 0.01381575 +a2 0.98618425 0.5 0.98618425 + +domain π_Jn(Alarm) λ_Jn(Alarm) +---------------------------------------------------------------- +a1 0.01381575 0.5 +a2 0.98618425 0.5 + +domain π(_Jn) λ(_Jn) belief +---------------------------------------------------------------- +_jn0 0.0004144725 1 0.0004144725 +_jn1 0.0295855275 1 0.0295855275 +_jn2 0.0134012775 1 0.0134012775 +_jn3 0.9565987225 1 0.9565987225 + + + +******************************************************************************** + Iteration 79 +******************************************************************************** +λ message Alarm --> Burglar +λAlarm(b1) += [p(a1|b1,f1).πAlarm(f1) + p(a1|b1,f2).πAlarm(f2)].λ(a1) ++ [p(a2|b1,f1).πAlarm(f1) + p(a2|b1,f2).πAlarm(f2)].λ(a2) += [(0.992x0.03) + (0.99x0.97)]x0.5 ++ [(0.008x0.03) + (0.01x0.97)]x0.5 = 0.5 +λAlarm(b2) += [p(a1|b2,f1).πAlarm(f1) + p(a1|b2,f2).πAlarm(f2)].λ(a1) ++ [p(a2|b2,f1).πAlarm(f1) + p(a2|b2,f2).πAlarm(f2)].λ(a2) += [(0.2x0.03) + (0.003x0.97)]x0.5 ++ [(0.8x0.03) + (0.997x0.97)]x0.5 = 0.5 + +λ message Alarm --> FreightTruck +λAlarm(f1) += [p(a1|b1,f1).πAlarm(b1) + p(a1|b2,f1).πAlarm(b2)].λ(a1) ++ [p(a2|b1,f1).πAlarm(b1) + p(a2|b2,f1).πAlarm(b2)].λ(a2) += [(0.992x0.005) + (0.2x0.995)]x0.5 ++ [(0.008x0.005) + (0.8x0.995)]x0.5 = 0.5 +λAlarm(f2) += [p(a1|b1,f2).πAlarm(b1) + p(a1|b2,f2).πAlarm(b2)].λ(a1) ++ [p(a2|b1,f2).πAlarm(b1) + p(a2|b2,f2).πAlarm(b2)].λ(a2) += [(0.99x0.005) + (0.003x0.995)]x0.5 ++ [(0.01x0.005) + (0.997x0.995)]x0.5 = 0.5 + +λ message _Jn --> FreightTruck +λ_Jn(f1) += [p(_jn0|f1,a1).π_Jn(a1) + p(_jn0|f1,a2).π_Jn(a2)].λ(_jn0) ++ [p(_jn1|f1,a1).π_Jn(a1) + p(_jn1|f1,a2).π_Jn(a2)].λ(_jn1) ++ [p(_jn2|f1,a1).π_Jn(a1) + p(_jn2|f1,a2).π_Jn(a2)].λ(_jn2) ++ [p(_jn3|f1,a1).π_Jn(a1) + p(_jn3|f1,a2).π_Jn(a2)].λ(_jn3) += [(1x0.0138158) + (0x0.986184)]x1 ++ [(0x0.0138158) + (1x0.986184)]x1 ++ [(0x0.0138158) + (0x0.986184)]x1 ++ [(0x0.0138158) + (0x0.986184)]x1 = 1 +λ_Jn(f2) += [p(_jn0|f2,a1).π_Jn(a1) + p(_jn0|f2,a2).π_Jn(a2)].λ(_jn0) ++ [p(_jn1|f2,a1).π_Jn(a1) + p(_jn1|f2,a2).π_Jn(a2)].λ(_jn1) ++ [p(_jn2|f2,a1).π_Jn(a1) + p(_jn2|f2,a2).π_Jn(a2)].λ(_jn2) ++ [p(_jn3|f2,a1).π_Jn(a1) + p(_jn3|f2,a2).π_Jn(a2)].λ(_jn3) += [(0x0.0138158) + (0x0.986184)]x1 ++ [(0x0.0138158) + (0x0.986184)]x1 ++ [(1x0.0138158) + (0x0.986184)]x1 ++ [(0x0.0138158) + (1x0.986184)]x1 = 1 + +λ message _Jn --> Alarm +λ_Jn(a1) += [p(_jn0|f1,a1).π_Jn(f1) + p(_jn0|f2,a1).π_Jn(f2)].λ(_jn0) ++ [p(_jn1|f1,a1).π_Jn(f1) + p(_jn1|f2,a1).π_Jn(f2)].λ(_jn1) ++ [p(_jn2|f1,a1).π_Jn(f1) + p(_jn2|f2,a1).π_Jn(f2)].λ(_jn2) ++ [p(_jn3|f1,a1).π_Jn(f1) + p(_jn3|f2,a1).π_Jn(f2)].λ(_jn3) += [(1x0.03) + (0x0.97)]x1 ++ [(0x0.03) + (0x0.97)]x1 ++ [(0x0.03) + (1x0.97)]x1 ++ [(0x0.03) + (0x0.97)]x1 = 1 +λ_Jn(a2) += [p(_jn0|f1,a2).π_Jn(f1) + p(_jn0|f2,a2).π_Jn(f2)].λ(_jn0) ++ [p(_jn1|f1,a2).π_Jn(f1) + p(_jn1|f2,a2).π_Jn(f2)].λ(_jn1) ++ [p(_jn2|f1,a2).π_Jn(f1) + p(_jn2|f2,a2).π_Jn(f2)].λ(_jn2) ++ [p(_jn3|f1,a2).π_Jn(f1) + p(_jn3|f2,a2).π_Jn(f2)].λ(_jn3) += [(0x0.03) + (0x0.97)]x1 ++ [(1x0.03) + (0x0.97)]x1 ++ [(0x0.03) + (0x0.97)]x1 ++ [(0x0.03) + (1x0.97)]x1 = 1 + +π message Burglar --> Alarm +πAlarm(b1) = π(b1) = 0.005 = 0.005 +πAlarm(b2) = π(b2) = 0.995 = 0.995 + +π message FreightTruck --> Alarm +πAlarm(f1) = π(f1).λ_Jn(f1) = 0.03 x 0.5 = 0.015 +πAlarm(f2) = π(f2).λ_Jn(f2) = 0.97 x 0.5 = 0.485 + +π message FreightTruck --> _Jn +π_Jn(f1) = π(f1).λAlarm(f1) = 0.03 x 0.5 = 0.015 +π_Jn(f2) = π(f2).λAlarm(f2) = 0.97 x 0.5 = 0.485 + +π message Alarm --> _Jn +π_Jn(a1) = π(a1) = 0.0138158 = 0.01381575 +π_Jn(a2) = π(a2) = 0.986184 = 0.98618425 + +var Burglar: +π(b1) += p(b1) += (0.005) = 0.005 +π(b2) += p(b2) += (0.995) = 0.995 +λ(b1) = λAlarm(b1) = 0.5 = 0.5 +λ(b2) = λAlarm(b2) = 0.5 = 0.5 +belief change = 0 + +var FreightTruck: +π(f1) += p(f1) += (0.03) = 0.03 +π(f2) += p(f2) += (0.97) = 0.97 +λ(f1) = λAlarm(f1).λ_Jn(f1) = 0.5 x 0.5 = 0.25 +λ(f2) = λAlarm(f2).λ_Jn(f2) = 0.5 x 0.5 = 0.25 +belief change = 0 + +var Alarm: +π(a1) += p(a1|b1,f1).πAlarm(b1).πAlarm(f1) ++ p(a1|b1,f2).πAlarm(b1).πAlarm(f2) ++ p(a1|b2,f1).πAlarm(b2).πAlarm(f1) ++ p(a1|b2,f2).πAlarm(b2).πAlarm(f2) += (0.992x0.005x0.03) ++ (0.99x0.005x0.97) ++ (0.2x0.995x0.03) ++ (0.003x0.995x0.97) = 0.01381575 +π(a2) += p(a2|b1,f1).πAlarm(b1).πAlarm(f1) ++ p(a2|b1,f2).πAlarm(b1).πAlarm(f2) ++ p(a2|b2,f1).πAlarm(b2).πAlarm(f1) ++ p(a2|b2,f2).πAlarm(b2).πAlarm(f2) += (0.008x0.005x0.03) ++ (0.01x0.005x0.97) ++ (0.8x0.995x0.03) ++ (0.997x0.995x0.97) = 0.98618425 +λ(a1) = λ_Jn(a1) = 0.5 = 0.5 +λ(a2) = λ_Jn(a2) = 0.5 = 0.5 +belief change = 1.011343786e-15 + +var _Jn: +π(_jn0) += p(_jn0|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn0|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn0|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn0|f2,a2).π_Jn(f2).π_Jn(a2) += (1x0.03x0.0138158) ++ (0x0.03x0.986184) ++ (0x0.97x0.0138158) ++ (0x0.97x0.986184) = 0.0004144725 +π(_jn1) += p(_jn1|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn1|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn1|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn1|f2,a2).π_Jn(f2).π_Jn(a2) += (0x0.03x0.0138158) ++ (1x0.03x0.986184) ++ (0x0.97x0.0138158) ++ (0x0.97x0.986184) = 0.0295855275 +π(_jn2) += p(_jn2|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn2|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn2|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn2|f2,a2).π_Jn(f2).π_Jn(a2) += (0x0.03x0.0138158) ++ (0x0.03x0.986184) ++ (1x0.97x0.0138158) ++ (0x0.97x0.986184) = 0.0134012775 +π(_jn3) += p(_jn3|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn3|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn3|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn3|f2,a2).π_Jn(f2).π_Jn(a2) += (0x0.03x0.0138158) ++ (0x0.03x0.986184) ++ (0x0.97x0.0138158) ++ (1x0.97x0.986184) = 0.9565987225 +λ(_jn0) = 1 +λ(_jn1) = 1 +λ(_jn2) = 1 +λ(_jn3) = 1 +belief change = 9.038451411e-15 + +domain π(Burglar) λ(Burglar) belief +---------------------------------------------------------------- +b1 0.005 0.5 0.005 +b2 0.995 0.5 0.995 + +domain πAlarm(Burglar) λAlarm(Burglar) +---------------------------------------------------------------- +b1 0.005 0.5 +b2 0.995 0.5 + +domain π(FreightTruck) λ(FreightTruck) belief +---------------------------------------------------------------- +f1 0.03 0.25 0.03 +f2 0.97 0.25 0.97 + +domain πAlarm(FreightTruck) λAlarm(FreightTruck) +---------------------------------------------------------------- +f1 0.03 0.5 +f2 0.97 0.5 + +domain π_Jn(FreightTruck) λ_Jn(FreightTruck) +---------------------------------------------------------------- +f1 0.03 0.5 +f2 0.97 0.5 + +domain π(Alarm) λ(Alarm) belief +---------------------------------------------------------------- +a1 0.01381575 0.5 0.01381575 +a2 0.98618425 0.5 0.98618425 + +domain π_Jn(Alarm) λ_Jn(Alarm) +---------------------------------------------------------------- +a1 0.01381575 0.5 +a2 0.98618425 0.5 + +domain π(_Jn) λ(_Jn) belief +---------------------------------------------------------------- +_jn0 0.0004144725 1 0.0004144725 +_jn1 0.0295855275 1 0.0295855275 +_jn2 0.0134012775 1 0.0134012775 +_jn3 0.9565987225 1 0.9565987225 + + + +******************************************************************************** + Iteration 80 +******************************************************************************** +λ message Alarm --> Burglar +λAlarm(b1) += [p(a1|b1,f1).πAlarm(f1) + p(a1|b1,f2).πAlarm(f2)].λ(a1) ++ [p(a2|b1,f1).πAlarm(f1) + p(a2|b1,f2).πAlarm(f2)].λ(a2) += [(0.992x0.03) + (0.99x0.97)]x0.5 ++ [(0.008x0.03) + (0.01x0.97)]x0.5 = 0.5 +λAlarm(b2) += [p(a1|b2,f1).πAlarm(f1) + p(a1|b2,f2).πAlarm(f2)].λ(a1) ++ [p(a2|b2,f1).πAlarm(f1) + p(a2|b2,f2).πAlarm(f2)].λ(a2) += [(0.2x0.03) + (0.003x0.97)]x0.5 ++ [(0.8x0.03) + (0.997x0.97)]x0.5 = 0.5 + +λ message Alarm --> FreightTruck +λAlarm(f1) += [p(a1|b1,f1).πAlarm(b1) + p(a1|b2,f1).πAlarm(b2)].λ(a1) ++ [p(a2|b1,f1).πAlarm(b1) + p(a2|b2,f1).πAlarm(b2)].λ(a2) += [(0.992x0.005) + (0.2x0.995)]x0.5 ++ [(0.008x0.005) + (0.8x0.995)]x0.5 = 0.5 +λAlarm(f2) += [p(a1|b1,f2).πAlarm(b1) + p(a1|b2,f2).πAlarm(b2)].λ(a1) ++ [p(a2|b1,f2).πAlarm(b1) + p(a2|b2,f2).πAlarm(b2)].λ(a2) += [(0.99x0.005) + (0.003x0.995)]x0.5 ++ [(0.01x0.005) + (0.997x0.995)]x0.5 = 0.5 + +λ message _Jn --> FreightTruck +λ_Jn(f1) += [p(_jn0|f1,a1).π_Jn(a1) + p(_jn0|f1,a2).π_Jn(a2)].λ(_jn0) ++ [p(_jn1|f1,a1).π_Jn(a1) + p(_jn1|f1,a2).π_Jn(a2)].λ(_jn1) ++ [p(_jn2|f1,a1).π_Jn(a1) + p(_jn2|f1,a2).π_Jn(a2)].λ(_jn2) ++ [p(_jn3|f1,a1).π_Jn(a1) + p(_jn3|f1,a2).π_Jn(a2)].λ(_jn3) += [(1x0.0138158) + (0x0.986184)]x1 ++ [(0x0.0138158) + (1x0.986184)]x1 ++ [(0x0.0138158) + (0x0.986184)]x1 ++ [(0x0.0138158) + (0x0.986184)]x1 = 1 +λ_Jn(f2) += [p(_jn0|f2,a1).π_Jn(a1) + p(_jn0|f2,a2).π_Jn(a2)].λ(_jn0) ++ [p(_jn1|f2,a1).π_Jn(a1) + p(_jn1|f2,a2).π_Jn(a2)].λ(_jn1) ++ [p(_jn2|f2,a1).π_Jn(a1) + p(_jn2|f2,a2).π_Jn(a2)].λ(_jn2) ++ [p(_jn3|f2,a1).π_Jn(a1) + p(_jn3|f2,a2).π_Jn(a2)].λ(_jn3) += [(0x0.0138158) + (0x0.986184)]x1 ++ [(0x0.0138158) + (0x0.986184)]x1 ++ [(1x0.0138158) + (0x0.986184)]x1 ++ [(0x0.0138158) + (1x0.986184)]x1 = 1 + +λ message _Jn --> Alarm +λ_Jn(a1) += [p(_jn0|f1,a1).π_Jn(f1) + p(_jn0|f2,a1).π_Jn(f2)].λ(_jn0) ++ [p(_jn1|f1,a1).π_Jn(f1) + p(_jn1|f2,a1).π_Jn(f2)].λ(_jn1) ++ [p(_jn2|f1,a1).π_Jn(f1) + p(_jn2|f2,a1).π_Jn(f2)].λ(_jn2) ++ [p(_jn3|f1,a1).π_Jn(f1) + p(_jn3|f2,a1).π_Jn(f2)].λ(_jn3) += [(1x0.03) + (0x0.97)]x1 ++ [(0x0.03) + (0x0.97)]x1 ++ [(0x0.03) + (1x0.97)]x1 ++ [(0x0.03) + (0x0.97)]x1 = 1 +λ_Jn(a2) += [p(_jn0|f1,a2).π_Jn(f1) + p(_jn0|f2,a2).π_Jn(f2)].λ(_jn0) ++ [p(_jn1|f1,a2).π_Jn(f1) + p(_jn1|f2,a2).π_Jn(f2)].λ(_jn1) ++ [p(_jn2|f1,a2).π_Jn(f1) + p(_jn2|f2,a2).π_Jn(f2)].λ(_jn2) ++ [p(_jn3|f1,a2).π_Jn(f1) + p(_jn3|f2,a2).π_Jn(f2)].λ(_jn3) += [(0x0.03) + (0x0.97)]x1 ++ [(1x0.03) + (0x0.97)]x1 ++ [(0x0.03) + (0x0.97)]x1 ++ [(0x0.03) + (1x0.97)]x1 = 1 + +π message Burglar --> Alarm +πAlarm(b1) = π(b1) = 0.005 = 0.005 +πAlarm(b2) = π(b2) = 0.995 = 0.995 + +π message FreightTruck --> Alarm +πAlarm(f1) = π(f1).λ_Jn(f1) = 0.03 x 0.5 = 0.015 +πAlarm(f2) = π(f2).λ_Jn(f2) = 0.97 x 0.5 = 0.485 + +π message FreightTruck --> _Jn +π_Jn(f1) = π(f1).λAlarm(f1) = 0.03 x 0.5 = 0.015 +π_Jn(f2) = π(f2).λAlarm(f2) = 0.97 x 0.5 = 0.485 + +π message Alarm --> _Jn +π_Jn(a1) = π(a1) = 0.0138158 = 0.01381575 +π_Jn(a2) = π(a2) = 0.986184 = 0.98618425 + +var Burglar: +π(b1) += p(b1) += (0.005) = 0.005 +π(b2) += p(b2) += (0.995) = 0.995 +λ(b1) = λAlarm(b1) = 0.5 = 0.5 +λ(b2) = λAlarm(b2) = 0.5 = 0.5 +belief change = 0 + +var FreightTruck: +π(f1) += p(f1) += (0.03) = 0.03 +π(f2) += p(f2) += (0.97) = 0.97 +λ(f1) = λAlarm(f1).λ_Jn(f1) = 0.5 x 0.5 = 0.25 +λ(f2) = λAlarm(f2).λ_Jn(f2) = 0.5 x 0.5 = 0.25 +belief change = 0 + +var Alarm: +π(a1) += p(a1|b1,f1).πAlarm(b1).πAlarm(f1) ++ p(a1|b1,f2).πAlarm(b1).πAlarm(f2) ++ p(a1|b2,f1).πAlarm(b2).πAlarm(f1) ++ p(a1|b2,f2).πAlarm(b2).πAlarm(f2) += (0.992x0.005x0.03) ++ (0.99x0.005x0.97) ++ (0.2x0.995x0.03) ++ (0.003x0.995x0.97) = 0.01381575 +π(a2) += p(a2|b1,f1).πAlarm(b1).πAlarm(f1) ++ p(a2|b1,f2).πAlarm(b1).πAlarm(f2) ++ p(a2|b2,f1).πAlarm(b2).πAlarm(f1) ++ p(a2|b2,f2).πAlarm(b2).πAlarm(f2) += (0.008x0.005x0.03) ++ (0.01x0.005x0.97) ++ (0.8x0.995x0.03) ++ (0.997x0.995x0.97) = 0.98618425 +λ(a1) = λ_Jn(a1) = 0.5 = 0.5 +λ(a2) = λ_Jn(a2) = 0.5 = 0.5 +belief change = 8.170547572e-16 + +var _Jn: +π(_jn0) += p(_jn0|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn0|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn0|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn0|f2,a2).π_Jn(f2).π_Jn(a2) += (1x0.03x0.0138158) ++ (0x0.03x0.986184) ++ (0x0.97x0.0138158) ++ (0x0.97x0.986184) = 0.0004144725 +π(_jn1) += p(_jn1|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn1|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn1|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn1|f2,a2).π_Jn(f2).π_Jn(a2) += (0x0.03x0.0138158) ++ (1x0.03x0.986184) ++ (0x0.97x0.0138158) ++ (0x0.97x0.986184) = 0.0295855275 +π(_jn2) += p(_jn2|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn2|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn2|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn2|f2,a2).π_Jn(f2).π_Jn(a2) += (0x0.03x0.0138158) ++ (0x0.03x0.986184) ++ (1x0.97x0.0138158) ++ (0x0.97x0.986184) = 0.0134012775 +π(_jn3) += p(_jn3|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn3|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn3|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn3|f2,a2).π_Jn(f2).π_Jn(a2) += (0x0.03x0.0138158) ++ (0x0.03x0.986184) ++ (0x0.97x0.0138158) ++ (1x0.97x0.986184) = 0.9565987225 +λ(_jn0) = 1 +λ(_jn1) = 1 +λ(_jn2) = 1 +λ(_jn3) = 1 +belief change = 5.989729112e-15 + +domain π(Burglar) λ(Burglar) belief +---------------------------------------------------------------- +b1 0.005 0.5 0.005 +b2 0.995 0.5 0.995 + +domain πAlarm(Burglar) λAlarm(Burglar) +---------------------------------------------------------------- +b1 0.005 0.5 +b2 0.995 0.5 + +domain π(FreightTruck) λ(FreightTruck) belief +---------------------------------------------------------------- +f1 0.03 0.25 0.03 +f2 0.97 0.25 0.97 + +domain πAlarm(FreightTruck) λAlarm(FreightTruck) +---------------------------------------------------------------- +f1 0.03 0.5 +f2 0.97 0.5 + +domain π_Jn(FreightTruck) λ_Jn(FreightTruck) +---------------------------------------------------------------- +f1 0.03 0.5 +f2 0.97 0.5 + +domain π(Alarm) λ(Alarm) belief +---------------------------------------------------------------- +a1 0.01381575 0.5 0.01381575 +a2 0.98618425 0.5 0.98618425 + +domain π_Jn(Alarm) λ_Jn(Alarm) +---------------------------------------------------------------- +a1 0.01381575 0.5 +a2 0.98618425 0.5 + +domain π(_Jn) λ(_Jn) belief +---------------------------------------------------------------- +_jn0 0.0004144725 1 0.0004144725 +_jn1 0.0295855275 1 0.0295855275 +_jn2 0.0134012775 1 0.0134012775 +_jn3 0.9565987225 1 0.9565987225 + + + +******************************************************************************** + Iteration 81 +******************************************************************************** +λ message Alarm --> Burglar +λAlarm(b1) += [p(a1|b1,f1).πAlarm(f1) + p(a1|b1,f2).πAlarm(f2)].λ(a1) ++ [p(a2|b1,f1).πAlarm(f1) + p(a2|b1,f2).πAlarm(f2)].λ(a2) += [(0.992x0.03) + (0.99x0.97)]x0.5 ++ [(0.008x0.03) + (0.01x0.97)]x0.5 = 0.5 +λAlarm(b2) += [p(a1|b2,f1).πAlarm(f1) + p(a1|b2,f2).πAlarm(f2)].λ(a1) ++ [p(a2|b2,f1).πAlarm(f1) + p(a2|b2,f2).πAlarm(f2)].λ(a2) += [(0.2x0.03) + (0.003x0.97)]x0.5 ++ [(0.8x0.03) + (0.997x0.97)]x0.5 = 0.5 + +λ message Alarm --> FreightTruck +λAlarm(f1) += [p(a1|b1,f1).πAlarm(b1) + p(a1|b2,f1).πAlarm(b2)].λ(a1) ++ [p(a2|b1,f1).πAlarm(b1) + p(a2|b2,f1).πAlarm(b2)].λ(a2) += [(0.992x0.005) + (0.2x0.995)]x0.5 ++ [(0.008x0.005) + (0.8x0.995)]x0.5 = 0.5 +λAlarm(f2) += [p(a1|b1,f2).πAlarm(b1) + p(a1|b2,f2).πAlarm(b2)].λ(a1) ++ [p(a2|b1,f2).πAlarm(b1) + p(a2|b2,f2).πAlarm(b2)].λ(a2) += [(0.99x0.005) + (0.003x0.995)]x0.5 ++ [(0.01x0.005) + (0.997x0.995)]x0.5 = 0.5 + +λ message _Jn --> FreightTruck +λ_Jn(f1) += [p(_jn0|f1,a1).π_Jn(a1) + p(_jn0|f1,a2).π_Jn(a2)].λ(_jn0) ++ [p(_jn1|f1,a1).π_Jn(a1) + p(_jn1|f1,a2).π_Jn(a2)].λ(_jn1) ++ [p(_jn2|f1,a1).π_Jn(a1) + p(_jn2|f1,a2).π_Jn(a2)].λ(_jn2) ++ [p(_jn3|f1,a1).π_Jn(a1) + p(_jn3|f1,a2).π_Jn(a2)].λ(_jn3) += [(1x0.0138158) + (0x0.986184)]x1 ++ [(0x0.0138158) + (1x0.986184)]x1 ++ [(0x0.0138158) + (0x0.986184)]x1 ++ [(0x0.0138158) + (0x0.986184)]x1 = 1 +λ_Jn(f2) += [p(_jn0|f2,a1).π_Jn(a1) + p(_jn0|f2,a2).π_Jn(a2)].λ(_jn0) ++ [p(_jn1|f2,a1).π_Jn(a1) + p(_jn1|f2,a2).π_Jn(a2)].λ(_jn1) ++ [p(_jn2|f2,a1).π_Jn(a1) + p(_jn2|f2,a2).π_Jn(a2)].λ(_jn2) ++ [p(_jn3|f2,a1).π_Jn(a1) + p(_jn3|f2,a2).π_Jn(a2)].λ(_jn3) += [(0x0.0138158) + (0x0.986184)]x1 ++ [(0x0.0138158) + (0x0.986184)]x1 ++ [(1x0.0138158) + (0x0.986184)]x1 ++ [(0x0.0138158) + (1x0.986184)]x1 = 1 + +λ message _Jn --> Alarm +λ_Jn(a1) += [p(_jn0|f1,a1).π_Jn(f1) + p(_jn0|f2,a1).π_Jn(f2)].λ(_jn0) ++ [p(_jn1|f1,a1).π_Jn(f1) + p(_jn1|f2,a1).π_Jn(f2)].λ(_jn1) ++ [p(_jn2|f1,a1).π_Jn(f1) + p(_jn2|f2,a1).π_Jn(f2)].λ(_jn2) ++ [p(_jn3|f1,a1).π_Jn(f1) + p(_jn3|f2,a1).π_Jn(f2)].λ(_jn3) += [(1x0.03) + (0x0.97)]x1 ++ [(0x0.03) + (0x0.97)]x1 ++ [(0x0.03) + (1x0.97)]x1 ++ [(0x0.03) + (0x0.97)]x1 = 1 +λ_Jn(a2) += [p(_jn0|f1,a2).π_Jn(f1) + p(_jn0|f2,a2).π_Jn(f2)].λ(_jn0) ++ [p(_jn1|f1,a2).π_Jn(f1) + p(_jn1|f2,a2).π_Jn(f2)].λ(_jn1) ++ [p(_jn2|f1,a2).π_Jn(f1) + p(_jn2|f2,a2).π_Jn(f2)].λ(_jn2) ++ [p(_jn3|f1,a2).π_Jn(f1) + p(_jn3|f2,a2).π_Jn(f2)].λ(_jn3) += [(0x0.03) + (0x0.97)]x1 ++ [(1x0.03) + (0x0.97)]x1 ++ [(0x0.03) + (0x0.97)]x1 ++ [(0x0.03) + (1x0.97)]x1 = 1 + +π message Burglar --> Alarm +πAlarm(b1) = π(b1) = 0.005 = 0.005 +πAlarm(b2) = π(b2) = 0.995 = 0.995 + +π message FreightTruck --> Alarm +πAlarm(f1) = π(f1).λ_Jn(f1) = 0.03 x 0.5 = 0.015 +πAlarm(f2) = π(f2).λ_Jn(f2) = 0.97 x 0.5 = 0.485 + +π message FreightTruck --> _Jn +π_Jn(f1) = π(f1).λAlarm(f1) = 0.03 x 0.5 = 0.015 +π_Jn(f2) = π(f2).λAlarm(f2) = 0.97 x 0.5 = 0.485 + +π message Alarm --> _Jn +π_Jn(a1) = π(a1) = 0.0138158 = 0.01381575 +π_Jn(a2) = π(a2) = 0.986184 = 0.98618425 + +var Burglar: +π(b1) += p(b1) += (0.005) = 0.005 +π(b2) += p(b2) += (0.995) = 0.995 +λ(b1) = λAlarm(b1) = 0.5 = 0.5 +λ(b2) = λAlarm(b2) = 0.5 = 0.5 +belief change = 0 + +var FreightTruck: +π(f1) += p(f1) += (0.03) = 0.03 +π(f2) += p(f2) += (0.97) = 0.97 +λ(f1) = λAlarm(f1).λ_Jn(f1) = 0.5 x 0.5 = 0.25 +λ(f2) = λAlarm(f2).λ_Jn(f2) = 0.5 x 0.5 = 0.25 +belief change = 0 + +var Alarm: +π(a1) += p(a1|b1,f1).πAlarm(b1).πAlarm(f1) ++ p(a1|b1,f2).πAlarm(b1).πAlarm(f2) ++ p(a1|b2,f1).πAlarm(b2).πAlarm(f1) ++ p(a1|b2,f2).πAlarm(b2).πAlarm(f2) += (0.992x0.005x0.03) ++ (0.99x0.005x0.97) ++ (0.2x0.995x0.03) ++ (0.003x0.995x0.97) = 0.01381575 +π(a2) += p(a2|b1,f1).πAlarm(b1).πAlarm(f1) ++ p(a2|b1,f2).πAlarm(b1).πAlarm(f2) ++ p(a2|b2,f1).πAlarm(b2).πAlarm(f1) ++ p(a2|b2,f2).πAlarm(b2).πAlarm(f2) += (0.008x0.005x0.03) ++ (0.01x0.005x0.97) ++ (0.8x0.995x0.03) ++ (0.997x0.995x0.97) = 0.98618425 +λ(a1) = λ_Jn(a1) = 0.5 = 0.5 +λ(a2) = λ_Jn(a2) = 0.5 = 0.5 +belief change = 5.846018114e-16 + +var _Jn: +π(_jn0) += p(_jn0|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn0|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn0|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn0|f2,a2).π_Jn(f2).π_Jn(a2) += (1x0.03x0.0138158) ++ (0x0.03x0.986184) ++ (0x0.97x0.0138158) ++ (0x0.97x0.986184) = 0.0004144725 +π(_jn1) += p(_jn1|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn1|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn1|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn1|f2,a2).π_Jn(f2).π_Jn(a2) += (0x0.03x0.0138158) ++ (1x0.03x0.986184) ++ (0x0.97x0.0138158) ++ (0x0.97x0.986184) = 0.0295855275 +π(_jn2) += p(_jn2|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn2|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn2|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn2|f2,a2).π_Jn(f2).π_Jn(a2) += (0x0.03x0.0138158) ++ (0x0.03x0.986184) ++ (1x0.97x0.0138158) ++ (0x0.97x0.986184) = 0.0134012775 +π(_jn3) += p(_jn3|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn3|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn3|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn3|f2,a2).π_Jn(f2).π_Jn(a2) += (0x0.03x0.0138158) ++ (0x0.03x0.986184) ++ (0x0.97x0.0138158) ++ (1x0.97x0.986184) = 0.9565987225 +λ(_jn0) = 1 +λ(_jn1) = 1 +λ(_jn2) = 1 +λ(_jn3) = 1 +belief change = 3.880955887e-15 + +domain π(Burglar) λ(Burglar) belief +---------------------------------------------------------------- +b1 0.005 0.5 0.005 +b2 0.995 0.5 0.995 + +domain πAlarm(Burglar) λAlarm(Burglar) +---------------------------------------------------------------- +b1 0.005 0.5 +b2 0.995 0.5 + +domain π(FreightTruck) λ(FreightTruck) belief +---------------------------------------------------------------- +f1 0.03 0.25 0.03 +f2 0.97 0.25 0.97 + +domain πAlarm(FreightTruck) λAlarm(FreightTruck) +---------------------------------------------------------------- +f1 0.03 0.5 +f2 0.97 0.5 + +domain π_Jn(FreightTruck) λ_Jn(FreightTruck) +---------------------------------------------------------------- +f1 0.03 0.5 +f2 0.97 0.5 + +domain π(Alarm) λ(Alarm) belief +---------------------------------------------------------------- +a1 0.01381575 0.5 0.01381575 +a2 0.98618425 0.5 0.98618425 + +domain π_Jn(Alarm) λ_Jn(Alarm) +---------------------------------------------------------------- +a1 0.01381575 0.5 +a2 0.98618425 0.5 + +domain π(_Jn) λ(_Jn) belief +---------------------------------------------------------------- +_jn0 0.0004144725 1 0.0004144725 +_jn1 0.0295855275 1 0.0295855275 +_jn2 0.0134012775 1 0.0134012775 +_jn3 0.9565987225 1 0.9565987225 + + + +******************************************************************************** + Iteration 82 +******************************************************************************** +λ message Alarm --> Burglar +λAlarm(b1) += [p(a1|b1,f1).πAlarm(f1) + p(a1|b1,f2).πAlarm(f2)].λ(a1) ++ [p(a2|b1,f1).πAlarm(f1) + p(a2|b1,f2).πAlarm(f2)].λ(a2) += [(0.992x0.03) + (0.99x0.97)]x0.5 ++ [(0.008x0.03) + (0.01x0.97)]x0.5 = 0.5 +λAlarm(b2) += [p(a1|b2,f1).πAlarm(f1) + p(a1|b2,f2).πAlarm(f2)].λ(a1) ++ [p(a2|b2,f1).πAlarm(f1) + p(a2|b2,f2).πAlarm(f2)].λ(a2) += [(0.2x0.03) + (0.003x0.97)]x0.5 ++ [(0.8x0.03) + (0.997x0.97)]x0.5 = 0.5 + +λ message Alarm --> FreightTruck +λAlarm(f1) += [p(a1|b1,f1).πAlarm(b1) + p(a1|b2,f1).πAlarm(b2)].λ(a1) ++ [p(a2|b1,f1).πAlarm(b1) + p(a2|b2,f1).πAlarm(b2)].λ(a2) += [(0.992x0.005) + (0.2x0.995)]x0.5 ++ [(0.008x0.005) + (0.8x0.995)]x0.5 = 0.5 +λAlarm(f2) += [p(a1|b1,f2).πAlarm(b1) + p(a1|b2,f2).πAlarm(b2)].λ(a1) ++ [p(a2|b1,f2).πAlarm(b1) + p(a2|b2,f2).πAlarm(b2)].λ(a2) += [(0.99x0.005) + (0.003x0.995)]x0.5 ++ [(0.01x0.005) + (0.997x0.995)]x0.5 = 0.5 + +λ message _Jn --> FreightTruck +λ_Jn(f1) += [p(_jn0|f1,a1).π_Jn(a1) + p(_jn0|f1,a2).π_Jn(a2)].λ(_jn0) ++ [p(_jn1|f1,a1).π_Jn(a1) + p(_jn1|f1,a2).π_Jn(a2)].λ(_jn1) ++ [p(_jn2|f1,a1).π_Jn(a1) + p(_jn2|f1,a2).π_Jn(a2)].λ(_jn2) ++ [p(_jn3|f1,a1).π_Jn(a1) + p(_jn3|f1,a2).π_Jn(a2)].λ(_jn3) += [(1x0.0138158) + (0x0.986184)]x1 ++ [(0x0.0138158) + (1x0.986184)]x1 ++ [(0x0.0138158) + (0x0.986184)]x1 ++ [(0x0.0138158) + (0x0.986184)]x1 = 1 +λ_Jn(f2) += [p(_jn0|f2,a1).π_Jn(a1) + p(_jn0|f2,a2).π_Jn(a2)].λ(_jn0) ++ [p(_jn1|f2,a1).π_Jn(a1) + p(_jn1|f2,a2).π_Jn(a2)].λ(_jn1) ++ [p(_jn2|f2,a1).π_Jn(a1) + p(_jn2|f2,a2).π_Jn(a2)].λ(_jn2) ++ [p(_jn3|f2,a1).π_Jn(a1) + p(_jn3|f2,a2).π_Jn(a2)].λ(_jn3) += [(0x0.0138158) + (0x0.986184)]x1 ++ [(0x0.0138158) + (0x0.986184)]x1 ++ [(1x0.0138158) + (0x0.986184)]x1 ++ [(0x0.0138158) + (1x0.986184)]x1 = 1 + +λ message _Jn --> Alarm +λ_Jn(a1) += [p(_jn0|f1,a1).π_Jn(f1) + p(_jn0|f2,a1).π_Jn(f2)].λ(_jn0) ++ [p(_jn1|f1,a1).π_Jn(f1) + p(_jn1|f2,a1).π_Jn(f2)].λ(_jn1) ++ [p(_jn2|f1,a1).π_Jn(f1) + p(_jn2|f2,a1).π_Jn(f2)].λ(_jn2) ++ [p(_jn3|f1,a1).π_Jn(f1) + p(_jn3|f2,a1).π_Jn(f2)].λ(_jn3) += [(1x0.03) + (0x0.97)]x1 ++ [(0x0.03) + (0x0.97)]x1 ++ [(0x0.03) + (1x0.97)]x1 ++ [(0x0.03) + (0x0.97)]x1 = 1 +λ_Jn(a2) += [p(_jn0|f1,a2).π_Jn(f1) + p(_jn0|f2,a2).π_Jn(f2)].λ(_jn0) ++ [p(_jn1|f1,a2).π_Jn(f1) + p(_jn1|f2,a2).π_Jn(f2)].λ(_jn1) ++ [p(_jn2|f1,a2).π_Jn(f1) + p(_jn2|f2,a2).π_Jn(f2)].λ(_jn2) ++ [p(_jn3|f1,a2).π_Jn(f1) + p(_jn3|f2,a2).π_Jn(f2)].λ(_jn3) += [(0x0.03) + (0x0.97)]x1 ++ [(1x0.03) + (0x0.97)]x1 ++ [(0x0.03) + (0x0.97)]x1 ++ [(0x0.03) + (1x0.97)]x1 = 1 + +π message Burglar --> Alarm +πAlarm(b1) = π(b1) = 0.005 = 0.005 +πAlarm(b2) = π(b2) = 0.995 = 0.995 + +π message FreightTruck --> Alarm +πAlarm(f1) = π(f1).λ_Jn(f1) = 0.03 x 0.5 = 0.015 +πAlarm(f2) = π(f2).λ_Jn(f2) = 0.97 x 0.5 = 0.485 + +π message FreightTruck --> _Jn +π_Jn(f1) = π(f1).λAlarm(f1) = 0.03 x 0.5 = 0.015 +π_Jn(f2) = π(f2).λAlarm(f2) = 0.97 x 0.5 = 0.485 + +π message Alarm --> _Jn +π_Jn(a1) = π(a1) = 0.0138158 = 0.01381575 +π_Jn(a2) = π(a2) = 0.986184 = 0.98618425 + +var Burglar: +π(b1) += p(b1) += (0.005) = 0.005 +π(b2) += p(b2) += (0.995) = 0.995 +λ(b1) = λAlarm(b1) = 0.5 = 0.5 +λ(b2) = λAlarm(b2) = 0.5 = 0.5 +belief change = 0 + +var FreightTruck: +π(f1) += p(f1) += (0.03) = 0.03 +π(f2) += p(f2) += (0.97) = 0.97 +λ(f1) = λAlarm(f1).λ_Jn(f1) = 0.5 x 0.5 = 0.25 +λ(f2) = λAlarm(f2).λ_Jn(f2) = 0.5 x 0.5 = 0.25 +belief change = 0 + +var Alarm: +π(a1) += p(a1|b1,f1).πAlarm(b1).πAlarm(f1) ++ p(a1|b1,f2).πAlarm(b1).πAlarm(f2) ++ p(a1|b2,f1).πAlarm(b2).πAlarm(f1) ++ p(a1|b2,f2).πAlarm(b2).πAlarm(f2) += (0.992x0.005x0.03) ++ (0.99x0.005x0.97) ++ (0.2x0.995x0.03) ++ (0.003x0.995x0.97) = 0.01381575 +π(a2) += p(a2|b1,f1).πAlarm(b1).πAlarm(f1) ++ p(a2|b1,f2).πAlarm(b1).πAlarm(f2) ++ p(a2|b2,f1).πAlarm(b2).πAlarm(f1) ++ p(a2|b2,f2).πAlarm(b2).πAlarm(f2) += (0.008x0.005x0.03) ++ (0.01x0.005x0.97) ++ (0.8x0.995x0.03) ++ (0.997x0.995x0.97) = 0.98618425 +λ(a1) = λ_Jn(a1) = 0.5 = 0.5 +λ(a2) = λ_Jn(a2) = 0.5 = 0.5 +belief change = 2.775557562e-16 + +var _Jn: +π(_jn0) += p(_jn0|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn0|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn0|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn0|f2,a2).π_Jn(f2).π_Jn(a2) += (1x0.03x0.0138158) ++ (0x0.03x0.986184) ++ (0x0.97x0.0138158) ++ (0x0.97x0.986184) = 0.0004144725 +π(_jn1) += p(_jn1|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn1|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn1|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn1|f2,a2).π_Jn(f2).π_Jn(a2) += (0x0.03x0.0138158) ++ (1x0.03x0.986184) ++ (0x0.97x0.0138158) ++ (0x0.97x0.986184) = 0.0295855275 +π(_jn2) += p(_jn2|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn2|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn2|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn2|f2,a2).π_Jn(f2).π_Jn(a2) += (0x0.03x0.0138158) ++ (0x0.03x0.986184) ++ (1x0.97x0.0138158) ++ (0x0.97x0.986184) = 0.0134012775 +π(_jn3) += p(_jn3|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn3|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn3|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn3|f2,a2).π_Jn(f2).π_Jn(a2) += (0x0.03x0.0138158) ++ (0x0.03x0.986184) ++ (0x0.97x0.0138158) ++ (1x0.97x0.986184) = 0.9565987225 +λ(_jn0) = 1 +λ(_jn1) = 1 +λ(_jn2) = 1 +λ(_jn3) = 1 +belief change = 2.665402621e-15 + +domain π(Burglar) λ(Burglar) belief +---------------------------------------------------------------- +b1 0.005 0.5 0.005 +b2 0.995 0.5 0.995 + +domain πAlarm(Burglar) λAlarm(Burglar) +---------------------------------------------------------------- +b1 0.005 0.5 +b2 0.995 0.5 + +domain π(FreightTruck) λ(FreightTruck) belief +---------------------------------------------------------------- +f1 0.03 0.25 0.03 +f2 0.97 0.25 0.97 + +domain πAlarm(FreightTruck) λAlarm(FreightTruck) +---------------------------------------------------------------- +f1 0.03 0.5 +f2 0.97 0.5 + +domain π_Jn(FreightTruck) λ_Jn(FreightTruck) +---------------------------------------------------------------- +f1 0.03 0.5 +f2 0.97 0.5 + +domain π(Alarm) λ(Alarm) belief +---------------------------------------------------------------- +a1 0.01381575 0.5 0.01381575 +a2 0.98618425 0.5 0.98618425 + +domain π_Jn(Alarm) λ_Jn(Alarm) +---------------------------------------------------------------- +a1 0.01381575 0.5 +a2 0.98618425 0.5 + +domain π(_Jn) λ(_Jn) belief +---------------------------------------------------------------- +_jn0 0.0004144725 1 0.0004144725 +_jn1 0.0295855275 1 0.0295855275 +_jn2 0.0134012775 1 0.0134012775 +_jn3 0.9565987225 1 0.9565987225 + + + +******************************************************************************** + Iteration 83 +******************************************************************************** +λ message Alarm --> Burglar +λAlarm(b1) += [p(a1|b1,f1).πAlarm(f1) + p(a1|b1,f2).πAlarm(f2)].λ(a1) ++ [p(a2|b1,f1).πAlarm(f1) + p(a2|b1,f2).πAlarm(f2)].λ(a2) += [(0.992x0.03) + (0.99x0.97)]x0.5 ++ [(0.008x0.03) + (0.01x0.97)]x0.5 = 0.5 +λAlarm(b2) += [p(a1|b2,f1).πAlarm(f1) + p(a1|b2,f2).πAlarm(f2)].λ(a1) ++ [p(a2|b2,f1).πAlarm(f1) + p(a2|b2,f2).πAlarm(f2)].λ(a2) += [(0.2x0.03) + (0.003x0.97)]x0.5 ++ [(0.8x0.03) + (0.997x0.97)]x0.5 = 0.5 + +λ message Alarm --> FreightTruck +λAlarm(f1) += [p(a1|b1,f1).πAlarm(b1) + p(a1|b2,f1).πAlarm(b2)].λ(a1) ++ [p(a2|b1,f1).πAlarm(b1) + p(a2|b2,f1).πAlarm(b2)].λ(a2) += [(0.992x0.005) + (0.2x0.995)]x0.5 ++ [(0.008x0.005) + (0.8x0.995)]x0.5 = 0.5 +λAlarm(f2) += [p(a1|b1,f2).πAlarm(b1) + p(a1|b2,f2).πAlarm(b2)].λ(a1) ++ [p(a2|b1,f2).πAlarm(b1) + p(a2|b2,f2).πAlarm(b2)].λ(a2) += [(0.99x0.005) + (0.003x0.995)]x0.5 ++ [(0.01x0.005) + (0.997x0.995)]x0.5 = 0.5 + +λ message _Jn --> FreightTruck +λ_Jn(f1) += [p(_jn0|f1,a1).π_Jn(a1) + p(_jn0|f1,a2).π_Jn(a2)].λ(_jn0) ++ [p(_jn1|f1,a1).π_Jn(a1) + p(_jn1|f1,a2).π_Jn(a2)].λ(_jn1) ++ [p(_jn2|f1,a1).π_Jn(a1) + p(_jn2|f1,a2).π_Jn(a2)].λ(_jn2) ++ [p(_jn3|f1,a1).π_Jn(a1) + p(_jn3|f1,a2).π_Jn(a2)].λ(_jn3) += [(1x0.0138158) + (0x0.986184)]x1 ++ [(0x0.0138158) + (1x0.986184)]x1 ++ [(0x0.0138158) + (0x0.986184)]x1 ++ [(0x0.0138158) + (0x0.986184)]x1 = 1 +λ_Jn(f2) += [p(_jn0|f2,a1).π_Jn(a1) + p(_jn0|f2,a2).π_Jn(a2)].λ(_jn0) ++ [p(_jn1|f2,a1).π_Jn(a1) + p(_jn1|f2,a2).π_Jn(a2)].λ(_jn1) ++ [p(_jn2|f2,a1).π_Jn(a1) + p(_jn2|f2,a2).π_Jn(a2)].λ(_jn2) ++ [p(_jn3|f2,a1).π_Jn(a1) + p(_jn3|f2,a2).π_Jn(a2)].λ(_jn3) += [(0x0.0138158) + (0x0.986184)]x1 ++ [(0x0.0138158) + (0x0.986184)]x1 ++ [(1x0.0138158) + (0x0.986184)]x1 ++ [(0x0.0138158) + (1x0.986184)]x1 = 1 + +λ message _Jn --> Alarm +λ_Jn(a1) += [p(_jn0|f1,a1).π_Jn(f1) + p(_jn0|f2,a1).π_Jn(f2)].λ(_jn0) ++ [p(_jn1|f1,a1).π_Jn(f1) + p(_jn1|f2,a1).π_Jn(f2)].λ(_jn1) ++ [p(_jn2|f1,a1).π_Jn(f1) + p(_jn2|f2,a1).π_Jn(f2)].λ(_jn2) ++ [p(_jn3|f1,a1).π_Jn(f1) + p(_jn3|f2,a1).π_Jn(f2)].λ(_jn3) += [(1x0.03) + (0x0.97)]x1 ++ [(0x0.03) + (0x0.97)]x1 ++ [(0x0.03) + (1x0.97)]x1 ++ [(0x0.03) + (0x0.97)]x1 = 1 +λ_Jn(a2) += [p(_jn0|f1,a2).π_Jn(f1) + p(_jn0|f2,a2).π_Jn(f2)].λ(_jn0) ++ [p(_jn1|f1,a2).π_Jn(f1) + p(_jn1|f2,a2).π_Jn(f2)].λ(_jn1) ++ [p(_jn2|f1,a2).π_Jn(f1) + p(_jn2|f2,a2).π_Jn(f2)].λ(_jn2) ++ [p(_jn3|f1,a2).π_Jn(f1) + p(_jn3|f2,a2).π_Jn(f2)].λ(_jn3) += [(0x0.03) + (0x0.97)]x1 ++ [(1x0.03) + (0x0.97)]x1 ++ [(0x0.03) + (0x0.97)]x1 ++ [(0x0.03) + (1x0.97)]x1 = 1 + +π message Burglar --> Alarm +πAlarm(b1) = π(b1) = 0.005 = 0.005 +πAlarm(b2) = π(b2) = 0.995 = 0.995 + +π message FreightTruck --> Alarm +πAlarm(f1) = π(f1).λ_Jn(f1) = 0.03 x 0.5 = 0.015 +πAlarm(f2) = π(f2).λ_Jn(f2) = 0.97 x 0.5 = 0.485 + +π message FreightTruck --> _Jn +π_Jn(f1) = π(f1).λAlarm(f1) = 0.03 x 0.5 = 0.015 +π_Jn(f2) = π(f2).λAlarm(f2) = 0.97 x 0.5 = 0.485 + +π message Alarm --> _Jn +π_Jn(a1) = π(a1) = 0.0138158 = 0.01381575 +π_Jn(a2) = π(a2) = 0.986184 = 0.98618425 + +var Burglar: +π(b1) += p(b1) += (0.005) = 0.005 +π(b2) += p(b2) += (0.995) = 0.995 +λ(b1) = λAlarm(b1) = 0.5 = 0.5 +λ(b2) = λAlarm(b2) = 0.5 = 0.5 +belief change = 0 + +var FreightTruck: +π(f1) += p(f1) += (0.03) = 0.03 +π(f2) += p(f2) += (0.97) = 0.97 +λ(f1) = λAlarm(f1).λ_Jn(f1) = 0.5 x 0.5 = 0.25 +λ(f2) = λAlarm(f2).λ_Jn(f2) = 0.5 x 0.5 = 0.25 +belief change = 0 + +var Alarm: +π(a1) += p(a1|b1,f1).πAlarm(b1).πAlarm(f1) ++ p(a1|b1,f2).πAlarm(b1).πAlarm(f2) ++ p(a1|b2,f1).πAlarm(b2).πAlarm(f1) ++ p(a1|b2,f2).πAlarm(b2).πAlarm(f2) += (0.992x0.005x0.03) ++ (0.99x0.005x0.97) ++ (0.2x0.995x0.03) ++ (0.003x0.995x0.97) = 0.01381575 +π(a2) += p(a2|b1,f1).πAlarm(b1).πAlarm(f1) ++ p(a2|b1,f2).πAlarm(b1).πAlarm(f2) ++ p(a2|b2,f1).πAlarm(b2).πAlarm(f1) ++ p(a2|b2,f2).πAlarm(b2).πAlarm(f2) += (0.008x0.005x0.03) ++ (0.01x0.005x0.97) ++ (0.8x0.995x0.03) ++ (0.997x0.995x0.97) = 0.98618425 +λ(a1) = λ_Jn(a1) = 0.5 = 0.5 +λ(a2) = λ_Jn(a2) = 0.5 = 0.5 +belief change = 2.237793284e-16 + +var _Jn: +π(_jn0) += p(_jn0|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn0|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn0|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn0|f2,a2).π_Jn(f2).π_Jn(a2) += (1x0.03x0.0138158) ++ (0x0.03x0.986184) ++ (0x0.97x0.0138158) ++ (0x0.97x0.986184) = 0.0004144725 +π(_jn1) += p(_jn1|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn1|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn1|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn1|f2,a2).π_Jn(f2).π_Jn(a2) += (0x0.03x0.0138158) ++ (1x0.03x0.986184) ++ (0x0.97x0.0138158) ++ (0x0.97x0.986184) = 0.0295855275 +π(_jn2) += p(_jn2|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn2|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn2|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn2|f2,a2).π_Jn(f2).π_Jn(a2) += (0x0.03x0.0138158) ++ (0x0.03x0.986184) ++ (1x0.97x0.0138158) ++ (0x0.97x0.986184) = 0.0134012775 +π(_jn3) += p(_jn3|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn3|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn3|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn3|f2,a2).π_Jn(f2).π_Jn(a2) += (0x0.03x0.0138158) ++ (0x0.03x0.986184) ++ (0x0.97x0.0138158) ++ (1x0.97x0.986184) = 0.9565987225 +λ(_jn0) = 1 +λ(_jn1) = 1 +λ(_jn2) = 1 +λ(_jn3) = 1 +belief change = 1.776953151e-15 + +domain π(Burglar) λ(Burglar) belief +---------------------------------------------------------------- +b1 0.005 0.5 0.005 +b2 0.995 0.5 0.995 + +domain πAlarm(Burglar) λAlarm(Burglar) +---------------------------------------------------------------- +b1 0.005 0.5 +b2 0.995 0.5 + +domain π(FreightTruck) λ(FreightTruck) belief +---------------------------------------------------------------- +f1 0.03 0.25 0.03 +f2 0.97 0.25 0.97 + +domain πAlarm(FreightTruck) λAlarm(FreightTruck) +---------------------------------------------------------------- +f1 0.03 0.5 +f2 0.97 0.5 + +domain π_Jn(FreightTruck) λ_Jn(FreightTruck) +---------------------------------------------------------------- +f1 0.03 0.5 +f2 0.97 0.5 + +domain π(Alarm) λ(Alarm) belief +---------------------------------------------------------------- +a1 0.01381575 0.5 0.01381575 +a2 0.98618425 0.5 0.98618425 + +domain π_Jn(Alarm) λ_Jn(Alarm) +---------------------------------------------------------------- +a1 0.01381575 0.5 +a2 0.98618425 0.5 + +domain π(_Jn) λ(_Jn) belief +---------------------------------------------------------------- +_jn0 0.0004144725 1 0.0004144725 +_jn1 0.0295855275 1 0.0295855275 +_jn2 0.0134012775 1 0.0134012775 +_jn3 0.9565987225 1 0.9565987225 + + + +******************************************************************************** + Iteration 84 +******************************************************************************** +λ message Alarm --> Burglar +λAlarm(b1) += [p(a1|b1,f1).πAlarm(f1) + p(a1|b1,f2).πAlarm(f2)].λ(a1) ++ [p(a2|b1,f1).πAlarm(f1) + p(a2|b1,f2).πAlarm(f2)].λ(a2) += [(0.992x0.03) + (0.99x0.97)]x0.5 ++ [(0.008x0.03) + (0.01x0.97)]x0.5 = 0.5 +λAlarm(b2) += [p(a1|b2,f1).πAlarm(f1) + p(a1|b2,f2).πAlarm(f2)].λ(a1) ++ [p(a2|b2,f1).πAlarm(f1) + p(a2|b2,f2).πAlarm(f2)].λ(a2) += [(0.2x0.03) + (0.003x0.97)]x0.5 ++ [(0.8x0.03) + (0.997x0.97)]x0.5 = 0.5 + +λ message Alarm --> FreightTruck +λAlarm(f1) += [p(a1|b1,f1).πAlarm(b1) + p(a1|b2,f1).πAlarm(b2)].λ(a1) ++ [p(a2|b1,f1).πAlarm(b1) + p(a2|b2,f1).πAlarm(b2)].λ(a2) += [(0.992x0.005) + (0.2x0.995)]x0.5 ++ [(0.008x0.005) + (0.8x0.995)]x0.5 = 0.5 +λAlarm(f2) += [p(a1|b1,f2).πAlarm(b1) + p(a1|b2,f2).πAlarm(b2)].λ(a1) ++ [p(a2|b1,f2).πAlarm(b1) + p(a2|b2,f2).πAlarm(b2)].λ(a2) += [(0.99x0.005) + (0.003x0.995)]x0.5 ++ [(0.01x0.005) + (0.997x0.995)]x0.5 = 0.5 + +λ message _Jn --> FreightTruck +λ_Jn(f1) += [p(_jn0|f1,a1).π_Jn(a1) + p(_jn0|f1,a2).π_Jn(a2)].λ(_jn0) ++ [p(_jn1|f1,a1).π_Jn(a1) + p(_jn1|f1,a2).π_Jn(a2)].λ(_jn1) ++ [p(_jn2|f1,a1).π_Jn(a1) + p(_jn2|f1,a2).π_Jn(a2)].λ(_jn2) ++ [p(_jn3|f1,a1).π_Jn(a1) + p(_jn3|f1,a2).π_Jn(a2)].λ(_jn3) += [(1x0.0138158) + (0x0.986184)]x1 ++ [(0x0.0138158) + (1x0.986184)]x1 ++ [(0x0.0138158) + (0x0.986184)]x1 ++ [(0x0.0138158) + (0x0.986184)]x1 = 1 +λ_Jn(f2) += [p(_jn0|f2,a1).π_Jn(a1) + p(_jn0|f2,a2).π_Jn(a2)].λ(_jn0) ++ [p(_jn1|f2,a1).π_Jn(a1) + p(_jn1|f2,a2).π_Jn(a2)].λ(_jn1) ++ [p(_jn2|f2,a1).π_Jn(a1) + p(_jn2|f2,a2).π_Jn(a2)].λ(_jn2) ++ [p(_jn3|f2,a1).π_Jn(a1) + p(_jn3|f2,a2).π_Jn(a2)].λ(_jn3) += [(0x0.0138158) + (0x0.986184)]x1 ++ [(0x0.0138158) + (0x0.986184)]x1 ++ [(1x0.0138158) + (0x0.986184)]x1 ++ [(0x0.0138158) + (1x0.986184)]x1 = 1 + +λ message _Jn --> Alarm +λ_Jn(a1) += [p(_jn0|f1,a1).π_Jn(f1) + p(_jn0|f2,a1).π_Jn(f2)].λ(_jn0) ++ [p(_jn1|f1,a1).π_Jn(f1) + p(_jn1|f2,a1).π_Jn(f2)].λ(_jn1) ++ [p(_jn2|f1,a1).π_Jn(f1) + p(_jn2|f2,a1).π_Jn(f2)].λ(_jn2) ++ [p(_jn3|f1,a1).π_Jn(f1) + p(_jn3|f2,a1).π_Jn(f2)].λ(_jn3) += [(1x0.03) + (0x0.97)]x1 ++ [(0x0.03) + (0x0.97)]x1 ++ [(0x0.03) + (1x0.97)]x1 ++ [(0x0.03) + (0x0.97)]x1 = 1 +λ_Jn(a2) += [p(_jn0|f1,a2).π_Jn(f1) + p(_jn0|f2,a2).π_Jn(f2)].λ(_jn0) ++ [p(_jn1|f1,a2).π_Jn(f1) + p(_jn1|f2,a2).π_Jn(f2)].λ(_jn1) ++ [p(_jn2|f1,a2).π_Jn(f1) + p(_jn2|f2,a2).π_Jn(f2)].λ(_jn2) ++ [p(_jn3|f1,a2).π_Jn(f1) + p(_jn3|f2,a2).π_Jn(f2)].λ(_jn3) += [(0x0.03) + (0x0.97)]x1 ++ [(1x0.03) + (0x0.97)]x1 ++ [(0x0.03) + (0x0.97)]x1 ++ [(0x0.03) + (1x0.97)]x1 = 1 + +π message Burglar --> Alarm +πAlarm(b1) = π(b1) = 0.005 = 0.005 +πAlarm(b2) = π(b2) = 0.995 = 0.995 + +π message FreightTruck --> Alarm +πAlarm(f1) = π(f1).λ_Jn(f1) = 0.03 x 0.5 = 0.015 +πAlarm(f2) = π(f2).λ_Jn(f2) = 0.97 x 0.5 = 0.485 + +π message FreightTruck --> _Jn +π_Jn(f1) = π(f1).λAlarm(f1) = 0.03 x 0.5 = 0.015 +π_Jn(f2) = π(f2).λAlarm(f2) = 0.97 x 0.5 = 0.485 + +π message Alarm --> _Jn +π_Jn(a1) = π(a1) = 0.0138158 = 0.01381575 +π_Jn(a2) = π(a2) = 0.986184 = 0.98618425 + +var Burglar: +π(b1) += p(b1) += (0.005) = 0.005 +π(b2) += p(b2) += (0.995) = 0.995 +λ(b1) = λAlarm(b1) = 0.5 = 0.5 +λ(b2) = λAlarm(b2) = 0.5 = 0.5 +belief change = 0 + +var FreightTruck: +π(f1) += p(f1) += (0.03) = 0.03 +π(f2) += p(f2) += (0.97) = 0.97 +λ(f1) = λAlarm(f1).λ_Jn(f1) = 0.5 x 0.5 = 0.25 +λ(f2) = λAlarm(f2).λ_Jn(f2) = 0.5 x 0.5 = 0.25 +belief change = 0 + +var Alarm: +π(a1) += p(a1|b1,f1).πAlarm(b1).πAlarm(f1) ++ p(a1|b1,f2).πAlarm(b1).πAlarm(f2) ++ p(a1|b2,f1).πAlarm(b2).πAlarm(f1) ++ p(a1|b2,f2).πAlarm(b2).πAlarm(f2) += (0.992x0.005x0.03) ++ (0.99x0.005x0.97) ++ (0.2x0.995x0.03) ++ (0.003x0.995x0.97) = 0.01381575 +π(a2) += p(a2|b1,f1).πAlarm(b1).πAlarm(f1) ++ p(a2|b1,f2).πAlarm(b1).πAlarm(f2) ++ p(a2|b2,f1).πAlarm(b2).πAlarm(f1) ++ p(a2|b2,f2).πAlarm(b2).πAlarm(f2) += (0.008x0.005x0.03) ++ (0.01x0.005x0.97) ++ (0.8x0.995x0.03) ++ (0.997x0.995x0.97) = 0.98618425 +λ(a1) = λ_Jn(a1) = 0.5 = 0.5 +λ(a2) = λ_Jn(a2) = 0.5 = 0.5 +belief change = 1.856154119e-16 + +var _Jn: +π(_jn0) += p(_jn0|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn0|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn0|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn0|f2,a2).π_Jn(f2).π_Jn(a2) += (1x0.03x0.0138158) ++ (0x0.03x0.986184) ++ (0x0.97x0.0138158) ++ (0x0.97x0.986184) = 0.0004144725 +π(_jn1) += p(_jn1|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn1|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn1|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn1|f2,a2).π_Jn(f2).π_Jn(a2) += (0x0.03x0.0138158) ++ (1x0.03x0.986184) ++ (0x0.97x0.0138158) ++ (0x0.97x0.986184) = 0.0295855275 +π(_jn2) += p(_jn2|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn2|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn2|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn2|f2,a2).π_Jn(f2).π_Jn(a2) += (0x0.03x0.0138158) ++ (0x0.03x0.986184) ++ (1x0.97x0.0138158) ++ (0x0.97x0.986184) = 0.0134012775 +π(_jn3) += p(_jn3|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn3|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn3|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn3|f2,a2).π_Jn(f2).π_Jn(a2) += (0x0.03x0.0138158) ++ (0x0.03x0.986184) ++ (0x0.97x0.0138158) ++ (1x0.97x0.986184) = 0.9565987225 +λ(_jn0) = 1 +λ(_jn1) = 1 +λ(_jn2) = 1 +λ(_jn3) = 1 +belief change = 1.250464576e-15 + +domain π(Burglar) λ(Burglar) belief +---------------------------------------------------------------- +b1 0.005 0.5 0.005 +b2 0.995 0.5 0.995 + +domain πAlarm(Burglar) λAlarm(Burglar) +---------------------------------------------------------------- +b1 0.005 0.5 +b2 0.995 0.5 + +domain π(FreightTruck) λ(FreightTruck) belief +---------------------------------------------------------------- +f1 0.03 0.25 0.03 +f2 0.97 0.25 0.97 + +domain πAlarm(FreightTruck) λAlarm(FreightTruck) +---------------------------------------------------------------- +f1 0.03 0.5 +f2 0.97 0.5 + +domain π_Jn(FreightTruck) λ_Jn(FreightTruck) +---------------------------------------------------------------- +f1 0.03 0.5 +f2 0.97 0.5 + +domain π(Alarm) λ(Alarm) belief +---------------------------------------------------------------- +a1 0.01381575 0.5 0.01381575 +a2 0.98618425 0.5 0.98618425 + +domain π_Jn(Alarm) λ_Jn(Alarm) +---------------------------------------------------------------- +a1 0.01381575 0.5 +a2 0.98618425 0.5 + +domain π(_Jn) λ(_Jn) belief +---------------------------------------------------------------- +_jn0 0.0004144725 1 0.0004144725 +_jn1 0.0295855275 1 0.0295855275 +_jn2 0.0134012775 1 0.0134012775 +_jn3 0.9565987225 1 0.9565987225 + + + +******************************************************************************** + Iteration 85 +******************************************************************************** +λ message Alarm --> Burglar +λAlarm(b1) += [p(a1|b1,f1).πAlarm(f1) + p(a1|b1,f2).πAlarm(f2)].λ(a1) ++ [p(a2|b1,f1).πAlarm(f1) + p(a2|b1,f2).πAlarm(f2)].λ(a2) += [(0.992x0.03) + (0.99x0.97)]x0.5 ++ [(0.008x0.03) + (0.01x0.97)]x0.5 = 0.5 +λAlarm(b2) += [p(a1|b2,f1).πAlarm(f1) + p(a1|b2,f2).πAlarm(f2)].λ(a1) ++ [p(a2|b2,f1).πAlarm(f1) + p(a2|b2,f2).πAlarm(f2)].λ(a2) += [(0.2x0.03) + (0.003x0.97)]x0.5 ++ [(0.8x0.03) + (0.997x0.97)]x0.5 = 0.5 + +λ message Alarm --> FreightTruck +λAlarm(f1) += [p(a1|b1,f1).πAlarm(b1) + p(a1|b2,f1).πAlarm(b2)].λ(a1) ++ [p(a2|b1,f1).πAlarm(b1) + p(a2|b2,f1).πAlarm(b2)].λ(a2) += [(0.992x0.005) + (0.2x0.995)]x0.5 ++ [(0.008x0.005) + (0.8x0.995)]x0.5 = 0.5 +λAlarm(f2) += [p(a1|b1,f2).πAlarm(b1) + p(a1|b2,f2).πAlarm(b2)].λ(a1) ++ [p(a2|b1,f2).πAlarm(b1) + p(a2|b2,f2).πAlarm(b2)].λ(a2) += [(0.99x0.005) + (0.003x0.995)]x0.5 ++ [(0.01x0.005) + (0.997x0.995)]x0.5 = 0.5 + +λ message _Jn --> FreightTruck +λ_Jn(f1) += [p(_jn0|f1,a1).π_Jn(a1) + p(_jn0|f1,a2).π_Jn(a2)].λ(_jn0) ++ [p(_jn1|f1,a1).π_Jn(a1) + p(_jn1|f1,a2).π_Jn(a2)].λ(_jn1) ++ [p(_jn2|f1,a1).π_Jn(a1) + p(_jn2|f1,a2).π_Jn(a2)].λ(_jn2) ++ [p(_jn3|f1,a1).π_Jn(a1) + p(_jn3|f1,a2).π_Jn(a2)].λ(_jn3) += [(1x0.0138158) + (0x0.986184)]x1 ++ [(0x0.0138158) + (1x0.986184)]x1 ++ [(0x0.0138158) + (0x0.986184)]x1 ++ [(0x0.0138158) + (0x0.986184)]x1 = 1 +λ_Jn(f2) += [p(_jn0|f2,a1).π_Jn(a1) + p(_jn0|f2,a2).π_Jn(a2)].λ(_jn0) ++ [p(_jn1|f2,a1).π_Jn(a1) + p(_jn1|f2,a2).π_Jn(a2)].λ(_jn1) ++ [p(_jn2|f2,a1).π_Jn(a1) + p(_jn2|f2,a2).π_Jn(a2)].λ(_jn2) ++ [p(_jn3|f2,a1).π_Jn(a1) + p(_jn3|f2,a2).π_Jn(a2)].λ(_jn3) += [(0x0.0138158) + (0x0.986184)]x1 ++ [(0x0.0138158) + (0x0.986184)]x1 ++ [(1x0.0138158) + (0x0.986184)]x1 ++ [(0x0.0138158) + (1x0.986184)]x1 = 1 + +λ message _Jn --> Alarm +λ_Jn(a1) += [p(_jn0|f1,a1).π_Jn(f1) + p(_jn0|f2,a1).π_Jn(f2)].λ(_jn0) ++ [p(_jn1|f1,a1).π_Jn(f1) + p(_jn1|f2,a1).π_Jn(f2)].λ(_jn1) ++ [p(_jn2|f1,a1).π_Jn(f1) + p(_jn2|f2,a1).π_Jn(f2)].λ(_jn2) ++ [p(_jn3|f1,a1).π_Jn(f1) + p(_jn3|f2,a1).π_Jn(f2)].λ(_jn3) += [(1x0.03) + (0x0.97)]x1 ++ [(0x0.03) + (0x0.97)]x1 ++ [(0x0.03) + (1x0.97)]x1 ++ [(0x0.03) + (0x0.97)]x1 = 1 +λ_Jn(a2) += [p(_jn0|f1,a2).π_Jn(f1) + p(_jn0|f2,a2).π_Jn(f2)].λ(_jn0) ++ [p(_jn1|f1,a2).π_Jn(f1) + p(_jn1|f2,a2).π_Jn(f2)].λ(_jn1) ++ [p(_jn2|f1,a2).π_Jn(f1) + p(_jn2|f2,a2).π_Jn(f2)].λ(_jn2) ++ [p(_jn3|f1,a2).π_Jn(f1) + p(_jn3|f2,a2).π_Jn(f2)].λ(_jn3) += [(0x0.03) + (0x0.97)]x1 ++ [(1x0.03) + (0x0.97)]x1 ++ [(0x0.03) + (0x0.97)]x1 ++ [(0x0.03) + (1x0.97)]x1 = 1 + +π message Burglar --> Alarm +πAlarm(b1) = π(b1) = 0.005 = 0.005 +πAlarm(b2) = π(b2) = 0.995 = 0.995 + +π message FreightTruck --> Alarm +πAlarm(f1) = π(f1).λ_Jn(f1) = 0.03 x 0.5 = 0.015 +πAlarm(f2) = π(f2).λ_Jn(f2) = 0.97 x 0.5 = 0.485 + +π message FreightTruck --> _Jn +π_Jn(f1) = π(f1).λAlarm(f1) = 0.03 x 0.5 = 0.015 +π_Jn(f2) = π(f2).λAlarm(f2) = 0.97 x 0.5 = 0.485 + +π message Alarm --> _Jn +π_Jn(a1) = π(a1) = 0.0138158 = 0.01381575 +π_Jn(a2) = π(a2) = 0.986184 = 0.98618425 + +var Burglar: +π(b1) += p(b1) += (0.005) = 0.005 +π(b2) += p(b2) += (0.995) = 0.995 +λ(b1) = λAlarm(b1) = 0.5 = 0.5 +λ(b2) = λAlarm(b2) = 0.5 = 0.5 +belief change = 0 + +var FreightTruck: +π(f1) += p(f1) += (0.03) = 0.03 +π(f2) += p(f2) += (0.97) = 0.97 +λ(f1) = λAlarm(f1).λ_Jn(f1) = 0.5 x 0.5 = 0.25 +λ(f2) = λAlarm(f2).λ_Jn(f2) = 0.5 x 0.5 = 0.25 +belief change = 0 + +var Alarm: +π(a1) += p(a1|b1,f1).πAlarm(b1).πAlarm(f1) ++ p(a1|b1,f2).πAlarm(b1).πAlarm(f2) ++ p(a1|b2,f1).πAlarm(b2).πAlarm(f1) ++ p(a1|b2,f2).πAlarm(b2).πAlarm(f2) += (0.992x0.005x0.03) ++ (0.99x0.005x0.97) ++ (0.2x0.995x0.03) ++ (0.003x0.995x0.97) = 0.01381575 +π(a2) += p(a2|b1,f1).πAlarm(b1).πAlarm(f1) ++ p(a2|b1,f2).πAlarm(b1).πAlarm(f2) ++ p(a2|b2,f1).πAlarm(b2).πAlarm(f1) ++ p(a2|b2,f2).πAlarm(b2).πAlarm(f2) += (0.008x0.005x0.03) ++ (0.01x0.005x0.97) ++ (0.8x0.995x0.03) ++ (0.997x0.995x0.97) = 0.98618425 +λ(a1) = λ_Jn(a1) = 0.5 = 0.5 +λ(a2) = λ_Jn(a2) = 0.5 = 0.5 +belief change = 4.683753385e-17 + +var _Jn: +π(_jn0) += p(_jn0|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn0|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn0|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn0|f2,a2).π_Jn(f2).π_Jn(a2) += (1x0.03x0.0138158) ++ (0x0.03x0.986184) ++ (0x0.97x0.0138158) ++ (0x0.97x0.986184) = 0.0004144725 +π(_jn1) += p(_jn1|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn1|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn1|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn1|f2,a2).π_Jn(f2).π_Jn(a2) += (0x0.03x0.0138158) ++ (1x0.03x0.986184) ++ (0x0.97x0.0138158) ++ (0x0.97x0.986184) = 0.0295855275 +π(_jn2) += p(_jn2|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn2|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn2|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn2|f2,a2).π_Jn(f2).π_Jn(a2) += (0x0.03x0.0138158) ++ (0x0.03x0.986184) ++ (1x0.97x0.0138158) ++ (0x0.97x0.986184) = 0.0134012775 +π(_jn3) += p(_jn3|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn3|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn3|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn3|f2,a2).π_Jn(f2).π_Jn(a2) += (0x0.03x0.0138158) ++ (0x0.03x0.986184) ++ (0x0.97x0.0138158) ++ (1x0.97x0.986184) = 0.9565987225 +λ(_jn0) = 1 +λ(_jn1) = 1 +λ(_jn2) = 1 +λ(_jn3) = 1 +belief change = 7.278791285e-16 + +domain π(Burglar) λ(Burglar) belief +---------------------------------------------------------------- +b1 0.005 0.5 0.005 +b2 0.995 0.5 0.995 + +domain πAlarm(Burglar) λAlarm(Burglar) +---------------------------------------------------------------- +b1 0.005 0.5 +b2 0.995 0.5 + +domain π(FreightTruck) λ(FreightTruck) belief +---------------------------------------------------------------- +f1 0.03 0.25 0.03 +f2 0.97 0.25 0.97 + +domain πAlarm(FreightTruck) λAlarm(FreightTruck) +---------------------------------------------------------------- +f1 0.03 0.5 +f2 0.97 0.5 + +domain π_Jn(FreightTruck) λ_Jn(FreightTruck) +---------------------------------------------------------------- +f1 0.03 0.5 +f2 0.97 0.5 + +domain π(Alarm) λ(Alarm) belief +---------------------------------------------------------------- +a1 0.01381575 0.5 0.01381575 +a2 0.98618425 0.5 0.98618425 + +domain π_Jn(Alarm) λ_Jn(Alarm) +---------------------------------------------------------------- +a1 0.01381575 0.5 +a2 0.98618425 0.5 + +domain π(_Jn) λ(_Jn) belief +---------------------------------------------------------------- +_jn0 0.0004144725 1 0.0004144725 +_jn1 0.0295855275 1 0.0295855275 +_jn2 0.0134012775 1 0.0134012775 +_jn3 0.9565987225 1 0.9565987225 + + + +******************************************************************************** + Iteration 86 +******************************************************************************** +λ message Alarm --> Burglar +λAlarm(b1) += [p(a1|b1,f1).πAlarm(f1) + p(a1|b1,f2).πAlarm(f2)].λ(a1) ++ [p(a2|b1,f1).πAlarm(f1) + p(a2|b1,f2).πAlarm(f2)].λ(a2) += [(0.992x0.03) + (0.99x0.97)]x0.5 ++ [(0.008x0.03) + (0.01x0.97)]x0.5 = 0.5 +λAlarm(b2) += [p(a1|b2,f1).πAlarm(f1) + p(a1|b2,f2).πAlarm(f2)].λ(a1) ++ [p(a2|b2,f1).πAlarm(f1) + p(a2|b2,f2).πAlarm(f2)].λ(a2) += [(0.2x0.03) + (0.003x0.97)]x0.5 ++ [(0.8x0.03) + (0.997x0.97)]x0.5 = 0.5 + +λ message Alarm --> FreightTruck +λAlarm(f1) += [p(a1|b1,f1).πAlarm(b1) + p(a1|b2,f1).πAlarm(b2)].λ(a1) ++ [p(a2|b1,f1).πAlarm(b1) + p(a2|b2,f1).πAlarm(b2)].λ(a2) += [(0.992x0.005) + (0.2x0.995)]x0.5 ++ [(0.008x0.005) + (0.8x0.995)]x0.5 = 0.5 +λAlarm(f2) += [p(a1|b1,f2).πAlarm(b1) + p(a1|b2,f2).πAlarm(b2)].λ(a1) ++ [p(a2|b1,f2).πAlarm(b1) + p(a2|b2,f2).πAlarm(b2)].λ(a2) += [(0.99x0.005) + (0.003x0.995)]x0.5 ++ [(0.01x0.005) + (0.997x0.995)]x0.5 = 0.5 + +λ message _Jn --> FreightTruck +λ_Jn(f1) += [p(_jn0|f1,a1).π_Jn(a1) + p(_jn0|f1,a2).π_Jn(a2)].λ(_jn0) ++ [p(_jn1|f1,a1).π_Jn(a1) + p(_jn1|f1,a2).π_Jn(a2)].λ(_jn1) ++ [p(_jn2|f1,a1).π_Jn(a1) + p(_jn2|f1,a2).π_Jn(a2)].λ(_jn2) ++ [p(_jn3|f1,a1).π_Jn(a1) + p(_jn3|f1,a2).π_Jn(a2)].λ(_jn3) += [(1x0.0138158) + (0x0.986184)]x1 ++ [(0x0.0138158) + (1x0.986184)]x1 ++ [(0x0.0138158) + (0x0.986184)]x1 ++ [(0x0.0138158) + (0x0.986184)]x1 = 1 +λ_Jn(f2) += [p(_jn0|f2,a1).π_Jn(a1) + p(_jn0|f2,a2).π_Jn(a2)].λ(_jn0) ++ [p(_jn1|f2,a1).π_Jn(a1) + p(_jn1|f2,a2).π_Jn(a2)].λ(_jn1) ++ [p(_jn2|f2,a1).π_Jn(a1) + p(_jn2|f2,a2).π_Jn(a2)].λ(_jn2) ++ [p(_jn3|f2,a1).π_Jn(a1) + p(_jn3|f2,a2).π_Jn(a2)].λ(_jn3) += [(0x0.0138158) + (0x0.986184)]x1 ++ [(0x0.0138158) + (0x0.986184)]x1 ++ [(1x0.0138158) + (0x0.986184)]x1 ++ [(0x0.0138158) + (1x0.986184)]x1 = 1 + +λ message _Jn --> Alarm +λ_Jn(a1) += [p(_jn0|f1,a1).π_Jn(f1) + p(_jn0|f2,a1).π_Jn(f2)].λ(_jn0) ++ [p(_jn1|f1,a1).π_Jn(f1) + p(_jn1|f2,a1).π_Jn(f2)].λ(_jn1) ++ [p(_jn2|f1,a1).π_Jn(f1) + p(_jn2|f2,a1).π_Jn(f2)].λ(_jn2) ++ [p(_jn3|f1,a1).π_Jn(f1) + p(_jn3|f2,a1).π_Jn(f2)].λ(_jn3) += [(1x0.03) + (0x0.97)]x1 ++ [(0x0.03) + (0x0.97)]x1 ++ [(0x0.03) + (1x0.97)]x1 ++ [(0x0.03) + (0x0.97)]x1 = 1 +λ_Jn(a2) += [p(_jn0|f1,a2).π_Jn(f1) + p(_jn0|f2,a2).π_Jn(f2)].λ(_jn0) ++ [p(_jn1|f1,a2).π_Jn(f1) + p(_jn1|f2,a2).π_Jn(f2)].λ(_jn1) ++ [p(_jn2|f1,a2).π_Jn(f1) + p(_jn2|f2,a2).π_Jn(f2)].λ(_jn2) ++ [p(_jn3|f1,a2).π_Jn(f1) + p(_jn3|f2,a2).π_Jn(f2)].λ(_jn3) += [(0x0.03) + (0x0.97)]x1 ++ [(1x0.03) + (0x0.97)]x1 ++ [(0x0.03) + (0x0.97)]x1 ++ [(0x0.03) + (1x0.97)]x1 = 1 + +π message Burglar --> Alarm +πAlarm(b1) = π(b1) = 0.005 = 0.005 +πAlarm(b2) = π(b2) = 0.995 = 0.995 + +π message FreightTruck --> Alarm +πAlarm(f1) = π(f1).λ_Jn(f1) = 0.03 x 0.5 = 0.015 +πAlarm(f2) = π(f2).λ_Jn(f2) = 0.97 x 0.5 = 0.485 + +π message FreightTruck --> _Jn +π_Jn(f1) = π(f1).λAlarm(f1) = 0.03 x 0.5 = 0.015 +π_Jn(f2) = π(f2).λAlarm(f2) = 0.97 x 0.5 = 0.485 + +π message Alarm --> _Jn +π_Jn(a1) = π(a1) = 0.0138158 = 0.01381575 +π_Jn(a2) = π(a2) = 0.986184 = 0.98618425 + +var Burglar: +π(b1) += p(b1) += (0.005) = 0.005 +π(b2) += p(b2) += (0.995) = 0.995 +λ(b1) = λAlarm(b1) = 0.5 = 0.5 +λ(b2) = λAlarm(b2) = 0.5 = 0.5 +belief change = 8.67361738e-19 + +var FreightTruck: +π(f1) += p(f1) += (0.03) = 0.03 +π(f2) += p(f2) += (0.97) = 0.97 +λ(f1) = λAlarm(f1).λ_Jn(f1) = 0.5 x 0.5 = 0.25 +λ(f2) = λAlarm(f2).λ_Jn(f2) = 0.5 x 0.5 = 0.25 +belief change = 0 + +var Alarm: +π(a1) += p(a1|b1,f1).πAlarm(b1).πAlarm(f1) ++ p(a1|b1,f2).πAlarm(b1).πAlarm(f2) ++ p(a1|b2,f1).πAlarm(b2).πAlarm(f1) ++ p(a1|b2,f2).πAlarm(b2).πAlarm(f2) += (0.992x0.005x0.03) ++ (0.99x0.005x0.97) ++ (0.2x0.995x0.03) ++ (0.003x0.995x0.97) = 0.01381575 +π(a2) += p(a2|b1,f1).πAlarm(b1).πAlarm(f1) ++ p(a2|b1,f2).πAlarm(b1).πAlarm(f2) ++ p(a2|b2,f1).πAlarm(b2).πAlarm(f1) ++ p(a2|b2,f2).πAlarm(b2).πAlarm(f2) += (0.008x0.005x0.03) ++ (0.01x0.005x0.97) ++ (0.8x0.995x0.03) ++ (0.997x0.995x0.97) = 0.98618425 +λ(a1) = λ_Jn(a1) = 0.5 = 0.5 +λ(a2) = λ_Jn(a2) = 0.5 = 0.5 +belief change = 1.439820485e-16 + +var _Jn: +π(_jn0) += p(_jn0|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn0|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn0|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn0|f2,a2).π_Jn(f2).π_Jn(a2) += (1x0.03x0.0138158) ++ (0x0.03x0.986184) ++ (0x0.97x0.0138158) ++ (0x0.97x0.986184) = 0.0004144725 +π(_jn1) += p(_jn1|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn1|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn1|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn1|f2,a2).π_Jn(f2).π_Jn(a2) += (0x0.03x0.0138158) ++ (1x0.03x0.986184) ++ (0x0.97x0.0138158) ++ (0x0.97x0.986184) = 0.0295855275 +π(_jn2) += p(_jn2|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn2|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn2|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn2|f2,a2).π_Jn(f2).π_Jn(a2) += (0x0.03x0.0138158) ++ (0x0.03x0.986184) ++ (1x0.97x0.0138158) ++ (0x0.97x0.986184) = 0.0134012775 +π(_jn3) += p(_jn3|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn3|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn3|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn3|f2,a2).π_Jn(f2).π_Jn(a2) += (0x0.03x0.0138158) ++ (0x0.03x0.986184) ++ (0x0.97x0.0138158) ++ (1x0.97x0.986184) = 0.9565987225 +λ(_jn0) = 1 +λ(_jn1) = 1 +λ(_jn2) = 1 +λ(_jn3) = 1 +belief change = 4.857767834e-16 + +domain π(Burglar) λ(Burglar) belief +---------------------------------------------------------------- +b1 0.005 0.5 0.005 +b2 0.995 0.5 0.995 + +domain πAlarm(Burglar) λAlarm(Burglar) +---------------------------------------------------------------- +b1 0.005 0.5 +b2 0.995 0.5 + +domain π(FreightTruck) λ(FreightTruck) belief +---------------------------------------------------------------- +f1 0.03 0.25 0.03 +f2 0.97 0.25 0.97 + +domain πAlarm(FreightTruck) λAlarm(FreightTruck) +---------------------------------------------------------------- +f1 0.03 0.5 +f2 0.97 0.5 + +domain π_Jn(FreightTruck) λ_Jn(FreightTruck) +---------------------------------------------------------------- +f1 0.03 0.5 +f2 0.97 0.5 + +domain π(Alarm) λ(Alarm) belief +---------------------------------------------------------------- +a1 0.01381575 0.5 0.01381575 +a2 0.98618425 0.5 0.98618425 + +domain π_Jn(Alarm) λ_Jn(Alarm) +---------------------------------------------------------------- +a1 0.01381575 0.5 +a2 0.98618425 0.5 + +domain π(_Jn) λ(_Jn) belief +---------------------------------------------------------------- +_jn0 0.0004144725 1 0.0004144725 +_jn1 0.0295855275 1 0.0295855275 +_jn2 0.0134012775 1 0.0134012775 +_jn3 0.9565987225 1 0.9565987225 + + + +******************************************************************************** + Iteration 87 +******************************************************************************** +λ message Alarm --> Burglar +λAlarm(b1) += [p(a1|b1,f1).πAlarm(f1) + p(a1|b1,f2).πAlarm(f2)].λ(a1) ++ [p(a2|b1,f1).πAlarm(f1) + p(a2|b1,f2).πAlarm(f2)].λ(a2) += [(0.992x0.03) + (0.99x0.97)]x0.5 ++ [(0.008x0.03) + (0.01x0.97)]x0.5 = 0.5 +λAlarm(b2) += [p(a1|b2,f1).πAlarm(f1) + p(a1|b2,f2).πAlarm(f2)].λ(a1) ++ [p(a2|b2,f1).πAlarm(f1) + p(a2|b2,f2).πAlarm(f2)].λ(a2) += [(0.2x0.03) + (0.003x0.97)]x0.5 ++ [(0.8x0.03) + (0.997x0.97)]x0.5 = 0.5 + +λ message Alarm --> FreightTruck +λAlarm(f1) += [p(a1|b1,f1).πAlarm(b1) + p(a1|b2,f1).πAlarm(b2)].λ(a1) ++ [p(a2|b1,f1).πAlarm(b1) + p(a2|b2,f1).πAlarm(b2)].λ(a2) += [(0.992x0.005) + (0.2x0.995)]x0.5 ++ [(0.008x0.005) + (0.8x0.995)]x0.5 = 0.5 +λAlarm(f2) += [p(a1|b1,f2).πAlarm(b1) + p(a1|b2,f2).πAlarm(b2)].λ(a1) ++ [p(a2|b1,f2).πAlarm(b1) + p(a2|b2,f2).πAlarm(b2)].λ(a2) += [(0.99x0.005) + (0.003x0.995)]x0.5 ++ [(0.01x0.005) + (0.997x0.995)]x0.5 = 0.5 + +λ message _Jn --> FreightTruck +λ_Jn(f1) += [p(_jn0|f1,a1).π_Jn(a1) + p(_jn0|f1,a2).π_Jn(a2)].λ(_jn0) ++ [p(_jn1|f1,a1).π_Jn(a1) + p(_jn1|f1,a2).π_Jn(a2)].λ(_jn1) ++ [p(_jn2|f1,a1).π_Jn(a1) + p(_jn2|f1,a2).π_Jn(a2)].λ(_jn2) ++ [p(_jn3|f1,a1).π_Jn(a1) + p(_jn3|f1,a2).π_Jn(a2)].λ(_jn3) += [(1x0.0138158) + (0x0.986184)]x1 ++ [(0x0.0138158) + (1x0.986184)]x1 ++ [(0x0.0138158) + (0x0.986184)]x1 ++ [(0x0.0138158) + (0x0.986184)]x1 = 1 +λ_Jn(f2) += [p(_jn0|f2,a1).π_Jn(a1) + p(_jn0|f2,a2).π_Jn(a2)].λ(_jn0) ++ [p(_jn1|f2,a1).π_Jn(a1) + p(_jn1|f2,a2).π_Jn(a2)].λ(_jn1) ++ [p(_jn2|f2,a1).π_Jn(a1) + p(_jn2|f2,a2).π_Jn(a2)].λ(_jn2) ++ [p(_jn3|f2,a1).π_Jn(a1) + p(_jn3|f2,a2).π_Jn(a2)].λ(_jn3) += [(0x0.0138158) + (0x0.986184)]x1 ++ [(0x0.0138158) + (0x0.986184)]x1 ++ [(1x0.0138158) + (0x0.986184)]x1 ++ [(0x0.0138158) + (1x0.986184)]x1 = 1 + +λ message _Jn --> Alarm +λ_Jn(a1) += [p(_jn0|f1,a1).π_Jn(f1) + p(_jn0|f2,a1).π_Jn(f2)].λ(_jn0) ++ [p(_jn1|f1,a1).π_Jn(f1) + p(_jn1|f2,a1).π_Jn(f2)].λ(_jn1) ++ [p(_jn2|f1,a1).π_Jn(f1) + p(_jn2|f2,a1).π_Jn(f2)].λ(_jn2) ++ [p(_jn3|f1,a1).π_Jn(f1) + p(_jn3|f2,a1).π_Jn(f2)].λ(_jn3) += [(1x0.03) + (0x0.97)]x1 ++ [(0x0.03) + (0x0.97)]x1 ++ [(0x0.03) + (1x0.97)]x1 ++ [(0x0.03) + (0x0.97)]x1 = 1 +λ_Jn(a2) += [p(_jn0|f1,a2).π_Jn(f1) + p(_jn0|f2,a2).π_Jn(f2)].λ(_jn0) ++ [p(_jn1|f1,a2).π_Jn(f1) + p(_jn1|f2,a2).π_Jn(f2)].λ(_jn1) ++ [p(_jn2|f1,a2).π_Jn(f1) + p(_jn2|f2,a2).π_Jn(f2)].λ(_jn2) ++ [p(_jn3|f1,a2).π_Jn(f1) + p(_jn3|f2,a2).π_Jn(f2)].λ(_jn3) += [(0x0.03) + (0x0.97)]x1 ++ [(1x0.03) + (0x0.97)]x1 ++ [(0x0.03) + (0x0.97)]x1 ++ [(0x0.03) + (1x0.97)]x1 = 1 + +π message Burglar --> Alarm +πAlarm(b1) = π(b1) = 0.005 = 0.005 +πAlarm(b2) = π(b2) = 0.995 = 0.995 + +π message FreightTruck --> Alarm +πAlarm(f1) = π(f1).λ_Jn(f1) = 0.03 x 0.5 = 0.015 +πAlarm(f2) = π(f2).λ_Jn(f2) = 0.97 x 0.5 = 0.485 + +π message FreightTruck --> _Jn +π_Jn(f1) = π(f1).λAlarm(f1) = 0.03 x 0.5 = 0.015 +π_Jn(f2) = π(f2).λAlarm(f2) = 0.97 x 0.5 = 0.485 + +π message Alarm --> _Jn +π_Jn(a1) = π(a1) = 0.0138158 = 0.01381575 +π_Jn(a2) = π(a2) = 0.986184 = 0.98618425 + +var Burglar: +π(b1) += p(b1) += (0.005) = 0.005 +π(b2) += p(b2) += (0.995) = 0.995 +λ(b1) = λAlarm(b1) = 0.5 = 0.5 +λ(b2) = λAlarm(b2) = 0.5 = 0.5 +belief change = 0 + +var FreightTruck: +π(f1) += p(f1) += (0.03) = 0.03 +π(f2) += p(f2) += (0.97) = 0.97 +λ(f1) = λAlarm(f1).λ_Jn(f1) = 0.5 x 0.5 = 0.25 +λ(f2) = λAlarm(f2).λ_Jn(f2) = 0.5 x 0.5 = 0.25 +belief change = 0 + +var Alarm: +π(a1) += p(a1|b1,f1).πAlarm(b1).πAlarm(f1) ++ p(a1|b1,f2).πAlarm(b1).πAlarm(f2) ++ p(a1|b2,f1).πAlarm(b2).πAlarm(f1) ++ p(a1|b2,f2).πAlarm(b2).πAlarm(f2) += (0.992x0.005x0.03) ++ (0.99x0.005x0.97) ++ (0.2x0.995x0.03) ++ (0.003x0.995x0.97) = 0.01381575 +π(a2) += p(a2|b1,f1).πAlarm(b1).πAlarm(f1) ++ p(a2|b1,f2).πAlarm(b1).πAlarm(f2) ++ p(a2|b2,f1).πAlarm(b2).πAlarm(f1) ++ p(a2|b2,f2).πAlarm(b2).πAlarm(f2) += (0.008x0.005x0.03) ++ (0.01x0.005x0.97) ++ (0.8x0.995x0.03) ++ (0.997x0.995x0.97) = 0.98618425 +λ(a1) = λ_Jn(a1) = 0.5 = 0.5 +λ(a2) = λ_Jn(a2) = 0.5 = 0.5 +belief change = 2.255140519e-17 + +var _Jn: +π(_jn0) += p(_jn0|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn0|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn0|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn0|f2,a2).π_Jn(f2).π_Jn(a2) += (1x0.03x0.0138158) ++ (0x0.03x0.986184) ++ (0x0.97x0.0138158) ++ (0x0.97x0.986184) = 0.0004144725 +π(_jn1) += p(_jn1|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn1|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn1|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn1|f2,a2).π_Jn(f2).π_Jn(a2) += (0x0.03x0.0138158) ++ (1x0.03x0.986184) ++ (0x0.97x0.0138158) ++ (0x0.97x0.986184) = 0.0295855275 +π(_jn2) += p(_jn2|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn2|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn2|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn2|f2,a2).π_Jn(f2).π_Jn(a2) += (0x0.03x0.0138158) ++ (0x0.03x0.986184) ++ (1x0.97x0.0138158) ++ (0x0.97x0.986184) = 0.0134012775 +π(_jn3) += p(_jn3|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn3|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn3|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn3|f2,a2).π_Jn(f2).π_Jn(a2) += (0x0.03x0.0138158) ++ (0x0.03x0.986184) ++ (0x0.97x0.0138158) ++ (1x0.97x0.986184) = 0.9565987225 +λ(_jn0) = 1 +λ(_jn1) = 1 +λ(_jn2) = 1 +λ(_jn3) = 1 +belief change = 3.903127821e-16 + +domain π(Burglar) λ(Burglar) belief +---------------------------------------------------------------- +b1 0.005 0.5 0.005 +b2 0.995 0.5 0.995 + +domain πAlarm(Burglar) λAlarm(Burglar) +---------------------------------------------------------------- +b1 0.005 0.5 +b2 0.995 0.5 + +domain π(FreightTruck) λ(FreightTruck) belief +---------------------------------------------------------------- +f1 0.03 0.25 0.03 +f2 0.97 0.25 0.97 + +domain πAlarm(FreightTruck) λAlarm(FreightTruck) +---------------------------------------------------------------- +f1 0.03 0.5 +f2 0.97 0.5 + +domain π_Jn(FreightTruck) λ_Jn(FreightTruck) +---------------------------------------------------------------- +f1 0.03 0.5 +f2 0.97 0.5 + +domain π(Alarm) λ(Alarm) belief +---------------------------------------------------------------- +a1 0.01381575 0.5 0.01381575 +a2 0.98618425 0.5 0.98618425 + +domain π_Jn(Alarm) λ_Jn(Alarm) +---------------------------------------------------------------- +a1 0.01381575 0.5 +a2 0.98618425 0.5 + +domain π(_Jn) λ(_Jn) belief +---------------------------------------------------------------- +_jn0 0.0004144725 1 0.0004144725 +_jn1 0.0295855275 1 0.0295855275 +_jn2 0.0134012775 1 0.0134012775 +_jn3 0.9565987225 1 0.9565987225 + + + +******************************************************************************** + Iteration 88 +******************************************************************************** +λ message Alarm --> Burglar +λAlarm(b1) += [p(a1|b1,f1).πAlarm(f1) + p(a1|b1,f2).πAlarm(f2)].λ(a1) ++ [p(a2|b1,f1).πAlarm(f1) + p(a2|b1,f2).πAlarm(f2)].λ(a2) += [(0.992x0.03) + (0.99x0.97)]x0.5 ++ [(0.008x0.03) + (0.01x0.97)]x0.5 = 0.5 +λAlarm(b2) += [p(a1|b2,f1).πAlarm(f1) + p(a1|b2,f2).πAlarm(f2)].λ(a1) ++ [p(a2|b2,f1).πAlarm(f1) + p(a2|b2,f2).πAlarm(f2)].λ(a2) += [(0.2x0.03) + (0.003x0.97)]x0.5 ++ [(0.8x0.03) + (0.997x0.97)]x0.5 = 0.5 + +λ message Alarm --> FreightTruck +λAlarm(f1) += [p(a1|b1,f1).πAlarm(b1) + p(a1|b2,f1).πAlarm(b2)].λ(a1) ++ [p(a2|b1,f1).πAlarm(b1) + p(a2|b2,f1).πAlarm(b2)].λ(a2) += [(0.992x0.005) + (0.2x0.995)]x0.5 ++ [(0.008x0.005) + (0.8x0.995)]x0.5 = 0.5 +λAlarm(f2) += [p(a1|b1,f2).πAlarm(b1) + p(a1|b2,f2).πAlarm(b2)].λ(a1) ++ [p(a2|b1,f2).πAlarm(b1) + p(a2|b2,f2).πAlarm(b2)].λ(a2) += [(0.99x0.005) + (0.003x0.995)]x0.5 ++ [(0.01x0.005) + (0.997x0.995)]x0.5 = 0.5 + +λ message _Jn --> FreightTruck +λ_Jn(f1) += [p(_jn0|f1,a1).π_Jn(a1) + p(_jn0|f1,a2).π_Jn(a2)].λ(_jn0) ++ [p(_jn1|f1,a1).π_Jn(a1) + p(_jn1|f1,a2).π_Jn(a2)].λ(_jn1) ++ [p(_jn2|f1,a1).π_Jn(a1) + p(_jn2|f1,a2).π_Jn(a2)].λ(_jn2) ++ [p(_jn3|f1,a1).π_Jn(a1) + p(_jn3|f1,a2).π_Jn(a2)].λ(_jn3) += [(1x0.0138158) + (0x0.986184)]x1 ++ [(0x0.0138158) + (1x0.986184)]x1 ++ [(0x0.0138158) + (0x0.986184)]x1 ++ [(0x0.0138158) + (0x0.986184)]x1 = 1 +λ_Jn(f2) += [p(_jn0|f2,a1).π_Jn(a1) + p(_jn0|f2,a2).π_Jn(a2)].λ(_jn0) ++ [p(_jn1|f2,a1).π_Jn(a1) + p(_jn1|f2,a2).π_Jn(a2)].λ(_jn1) ++ [p(_jn2|f2,a1).π_Jn(a1) + p(_jn2|f2,a2).π_Jn(a2)].λ(_jn2) ++ [p(_jn3|f2,a1).π_Jn(a1) + p(_jn3|f2,a2).π_Jn(a2)].λ(_jn3) += [(0x0.0138158) + (0x0.986184)]x1 ++ [(0x0.0138158) + (0x0.986184)]x1 ++ [(1x0.0138158) + (0x0.986184)]x1 ++ [(0x0.0138158) + (1x0.986184)]x1 = 1 + +λ message _Jn --> Alarm +λ_Jn(a1) += [p(_jn0|f1,a1).π_Jn(f1) + p(_jn0|f2,a1).π_Jn(f2)].λ(_jn0) ++ [p(_jn1|f1,a1).π_Jn(f1) + p(_jn1|f2,a1).π_Jn(f2)].λ(_jn1) ++ [p(_jn2|f1,a1).π_Jn(f1) + p(_jn2|f2,a1).π_Jn(f2)].λ(_jn2) ++ [p(_jn3|f1,a1).π_Jn(f1) + p(_jn3|f2,a1).π_Jn(f2)].λ(_jn3) += [(1x0.03) + (0x0.97)]x1 ++ [(0x0.03) + (0x0.97)]x1 ++ [(0x0.03) + (1x0.97)]x1 ++ [(0x0.03) + (0x0.97)]x1 = 1 +λ_Jn(a2) += [p(_jn0|f1,a2).π_Jn(f1) + p(_jn0|f2,a2).π_Jn(f2)].λ(_jn0) ++ [p(_jn1|f1,a2).π_Jn(f1) + p(_jn1|f2,a2).π_Jn(f2)].λ(_jn1) ++ [p(_jn2|f1,a2).π_Jn(f1) + p(_jn2|f2,a2).π_Jn(f2)].λ(_jn2) ++ [p(_jn3|f1,a2).π_Jn(f1) + p(_jn3|f2,a2).π_Jn(f2)].λ(_jn3) += [(0x0.03) + (0x0.97)]x1 ++ [(1x0.03) + (0x0.97)]x1 ++ [(0x0.03) + (0x0.97)]x1 ++ [(0x0.03) + (1x0.97)]x1 = 1 + +π message Burglar --> Alarm +πAlarm(b1) = π(b1) = 0.005 = 0.005 +πAlarm(b2) = π(b2) = 0.995 = 0.995 + +π message FreightTruck --> Alarm +πAlarm(f1) = π(f1).λ_Jn(f1) = 0.03 x 0.5 = 0.015 +πAlarm(f2) = π(f2).λ_Jn(f2) = 0.97 x 0.5 = 0.485 + +π message FreightTruck --> _Jn +π_Jn(f1) = π(f1).λAlarm(f1) = 0.03 x 0.5 = 0.015 +π_Jn(f2) = π(f2).λAlarm(f2) = 0.97 x 0.5 = 0.485 + +π message Alarm --> _Jn +π_Jn(a1) = π(a1) = 0.0138158 = 0.01381575 +π_Jn(a2) = π(a2) = 0.986184 = 0.98618425 + +var Burglar: +π(b1) += p(b1) += (0.005) = 0.005 +π(b2) += p(b2) += (0.995) = 0.995 +λ(b1) = λAlarm(b1) = 0.5 = 0.5 +λ(b2) = λAlarm(b2) = 0.5 = 0.5 +belief change = 0 + +var FreightTruck: +π(f1) += p(f1) += (0.03) = 0.03 +π(f2) += p(f2) += (0.97) = 0.97 +λ(f1) = λAlarm(f1).λ_Jn(f1) = 0.5 x 0.5 = 0.25 +λ(f2) = λAlarm(f2).λ_Jn(f2) = 0.5 x 0.5 = 0.25 +belief change = 0 + +var Alarm: +π(a1) += p(a1|b1,f1).πAlarm(b1).πAlarm(f1) ++ p(a1|b1,f2).πAlarm(b1).πAlarm(f2) ++ p(a1|b2,f1).πAlarm(b2).πAlarm(f1) ++ p(a1|b2,f2).πAlarm(b2).πAlarm(f2) += (0.992x0.005x0.03) ++ (0.99x0.005x0.97) ++ (0.2x0.995x0.03) ++ (0.003x0.995x0.97) = 0.01381575 +π(a2) += p(a2|b1,f1).πAlarm(b1).πAlarm(f1) ++ p(a2|b1,f2).πAlarm(b1).πAlarm(f2) ++ p(a2|b2,f1).πAlarm(b2).πAlarm(f1) ++ p(a2|b2,f2).πAlarm(b2).πAlarm(f2) += (0.008x0.005x0.03) ++ (0.01x0.005x0.97) ++ (0.8x0.995x0.03) ++ (0.997x0.995x0.97) = 0.98618425 +λ(a1) = λ_Jn(a1) = 0.5 = 0.5 +λ(a2) = λ_Jn(a2) = 0.5 = 0.5 +belief change = 1.561251128e-17 + +var _Jn: +π(_jn0) += p(_jn0|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn0|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn0|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn0|f2,a2).π_Jn(f2).π_Jn(a2) += (1x0.03x0.0138158) ++ (0x0.03x0.986184) ++ (0x0.97x0.0138158) ++ (0x0.97x0.986184) = 0.0004144725 +π(_jn1) += p(_jn1|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn1|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn1|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn1|f2,a2).π_Jn(f2).π_Jn(a2) += (0x0.03x0.0138158) ++ (1x0.03x0.986184) ++ (0x0.97x0.0138158) ++ (0x0.97x0.986184) = 0.0295855275 +π(_jn2) += p(_jn2|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn2|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn2|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn2|f2,a2).π_Jn(f2).π_Jn(a2) += (0x0.03x0.0138158) ++ (0x0.03x0.986184) ++ (1x0.97x0.0138158) ++ (0x0.97x0.986184) = 0.0134012775 +π(_jn3) += p(_jn3|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn3|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn3|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn3|f2,a2).π_Jn(f2).π_Jn(a2) += (0x0.03x0.0138158) ++ (0x0.03x0.986184) ++ (0x0.97x0.0138158) ++ (1x0.97x0.986184) = 0.9565987225 +λ(_jn0) = 1 +λ(_jn1) = 1 +λ(_jn2) = 1 +λ(_jn3) = 1 +belief change = 2.243756396e-16 + +domain π(Burglar) λ(Burglar) belief +---------------------------------------------------------------- +b1 0.005 0.5 0.005 +b2 0.995 0.5 0.995 + +domain πAlarm(Burglar) λAlarm(Burglar) +---------------------------------------------------------------- +b1 0.005 0.5 +b2 0.995 0.5 + +domain π(FreightTruck) λ(FreightTruck) belief +---------------------------------------------------------------- +f1 0.03 0.25 0.03 +f2 0.97 0.25 0.97 + +domain πAlarm(FreightTruck) λAlarm(FreightTruck) +---------------------------------------------------------------- +f1 0.03 0.5 +f2 0.97 0.5 + +domain π_Jn(FreightTruck) λ_Jn(FreightTruck) +---------------------------------------------------------------- +f1 0.03 0.5 +f2 0.97 0.5 + +domain π(Alarm) λ(Alarm) belief +---------------------------------------------------------------- +a1 0.01381575 0.5 0.01381575 +a2 0.98618425 0.5 0.98618425 + +domain π_Jn(Alarm) λ_Jn(Alarm) +---------------------------------------------------------------- +a1 0.01381575 0.5 +a2 0.98618425 0.5 + +domain π(_Jn) λ(_Jn) belief +---------------------------------------------------------------- +_jn0 0.0004144725 1 0.0004144725 +_jn1 0.0295855275 1 0.0295855275 +_jn2 0.0134012775 1 0.0134012775 +_jn3 0.9565987225 1 0.9565987225 + + + +******************************************************************************** + Iteration 89 +******************************************************************************** +λ message Alarm --> Burglar +λAlarm(b1) += [p(a1|b1,f1).πAlarm(f1) + p(a1|b1,f2).πAlarm(f2)].λ(a1) ++ [p(a2|b1,f1).πAlarm(f1) + p(a2|b1,f2).πAlarm(f2)].λ(a2) += [(0.992x0.03) + (0.99x0.97)]x0.5 ++ [(0.008x0.03) + (0.01x0.97)]x0.5 = 0.5 +λAlarm(b2) += [p(a1|b2,f1).πAlarm(f1) + p(a1|b2,f2).πAlarm(f2)].λ(a1) ++ [p(a2|b2,f1).πAlarm(f1) + p(a2|b2,f2).πAlarm(f2)].λ(a2) += [(0.2x0.03) + (0.003x0.97)]x0.5 ++ [(0.8x0.03) + (0.997x0.97)]x0.5 = 0.5 + +λ message Alarm --> FreightTruck +λAlarm(f1) += [p(a1|b1,f1).πAlarm(b1) + p(a1|b2,f1).πAlarm(b2)].λ(a1) ++ [p(a2|b1,f1).πAlarm(b1) + p(a2|b2,f1).πAlarm(b2)].λ(a2) += [(0.992x0.005) + (0.2x0.995)]x0.5 ++ [(0.008x0.005) + (0.8x0.995)]x0.5 = 0.5 +λAlarm(f2) += [p(a1|b1,f2).πAlarm(b1) + p(a1|b2,f2).πAlarm(b2)].λ(a1) ++ [p(a2|b1,f2).πAlarm(b1) + p(a2|b2,f2).πAlarm(b2)].λ(a2) += [(0.99x0.005) + (0.003x0.995)]x0.5 ++ [(0.01x0.005) + (0.997x0.995)]x0.5 = 0.5 + +λ message _Jn --> FreightTruck +λ_Jn(f1) += [p(_jn0|f1,a1).π_Jn(a1) + p(_jn0|f1,a2).π_Jn(a2)].λ(_jn0) ++ [p(_jn1|f1,a1).π_Jn(a1) + p(_jn1|f1,a2).π_Jn(a2)].λ(_jn1) ++ [p(_jn2|f1,a1).π_Jn(a1) + p(_jn2|f1,a2).π_Jn(a2)].λ(_jn2) ++ [p(_jn3|f1,a1).π_Jn(a1) + p(_jn3|f1,a2).π_Jn(a2)].λ(_jn3) += [(1x0.0138158) + (0x0.986184)]x1 ++ [(0x0.0138158) + (1x0.986184)]x1 ++ [(0x0.0138158) + (0x0.986184)]x1 ++ [(0x0.0138158) + (0x0.986184)]x1 = 1 +λ_Jn(f2) += [p(_jn0|f2,a1).π_Jn(a1) + p(_jn0|f2,a2).π_Jn(a2)].λ(_jn0) ++ [p(_jn1|f2,a1).π_Jn(a1) + p(_jn1|f2,a2).π_Jn(a2)].λ(_jn1) ++ [p(_jn2|f2,a1).π_Jn(a1) + p(_jn2|f2,a2).π_Jn(a2)].λ(_jn2) ++ [p(_jn3|f2,a1).π_Jn(a1) + p(_jn3|f2,a2).π_Jn(a2)].λ(_jn3) += [(0x0.0138158) + (0x0.986184)]x1 ++ [(0x0.0138158) + (0x0.986184)]x1 ++ [(1x0.0138158) + (0x0.986184)]x1 ++ [(0x0.0138158) + (1x0.986184)]x1 = 1 + +λ message _Jn --> Alarm +λ_Jn(a1) += [p(_jn0|f1,a1).π_Jn(f1) + p(_jn0|f2,a1).π_Jn(f2)].λ(_jn0) ++ [p(_jn1|f1,a1).π_Jn(f1) + p(_jn1|f2,a1).π_Jn(f2)].λ(_jn1) ++ [p(_jn2|f1,a1).π_Jn(f1) + p(_jn2|f2,a1).π_Jn(f2)].λ(_jn2) ++ [p(_jn3|f1,a1).π_Jn(f1) + p(_jn3|f2,a1).π_Jn(f2)].λ(_jn3) += [(1x0.03) + (0x0.97)]x1 ++ [(0x0.03) + (0x0.97)]x1 ++ [(0x0.03) + (1x0.97)]x1 ++ [(0x0.03) + (0x0.97)]x1 = 1 +λ_Jn(a2) += [p(_jn0|f1,a2).π_Jn(f1) + p(_jn0|f2,a2).π_Jn(f2)].λ(_jn0) ++ [p(_jn1|f1,a2).π_Jn(f1) + p(_jn1|f2,a2).π_Jn(f2)].λ(_jn1) ++ [p(_jn2|f1,a2).π_Jn(f1) + p(_jn2|f2,a2).π_Jn(f2)].λ(_jn2) ++ [p(_jn3|f1,a2).π_Jn(f1) + p(_jn3|f2,a2).π_Jn(f2)].λ(_jn3) += [(0x0.03) + (0x0.97)]x1 ++ [(1x0.03) + (0x0.97)]x1 ++ [(0x0.03) + (0x0.97)]x1 ++ [(0x0.03) + (1x0.97)]x1 = 1 + +π message Burglar --> Alarm +πAlarm(b1) = π(b1) = 0.005 = 0.005 +πAlarm(b2) = π(b2) = 0.995 = 0.995 + +π message FreightTruck --> Alarm +πAlarm(f1) = π(f1).λ_Jn(f1) = 0.03 x 0.5 = 0.015 +πAlarm(f2) = π(f2).λ_Jn(f2) = 0.97 x 0.5 = 0.485 + +π message FreightTruck --> _Jn +π_Jn(f1) = π(f1).λAlarm(f1) = 0.03 x 0.5 = 0.015 +π_Jn(f2) = π(f2).λAlarm(f2) = 0.97 x 0.5 = 0.485 + +π message Alarm --> _Jn +π_Jn(a1) = π(a1) = 0.0138158 = 0.01381575 +π_Jn(a2) = π(a2) = 0.986184 = 0.98618425 + +var Burglar: +π(b1) += p(b1) += (0.005) = 0.005 +π(b2) += p(b2) += (0.995) = 0.995 +λ(b1) = λAlarm(b1) = 0.5 = 0.5 +λ(b2) = λAlarm(b2) = 0.5 = 0.5 +belief change = 0 + +var FreightTruck: +π(f1) += p(f1) += (0.03) = 0.03 +π(f2) += p(f2) += (0.97) = 0.97 +λ(f1) = λAlarm(f1).λ_Jn(f1) = 0.5 x 0.5 = 0.25 +λ(f2) = λAlarm(f2).λ_Jn(f2) = 0.5 x 0.5 = 0.25 +belief change = 0 + +var Alarm: +π(a1) += p(a1|b1,f1).πAlarm(b1).πAlarm(f1) ++ p(a1|b1,f2).πAlarm(b1).πAlarm(f2) ++ p(a1|b2,f1).πAlarm(b2).πAlarm(f1) ++ p(a1|b2,f2).πAlarm(b2).πAlarm(f2) += (0.992x0.005x0.03) ++ (0.99x0.005x0.97) ++ (0.2x0.995x0.03) ++ (0.003x0.995x0.97) = 0.01381575 +π(a2) += p(a2|b1,f1).πAlarm(b1).πAlarm(f1) ++ p(a2|b1,f2).πAlarm(b1).πAlarm(f2) ++ p(a2|b2,f1).πAlarm(b2).πAlarm(f1) ++ p(a2|b2,f2).πAlarm(b2).πAlarm(f2) += (0.008x0.005x0.03) ++ (0.01x0.005x0.97) ++ (0.8x0.995x0.03) ++ (0.997x0.995x0.97) = 0.98618425 +λ(a1) = λ_Jn(a1) = 0.5 = 0.5 +λ(a2) = λ_Jn(a2) = 0.5 = 0.5 +belief change = 8.67361738e-18 + +var _Jn: +π(_jn0) += p(_jn0|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn0|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn0|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn0|f2,a2).π_Jn(f2).π_Jn(a2) += (1x0.03x0.0138158) ++ (0x0.03x0.986184) ++ (0x0.97x0.0138158) ++ (0x0.97x0.986184) = 0.0004144725 +π(_jn1) += p(_jn1|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn1|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn1|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn1|f2,a2).π_Jn(f2).π_Jn(a2) += (0x0.03x0.0138158) ++ (1x0.03x0.986184) ++ (0x0.97x0.0138158) ++ (0x0.97x0.986184) = 0.0295855275 +π(_jn2) += p(_jn2|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn2|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn2|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn2|f2,a2).π_Jn(f2).π_Jn(a2) += (0x0.03x0.0138158) ++ (0x0.03x0.986184) ++ (1x0.97x0.0138158) ++ (0x0.97x0.986184) = 0.0134012775 +π(_jn3) += p(_jn3|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn3|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn3|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn3|f2,a2).π_Jn(f2).π_Jn(a2) += (0x0.03x0.0138158) ++ (0x0.03x0.986184) ++ (0x0.97x0.0138158) ++ (1x0.97x0.986184) = 0.9565987225 +λ(_jn0) = 1 +λ(_jn1) = 1 +λ(_jn2) = 1 +λ(_jn3) = 1 +belief change = 1.90656952e-16 + +domain π(Burglar) λ(Burglar) belief +---------------------------------------------------------------- +b1 0.005 0.5 0.005 +b2 0.995 0.5 0.995 + +domain πAlarm(Burglar) λAlarm(Burglar) +---------------------------------------------------------------- +b1 0.005 0.5 +b2 0.995 0.5 + +domain π(FreightTruck) λ(FreightTruck) belief +---------------------------------------------------------------- +f1 0.03 0.25 0.03 +f2 0.97 0.25 0.97 + +domain πAlarm(FreightTruck) λAlarm(FreightTruck) +---------------------------------------------------------------- +f1 0.03 0.5 +f2 0.97 0.5 + +domain π_Jn(FreightTruck) λ_Jn(FreightTruck) +---------------------------------------------------------------- +f1 0.03 0.5 +f2 0.97 0.5 + +domain π(Alarm) λ(Alarm) belief +---------------------------------------------------------------- +a1 0.01381575 0.5 0.01381575 +a2 0.98618425 0.5 0.98618425 + +domain π_Jn(Alarm) λ_Jn(Alarm) +---------------------------------------------------------------- +a1 0.01381575 0.5 +a2 0.98618425 0.5 + +domain π(_Jn) λ(_Jn) belief +---------------------------------------------------------------- +_jn0 0.0004144725 1 0.0004144725 +_jn1 0.0295855275 1 0.0295855275 +_jn2 0.0134012775 1 0.0134012775 +_jn3 0.9565987225 1 0.9565987225 + + + +******************************************************************************** + Iteration 90 +******************************************************************************** +λ message Alarm --> Burglar +λAlarm(b1) += [p(a1|b1,f1).πAlarm(f1) + p(a1|b1,f2).πAlarm(f2)].λ(a1) ++ [p(a2|b1,f1).πAlarm(f1) + p(a2|b1,f2).πAlarm(f2)].λ(a2) += [(0.992x0.03) + (0.99x0.97)]x0.5 ++ [(0.008x0.03) + (0.01x0.97)]x0.5 = 0.5 +λAlarm(b2) += [p(a1|b2,f1).πAlarm(f1) + p(a1|b2,f2).πAlarm(f2)].λ(a1) ++ [p(a2|b2,f1).πAlarm(f1) + p(a2|b2,f2).πAlarm(f2)].λ(a2) += [(0.2x0.03) + (0.003x0.97)]x0.5 ++ [(0.8x0.03) + (0.997x0.97)]x0.5 = 0.5 + +λ message Alarm --> FreightTruck +λAlarm(f1) += [p(a1|b1,f1).πAlarm(b1) + p(a1|b2,f1).πAlarm(b2)].λ(a1) ++ [p(a2|b1,f1).πAlarm(b1) + p(a2|b2,f1).πAlarm(b2)].λ(a2) += [(0.992x0.005) + (0.2x0.995)]x0.5 ++ [(0.008x0.005) + (0.8x0.995)]x0.5 = 0.5 +λAlarm(f2) += [p(a1|b1,f2).πAlarm(b1) + p(a1|b2,f2).πAlarm(b2)].λ(a1) ++ [p(a2|b1,f2).πAlarm(b1) + p(a2|b2,f2).πAlarm(b2)].λ(a2) += [(0.99x0.005) + (0.003x0.995)]x0.5 ++ [(0.01x0.005) + (0.997x0.995)]x0.5 = 0.5 + +λ message _Jn --> FreightTruck +λ_Jn(f1) += [p(_jn0|f1,a1).π_Jn(a1) + p(_jn0|f1,a2).π_Jn(a2)].λ(_jn0) ++ [p(_jn1|f1,a1).π_Jn(a1) + p(_jn1|f1,a2).π_Jn(a2)].λ(_jn1) ++ [p(_jn2|f1,a1).π_Jn(a1) + p(_jn2|f1,a2).π_Jn(a2)].λ(_jn2) ++ [p(_jn3|f1,a1).π_Jn(a1) + p(_jn3|f1,a2).π_Jn(a2)].λ(_jn3) += [(1x0.0138158) + (0x0.986184)]x1 ++ [(0x0.0138158) + (1x0.986184)]x1 ++ [(0x0.0138158) + (0x0.986184)]x1 ++ [(0x0.0138158) + (0x0.986184)]x1 = 1 +λ_Jn(f2) += [p(_jn0|f2,a1).π_Jn(a1) + p(_jn0|f2,a2).π_Jn(a2)].λ(_jn0) ++ [p(_jn1|f2,a1).π_Jn(a1) + p(_jn1|f2,a2).π_Jn(a2)].λ(_jn1) ++ [p(_jn2|f2,a1).π_Jn(a1) + p(_jn2|f2,a2).π_Jn(a2)].λ(_jn2) ++ [p(_jn3|f2,a1).π_Jn(a1) + p(_jn3|f2,a2).π_Jn(a2)].λ(_jn3) += [(0x0.0138158) + (0x0.986184)]x1 ++ [(0x0.0138158) + (0x0.986184)]x1 ++ [(1x0.0138158) + (0x0.986184)]x1 ++ [(0x0.0138158) + (1x0.986184)]x1 = 1 + +λ message _Jn --> Alarm +λ_Jn(a1) += [p(_jn0|f1,a1).π_Jn(f1) + p(_jn0|f2,a1).π_Jn(f2)].λ(_jn0) ++ [p(_jn1|f1,a1).π_Jn(f1) + p(_jn1|f2,a1).π_Jn(f2)].λ(_jn1) ++ [p(_jn2|f1,a1).π_Jn(f1) + p(_jn2|f2,a1).π_Jn(f2)].λ(_jn2) ++ [p(_jn3|f1,a1).π_Jn(f1) + p(_jn3|f2,a1).π_Jn(f2)].λ(_jn3) += [(1x0.03) + (0x0.97)]x1 ++ [(0x0.03) + (0x0.97)]x1 ++ [(0x0.03) + (1x0.97)]x1 ++ [(0x0.03) + (0x0.97)]x1 = 1 +λ_Jn(a2) += [p(_jn0|f1,a2).π_Jn(f1) + p(_jn0|f2,a2).π_Jn(f2)].λ(_jn0) ++ [p(_jn1|f1,a2).π_Jn(f1) + p(_jn1|f2,a2).π_Jn(f2)].λ(_jn1) ++ [p(_jn2|f1,a2).π_Jn(f1) + p(_jn2|f2,a2).π_Jn(f2)].λ(_jn2) ++ [p(_jn3|f1,a2).π_Jn(f1) + p(_jn3|f2,a2).π_Jn(f2)].λ(_jn3) += [(0x0.03) + (0x0.97)]x1 ++ [(1x0.03) + (0x0.97)]x1 ++ [(0x0.03) + (0x0.97)]x1 ++ [(0x0.03) + (1x0.97)]x1 = 1 + +π message Burglar --> Alarm +πAlarm(b1) = π(b1) = 0.005 = 0.005 +πAlarm(b2) = π(b2) = 0.995 = 0.995 + +π message FreightTruck --> Alarm +πAlarm(f1) = π(f1).λ_Jn(f1) = 0.03 x 0.5 = 0.015 +πAlarm(f2) = π(f2).λ_Jn(f2) = 0.97 x 0.5 = 0.485 + +π message FreightTruck --> _Jn +π_Jn(f1) = π(f1).λAlarm(f1) = 0.03 x 0.5 = 0.015 +π_Jn(f2) = π(f2).λAlarm(f2) = 0.97 x 0.5 = 0.485 + +π message Alarm --> _Jn +π_Jn(a1) = π(a1) = 0.0138158 = 0.01381575 +π_Jn(a2) = π(a2) = 0.986184 = 0.98618425 + +var Burglar: +π(b1) += p(b1) += (0.005) = 0.005 +π(b2) += p(b2) += (0.995) = 0.995 +λ(b1) = λAlarm(b1) = 0.5 = 0.5 +λ(b2) = λAlarm(b2) = 0.5 = 0.5 +belief change = 0 + +var FreightTruck: +π(f1) += p(f1) += (0.03) = 0.03 +π(f2) += p(f2) += (0.97) = 0.97 +λ(f1) = λAlarm(f1).λ_Jn(f1) = 0.5 x 0.5 = 0.25 +λ(f2) = λAlarm(f2).λ_Jn(f2) = 0.5 x 0.5 = 0.25 +belief change = 0 + +var Alarm: +π(a1) += p(a1|b1,f1).πAlarm(b1).πAlarm(f1) ++ p(a1|b1,f2).πAlarm(b1).πAlarm(f2) ++ p(a1|b2,f1).πAlarm(b2).πAlarm(f1) ++ p(a1|b2,f2).πAlarm(b2).πAlarm(f2) += (0.992x0.005x0.03) ++ (0.99x0.005x0.97) ++ (0.2x0.995x0.03) ++ (0.003x0.995x0.97) = 0.01381575 +π(a2) += p(a2|b1,f1).πAlarm(b1).πAlarm(f1) ++ p(a2|b1,f2).πAlarm(b1).πAlarm(f2) ++ p(a2|b2,f1).πAlarm(b2).πAlarm(f1) ++ p(a2|b2,f2).πAlarm(b2).πAlarm(f2) += (0.008x0.005x0.03) ++ (0.01x0.005x0.97) ++ (0.8x0.995x0.03) ++ (0.997x0.995x0.97) = 0.98618425 +λ(a1) = λ_Jn(a1) = 0.5 = 0.5 +λ(a2) = λ_Jn(a2) = 0.5 = 0.5 +belief change = 6.938893904e-18 + +var _Jn: +π(_jn0) += p(_jn0|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn0|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn0|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn0|f2,a2).π_Jn(f2).π_Jn(a2) += (1x0.03x0.0138158) ++ (0x0.03x0.986184) ++ (0x0.97x0.0138158) ++ (0x0.97x0.986184) = 0.0004144725 +π(_jn1) += p(_jn1|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn1|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn1|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn1|f2,a2).π_Jn(f2).π_Jn(a2) += (0x0.03x0.0138158) ++ (1x0.03x0.986184) ++ (0x0.97x0.0138158) ++ (0x0.97x0.986184) = 0.0295855275 +π(_jn2) += p(_jn2|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn2|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn2|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn2|f2,a2).π_Jn(f2).π_Jn(a2) += (0x0.03x0.0138158) ++ (0x0.03x0.986184) ++ (1x0.97x0.0138158) ++ (0x0.97x0.986184) = 0.0134012775 +π(_jn3) += p(_jn3|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn3|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn3|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn3|f2,a2).π_Jn(f2).π_Jn(a2) += (0x0.03x0.0138158) ++ (0x0.03x0.986184) ++ (0x0.97x0.0138158) ++ (1x0.97x0.986184) = 0.9565987225 +λ(_jn0) = 1 +λ(_jn1) = 1 +λ(_jn2) = 1 +λ(_jn3) = 1 +belief change = 5.838428699e-17 + +domain π(Burglar) λ(Burglar) belief +---------------------------------------------------------------- +b1 0.005 0.5 0.005 +b2 0.995 0.5 0.995 + +domain πAlarm(Burglar) λAlarm(Burglar) +---------------------------------------------------------------- +b1 0.005 0.5 +b2 0.995 0.5 + +domain π(FreightTruck) λ(FreightTruck) belief +---------------------------------------------------------------- +f1 0.03 0.25 0.03 +f2 0.97 0.25 0.97 + +domain πAlarm(FreightTruck) λAlarm(FreightTruck) +---------------------------------------------------------------- +f1 0.03 0.5 +f2 0.97 0.5 + +domain π_Jn(FreightTruck) λ_Jn(FreightTruck) +---------------------------------------------------------------- +f1 0.03 0.5 +f2 0.97 0.5 + +domain π(Alarm) λ(Alarm) belief +---------------------------------------------------------------- +a1 0.01381575 0.5 0.01381575 +a2 0.98618425 0.5 0.98618425 + +domain π_Jn(Alarm) λ_Jn(Alarm) +---------------------------------------------------------------- +a1 0.01381575 0.5 +a2 0.98618425 0.5 + +domain π(_Jn) λ(_Jn) belief +---------------------------------------------------------------- +_jn0 0.0004144725 1 0.0004144725 +_jn1 0.0295855275 1 0.0295855275 +_jn2 0.0134012775 1 0.0134012775 +_jn3 0.9565987225 1 0.9565987225 + + + +******************************************************************************** + Iteration 91 +******************************************************************************** +λ message Alarm --> Burglar +λAlarm(b1) += [p(a1|b1,f1).πAlarm(f1) + p(a1|b1,f2).πAlarm(f2)].λ(a1) ++ [p(a2|b1,f1).πAlarm(f1) + p(a2|b1,f2).πAlarm(f2)].λ(a2) += [(0.992x0.03) + (0.99x0.97)]x0.5 ++ [(0.008x0.03) + (0.01x0.97)]x0.5 = 0.5 +λAlarm(b2) += [p(a1|b2,f1).πAlarm(f1) + p(a1|b2,f2).πAlarm(f2)].λ(a1) ++ [p(a2|b2,f1).πAlarm(f1) + p(a2|b2,f2).πAlarm(f2)].λ(a2) += [(0.2x0.03) + (0.003x0.97)]x0.5 ++ [(0.8x0.03) + (0.997x0.97)]x0.5 = 0.5 + +λ message Alarm --> FreightTruck +λAlarm(f1) += [p(a1|b1,f1).πAlarm(b1) + p(a1|b2,f1).πAlarm(b2)].λ(a1) ++ [p(a2|b1,f1).πAlarm(b1) + p(a2|b2,f1).πAlarm(b2)].λ(a2) += [(0.992x0.005) + (0.2x0.995)]x0.5 ++ [(0.008x0.005) + (0.8x0.995)]x0.5 = 0.5 +λAlarm(f2) += [p(a1|b1,f2).πAlarm(b1) + p(a1|b2,f2).πAlarm(b2)].λ(a1) ++ [p(a2|b1,f2).πAlarm(b1) + p(a2|b2,f2).πAlarm(b2)].λ(a2) += [(0.99x0.005) + (0.003x0.995)]x0.5 ++ [(0.01x0.005) + (0.997x0.995)]x0.5 = 0.5 + +λ message _Jn --> FreightTruck +λ_Jn(f1) += [p(_jn0|f1,a1).π_Jn(a1) + p(_jn0|f1,a2).π_Jn(a2)].λ(_jn0) ++ [p(_jn1|f1,a1).π_Jn(a1) + p(_jn1|f1,a2).π_Jn(a2)].λ(_jn1) ++ [p(_jn2|f1,a1).π_Jn(a1) + p(_jn2|f1,a2).π_Jn(a2)].λ(_jn2) ++ [p(_jn3|f1,a1).π_Jn(a1) + p(_jn3|f1,a2).π_Jn(a2)].λ(_jn3) += [(1x0.0138158) + (0x0.986184)]x1 ++ [(0x0.0138158) + (1x0.986184)]x1 ++ [(0x0.0138158) + (0x0.986184)]x1 ++ [(0x0.0138158) + (0x0.986184)]x1 = 1 +λ_Jn(f2) += [p(_jn0|f2,a1).π_Jn(a1) + p(_jn0|f2,a2).π_Jn(a2)].λ(_jn0) ++ [p(_jn1|f2,a1).π_Jn(a1) + p(_jn1|f2,a2).π_Jn(a2)].λ(_jn1) ++ [p(_jn2|f2,a1).π_Jn(a1) + p(_jn2|f2,a2).π_Jn(a2)].λ(_jn2) ++ [p(_jn3|f2,a1).π_Jn(a1) + p(_jn3|f2,a2).π_Jn(a2)].λ(_jn3) += [(0x0.0138158) + (0x0.986184)]x1 ++ [(0x0.0138158) + (0x0.986184)]x1 ++ [(1x0.0138158) + (0x0.986184)]x1 ++ [(0x0.0138158) + (1x0.986184)]x1 = 1 + +λ message _Jn --> Alarm +λ_Jn(a1) += [p(_jn0|f1,a1).π_Jn(f1) + p(_jn0|f2,a1).π_Jn(f2)].λ(_jn0) ++ [p(_jn1|f1,a1).π_Jn(f1) + p(_jn1|f2,a1).π_Jn(f2)].λ(_jn1) ++ [p(_jn2|f1,a1).π_Jn(f1) + p(_jn2|f2,a1).π_Jn(f2)].λ(_jn2) ++ [p(_jn3|f1,a1).π_Jn(f1) + p(_jn3|f2,a1).π_Jn(f2)].λ(_jn3) += [(1x0.03) + (0x0.97)]x1 ++ [(0x0.03) + (0x0.97)]x1 ++ [(0x0.03) + (1x0.97)]x1 ++ [(0x0.03) + (0x0.97)]x1 = 1 +λ_Jn(a2) += [p(_jn0|f1,a2).π_Jn(f1) + p(_jn0|f2,a2).π_Jn(f2)].λ(_jn0) ++ [p(_jn1|f1,a2).π_Jn(f1) + p(_jn1|f2,a2).π_Jn(f2)].λ(_jn1) ++ [p(_jn2|f1,a2).π_Jn(f1) + p(_jn2|f2,a2).π_Jn(f2)].λ(_jn2) ++ [p(_jn3|f1,a2).π_Jn(f1) + p(_jn3|f2,a2).π_Jn(f2)].λ(_jn3) += [(0x0.03) + (0x0.97)]x1 ++ [(1x0.03) + (0x0.97)]x1 ++ [(0x0.03) + (0x0.97)]x1 ++ [(0x0.03) + (1x0.97)]x1 = 1 + +π message Burglar --> Alarm +πAlarm(b1) = π(b1) = 0.005 = 0.005 +πAlarm(b2) = π(b2) = 0.995 = 0.995 + +π message FreightTruck --> Alarm +πAlarm(f1) = π(f1).λ_Jn(f1) = 0.03 x 0.5 = 0.015 +πAlarm(f2) = π(f2).λ_Jn(f2) = 0.97 x 0.5 = 0.485 + +π message FreightTruck --> _Jn +π_Jn(f1) = π(f1).λAlarm(f1) = 0.03 x 0.5 = 0.015 +π_Jn(f2) = π(f2).λAlarm(f2) = 0.97 x 0.5 = 0.485 + +π message Alarm --> _Jn +π_Jn(a1) = π(a1) = 0.0138158 = 0.01381575 +π_Jn(a2) = π(a2) = 0.986184 = 0.98618425 + +var Burglar: +π(b1) += p(b1) += (0.005) = 0.005 +π(b2) += p(b2) += (0.995) = 0.995 +λ(b1) = λAlarm(b1) = 0.5 = 0.5 +λ(b2) = λAlarm(b2) = 0.5 = 0.5 +belief change = 0 + +var FreightTruck: +π(f1) += p(f1) += (0.03) = 0.03 +π(f2) += p(f2) += (0.97) = 0.97 +λ(f1) = λAlarm(f1).λ_Jn(f1) = 0.5 x 0.5 = 0.25 +λ(f2) = λAlarm(f2).λ_Jn(f2) = 0.5 x 0.5 = 0.25 +belief change = 0 + +var Alarm: +π(a1) += p(a1|b1,f1).πAlarm(b1).πAlarm(f1) ++ p(a1|b1,f2).πAlarm(b1).πAlarm(f2) ++ p(a1|b2,f1).πAlarm(b2).πAlarm(f1) ++ p(a1|b2,f2).πAlarm(b2).πAlarm(f2) += (0.992x0.005x0.03) ++ (0.99x0.005x0.97) ++ (0.2x0.995x0.03) ++ (0.003x0.995x0.97) = 0.01381575 +π(a2) += p(a2|b1,f1).πAlarm(b1).πAlarm(f1) ++ p(a2|b1,f2).πAlarm(b1).πAlarm(f2) ++ p(a2|b2,f1).πAlarm(b2).πAlarm(f1) ++ p(a2|b2,f2).πAlarm(b2).πAlarm(f2) += (0.008x0.005x0.03) ++ (0.01x0.005x0.97) ++ (0.8x0.995x0.03) ++ (0.997x0.995x0.97) = 0.98618425 +λ(a1) = λ_Jn(a1) = 0.5 = 0.5 +λ(a2) = λ_Jn(a2) = 0.5 = 0.5 +belief change = 6.938893904e-18 + +var _Jn: +π(_jn0) += p(_jn0|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn0|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn0|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn0|f2,a2).π_Jn(f2).π_Jn(a2) += (1x0.03x0.0138158) ++ (0x0.03x0.986184) ++ (0x0.97x0.0138158) ++ (0x0.97x0.986184) = 0.0004144725 +π(_jn1) += p(_jn1|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn1|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn1|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn1|f2,a2).π_Jn(f2).π_Jn(a2) += (0x0.03x0.0138158) ++ (1x0.03x0.986184) ++ (0x0.97x0.0138158) ++ (0x0.97x0.986184) = 0.0295855275 +π(_jn2) += p(_jn2|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn2|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn2|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn2|f2,a2).π_Jn(f2).π_Jn(a2) += (0x0.03x0.0138158) ++ (0x0.03x0.986184) ++ (1x0.97x0.0138158) ++ (0x0.97x0.986184) = 0.0134012775 +π(_jn3) += p(_jn3|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn3|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn3|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn3|f2,a2).π_Jn(f2).π_Jn(a2) += (0x0.03x0.0138158) ++ (0x0.03x0.986184) ++ (0x0.97x0.0138158) ++ (1x0.97x0.986184) = 0.9565987225 +λ(_jn0) = 1 +λ(_jn1) = 1 +λ(_jn2) = 1 +λ(_jn3) = 1 +belief change = 4.065758147e-17 + +domain π(Burglar) λ(Burglar) belief +---------------------------------------------------------------- +b1 0.005 0.5 0.005 +b2 0.995 0.5 0.995 + +domain πAlarm(Burglar) λAlarm(Burglar) +---------------------------------------------------------------- +b1 0.005 0.5 +b2 0.995 0.5 + +domain π(FreightTruck) λ(FreightTruck) belief +---------------------------------------------------------------- +f1 0.03 0.25 0.03 +f2 0.97 0.25 0.97 + +domain πAlarm(FreightTruck) λAlarm(FreightTruck) +---------------------------------------------------------------- +f1 0.03 0.5 +f2 0.97 0.5 + +domain π_Jn(FreightTruck) λ_Jn(FreightTruck) +---------------------------------------------------------------- +f1 0.03 0.5 +f2 0.97 0.5 + +domain π(Alarm) λ(Alarm) belief +---------------------------------------------------------------- +a1 0.01381575 0.5 0.01381575 +a2 0.98618425 0.5 0.98618425 + +domain π_Jn(Alarm) λ_Jn(Alarm) +---------------------------------------------------------------- +a1 0.01381575 0.5 +a2 0.98618425 0.5 + +domain π(_Jn) λ(_Jn) belief +---------------------------------------------------------------- +_jn0 0.0004144725 1 0.0004144725 +_jn1 0.0295855275 1 0.0295855275 +_jn2 0.0134012775 1 0.0134012775 +_jn3 0.9565987225 1 0.9565987225 + + + +******************************************************************************** + Iteration 92 +******************************************************************************** +λ message Alarm --> Burglar +λAlarm(b1) += [p(a1|b1,f1).πAlarm(f1) + p(a1|b1,f2).πAlarm(f2)].λ(a1) ++ [p(a2|b1,f1).πAlarm(f1) + p(a2|b1,f2).πAlarm(f2)].λ(a2) += [(0.992x0.03) + (0.99x0.97)]x0.5 ++ [(0.008x0.03) + (0.01x0.97)]x0.5 = 0.5 +λAlarm(b2) += [p(a1|b2,f1).πAlarm(f1) + p(a1|b2,f2).πAlarm(f2)].λ(a1) ++ [p(a2|b2,f1).πAlarm(f1) + p(a2|b2,f2).πAlarm(f2)].λ(a2) += [(0.2x0.03) + (0.003x0.97)]x0.5 ++ [(0.8x0.03) + (0.997x0.97)]x0.5 = 0.5 + +λ message Alarm --> FreightTruck +λAlarm(f1) += [p(a1|b1,f1).πAlarm(b1) + p(a1|b2,f1).πAlarm(b2)].λ(a1) ++ [p(a2|b1,f1).πAlarm(b1) + p(a2|b2,f1).πAlarm(b2)].λ(a2) += [(0.992x0.005) + (0.2x0.995)]x0.5 ++ [(0.008x0.005) + (0.8x0.995)]x0.5 = 0.5 +λAlarm(f2) += [p(a1|b1,f2).πAlarm(b1) + p(a1|b2,f2).πAlarm(b2)].λ(a1) ++ [p(a2|b1,f2).πAlarm(b1) + p(a2|b2,f2).πAlarm(b2)].λ(a2) += [(0.99x0.005) + (0.003x0.995)]x0.5 ++ [(0.01x0.005) + (0.997x0.995)]x0.5 = 0.5 + +λ message _Jn --> FreightTruck +λ_Jn(f1) += [p(_jn0|f1,a1).π_Jn(a1) + p(_jn0|f1,a2).π_Jn(a2)].λ(_jn0) ++ [p(_jn1|f1,a1).π_Jn(a1) + p(_jn1|f1,a2).π_Jn(a2)].λ(_jn1) ++ [p(_jn2|f1,a1).π_Jn(a1) + p(_jn2|f1,a2).π_Jn(a2)].λ(_jn2) ++ [p(_jn3|f1,a1).π_Jn(a1) + p(_jn3|f1,a2).π_Jn(a2)].λ(_jn3) += [(1x0.0138158) + (0x0.986184)]x1 ++ [(0x0.0138158) + (1x0.986184)]x1 ++ [(0x0.0138158) + (0x0.986184)]x1 ++ [(0x0.0138158) + (0x0.986184)]x1 = 1 +λ_Jn(f2) += [p(_jn0|f2,a1).π_Jn(a1) + p(_jn0|f2,a2).π_Jn(a2)].λ(_jn0) ++ [p(_jn1|f2,a1).π_Jn(a1) + p(_jn1|f2,a2).π_Jn(a2)].λ(_jn1) ++ [p(_jn2|f2,a1).π_Jn(a1) + p(_jn2|f2,a2).π_Jn(a2)].λ(_jn2) ++ [p(_jn3|f2,a1).π_Jn(a1) + p(_jn3|f2,a2).π_Jn(a2)].λ(_jn3) += [(0x0.0138158) + (0x0.986184)]x1 ++ [(0x0.0138158) + (0x0.986184)]x1 ++ [(1x0.0138158) + (0x0.986184)]x1 ++ [(0x0.0138158) + (1x0.986184)]x1 = 1 + +λ message _Jn --> Alarm +λ_Jn(a1) += [p(_jn0|f1,a1).π_Jn(f1) + p(_jn0|f2,a1).π_Jn(f2)].λ(_jn0) ++ [p(_jn1|f1,a1).π_Jn(f1) + p(_jn1|f2,a1).π_Jn(f2)].λ(_jn1) ++ [p(_jn2|f1,a1).π_Jn(f1) + p(_jn2|f2,a1).π_Jn(f2)].λ(_jn2) ++ [p(_jn3|f1,a1).π_Jn(f1) + p(_jn3|f2,a1).π_Jn(f2)].λ(_jn3) += [(1x0.03) + (0x0.97)]x1 ++ [(0x0.03) + (0x0.97)]x1 ++ [(0x0.03) + (1x0.97)]x1 ++ [(0x0.03) + (0x0.97)]x1 = 1 +λ_Jn(a2) += [p(_jn0|f1,a2).π_Jn(f1) + p(_jn0|f2,a2).π_Jn(f2)].λ(_jn0) ++ [p(_jn1|f1,a2).π_Jn(f1) + p(_jn1|f2,a2).π_Jn(f2)].λ(_jn1) ++ [p(_jn2|f1,a2).π_Jn(f1) + p(_jn2|f2,a2).π_Jn(f2)].λ(_jn2) ++ [p(_jn3|f1,a2).π_Jn(f1) + p(_jn3|f2,a2).π_Jn(f2)].λ(_jn3) += [(0x0.03) + (0x0.97)]x1 ++ [(1x0.03) + (0x0.97)]x1 ++ [(0x0.03) + (0x0.97)]x1 ++ [(0x0.03) + (1x0.97)]x1 = 1 + +π message Burglar --> Alarm +πAlarm(b1) = π(b1) = 0.005 = 0.005 +πAlarm(b2) = π(b2) = 0.995 = 0.995 + +π message FreightTruck --> Alarm +πAlarm(f1) = π(f1).λ_Jn(f1) = 0.03 x 0.5 = 0.015 +πAlarm(f2) = π(f2).λ_Jn(f2) = 0.97 x 0.5 = 0.485 + +π message FreightTruck --> _Jn +π_Jn(f1) = π(f1).λAlarm(f1) = 0.03 x 0.5 = 0.015 +π_Jn(f2) = π(f2).λAlarm(f2) = 0.97 x 0.5 = 0.485 + +π message Alarm --> _Jn +π_Jn(a1) = π(a1) = 0.0138158 = 0.01381575 +π_Jn(a2) = π(a2) = 0.986184 = 0.98618425 + +var Burglar: +π(b1) += p(b1) += (0.005) = 0.005 +π(b2) += p(b2) += (0.995) = 0.995 +λ(b1) = λAlarm(b1) = 0.5 = 0.5 +λ(b2) = λAlarm(b2) = 0.5 = 0.5 +belief change = 0 + +var FreightTruck: +π(f1) += p(f1) += (0.03) = 0.03 +π(f2) += p(f2) += (0.97) = 0.97 +λ(f1) = λAlarm(f1).λ_Jn(f1) = 0.5 x 0.5 = 0.25 +λ(f2) = λAlarm(f2).λ_Jn(f2) = 0.5 x 0.5 = 0.25 +belief change = 0 + +var Alarm: +π(a1) += p(a1|b1,f1).πAlarm(b1).πAlarm(f1) ++ p(a1|b1,f2).πAlarm(b1).πAlarm(f2) ++ p(a1|b2,f1).πAlarm(b2).πAlarm(f1) ++ p(a1|b2,f2).πAlarm(b2).πAlarm(f2) += (0.992x0.005x0.03) ++ (0.99x0.005x0.97) ++ (0.2x0.995x0.03) ++ (0.003x0.995x0.97) = 0.01381575 +π(a2) += p(a2|b1,f1).πAlarm(b1).πAlarm(f1) ++ p(a2|b1,f2).πAlarm(b1).πAlarm(f2) ++ p(a2|b2,f1).πAlarm(b2).πAlarm(f1) ++ p(a2|b2,f2).πAlarm(b2).πAlarm(f2) += (0.008x0.005x0.03) ++ (0.01x0.005x0.97) ++ (0.8x0.995x0.03) ++ (0.997x0.995x0.97) = 0.98618425 +λ(a1) = λ_Jn(a1) = 0.5 = 0.5 +λ(a2) = λ_Jn(a2) = 0.5 = 0.5 +belief change = 3.469446952e-18 + +var _Jn: +π(_jn0) += p(_jn0|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn0|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn0|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn0|f2,a2).π_Jn(f2).π_Jn(a2) += (1x0.03x0.0138158) ++ (0x0.03x0.986184) ++ (0x0.97x0.0138158) ++ (0x0.97x0.986184) = 0.0004144725 +π(_jn1) += p(_jn1|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn1|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn1|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn1|f2,a2).π_Jn(f2).π_Jn(a2) += (0x0.03x0.0138158) ++ (1x0.03x0.986184) ++ (0x0.97x0.0138158) ++ (0x0.97x0.986184) = 0.0295855275 +π(_jn2) += p(_jn2|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn2|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn2|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn2|f2,a2).π_Jn(f2).π_Jn(a2) += (0x0.03x0.0138158) ++ (0x0.03x0.986184) ++ (1x0.97x0.0138158) ++ (0x0.97x0.986184) = 0.0134012775 +π(_jn3) += p(_jn3|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn3|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn3|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn3|f2,a2).π_Jn(f2).π_Jn(a2) += (0x0.03x0.0138158) ++ (0x0.03x0.986184) ++ (0x0.97x0.0138158) ++ (1x0.97x0.986184) = 0.9565987225 +λ(_jn0) = 1 +λ(_jn1) = 1 +λ(_jn2) = 1 +λ(_jn3) = 1 +belief change = 1.341158087e-16 + +domain π(Burglar) λ(Burglar) belief +---------------------------------------------------------------- +b1 0.005 0.5 0.005 +b2 0.995 0.5 0.995 + +domain πAlarm(Burglar) λAlarm(Burglar) +---------------------------------------------------------------- +b1 0.005 0.5 +b2 0.995 0.5 + +domain π(FreightTruck) λ(FreightTruck) belief +---------------------------------------------------------------- +f1 0.03 0.25 0.03 +f2 0.97 0.25 0.97 + +domain πAlarm(FreightTruck) λAlarm(FreightTruck) +---------------------------------------------------------------- +f1 0.03 0.5 +f2 0.97 0.5 + +domain π_Jn(FreightTruck) λ_Jn(FreightTruck) +---------------------------------------------------------------- +f1 0.03 0.5 +f2 0.97 0.5 + +domain π(Alarm) λ(Alarm) belief +---------------------------------------------------------------- +a1 0.01381575 0.5 0.01381575 +a2 0.98618425 0.5 0.98618425 + +domain π_Jn(Alarm) λ_Jn(Alarm) +---------------------------------------------------------------- +a1 0.01381575 0.5 +a2 0.98618425 0.5 + +domain π(_Jn) λ(_Jn) belief +---------------------------------------------------------------- +_jn0 0.0004144725 1 0.0004144725 +_jn1 0.0295855275 1 0.0295855275 +_jn2 0.0134012775 1 0.0134012775 +_jn3 0.9565987225 1 0.9565987225 + + + +******************************************************************************** + Iteration 93 +******************************************************************************** +λ message Alarm --> Burglar +λAlarm(b1) += [p(a1|b1,f1).πAlarm(f1) + p(a1|b1,f2).πAlarm(f2)].λ(a1) ++ [p(a2|b1,f1).πAlarm(f1) + p(a2|b1,f2).πAlarm(f2)].λ(a2) += [(0.992x0.03) + (0.99x0.97)]x0.5 ++ [(0.008x0.03) + (0.01x0.97)]x0.5 = 0.5 +λAlarm(b2) += [p(a1|b2,f1).πAlarm(f1) + p(a1|b2,f2).πAlarm(f2)].λ(a1) ++ [p(a2|b2,f1).πAlarm(f1) + p(a2|b2,f2).πAlarm(f2)].λ(a2) += [(0.2x0.03) + (0.003x0.97)]x0.5 ++ [(0.8x0.03) + (0.997x0.97)]x0.5 = 0.5 + +λ message Alarm --> FreightTruck +λAlarm(f1) += [p(a1|b1,f1).πAlarm(b1) + p(a1|b2,f1).πAlarm(b2)].λ(a1) ++ [p(a2|b1,f1).πAlarm(b1) + p(a2|b2,f1).πAlarm(b2)].λ(a2) += [(0.992x0.005) + (0.2x0.995)]x0.5 ++ [(0.008x0.005) + (0.8x0.995)]x0.5 = 0.5 +λAlarm(f2) += [p(a1|b1,f2).πAlarm(b1) + p(a1|b2,f2).πAlarm(b2)].λ(a1) ++ [p(a2|b1,f2).πAlarm(b1) + p(a2|b2,f2).πAlarm(b2)].λ(a2) += [(0.99x0.005) + (0.003x0.995)]x0.5 ++ [(0.01x0.005) + (0.997x0.995)]x0.5 = 0.5 + +λ message _Jn --> FreightTruck +λ_Jn(f1) += [p(_jn0|f1,a1).π_Jn(a1) + p(_jn0|f1,a2).π_Jn(a2)].λ(_jn0) ++ [p(_jn1|f1,a1).π_Jn(a1) + p(_jn1|f1,a2).π_Jn(a2)].λ(_jn1) ++ [p(_jn2|f1,a1).π_Jn(a1) + p(_jn2|f1,a2).π_Jn(a2)].λ(_jn2) ++ [p(_jn3|f1,a1).π_Jn(a1) + p(_jn3|f1,a2).π_Jn(a2)].λ(_jn3) += [(1x0.0138158) + (0x0.986184)]x1 ++ [(0x0.0138158) + (1x0.986184)]x1 ++ [(0x0.0138158) + (0x0.986184)]x1 ++ [(0x0.0138158) + (0x0.986184)]x1 = 1 +λ_Jn(f2) += [p(_jn0|f2,a1).π_Jn(a1) + p(_jn0|f2,a2).π_Jn(a2)].λ(_jn0) ++ [p(_jn1|f2,a1).π_Jn(a1) + p(_jn1|f2,a2).π_Jn(a2)].λ(_jn1) ++ [p(_jn2|f2,a1).π_Jn(a1) + p(_jn2|f2,a2).π_Jn(a2)].λ(_jn2) ++ [p(_jn3|f2,a1).π_Jn(a1) + p(_jn3|f2,a2).π_Jn(a2)].λ(_jn3) += [(0x0.0138158) + (0x0.986184)]x1 ++ [(0x0.0138158) + (0x0.986184)]x1 ++ [(1x0.0138158) + (0x0.986184)]x1 ++ [(0x0.0138158) + (1x0.986184)]x1 = 1 + +λ message _Jn --> Alarm +λ_Jn(a1) += [p(_jn0|f1,a1).π_Jn(f1) + p(_jn0|f2,a1).π_Jn(f2)].λ(_jn0) ++ [p(_jn1|f1,a1).π_Jn(f1) + p(_jn1|f2,a1).π_Jn(f2)].λ(_jn1) ++ [p(_jn2|f1,a1).π_Jn(f1) + p(_jn2|f2,a1).π_Jn(f2)].λ(_jn2) ++ [p(_jn3|f1,a1).π_Jn(f1) + p(_jn3|f2,a1).π_Jn(f2)].λ(_jn3) += [(1x0.03) + (0x0.97)]x1 ++ [(0x0.03) + (0x0.97)]x1 ++ [(0x0.03) + (1x0.97)]x1 ++ [(0x0.03) + (0x0.97)]x1 = 1 +λ_Jn(a2) += [p(_jn0|f1,a2).π_Jn(f1) + p(_jn0|f2,a2).π_Jn(f2)].λ(_jn0) ++ [p(_jn1|f1,a2).π_Jn(f1) + p(_jn1|f2,a2).π_Jn(f2)].λ(_jn1) ++ [p(_jn2|f1,a2).π_Jn(f1) + p(_jn2|f2,a2).π_Jn(f2)].λ(_jn2) ++ [p(_jn3|f1,a2).π_Jn(f1) + p(_jn3|f2,a2).π_Jn(f2)].λ(_jn3) += [(0x0.03) + (0x0.97)]x1 ++ [(1x0.03) + (0x0.97)]x1 ++ [(0x0.03) + (0x0.97)]x1 ++ [(0x0.03) + (1x0.97)]x1 = 1 + +π message Burglar --> Alarm +πAlarm(b1) = π(b1) = 0.005 = 0.005 +πAlarm(b2) = π(b2) = 0.995 = 0.995 + +π message FreightTruck --> Alarm +πAlarm(f1) = π(f1).λ_Jn(f1) = 0.03 x 0.5 = 0.015 +πAlarm(f2) = π(f2).λ_Jn(f2) = 0.97 x 0.5 = 0.485 + +π message FreightTruck --> _Jn +π_Jn(f1) = π(f1).λAlarm(f1) = 0.03 x 0.5 = 0.015 +π_Jn(f2) = π(f2).λAlarm(f2) = 0.97 x 0.5 = 0.485 + +π message Alarm --> _Jn +π_Jn(a1) = π(a1) = 0.0138158 = 0.01381575 +π_Jn(a2) = π(a2) = 0.986184 = 0.98618425 + +var Burglar: +π(b1) += p(b1) += (0.005) = 0.005 +π(b2) += p(b2) += (0.995) = 0.995 +λ(b1) = λAlarm(b1) = 0.5 = 0.5 +λ(b2) = λAlarm(b2) = 0.5 = 0.5 +belief change = 0 + +var FreightTruck: +π(f1) += p(f1) += (0.03) = 0.03 +π(f2) += p(f2) += (0.97) = 0.97 +λ(f1) = λAlarm(f1).λ_Jn(f1) = 0.5 x 0.5 = 0.25 +λ(f2) = λAlarm(f2).λ_Jn(f2) = 0.5 x 0.5 = 0.25 +belief change = 0 + +var Alarm: +π(a1) += p(a1|b1,f1).πAlarm(b1).πAlarm(f1) ++ p(a1|b1,f2).πAlarm(b1).πAlarm(f2) ++ p(a1|b2,f1).πAlarm(b2).πAlarm(f1) ++ p(a1|b2,f2).πAlarm(b2).πAlarm(f2) += (0.992x0.005x0.03) ++ (0.99x0.005x0.97) ++ (0.2x0.995x0.03) ++ (0.003x0.995x0.97) = 0.01381575 +π(a2) += p(a2|b1,f1).πAlarm(b1).πAlarm(f1) ++ p(a2|b1,f2).πAlarm(b1).πAlarm(f2) ++ p(a2|b2,f1).πAlarm(b2).πAlarm(f1) ++ p(a2|b2,f2).πAlarm(b2).πAlarm(f2) += (0.008x0.005x0.03) ++ (0.01x0.005x0.97) ++ (0.8x0.995x0.03) ++ (0.997x0.995x0.97) = 0.98618425 +λ(a1) = λ_Jn(a1) = 0.5 = 0.5 +λ(a2) = λ_Jn(a2) = 0.5 = 0.5 +belief change = 1.127570259e-16 + +var _Jn: +π(_jn0) += p(_jn0|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn0|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn0|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn0|f2,a2).π_Jn(f2).π_Jn(a2) += (1x0.03x0.0138158) ++ (0x0.03x0.986184) ++ (0x0.97x0.0138158) ++ (0x0.97x0.986184) = 0.0004144725 +π(_jn1) += p(_jn1|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn1|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn1|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn1|f2,a2).π_Jn(f2).π_Jn(a2) += (0x0.03x0.0138158) ++ (1x0.03x0.986184) ++ (0x0.97x0.0138158) ++ (0x0.97x0.986184) = 0.0295855275 +π(_jn2) += p(_jn2|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn2|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn2|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn2|f2,a2).π_Jn(f2).π_Jn(a2) += (0x0.03x0.0138158) ++ (0x0.03x0.986184) ++ (1x0.97x0.0138158) ++ (0x0.97x0.986184) = 0.0134012775 +π(_jn3) += p(_jn3|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn3|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn3|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn3|f2,a2).π_Jn(f2).π_Jn(a2) += (0x0.03x0.0138158) ++ (0x0.03x0.986184) ++ (0x0.97x0.0138158) ++ (1x0.97x0.986184) = 0.9565987225 +λ(_jn0) = 1 +λ(_jn1) = 1 +λ(_jn2) = 1 +λ(_jn3) = 1 +belief change = 1.339531784e-16 + +domain π(Burglar) λ(Burglar) belief +---------------------------------------------------------------- +b1 0.005 0.5 0.005 +b2 0.995 0.5 0.995 + +domain πAlarm(Burglar) λAlarm(Burglar) +---------------------------------------------------------------- +b1 0.005 0.5 +b2 0.995 0.5 + +domain π(FreightTruck) λ(FreightTruck) belief +---------------------------------------------------------------- +f1 0.03 0.25 0.03 +f2 0.97 0.25 0.97 + +domain πAlarm(FreightTruck) λAlarm(FreightTruck) +---------------------------------------------------------------- +f1 0.03 0.5 +f2 0.97 0.5 + +domain π_Jn(FreightTruck) λ_Jn(FreightTruck) +---------------------------------------------------------------- +f1 0.03 0.5 +f2 0.97 0.5 + +domain π(Alarm) λ(Alarm) belief +---------------------------------------------------------------- +a1 0.01381575 0.5 0.01381575 +a2 0.98618425 0.5 0.98618425 + +domain π_Jn(Alarm) λ_Jn(Alarm) +---------------------------------------------------------------- +a1 0.01381575 0.5 +a2 0.98618425 0.5 + +domain π(_Jn) λ(_Jn) belief +---------------------------------------------------------------- +_jn0 0.0004144725 1 0.0004144725 +_jn1 0.0295855275 1 0.0295855275 +_jn2 0.0134012775 1 0.0134012775 +_jn3 0.9565987225 1 0.9565987225 + + + +******************************************************************************** + Iteration 94 +******************************************************************************** +λ message Alarm --> Burglar +λAlarm(b1) += [p(a1|b1,f1).πAlarm(f1) + p(a1|b1,f2).πAlarm(f2)].λ(a1) ++ [p(a2|b1,f1).πAlarm(f1) + p(a2|b1,f2).πAlarm(f2)].λ(a2) += [(0.992x0.03) + (0.99x0.97)]x0.5 ++ [(0.008x0.03) + (0.01x0.97)]x0.5 = 0.5 +λAlarm(b2) += [p(a1|b2,f1).πAlarm(f1) + p(a1|b2,f2).πAlarm(f2)].λ(a1) ++ [p(a2|b2,f1).πAlarm(f1) + p(a2|b2,f2).πAlarm(f2)].λ(a2) += [(0.2x0.03) + (0.003x0.97)]x0.5 ++ [(0.8x0.03) + (0.997x0.97)]x0.5 = 0.5 + +λ message Alarm --> FreightTruck +λAlarm(f1) += [p(a1|b1,f1).πAlarm(b1) + p(a1|b2,f1).πAlarm(b2)].λ(a1) ++ [p(a2|b1,f1).πAlarm(b1) + p(a2|b2,f1).πAlarm(b2)].λ(a2) += [(0.992x0.005) + (0.2x0.995)]x0.5 ++ [(0.008x0.005) + (0.8x0.995)]x0.5 = 0.5 +λAlarm(f2) += [p(a1|b1,f2).πAlarm(b1) + p(a1|b2,f2).πAlarm(b2)].λ(a1) ++ [p(a2|b1,f2).πAlarm(b1) + p(a2|b2,f2).πAlarm(b2)].λ(a2) += [(0.99x0.005) + (0.003x0.995)]x0.5 ++ [(0.01x0.005) + (0.997x0.995)]x0.5 = 0.5 + +λ message _Jn --> FreightTruck +λ_Jn(f1) += [p(_jn0|f1,a1).π_Jn(a1) + p(_jn0|f1,a2).π_Jn(a2)].λ(_jn0) ++ [p(_jn1|f1,a1).π_Jn(a1) + p(_jn1|f1,a2).π_Jn(a2)].λ(_jn1) ++ [p(_jn2|f1,a1).π_Jn(a1) + p(_jn2|f1,a2).π_Jn(a2)].λ(_jn2) ++ [p(_jn3|f1,a1).π_Jn(a1) + p(_jn3|f1,a2).π_Jn(a2)].λ(_jn3) += [(1x0.0138158) + (0x0.986184)]x1 ++ [(0x0.0138158) + (1x0.986184)]x1 ++ [(0x0.0138158) + (0x0.986184)]x1 ++ [(0x0.0138158) + (0x0.986184)]x1 = 1 +λ_Jn(f2) += [p(_jn0|f2,a1).π_Jn(a1) + p(_jn0|f2,a2).π_Jn(a2)].λ(_jn0) ++ [p(_jn1|f2,a1).π_Jn(a1) + p(_jn1|f2,a2).π_Jn(a2)].λ(_jn1) ++ [p(_jn2|f2,a1).π_Jn(a1) + p(_jn2|f2,a2).π_Jn(a2)].λ(_jn2) ++ [p(_jn3|f2,a1).π_Jn(a1) + p(_jn3|f2,a2).π_Jn(a2)].λ(_jn3) += [(0x0.0138158) + (0x0.986184)]x1 ++ [(0x0.0138158) + (0x0.986184)]x1 ++ [(1x0.0138158) + (0x0.986184)]x1 ++ [(0x0.0138158) + (1x0.986184)]x1 = 1 + +λ message _Jn --> Alarm +λ_Jn(a1) += [p(_jn0|f1,a1).π_Jn(f1) + p(_jn0|f2,a1).π_Jn(f2)].λ(_jn0) ++ [p(_jn1|f1,a1).π_Jn(f1) + p(_jn1|f2,a1).π_Jn(f2)].λ(_jn1) ++ [p(_jn2|f1,a1).π_Jn(f1) + p(_jn2|f2,a1).π_Jn(f2)].λ(_jn2) ++ [p(_jn3|f1,a1).π_Jn(f1) + p(_jn3|f2,a1).π_Jn(f2)].λ(_jn3) += [(1x0.03) + (0x0.97)]x1 ++ [(0x0.03) + (0x0.97)]x1 ++ [(0x0.03) + (1x0.97)]x1 ++ [(0x0.03) + (0x0.97)]x1 = 1 +λ_Jn(a2) += [p(_jn0|f1,a2).π_Jn(f1) + p(_jn0|f2,a2).π_Jn(f2)].λ(_jn0) ++ [p(_jn1|f1,a2).π_Jn(f1) + p(_jn1|f2,a2).π_Jn(f2)].λ(_jn1) ++ [p(_jn2|f1,a2).π_Jn(f1) + p(_jn2|f2,a2).π_Jn(f2)].λ(_jn2) ++ [p(_jn3|f1,a2).π_Jn(f1) + p(_jn3|f2,a2).π_Jn(f2)].λ(_jn3) += [(0x0.03) + (0x0.97)]x1 ++ [(1x0.03) + (0x0.97)]x1 ++ [(0x0.03) + (0x0.97)]x1 ++ [(0x0.03) + (1x0.97)]x1 = 1 + +π message Burglar --> Alarm +πAlarm(b1) = π(b1) = 0.005 = 0.005 +πAlarm(b2) = π(b2) = 0.995 = 0.995 + +π message FreightTruck --> Alarm +πAlarm(f1) = π(f1).λ_Jn(f1) = 0.03 x 0.5 = 0.015 +πAlarm(f2) = π(f2).λ_Jn(f2) = 0.97 x 0.5 = 0.485 + +π message FreightTruck --> _Jn +π_Jn(f1) = π(f1).λAlarm(f1) = 0.03 x 0.5 = 0.015 +π_Jn(f2) = π(f2).λAlarm(f2) = 0.97 x 0.5 = 0.485 + +π message Alarm --> _Jn +π_Jn(a1) = π(a1) = 0.0138158 = 0.01381575 +π_Jn(a2) = π(a2) = 0.986184 = 0.98618425 + +var Burglar: +π(b1) += p(b1) += (0.005) = 0.005 +π(b2) += p(b2) += (0.995) = 0.995 +λ(b1) = λAlarm(b1) = 0.5 = 0.5 +λ(b2) = λAlarm(b2) = 0.5 = 0.5 +belief change = 8.67361738e-19 + +var FreightTruck: +π(f1) += p(f1) += (0.03) = 0.03 +π(f2) += p(f2) += (0.97) = 0.97 +λ(f1) = λAlarm(f1).λ_Jn(f1) = 0.5 x 0.5 = 0.25 +λ(f2) = λAlarm(f2).λ_Jn(f2) = 0.5 x 0.5 = 0.25 +belief change = 0 + +var Alarm: +π(a1) += p(a1|b1,f1).πAlarm(b1).πAlarm(f1) ++ p(a1|b1,f2).πAlarm(b1).πAlarm(f2) ++ p(a1|b2,f1).πAlarm(b2).πAlarm(f1) ++ p(a1|b2,f2).πAlarm(b2).πAlarm(f2) += (0.992x0.005x0.03) ++ (0.99x0.005x0.97) ++ (0.2x0.995x0.03) ++ (0.003x0.995x0.97) = 0.01381575 +π(a2) += p(a2|b1,f1).πAlarm(b1).πAlarm(f1) ++ p(a2|b1,f2).πAlarm(b1).πAlarm(f2) ++ p(a2|b2,f1).πAlarm(b2).πAlarm(f1) ++ p(a2|b2,f2).πAlarm(b2).πAlarm(f2) += (0.008x0.005x0.03) ++ (0.01x0.005x0.97) ++ (0.8x0.995x0.03) ++ (0.997x0.995x0.97) = 0.98618425 +λ(a1) = λ_Jn(a1) = 0.5 = 0.5 +λ(a2) = λ_Jn(a2) = 0.5 = 0.5 +belief change = 1.734723476e-18 + +var _Jn: +π(_jn0) += p(_jn0|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn0|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn0|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn0|f2,a2).π_Jn(f2).π_Jn(a2) += (1x0.03x0.0138158) ++ (0x0.03x0.986184) ++ (0x0.97x0.0138158) ++ (0x0.97x0.986184) = 0.0004144725 +π(_jn1) += p(_jn1|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn1|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn1|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn1|f2,a2).π_Jn(f2).π_Jn(a2) += (0x0.03x0.0138158) ++ (1x0.03x0.986184) ++ (0x0.97x0.0138158) ++ (0x0.97x0.986184) = 0.0295855275 +π(_jn2) += p(_jn2|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn2|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn2|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn2|f2,a2).π_Jn(f2).π_Jn(a2) += (0x0.03x0.0138158) ++ (0x0.03x0.986184) ++ (1x0.97x0.0138158) ++ (0x0.97x0.986184) = 0.0134012775 +π(_jn3) += p(_jn3|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn3|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn3|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn3|f2,a2).π_Jn(f2).π_Jn(a2) += (0x0.03x0.0138158) ++ (0x0.03x0.986184) ++ (0x0.97x0.0138158) ++ (1x0.97x0.986184) = 0.9565987225 +λ(_jn0) = 1 +λ(_jn1) = 1 +λ(_jn2) = 1 +λ(_jn3) = 1 +belief change = 8.836247706e-18 + +domain π(Burglar) λ(Burglar) belief +---------------------------------------------------------------- +b1 0.005 0.5 0.005 +b2 0.995 0.5 0.995 + +domain πAlarm(Burglar) λAlarm(Burglar) +---------------------------------------------------------------- +b1 0.005 0.5 +b2 0.995 0.5 + +domain π(FreightTruck) λ(FreightTruck) belief +---------------------------------------------------------------- +f1 0.03 0.25 0.03 +f2 0.97 0.25 0.97 + +domain πAlarm(FreightTruck) λAlarm(FreightTruck) +---------------------------------------------------------------- +f1 0.03 0.5 +f2 0.97 0.5 + +domain π_Jn(FreightTruck) λ_Jn(FreightTruck) +---------------------------------------------------------------- +f1 0.03 0.5 +f2 0.97 0.5 + +domain π(Alarm) λ(Alarm) belief +---------------------------------------------------------------- +a1 0.01381575 0.5 0.01381575 +a2 0.98618425 0.5 0.98618425 + +domain π_Jn(Alarm) λ_Jn(Alarm) +---------------------------------------------------------------- +a1 0.01381575 0.5 +a2 0.98618425 0.5 + +domain π(_Jn) λ(_Jn) belief +---------------------------------------------------------------- +_jn0 0.0004144725 1 0.0004144725 +_jn1 0.0295855275 1 0.0295855275 +_jn2 0.0134012775 1 0.0134012775 +_jn3 0.9565987225 1 0.9565987225 + + + +******************************************************************************** + Iteration 95 +******************************************************************************** +λ message Alarm --> Burglar +λAlarm(b1) += [p(a1|b1,f1).πAlarm(f1) + p(a1|b1,f2).πAlarm(f2)].λ(a1) ++ [p(a2|b1,f1).πAlarm(f1) + p(a2|b1,f2).πAlarm(f2)].λ(a2) += [(0.992x0.03) + (0.99x0.97)]x0.5 ++ [(0.008x0.03) + (0.01x0.97)]x0.5 = 0.5 +λAlarm(b2) += [p(a1|b2,f1).πAlarm(f1) + p(a1|b2,f2).πAlarm(f2)].λ(a1) ++ [p(a2|b2,f1).πAlarm(f1) + p(a2|b2,f2).πAlarm(f2)].λ(a2) += [(0.2x0.03) + (0.003x0.97)]x0.5 ++ [(0.8x0.03) + (0.997x0.97)]x0.5 = 0.5 + +λ message Alarm --> FreightTruck +λAlarm(f1) += [p(a1|b1,f1).πAlarm(b1) + p(a1|b2,f1).πAlarm(b2)].λ(a1) ++ [p(a2|b1,f1).πAlarm(b1) + p(a2|b2,f1).πAlarm(b2)].λ(a2) += [(0.992x0.005) + (0.2x0.995)]x0.5 ++ [(0.008x0.005) + (0.8x0.995)]x0.5 = 0.5 +λAlarm(f2) += [p(a1|b1,f2).πAlarm(b1) + p(a1|b2,f2).πAlarm(b2)].λ(a1) ++ [p(a2|b1,f2).πAlarm(b1) + p(a2|b2,f2).πAlarm(b2)].λ(a2) += [(0.99x0.005) + (0.003x0.995)]x0.5 ++ [(0.01x0.005) + (0.997x0.995)]x0.5 = 0.5 + +λ message _Jn --> FreightTruck +λ_Jn(f1) += [p(_jn0|f1,a1).π_Jn(a1) + p(_jn0|f1,a2).π_Jn(a2)].λ(_jn0) ++ [p(_jn1|f1,a1).π_Jn(a1) + p(_jn1|f1,a2).π_Jn(a2)].λ(_jn1) ++ [p(_jn2|f1,a1).π_Jn(a1) + p(_jn2|f1,a2).π_Jn(a2)].λ(_jn2) ++ [p(_jn3|f1,a1).π_Jn(a1) + p(_jn3|f1,a2).π_Jn(a2)].λ(_jn3) += [(1x0.0138158) + (0x0.986184)]x1 ++ [(0x0.0138158) + (1x0.986184)]x1 ++ [(0x0.0138158) + (0x0.986184)]x1 ++ [(0x0.0138158) + (0x0.986184)]x1 = 1 +λ_Jn(f2) += [p(_jn0|f2,a1).π_Jn(a1) + p(_jn0|f2,a2).π_Jn(a2)].λ(_jn0) ++ [p(_jn1|f2,a1).π_Jn(a1) + p(_jn1|f2,a2).π_Jn(a2)].λ(_jn1) ++ [p(_jn2|f2,a1).π_Jn(a1) + p(_jn2|f2,a2).π_Jn(a2)].λ(_jn2) ++ [p(_jn3|f2,a1).π_Jn(a1) + p(_jn3|f2,a2).π_Jn(a2)].λ(_jn3) += [(0x0.0138158) + (0x0.986184)]x1 ++ [(0x0.0138158) + (0x0.986184)]x1 ++ [(1x0.0138158) + (0x0.986184)]x1 ++ [(0x0.0138158) + (1x0.986184)]x1 = 1 + +λ message _Jn --> Alarm +λ_Jn(a1) += [p(_jn0|f1,a1).π_Jn(f1) + p(_jn0|f2,a1).π_Jn(f2)].λ(_jn0) ++ [p(_jn1|f1,a1).π_Jn(f1) + p(_jn1|f2,a1).π_Jn(f2)].λ(_jn1) ++ [p(_jn2|f1,a1).π_Jn(f1) + p(_jn2|f2,a1).π_Jn(f2)].λ(_jn2) ++ [p(_jn3|f1,a1).π_Jn(f1) + p(_jn3|f2,a1).π_Jn(f2)].λ(_jn3) += [(1x0.03) + (0x0.97)]x1 ++ [(0x0.03) + (0x0.97)]x1 ++ [(0x0.03) + (1x0.97)]x1 ++ [(0x0.03) + (0x0.97)]x1 = 1 +λ_Jn(a2) += [p(_jn0|f1,a2).π_Jn(f1) + p(_jn0|f2,a2).π_Jn(f2)].λ(_jn0) ++ [p(_jn1|f1,a2).π_Jn(f1) + p(_jn1|f2,a2).π_Jn(f2)].λ(_jn1) ++ [p(_jn2|f1,a2).π_Jn(f1) + p(_jn2|f2,a2).π_Jn(f2)].λ(_jn2) ++ [p(_jn3|f1,a2).π_Jn(f1) + p(_jn3|f2,a2).π_Jn(f2)].λ(_jn3) += [(0x0.03) + (0x0.97)]x1 ++ [(1x0.03) + (0x0.97)]x1 ++ [(0x0.03) + (0x0.97)]x1 ++ [(0x0.03) + (1x0.97)]x1 = 1 + +π message Burglar --> Alarm +πAlarm(b1) = π(b1) = 0.005 = 0.005 +πAlarm(b2) = π(b2) = 0.995 = 0.995 + +π message FreightTruck --> Alarm +πAlarm(f1) = π(f1).λ_Jn(f1) = 0.03 x 0.5 = 0.015 +πAlarm(f2) = π(f2).λ_Jn(f2) = 0.97 x 0.5 = 0.485 + +π message FreightTruck --> _Jn +π_Jn(f1) = π(f1).λAlarm(f1) = 0.03 x 0.5 = 0.015 +π_Jn(f2) = π(f2).λAlarm(f2) = 0.97 x 0.5 = 0.485 + +π message Alarm --> _Jn +π_Jn(a1) = π(a1) = 0.0138158 = 0.01381575 +π_Jn(a2) = π(a2) = 0.986184 = 0.98618425 + +var Burglar: +π(b1) += p(b1) += (0.005) = 0.005 +π(b2) += p(b2) += (0.995) = 0.995 +λ(b1) = λAlarm(b1) = 0.5 = 0.5 +λ(b2) = λAlarm(b2) = 0.5 = 0.5 +belief change = 0 + +var FreightTruck: +π(f1) += p(f1) += (0.03) = 0.03 +π(f2) += p(f2) += (0.97) = 0.97 +λ(f1) = λAlarm(f1).λ_Jn(f1) = 0.5 x 0.5 = 0.25 +λ(f2) = λAlarm(f2).λ_Jn(f2) = 0.5 x 0.5 = 0.25 +belief change = 0 + +var Alarm: +π(a1) += p(a1|b1,f1).πAlarm(b1).πAlarm(f1) ++ p(a1|b1,f2).πAlarm(b1).πAlarm(f2) ++ p(a1|b2,f1).πAlarm(b2).πAlarm(f1) ++ p(a1|b2,f2).πAlarm(b2).πAlarm(f2) += (0.992x0.005x0.03) ++ (0.99x0.005x0.97) ++ (0.2x0.995x0.03) ++ (0.003x0.995x0.97) = 0.01381575 +π(a2) += p(a2|b1,f1).πAlarm(b1).πAlarm(f1) ++ p(a2|b1,f2).πAlarm(b1).πAlarm(f2) ++ p(a2|b2,f1).πAlarm(b2).πAlarm(f1) ++ p(a2|b2,f2).πAlarm(b2).πAlarm(f2) += (0.008x0.005x0.03) ++ (0.01x0.005x0.97) ++ (0.8x0.995x0.03) ++ (0.997x0.995x0.97) = 0.98618425 +λ(a1) = λ_Jn(a1) = 0.5 = 0.5 +λ(a2) = λ_Jn(a2) = 0.5 = 0.5 +belief change = 1.734723476e-18 + +var _Jn: +π(_jn0) += p(_jn0|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn0|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn0|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn0|f2,a2).π_Jn(f2).π_Jn(a2) += (1x0.03x0.0138158) ++ (0x0.03x0.986184) ++ (0x0.97x0.0138158) ++ (0x0.97x0.986184) = 0.0004144725 +π(_jn1) += p(_jn1|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn1|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn1|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn1|f2,a2).π_Jn(f2).π_Jn(a2) += (0x0.03x0.0138158) ++ (1x0.03x0.986184) ++ (0x0.97x0.0138158) ++ (0x0.97x0.986184) = 0.0295855275 +π(_jn2) += p(_jn2|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn2|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn2|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn2|f2,a2).π_Jn(f2).π_Jn(a2) += (0x0.03x0.0138158) ++ (0x0.03x0.986184) ++ (1x0.97x0.0138158) ++ (0x0.97x0.986184) = 0.0134012775 +π(_jn3) += p(_jn3|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn3|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn3|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn3|f2,a2).π_Jn(f2).π_Jn(a2) += (0x0.03x0.0138158) ++ (0x0.03x0.986184) ++ (0x0.97x0.0138158) ++ (1x0.97x0.986184) = 0.9565987225 +λ(_jn0) = 1 +λ(_jn1) = 1 +λ(_jn2) = 1 +λ(_jn3) = 1 +belief change = 8.836247706e-18 + +domain π(Burglar) λ(Burglar) belief +---------------------------------------------------------------- +b1 0.005 0.5 0.005 +b2 0.995 0.5 0.995 + +domain πAlarm(Burglar) λAlarm(Burglar) +---------------------------------------------------------------- +b1 0.005 0.5 +b2 0.995 0.5 + +domain π(FreightTruck) λ(FreightTruck) belief +---------------------------------------------------------------- +f1 0.03 0.25 0.03 +f2 0.97 0.25 0.97 + +domain πAlarm(FreightTruck) λAlarm(FreightTruck) +---------------------------------------------------------------- +f1 0.03 0.5 +f2 0.97 0.5 + +domain π_Jn(FreightTruck) λ_Jn(FreightTruck) +---------------------------------------------------------------- +f1 0.03 0.5 +f2 0.97 0.5 + +domain π(Alarm) λ(Alarm) belief +---------------------------------------------------------------- +a1 0.01381575 0.5 0.01381575 +a2 0.98618425 0.5 0.98618425 + +domain π_Jn(Alarm) λ_Jn(Alarm) +---------------------------------------------------------------- +a1 0.01381575 0.5 +a2 0.98618425 0.5 + +domain π(_Jn) λ(_Jn) belief +---------------------------------------------------------------- +_jn0 0.0004144725 1 0.0004144725 +_jn1 0.0295855275 1 0.0295855275 +_jn2 0.0134012775 1 0.0134012775 +_jn3 0.9565987225 1 0.9565987225 + + + +******************************************************************************** + Iteration 96 +******************************************************************************** +λ message Alarm --> Burglar +λAlarm(b1) += [p(a1|b1,f1).πAlarm(f1) + p(a1|b1,f2).πAlarm(f2)].λ(a1) ++ [p(a2|b1,f1).πAlarm(f1) + p(a2|b1,f2).πAlarm(f2)].λ(a2) += [(0.992x0.03) + (0.99x0.97)]x0.5 ++ [(0.008x0.03) + (0.01x0.97)]x0.5 = 0.5 +λAlarm(b2) += [p(a1|b2,f1).πAlarm(f1) + p(a1|b2,f2).πAlarm(f2)].λ(a1) ++ [p(a2|b2,f1).πAlarm(f1) + p(a2|b2,f2).πAlarm(f2)].λ(a2) += [(0.2x0.03) + (0.003x0.97)]x0.5 ++ [(0.8x0.03) + (0.997x0.97)]x0.5 = 0.5 + +λ message Alarm --> FreightTruck +λAlarm(f1) += [p(a1|b1,f1).πAlarm(b1) + p(a1|b2,f1).πAlarm(b2)].λ(a1) ++ [p(a2|b1,f1).πAlarm(b1) + p(a2|b2,f1).πAlarm(b2)].λ(a2) += [(0.992x0.005) + (0.2x0.995)]x0.5 ++ [(0.008x0.005) + (0.8x0.995)]x0.5 = 0.5 +λAlarm(f2) += [p(a1|b1,f2).πAlarm(b1) + p(a1|b2,f2).πAlarm(b2)].λ(a1) ++ [p(a2|b1,f2).πAlarm(b1) + p(a2|b2,f2).πAlarm(b2)].λ(a2) += [(0.99x0.005) + (0.003x0.995)]x0.5 ++ [(0.01x0.005) + (0.997x0.995)]x0.5 = 0.5 + +λ message _Jn --> FreightTruck +λ_Jn(f1) += [p(_jn0|f1,a1).π_Jn(a1) + p(_jn0|f1,a2).π_Jn(a2)].λ(_jn0) ++ [p(_jn1|f1,a1).π_Jn(a1) + p(_jn1|f1,a2).π_Jn(a2)].λ(_jn1) ++ [p(_jn2|f1,a1).π_Jn(a1) + p(_jn2|f1,a2).π_Jn(a2)].λ(_jn2) ++ [p(_jn3|f1,a1).π_Jn(a1) + p(_jn3|f1,a2).π_Jn(a2)].λ(_jn3) += [(1x0.0138158) + (0x0.986184)]x1 ++ [(0x0.0138158) + (1x0.986184)]x1 ++ [(0x0.0138158) + (0x0.986184)]x1 ++ [(0x0.0138158) + (0x0.986184)]x1 = 1 +λ_Jn(f2) += [p(_jn0|f2,a1).π_Jn(a1) + p(_jn0|f2,a2).π_Jn(a2)].λ(_jn0) ++ [p(_jn1|f2,a1).π_Jn(a1) + p(_jn1|f2,a2).π_Jn(a2)].λ(_jn1) ++ [p(_jn2|f2,a1).π_Jn(a1) + p(_jn2|f2,a2).π_Jn(a2)].λ(_jn2) ++ [p(_jn3|f2,a1).π_Jn(a1) + p(_jn3|f2,a2).π_Jn(a2)].λ(_jn3) += [(0x0.0138158) + (0x0.986184)]x1 ++ [(0x0.0138158) + (0x0.986184)]x1 ++ [(1x0.0138158) + (0x0.986184)]x1 ++ [(0x0.0138158) + (1x0.986184)]x1 = 1 + +λ message _Jn --> Alarm +λ_Jn(a1) += [p(_jn0|f1,a1).π_Jn(f1) + p(_jn0|f2,a1).π_Jn(f2)].λ(_jn0) ++ [p(_jn1|f1,a1).π_Jn(f1) + p(_jn1|f2,a1).π_Jn(f2)].λ(_jn1) ++ [p(_jn2|f1,a1).π_Jn(f1) + p(_jn2|f2,a1).π_Jn(f2)].λ(_jn2) ++ [p(_jn3|f1,a1).π_Jn(f1) + p(_jn3|f2,a1).π_Jn(f2)].λ(_jn3) += [(1x0.03) + (0x0.97)]x1 ++ [(0x0.03) + (0x0.97)]x1 ++ [(0x0.03) + (1x0.97)]x1 ++ [(0x0.03) + (0x0.97)]x1 = 1 +λ_Jn(a2) += [p(_jn0|f1,a2).π_Jn(f1) + p(_jn0|f2,a2).π_Jn(f2)].λ(_jn0) ++ [p(_jn1|f1,a2).π_Jn(f1) + p(_jn1|f2,a2).π_Jn(f2)].λ(_jn1) ++ [p(_jn2|f1,a2).π_Jn(f1) + p(_jn2|f2,a2).π_Jn(f2)].λ(_jn2) ++ [p(_jn3|f1,a2).π_Jn(f1) + p(_jn3|f2,a2).π_Jn(f2)].λ(_jn3) += [(0x0.03) + (0x0.97)]x1 ++ [(1x0.03) + (0x0.97)]x1 ++ [(0x0.03) + (0x0.97)]x1 ++ [(0x0.03) + (1x0.97)]x1 = 1 + +π message Burglar --> Alarm +πAlarm(b1) = π(b1) = 0.005 = 0.005 +πAlarm(b2) = π(b2) = 0.995 = 0.995 + +π message FreightTruck --> Alarm +πAlarm(f1) = π(f1).λ_Jn(f1) = 0.03 x 0.5 = 0.015 +πAlarm(f2) = π(f2).λ_Jn(f2) = 0.97 x 0.5 = 0.485 + +π message FreightTruck --> _Jn +π_Jn(f1) = π(f1).λAlarm(f1) = 0.03 x 0.5 = 0.015 +π_Jn(f2) = π(f2).λAlarm(f2) = 0.97 x 0.5 = 0.485 + +π message Alarm --> _Jn +π_Jn(a1) = π(a1) = 0.0138158 = 0.01381575 +π_Jn(a2) = π(a2) = 0.986184 = 0.98618425 + +var Burglar: +π(b1) += p(b1) += (0.005) = 0.005 +π(b2) += p(b2) += (0.995) = 0.995 +λ(b1) = λAlarm(b1) = 0.5 = 0.5 +λ(b2) = λAlarm(b2) = 0.5 = 0.5 +belief change = 0 + +var FreightTruck: +π(f1) += p(f1) += (0.03) = 0.03 +π(f2) += p(f2) += (0.97) = 0.97 +λ(f1) = λAlarm(f1).λ_Jn(f1) = 0.5 x 0.5 = 0.25 +λ(f2) = λAlarm(f2).λ_Jn(f2) = 0.5 x 0.5 = 0.25 +belief change = 0 + +var Alarm: +π(a1) += p(a1|b1,f1).πAlarm(b1).πAlarm(f1) ++ p(a1|b1,f2).πAlarm(b1).πAlarm(f2) ++ p(a1|b2,f1).πAlarm(b2).πAlarm(f1) ++ p(a1|b2,f2).πAlarm(b2).πAlarm(f2) += (0.992x0.005x0.03) ++ (0.99x0.005x0.97) ++ (0.2x0.995x0.03) ++ (0.003x0.995x0.97) = 0.01381575 +π(a2) += p(a2|b1,f1).πAlarm(b1).πAlarm(f1) ++ p(a2|b1,f2).πAlarm(b1).πAlarm(f2) ++ p(a2|b2,f1).πAlarm(b2).πAlarm(f1) ++ p(a2|b2,f2).πAlarm(b2).πAlarm(f2) += (0.008x0.005x0.03) ++ (0.01x0.005x0.97) ++ (0.8x0.995x0.03) ++ (0.997x0.995x0.97) = 0.98618425 +λ(a1) = λ_Jn(a1) = 0.5 = 0.5 +λ(a2) = λ_Jn(a2) = 0.5 = 0.5 +belief change = 0 + +var _Jn: +π(_jn0) += p(_jn0|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn0|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn0|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn0|f2,a2).π_Jn(f2).π_Jn(a2) += (1x0.03x0.0138158) ++ (0x0.03x0.986184) ++ (0x0.97x0.0138158) ++ (0x0.97x0.986184) = 0.0004144725 +π(_jn1) += p(_jn1|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn1|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn1|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn1|f2,a2).π_Jn(f2).π_Jn(a2) += (0x0.03x0.0138158) ++ (1x0.03x0.986184) ++ (0x0.97x0.0138158) ++ (0x0.97x0.986184) = 0.0295855275 +π(_jn2) += p(_jn2|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn2|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn2|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn2|f2,a2).π_Jn(f2).π_Jn(a2) += (0x0.03x0.0138158) ++ (0x0.03x0.986184) ++ (1x0.97x0.0138158) ++ (0x0.97x0.986184) = 0.0134012775 +π(_jn3) += p(_jn3|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn3|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn3|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn3|f2,a2).π_Jn(f2).π_Jn(a2) += (0x0.03x0.0138158) ++ (0x0.03x0.986184) ++ (0x0.97x0.0138158) ++ (1x0.97x0.986184) = 0.9565987225 +λ(_jn0) = 1 +λ(_jn1) = 1 +λ(_jn2) = 1 +λ(_jn3) = 1 +belief change = 1.788933585e-18 + +domain π(Burglar) λ(Burglar) belief +---------------------------------------------------------------- +b1 0.005 0.5 0.005 +b2 0.995 0.5 0.995 + +domain πAlarm(Burglar) λAlarm(Burglar) +---------------------------------------------------------------- +b1 0.005 0.5 +b2 0.995 0.5 + +domain π(FreightTruck) λ(FreightTruck) belief +---------------------------------------------------------------- +f1 0.03 0.25 0.03 +f2 0.97 0.25 0.97 + +domain πAlarm(FreightTruck) λAlarm(FreightTruck) +---------------------------------------------------------------- +f1 0.03 0.5 +f2 0.97 0.5 + +domain π_Jn(FreightTruck) λ_Jn(FreightTruck) +---------------------------------------------------------------- +f1 0.03 0.5 +f2 0.97 0.5 + +domain π(Alarm) λ(Alarm) belief +---------------------------------------------------------------- +a1 0.01381575 0.5 0.01381575 +a2 0.98618425 0.5 0.98618425 + +domain π_Jn(Alarm) λ_Jn(Alarm) +---------------------------------------------------------------- +a1 0.01381575 0.5 +a2 0.98618425 0.5 + +domain π(_Jn) λ(_Jn) belief +---------------------------------------------------------------- +_jn0 0.0004144725 1 0.0004144725 +_jn1 0.0295855275 1 0.0295855275 +_jn2 0.0134012775 1 0.0134012775 +_jn3 0.9565987225 1 0.9565987225 + + + +******************************************************************************** + Iteration 97 +******************************************************************************** +λ message Alarm --> Burglar +λAlarm(b1) += [p(a1|b1,f1).πAlarm(f1) + p(a1|b1,f2).πAlarm(f2)].λ(a1) ++ [p(a2|b1,f1).πAlarm(f1) + p(a2|b1,f2).πAlarm(f2)].λ(a2) += [(0.992x0.03) + (0.99x0.97)]x0.5 ++ [(0.008x0.03) + (0.01x0.97)]x0.5 = 0.5 +λAlarm(b2) += [p(a1|b2,f1).πAlarm(f1) + p(a1|b2,f2).πAlarm(f2)].λ(a1) ++ [p(a2|b2,f1).πAlarm(f1) + p(a2|b2,f2).πAlarm(f2)].λ(a2) += [(0.2x0.03) + (0.003x0.97)]x0.5 ++ [(0.8x0.03) + (0.997x0.97)]x0.5 = 0.5 + +λ message Alarm --> FreightTruck +λAlarm(f1) += [p(a1|b1,f1).πAlarm(b1) + p(a1|b2,f1).πAlarm(b2)].λ(a1) ++ [p(a2|b1,f1).πAlarm(b1) + p(a2|b2,f1).πAlarm(b2)].λ(a2) += [(0.992x0.005) + (0.2x0.995)]x0.5 ++ [(0.008x0.005) + (0.8x0.995)]x0.5 = 0.5 +λAlarm(f2) += [p(a1|b1,f2).πAlarm(b1) + p(a1|b2,f2).πAlarm(b2)].λ(a1) ++ [p(a2|b1,f2).πAlarm(b1) + p(a2|b2,f2).πAlarm(b2)].λ(a2) += [(0.99x0.005) + (0.003x0.995)]x0.5 ++ [(0.01x0.005) + (0.997x0.995)]x0.5 = 0.5 + +λ message _Jn --> FreightTruck +λ_Jn(f1) += [p(_jn0|f1,a1).π_Jn(a1) + p(_jn0|f1,a2).π_Jn(a2)].λ(_jn0) ++ [p(_jn1|f1,a1).π_Jn(a1) + p(_jn1|f1,a2).π_Jn(a2)].λ(_jn1) ++ [p(_jn2|f1,a1).π_Jn(a1) + p(_jn2|f1,a2).π_Jn(a2)].λ(_jn2) ++ [p(_jn3|f1,a1).π_Jn(a1) + p(_jn3|f1,a2).π_Jn(a2)].λ(_jn3) += [(1x0.0138158) + (0x0.986184)]x1 ++ [(0x0.0138158) + (1x0.986184)]x1 ++ [(0x0.0138158) + (0x0.986184)]x1 ++ [(0x0.0138158) + (0x0.986184)]x1 = 1 +λ_Jn(f2) += [p(_jn0|f2,a1).π_Jn(a1) + p(_jn0|f2,a2).π_Jn(a2)].λ(_jn0) ++ [p(_jn1|f2,a1).π_Jn(a1) + p(_jn1|f2,a2).π_Jn(a2)].λ(_jn1) ++ [p(_jn2|f2,a1).π_Jn(a1) + p(_jn2|f2,a2).π_Jn(a2)].λ(_jn2) ++ [p(_jn3|f2,a1).π_Jn(a1) + p(_jn3|f2,a2).π_Jn(a2)].λ(_jn3) += [(0x0.0138158) + (0x0.986184)]x1 ++ [(0x0.0138158) + (0x0.986184)]x1 ++ [(1x0.0138158) + (0x0.986184)]x1 ++ [(0x0.0138158) + (1x0.986184)]x1 = 1 + +λ message _Jn --> Alarm +λ_Jn(a1) += [p(_jn0|f1,a1).π_Jn(f1) + p(_jn0|f2,a1).π_Jn(f2)].λ(_jn0) ++ [p(_jn1|f1,a1).π_Jn(f1) + p(_jn1|f2,a1).π_Jn(f2)].λ(_jn1) ++ [p(_jn2|f1,a1).π_Jn(f1) + p(_jn2|f2,a1).π_Jn(f2)].λ(_jn2) ++ [p(_jn3|f1,a1).π_Jn(f1) + p(_jn3|f2,a1).π_Jn(f2)].λ(_jn3) += [(1x0.03) + (0x0.97)]x1 ++ [(0x0.03) + (0x0.97)]x1 ++ [(0x0.03) + (1x0.97)]x1 ++ [(0x0.03) + (0x0.97)]x1 = 1 +λ_Jn(a2) += [p(_jn0|f1,a2).π_Jn(f1) + p(_jn0|f2,a2).π_Jn(f2)].λ(_jn0) ++ [p(_jn1|f1,a2).π_Jn(f1) + p(_jn1|f2,a2).π_Jn(f2)].λ(_jn1) ++ [p(_jn2|f1,a2).π_Jn(f1) + p(_jn2|f2,a2).π_Jn(f2)].λ(_jn2) ++ [p(_jn3|f1,a2).π_Jn(f1) + p(_jn3|f2,a2).π_Jn(f2)].λ(_jn3) += [(0x0.03) + (0x0.97)]x1 ++ [(1x0.03) + (0x0.97)]x1 ++ [(0x0.03) + (0x0.97)]x1 ++ [(0x0.03) + (1x0.97)]x1 = 1 + +π message Burglar --> Alarm +πAlarm(b1) = π(b1) = 0.005 = 0.005 +πAlarm(b2) = π(b2) = 0.995 = 0.995 + +π message FreightTruck --> Alarm +πAlarm(f1) = π(f1).λ_Jn(f1) = 0.03 x 0.5 = 0.015 +πAlarm(f2) = π(f2).λ_Jn(f2) = 0.97 x 0.5 = 0.485 + +π message FreightTruck --> _Jn +π_Jn(f1) = π(f1).λAlarm(f1) = 0.03 x 0.5 = 0.015 +π_Jn(f2) = π(f2).λAlarm(f2) = 0.97 x 0.5 = 0.485 + +π message Alarm --> _Jn +π_Jn(a1) = π(a1) = 0.0138158 = 0.01381575 +π_Jn(a2) = π(a2) = 0.986184 = 0.98618425 + +var Burglar: +π(b1) += p(b1) += (0.005) = 0.005 +π(b2) += p(b2) += (0.995) = 0.995 +λ(b1) = λAlarm(b1) = 0.5 = 0.5 +λ(b2) = λAlarm(b2) = 0.5 = 0.5 +belief change = 0 + +var FreightTruck: +π(f1) += p(f1) += (0.03) = 0.03 +π(f2) += p(f2) += (0.97) = 0.97 +λ(f1) = λAlarm(f1).λ_Jn(f1) = 0.5 x 0.5 = 0.25 +λ(f2) = λAlarm(f2).λ_Jn(f2) = 0.5 x 0.5 = 0.25 +belief change = 0 + +var Alarm: +π(a1) += p(a1|b1,f1).πAlarm(b1).πAlarm(f1) ++ p(a1|b1,f2).πAlarm(b1).πAlarm(f2) ++ p(a1|b2,f1).πAlarm(b2).πAlarm(f1) ++ p(a1|b2,f2).πAlarm(b2).πAlarm(f2) += (0.992x0.005x0.03) ++ (0.99x0.005x0.97) ++ (0.2x0.995x0.03) ++ (0.003x0.995x0.97) = 0.01381575 +π(a2) += p(a2|b1,f1).πAlarm(b1).πAlarm(f1) ++ p(a2|b1,f2).πAlarm(b1).πAlarm(f2) ++ p(a2|b2,f1).πAlarm(b2).πAlarm(f1) ++ p(a2|b2,f2).πAlarm(b2).πAlarm(f2) += (0.008x0.005x0.03) ++ (0.01x0.005x0.97) ++ (0.8x0.995x0.03) ++ (0.997x0.995x0.97) = 0.98618425 +λ(a1) = λ_Jn(a1) = 0.5 = 0.5 +λ(a2) = λ_Jn(a2) = 0.5 = 0.5 +belief change = 0 + +var _Jn: +π(_jn0) += p(_jn0|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn0|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn0|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn0|f2,a2).π_Jn(f2).π_Jn(a2) += (1x0.03x0.0138158) ++ (0x0.03x0.986184) ++ (0x0.97x0.0138158) ++ (0x0.97x0.986184) = 0.0004144725 +π(_jn1) += p(_jn1|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn1|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn1|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn1|f2,a2).π_Jn(f2).π_Jn(a2) += (0x0.03x0.0138158) ++ (1x0.03x0.986184) ++ (0x0.97x0.0138158) ++ (0x0.97x0.986184) = 0.0295855275 +π(_jn2) += p(_jn2|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn2|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn2|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn2|f2,a2).π_Jn(f2).π_Jn(a2) += (0x0.03x0.0138158) ++ (0x0.03x0.986184) ++ (1x0.97x0.0138158) ++ (0x0.97x0.986184) = 0.0134012775 +π(_jn3) += p(_jn3|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn3|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn3|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn3|f2,a2).π_Jn(f2).π_Jn(a2) += (0x0.03x0.0138158) ++ (0x0.03x0.986184) ++ (0x0.97x0.0138158) ++ (1x0.97x0.986184) = 0.9565987225 +λ(_jn0) = 1 +λ(_jn1) = 1 +λ(_jn2) = 1 +λ(_jn3) = 1 +belief change = 1.788933585e-18 + +domain π(Burglar) λ(Burglar) belief +---------------------------------------------------------------- +b1 0.005 0.5 0.005 +b2 0.995 0.5 0.995 + +domain πAlarm(Burglar) λAlarm(Burglar) +---------------------------------------------------------------- +b1 0.005 0.5 +b2 0.995 0.5 + +domain π(FreightTruck) λ(FreightTruck) belief +---------------------------------------------------------------- +f1 0.03 0.25 0.03 +f2 0.97 0.25 0.97 + +domain πAlarm(FreightTruck) λAlarm(FreightTruck) +---------------------------------------------------------------- +f1 0.03 0.5 +f2 0.97 0.5 + +domain π_Jn(FreightTruck) λ_Jn(FreightTruck) +---------------------------------------------------------------- +f1 0.03 0.5 +f2 0.97 0.5 + +domain π(Alarm) λ(Alarm) belief +---------------------------------------------------------------- +a1 0.01381575 0.5 0.01381575 +a2 0.98618425 0.5 0.98618425 + +domain π_Jn(Alarm) λ_Jn(Alarm) +---------------------------------------------------------------- +a1 0.01381575 0.5 +a2 0.98618425 0.5 + +domain π(_Jn) λ(_Jn) belief +---------------------------------------------------------------- +_jn0 0.0004144725 1 0.0004144725 +_jn1 0.0295855275 1 0.0295855275 +_jn2 0.0134012775 1 0.0134012775 +_jn3 0.9565987225 1 0.9565987225 + + + +******************************************************************************** + Iteration 98 +******************************************************************************** +λ message Alarm --> Burglar +λAlarm(b1) += [p(a1|b1,f1).πAlarm(f1) + p(a1|b1,f2).πAlarm(f2)].λ(a1) ++ [p(a2|b1,f1).πAlarm(f1) + p(a2|b1,f2).πAlarm(f2)].λ(a2) += [(0.992x0.03) + (0.99x0.97)]x0.5 ++ [(0.008x0.03) + (0.01x0.97)]x0.5 = 0.5 +λAlarm(b2) += [p(a1|b2,f1).πAlarm(f1) + p(a1|b2,f2).πAlarm(f2)].λ(a1) ++ [p(a2|b2,f1).πAlarm(f1) + p(a2|b2,f2).πAlarm(f2)].λ(a2) += [(0.2x0.03) + (0.003x0.97)]x0.5 ++ [(0.8x0.03) + (0.997x0.97)]x0.5 = 0.5 + +λ message Alarm --> FreightTruck +λAlarm(f1) += [p(a1|b1,f1).πAlarm(b1) + p(a1|b2,f1).πAlarm(b2)].λ(a1) ++ [p(a2|b1,f1).πAlarm(b1) + p(a2|b2,f1).πAlarm(b2)].λ(a2) += [(0.992x0.005) + (0.2x0.995)]x0.5 ++ [(0.008x0.005) + (0.8x0.995)]x0.5 = 0.5 +λAlarm(f2) += [p(a1|b1,f2).πAlarm(b1) + p(a1|b2,f2).πAlarm(b2)].λ(a1) ++ [p(a2|b1,f2).πAlarm(b1) + p(a2|b2,f2).πAlarm(b2)].λ(a2) += [(0.99x0.005) + (0.003x0.995)]x0.5 ++ [(0.01x0.005) + (0.997x0.995)]x0.5 = 0.5 + +λ message _Jn --> FreightTruck +λ_Jn(f1) += [p(_jn0|f1,a1).π_Jn(a1) + p(_jn0|f1,a2).π_Jn(a2)].λ(_jn0) ++ [p(_jn1|f1,a1).π_Jn(a1) + p(_jn1|f1,a2).π_Jn(a2)].λ(_jn1) ++ [p(_jn2|f1,a1).π_Jn(a1) + p(_jn2|f1,a2).π_Jn(a2)].λ(_jn2) ++ [p(_jn3|f1,a1).π_Jn(a1) + p(_jn3|f1,a2).π_Jn(a2)].λ(_jn3) += [(1x0.0138158) + (0x0.986184)]x1 ++ [(0x0.0138158) + (1x0.986184)]x1 ++ [(0x0.0138158) + (0x0.986184)]x1 ++ [(0x0.0138158) + (0x0.986184)]x1 = 1 +λ_Jn(f2) += [p(_jn0|f2,a1).π_Jn(a1) + p(_jn0|f2,a2).π_Jn(a2)].λ(_jn0) ++ [p(_jn1|f2,a1).π_Jn(a1) + p(_jn1|f2,a2).π_Jn(a2)].λ(_jn1) ++ [p(_jn2|f2,a1).π_Jn(a1) + p(_jn2|f2,a2).π_Jn(a2)].λ(_jn2) ++ [p(_jn3|f2,a1).π_Jn(a1) + p(_jn3|f2,a2).π_Jn(a2)].λ(_jn3) += [(0x0.0138158) + (0x0.986184)]x1 ++ [(0x0.0138158) + (0x0.986184)]x1 ++ [(1x0.0138158) + (0x0.986184)]x1 ++ [(0x0.0138158) + (1x0.986184)]x1 = 1 + +λ message _Jn --> Alarm +λ_Jn(a1) += [p(_jn0|f1,a1).π_Jn(f1) + p(_jn0|f2,a1).π_Jn(f2)].λ(_jn0) ++ [p(_jn1|f1,a1).π_Jn(f1) + p(_jn1|f2,a1).π_Jn(f2)].λ(_jn1) ++ [p(_jn2|f1,a1).π_Jn(f1) + p(_jn2|f2,a1).π_Jn(f2)].λ(_jn2) ++ [p(_jn3|f1,a1).π_Jn(f1) + p(_jn3|f2,a1).π_Jn(f2)].λ(_jn3) += [(1x0.03) + (0x0.97)]x1 ++ [(0x0.03) + (0x0.97)]x1 ++ [(0x0.03) + (1x0.97)]x1 ++ [(0x0.03) + (0x0.97)]x1 = 1 +λ_Jn(a2) += [p(_jn0|f1,a2).π_Jn(f1) + p(_jn0|f2,a2).π_Jn(f2)].λ(_jn0) ++ [p(_jn1|f1,a2).π_Jn(f1) + p(_jn1|f2,a2).π_Jn(f2)].λ(_jn1) ++ [p(_jn2|f1,a2).π_Jn(f1) + p(_jn2|f2,a2).π_Jn(f2)].λ(_jn2) ++ [p(_jn3|f1,a2).π_Jn(f1) + p(_jn3|f2,a2).π_Jn(f2)].λ(_jn3) += [(0x0.03) + (0x0.97)]x1 ++ [(1x0.03) + (0x0.97)]x1 ++ [(0x0.03) + (0x0.97)]x1 ++ [(0x0.03) + (1x0.97)]x1 = 1 + +π message Burglar --> Alarm +πAlarm(b1) = π(b1) = 0.005 = 0.005 +πAlarm(b2) = π(b2) = 0.995 = 0.995 + +π message FreightTruck --> Alarm +πAlarm(f1) = π(f1).λ_Jn(f1) = 0.03 x 0.5 = 0.015 +πAlarm(f2) = π(f2).λ_Jn(f2) = 0.97 x 0.5 = 0.485 + +π message FreightTruck --> _Jn +π_Jn(f1) = π(f1).λAlarm(f1) = 0.03 x 0.5 = 0.015 +π_Jn(f2) = π(f2).λAlarm(f2) = 0.97 x 0.5 = 0.485 + +π message Alarm --> _Jn +π_Jn(a1) = π(a1) = 0.0138158 = 0.01381575 +π_Jn(a2) = π(a2) = 0.986184 = 0.98618425 + +var Burglar: +π(b1) += p(b1) += (0.005) = 0.005 +π(b2) += p(b2) += (0.995) = 0.995 +λ(b1) = λAlarm(b1) = 0.5 = 0.5 +λ(b2) = λAlarm(b2) = 0.5 = 0.5 +belief change = 0 + +var FreightTruck: +π(f1) += p(f1) += (0.03) = 0.03 +π(f2) += p(f2) += (0.97) = 0.97 +λ(f1) = λAlarm(f1).λ_Jn(f1) = 0.5 x 0.5 = 0.25 +λ(f2) = λAlarm(f2).λ_Jn(f2) = 0.5 x 0.5 = 0.25 +belief change = 0 + +var Alarm: +π(a1) += p(a1|b1,f1).πAlarm(b1).πAlarm(f1) ++ p(a1|b1,f2).πAlarm(b1).πAlarm(f2) ++ p(a1|b2,f1).πAlarm(b2).πAlarm(f1) ++ p(a1|b2,f2).πAlarm(b2).πAlarm(f2) += (0.992x0.005x0.03) ++ (0.99x0.005x0.97) ++ (0.2x0.995x0.03) ++ (0.003x0.995x0.97) = 0.01381575 +π(a2) += p(a2|b1,f1).πAlarm(b1).πAlarm(f1) ++ p(a2|b1,f2).πAlarm(b1).πAlarm(f2) ++ p(a2|b2,f1).πAlarm(b2).πAlarm(f1) ++ p(a2|b2,f2).πAlarm(b2).πAlarm(f2) += (0.008x0.005x0.03) ++ (0.01x0.005x0.97) ++ (0.8x0.995x0.03) ++ (0.997x0.995x0.97) = 0.98618425 +λ(a1) = λ_Jn(a1) = 0.5 = 0.5 +λ(a2) = λ_Jn(a2) = 0.5 = 0.5 +belief change = 0 + +var _Jn: +π(_jn0) += p(_jn0|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn0|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn0|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn0|f2,a2).π_Jn(f2).π_Jn(a2) += (1x0.03x0.0138158) ++ (0x0.03x0.986184) ++ (0x0.97x0.0138158) ++ (0x0.97x0.986184) = 0.0004144725 +π(_jn1) += p(_jn1|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn1|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn1|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn1|f2,a2).π_Jn(f2).π_Jn(a2) += (0x0.03x0.0138158) ++ (1x0.03x0.986184) ++ (0x0.97x0.0138158) ++ (0x0.97x0.986184) = 0.0295855275 +π(_jn2) += p(_jn2|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn2|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn2|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn2|f2,a2).π_Jn(f2).π_Jn(a2) += (0x0.03x0.0138158) ++ (0x0.03x0.986184) ++ (1x0.97x0.0138158) ++ (0x0.97x0.986184) = 0.0134012775 +π(_jn3) += p(_jn3|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn3|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn3|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn3|f2,a2).π_Jn(f2).π_Jn(a2) += (0x0.03x0.0138158) ++ (0x0.03x0.986184) ++ (0x0.97x0.0138158) ++ (1x0.97x0.986184) = 0.9565987225 +λ(_jn0) = 1 +λ(_jn1) = 1 +λ(_jn2) = 1 +λ(_jn3) = 1 +belief change = 0 + +domain π(Burglar) λ(Burglar) belief +---------------------------------------------------------------- +b1 0.005 0.5 0.005 +b2 0.995 0.5 0.995 + +domain πAlarm(Burglar) λAlarm(Burglar) +---------------------------------------------------------------- +b1 0.005 0.5 +b2 0.995 0.5 + +domain π(FreightTruck) λ(FreightTruck) belief +---------------------------------------------------------------- +f1 0.03 0.25 0.03 +f2 0.97 0.25 0.97 + +domain πAlarm(FreightTruck) λAlarm(FreightTruck) +---------------------------------------------------------------- +f1 0.03 0.5 +f2 0.97 0.5 + +domain π_Jn(FreightTruck) λ_Jn(FreightTruck) +---------------------------------------------------------------- +f1 0.03 0.5 +f2 0.97 0.5 + +domain π(Alarm) λ(Alarm) belief +---------------------------------------------------------------- +a1 0.01381575 0.5 0.01381575 +a2 0.98618425 0.5 0.98618425 + +domain π_Jn(Alarm) λ_Jn(Alarm) +---------------------------------------------------------------- +a1 0.01381575 0.5 +a2 0.98618425 0.5 + +domain π(_Jn) λ(_Jn) belief +---------------------------------------------------------------- +_jn0 0.0004144725 1 0.0004144725 +_jn1 0.0295855275 1 0.0295855275 +_jn2 0.0134012775 1 0.0134012775 +_jn3 0.9565987225 1 0.9565987225 + + +Iterative belief propagation converged in 98 iterations + diff --git a/packages/CLPBN/clpbn/bp/out.txt b/packages/CLPBN/clpbn/bp/out.txt new file mode 100644 index 000000000..78c46e813 --- /dev/null +++ b/packages/CLPBN/clpbn/bp/out.txt @@ -0,0 +1,762 @@ +Variable: Burglar +Domain: b1, b2 +Parents: +Childs: Alarm +cpt +---------------- +b1 0.005 +b2 0.995 + +Variable: FreightTruck +Domain: f1, f2 +Parents: +Childs: Alarm +cpt +---------------- +f1 0.03 +f2 0.97 + +Variable: Alarm +Domain: a1, a2 +Parents: Burglar, FreightTruck +Childs: +cpt b1,f1 b1,f2 b2,f1 b2,f2 +---------------------------------------------------- +a1 0.992 0.99 0.2 0.003 +a2 0.008 0.01 0.8 0.997 + +Variable: Burglar +Domain: b1, b2 +Parents: +Childs: Alarm +cpt +---------------- +b1 0.005 +b2 0.995 + +Variable: FreightTruck +Domain: f1, f2 +Parents: +Childs: Alarm, _Jn +cpt +---------------- +f1 0.03 +f2 0.97 + +Variable: Alarm +Domain: a1, a2 +Parents: Burglar, FreightTruck +Childs: _Jn +cpt b1,f1 b1,f2 b2,f1 b2,f2 +---------------------------------------------------- +a1 0.992 0.99 0.2 0.003 +a2 0.008 0.01 0.8 0.997 + +Variable: _Jn +Domain: _jn0, _jn1, _jn2, _jn3 +Parents: FreightTruck, Alarm +Childs: +cpt f1,a1 f1,a2 f2,a1 f2,a2 +---------------------------------------------------- +_jn0 1 0 0 0 +_jn1 0 1 0 0 +_jn2 0 0 1 0 +_jn3 0 0 0 1 + +The graph is not single connected. Iterative belief propagation will be used. + +Initializing solver +-> schedule = parallel +-> max iters = 100 +-> stable threashold = 1e-20 +-> query vars = FreightTruck Alarm +domain π(Burglar) λ(Burglar) belief +---------------------------------------------------------------- +b1 1 1 0.5 +b2 1 1 0.5 + +domain πAlarm(Burglar) λAlarm(Burglar) +---------------------------------------------------------------- +b1 0.5 0.5 +b2 0.5 0.5 + +domain π(FreightTruck) λ(FreightTruck) belief +---------------------------------------------------------------- +f1 1 1 0.5 +f2 1 1 0.5 + +domain πAlarm(FreightTruck) λAlarm(FreightTruck) +---------------------------------------------------------------- +f1 0.5 0.5 +f2 0.5 0.5 + +domain π_Jn(FreightTruck) λ_Jn(FreightTruck) +---------------------------------------------------------------- +f1 0.5 0.5 +f2 0.5 0.5 + +domain π(Alarm) λ(Alarm) belief +---------------------------------------------------------------- +a1 1 1 0.5 +a2 1 1 0.5 + +domain π_Jn(Alarm) λ_Jn(Alarm) +---------------------------------------------------------------- +a1 0.5 0.5 +a2 0.5 0.5 + +domain π(_Jn) λ(_Jn) belief +---------------------------------------------------------------- +_jn0 1 1 0.25 +_jn1 1 1 0.25 +_jn2 1 1 0.25 +_jn3 1 1 0.25 + + + +******************************************************************************** + Iteration 1 +******************************************************************************** +λ message Alarm --> Burglar +λAlarm(b1) += [p(a1|b1,f1).πAlarm(f1) + p(a1|b1,f2).πAlarm(f2)].λ(a1) ++ [p(a2|b1,f1).πAlarm(f1) + p(a2|b1,f2).πAlarm(f2)].λ(a2) += [(0.992x0.5) + (0.99x0.5)]x1 ++ [(0.008x0.5) + (0.01x0.5)]x1 = 1 +λAlarm(b2) += [p(a1|b2,f1).πAlarm(f1) + p(a1|b2,f2).πAlarm(f2)].λ(a1) ++ [p(a2|b2,f1).πAlarm(f1) + p(a2|b2,f2).πAlarm(f2)].λ(a2) += [(0.2x0.5) + (0.003x0.5)]x1 ++ [(0.8x0.5) + (0.997x0.5)]x1 = 1 + +λ message Alarm --> FreightTruck +λAlarm(f1) += [p(a1|b1,f1).πAlarm(b1) + p(a1|b2,f1).πAlarm(b2)].λ(a1) ++ [p(a2|b1,f1).πAlarm(b1) + p(a2|b2,f1).πAlarm(b2)].λ(a2) += [(0.992x0.5) + (0.2x0.5)]x1 ++ [(0.008x0.5) + (0.8x0.5)]x1 = 1 +λAlarm(f2) += [p(a1|b1,f2).πAlarm(b1) + p(a1|b2,f2).πAlarm(b2)].λ(a1) ++ [p(a2|b1,f2).πAlarm(b1) + p(a2|b2,f2).πAlarm(b2)].λ(a2) += [(0.99x0.5) + (0.003x0.5)]x1 ++ [(0.01x0.5) + (0.997x0.5)]x1 = 1 + +λ message _Jn --> FreightTruck +λ_Jn(f1) += [p(_jn0|f1,a1).π_Jn(a1) + p(_jn0|f1,a2).π_Jn(a2)].λ(_jn0) ++ [p(_jn1|f1,a1).π_Jn(a1) + p(_jn1|f1,a2).π_Jn(a2)].λ(_jn1) ++ [p(_jn2|f1,a1).π_Jn(a1) + p(_jn2|f1,a2).π_Jn(a2)].λ(_jn2) ++ [p(_jn3|f1,a1).π_Jn(a1) + p(_jn3|f1,a2).π_Jn(a2)].λ(_jn3) += [(1x0.5) + (0x0.5)]x1 ++ [(0x0.5) + (1x0.5)]x1 ++ [(0x0.5) + (0x0.5)]x1 ++ [(0x0.5) + (0x0.5)]x1 = 1 +λ_Jn(f2) += [p(_jn0|f2,a1).π_Jn(a1) + p(_jn0|f2,a2).π_Jn(a2)].λ(_jn0) ++ [p(_jn1|f2,a1).π_Jn(a1) + p(_jn1|f2,a2).π_Jn(a2)].λ(_jn1) ++ [p(_jn2|f2,a1).π_Jn(a1) + p(_jn2|f2,a2).π_Jn(a2)].λ(_jn2) ++ [p(_jn3|f2,a1).π_Jn(a1) + p(_jn3|f2,a2).π_Jn(a2)].λ(_jn3) += [(0x0.5) + (0x0.5)]x1 ++ [(0x0.5) + (0x0.5)]x1 ++ [(1x0.5) + (0x0.5)]x1 ++ [(0x0.5) + (1x0.5)]x1 = 1 + +λ message _Jn --> Alarm +λ_Jn(a1) += [p(_jn0|f1,a1).π_Jn(f1) + p(_jn0|f2,a1).π_Jn(f2)].λ(_jn0) ++ [p(_jn1|f1,a1).π_Jn(f1) + p(_jn1|f2,a1).π_Jn(f2)].λ(_jn1) ++ [p(_jn2|f1,a1).π_Jn(f1) + p(_jn2|f2,a1).π_Jn(f2)].λ(_jn2) ++ [p(_jn3|f1,a1).π_Jn(f1) + p(_jn3|f2,a1).π_Jn(f2)].λ(_jn3) += [(1x0.5) + (0x0.5)]x1 ++ [(0x0.5) + (0x0.5)]x1 ++ [(0x0.5) + (1x0.5)]x1 ++ [(0x0.5) + (0x0.5)]x1 = 1 +λ_Jn(a2) += [p(_jn0|f1,a2).π_Jn(f1) + p(_jn0|f2,a2).π_Jn(f2)].λ(_jn0) ++ [p(_jn1|f1,a2).π_Jn(f1) + p(_jn1|f2,a2).π_Jn(f2)].λ(_jn1) ++ [p(_jn2|f1,a2).π_Jn(f1) + p(_jn2|f2,a2).π_Jn(f2)].λ(_jn2) ++ [p(_jn3|f1,a2).π_Jn(f1) + p(_jn3|f2,a2).π_Jn(f2)].λ(_jn3) += [(0x0.5) + (0x0.5)]x1 ++ [(1x0.5) + (0x0.5)]x1 ++ [(0x0.5) + (0x0.5)]x1 ++ [(0x0.5) + (1x0.5)]x1 = 1 + +π message Burglar --> Alarm +πAlarm(b1) = π(b1) = 0.005 = 0.005 +πAlarm(b2) = π(b2) = 0.995 = 0.995 + +π message FreightTruck --> Alarm +πAlarm(f1) = π(f1).λ_Jn(f1) = 0.03 x 0.5 = 0.015 +πAlarm(f2) = π(f2).λ_Jn(f2) = 0.97 x 0.5 = 0.485 + +π message FreightTruck --> _Jn +π_Jn(f1) = π(f1).λAlarm(f1) = 0.03 x 0.5 = 0.015 +π_Jn(f2) = π(f2).λAlarm(f2) = 0.97 x 0.5 = 0.485 + +π message Alarm --> _Jn +π_Jn(a1) = π(a1) = 1 = 1 +π_Jn(a2) = π(a2) = 1 = 1 + +var Burglar: +π(b1) += p(b1) += (0.005) = 0.005 +π(b2) += p(b2) += (0.995) = 0.995 +λ(b1) = λAlarm(b1) = 0.5 = 0.5 +λ(b2) = λAlarm(b2) = 0.5 = 0.5 +belief change = 1 + +var FreightTruck: +π(f1) += p(f1) += (0.03) = 0.03 +π(f2) += p(f2) += (0.97) = 0.97 +λ(f1) = λAlarm(f1).λ_Jn(f1) = 0.5 x 0.5 = 0.25 +λ(f2) = λAlarm(f2).λ_Jn(f2) = 0.5 x 0.5 = 0.25 +belief change = 1 + +var Alarm: +π(a1) += p(a1|b1,f1).πAlarm(b1).πAlarm(f1) ++ p(a1|b1,f2).πAlarm(b1).πAlarm(f2) ++ p(a1|b2,f1).πAlarm(b2).πAlarm(f1) ++ p(a1|b2,f2).πAlarm(b2).πAlarm(f2) += (0.992x0.005x0.03) ++ (0.99x0.005x0.97) ++ (0.2x0.995x0.03) ++ (0.003x0.995x0.97) = 0.01381575 +π(a2) += p(a2|b1,f1).πAlarm(b1).πAlarm(f1) ++ p(a2|b1,f2).πAlarm(b1).πAlarm(f2) ++ p(a2|b2,f1).πAlarm(b2).πAlarm(f1) ++ p(a2|b2,f2).πAlarm(b2).πAlarm(f2) += (0.008x0.005x0.03) ++ (0.01x0.005x0.97) ++ (0.8x0.995x0.03) ++ (0.997x0.995x0.97) = 0.98618425 +λ(a1) = λ_Jn(a1) = 0.5 = 0.5 +λ(a2) = λ_Jn(a2) = 0.5 = 0.5 +belief change = 1 + +var _Jn: +π(_jn0) += p(_jn0|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn0|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn0|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn0|f2,a2).π_Jn(f2).π_Jn(a2) += (1x0.03x0.5) ++ (0x0.03x0.5) ++ (0x0.97x0.5) ++ (0x0.97x0.5) = 0.015 +π(_jn1) += p(_jn1|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn1|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn1|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn1|f2,a2).π_Jn(f2).π_Jn(a2) += (0x0.03x0.5) ++ (1x0.03x0.5) ++ (0x0.97x0.5) ++ (0x0.97x0.5) = 0.015 +π(_jn2) += p(_jn2|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn2|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn2|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn2|f2,a2).π_Jn(f2).π_Jn(a2) += (0x0.03x0.5) ++ (0x0.03x0.5) ++ (1x0.97x0.5) ++ (0x0.97x0.5) = 0.485 +π(_jn3) += p(_jn3|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn3|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn3|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn3|f2,a2).π_Jn(f2).π_Jn(a2) += (0x0.03x0.5) ++ (0x0.03x0.5) ++ (0x0.97x0.5) ++ (1x0.97x0.5) = 0.485 +λ(_jn0) = 1 +λ(_jn1) = 1 +λ(_jn2) = 1 +λ(_jn3) = 1 +belief change = 1 + +domain π(Burglar) λ(Burglar) belief +---------------------------------------------------------------- +b1 0.005 0.5 0.005 +b2 0.995 0.5 0.995 + +domain πAlarm(Burglar) λAlarm(Burglar) +---------------------------------------------------------------- +b1 0.005 0.5 +b2 0.995 0.5 + +domain π(FreightTruck) λ(FreightTruck) belief +---------------------------------------------------------------- +f1 0.03 0.25 0.03 +f2 0.97 0.25 0.97 + +domain πAlarm(FreightTruck) λAlarm(FreightTruck) +---------------------------------------------------------------- +f1 0.03 0.5 +f2 0.97 0.5 + +domain π_Jn(FreightTruck) λ_Jn(FreightTruck) +---------------------------------------------------------------- +f1 0.03 0.5 +f2 0.97 0.5 + +domain π(Alarm) λ(Alarm) belief +---------------------------------------------------------------- +a1 0.01381575 0.5 0.01381575 +a2 0.98618425 0.5 0.98618425 + +domain π_Jn(Alarm) λ_Jn(Alarm) +---------------------------------------------------------------- +a1 0.5 0.5 +a2 0.5 0.5 + +domain π(_Jn) λ(_Jn) belief +---------------------------------------------------------------- +_jn0 0.015 1 0.015 +_jn1 0.015 1 0.015 +_jn2 0.485 1 0.485 +_jn3 0.485 1 0.485 + + + +******************************************************************************** + Iteration 2 +******************************************************************************** +λ message Alarm --> Burglar +λAlarm(b1) += [p(a1|b1,f1).πAlarm(f1) + p(a1|b1,f2).πAlarm(f2)].λ(a1) ++ [p(a2|b1,f1).πAlarm(f1) + p(a2|b1,f2).πAlarm(f2)].λ(a2) += [(0.992x0.03) + (0.99x0.97)]x0.5 ++ [(0.008x0.03) + (0.01x0.97)]x0.5 = 0.5 +λAlarm(b2) += [p(a1|b2,f1).πAlarm(f1) + p(a1|b2,f2).πAlarm(f2)].λ(a1) ++ [p(a2|b2,f1).πAlarm(f1) + p(a2|b2,f2).πAlarm(f2)].λ(a2) += [(0.2x0.03) + (0.003x0.97)]x0.5 ++ [(0.8x0.03) + (0.997x0.97)]x0.5 = 0.5 + +λ message Alarm --> FreightTruck +λAlarm(f1) += [p(a1|b1,f1).πAlarm(b1) + p(a1|b2,f1).πAlarm(b2)].λ(a1) ++ [p(a2|b1,f1).πAlarm(b1) + p(a2|b2,f1).πAlarm(b2)].λ(a2) += [(0.992x0.005) + (0.2x0.995)]x0.5 ++ [(0.008x0.005) + (0.8x0.995)]x0.5 = 0.5 +λAlarm(f2) += [p(a1|b1,f2).πAlarm(b1) + p(a1|b2,f2).πAlarm(b2)].λ(a1) ++ [p(a2|b1,f2).πAlarm(b1) + p(a2|b2,f2).πAlarm(b2)].λ(a2) += [(0.99x0.005) + (0.003x0.995)]x0.5 ++ [(0.01x0.005) + (0.997x0.995)]x0.5 = 0.5 + +λ message _Jn --> FreightTruck +λ_Jn(f1) += [p(_jn0|f1,a1).π_Jn(a1) + p(_jn0|f1,a2).π_Jn(a2)].λ(_jn0) ++ [p(_jn1|f1,a1).π_Jn(a1) + p(_jn1|f1,a2).π_Jn(a2)].λ(_jn1) ++ [p(_jn2|f1,a1).π_Jn(a1) + p(_jn2|f1,a2).π_Jn(a2)].λ(_jn2) ++ [p(_jn3|f1,a1).π_Jn(a1) + p(_jn3|f1,a2).π_Jn(a2)].λ(_jn3) += [(1x0.5) + (0x0.5)]x1 ++ [(0x0.5) + (1x0.5)]x1 ++ [(0x0.5) + (0x0.5)]x1 ++ [(0x0.5) + (0x0.5)]x1 = 1 +λ_Jn(f2) += [p(_jn0|f2,a1).π_Jn(a1) + p(_jn0|f2,a2).π_Jn(a2)].λ(_jn0) ++ [p(_jn1|f2,a1).π_Jn(a1) + p(_jn1|f2,a2).π_Jn(a2)].λ(_jn1) ++ [p(_jn2|f2,a1).π_Jn(a1) + p(_jn2|f2,a2).π_Jn(a2)].λ(_jn2) ++ [p(_jn3|f2,a1).π_Jn(a1) + p(_jn3|f2,a2).π_Jn(a2)].λ(_jn3) += [(0x0.5) + (0x0.5)]x1 ++ [(0x0.5) + (0x0.5)]x1 ++ [(1x0.5) + (0x0.5)]x1 ++ [(0x0.5) + (1x0.5)]x1 = 1 + +λ message _Jn --> Alarm +λ_Jn(a1) += [p(_jn0|f1,a1).π_Jn(f1) + p(_jn0|f2,a1).π_Jn(f2)].λ(_jn0) ++ [p(_jn1|f1,a1).π_Jn(f1) + p(_jn1|f2,a1).π_Jn(f2)].λ(_jn1) ++ [p(_jn2|f1,a1).π_Jn(f1) + p(_jn2|f2,a1).π_Jn(f2)].λ(_jn2) ++ [p(_jn3|f1,a1).π_Jn(f1) + p(_jn3|f2,a1).π_Jn(f2)].λ(_jn3) += [(1x0.03) + (0x0.97)]x1 ++ [(0x0.03) + (0x0.97)]x1 ++ [(0x0.03) + (1x0.97)]x1 ++ [(0x0.03) + (0x0.97)]x1 = 1 +λ_Jn(a2) += [p(_jn0|f1,a2).π_Jn(f1) + p(_jn0|f2,a2).π_Jn(f2)].λ(_jn0) ++ [p(_jn1|f1,a2).π_Jn(f1) + p(_jn1|f2,a2).π_Jn(f2)].λ(_jn1) ++ [p(_jn2|f1,a2).π_Jn(f1) + p(_jn2|f2,a2).π_Jn(f2)].λ(_jn2) ++ [p(_jn3|f1,a2).π_Jn(f1) + p(_jn3|f2,a2).π_Jn(f2)].λ(_jn3) += [(0x0.03) + (0x0.97)]x1 ++ [(1x0.03) + (0x0.97)]x1 ++ [(0x0.03) + (0x0.97)]x1 ++ [(0x0.03) + (1x0.97)]x1 = 1 + +π message Burglar --> Alarm +πAlarm(b1) = π(b1) = 0.005 = 0.005 +πAlarm(b2) = π(b2) = 0.995 = 0.995 + +π message FreightTruck --> Alarm +πAlarm(f1) = π(f1).λ_Jn(f1) = 0.03 x 0.5 = 0.015 +πAlarm(f2) = π(f2).λ_Jn(f2) = 0.97 x 0.5 = 0.485 + +π message FreightTruck --> _Jn +π_Jn(f1) = π(f1).λAlarm(f1) = 0.03 x 0.5 = 0.015 +π_Jn(f2) = π(f2).λAlarm(f2) = 0.97 x 0.5 = 0.485 + +π message Alarm --> _Jn +π_Jn(a1) = π(a1) = 0.0138158 = 0.01381575 +π_Jn(a2) = π(a2) = 0.986184 = 0.98618425 + +var Burglar: +π(b1) += p(b1) += (0.005) = 0.005 +π(b2) += p(b2) += (0.995) = 0.995 +λ(b1) = λAlarm(b1) = 0.5 = 0.5 +λ(b2) = λAlarm(b2) = 0.5 = 0.5 +belief change = 8.67361738e-19 + +var FreightTruck: +π(f1) += p(f1) += (0.03) = 0.03 +π(f2) += p(f2) += (0.97) = 0.97 +λ(f1) = λAlarm(f1).λ_Jn(f1) = 0.5 x 0.5 = 0.25 +λ(f2) = λAlarm(f2).λ_Jn(f2) = 0.5 x 0.5 = 0.25 +belief change = 0 + +var Alarm: +π(a1) += p(a1|b1,f1).πAlarm(b1).πAlarm(f1) ++ p(a1|b1,f2).πAlarm(b1).πAlarm(f2) ++ p(a1|b2,f1).πAlarm(b2).πAlarm(f1) ++ p(a1|b2,f2).πAlarm(b2).πAlarm(f2) += (0.992x0.005x0.03) ++ (0.99x0.005x0.97) ++ (0.2x0.995x0.03) ++ (0.003x0.995x0.97) = 0.01381575 +π(a2) += p(a2|b1,f1).πAlarm(b1).πAlarm(f1) ++ p(a2|b1,f2).πAlarm(b1).πAlarm(f2) ++ p(a2|b2,f1).πAlarm(b2).πAlarm(f1) ++ p(a2|b2,f2).πAlarm(b2).πAlarm(f2) += (0.008x0.005x0.03) ++ (0.01x0.005x0.97) ++ (0.8x0.995x0.03) ++ (0.997x0.995x0.97) = 0.98618425 +λ(a1) = λ_Jn(a1) = 0.5 = 0.5 +λ(a2) = λ_Jn(a2) = 0.5 = 0.5 +belief change = 0 + +var _Jn: +π(_jn0) += p(_jn0|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn0|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn0|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn0|f2,a2).π_Jn(f2).π_Jn(a2) += (1x0.03x0.0138158) ++ (0x0.03x0.986184) ++ (0x0.97x0.0138158) ++ (0x0.97x0.986184) = 0.0004144725 +π(_jn1) += p(_jn1|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn1|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn1|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn1|f2,a2).π_Jn(f2).π_Jn(a2) += (0x0.03x0.0138158) ++ (1x0.03x0.986184) ++ (0x0.97x0.0138158) ++ (0x0.97x0.986184) = 0.0295855275 +π(_jn2) += p(_jn2|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn2|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn2|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn2|f2,a2).π_Jn(f2).π_Jn(a2) += (0x0.03x0.0138158) ++ (0x0.03x0.986184) ++ (1x0.97x0.0138158) ++ (0x0.97x0.986184) = 0.0134012775 +π(_jn3) += p(_jn3|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn3|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn3|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn3|f2,a2).π_Jn(f2).π_Jn(a2) += (0x0.03x0.0138158) ++ (0x0.03x0.986184) ++ (0x0.97x0.0138158) ++ (1x0.97x0.986184) = 0.9565987225 +λ(_jn0) = 1 +λ(_jn1) = 1 +λ(_jn2) = 1 +λ(_jn3) = 1 +belief change = 0.9723685 + +domain π(Burglar) λ(Burglar) belief +---------------------------------------------------------------- +b1 0.005 0.5 0.005 +b2 0.995 0.5 0.995 + +domain πAlarm(Burglar) λAlarm(Burglar) +---------------------------------------------------------------- +b1 0.005 0.5 +b2 0.995 0.5 + +domain π(FreightTruck) λ(FreightTruck) belief +---------------------------------------------------------------- +f1 0.03 0.25 0.03 +f2 0.97 0.25 0.97 + +domain πAlarm(FreightTruck) λAlarm(FreightTruck) +---------------------------------------------------------------- +f1 0.03 0.5 +f2 0.97 0.5 + +domain π_Jn(FreightTruck) λ_Jn(FreightTruck) +---------------------------------------------------------------- +f1 0.03 0.5 +f2 0.97 0.5 + +domain π(Alarm) λ(Alarm) belief +---------------------------------------------------------------- +a1 0.01381575 0.5 0.01381575 +a2 0.98618425 0.5 0.98618425 + +domain π_Jn(Alarm) λ_Jn(Alarm) +---------------------------------------------------------------- +a1 0.01381575 0.5 +a2 0.98618425 0.5 + +domain π(_Jn) λ(_Jn) belief +---------------------------------------------------------------- +_jn0 0.0004144725 1 0.0004144725 +_jn1 0.0295855275 1 0.0295855275 +_jn2 0.0134012775 1 0.0134012775 +_jn3 0.9565987225 1 0.9565987225 + + + +******************************************************************************** + Iteration 3 +******************************************************************************** +λ message Alarm --> Burglar +λAlarm(b1) += [p(a1|b1,f1).πAlarm(f1) + p(a1|b1,f2).πAlarm(f2)].λ(a1) ++ [p(a2|b1,f1).πAlarm(f1) + p(a2|b1,f2).πAlarm(f2)].λ(a2) += [(0.992x0.03) + (0.99x0.97)]x0.5 ++ [(0.008x0.03) + (0.01x0.97)]x0.5 = 0.5 +λAlarm(b2) += [p(a1|b2,f1).πAlarm(f1) + p(a1|b2,f2).πAlarm(f2)].λ(a1) ++ [p(a2|b2,f1).πAlarm(f1) + p(a2|b2,f2).πAlarm(f2)].λ(a2) += [(0.2x0.03) + (0.003x0.97)]x0.5 ++ [(0.8x0.03) + (0.997x0.97)]x0.5 = 0.5 + +λ message Alarm --> FreightTruck +λAlarm(f1) += [p(a1|b1,f1).πAlarm(b1) + p(a1|b2,f1).πAlarm(b2)].λ(a1) ++ [p(a2|b1,f1).πAlarm(b1) + p(a2|b2,f1).πAlarm(b2)].λ(a2) += [(0.992x0.005) + (0.2x0.995)]x0.5 ++ [(0.008x0.005) + (0.8x0.995)]x0.5 = 0.5 +λAlarm(f2) += [p(a1|b1,f2).πAlarm(b1) + p(a1|b2,f2).πAlarm(b2)].λ(a1) ++ [p(a2|b1,f2).πAlarm(b1) + p(a2|b2,f2).πAlarm(b2)].λ(a2) += [(0.99x0.005) + (0.003x0.995)]x0.5 ++ [(0.01x0.005) + (0.997x0.995)]x0.5 = 0.5 + +λ message _Jn --> FreightTruck +λ_Jn(f1) += [p(_jn0|f1,a1).π_Jn(a1) + p(_jn0|f1,a2).π_Jn(a2)].λ(_jn0) ++ [p(_jn1|f1,a1).π_Jn(a1) + p(_jn1|f1,a2).π_Jn(a2)].λ(_jn1) ++ [p(_jn2|f1,a1).π_Jn(a1) + p(_jn2|f1,a2).π_Jn(a2)].λ(_jn2) ++ [p(_jn3|f1,a1).π_Jn(a1) + p(_jn3|f1,a2).π_Jn(a2)].λ(_jn3) += [(1x0.0138158) + (0x0.986184)]x1 ++ [(0x0.0138158) + (1x0.986184)]x1 ++ [(0x0.0138158) + (0x0.986184)]x1 ++ [(0x0.0138158) + (0x0.986184)]x1 = 1 +λ_Jn(f2) += [p(_jn0|f2,a1).π_Jn(a1) + p(_jn0|f2,a2).π_Jn(a2)].λ(_jn0) ++ [p(_jn1|f2,a1).π_Jn(a1) + p(_jn1|f2,a2).π_Jn(a2)].λ(_jn1) ++ [p(_jn2|f2,a1).π_Jn(a1) + p(_jn2|f2,a2).π_Jn(a2)].λ(_jn2) ++ [p(_jn3|f2,a1).π_Jn(a1) + p(_jn3|f2,a2).π_Jn(a2)].λ(_jn3) += [(0x0.0138158) + (0x0.986184)]x1 ++ [(0x0.0138158) + (0x0.986184)]x1 ++ [(1x0.0138158) + (0x0.986184)]x1 ++ [(0x0.0138158) + (1x0.986184)]x1 = 1 + +λ message _Jn --> Alarm +λ_Jn(a1) += [p(_jn0|f1,a1).π_Jn(f1) + p(_jn0|f2,a1).π_Jn(f2)].λ(_jn0) ++ [p(_jn1|f1,a1).π_Jn(f1) + p(_jn1|f2,a1).π_Jn(f2)].λ(_jn1) ++ [p(_jn2|f1,a1).π_Jn(f1) + p(_jn2|f2,a1).π_Jn(f2)].λ(_jn2) ++ [p(_jn3|f1,a1).π_Jn(f1) + p(_jn3|f2,a1).π_Jn(f2)].λ(_jn3) += [(1x0.03) + (0x0.97)]x1 ++ [(0x0.03) + (0x0.97)]x1 ++ [(0x0.03) + (1x0.97)]x1 ++ [(0x0.03) + (0x0.97)]x1 = 1 +λ_Jn(a2) += [p(_jn0|f1,a2).π_Jn(f1) + p(_jn0|f2,a2).π_Jn(f2)].λ(_jn0) ++ [p(_jn1|f1,a2).π_Jn(f1) + p(_jn1|f2,a2).π_Jn(f2)].λ(_jn1) ++ [p(_jn2|f1,a2).π_Jn(f1) + p(_jn2|f2,a2).π_Jn(f2)].λ(_jn2) ++ [p(_jn3|f1,a2).π_Jn(f1) + p(_jn3|f2,a2).π_Jn(f2)].λ(_jn3) += [(0x0.03) + (0x0.97)]x1 ++ [(1x0.03) + (0x0.97)]x1 ++ [(0x0.03) + (0x0.97)]x1 ++ [(0x0.03) + (1x0.97)]x1 = 1 + +π message Burglar --> Alarm +πAlarm(b1) = π(b1) = 0.005 = 0.005 +πAlarm(b2) = π(b2) = 0.995 = 0.995 + +π message FreightTruck --> Alarm +πAlarm(f1) = π(f1).λ_Jn(f1) = 0.03 x 0.5 = 0.015 +πAlarm(f2) = π(f2).λ_Jn(f2) = 0.97 x 0.5 = 0.485 + +π message FreightTruck --> _Jn +π_Jn(f1) = π(f1).λAlarm(f1) = 0.03 x 0.5 = 0.015 +π_Jn(f2) = π(f2).λAlarm(f2) = 0.97 x 0.5 = 0.485 + +π message Alarm --> _Jn +π_Jn(a1) = π(a1) = 0.0138158 = 0.01381575 +π_Jn(a2) = π(a2) = 0.986184 = 0.98618425 + +var Burglar: +π(b1) += p(b1) += (0.005) = 0.005 +π(b2) += p(b2) += (0.995) = 0.995 +λ(b1) = λAlarm(b1) = 0.5 = 0.5 +λ(b2) = λAlarm(b2) = 0.5 = 0.5 +belief change = 0 + +var FreightTruck: +π(f1) += p(f1) += (0.03) = 0.03 +π(f2) += p(f2) += (0.97) = 0.97 +λ(f1) = λAlarm(f1).λ_Jn(f1) = 0.5 x 0.5 = 0.25 +λ(f2) = λAlarm(f2).λ_Jn(f2) = 0.5 x 0.5 = 0.25 +belief change = 0 + +var Alarm: +π(a1) += p(a1|b1,f1).πAlarm(b1).πAlarm(f1) ++ p(a1|b1,f2).πAlarm(b1).πAlarm(f2) ++ p(a1|b2,f1).πAlarm(b2).πAlarm(f1) ++ p(a1|b2,f2).πAlarm(b2).πAlarm(f2) += (0.992x0.005x0.03) ++ (0.99x0.005x0.97) ++ (0.2x0.995x0.03) ++ (0.003x0.995x0.97) = 0.01381575 +π(a2) += p(a2|b1,f1).πAlarm(b1).πAlarm(f1) ++ p(a2|b1,f2).πAlarm(b1).πAlarm(f2) ++ p(a2|b2,f1).πAlarm(b2).πAlarm(f1) ++ p(a2|b2,f2).πAlarm(b2).πAlarm(f2) += (0.008x0.005x0.03) ++ (0.01x0.005x0.97) ++ (0.8x0.995x0.03) ++ (0.997x0.995x0.97) = 0.98618425 +λ(a1) = λ_Jn(a1) = 0.5 = 0.5 +λ(a2) = λ_Jn(a2) = 0.5 = 0.5 +belief change = 0 + +var _Jn: +π(_jn0) += p(_jn0|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn0|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn0|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn0|f2,a2).π_Jn(f2).π_Jn(a2) += (1x0.03x0.0138158) ++ (0x0.03x0.986184) ++ (0x0.97x0.0138158) ++ (0x0.97x0.986184) = 0.0004144725 +π(_jn1) += p(_jn1|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn1|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn1|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn1|f2,a2).π_Jn(f2).π_Jn(a2) += (0x0.03x0.0138158) ++ (1x0.03x0.986184) ++ (0x0.97x0.0138158) ++ (0x0.97x0.986184) = 0.0295855275 +π(_jn2) += p(_jn2|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn2|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn2|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn2|f2,a2).π_Jn(f2).π_Jn(a2) += (0x0.03x0.0138158) ++ (0x0.03x0.986184) ++ (1x0.97x0.0138158) ++ (0x0.97x0.986184) = 0.0134012775 +π(_jn3) += p(_jn3|f1,a1).π_Jn(f1).π_Jn(a1) ++ p(_jn3|f1,a2).π_Jn(f1).π_Jn(a2) ++ p(_jn3|f2,a1).π_Jn(f2).π_Jn(a1) ++ p(_jn3|f2,a2).π_Jn(f2).π_Jn(a2) += (0x0.03x0.0138158) ++ (0x0.03x0.986184) ++ (0x0.97x0.0138158) ++ (1x0.97x0.986184) = 0.9565987225 +λ(_jn0) = 1 +λ(_jn1) = 1 +λ(_jn2) = 1 +λ(_jn3) = 1 +belief change = 0 + +domain π(Burglar) λ(Burglar) belief +---------------------------------------------------------------- +b1 0.005 0.5 0.005 +b2 0.995 0.5 0.995 + +domain πAlarm(Burglar) λAlarm(Burglar) +---------------------------------------------------------------- +b1 0.005 0.5 +b2 0.995 0.5 + +domain π(FreightTruck) λ(FreightTruck) belief +---------------------------------------------------------------- +f1 0.03 0.25 0.03 +f2 0.97 0.25 0.97 + +domain πAlarm(FreightTruck) λAlarm(FreightTruck) +---------------------------------------------------------------- +f1 0.03 0.5 +f2 0.97 0.5 + +domain π_Jn(FreightTruck) λ_Jn(FreightTruck) +---------------------------------------------------------------- +f1 0.03 0.5 +f2 0.97 0.5 + +domain π(Alarm) λ(Alarm) belief +---------------------------------------------------------------- +a1 0.01381575 0.5 0.01381575 +a2 0.98618425 0.5 0.98618425 + +domain π_Jn(Alarm) λ_Jn(Alarm) +---------------------------------------------------------------- +a1 0.01381575 0.5 +a2 0.98618425 0.5 + +domain π(_Jn) λ(_Jn) belief +---------------------------------------------------------------- +_jn0 0.0004144725 1 0.0004144725 +_jn1 0.0295855275 1 0.0295855275 +_jn2 0.0134012775 1 0.0134012775 +_jn3 0.9565987225 1 0.9565987225 + + +Iterative belief propagation converged in 3 iterations + diff --git a/packages/CLPBN/clpbn/bp/simple-loop.par.txt b/packages/CLPBN/clpbn/bp/simple-loop.par.txt new file mode 100644 index 000000000..25bab238e --- /dev/null +++ b/packages/CLPBN/clpbn/bp/simple-loop.par.txt @@ -0,0 +1,10366 @@ +Variable: A +Domain: a1, a2 +Parents: +Childs: B, C +cpt +---------------- +a1 0.01 +a2 0.09 + +Variable: B +Domain: b1, b2 +Parents: A +Childs: D +cpt a1, a2, +---------------------------- +b1 0.03 0.6 +b2 0.97 0.4 + +Variable: C +Domain: c1, c2 +Parents: A +Childs: D +cpt a1, a2, +---------------------------- +c1 0.24 0.12 +c2 0.76 0.88 + +Variable: D +Domain: d1, d2 +Parents: B, C +Childs: +cpt b1,c1, b1,c2, b2,c1, b2,c2, +---------------------------------------------------- +d1 0.2 0.7 0.45 0.22 +d2 0.8 0.3 0.55 0.78 + +initializing solver + schedule = parallel + maxIter = 100 + accuracy = 0 + + +******************************************************************************** +Iteration 0 +******************************************************************************** + +status of random variable `A': + domain π(A) λ(A) belief +---------------------------------------------------------------- + a1 0.01 1 0.1 + a2 0.09 1 0.9 + + domain πB(A) λB(A) +---------------------------------------------------------------- + a1 1 1 + a2 1 1 + + domain πC(A) λC(A) +---------------------------------------------------------------- + a1 1 1 + a2 1 1 + + +status of random variable `B': + domain π(B) λ(B) belief +---------------------------------------------------------------- + b1 1 1 0.5 + b2 1 1 0.5 + + domain πD(B) λD(B) +---------------------------------------------------------------- + b1 1 1 + b2 1 1 + + +status of random variable `C': + domain π(C) λ(C) belief +---------------------------------------------------------------- + c1 1 1 0.5 + c2 1 1 0.5 + + domain πD(C) λD(C) +---------------------------------------------------------------- + c1 1 1 + c2 1 1 + + +status of random variable `D': + domain π(D) λ(D) belief +---------------------------------------------------------------- + d1 1 1 0.5 + d2 1 1 0.5 + +λ message B --> A + λB(a1) = [p(b1|a1)].λ(b1) + [p(b2|a1)].λ(b2) = [(0.03)]x1 + [(0.97)]x1 = 1 + λB(a2) = [p(b1|a2)].λ(b1) + [p(b2|a2)].λ(b2) = [(0.6)]x1 + [(0.4)]x1 = 1 +λ message C --> A + λC(a1) = [p(c1|a1)].λ(c1) + [p(c2|a1)].λ(c2) = [(0.24)]x1 + [(0.76)]x1 = 1 + λC(a2) = [p(c1|a2)].λ(c1) + [p(c2|a2)].λ(c2) = [(0.12)]x1 + [(0.88)]x1 = 1 +λ message D --> B + λD(b1) = [p(d1|b1,c1).πD(c1) + p(d1|b1,c2).πD(c2)].λ(d1) + [p(d2|b1,c1).πD(c1) + p(d2|b1,c2).πD(c2)].λ(d2) = [(0.2x1) + (0.7x1)]x1 + [(0.8x1) + (0.3x1)]x1 = 2 + λD(b2) = [p(d1|b2,c1).πD(c1) + p(d1|b2,c2).πD(c2)].λ(d1) + [p(d2|b2,c1).πD(c1) + p(d2|b2,c2).πD(c2)].λ(d2) = [(0.45x1) + (0.22x1)]x1 + [(0.55x1) + (0.78x1)]x1 = 2 +λ message D --> C + λD(c1) = [p(d1|b1,c1).πD(b1) + p(d1|b2,c1).πD(b2)].λ(d1) + [p(d2|b1,c1).πD(b1) + p(d2|b2,c1).πD(b2)].λ(d2) = [(0.2x1) + (0.45x1)]x1 + [(0.8x1) + (0.55x1)]x1 = 2 + λD(c2) = [p(d1|b1,c2).πD(b1) + p(d1|b2,c2).πD(b2)].λ(d1) + [p(d2|b1,c2).πD(b1) + p(d2|b2,c2).πD(b2)].λ(d2) = [(0.7x1) + (0.22x1)]x1 + [(0.3x1) + (0.78x1)]x1 = 2 +π message A --> B + πB(a1) = π(a1).λC(a1) = 0.01 x 1 = 0.01 + πB(a2) = π(a2).λC(a2) = 0.09 x 1 = 0.09 +π message A --> C + πC(a1) = π(a1).λB(a1) = 0.01 x 1 = 0.01 + πC(a2) = π(a2).λB(a2) = 0.09 x 1 = 0.09 +π message B --> D + πD(b1) = π(b1) = 1 = 1 + πD(b2) = π(b2) = 1 = 1 +π message C --> D + πD(c1) = π(c1) = 1 = 1 + πD(c2) = π(c2) = 1 = 1 + +updating π & λ values +node A: + π(a1) = p(a1) = (0.01) = 0.01 + π(a2) = p(a2) = (0.09) = 0.09 + λ(a1) = λB(a1).λC(a1) = 1 x 1 = 1 + λ(a2) = λB(a2).λC(a2) = 1 x 1 = 1 + belief change = 1 +node B: + π(b1) = p(b1|a1).πB(a1) + p(b1|a2).πB(a2) = (0.03 x 0.01) + (0.6 x 0.09) = 0.0543 + π(b2) = p(b2|a1).πB(a1) + p(b2|a2).πB(a2) = (0.97 x 0.01) + (0.4 x 0.09) = 0.0457 + λ(b1) = λD(b1) = 2 = 2 + λ(b2) = λD(b2) = 2 = 2 + belief change = 1 +node C: + π(c1) = p(c1|a1).πC(a1) + p(c1|a2).πC(a2) = (0.24 x 0.01) + (0.12 x 0.09) = 0.0132 + π(c2) = p(c2|a1).πC(a1) + p(c2|a2).πC(a2) = (0.76 x 0.01) + (0.88 x 0.09) = 0.0868 + λ(c1) = λD(c1) = 2 = 2 + λ(c2) = λD(c2) = 2 = 2 + belief change = 1 +node D: + π(d1) = p(d1|b1,c1).πD(b1).πD(c1) + p(d1|b1,c2).πD(b1).πD(c2) + p(d1|b2,c1).πD(b2).πD(c1) + p(d1|b2,c2).πD(b2).πD(c2) = (0.2 x 1 x 1) + (0.7 x 1 x 1) + (0.45 x 1 x 1) + (0.22 x 1 x 1) = 1.57 + π(d2) = p(d2|b1,c1).πD(b1).πD(c1) + p(d2|b1,c2).πD(b1).πD(c2) + p(d2|b2,c1).πD(b2).πD(c1) + p(d2|b2,c2).πD(b2).πD(c2) = (0.8 x 1 x 1) + (0.3 x 1 x 1) + (0.55 x 1 x 1) + (0.78 x 1 x 1) = 2.43 + λ(d1) = 1 + λ(d2) = 1 + belief change = 1 + + +******************************************************************************** +Iteration 1 +******************************************************************************** + +status of random variable `A': + domain π(A) λ(A) belief +---------------------------------------------------------------- + a1 0.01 1 0.1 + a2 0.09 1 0.9 + + domain πB(A) λB(A) +---------------------------------------------------------------- + a1 0.01 1 + a2 0.09 1 + + domain πC(A) λC(A) +---------------------------------------------------------------- + a1 0.01 1 + a2 0.09 1 + + +status of random variable `B': + domain π(B) λ(B) belief +---------------------------------------------------------------- + b1 0.0543 2 0.543 + b2 0.0457 2 0.457 + + domain πD(B) λD(B) +---------------------------------------------------------------- + b1 1 2 + b2 1 2 + + +status of random variable `C': + domain π(C) λ(C) belief +---------------------------------------------------------------- + c1 0.0132 2 0.132 + c2 0.0868 2 0.868 + + domain πD(C) λD(C) +---------------------------------------------------------------- + c1 1 2 + c2 1 2 + + +status of random variable `D': + domain π(D) λ(D) belief +---------------------------------------------------------------- + d1 1.57 1 0.3925 + d2 2.43 1 0.6075 + +λ message B --> A + λB(a1) = [p(b1|a1)].λ(b1) + [p(b2|a1)].λ(b2) = [(0.03)]x2 + [(0.97)]x2 = 2 + λB(a2) = [p(b1|a2)].λ(b1) + [p(b2|a2)].λ(b2) = [(0.6)]x2 + [(0.4)]x2 = 2 +λ message C --> A + λC(a1) = [p(c1|a1)].λ(c1) + [p(c2|a1)].λ(c2) = [(0.24)]x2 + [(0.76)]x2 = 2 + λC(a2) = [p(c1|a2)].λ(c1) + [p(c2|a2)].λ(c2) = [(0.12)]x2 + [(0.88)]x2 = 2 +λ message D --> B + λD(b1) = [p(d1|b1,c1).πD(c1) + p(d1|b1,c2).πD(c2)].λ(d1) + [p(d2|b1,c1).πD(c1) + p(d2|b1,c2).πD(c2)].λ(d2) = [(0.2x1) + (0.7x1)]x1 + [(0.8x1) + (0.3x1)]x1 = 2 + λD(b2) = [p(d1|b2,c1).πD(c1) + p(d1|b2,c2).πD(c2)].λ(d1) + [p(d2|b2,c1).πD(c1) + p(d2|b2,c2).πD(c2)].λ(d2) = [(0.45x1) + (0.22x1)]x1 + [(0.55x1) + (0.78x1)]x1 = 2 +λ message D --> C + λD(c1) = [p(d1|b1,c1).πD(b1) + p(d1|b2,c1).πD(b2)].λ(d1) + [p(d2|b1,c1).πD(b1) + p(d2|b2,c1).πD(b2)].λ(d2) = [(0.2x1) + (0.45x1)]x1 + [(0.8x1) + (0.55x1)]x1 = 2 + λD(c2) = [p(d1|b1,c2).πD(b1) + p(d1|b2,c2).πD(b2)].λ(d1) + [p(d2|b1,c2).πD(b1) + p(d2|b2,c2).πD(b2)].λ(d2) = [(0.7x1) + (0.22x1)]x1 + [(0.3x1) + (0.78x1)]x1 = 2 +π message A --> B + πB(a1) = π(a1).λC(a1) = 0.01 x 1 = 0.01 + πB(a2) = π(a2).λC(a2) = 0.09 x 1 = 0.09 +π message A --> C + πC(a1) = π(a1).λB(a1) = 0.01 x 1 = 0.01 + πC(a2) = π(a2).λB(a2) = 0.09 x 1 = 0.09 +π message B --> D + πD(b1) = π(b1) = 0.0543 = 0.0543 + πD(b2) = π(b2) = 0.0457 = 0.0457 +π message C --> D + πD(c1) = π(c1) = 0.0132 = 0.0132 + πD(c2) = π(c2) = 0.0868 = 0.0868 + +updating π & λ values +node A: + π(a1) = p(a1) = (0.01) = 0.01 + π(a2) = p(a2) = (0.09) = 0.09 + λ(a1) = λB(a1).λC(a1) = 2 x 2 = 4 + λ(a2) = λB(a2).λC(a2) = 2 x 2 = 4 + belief change = 0 +node B: + π(b1) = p(b1|a1).πB(a1) + p(b1|a2).πB(a2) = (0.03 x 0.01) + (0.6 x 0.09) = 0.0543 + π(b2) = p(b2|a1).πB(a1) + p(b2|a2).πB(a2) = (0.97 x 0.01) + (0.4 x 0.09) = 0.0457 + λ(b1) = λD(b1) = 2 = 2 + λ(b2) = λD(b2) = 2 = 2 + belief change = 0 +node C: + π(c1) = p(c1|a1).πC(a1) + p(c1|a2).πC(a2) = (0.24 x 0.01) + (0.12 x 0.09) = 0.0132 + π(c2) = p(c2|a1).πC(a1) + p(c2|a2).πC(a2) = (0.76 x 0.01) + (0.88 x 0.09) = 0.0868 + λ(c1) = λD(c1) = 2 = 2 + λ(c2) = λD(c2) = 2 = 2 + belief change = 0 +node D: + π(d1) = p(d1|b1,c1).πD(b1).πD(c1) + p(d1|b1,c2).πD(b1).πD(c2) + p(d1|b2,c1).πD(b2).πD(c1) + p(d1|b2,c2).πD(b2).πD(c2) = (0.2 x 0.0543 x 0.0132) + (0.7 x 0.0543 x 0.0868) + (0.45 x 0.0457 x 0.0132) + (0.22 x 0.0457 x 0.0868) = 0.0045867652 + π(d2) = p(d2|b1,c1).πD(b1).πD(c1) + p(d2|b1,c2).πD(b1).πD(c2) + p(d2|b2,c1).πD(b2).πD(c1) + p(d2|b2,c2).πD(b2).πD(c2) = (0.8 x 0.0543 x 0.0132) + (0.3 x 0.0543 x 0.0868) + (0.55 x 0.0457 x 0.0132) + (0.78 x 0.0457 x 0.0868) = 0.0054132348 + λ(d1) = 1 + λ(d2) = 1 + belief change = 0.13235304 + + +******************************************************************************** +Iteration 2 +******************************************************************************** + +status of random variable `A': + domain π(A) λ(A) belief +---------------------------------------------------------------- + a1 0.01 4 0.1 + a2 0.09 4 0.9 + + domain πB(A) λB(A) +---------------------------------------------------------------- + a1 0.01 2 + a2 0.09 2 + + domain πC(A) λC(A) +---------------------------------------------------------------- + a1 0.01 2 + a2 0.09 2 + + +status of random variable `B': + domain π(B) λ(B) belief +---------------------------------------------------------------- + b1 0.0543 2 0.543 + b2 0.0457 2 0.457 + + domain πD(B) λD(B) +---------------------------------------------------------------- + b1 0.0543 2 + b2 0.0457 2 + + +status of random variable `C': + domain π(C) λ(C) belief +---------------------------------------------------------------- + c1 0.0132 2 0.132 + c2 0.0868 2 0.868 + + domain πD(C) λD(C) +---------------------------------------------------------------- + c1 0.0132 2 + c2 0.0868 2 + + +status of random variable `D': + domain π(D) λ(D) belief +---------------------------------------------------------------- + d1 0.0045867652 1 0.45867652 + d2 0.0054132348 1 0.54132348 + +λ message B --> A + λB(a1) = [p(b1|a1)].λ(b1) + [p(b2|a1)].λ(b2) = [(0.03)]x2 + [(0.97)]x2 = 2 + λB(a2) = [p(b1|a2)].λ(b1) + [p(b2|a2)].λ(b2) = [(0.6)]x2 + [(0.4)]x2 = 2 +λ message C --> A + λC(a1) = [p(c1|a1)].λ(c1) + [p(c2|a1)].λ(c2) = [(0.24)]x2 + [(0.76)]x2 = 2 + λC(a2) = [p(c1|a2)].λ(c1) + [p(c2|a2)].λ(c2) = [(0.12)]x2 + [(0.88)]x2 = 2 +λ message D --> B + λD(b1) = [p(d1|b1,c1).πD(c1) + p(d1|b1,c2).πD(c2)].λ(d1) + [p(d2|b1,c1).πD(c1) + p(d2|b1,c2).πD(c2)].λ(d2) = [(0.2x0.0132) + (0.7x0.0868)]x1 + [(0.8x0.0132) + (0.3x0.0868)]x1 = 0.1 + λD(b2) = [p(d1|b2,c1).πD(c1) + p(d1|b2,c2).πD(c2)].λ(d1) + [p(d2|b2,c1).πD(c1) + p(d2|b2,c2).πD(c2)].λ(d2) = [(0.45x0.0132) + (0.22x0.0868)]x1 + [(0.55x0.0132) + (0.78x0.0868)]x1 = 0.1 +λ message D --> C + λD(c1) = [p(d1|b1,c1).πD(b1) + p(d1|b2,c1).πD(b2)].λ(d1) + [p(d2|b1,c1).πD(b1) + p(d2|b2,c1).πD(b2)].λ(d2) = [(0.2x0.0543) + (0.45x0.0457)]x1 + [(0.8x0.0543) + (0.55x0.0457)]x1 = 0.1 + λD(c2) = [p(d1|b1,c2).πD(b1) + p(d1|b2,c2).πD(b2)].λ(d1) + [p(d2|b1,c2).πD(b1) + p(d2|b2,c2).πD(b2)].λ(d2) = [(0.7x0.0543) + (0.22x0.0457)]x1 + [(0.3x0.0543) + (0.78x0.0457)]x1 = 0.1 +π message A --> B + πB(a1) = π(a1).λC(a1) = 0.01 x 2 = 0.02 + πB(a2) = π(a2).λC(a2) = 0.09 x 2 = 0.18 +π message A --> C + πC(a1) = π(a1).λB(a1) = 0.01 x 2 = 0.02 + πC(a2) = π(a2).λB(a2) = 0.09 x 2 = 0.18 +π message B --> D + πD(b1) = π(b1) = 0.0543 = 0.0543 + πD(b2) = π(b2) = 0.0457 = 0.0457 +π message C --> D + πD(c1) = π(c1) = 0.0132 = 0.0132 + πD(c2) = π(c2) = 0.0868 = 0.0868 + +updating π & λ values +node A: + π(a1) = p(a1) = (0.01) = 0.01 + π(a2) = p(a2) = (0.09) = 0.09 + λ(a1) = λB(a1).λC(a1) = 2 x 2 = 4 + λ(a2) = λB(a2).λC(a2) = 2 x 2 = 4 + belief change = 0 +node B: + π(b1) = p(b1|a1).πB(a1) + p(b1|a2).πB(a2) = (0.03 x 0.02) + (0.6 x 0.18) = 0.1086 + π(b2) = p(b2|a1).πB(a1) + p(b2|a2).πB(a2) = (0.97 x 0.02) + (0.4 x 0.18) = 0.0914 + λ(b1) = λD(b1) = 0.1 = 0.1 + λ(b2) = λD(b2) = 0.1 = 0.1 + belief change = 1.665334537e-16 +node C: + π(c1) = p(c1|a1).πC(a1) + p(c1|a2).πC(a2) = (0.24 x 0.02) + (0.12 x 0.18) = 0.0264 + π(c2) = p(c2|a1).πC(a1) + p(c2|a2).πC(a2) = (0.76 x 0.02) + (0.88 x 0.18) = 0.1736 + λ(c1) = λD(c1) = 0.1 = 0.1 + λ(c2) = λD(c2) = 0.1 = 0.1 + belief change = 0 +node D: + π(d1) = p(d1|b1,c1).πD(b1).πD(c1) + p(d1|b1,c2).πD(b1).πD(c2) + p(d1|b2,c1).πD(b2).πD(c1) + p(d1|b2,c2).πD(b2).πD(c2) = (0.2 x 0.0543 x 0.0132) + (0.7 x 0.0543 x 0.0868) + (0.45 x 0.0457 x 0.0132) + (0.22 x 0.0457 x 0.0868) = 0.0045867652 + π(d2) = p(d2|b1,c1).πD(b1).πD(c1) + p(d2|b1,c2).πD(b1).πD(c2) + p(d2|b2,c1).πD(b2).πD(c1) + p(d2|b2,c2).πD(b2).πD(c2) = (0.8 x 0.0543 x 0.0132) + (0.3 x 0.0543 x 0.0868) + (0.55 x 0.0457 x 0.0132) + (0.78 x 0.0457 x 0.0868) = 0.0054132348 + λ(d1) = 1 + λ(d2) = 1 + belief change = 0 + + +******************************************************************************** +Iteration 3 +******************************************************************************** + +status of random variable `A': + domain π(A) λ(A) belief +---------------------------------------------------------------- + a1 0.01 4 0.1 + a2 0.09 4 0.9 + + domain πB(A) λB(A) +---------------------------------------------------------------- + a1 0.02 2 + a2 0.18 2 + + domain πC(A) λC(A) +---------------------------------------------------------------- + a1 0.02 2 + a2 0.18 2 + + +status of random variable `B': + domain π(B) λ(B) belief +---------------------------------------------------------------- + b1 0.1086 0.1 0.543 + b2 0.0914 0.1 0.457 + + domain πD(B) λD(B) +---------------------------------------------------------------- + b1 0.0543 0.1 + b2 0.0457 0.1 + + +status of random variable `C': + domain π(C) λ(C) belief +---------------------------------------------------------------- + c1 0.0264 0.1 0.132 + c2 0.1736 0.1 0.868 + + domain πD(C) λD(C) +---------------------------------------------------------------- + c1 0.0132 0.1 + c2 0.0868 0.1 + + +status of random variable `D': + domain π(D) λ(D) belief +---------------------------------------------------------------- + d1 0.0045867652 1 0.45867652 + d2 0.0054132348 1 0.54132348 + +λ message B --> A + λB(a1) = [p(b1|a1)].λ(b1) + [p(b2|a1)].λ(b2) = [(0.03)]x0.1 + [(0.97)]x0.1 = 0.1 + λB(a2) = [p(b1|a2)].λ(b1) + [p(b2|a2)].λ(b2) = [(0.6)]x0.1 + [(0.4)]x0.1 = 0.1 +λ message C --> A + λC(a1) = [p(c1|a1)].λ(c1) + [p(c2|a1)].λ(c2) = [(0.24)]x0.1 + [(0.76)]x0.1 = 0.1 + λC(a2) = [p(c1|a2)].λ(c1) + [p(c2|a2)].λ(c2) = [(0.12)]x0.1 + [(0.88)]x0.1 = 0.1 +λ message D --> B + λD(b1) = [p(d1|b1,c1).πD(c1) + p(d1|b1,c2).πD(c2)].λ(d1) + [p(d2|b1,c1).πD(c1) + p(d2|b1,c2).πD(c2)].λ(d2) = [(0.2x0.0132) + (0.7x0.0868)]x1 + [(0.8x0.0132) + (0.3x0.0868)]x1 = 0.1 + λD(b2) = [p(d1|b2,c1).πD(c1) + p(d1|b2,c2).πD(c2)].λ(d1) + [p(d2|b2,c1).πD(c1) + p(d2|b2,c2).πD(c2)].λ(d2) = [(0.45x0.0132) + (0.22x0.0868)]x1 + [(0.55x0.0132) + (0.78x0.0868)]x1 = 0.1 +λ message D --> C + λD(c1) = [p(d1|b1,c1).πD(b1) + p(d1|b2,c1).πD(b2)].λ(d1) + [p(d2|b1,c1).πD(b1) + p(d2|b2,c1).πD(b2)].λ(d2) = [(0.2x0.0543) + (0.45x0.0457)]x1 + [(0.8x0.0543) + (0.55x0.0457)]x1 = 0.1 + λD(c2) = [p(d1|b1,c2).πD(b1) + p(d1|b2,c2).πD(b2)].λ(d1) + [p(d2|b1,c2).πD(b1) + p(d2|b2,c2).πD(b2)].λ(d2) = [(0.7x0.0543) + (0.22x0.0457)]x1 + [(0.3x0.0543) + (0.78x0.0457)]x1 = 0.1 +π message A --> B + πB(a1) = π(a1).λC(a1) = 0.01 x 2 = 0.02 + πB(a2) = π(a2).λC(a2) = 0.09 x 2 = 0.18 +π message A --> C + πC(a1) = π(a1).λB(a1) = 0.01 x 2 = 0.02 + πC(a2) = π(a2).λB(a2) = 0.09 x 2 = 0.18 +π message B --> D + πD(b1) = π(b1) = 0.1086 = 0.1086 + πD(b2) = π(b2) = 0.0914 = 0.0914 +π message C --> D + πD(c1) = π(c1) = 0.0264 = 0.0264 + πD(c2) = π(c2) = 0.1736 = 0.1736 + +updating π & λ values +node A: + π(a1) = p(a1) = (0.01) = 0.01 + π(a2) = p(a2) = (0.09) = 0.09 + λ(a1) = λB(a1).λC(a1) = 0.1 x 0.1 = 0.01 + λ(a2) = λB(a2).λC(a2) = 0.1 x 0.1 = 0.01 + belief change = 0 +node B: + π(b1) = p(b1|a1).πB(a1) + p(b1|a2).πB(a2) = (0.03 x 0.02) + (0.6 x 0.18) = 0.1086 + π(b2) = p(b2|a1).πB(a1) + p(b2|a2).πB(a2) = (0.97 x 0.02) + (0.4 x 0.18) = 0.0914 + λ(b1) = λD(b1) = 0.1 = 0.1 + λ(b2) = λD(b2) = 0.1 = 0.1 + belief change = 0 +node C: + π(c1) = p(c1|a1).πC(a1) + p(c1|a2).πC(a2) = (0.24 x 0.02) + (0.12 x 0.18) = 0.0264 + π(c2) = p(c2|a1).πC(a1) + p(c2|a2).πC(a2) = (0.76 x 0.02) + (0.88 x 0.18) = 0.1736 + λ(c1) = λD(c1) = 0.1 = 0.1 + λ(c2) = λD(c2) = 0.1 = 0.1 + belief change = 0 +node D: + π(d1) = p(d1|b1,c1).πD(b1).πD(c1) + p(d1|b1,c2).πD(b1).πD(c2) + p(d1|b2,c1).πD(b2).πD(c1) + p(d1|b2,c2).πD(b2).πD(c2) = (0.2 x 0.1086 x 0.0264) + (0.7 x 0.1086 x 0.1736) + (0.45 x 0.0914 x 0.0264) + (0.22 x 0.0914 x 0.1736) = 0.0183470608 + π(d2) = p(d2|b1,c1).πD(b1).πD(c1) + p(d2|b1,c2).πD(b1).πD(c2) + p(d2|b2,c1).πD(b2).πD(c1) + p(d2|b2,c2).πD(b2).πD(c2) = (0.8 x 0.1086 x 0.0264) + (0.3 x 0.1086 x 0.1736) + (0.55 x 0.0914 x 0.0264) + (0.78 x 0.0914 x 0.1736) = 0.0216529392 + λ(d1) = 1 + λ(d2) = 1 + belief change = 0 + + +******************************************************************************** +Iteration 4 +******************************************************************************** + +status of random variable `A': + domain π(A) λ(A) belief +---------------------------------------------------------------- + a1 0.01 0.01 0.1 + a2 0.09 0.01 0.9 + + domain πB(A) λB(A) +---------------------------------------------------------------- + a1 0.02 0.1 + a2 0.18 0.1 + + domain πC(A) λC(A) +---------------------------------------------------------------- + a1 0.02 0.1 + a2 0.18 0.1 + + +status of random variable `B': + domain π(B) λ(B) belief +---------------------------------------------------------------- + b1 0.1086 0.1 0.543 + b2 0.0914 0.1 0.457 + + domain πD(B) λD(B) +---------------------------------------------------------------- + b1 0.1086 0.1 + b2 0.0914 0.1 + + +status of random variable `C': + domain π(C) λ(C) belief +---------------------------------------------------------------- + c1 0.0264 0.1 0.132 + c2 0.1736 0.1 0.868 + + domain πD(C) λD(C) +---------------------------------------------------------------- + c1 0.0264 0.1 + c2 0.1736 0.1 + + +status of random variable `D': + domain π(D) λ(D) belief +---------------------------------------------------------------- + d1 0.0183470608 1 0.45867652 + d2 0.0216529392 1 0.54132348 + +λ message B --> A + λB(a1) = [p(b1|a1)].λ(b1) + [p(b2|a1)].λ(b2) = [(0.03)]x0.1 + [(0.97)]x0.1 = 0.1 + λB(a2) = [p(b1|a2)].λ(b1) + [p(b2|a2)].λ(b2) = [(0.6)]x0.1 + [(0.4)]x0.1 = 0.1 +λ message C --> A + λC(a1) = [p(c1|a1)].λ(c1) + [p(c2|a1)].λ(c2) = [(0.24)]x0.1 + [(0.76)]x0.1 = 0.1 + λC(a2) = [p(c1|a2)].λ(c1) + [p(c2|a2)].λ(c2) = [(0.12)]x0.1 + [(0.88)]x0.1 = 0.1 +λ message D --> B + λD(b1) = [p(d1|b1,c1).πD(c1) + p(d1|b1,c2).πD(c2)].λ(d1) + [p(d2|b1,c1).πD(c1) + p(d2|b1,c2).πD(c2)].λ(d2) = [(0.2x0.0264) + (0.7x0.1736)]x1 + [(0.8x0.0264) + (0.3x0.1736)]x1 = 0.2 + λD(b2) = [p(d1|b2,c1).πD(c1) + p(d1|b2,c2).πD(c2)].λ(d1) + [p(d2|b2,c1).πD(c1) + p(d2|b2,c2).πD(c2)].λ(d2) = [(0.45x0.0264) + (0.22x0.1736)]x1 + [(0.55x0.0264) + (0.78x0.1736)]x1 = 0.2 +λ message D --> C + λD(c1) = [p(d1|b1,c1).πD(b1) + p(d1|b2,c1).πD(b2)].λ(d1) + [p(d2|b1,c1).πD(b1) + p(d2|b2,c1).πD(b2)].λ(d2) = [(0.2x0.1086) + (0.45x0.0914)]x1 + [(0.8x0.1086) + (0.55x0.0914)]x1 = 0.2 + λD(c2) = [p(d1|b1,c2).πD(b1) + p(d1|b2,c2).πD(b2)].λ(d1) + [p(d2|b1,c2).πD(b1) + p(d2|b2,c2).πD(b2)].λ(d2) = [(0.7x0.1086) + (0.22x0.0914)]x1 + [(0.3x0.1086) + (0.78x0.0914)]x1 = 0.2 +π message A --> B + πB(a1) = π(a1).λC(a1) = 0.01 x 0.1 = 0.001 + πB(a2) = π(a2).λC(a2) = 0.09 x 0.1 = 0.009 +π message A --> C + πC(a1) = π(a1).λB(a1) = 0.01 x 0.1 = 0.001 + πC(a2) = π(a2).λB(a2) = 0.09 x 0.1 = 0.009 +π message B --> D + πD(b1) = π(b1) = 0.1086 = 0.1086 + πD(b2) = π(b2) = 0.0914 = 0.0914 +π message C --> D + πD(c1) = π(c1) = 0.0264 = 0.0264 + πD(c2) = π(c2) = 0.1736 = 0.1736 + +updating π & λ values +node A: + π(a1) = p(a1) = (0.01) = 0.01 + π(a2) = p(a2) = (0.09) = 0.09 + λ(a1) = λB(a1).λC(a1) = 0.1 x 0.1 = 0.01 + λ(a2) = λB(a2).λC(a2) = 0.1 x 0.1 = 0.01 + belief change = 0 +node B: + π(b1) = p(b1|a1).πB(a1) + p(b1|a2).πB(a2) = (0.03 x 0.001) + (0.6 x 0.009) = 0.00543 + π(b2) = p(b2|a1).πB(a1) + p(b2|a2).πB(a2) = (0.97 x 0.001) + (0.4 x 0.009) = 0.00457 + λ(b1) = λD(b1) = 0.2 = 0.2 + λ(b2) = λD(b2) = 0.2 = 0.2 + belief change = 2.220446049e-16 +node C: + π(c1) = p(c1|a1).πC(a1) + p(c1|a2).πC(a2) = (0.24 x 0.001) + (0.12 x 0.009) = 0.00132 + π(c2) = p(c2|a1).πC(a1) + p(c2|a2).πC(a2) = (0.76 x 0.001) + (0.88 x 0.009) = 0.00868 + λ(c1) = λD(c1) = 0.2 = 0.2 + λ(c2) = λD(c2) = 0.2 = 0.2 + belief change = 1.387778781e-16 +node D: + π(d1) = p(d1|b1,c1).πD(b1).πD(c1) + p(d1|b1,c2).πD(b1).πD(c2) + p(d1|b2,c1).πD(b2).πD(c1) + p(d1|b2,c2).πD(b2).πD(c2) = (0.2 x 0.1086 x 0.0264) + (0.7 x 0.1086 x 0.1736) + (0.45 x 0.0914 x 0.0264) + (0.22 x 0.0914 x 0.1736) = 0.0183470608 + π(d2) = p(d2|b1,c1).πD(b1).πD(c1) + p(d2|b1,c2).πD(b1).πD(c2) + p(d2|b2,c1).πD(b2).πD(c1) + p(d2|b2,c2).πD(b2).πD(c2) = (0.8 x 0.1086 x 0.0264) + (0.3 x 0.1086 x 0.1736) + (0.55 x 0.0914 x 0.0264) + (0.78 x 0.0914 x 0.1736) = 0.0216529392 + λ(d1) = 1 + λ(d2) = 1 + belief change = 0 + + +******************************************************************************** +Iteration 5 +******************************************************************************** + +status of random variable `A': + domain π(A) λ(A) belief +---------------------------------------------------------------- + a1 0.01 0.01 0.1 + a2 0.09 0.01 0.9 + + domain πB(A) λB(A) +---------------------------------------------------------------- + a1 0.001 0.1 + a2 0.009 0.1 + + domain πC(A) λC(A) +---------------------------------------------------------------- + a1 0.001 0.1 + a2 0.009 0.1 + + +status of random variable `B': + domain π(B) λ(B) belief +---------------------------------------------------------------- + b1 0.00543 0.2 0.543 + b2 0.00457 0.2 0.457 + + domain πD(B) λD(B) +---------------------------------------------------------------- + b1 0.1086 0.2 + b2 0.0914 0.2 + + +status of random variable `C': + domain π(C) λ(C) belief +---------------------------------------------------------------- + c1 0.00132 0.2 0.132 + c2 0.00868 0.2 0.868 + + domain πD(C) λD(C) +---------------------------------------------------------------- + c1 0.0264 0.2 + c2 0.1736 0.2 + + +status of random variable `D': + domain π(D) λ(D) belief +---------------------------------------------------------------- + d1 0.0183470608 1 0.45867652 + d2 0.0216529392 1 0.54132348 + +λ message B --> A + λB(a1) = [p(b1|a1)].λ(b1) + [p(b2|a1)].λ(b2) = [(0.03)]x0.2 + [(0.97)]x0.2 = 0.2 + λB(a2) = [p(b1|a2)].λ(b1) + [p(b2|a2)].λ(b2) = [(0.6)]x0.2 + [(0.4)]x0.2 = 0.2 +λ message C --> A + λC(a1) = [p(c1|a1)].λ(c1) + [p(c2|a1)].λ(c2) = [(0.24)]x0.2 + [(0.76)]x0.2 = 0.2 + λC(a2) = [p(c1|a2)].λ(c1) + [p(c2|a2)].λ(c2) = [(0.12)]x0.2 + [(0.88)]x0.2 = 0.2 +λ message D --> B + λD(b1) = [p(d1|b1,c1).πD(c1) + p(d1|b1,c2).πD(c2)].λ(d1) + [p(d2|b1,c1).πD(c1) + p(d2|b1,c2).πD(c2)].λ(d2) = [(0.2x0.0264) + (0.7x0.1736)]x1 + [(0.8x0.0264) + (0.3x0.1736)]x1 = 0.2 + λD(b2) = [p(d1|b2,c1).πD(c1) + p(d1|b2,c2).πD(c2)].λ(d1) + [p(d2|b2,c1).πD(c1) + p(d2|b2,c2).πD(c2)].λ(d2) = [(0.45x0.0264) + (0.22x0.1736)]x1 + [(0.55x0.0264) + (0.78x0.1736)]x1 = 0.2 +λ message D --> C + λD(c1) = [p(d1|b1,c1).πD(b1) + p(d1|b2,c1).πD(b2)].λ(d1) + [p(d2|b1,c1).πD(b1) + p(d2|b2,c1).πD(b2)].λ(d2) = [(0.2x0.1086) + (0.45x0.0914)]x1 + [(0.8x0.1086) + (0.55x0.0914)]x1 = 0.2 + λD(c2) = [p(d1|b1,c2).πD(b1) + p(d1|b2,c2).πD(b2)].λ(d1) + [p(d2|b1,c2).πD(b1) + p(d2|b2,c2).πD(b2)].λ(d2) = [(0.7x0.1086) + (0.22x0.0914)]x1 + [(0.3x0.1086) + (0.78x0.0914)]x1 = 0.2 +π message A --> B + πB(a1) = π(a1).λC(a1) = 0.01 x 0.1 = 0.001 + πB(a2) = π(a2).λC(a2) = 0.09 x 0.1 = 0.009 +π message A --> C + πC(a1) = π(a1).λB(a1) = 0.01 x 0.1 = 0.001 + πC(a2) = π(a2).λB(a2) = 0.09 x 0.1 = 0.009 +π message B --> D + πD(b1) = π(b1) = 0.00543 = 0.00543 + πD(b2) = π(b2) = 0.00457 = 0.00457 +π message C --> D + πD(c1) = π(c1) = 0.00132 = 0.00132 + πD(c2) = π(c2) = 0.00868 = 0.00868 + +updating π & λ values +node A: + π(a1) = p(a1) = (0.01) = 0.01 + π(a2) = p(a2) = (0.09) = 0.09 + λ(a1) = λB(a1).λC(a1) = 0.2 x 0.2 = 0.04 + λ(a2) = λB(a2).λC(a2) = 0.2 x 0.2 = 0.04 + belief change = 0 +node B: + π(b1) = p(b1|a1).πB(a1) + p(b1|a2).πB(a2) = (0.03 x 0.001) + (0.6 x 0.009) = 0.00543 + π(b2) = p(b2|a1).πB(a1) + p(b2|a2).πB(a2) = (0.97 x 0.001) + (0.4 x 0.009) = 0.00457 + λ(b1) = λD(b1) = 0.2 = 0.2 + λ(b2) = λD(b2) = 0.2 = 0.2 + belief change = 0 +node C: + π(c1) = p(c1|a1).πC(a1) + p(c1|a2).πC(a2) = (0.24 x 0.001) + (0.12 x 0.009) = 0.00132 + π(c2) = p(c2|a1).πC(a1) + p(c2|a2).πC(a2) = (0.76 x 0.001) + (0.88 x 0.009) = 0.00868 + λ(c1) = λD(c1) = 0.2 = 0.2 + λ(c2) = λD(c2) = 0.2 = 0.2 + belief change = 0 +node D: + π(d1) = p(d1|b1,c1).πD(b1).πD(c1) + p(d1|b1,c2).πD(b1).πD(c2) + p(d1|b2,c1).πD(b2).πD(c1) + p(d1|b2,c2).πD(b2).πD(c2) = (0.2 x 0.00543 x 0.00132) + (0.7 x 0.00543 x 0.00868) + (0.45 x 0.00457 x 0.00132) + (0.22 x 0.00457 x 0.00868) = 4.5867652e-05 + π(d2) = p(d2|b1,c1).πD(b1).πD(c1) + p(d2|b1,c2).πD(b1).πD(c2) + p(d2|b2,c1).πD(b2).πD(c1) + p(d2|b2,c2).πD(b2).πD(c2) = (0.8 x 0.00543 x 0.00132) + (0.3 x 0.00543 x 0.00868) + (0.55 x 0.00457 x 0.00132) + (0.78 x 0.00457 x 0.00868) = 5.4132348e-05 + λ(d1) = 1 + λ(d2) = 1 + belief change = 0 + + +******************************************************************************** +Iteration 6 +******************************************************************************** + +status of random variable `A': + domain π(A) λ(A) belief +---------------------------------------------------------------- + a1 0.01 0.04 0.1 + a2 0.09 0.04 0.9 + + domain πB(A) λB(A) +---------------------------------------------------------------- + a1 0.001 0.2 + a2 0.009 0.2 + + domain πC(A) λC(A) +---------------------------------------------------------------- + a1 0.001 0.2 + a2 0.009 0.2 + + +status of random variable `B': + domain π(B) λ(B) belief +---------------------------------------------------------------- + b1 0.00543 0.2 0.543 + b2 0.00457 0.2 0.457 + + domain πD(B) λD(B) +---------------------------------------------------------------- + b1 0.00543 0.2 + b2 0.00457 0.2 + + +status of random variable `C': + domain π(C) λ(C) belief +---------------------------------------------------------------- + c1 0.00132 0.2 0.132 + c2 0.00868 0.2 0.868 + + domain πD(C) λD(C) +---------------------------------------------------------------- + c1 0.00132 0.2 + c2 0.00868 0.2 + + +status of random variable `D': + domain π(D) λ(D) belief +---------------------------------------------------------------- + d1 4.5867652e-05 1 0.45867652 + d2 5.4132348e-05 1 0.54132348 + +λ message B --> A + λB(a1) = [p(b1|a1)].λ(b1) + [p(b2|a1)].λ(b2) = [(0.03)]x0.2 + [(0.97)]x0.2 = 0.2 + λB(a2) = [p(b1|a2)].λ(b1) + [p(b2|a2)].λ(b2) = [(0.6)]x0.2 + [(0.4)]x0.2 = 0.2 +λ message C --> A + λC(a1) = [p(c1|a1)].λ(c1) + [p(c2|a1)].λ(c2) = [(0.24)]x0.2 + [(0.76)]x0.2 = 0.2 + λC(a2) = [p(c1|a2)].λ(c1) + [p(c2|a2)].λ(c2) = [(0.12)]x0.2 + [(0.88)]x0.2 = 0.2 +λ message D --> B + λD(b1) = [p(d1|b1,c1).πD(c1) + p(d1|b1,c2).πD(c2)].λ(d1) + [p(d2|b1,c1).πD(c1) + p(d2|b1,c2).πD(c2)].λ(d2) = [(0.2x0.00132) + (0.7x0.00868)]x1 + [(0.8x0.00132) + (0.3x0.00868)]x1 = 0.01 + λD(b2) = [p(d1|b2,c1).πD(c1) + p(d1|b2,c2).πD(c2)].λ(d1) + [p(d2|b2,c1).πD(c1) + p(d2|b2,c2).πD(c2)].λ(d2) = [(0.45x0.00132) + (0.22x0.00868)]x1 + [(0.55x0.00132) + (0.78x0.00868)]x1 = 0.01 +λ message D --> C + λD(c1) = [p(d1|b1,c1).πD(b1) + p(d1|b2,c1).πD(b2)].λ(d1) + [p(d2|b1,c1).πD(b1) + p(d2|b2,c1).πD(b2)].λ(d2) = [(0.2x0.00543) + (0.45x0.00457)]x1 + [(0.8x0.00543) + (0.55x0.00457)]x1 = 0.01 + λD(c2) = [p(d1|b1,c2).πD(b1) + p(d1|b2,c2).πD(b2)].λ(d1) + [p(d2|b1,c2).πD(b1) + p(d2|b2,c2).πD(b2)].λ(d2) = [(0.7x0.00543) + (0.22x0.00457)]x1 + [(0.3x0.00543) + (0.78x0.00457)]x1 = 0.01 +π message A --> B + πB(a1) = π(a1).λC(a1) = 0.01 x 0.2 = 0.002 + πB(a2) = π(a2).λC(a2) = 0.09 x 0.2 = 0.018 +π message A --> C + πC(a1) = π(a1).λB(a1) = 0.01 x 0.2 = 0.002 + πC(a2) = π(a2).λB(a2) = 0.09 x 0.2 = 0.018 +π message B --> D + πD(b1) = π(b1) = 0.00543 = 0.00543 + πD(b2) = π(b2) = 0.00457 = 0.00457 +π message C --> D + πD(c1) = π(c1) = 0.00132 = 0.00132 + πD(c2) = π(c2) = 0.00868 = 0.00868 + +updating π & λ values +node A: + π(a1) = p(a1) = (0.01) = 0.01 + π(a2) = p(a2) = (0.09) = 0.09 + λ(a1) = λB(a1).λC(a1) = 0.2 x 0.2 = 0.04 + λ(a2) = λB(a2).λC(a2) = 0.2 x 0.2 = 0.04 + belief change = 0 +node B: + π(b1) = p(b1|a1).πB(a1) + p(b1|a2).πB(a2) = (0.03 x 0.002) + (0.6 x 0.018) = 0.01086 + π(b2) = p(b2|a1).πB(a1) + p(b2|a2).πB(a2) = (0.97 x 0.002) + (0.4 x 0.018) = 0.00914 + λ(b1) = λD(b1) = 0.01 = 0.01 + λ(b2) = λD(b2) = 0.01 = 0.01 + belief change = 5.551115123e-17 +node C: + π(c1) = p(c1|a1).πC(a1) + p(c1|a2).πC(a2) = (0.24 x 0.002) + (0.12 x 0.018) = 0.00264 + π(c2) = p(c2|a1).πC(a1) + p(c2|a2).πC(a2) = (0.76 x 0.002) + (0.88 x 0.018) = 0.01736 + λ(c1) = λD(c1) = 0.01 = 0.01 + λ(c2) = λD(c2) = 0.01 = 0.01 + belief change = 1.110223025e-16 +node D: + π(d1) = p(d1|b1,c1).πD(b1).πD(c1) + p(d1|b1,c2).πD(b1).πD(c2) + p(d1|b2,c1).πD(b2).πD(c1) + p(d1|b2,c2).πD(b2).πD(c2) = (0.2 x 0.00543 x 0.00132) + (0.7 x 0.00543 x 0.00868) + (0.45 x 0.00457 x 0.00132) + (0.22 x 0.00457 x 0.00868) = 4.5867652e-05 + π(d2) = p(d2|b1,c1).πD(b1).πD(c1) + p(d2|b1,c2).πD(b1).πD(c2) + p(d2|b2,c1).πD(b2).πD(c1) + p(d2|b2,c2).πD(b2).πD(c2) = (0.8 x 0.00543 x 0.00132) + (0.3 x 0.00543 x 0.00868) + (0.55 x 0.00457 x 0.00132) + (0.78 x 0.00457 x 0.00868) = 5.4132348e-05 + λ(d1) = 1 + λ(d2) = 1 + belief change = 0 + + +******************************************************************************** +Iteration 7 +******************************************************************************** + +status of random variable `A': + domain π(A) λ(A) belief +---------------------------------------------------------------- + a1 0.01 0.04 0.1 + a2 0.09 0.04 0.9 + + domain πB(A) λB(A) +---------------------------------------------------------------- + a1 0.002 0.2 + a2 0.018 0.2 + + domain πC(A) λC(A) +---------------------------------------------------------------- + a1 0.002 0.2 + a2 0.018 0.2 + + +status of random variable `B': + domain π(B) λ(B) belief +---------------------------------------------------------------- + b1 0.01086 0.01 0.543 + b2 0.00914 0.01 0.457 + + domain πD(B) λD(B) +---------------------------------------------------------------- + b1 0.00543 0.01 + b2 0.00457 0.01 + + +status of random variable `C': + domain π(C) λ(C) belief +---------------------------------------------------------------- + c1 0.00264 0.01 0.132 + c2 0.01736 0.01 0.868 + + domain πD(C) λD(C) +---------------------------------------------------------------- + c1 0.00132 0.01 + c2 0.00868 0.01 + + +status of random variable `D': + domain π(D) λ(D) belief +---------------------------------------------------------------- + d1 4.5867652e-05 1 0.45867652 + d2 5.4132348e-05 1 0.54132348 + +λ message B --> A + λB(a1) = [p(b1|a1)].λ(b1) + [p(b2|a1)].λ(b2) = [(0.03)]x0.01 + [(0.97)]x0.01 = 0.01 + λB(a2) = [p(b1|a2)].λ(b1) + [p(b2|a2)].λ(b2) = [(0.6)]x0.01 + [(0.4)]x0.01 = 0.01 +λ message C --> A + λC(a1) = [p(c1|a1)].λ(c1) + [p(c2|a1)].λ(c2) = [(0.24)]x0.01 + [(0.76)]x0.01 = 0.01 + λC(a2) = [p(c1|a2)].λ(c1) + [p(c2|a2)].λ(c2) = [(0.12)]x0.01 + [(0.88)]x0.01 = 0.01 +λ message D --> B + λD(b1) = [p(d1|b1,c1).πD(c1) + p(d1|b1,c2).πD(c2)].λ(d1) + [p(d2|b1,c1).πD(c1) + p(d2|b1,c2).πD(c2)].λ(d2) = [(0.2x0.00132) + (0.7x0.00868)]x1 + [(0.8x0.00132) + (0.3x0.00868)]x1 = 0.01 + λD(b2) = [p(d1|b2,c1).πD(c1) + p(d1|b2,c2).πD(c2)].λ(d1) + [p(d2|b2,c1).πD(c1) + p(d2|b2,c2).πD(c2)].λ(d2) = [(0.45x0.00132) + (0.22x0.00868)]x1 + [(0.55x0.00132) + (0.78x0.00868)]x1 = 0.01 +λ message D --> C + λD(c1) = [p(d1|b1,c1).πD(b1) + p(d1|b2,c1).πD(b2)].λ(d1) + [p(d2|b1,c1).πD(b1) + p(d2|b2,c1).πD(b2)].λ(d2) = [(0.2x0.00543) + (0.45x0.00457)]x1 + [(0.8x0.00543) + (0.55x0.00457)]x1 = 0.01 + λD(c2) = [p(d1|b1,c2).πD(b1) + p(d1|b2,c2).πD(b2)].λ(d1) + [p(d2|b1,c2).πD(b1) + p(d2|b2,c2).πD(b2)].λ(d2) = [(0.7x0.00543) + (0.22x0.00457)]x1 + [(0.3x0.00543) + (0.78x0.00457)]x1 = 0.01 +π message A --> B + πB(a1) = π(a1).λC(a1) = 0.01 x 0.2 = 0.002 + πB(a2) = π(a2).λC(a2) = 0.09 x 0.2 = 0.018 +π message A --> C + πC(a1) = π(a1).λB(a1) = 0.01 x 0.2 = 0.002 + πC(a2) = π(a2).λB(a2) = 0.09 x 0.2 = 0.018 +π message B --> D + πD(b1) = π(b1) = 0.01086 = 0.01086 + πD(b2) = π(b2) = 0.00914 = 0.00914 +π message C --> D + πD(c1) = π(c1) = 0.00264 = 0.00264 + πD(c2) = π(c2) = 0.01736 = 0.01736 + +updating π & λ values +node A: + π(a1) = p(a1) = (0.01) = 0.01 + π(a2) = p(a2) = (0.09) = 0.09 + λ(a1) = λB(a1).λC(a1) = 0.01 x 0.01 = 0.0001 + λ(a2) = λB(a2).λC(a2) = 0.01 x 0.01 = 0.0001 + belief change = 1.387778781e-17 +node B: + π(b1) = p(b1|a1).πB(a1) + p(b1|a2).πB(a2) = (0.03 x 0.002) + (0.6 x 0.018) = 0.01086 + π(b2) = p(b2|a1).πB(a1) + p(b2|a2).πB(a2) = (0.97 x 0.002) + (0.4 x 0.018) = 0.00914 + λ(b1) = λD(b1) = 0.01 = 0.01 + λ(b2) = λD(b2) = 0.01 = 0.01 + belief change = 0 +node C: + π(c1) = p(c1|a1).πC(a1) + p(c1|a2).πC(a2) = (0.24 x 0.002) + (0.12 x 0.018) = 0.00264 + π(c2) = p(c2|a1).πC(a1) + p(c2|a2).πC(a2) = (0.76 x 0.002) + (0.88 x 0.018) = 0.01736 + λ(c1) = λD(c1) = 0.01 = 0.01 + λ(c2) = λD(c2) = 0.01 = 0.01 + belief change = 0 +node D: + π(d1) = p(d1|b1,c1).πD(b1).πD(c1) + p(d1|b1,c2).πD(b1).πD(c2) + p(d1|b2,c1).πD(b2).πD(c1) + p(d1|b2,c2).πD(b2).πD(c2) = (0.2 x 0.01086 x 0.00264) + (0.7 x 0.01086 x 0.01736) + (0.45 x 0.00914 x 0.00264) + (0.22 x 0.00914 x 0.01736) = 0.000183470608 + π(d2) = p(d2|b1,c1).πD(b1).πD(c1) + p(d2|b1,c2).πD(b1).πD(c2) + p(d2|b2,c1).πD(b2).πD(c1) + p(d2|b2,c2).πD(b2).πD(c2) = (0.8 x 0.01086 x 0.00264) + (0.3 x 0.01086 x 0.01736) + (0.55 x 0.00914 x 0.00264) + (0.78 x 0.00914 x 0.01736) = 0.000216529392 + λ(d1) = 1 + λ(d2) = 1 + belief change = 0 + + +******************************************************************************** +Iteration 8 +******************************************************************************** + +status of random variable `A': + domain π(A) λ(A) belief +---------------------------------------------------------------- + a1 0.01 0.0001 0.1 + a2 0.09 0.0001 0.9 + + domain πB(A) λB(A) +---------------------------------------------------------------- + a1 0.002 0.01 + a2 0.018 0.01 + + domain πC(A) λC(A) +---------------------------------------------------------------- + a1 0.002 0.01 + a2 0.018 0.01 + + +status of random variable `B': + domain π(B) λ(B) belief +---------------------------------------------------------------- + b1 0.01086 0.01 0.543 + b2 0.00914 0.01 0.457 + + domain πD(B) λD(B) +---------------------------------------------------------------- + b1 0.01086 0.01 + b2 0.00914 0.01 + + +status of random variable `C': + domain π(C) λ(C) belief +---------------------------------------------------------------- + c1 0.00264 0.01 0.132 + c2 0.01736 0.01 0.868 + + domain πD(C) λD(C) +---------------------------------------------------------------- + c1 0.00264 0.01 + c2 0.01736 0.01 + + +status of random variable `D': + domain π(D) λ(D) belief +---------------------------------------------------------------- + d1 0.000183470608 1 0.45867652 + d2 0.000216529392 1 0.54132348 + +λ message B --> A + λB(a1) = [p(b1|a1)].λ(b1) + [p(b2|a1)].λ(b2) = [(0.03)]x0.01 + [(0.97)]x0.01 = 0.01 + λB(a2) = [p(b1|a2)].λ(b1) + [p(b2|a2)].λ(b2) = [(0.6)]x0.01 + [(0.4)]x0.01 = 0.01 +λ message C --> A + λC(a1) = [p(c1|a1)].λ(c1) + [p(c2|a1)].λ(c2) = [(0.24)]x0.01 + [(0.76)]x0.01 = 0.01 + λC(a2) = [p(c1|a2)].λ(c1) + [p(c2|a2)].λ(c2) = [(0.12)]x0.01 + [(0.88)]x0.01 = 0.01 +λ message D --> B + λD(b1) = [p(d1|b1,c1).πD(c1) + p(d1|b1,c2).πD(c2)].λ(d1) + [p(d2|b1,c1).πD(c1) + p(d2|b1,c2).πD(c2)].λ(d2) = [(0.2x0.00264) + (0.7x0.01736)]x1 + [(0.8x0.00264) + (0.3x0.01736)]x1 = 0.02 + λD(b2) = [p(d1|b2,c1).πD(c1) + p(d1|b2,c2).πD(c2)].λ(d1) + [p(d2|b2,c1).πD(c1) + p(d2|b2,c2).πD(c2)].λ(d2) = [(0.45x0.00264) + (0.22x0.01736)]x1 + [(0.55x0.00264) + (0.78x0.01736)]x1 = 0.02 +λ message D --> C + λD(c1) = [p(d1|b1,c1).πD(b1) + p(d1|b2,c1).πD(b2)].λ(d1) + [p(d2|b1,c1).πD(b1) + p(d2|b2,c1).πD(b2)].λ(d2) = [(0.2x0.01086) + (0.45x0.00914)]x1 + [(0.8x0.01086) + (0.55x0.00914)]x1 = 0.02 + λD(c2) = [p(d1|b1,c2).πD(b1) + p(d1|b2,c2).πD(b2)].λ(d1) + [p(d2|b1,c2).πD(b1) + p(d2|b2,c2).πD(b2)].λ(d2) = [(0.7x0.01086) + (0.22x0.00914)]x1 + [(0.3x0.01086) + (0.78x0.00914)]x1 = 0.02 +π message A --> B + πB(a1) = π(a1).λC(a1) = 0.01 x 0.01 = 0.0001 + πB(a2) = π(a2).λC(a2) = 0.09 x 0.01 = 0.0009 +π message A --> C + πC(a1) = π(a1).λB(a1) = 0.01 x 0.01 = 0.0001 + πC(a2) = π(a2).λB(a2) = 0.09 x 0.01 = 0.0009 +π message B --> D + πD(b1) = π(b1) = 0.01086 = 0.01086 + πD(b2) = π(b2) = 0.00914 = 0.00914 +π message C --> D + πD(c1) = π(c1) = 0.00264 = 0.00264 + πD(c2) = π(c2) = 0.01736 = 0.01736 + +updating π & λ values +node A: + π(a1) = p(a1) = (0.01) = 0.01 + π(a2) = p(a2) = (0.09) = 0.09 + λ(a1) = λB(a1).λC(a1) = 0.01 x 0.01 = 0.0001 + λ(a2) = λB(a2).λC(a2) = 0.01 x 0.01 = 0.0001 + belief change = 0 +node B: + π(b1) = p(b1|a1).πB(a1) + p(b1|a2).πB(a2) = (0.03 x 0.0001) + (0.6 x 0.0009) = 0.000543 + π(b2) = p(b2|a1).πB(a1) + p(b2|a2).πB(a2) = (0.97 x 0.0001) + (0.4 x 0.0009) = 0.000457 + λ(b1) = λD(b1) = 0.02 = 0.02 + λ(b2) = λD(b2) = 0.02 = 0.02 + belief change = 0 +node C: + π(c1) = p(c1|a1).πC(a1) + p(c1|a2).πC(a2) = (0.24 x 0.0001) + (0.12 x 0.0009) = 0.000132 + π(c2) = p(c2|a1).πC(a1) + p(c2|a2).πC(a2) = (0.76 x 0.0001) + (0.88 x 0.0009) = 0.000868 + λ(c1) = λD(c1) = 0.02 = 0.02 + λ(c2) = λD(c2) = 0.02 = 0.02 + belief change = 1.387778781e-16 +node D: + π(d1) = p(d1|b1,c1).πD(b1).πD(c1) + p(d1|b1,c2).πD(b1).πD(c2) + p(d1|b2,c1).πD(b2).πD(c1) + p(d1|b2,c2).πD(b2).πD(c2) = (0.2 x 0.01086 x 0.00264) + (0.7 x 0.01086 x 0.01736) + (0.45 x 0.00914 x 0.00264) + (0.22 x 0.00914 x 0.01736) = 0.000183470608 + π(d2) = p(d2|b1,c1).πD(b1).πD(c1) + p(d2|b1,c2).πD(b1).πD(c2) + p(d2|b2,c1).πD(b2).πD(c1) + p(d2|b2,c2).πD(b2).πD(c2) = (0.8 x 0.01086 x 0.00264) + (0.3 x 0.01086 x 0.01736) + (0.55 x 0.00914 x 0.00264) + (0.78 x 0.00914 x 0.01736) = 0.000216529392 + λ(d1) = 1 + λ(d2) = 1 + belief change = 0 + + +******************************************************************************** +Iteration 9 +******************************************************************************** + +status of random variable `A': + domain π(A) λ(A) belief +---------------------------------------------------------------- + a1 0.01 0.0001 0.1 + a2 0.09 0.0001 0.9 + + domain πB(A) λB(A) +---------------------------------------------------------------- + a1 0.0001 0.01 + a2 0.0009 0.01 + + domain πC(A) λC(A) +---------------------------------------------------------------- + a1 0.0001 0.01 + a2 0.0009 0.01 + + +status of random variable `B': + domain π(B) λ(B) belief +---------------------------------------------------------------- + b1 0.000543 0.02 0.543 + b2 0.000457 0.02 0.457 + + domain πD(B) λD(B) +---------------------------------------------------------------- + b1 0.01086 0.02 + b2 0.00914 0.02 + + +status of random variable `C': + domain π(C) λ(C) belief +---------------------------------------------------------------- + c1 0.000132 0.02 0.132 + c2 0.000868 0.02 0.868 + + domain πD(C) λD(C) +---------------------------------------------------------------- + c1 0.00264 0.02 + c2 0.01736 0.02 + + +status of random variable `D': + domain π(D) λ(D) belief +---------------------------------------------------------------- + d1 0.000183470608 1 0.45867652 + d2 0.000216529392 1 0.54132348 + +λ message B --> A + λB(a1) = [p(b1|a1)].λ(b1) + [p(b2|a1)].λ(b2) = [(0.03)]x0.02 + [(0.97)]x0.02 = 0.02 + λB(a2) = [p(b1|a2)].λ(b1) + [p(b2|a2)].λ(b2) = [(0.6)]x0.02 + [(0.4)]x0.02 = 0.02 +λ message C --> A + λC(a1) = [p(c1|a1)].λ(c1) + [p(c2|a1)].λ(c2) = [(0.24)]x0.02 + [(0.76)]x0.02 = 0.02 + λC(a2) = [p(c1|a2)].λ(c1) + [p(c2|a2)].λ(c2) = [(0.12)]x0.02 + [(0.88)]x0.02 = 0.02 +λ message D --> B + λD(b1) = [p(d1|b1,c1).πD(c1) + p(d1|b1,c2).πD(c2)].λ(d1) + [p(d2|b1,c1).πD(c1) + p(d2|b1,c2).πD(c2)].λ(d2) = [(0.2x0.00264) + (0.7x0.01736)]x1 + [(0.8x0.00264) + (0.3x0.01736)]x1 = 0.02 + λD(b2) = [p(d1|b2,c1).πD(c1) + p(d1|b2,c2).πD(c2)].λ(d1) + [p(d2|b2,c1).πD(c1) + p(d2|b2,c2).πD(c2)].λ(d2) = [(0.45x0.00264) + (0.22x0.01736)]x1 + [(0.55x0.00264) + (0.78x0.01736)]x1 = 0.02 +λ message D --> C + λD(c1) = [p(d1|b1,c1).πD(b1) + p(d1|b2,c1).πD(b2)].λ(d1) + [p(d2|b1,c1).πD(b1) + p(d2|b2,c1).πD(b2)].λ(d2) = [(0.2x0.01086) + (0.45x0.00914)]x1 + [(0.8x0.01086) + (0.55x0.00914)]x1 = 0.02 + λD(c2) = [p(d1|b1,c2).πD(b1) + p(d1|b2,c2).πD(b2)].λ(d1) + [p(d2|b1,c2).πD(b1) + p(d2|b2,c2).πD(b2)].λ(d2) = [(0.7x0.01086) + (0.22x0.00914)]x1 + [(0.3x0.01086) + (0.78x0.00914)]x1 = 0.02 +π message A --> B + πB(a1) = π(a1).λC(a1) = 0.01 x 0.01 = 0.0001 + πB(a2) = π(a2).λC(a2) = 0.09 x 0.01 = 0.0009 +π message A --> C + πC(a1) = π(a1).λB(a1) = 0.01 x 0.01 = 0.0001 + πC(a2) = π(a2).λB(a2) = 0.09 x 0.01 = 0.0009 +π message B --> D + πD(b1) = π(b1) = 0.000543 = 0.000543 + πD(b2) = π(b2) = 0.000457 = 0.000457 +π message C --> D + πD(c1) = π(c1) = 0.000132 = 0.000132 + πD(c2) = π(c2) = 0.000868 = 0.000868 + +updating π & λ values +node A: + π(a1) = p(a1) = (0.01) = 0.01 + π(a2) = p(a2) = (0.09) = 0.09 + λ(a1) = λB(a1).λC(a1) = 0.02 x 0.02 = 0.0004 + λ(a2) = λB(a2).λC(a2) = 0.02 x 0.02 = 0.0004 + belief change = 0 +node B: + π(b1) = p(b1|a1).πB(a1) + p(b1|a2).πB(a2) = (0.03 x 0.0001) + (0.6 x 0.0009) = 0.000543 + π(b2) = p(b2|a1).πB(a1) + p(b2|a2).πB(a2) = (0.97 x 0.0001) + (0.4 x 0.0009) = 0.000457 + λ(b1) = λD(b1) = 0.02 = 0.02 + λ(b2) = λD(b2) = 0.02 = 0.02 + belief change = 0 +node C: + π(c1) = p(c1|a1).πC(a1) + p(c1|a2).πC(a2) = (0.24 x 0.0001) + (0.12 x 0.0009) = 0.000132 + π(c2) = p(c2|a1).πC(a1) + p(c2|a2).πC(a2) = (0.76 x 0.0001) + (0.88 x 0.0009) = 0.000868 + λ(c1) = λD(c1) = 0.02 = 0.02 + λ(c2) = λD(c2) = 0.02 = 0.02 + belief change = 0 +node D: + π(d1) = p(d1|b1,c1).πD(b1).πD(c1) + p(d1|b1,c2).πD(b1).πD(c2) + p(d1|b2,c1).πD(b2).πD(c1) + p(d1|b2,c2).πD(b2).πD(c2) = (0.2 x 0.000543 x 0.000132) + (0.7 x 0.000543 x 0.000868) + (0.45 x 0.000457 x 0.000132) + (0.22 x 0.000457 x 0.000868) = 4.5867652e-07 + π(d2) = p(d2|b1,c1).πD(b1).πD(c1) + p(d2|b1,c2).πD(b1).πD(c2) + p(d2|b2,c1).πD(b2).πD(c1) + p(d2|b2,c2).πD(b2).πD(c2) = (0.8 x 0.000543 x 0.000132) + (0.3 x 0.000543 x 0.000868) + (0.55 x 0.000457 x 0.000132) + (0.78 x 0.000457 x 0.000868) = 5.4132348e-07 + λ(d1) = 1 + λ(d2) = 1 + belief change = 5.551115123e-17 + + +******************************************************************************** +Iteration 10 +******************************************************************************** + +status of random variable `A': + domain π(A) λ(A) belief +---------------------------------------------------------------- + a1 0.01 0.0004 0.1 + a2 0.09 0.0004 0.9 + + domain πB(A) λB(A) +---------------------------------------------------------------- + a1 0.0001 0.02 + a2 0.0009 0.02 + + domain πC(A) λC(A) +---------------------------------------------------------------- + a1 0.0001 0.02 + a2 0.0009 0.02 + + +status of random variable `B': + domain π(B) λ(B) belief +---------------------------------------------------------------- + b1 0.000543 0.02 0.543 + b2 0.000457 0.02 0.457 + + domain πD(B) λD(B) +---------------------------------------------------------------- + b1 0.000543 0.02 + b2 0.000457 0.02 + + +status of random variable `C': + domain π(C) λ(C) belief +---------------------------------------------------------------- + c1 0.000132 0.02 0.132 + c2 0.000868 0.02 0.868 + + domain πD(C) λD(C) +---------------------------------------------------------------- + c1 0.000132 0.02 + c2 0.000868 0.02 + + +status of random variable `D': + domain π(D) λ(D) belief +---------------------------------------------------------------- + d1 4.5867652e-07 1 0.45867652 + d2 5.4132348e-07 1 0.54132348 + +λ message B --> A + λB(a1) = [p(b1|a1)].λ(b1) + [p(b2|a1)].λ(b2) = [(0.03)]x0.02 + [(0.97)]x0.02 = 0.02 + λB(a2) = [p(b1|a2)].λ(b1) + [p(b2|a2)].λ(b2) = [(0.6)]x0.02 + [(0.4)]x0.02 = 0.02 +λ message C --> A + λC(a1) = [p(c1|a1)].λ(c1) + [p(c2|a1)].λ(c2) = [(0.24)]x0.02 + [(0.76)]x0.02 = 0.02 + λC(a2) = [p(c1|a2)].λ(c1) + [p(c2|a2)].λ(c2) = [(0.12)]x0.02 + [(0.88)]x0.02 = 0.02 +λ message D --> B + λD(b1) = [p(d1|b1,c1).πD(c1) + p(d1|b1,c2).πD(c2)].λ(d1) + [p(d2|b1,c1).πD(c1) + p(d2|b1,c2).πD(c2)].λ(d2) = [(0.2x0.000132) + (0.7x0.000868)]x1 + [(0.8x0.000132) + (0.3x0.000868)]x1 = 0.001 + λD(b2) = [p(d1|b2,c1).πD(c1) + p(d1|b2,c2).πD(c2)].λ(d1) + [p(d2|b2,c1).πD(c1) + p(d2|b2,c2).πD(c2)].λ(d2) = [(0.45x0.000132) + (0.22x0.000868)]x1 + [(0.55x0.000132) + (0.78x0.000868)]x1 = 0.001 +λ message D --> C + λD(c1) = [p(d1|b1,c1).πD(b1) + p(d1|b2,c1).πD(b2)].λ(d1) + [p(d2|b1,c1).πD(b1) + p(d2|b2,c1).πD(b2)].λ(d2) = [(0.2x0.000543) + (0.45x0.000457)]x1 + [(0.8x0.000543) + (0.55x0.000457)]x1 = 0.001 + λD(c2) = [p(d1|b1,c2).πD(b1) + p(d1|b2,c2).πD(b2)].λ(d1) + [p(d2|b1,c2).πD(b1) + p(d2|b2,c2).πD(b2)].λ(d2) = [(0.7x0.000543) + (0.22x0.000457)]x1 + [(0.3x0.000543) + (0.78x0.000457)]x1 = 0.001 +π message A --> B + πB(a1) = π(a1).λC(a1) = 0.01 x 0.02 = 0.0002 + πB(a2) = π(a2).λC(a2) = 0.09 x 0.02 = 0.0018 +π message A --> C + πC(a1) = π(a1).λB(a1) = 0.01 x 0.02 = 0.0002 + πC(a2) = π(a2).λB(a2) = 0.09 x 0.02 = 0.0018 +π message B --> D + πD(b1) = π(b1) = 0.000543 = 0.000543 + πD(b2) = π(b2) = 0.000457 = 0.000457 +π message C --> D + πD(c1) = π(c1) = 0.000132 = 0.000132 + πD(c2) = π(c2) = 0.000868 = 0.000868 + +updating π & λ values +node A: + π(a1) = p(a1) = (0.01) = 0.01 + π(a2) = p(a2) = (0.09) = 0.09 + λ(a1) = λB(a1).λC(a1) = 0.02 x 0.02 = 0.0004 + λ(a2) = λB(a2).λC(a2) = 0.02 x 0.02 = 0.0004 + belief change = 0 +node B: + π(b1) = p(b1|a1).πB(a1) + p(b1|a2).πB(a2) = (0.03 x 0.0002) + (0.6 x 0.0018) = 0.001086 + π(b2) = p(b2|a1).πB(a1) + p(b2|a2).πB(a2) = (0.97 x 0.0002) + (0.4 x 0.0018) = 0.000914 + λ(b1) = λD(b1) = 0.001 = 0.001 + λ(b2) = λD(b2) = 0.001 = 0.001 + belief change = 3.330669074e-16 +node C: + π(c1) = p(c1|a1).πC(a1) + p(c1|a2).πC(a2) = (0.24 x 0.0002) + (0.12 x 0.0018) = 0.000264 + π(c2) = p(c2|a1).πC(a1) + p(c2|a2).πC(a2) = (0.76 x 0.0002) + (0.88 x 0.0018) = 0.001736 + λ(c1) = λD(c1) = 0.001 = 0.001 + λ(c2) = λD(c2) = 0.001 = 0.001 + belief change = 2.775557562e-17 +node D: + π(d1) = p(d1|b1,c1).πD(b1).πD(c1) + p(d1|b1,c2).πD(b1).πD(c2) + p(d1|b2,c1).πD(b2).πD(c1) + p(d1|b2,c2).πD(b2).πD(c2) = (0.2 x 0.000543 x 0.000132) + (0.7 x 0.000543 x 0.000868) + (0.45 x 0.000457 x 0.000132) + (0.22 x 0.000457 x 0.000868) = 4.5867652e-07 + π(d2) = p(d2|b1,c1).πD(b1).πD(c1) + p(d2|b1,c2).πD(b1).πD(c2) + p(d2|b2,c1).πD(b2).πD(c1) + p(d2|b2,c2).πD(b2).πD(c2) = (0.8 x 0.000543 x 0.000132) + (0.3 x 0.000543 x 0.000868) + (0.55 x 0.000457 x 0.000132) + (0.78 x 0.000457 x 0.000868) = 5.4132348e-07 + λ(d1) = 1 + λ(d2) = 1 + belief change = 0 + + +******************************************************************************** +Iteration 11 +******************************************************************************** + +status of random variable `A': + domain π(A) λ(A) belief +---------------------------------------------------------------- + a1 0.01 0.0004 0.1 + a2 0.09 0.0004 0.9 + + domain πB(A) λB(A) +---------------------------------------------------------------- + a1 0.0002 0.02 + a2 0.0018 0.02 + + domain πC(A) λC(A) +---------------------------------------------------------------- + a1 0.0002 0.02 + a2 0.0018 0.02 + + +status of random variable `B': + domain π(B) λ(B) belief +---------------------------------------------------------------- + b1 0.001086 0.001 0.543 + b2 0.000914 0.001 0.457 + + domain πD(B) λD(B) +---------------------------------------------------------------- + b1 0.000543 0.001 + b2 0.000457 0.001 + + +status of random variable `C': + domain π(C) λ(C) belief +---------------------------------------------------------------- + c1 0.000264 0.001 0.132 + c2 0.001736 0.001 0.868 + + domain πD(C) λD(C) +---------------------------------------------------------------- + c1 0.000132 0.001 + c2 0.000868 0.001 + + +status of random variable `D': + domain π(D) λ(D) belief +---------------------------------------------------------------- + d1 4.5867652e-07 1 0.45867652 + d2 5.4132348e-07 1 0.54132348 + +λ message B --> A + λB(a1) = [p(b1|a1)].λ(b1) + [p(b2|a1)].λ(b2) = [(0.03)]x0.001 + [(0.97)]x0.001 = 0.001 + λB(a2) = [p(b1|a2)].λ(b1) + [p(b2|a2)].λ(b2) = [(0.6)]x0.001 + [(0.4)]x0.001 = 0.001 +λ message C --> A + λC(a1) = [p(c1|a1)].λ(c1) + [p(c2|a1)].λ(c2) = [(0.24)]x0.001 + [(0.76)]x0.001 = 0.001 + λC(a2) = [p(c1|a2)].λ(c1) + [p(c2|a2)].λ(c2) = [(0.12)]x0.001 + [(0.88)]x0.001 = 0.001 +λ message D --> B + λD(b1) = [p(d1|b1,c1).πD(c1) + p(d1|b1,c2).πD(c2)].λ(d1) + [p(d2|b1,c1).πD(c1) + p(d2|b1,c2).πD(c2)].λ(d2) = [(0.2x0.000132) + (0.7x0.000868)]x1 + [(0.8x0.000132) + (0.3x0.000868)]x1 = 0.001 + λD(b2) = [p(d1|b2,c1).πD(c1) + p(d1|b2,c2).πD(c2)].λ(d1) + [p(d2|b2,c1).πD(c1) + p(d2|b2,c2).πD(c2)].λ(d2) = [(0.45x0.000132) + (0.22x0.000868)]x1 + [(0.55x0.000132) + (0.78x0.000868)]x1 = 0.001 +λ message D --> C + λD(c1) = [p(d1|b1,c1).πD(b1) + p(d1|b2,c1).πD(b2)].λ(d1) + [p(d2|b1,c1).πD(b1) + p(d2|b2,c1).πD(b2)].λ(d2) = [(0.2x0.000543) + (0.45x0.000457)]x1 + [(0.8x0.000543) + (0.55x0.000457)]x1 = 0.001 + λD(c2) = [p(d1|b1,c2).πD(b1) + p(d1|b2,c2).πD(b2)].λ(d1) + [p(d2|b1,c2).πD(b1) + p(d2|b2,c2).πD(b2)].λ(d2) = [(0.7x0.000543) + (0.22x0.000457)]x1 + [(0.3x0.000543) + (0.78x0.000457)]x1 = 0.001 +π message A --> B + πB(a1) = π(a1).λC(a1) = 0.01 x 0.02 = 0.0002 + πB(a2) = π(a2).λC(a2) = 0.09 x 0.02 = 0.0018 +π message A --> C + πC(a1) = π(a1).λB(a1) = 0.01 x 0.02 = 0.0002 + πC(a2) = π(a2).λB(a2) = 0.09 x 0.02 = 0.0018 +π message B --> D + πD(b1) = π(b1) = 0.001086 = 0.001086 + πD(b2) = π(b2) = 0.000914 = 0.000914 +π message C --> D + πD(c1) = π(c1) = 0.000264 = 0.000264 + πD(c2) = π(c2) = 0.001736 = 0.001736 + +updating π & λ values +node A: + π(a1) = p(a1) = (0.01) = 0.01 + π(a2) = p(a2) = (0.09) = 0.09 + λ(a1) = λB(a1).λC(a1) = 0.001 x 0.001 = 1e-06 + λ(a2) = λB(a2).λC(a2) = 0.001 x 0.001 = 1e-06 + belief change = 0 +node B: + π(b1) = p(b1|a1).πB(a1) + p(b1|a2).πB(a2) = (0.03 x 0.0002) + (0.6 x 0.0018) = 0.001086 + π(b2) = p(b2|a1).πB(a1) + p(b2|a2).πB(a2) = (0.97 x 0.0002) + (0.4 x 0.0018) = 0.000914 + λ(b1) = λD(b1) = 0.001 = 0.001 + λ(b2) = λD(b2) = 0.001 = 0.001 + belief change = 0 +node C: + π(c1) = p(c1|a1).πC(a1) + p(c1|a2).πC(a2) = (0.24 x 0.0002) + (0.12 x 0.0018) = 0.000264 + π(c2) = p(c2|a1).πC(a1) + p(c2|a2).πC(a2) = (0.76 x 0.0002) + (0.88 x 0.0018) = 0.001736 + λ(c1) = λD(c1) = 0.001 = 0.001 + λ(c2) = λD(c2) = 0.001 = 0.001 + belief change = 0 +node D: + π(d1) = p(d1|b1,c1).πD(b1).πD(c1) + p(d1|b1,c2).πD(b1).πD(c2) + p(d1|b2,c1).πD(b2).πD(c1) + p(d1|b2,c2).πD(b2).πD(c2) = (0.2 x 0.001086 x 0.000264) + (0.7 x 0.001086 x 0.001736) + (0.45 x 0.000914 x 0.000264) + (0.22 x 0.000914 x 0.001736) = 1.83470608e-06 + π(d2) = p(d2|b1,c1).πD(b1).πD(c1) + p(d2|b1,c2).πD(b1).πD(c2) + p(d2|b2,c1).πD(b2).πD(c1) + p(d2|b2,c2).πD(b2).πD(c2) = (0.8 x 0.001086 x 0.000264) + (0.3 x 0.001086 x 0.001736) + (0.55 x 0.000914 x 0.000264) + (0.78 x 0.000914 x 0.001736) = 2.16529392e-06 + λ(d1) = 1 + λ(d2) = 1 + belief change = 0 + + +******************************************************************************** +Iteration 12 +******************************************************************************** + +status of random variable `A': + domain π(A) λ(A) belief +---------------------------------------------------------------- + a1 0.01 1e-06 0.1 + a2 0.09 1e-06 0.9 + + domain πB(A) λB(A) +---------------------------------------------------------------- + a1 0.0002 0.001 + a2 0.0018 0.001 + + domain πC(A) λC(A) +---------------------------------------------------------------- + a1 0.0002 0.001 + a2 0.0018 0.001 + + +status of random variable `B': + domain π(B) λ(B) belief +---------------------------------------------------------------- + b1 0.001086 0.001 0.543 + b2 0.000914 0.001 0.457 + + domain πD(B) λD(B) +---------------------------------------------------------------- + b1 0.001086 0.001 + b2 0.000914 0.001 + + +status of random variable `C': + domain π(C) λ(C) belief +---------------------------------------------------------------- + c1 0.000264 0.001 0.132 + c2 0.001736 0.001 0.868 + + domain πD(C) λD(C) +---------------------------------------------------------------- + c1 0.000264 0.001 + c2 0.001736 0.001 + + +status of random variable `D': + domain π(D) λ(D) belief +---------------------------------------------------------------- + d1 1.83470608e-06 1 0.45867652 + d2 2.16529392e-06 1 0.54132348 + +λ message B --> A + λB(a1) = [p(b1|a1)].λ(b1) + [p(b2|a1)].λ(b2) = [(0.03)]x0.001 + [(0.97)]x0.001 = 0.001 + λB(a2) = [p(b1|a2)].λ(b1) + [p(b2|a2)].λ(b2) = [(0.6)]x0.001 + [(0.4)]x0.001 = 0.001 +λ message C --> A + λC(a1) = [p(c1|a1)].λ(c1) + [p(c2|a1)].λ(c2) = [(0.24)]x0.001 + [(0.76)]x0.001 = 0.001 + λC(a2) = [p(c1|a2)].λ(c1) + [p(c2|a2)].λ(c2) = [(0.12)]x0.001 + [(0.88)]x0.001 = 0.001 +λ message D --> B + λD(b1) = [p(d1|b1,c1).πD(c1) + p(d1|b1,c2).πD(c2)].λ(d1) + [p(d2|b1,c1).πD(c1) + p(d2|b1,c2).πD(c2)].λ(d2) = [(0.2x0.000264) + (0.7x0.001736)]x1 + [(0.8x0.000264) + (0.3x0.001736)]x1 = 0.002 + λD(b2) = [p(d1|b2,c1).πD(c1) + p(d1|b2,c2).πD(c2)].λ(d1) + [p(d2|b2,c1).πD(c1) + p(d2|b2,c2).πD(c2)].λ(d2) = [(0.45x0.000264) + (0.22x0.001736)]x1 + [(0.55x0.000264) + (0.78x0.001736)]x1 = 0.002 +λ message D --> C + λD(c1) = [p(d1|b1,c1).πD(b1) + p(d1|b2,c1).πD(b2)].λ(d1) + [p(d2|b1,c1).πD(b1) + p(d2|b2,c1).πD(b2)].λ(d2) = [(0.2x0.001086) + (0.45x0.000914)]x1 + [(0.8x0.001086) + (0.55x0.000914)]x1 = 0.002 + λD(c2) = [p(d1|b1,c2).πD(b1) + p(d1|b2,c2).πD(b2)].λ(d1) + [p(d2|b1,c2).πD(b1) + p(d2|b2,c2).πD(b2)].λ(d2) = [(0.7x0.001086) + (0.22x0.000914)]x1 + [(0.3x0.001086) + (0.78x0.000914)]x1 = 0.002 +π message A --> B + πB(a1) = π(a1).λC(a1) = 0.01 x 0.001 = 1e-05 + πB(a2) = π(a2).λC(a2) = 0.09 x 0.001 = 9e-05 +π message A --> C + πC(a1) = π(a1).λB(a1) = 0.01 x 0.001 = 1e-05 + πC(a2) = π(a2).λB(a2) = 0.09 x 0.001 = 9e-05 +π message B --> D + πD(b1) = π(b1) = 0.001086 = 0.001086 + πD(b2) = π(b2) = 0.000914 = 0.000914 +π message C --> D + πD(c1) = π(c1) = 0.000264 = 0.000264 + πD(c2) = π(c2) = 0.001736 = 0.001736 + +updating π & λ values +node A: + π(a1) = p(a1) = (0.01) = 0.01 + π(a2) = p(a2) = (0.09) = 0.09 + λ(a1) = λB(a1).λC(a1) = 0.001 x 0.001 = 1e-06 + λ(a2) = λB(a2).λC(a2) = 0.001 x 0.001 = 1e-06 + belief change = 0 +node B: + π(b1) = p(b1|a1).πB(a1) + p(b1|a2).πB(a2) = (0.03 x 1e-05) + (0.6 x 9e-05) = 5.43e-05 + π(b2) = p(b2|a1).πB(a1) + p(b2|a2).πB(a2) = (0.97 x 1e-05) + (0.4 x 9e-05) = 4.57e-05 + λ(b1) = λD(b1) = 0.002 = 0.002 + λ(b2) = λD(b2) = 0.002 = 0.002 + belief change = 1.665334537e-16 +node C: + π(c1) = p(c1|a1).πC(a1) + p(c1|a2).πC(a2) = (0.24 x 1e-05) + (0.12 x 9e-05) = 1.32e-05 + π(c2) = p(c2|a1).πC(a1) + p(c2|a2).πC(a2) = (0.76 x 1e-05) + (0.88 x 9e-05) = 8.68e-05 + λ(c1) = λD(c1) = 0.002 = 0.002 + λ(c2) = λD(c2) = 0.002 = 0.002 + belief change = 1.387778781e-16 +node D: + π(d1) = p(d1|b1,c1).πD(b1).πD(c1) + p(d1|b1,c2).πD(b1).πD(c2) + p(d1|b2,c1).πD(b2).πD(c1) + p(d1|b2,c2).πD(b2).πD(c2) = (0.2 x 0.001086 x 0.000264) + (0.7 x 0.001086 x 0.001736) + (0.45 x 0.000914 x 0.000264) + (0.22 x 0.000914 x 0.001736) = 1.83470608e-06 + π(d2) = p(d2|b1,c1).πD(b1).πD(c1) + p(d2|b1,c2).πD(b1).πD(c2) + p(d2|b2,c1).πD(b2).πD(c1) + p(d2|b2,c2).πD(b2).πD(c2) = (0.8 x 0.001086 x 0.000264) + (0.3 x 0.001086 x 0.001736) + (0.55 x 0.000914 x 0.000264) + (0.78 x 0.000914 x 0.001736) = 2.16529392e-06 + λ(d1) = 1 + λ(d2) = 1 + belief change = 0 + + +******************************************************************************** +Iteration 13 +******************************************************************************** + +status of random variable `A': + domain π(A) λ(A) belief +---------------------------------------------------------------- + a1 0.01 1e-06 0.1 + a2 0.09 1e-06 0.9 + + domain πB(A) λB(A) +---------------------------------------------------------------- + a1 1e-05 0.001 + a2 9e-05 0.001 + + domain πC(A) λC(A) +---------------------------------------------------------------- + a1 1e-05 0.001 + a2 9e-05 0.001 + + +status of random variable `B': + domain π(B) λ(B) belief +---------------------------------------------------------------- + b1 5.43e-05 0.002 0.543 + b2 4.57e-05 0.002 0.457 + + domain πD(B) λD(B) +---------------------------------------------------------------- + b1 0.001086 0.002 + b2 0.000914 0.002 + + +status of random variable `C': + domain π(C) λ(C) belief +---------------------------------------------------------------- + c1 1.32e-05 0.002 0.132 + c2 8.68e-05 0.002 0.868 + + domain πD(C) λD(C) +---------------------------------------------------------------- + c1 0.000264 0.002 + c2 0.001736 0.002 + + +status of random variable `D': + domain π(D) λ(D) belief +---------------------------------------------------------------- + d1 1.83470608e-06 1 0.45867652 + d2 2.16529392e-06 1 0.54132348 + +λ message B --> A + λB(a1) = [p(b1|a1)].λ(b1) + [p(b2|a1)].λ(b2) = [(0.03)]x0.002 + [(0.97)]x0.002 = 0.002 + λB(a2) = [p(b1|a2)].λ(b1) + [p(b2|a2)].λ(b2) = [(0.6)]x0.002 + [(0.4)]x0.002 = 0.002 +λ message C --> A + λC(a1) = [p(c1|a1)].λ(c1) + [p(c2|a1)].λ(c2) = [(0.24)]x0.002 + [(0.76)]x0.002 = 0.002 + λC(a2) = [p(c1|a2)].λ(c1) + [p(c2|a2)].λ(c2) = [(0.12)]x0.002 + [(0.88)]x0.002 = 0.002 +λ message D --> B + λD(b1) = [p(d1|b1,c1).πD(c1) + p(d1|b1,c2).πD(c2)].λ(d1) + [p(d2|b1,c1).πD(c1) + p(d2|b1,c2).πD(c2)].λ(d2) = [(0.2x0.000264) + (0.7x0.001736)]x1 + [(0.8x0.000264) + (0.3x0.001736)]x1 = 0.002 + λD(b2) = [p(d1|b2,c1).πD(c1) + p(d1|b2,c2).πD(c2)].λ(d1) + [p(d2|b2,c1).πD(c1) + p(d2|b2,c2).πD(c2)].λ(d2) = [(0.45x0.000264) + (0.22x0.001736)]x1 + [(0.55x0.000264) + (0.78x0.001736)]x1 = 0.002 +λ message D --> C + λD(c1) = [p(d1|b1,c1).πD(b1) + p(d1|b2,c1).πD(b2)].λ(d1) + [p(d2|b1,c1).πD(b1) + p(d2|b2,c1).πD(b2)].λ(d2) = [(0.2x0.001086) + (0.45x0.000914)]x1 + [(0.8x0.001086) + (0.55x0.000914)]x1 = 0.002 + λD(c2) = [p(d1|b1,c2).πD(b1) + p(d1|b2,c2).πD(b2)].λ(d1) + [p(d2|b1,c2).πD(b1) + p(d2|b2,c2).πD(b2)].λ(d2) = [(0.7x0.001086) + (0.22x0.000914)]x1 + [(0.3x0.001086) + (0.78x0.000914)]x1 = 0.002 +π message A --> B + πB(a1) = π(a1).λC(a1) = 0.01 x 0.001 = 1e-05 + πB(a2) = π(a2).λC(a2) = 0.09 x 0.001 = 9e-05 +π message A --> C + πC(a1) = π(a1).λB(a1) = 0.01 x 0.001 = 1e-05 + πC(a2) = π(a2).λB(a2) = 0.09 x 0.001 = 9e-05 +π message B --> D + πD(b1) = π(b1) = 5.43e-05 = 5.43e-05 + πD(b2) = π(b2) = 4.57e-05 = 4.57e-05 +π message C --> D + πD(c1) = π(c1) = 1.32e-05 = 1.32e-05 + πD(c2) = π(c2) = 8.68e-05 = 8.68e-05 + +updating π & λ values +node A: + π(a1) = p(a1) = (0.01) = 0.01 + π(a2) = p(a2) = (0.09) = 0.09 + λ(a1) = λB(a1).λC(a1) = 0.002 x 0.002 = 4e-06 + λ(a2) = λB(a2).λC(a2) = 0.002 x 0.002 = 4e-06 + belief change = 0 +node B: + π(b1) = p(b1|a1).πB(a1) + p(b1|a2).πB(a2) = (0.03 x 1e-05) + (0.6 x 9e-05) = 5.43e-05 + π(b2) = p(b2|a1).πB(a1) + p(b2|a2).πB(a2) = (0.97 x 1e-05) + (0.4 x 9e-05) = 4.57e-05 + λ(b1) = λD(b1) = 0.002 = 0.002 + λ(b2) = λD(b2) = 0.002 = 0.002 + belief change = 0 +node C: + π(c1) = p(c1|a1).πC(a1) + p(c1|a2).πC(a2) = (0.24 x 1e-05) + (0.12 x 9e-05) = 1.32e-05 + π(c2) = p(c2|a1).πC(a1) + p(c2|a2).πC(a2) = (0.76 x 1e-05) + (0.88 x 9e-05) = 8.68e-05 + λ(c1) = λD(c1) = 0.002 = 0.002 + λ(c2) = λD(c2) = 0.002 = 0.002 + belief change = 0 +node D: + π(d1) = p(d1|b1,c1).πD(b1).πD(c1) + p(d1|b1,c2).πD(b1).πD(c2) + p(d1|b2,c1).πD(b2).πD(c1) + p(d1|b2,c2).πD(b2).πD(c2) = (0.2 x 5.43e-05 x 1.32e-05) + (0.7 x 5.43e-05 x 8.68e-05) + (0.45 x 4.57e-05 x 1.32e-05) + (0.22 x 4.57e-05 x 8.68e-05) = 4.5867652e-09 + π(d2) = p(d2|b1,c1).πD(b1).πD(c1) + p(d2|b1,c2).πD(b1).πD(c2) + p(d2|b2,c1).πD(b2).πD(c1) + p(d2|b2,c2).πD(b2).πD(c2) = (0.8 x 5.43e-05 x 1.32e-05) + (0.3 x 5.43e-05 x 8.68e-05) + (0.55 x 4.57e-05 x 1.32e-05) + (0.78 x 4.57e-05 x 8.68e-05) = 5.4132348e-09 + λ(d1) = 1 + λ(d2) = 1 + belief change = 0 + + +******************************************************************************** +Iteration 14 +******************************************************************************** + +status of random variable `A': + domain π(A) λ(A) belief +---------------------------------------------------------------- + a1 0.01 4e-06 0.1 + a2 0.09 4e-06 0.9 + + domain πB(A) λB(A) +---------------------------------------------------------------- + a1 1e-05 0.002 + a2 9e-05 0.002 + + domain πC(A) λC(A) +---------------------------------------------------------------- + a1 1e-05 0.002 + a2 9e-05 0.002 + + +status of random variable `B': + domain π(B) λ(B) belief +---------------------------------------------------------------- + b1 5.43e-05 0.002 0.543 + b2 4.57e-05 0.002 0.457 + + domain πD(B) λD(B) +---------------------------------------------------------------- + b1 5.43e-05 0.002 + b2 4.57e-05 0.002 + + +status of random variable `C': + domain π(C) λ(C) belief +---------------------------------------------------------------- + c1 1.32e-05 0.002 0.132 + c2 8.68e-05 0.002 0.868 + + domain πD(C) λD(C) +---------------------------------------------------------------- + c1 1.32e-05 0.002 + c2 8.68e-05 0.002 + + +status of random variable `D': + domain π(D) λ(D) belief +---------------------------------------------------------------- + d1 4.5867652e-09 1 0.45867652 + d2 5.4132348e-09 1 0.54132348 + +λ message B --> A + λB(a1) = [p(b1|a1)].λ(b1) + [p(b2|a1)].λ(b2) = [(0.03)]x0.002 + [(0.97)]x0.002 = 0.002 + λB(a2) = [p(b1|a2)].λ(b1) + [p(b2|a2)].λ(b2) = [(0.6)]x0.002 + [(0.4)]x0.002 = 0.002 +λ message C --> A + λC(a1) = [p(c1|a1)].λ(c1) + [p(c2|a1)].λ(c2) = [(0.24)]x0.002 + [(0.76)]x0.002 = 0.002 + λC(a2) = [p(c1|a2)].λ(c1) + [p(c2|a2)].λ(c2) = [(0.12)]x0.002 + [(0.88)]x0.002 = 0.002 +λ message D --> B + λD(b1) = [p(d1|b1,c1).πD(c1) + p(d1|b1,c2).πD(c2)].λ(d1) + [p(d2|b1,c1).πD(c1) + p(d2|b1,c2).πD(c2)].λ(d2) = [(0.2x1.32e-05) + (0.7x8.68e-05)]x1 + [(0.8x1.32e-05) + (0.3x8.68e-05)]x1 = 0.0001 + λD(b2) = [p(d1|b2,c1).πD(c1) + p(d1|b2,c2).πD(c2)].λ(d1) + [p(d2|b2,c1).πD(c1) + p(d2|b2,c2).πD(c2)].λ(d2) = [(0.45x1.32e-05) + (0.22x8.68e-05)]x1 + [(0.55x1.32e-05) + (0.78x8.68e-05)]x1 = 0.0001 +λ message D --> C + λD(c1) = [p(d1|b1,c1).πD(b1) + p(d1|b2,c1).πD(b2)].λ(d1) + [p(d2|b1,c1).πD(b1) + p(d2|b2,c1).πD(b2)].λ(d2) = [(0.2x5.43e-05) + (0.45x4.57e-05)]x1 + [(0.8x5.43e-05) + (0.55x4.57e-05)]x1 = 0.0001 + λD(c2) = [p(d1|b1,c2).πD(b1) + p(d1|b2,c2).πD(b2)].λ(d1) + [p(d2|b1,c2).πD(b1) + p(d2|b2,c2).πD(b2)].λ(d2) = [(0.7x5.43e-05) + (0.22x4.57e-05)]x1 + [(0.3x5.43e-05) + (0.78x4.57e-05)]x1 = 0.0001 +π message A --> B + πB(a1) = π(a1).λC(a1) = 0.01 x 0.002 = 2e-05 + πB(a2) = π(a2).λC(a2) = 0.09 x 0.002 = 0.00018 +π message A --> C + πC(a1) = π(a1).λB(a1) = 0.01 x 0.002 = 2e-05 + πC(a2) = π(a2).λB(a2) = 0.09 x 0.002 = 0.00018 +π message B --> D + πD(b1) = π(b1) = 5.43e-05 = 5.43e-05 + πD(b2) = π(b2) = 4.57e-05 = 4.57e-05 +π message C --> D + πD(c1) = π(c1) = 1.32e-05 = 1.32e-05 + πD(c2) = π(c2) = 8.68e-05 = 8.68e-05 + +updating π & λ values +node A: + π(a1) = p(a1) = (0.01) = 0.01 + π(a2) = p(a2) = (0.09) = 0.09 + λ(a1) = λB(a1).λC(a1) = 0.002 x 0.002 = 4e-06 + λ(a2) = λB(a2).λC(a2) = 0.002 x 0.002 = 4e-06 + belief change = 0 +node B: + π(b1) = p(b1|a1).πB(a1) + p(b1|a2).πB(a2) = (0.03 x 2e-05) + (0.6 x 0.00018) = 0.0001086 + π(b2) = p(b2|a1).πB(a1) + p(b2|a2).πB(a2) = (0.97 x 2e-05) + (0.4 x 0.00018) = 9.14e-05 + λ(b1) = λD(b1) = 0.0001 = 0.0001 + λ(b2) = λD(b2) = 0.0001 = 0.0001 + belief change = 1.110223025e-16 +node C: + π(c1) = p(c1|a1).πC(a1) + p(c1|a2).πC(a2) = (0.24 x 2e-05) + (0.12 x 0.00018) = 2.64e-05 + π(c2) = p(c2|a1).πC(a1) + p(c2|a2).πC(a2) = (0.76 x 2e-05) + (0.88 x 0.00018) = 0.0001736 + λ(c1) = λD(c1) = 0.0001 = 0.0001 + λ(c2) = λD(c2) = 0.0001 = 0.0001 + belief change = 2.775557562e-17 +node D: + π(d1) = p(d1|b1,c1).πD(b1).πD(c1) + p(d1|b1,c2).πD(b1).πD(c2) + p(d1|b2,c1).πD(b2).πD(c1) + p(d1|b2,c2).πD(b2).πD(c2) = (0.2 x 5.43e-05 x 1.32e-05) + (0.7 x 5.43e-05 x 8.68e-05) + (0.45 x 4.57e-05 x 1.32e-05) + (0.22 x 4.57e-05 x 8.68e-05) = 4.5867652e-09 + π(d2) = p(d2|b1,c1).πD(b1).πD(c1) + p(d2|b1,c2).πD(b1).πD(c2) + p(d2|b2,c1).πD(b2).πD(c1) + p(d2|b2,c2).πD(b2).πD(c2) = (0.8 x 5.43e-05 x 1.32e-05) + (0.3 x 5.43e-05 x 8.68e-05) + (0.55 x 4.57e-05 x 1.32e-05) + (0.78 x 4.57e-05 x 8.68e-05) = 5.4132348e-09 + λ(d1) = 1 + λ(d2) = 1 + belief change = 0 + + +******************************************************************************** +Iteration 15 +******************************************************************************** + +status of random variable `A': + domain π(A) λ(A) belief +---------------------------------------------------------------- + a1 0.01 4e-06 0.1 + a2 0.09 4e-06 0.9 + + domain πB(A) λB(A) +---------------------------------------------------------------- + a1 2e-05 0.002 + a2 0.00018 0.002 + + domain πC(A) λC(A) +---------------------------------------------------------------- + a1 2e-05 0.002 + a2 0.00018 0.002 + + +status of random variable `B': + domain π(B) λ(B) belief +---------------------------------------------------------------- + b1 0.0001086 0.0001 0.543 + b2 9.14e-05 0.0001 0.457 + + domain πD(B) λD(B) +---------------------------------------------------------------- + b1 5.43e-05 0.0001 + b2 4.57e-05 0.0001 + + +status of random variable `C': + domain π(C) λ(C) belief +---------------------------------------------------------------- + c1 2.64e-05 0.0001 0.132 + c2 0.0001736 0.0001 0.868 + + domain πD(C) λD(C) +---------------------------------------------------------------- + c1 1.32e-05 0.0001 + c2 8.68e-05 0.0001 + + +status of random variable `D': + domain π(D) λ(D) belief +---------------------------------------------------------------- + d1 4.5867652e-09 1 0.45867652 + d2 5.4132348e-09 1 0.54132348 + +λ message B --> A + λB(a1) = [p(b1|a1)].λ(b1) + [p(b2|a1)].λ(b2) = [(0.03)]x0.0001 + [(0.97)]x0.0001 = 0.0001 + λB(a2) = [p(b1|a2)].λ(b1) + [p(b2|a2)].λ(b2) = [(0.6)]x0.0001 + [(0.4)]x0.0001 = 0.0001 +λ message C --> A + λC(a1) = [p(c1|a1)].λ(c1) + [p(c2|a1)].λ(c2) = [(0.24)]x0.0001 + [(0.76)]x0.0001 = 0.0001 + λC(a2) = [p(c1|a2)].λ(c1) + [p(c2|a2)].λ(c2) = [(0.12)]x0.0001 + [(0.88)]x0.0001 = 0.0001 +λ message D --> B + λD(b1) = [p(d1|b1,c1).πD(c1) + p(d1|b1,c2).πD(c2)].λ(d1) + [p(d2|b1,c1).πD(c1) + p(d2|b1,c2).πD(c2)].λ(d2) = [(0.2x1.32e-05) + (0.7x8.68e-05)]x1 + [(0.8x1.32e-05) + (0.3x8.68e-05)]x1 = 0.0001 + λD(b2) = [p(d1|b2,c1).πD(c1) + p(d1|b2,c2).πD(c2)].λ(d1) + [p(d2|b2,c1).πD(c1) + p(d2|b2,c2).πD(c2)].λ(d2) = [(0.45x1.32e-05) + (0.22x8.68e-05)]x1 + [(0.55x1.32e-05) + (0.78x8.68e-05)]x1 = 0.0001 +λ message D --> C + λD(c1) = [p(d1|b1,c1).πD(b1) + p(d1|b2,c1).πD(b2)].λ(d1) + [p(d2|b1,c1).πD(b1) + p(d2|b2,c1).πD(b2)].λ(d2) = [(0.2x5.43e-05) + (0.45x4.57e-05)]x1 + [(0.8x5.43e-05) + (0.55x4.57e-05)]x1 = 0.0001 + λD(c2) = [p(d1|b1,c2).πD(b1) + p(d1|b2,c2).πD(b2)].λ(d1) + [p(d2|b1,c2).πD(b1) + p(d2|b2,c2).πD(b2)].λ(d2) = [(0.7x5.43e-05) + (0.22x4.57e-05)]x1 + [(0.3x5.43e-05) + (0.78x4.57e-05)]x1 = 0.0001 +π message A --> B + πB(a1) = π(a1).λC(a1) = 0.01 x 0.002 = 2e-05 + πB(a2) = π(a2).λC(a2) = 0.09 x 0.002 = 0.00018 +π message A --> C + πC(a1) = π(a1).λB(a1) = 0.01 x 0.002 = 2e-05 + πC(a2) = π(a2).λB(a2) = 0.09 x 0.002 = 0.00018 +π message B --> D + πD(b1) = π(b1) = 0.0001086 = 0.0001086 + πD(b2) = π(b2) = 9.14e-05 = 9.14e-05 +π message C --> D + πD(c1) = π(c1) = 2.64e-05 = 2.64e-05 + πD(c2) = π(c2) = 0.0001736 = 0.0001736 + +updating π & λ values +node A: + π(a1) = p(a1) = (0.01) = 0.01 + π(a2) = p(a2) = (0.09) = 0.09 + λ(a1) = λB(a1).λC(a1) = 0.0001 x 0.0001 = 1e-08 + λ(a2) = λB(a2).λC(a2) = 0.0001 x 0.0001 = 1e-08 + belief change = 1.387778781e-17 +node B: + π(b1) = p(b1|a1).πB(a1) + p(b1|a2).πB(a2) = (0.03 x 2e-05) + (0.6 x 0.00018) = 0.0001086 + π(b2) = p(b2|a1).πB(a1) + p(b2|a2).πB(a2) = (0.97 x 2e-05) + (0.4 x 0.00018) = 9.14e-05 + λ(b1) = λD(b1) = 0.0001 = 0.0001 + λ(b2) = λD(b2) = 0.0001 = 0.0001 + belief change = 0 +node C: + π(c1) = p(c1|a1).πC(a1) + p(c1|a2).πC(a2) = (0.24 x 2e-05) + (0.12 x 0.00018) = 2.64e-05 + π(c2) = p(c2|a1).πC(a1) + p(c2|a2).πC(a2) = (0.76 x 2e-05) + (0.88 x 0.00018) = 0.0001736 + λ(c1) = λD(c1) = 0.0001 = 0.0001 + λ(c2) = λD(c2) = 0.0001 = 0.0001 + belief change = 0 +node D: + π(d1) = p(d1|b1,c1).πD(b1).πD(c1) + p(d1|b1,c2).πD(b1).πD(c2) + p(d1|b2,c1).πD(b2).πD(c1) + p(d1|b2,c2).πD(b2).πD(c2) = (0.2 x 0.0001086 x 2.64e-05) + (0.7 x 0.0001086 x 0.0001736) + (0.45 x 9.14e-05 x 2.64e-05) + (0.22 x 9.14e-05 x 0.0001736) = 1.83470608e-08 + π(d2) = p(d2|b1,c1).πD(b1).πD(c1) + p(d2|b1,c2).πD(b1).πD(c2) + p(d2|b2,c1).πD(b2).πD(c1) + p(d2|b2,c2).πD(b2).πD(c2) = (0.8 x 0.0001086 x 2.64e-05) + (0.3 x 0.0001086 x 0.0001736) + (0.55 x 9.14e-05 x 2.64e-05) + (0.78 x 9.14e-05 x 0.0001736) = 2.16529392e-08 + λ(d1) = 1 + λ(d2) = 1 + belief change = 0 + + +******************************************************************************** +Iteration 16 +******************************************************************************** + +status of random variable `A': + domain π(A) λ(A) belief +---------------------------------------------------------------- + a1 0.01 1e-08 0.1 + a2 0.09 1e-08 0.9 + + domain πB(A) λB(A) +---------------------------------------------------------------- + a1 2e-05 0.0001 + a2 0.00018 0.0001 + + domain πC(A) λC(A) +---------------------------------------------------------------- + a1 2e-05 0.0001 + a2 0.00018 0.0001 + + +status of random variable `B': + domain π(B) λ(B) belief +---------------------------------------------------------------- + b1 0.0001086 0.0001 0.543 + b2 9.14e-05 0.0001 0.457 + + domain πD(B) λD(B) +---------------------------------------------------------------- + b1 0.0001086 0.0001 + b2 9.14e-05 0.0001 + + +status of random variable `C': + domain π(C) λ(C) belief +---------------------------------------------------------------- + c1 2.64e-05 0.0001 0.132 + c2 0.0001736 0.0001 0.868 + + domain πD(C) λD(C) +---------------------------------------------------------------- + c1 2.64e-05 0.0001 + c2 0.0001736 0.0001 + + +status of random variable `D': + domain π(D) λ(D) belief +---------------------------------------------------------------- + d1 1.83470608e-08 1 0.45867652 + d2 2.16529392e-08 1 0.54132348 + +λ message B --> A + λB(a1) = [p(b1|a1)].λ(b1) + [p(b2|a1)].λ(b2) = [(0.03)]x0.0001 + [(0.97)]x0.0001 = 0.0001 + λB(a2) = [p(b1|a2)].λ(b1) + [p(b2|a2)].λ(b2) = [(0.6)]x0.0001 + [(0.4)]x0.0001 = 0.0001 +λ message C --> A + λC(a1) = [p(c1|a1)].λ(c1) + [p(c2|a1)].λ(c2) = [(0.24)]x0.0001 + [(0.76)]x0.0001 = 0.0001 + λC(a2) = [p(c1|a2)].λ(c1) + [p(c2|a2)].λ(c2) = [(0.12)]x0.0001 + [(0.88)]x0.0001 = 0.0001 +λ message D --> B + λD(b1) = [p(d1|b1,c1).πD(c1) + p(d1|b1,c2).πD(c2)].λ(d1) + [p(d2|b1,c1).πD(c1) + p(d2|b1,c2).πD(c2)].λ(d2) = [(0.2x2.64e-05) + (0.7x0.0001736)]x1 + [(0.8x2.64e-05) + (0.3x0.0001736)]x1 = 0.0002 + λD(b2) = [p(d1|b2,c1).πD(c1) + p(d1|b2,c2).πD(c2)].λ(d1) + [p(d2|b2,c1).πD(c1) + p(d2|b2,c2).πD(c2)].λ(d2) = [(0.45x2.64e-05) + (0.22x0.0001736)]x1 + [(0.55x2.64e-05) + (0.78x0.0001736)]x1 = 0.0002 +λ message D --> C + λD(c1) = [p(d1|b1,c1).πD(b1) + p(d1|b2,c1).πD(b2)].λ(d1) + [p(d2|b1,c1).πD(b1) + p(d2|b2,c1).πD(b2)].λ(d2) = [(0.2x0.0001086) + (0.45x9.14e-05)]x1 + [(0.8x0.0001086) + (0.55x9.14e-05)]x1 = 0.0002 + λD(c2) = [p(d1|b1,c2).πD(b1) + p(d1|b2,c2).πD(b2)].λ(d1) + [p(d2|b1,c2).πD(b1) + p(d2|b2,c2).πD(b2)].λ(d2) = [(0.7x0.0001086) + (0.22x9.14e-05)]x1 + [(0.3x0.0001086) + (0.78x9.14e-05)]x1 = 0.0002 +π message A --> B + πB(a1) = π(a1).λC(a1) = 0.01 x 0.0001 = 1e-06 + πB(a2) = π(a2).λC(a2) = 0.09 x 0.0001 = 9e-06 +π message A --> C + πC(a1) = π(a1).λB(a1) = 0.01 x 0.0001 = 1e-06 + πC(a2) = π(a2).λB(a2) = 0.09 x 0.0001 = 9e-06 +π message B --> D + πD(b1) = π(b1) = 0.0001086 = 0.0001086 + πD(b2) = π(b2) = 9.14e-05 = 9.14e-05 +π message C --> D + πD(c1) = π(c1) = 2.64e-05 = 2.64e-05 + πD(c2) = π(c2) = 0.0001736 = 0.0001736 + +updating π & λ values +node A: + π(a1) = p(a1) = (0.01) = 0.01 + π(a2) = p(a2) = (0.09) = 0.09 + λ(a1) = λB(a1).λC(a1) = 0.0001 x 0.0001 = 1e-08 + λ(a2) = λB(a2).λC(a2) = 0.0001 x 0.0001 = 1e-08 + belief change = 0 +node B: + π(b1) = p(b1|a1).πB(a1) + p(b1|a2).πB(a2) = (0.03 x 1e-06) + (0.6 x 9e-06) = 5.43e-06 + π(b2) = p(b2|a1).πB(a1) + p(b2|a2).πB(a2) = (0.97 x 1e-06) + (0.4 x 9e-06) = 4.57e-06 + λ(b1) = λD(b1) = 0.0002 = 0.0002 + λ(b2) = λD(b2) = 0.0002 = 0.0002 + belief change = 5.551115123e-17 +node C: + π(c1) = p(c1|a1).πC(a1) + p(c1|a2).πC(a2) = (0.24 x 1e-06) + (0.12 x 9e-06) = 1.32e-06 + π(c2) = p(c2|a1).πC(a1) + p(c2|a2).πC(a2) = (0.76 x 1e-06) + (0.88 x 9e-06) = 8.68e-06 + λ(c1) = λD(c1) = 0.0002 = 0.0002 + λ(c2) = λD(c2) = 0.0002 = 0.0002 + belief change = 1.387778781e-16 +node D: + π(d1) = p(d1|b1,c1).πD(b1).πD(c1) + p(d1|b1,c2).πD(b1).πD(c2) + p(d1|b2,c1).πD(b2).πD(c1) + p(d1|b2,c2).πD(b2).πD(c2) = (0.2 x 0.0001086 x 2.64e-05) + (0.7 x 0.0001086 x 0.0001736) + (0.45 x 9.14e-05 x 2.64e-05) + (0.22 x 9.14e-05 x 0.0001736) = 1.83470608e-08 + π(d2) = p(d2|b1,c1).πD(b1).πD(c1) + p(d2|b1,c2).πD(b1).πD(c2) + p(d2|b2,c1).πD(b2).πD(c1) + p(d2|b2,c2).πD(b2).πD(c2) = (0.8 x 0.0001086 x 2.64e-05) + (0.3 x 0.0001086 x 0.0001736) + (0.55 x 9.14e-05 x 2.64e-05) + (0.78 x 9.14e-05 x 0.0001736) = 2.16529392e-08 + λ(d1) = 1 + λ(d2) = 1 + belief change = 0 + + +******************************************************************************** +Iteration 17 +******************************************************************************** + +status of random variable `A': + domain π(A) λ(A) belief +---------------------------------------------------------------- + a1 0.01 1e-08 0.1 + a2 0.09 1e-08 0.9 + + domain πB(A) λB(A) +---------------------------------------------------------------- + a1 1e-06 0.0001 + a2 9e-06 0.0001 + + domain πC(A) λC(A) +---------------------------------------------------------------- + a1 1e-06 0.0001 + a2 9e-06 0.0001 + + +status of random variable `B': + domain π(B) λ(B) belief +---------------------------------------------------------------- + b1 5.43e-06 0.0002 0.543 + b2 4.57e-06 0.0002 0.457 + + domain πD(B) λD(B) +---------------------------------------------------------------- + b1 0.0001086 0.0002 + b2 9.14e-05 0.0002 + + +status of random variable `C': + domain π(C) λ(C) belief +---------------------------------------------------------------- + c1 1.32e-06 0.0002 0.132 + c2 8.68e-06 0.0002 0.868 + + domain πD(C) λD(C) +---------------------------------------------------------------- + c1 2.64e-05 0.0002 + c2 0.0001736 0.0002 + + +status of random variable `D': + domain π(D) λ(D) belief +---------------------------------------------------------------- + d1 1.83470608e-08 1 0.45867652 + d2 2.16529392e-08 1 0.54132348 + +λ message B --> A + λB(a1) = [p(b1|a1)].λ(b1) + [p(b2|a1)].λ(b2) = [(0.03)]x0.0002 + [(0.97)]x0.0002 = 0.0002 + λB(a2) = [p(b1|a2)].λ(b1) + [p(b2|a2)].λ(b2) = [(0.6)]x0.0002 + [(0.4)]x0.0002 = 0.0002 +λ message C --> A + λC(a1) = [p(c1|a1)].λ(c1) + [p(c2|a1)].λ(c2) = [(0.24)]x0.0002 + [(0.76)]x0.0002 = 0.0002 + λC(a2) = [p(c1|a2)].λ(c1) + [p(c2|a2)].λ(c2) = [(0.12)]x0.0002 + [(0.88)]x0.0002 = 0.0002 +λ message D --> B + λD(b1) = [p(d1|b1,c1).πD(c1) + p(d1|b1,c2).πD(c2)].λ(d1) + [p(d2|b1,c1).πD(c1) + p(d2|b1,c2).πD(c2)].λ(d2) = [(0.2x2.64e-05) + (0.7x0.0001736)]x1 + [(0.8x2.64e-05) + (0.3x0.0001736)]x1 = 0.0002 + λD(b2) = [p(d1|b2,c1).πD(c1) + p(d1|b2,c2).πD(c2)].λ(d1) + [p(d2|b2,c1).πD(c1) + p(d2|b2,c2).πD(c2)].λ(d2) = [(0.45x2.64e-05) + (0.22x0.0001736)]x1 + [(0.55x2.64e-05) + (0.78x0.0001736)]x1 = 0.0002 +λ message D --> C + λD(c1) = [p(d1|b1,c1).πD(b1) + p(d1|b2,c1).πD(b2)].λ(d1) + [p(d2|b1,c1).πD(b1) + p(d2|b2,c1).πD(b2)].λ(d2) = [(0.2x0.0001086) + (0.45x9.14e-05)]x1 + [(0.8x0.0001086) + (0.55x9.14e-05)]x1 = 0.0002 + λD(c2) = [p(d1|b1,c2).πD(b1) + p(d1|b2,c2).πD(b2)].λ(d1) + [p(d2|b1,c2).πD(b1) + p(d2|b2,c2).πD(b2)].λ(d2) = [(0.7x0.0001086) + (0.22x9.14e-05)]x1 + [(0.3x0.0001086) + (0.78x9.14e-05)]x1 = 0.0002 +π message A --> B + πB(a1) = π(a1).λC(a1) = 0.01 x 0.0001 = 1e-06 + πB(a2) = π(a2).λC(a2) = 0.09 x 0.0001 = 9e-06 +π message A --> C + πC(a1) = π(a1).λB(a1) = 0.01 x 0.0001 = 1e-06 + πC(a2) = π(a2).λB(a2) = 0.09 x 0.0001 = 9e-06 +π message B --> D + πD(b1) = π(b1) = 5.43e-06 = 5.43e-06 + πD(b2) = π(b2) = 4.57e-06 = 4.57e-06 +π message C --> D + πD(c1) = π(c1) = 1.32e-06 = 1.32e-06 + πD(c2) = π(c2) = 8.68e-06 = 8.68e-06 + +updating π & λ values +node A: + π(a1) = p(a1) = (0.01) = 0.01 + π(a2) = p(a2) = (0.09) = 0.09 + λ(a1) = λB(a1).λC(a1) = 0.0002 x 0.0002 = 4e-08 + λ(a2) = λB(a2).λC(a2) = 0.0002 x 0.0002 = 4e-08 + belief change = 0 +node B: + π(b1) = p(b1|a1).πB(a1) + p(b1|a2).πB(a2) = (0.03 x 1e-06) + (0.6 x 9e-06) = 5.43e-06 + π(b2) = p(b2|a1).πB(a1) + p(b2|a2).πB(a2) = (0.97 x 1e-06) + (0.4 x 9e-06) = 4.57e-06 + λ(b1) = λD(b1) = 0.0002 = 0.0002 + λ(b2) = λD(b2) = 0.0002 = 0.0002 + belief change = 0 +node C: + π(c1) = p(c1|a1).πC(a1) + p(c1|a2).πC(a2) = (0.24 x 1e-06) + (0.12 x 9e-06) = 1.32e-06 + π(c2) = p(c2|a1).πC(a1) + p(c2|a2).πC(a2) = (0.76 x 1e-06) + (0.88 x 9e-06) = 8.68e-06 + λ(c1) = λD(c1) = 0.0002 = 0.0002 + λ(c2) = λD(c2) = 0.0002 = 0.0002 + belief change = 0 +node D: + π(d1) = p(d1|b1,c1).πD(b1).πD(c1) + p(d1|b1,c2).πD(b1).πD(c2) + p(d1|b2,c1).πD(b2).πD(c1) + p(d1|b2,c2).πD(b2).πD(c2) = (0.2 x 5.43e-06 x 1.32e-06) + (0.7 x 5.43e-06 x 8.68e-06) + (0.45 x 4.57e-06 x 1.32e-06) + (0.22 x 4.57e-06 x 8.68e-06) = 4.5867652e-11 + π(d2) = p(d2|b1,c1).πD(b1).πD(c1) + p(d2|b1,c2).πD(b1).πD(c2) + p(d2|b2,c1).πD(b2).πD(c1) + p(d2|b2,c2).πD(b2).πD(c2) = (0.8 x 5.43e-06 x 1.32e-06) + (0.3 x 5.43e-06 x 8.68e-06) + (0.55 x 4.57e-06 x 1.32e-06) + (0.78 x 4.57e-06 x 8.68e-06) = 5.4132348e-11 + λ(d1) = 1 + λ(d2) = 1 + belief change = 1.665334537e-16 + + +******************************************************************************** +Iteration 18 +******************************************************************************** + +status of random variable `A': + domain π(A) λ(A) belief +---------------------------------------------------------------- + a1 0.01 4e-08 0.1 + a2 0.09 4e-08 0.9 + + domain πB(A) λB(A) +---------------------------------------------------------------- + a1 1e-06 0.0002 + a2 9e-06 0.0002 + + domain πC(A) λC(A) +---------------------------------------------------------------- + a1 1e-06 0.0002 + a2 9e-06 0.0002 + + +status of random variable `B': + domain π(B) λ(B) belief +---------------------------------------------------------------- + b1 5.43e-06 0.0002 0.543 + b2 4.57e-06 0.0002 0.457 + + domain πD(B) λD(B) +---------------------------------------------------------------- + b1 5.43e-06 0.0002 + b2 4.57e-06 0.0002 + + +status of random variable `C': + domain π(C) λ(C) belief +---------------------------------------------------------------- + c1 1.32e-06 0.0002 0.132 + c2 8.68e-06 0.0002 0.868 + + domain πD(C) λD(C) +---------------------------------------------------------------- + c1 1.32e-06 0.0002 + c2 8.68e-06 0.0002 + + +status of random variable `D': + domain π(D) λ(D) belief +---------------------------------------------------------------- + d1 4.5867652e-11 1 0.45867652 + d2 5.4132348e-11 1 0.54132348 + +λ message B --> A + λB(a1) = [p(b1|a1)].λ(b1) + [p(b2|a1)].λ(b2) = [(0.03)]x0.0002 + [(0.97)]x0.0002 = 0.0002 + λB(a2) = [p(b1|a2)].λ(b1) + [p(b2|a2)].λ(b2) = [(0.6)]x0.0002 + [(0.4)]x0.0002 = 0.0002 +λ message C --> A + λC(a1) = [p(c1|a1)].λ(c1) + [p(c2|a1)].λ(c2) = [(0.24)]x0.0002 + [(0.76)]x0.0002 = 0.0002 + λC(a2) = [p(c1|a2)].λ(c1) + [p(c2|a2)].λ(c2) = [(0.12)]x0.0002 + [(0.88)]x0.0002 = 0.0002 +λ message D --> B + λD(b1) = [p(d1|b1,c1).πD(c1) + p(d1|b1,c2).πD(c2)].λ(d1) + [p(d2|b1,c1).πD(c1) + p(d2|b1,c2).πD(c2)].λ(d2) = [(0.2x1.32e-06) + (0.7x8.68e-06)]x1 + [(0.8x1.32e-06) + (0.3x8.68e-06)]x1 = 1e-05 + λD(b2) = [p(d1|b2,c1).πD(c1) + p(d1|b2,c2).πD(c2)].λ(d1) + [p(d2|b2,c1).πD(c1) + p(d2|b2,c2).πD(c2)].λ(d2) = [(0.45x1.32e-06) + (0.22x8.68e-06)]x1 + [(0.55x1.32e-06) + (0.78x8.68e-06)]x1 = 1e-05 +λ message D --> C + λD(c1) = [p(d1|b1,c1).πD(b1) + p(d1|b2,c1).πD(b2)].λ(d1) + [p(d2|b1,c1).πD(b1) + p(d2|b2,c1).πD(b2)].λ(d2) = [(0.2x5.43e-06) + (0.45x4.57e-06)]x1 + [(0.8x5.43e-06) + (0.55x4.57e-06)]x1 = 1e-05 + λD(c2) = [p(d1|b1,c2).πD(b1) + p(d1|b2,c2).πD(b2)].λ(d1) + [p(d2|b1,c2).πD(b1) + p(d2|b2,c2).πD(b2)].λ(d2) = [(0.7x5.43e-06) + (0.22x4.57e-06)]x1 + [(0.3x5.43e-06) + (0.78x4.57e-06)]x1 = 1e-05 +π message A --> B + πB(a1) = π(a1).λC(a1) = 0.01 x 0.0002 = 2e-06 + πB(a2) = π(a2).λC(a2) = 0.09 x 0.0002 = 1.8e-05 +π message A --> C + πC(a1) = π(a1).λB(a1) = 0.01 x 0.0002 = 2e-06 + πC(a2) = π(a2).λB(a2) = 0.09 x 0.0002 = 1.8e-05 +π message B --> D + πD(b1) = π(b1) = 5.43e-06 = 5.43e-06 + πD(b2) = π(b2) = 4.57e-06 = 4.57e-06 +π message C --> D + πD(c1) = π(c1) = 1.32e-06 = 1.32e-06 + πD(c2) = π(c2) = 8.68e-06 = 8.68e-06 + +updating π & λ values +node A: + π(a1) = p(a1) = (0.01) = 0.01 + π(a2) = p(a2) = (0.09) = 0.09 + λ(a1) = λB(a1).λC(a1) = 0.0002 x 0.0002 = 4e-08 + λ(a2) = λB(a2).λC(a2) = 0.0002 x 0.0002 = 4e-08 + belief change = 0 +node B: + π(b1) = p(b1|a1).πB(a1) + p(b1|a2).πB(a2) = (0.03 x 2e-06) + (0.6 x 1.8e-05) = 1.086e-05 + π(b2) = p(b2|a1).πB(a1) + p(b2|a2).πB(a2) = (0.97 x 2e-06) + (0.4 x 1.8e-05) = 9.14e-06 + λ(b1) = λD(b1) = 1e-05 = 1e-05 + λ(b2) = λD(b2) = 1e-05 = 1e-05 + belief change = 5.551115123e-17 +node C: + π(c1) = p(c1|a1).πC(a1) + p(c1|a2).πC(a2) = (0.24 x 2e-06) + (0.12 x 1.8e-05) = 2.64e-06 + π(c2) = p(c2|a1).πC(a1) + p(c2|a2).πC(a2) = (0.76 x 2e-06) + (0.88 x 1.8e-05) = 1.736e-05 + λ(c1) = λD(c1) = 1e-05 = 1e-05 + λ(c2) = λD(c2) = 1e-05 = 1e-05 + belief change = 1.387778781e-16 +node D: + π(d1) = p(d1|b1,c1).πD(b1).πD(c1) + p(d1|b1,c2).πD(b1).πD(c2) + p(d1|b2,c1).πD(b2).πD(c1) + p(d1|b2,c2).πD(b2).πD(c2) = (0.2 x 5.43e-06 x 1.32e-06) + (0.7 x 5.43e-06 x 8.68e-06) + (0.45 x 4.57e-06 x 1.32e-06) + (0.22 x 4.57e-06 x 8.68e-06) = 4.5867652e-11 + π(d2) = p(d2|b1,c1).πD(b1).πD(c1) + p(d2|b1,c2).πD(b1).πD(c2) + p(d2|b2,c1).πD(b2).πD(c1) + p(d2|b2,c2).πD(b2).πD(c2) = (0.8 x 5.43e-06 x 1.32e-06) + (0.3 x 5.43e-06 x 8.68e-06) + (0.55 x 4.57e-06 x 1.32e-06) + (0.78 x 4.57e-06 x 8.68e-06) = 5.4132348e-11 + λ(d1) = 1 + λ(d2) = 1 + belief change = 0 + + +******************************************************************************** +Iteration 19 +******************************************************************************** + +status of random variable `A': + domain π(A) λ(A) belief +---------------------------------------------------------------- + a1 0.01 4e-08 0.1 + a2 0.09 4e-08 0.9 + + domain πB(A) λB(A) +---------------------------------------------------------------- + a1 2e-06 0.0002 + a2 1.8e-05 0.0002 + + domain πC(A) λC(A) +---------------------------------------------------------------- + a1 2e-06 0.0002 + a2 1.8e-05 0.0002 + + +status of random variable `B': + domain π(B) λ(B) belief +---------------------------------------------------------------- + b1 1.086e-05 1e-05 0.543 + b2 9.14e-06 1e-05 0.457 + + domain πD(B) λD(B) +---------------------------------------------------------------- + b1 5.43e-06 1e-05 + b2 4.57e-06 1e-05 + + +status of random variable `C': + domain π(C) λ(C) belief +---------------------------------------------------------------- + c1 2.64e-06 1e-05 0.132 + c2 1.736e-05 1e-05 0.868 + + domain πD(C) λD(C) +---------------------------------------------------------------- + c1 1.32e-06 1e-05 + c2 8.68e-06 1e-05 + + +status of random variable `D': + domain π(D) λ(D) belief +---------------------------------------------------------------- + d1 4.5867652e-11 1 0.45867652 + d2 5.4132348e-11 1 0.54132348 + +λ message B --> A + λB(a1) = [p(b1|a1)].λ(b1) + [p(b2|a1)].λ(b2) = [(0.03)]x1e-05 + [(0.97)]x1e-05 = 1e-05 + λB(a2) = [p(b1|a2)].λ(b1) + [p(b2|a2)].λ(b2) = [(0.6)]x1e-05 + [(0.4)]x1e-05 = 1e-05 +λ message C --> A + λC(a1) = [p(c1|a1)].λ(c1) + [p(c2|a1)].λ(c2) = [(0.24)]x1e-05 + [(0.76)]x1e-05 = 1e-05 + λC(a2) = [p(c1|a2)].λ(c1) + [p(c2|a2)].λ(c2) = [(0.12)]x1e-05 + [(0.88)]x1e-05 = 1e-05 +λ message D --> B + λD(b1) = [p(d1|b1,c1).πD(c1) + p(d1|b1,c2).πD(c2)].λ(d1) + [p(d2|b1,c1).πD(c1) + p(d2|b1,c2).πD(c2)].λ(d2) = [(0.2x1.32e-06) + (0.7x8.68e-06)]x1 + [(0.8x1.32e-06) + (0.3x8.68e-06)]x1 = 1e-05 + λD(b2) = [p(d1|b2,c1).πD(c1) + p(d1|b2,c2).πD(c2)].λ(d1) + [p(d2|b2,c1).πD(c1) + p(d2|b2,c2).πD(c2)].λ(d2) = [(0.45x1.32e-06) + (0.22x8.68e-06)]x1 + [(0.55x1.32e-06) + (0.78x8.68e-06)]x1 = 1e-05 +λ message D --> C + λD(c1) = [p(d1|b1,c1).πD(b1) + p(d1|b2,c1).πD(b2)].λ(d1) + [p(d2|b1,c1).πD(b1) + p(d2|b2,c1).πD(b2)].λ(d2) = [(0.2x5.43e-06) + (0.45x4.57e-06)]x1 + [(0.8x5.43e-06) + (0.55x4.57e-06)]x1 = 1e-05 + λD(c2) = [p(d1|b1,c2).πD(b1) + p(d1|b2,c2).πD(b2)].λ(d1) + [p(d2|b1,c2).πD(b1) + p(d2|b2,c2).πD(b2)].λ(d2) = [(0.7x5.43e-06) + (0.22x4.57e-06)]x1 + [(0.3x5.43e-06) + (0.78x4.57e-06)]x1 = 1e-05 +π message A --> B + πB(a1) = π(a1).λC(a1) = 0.01 x 0.0002 = 2e-06 + πB(a2) = π(a2).λC(a2) = 0.09 x 0.0002 = 1.8e-05 +π message A --> C + πC(a1) = π(a1).λB(a1) = 0.01 x 0.0002 = 2e-06 + πC(a2) = π(a2).λB(a2) = 0.09 x 0.0002 = 1.8e-05 +π message B --> D + πD(b1) = π(b1) = 1.086e-05 = 1.086e-05 + πD(b2) = π(b2) = 9.14e-06 = 9.14e-06 +π message C --> D + πD(c1) = π(c1) = 2.64e-06 = 2.64e-06 + πD(c2) = π(c2) = 1.736e-05 = 1.736e-05 + +updating π & λ values +node A: + π(a1) = p(a1) = (0.01) = 0.01 + π(a2) = p(a2) = (0.09) = 0.09 + λ(a1) = λB(a1).λC(a1) = 1e-05 x 1e-05 = 1e-10 + λ(a2) = λB(a2).λC(a2) = 1e-05 x 1e-05 = 1e-10 + belief change = 0 +node B: + π(b1) = p(b1|a1).πB(a1) + p(b1|a2).πB(a2) = (0.03 x 2e-06) + (0.6 x 1.8e-05) = 1.086e-05 + π(b2) = p(b2|a1).πB(a1) + p(b2|a2).πB(a2) = (0.97 x 2e-06) + (0.4 x 1.8e-05) = 9.14e-06 + λ(b1) = λD(b1) = 1e-05 = 1e-05 + λ(b2) = λD(b2) = 1e-05 = 1e-05 + belief change = 0 +node C: + π(c1) = p(c1|a1).πC(a1) + p(c1|a2).πC(a2) = (0.24 x 2e-06) + (0.12 x 1.8e-05) = 2.64e-06 + π(c2) = p(c2|a1).πC(a1) + p(c2|a2).πC(a2) = (0.76 x 2e-06) + (0.88 x 1.8e-05) = 1.736e-05 + λ(c1) = λD(c1) = 1e-05 = 1e-05 + λ(c2) = λD(c2) = 1e-05 = 1e-05 + belief change = 0 +node D: + π(d1) = p(d1|b1,c1).πD(b1).πD(c1) + p(d1|b1,c2).πD(b1).πD(c2) + p(d1|b2,c1).πD(b2).πD(c1) + p(d1|b2,c2).πD(b2).πD(c2) = (0.2 x 1.086e-05 x 2.64e-06) + (0.7 x 1.086e-05 x 1.736e-05) + (0.45 x 9.14e-06 x 2.64e-06) + (0.22 x 9.14e-06 x 1.736e-05) = 1.83470608e-10 + π(d2) = p(d2|b1,c1).πD(b1).πD(c1) + p(d2|b1,c2).πD(b1).πD(c2) + p(d2|b2,c1).πD(b2).πD(c1) + p(d2|b2,c2).πD(b2).πD(c2) = (0.8 x 1.086e-05 x 2.64e-06) + (0.3 x 1.086e-05 x 1.736e-05) + (0.55 x 9.14e-06 x 2.64e-06) + (0.78 x 9.14e-06 x 1.736e-05) = 2.16529392e-10 + λ(d1) = 1 + λ(d2) = 1 + belief change = 0 + + +******************************************************************************** +Iteration 20 +******************************************************************************** + +status of random variable `A': + domain π(A) λ(A) belief +---------------------------------------------------------------- + a1 0.01 1e-10 0.1 + a2 0.09 1e-10 0.9 + + domain πB(A) λB(A) +---------------------------------------------------------------- + a1 2e-06 1e-05 + a2 1.8e-05 1e-05 + + domain πC(A) λC(A) +---------------------------------------------------------------- + a1 2e-06 1e-05 + a2 1.8e-05 1e-05 + + +status of random variable `B': + domain π(B) λ(B) belief +---------------------------------------------------------------- + b1 1.086e-05 1e-05 0.543 + b2 9.14e-06 1e-05 0.457 + + domain πD(B) λD(B) +---------------------------------------------------------------- + b1 1.086e-05 1e-05 + b2 9.14e-06 1e-05 + + +status of random variable `C': + domain π(C) λ(C) belief +---------------------------------------------------------------- + c1 2.64e-06 1e-05 0.132 + c2 1.736e-05 1e-05 0.868 + + domain πD(C) λD(C) +---------------------------------------------------------------- + c1 2.64e-06 1e-05 + c2 1.736e-05 1e-05 + + +status of random variable `D': + domain π(D) λ(D) belief +---------------------------------------------------------------- + d1 1.83470608e-10 1 0.45867652 + d2 2.16529392e-10 1 0.54132348 + +λ message B --> A + λB(a1) = [p(b1|a1)].λ(b1) + [p(b2|a1)].λ(b2) = [(0.03)]x1e-05 + [(0.97)]x1e-05 = 1e-05 + λB(a2) = [p(b1|a2)].λ(b1) + [p(b2|a2)].λ(b2) = [(0.6)]x1e-05 + [(0.4)]x1e-05 = 1e-05 +λ message C --> A + λC(a1) = [p(c1|a1)].λ(c1) + [p(c2|a1)].λ(c2) = [(0.24)]x1e-05 + [(0.76)]x1e-05 = 1e-05 + λC(a2) = [p(c1|a2)].λ(c1) + [p(c2|a2)].λ(c2) = [(0.12)]x1e-05 + [(0.88)]x1e-05 = 1e-05 +λ message D --> B + λD(b1) = [p(d1|b1,c1).πD(c1) + p(d1|b1,c2).πD(c2)].λ(d1) + [p(d2|b1,c1).πD(c1) + p(d2|b1,c2).πD(c2)].λ(d2) = [(0.2x2.64e-06) + (0.7x1.736e-05)]x1 + [(0.8x2.64e-06) + (0.3x1.736e-05)]x1 = 2e-05 + λD(b2) = [p(d1|b2,c1).πD(c1) + p(d1|b2,c2).πD(c2)].λ(d1) + [p(d2|b2,c1).πD(c1) + p(d2|b2,c2).πD(c2)].λ(d2) = [(0.45x2.64e-06) + (0.22x1.736e-05)]x1 + [(0.55x2.64e-06) + (0.78x1.736e-05)]x1 = 2e-05 +λ message D --> C + λD(c1) = [p(d1|b1,c1).πD(b1) + p(d1|b2,c1).πD(b2)].λ(d1) + [p(d2|b1,c1).πD(b1) + p(d2|b2,c1).πD(b2)].λ(d2) = [(0.2x1.086e-05) + (0.45x9.14e-06)]x1 + [(0.8x1.086e-05) + (0.55x9.14e-06)]x1 = 2e-05 + λD(c2) = [p(d1|b1,c2).πD(b1) + p(d1|b2,c2).πD(b2)].λ(d1) + [p(d2|b1,c2).πD(b1) + p(d2|b2,c2).πD(b2)].λ(d2) = [(0.7x1.086e-05) + (0.22x9.14e-06)]x1 + [(0.3x1.086e-05) + (0.78x9.14e-06)]x1 = 2e-05 +π message A --> B + πB(a1) = π(a1).λC(a1) = 0.01 x 1e-05 = 1e-07 + πB(a2) = π(a2).λC(a2) = 0.09 x 1e-05 = 9e-07 +π message A --> C + πC(a1) = π(a1).λB(a1) = 0.01 x 1e-05 = 1e-07 + πC(a2) = π(a2).λB(a2) = 0.09 x 1e-05 = 9e-07 +π message B --> D + πD(b1) = π(b1) = 1.086e-05 = 1.086e-05 + πD(b2) = π(b2) = 9.14e-06 = 9.14e-06 +π message C --> D + πD(c1) = π(c1) = 2.64e-06 = 2.64e-06 + πD(c2) = π(c2) = 1.736e-05 = 1.736e-05 + +updating π & λ values +node A: + π(a1) = p(a1) = (0.01) = 0.01 + π(a2) = p(a2) = (0.09) = 0.09 + λ(a1) = λB(a1).λC(a1) = 1e-05 x 1e-05 = 1e-10 + λ(a2) = λB(a2).λC(a2) = 1e-05 x 1e-05 = 1e-10 + belief change = 0 +node B: + π(b1) = p(b1|a1).πB(a1) + p(b1|a2).πB(a2) = (0.03 x 1e-07) + (0.6 x 9e-07) = 5.43e-07 + π(b2) = p(b2|a1).πB(a1) + p(b2|a2).πB(a2) = (0.97 x 1e-07) + (0.4 x 9e-07) = 4.57e-07 + λ(b1) = λD(b1) = 2e-05 = 2e-05 + λ(b2) = λD(b2) = 2e-05 = 2e-05 + belief change = 0 +node C: + π(c1) = p(c1|a1).πC(a1) + p(c1|a2).πC(a2) = (0.24 x 1e-07) + (0.12 x 9e-07) = 1.32e-07 + π(c2) = p(c2|a1).πC(a1) + p(c2|a2).πC(a2) = (0.76 x 1e-07) + (0.88 x 9e-07) = 8.68e-07 + λ(c1) = λD(c1) = 2e-05 = 2e-05 + λ(c2) = λD(c2) = 2e-05 = 2e-05 + belief change = 1.110223025e-16 +node D: + π(d1) = p(d1|b1,c1).πD(b1).πD(c1) + p(d1|b1,c2).πD(b1).πD(c2) + p(d1|b2,c1).πD(b2).πD(c1) + p(d1|b2,c2).πD(b2).πD(c2) = (0.2 x 1.086e-05 x 2.64e-06) + (0.7 x 1.086e-05 x 1.736e-05) + (0.45 x 9.14e-06 x 2.64e-06) + (0.22 x 9.14e-06 x 1.736e-05) = 1.83470608e-10 + π(d2) = p(d2|b1,c1).πD(b1).πD(c1) + p(d2|b1,c2).πD(b1).πD(c2) + p(d2|b2,c1).πD(b2).πD(c1) + p(d2|b2,c2).πD(b2).πD(c2) = (0.8 x 1.086e-05 x 2.64e-06) + (0.3 x 1.086e-05 x 1.736e-05) + (0.55 x 9.14e-06 x 2.64e-06) + (0.78 x 9.14e-06 x 1.736e-05) = 2.16529392e-10 + λ(d1) = 1 + λ(d2) = 1 + belief change = 0 + + +******************************************************************************** +Iteration 21 +******************************************************************************** + +status of random variable `A': + domain π(A) λ(A) belief +---------------------------------------------------------------- + a1 0.01 1e-10 0.1 + a2 0.09 1e-10 0.9 + + domain πB(A) λB(A) +---------------------------------------------------------------- + a1 1e-07 1e-05 + a2 9e-07 1e-05 + + domain πC(A) λC(A) +---------------------------------------------------------------- + a1 1e-07 1e-05 + a2 9e-07 1e-05 + + +status of random variable `B': + domain π(B) λ(B) belief +---------------------------------------------------------------- + b1 5.43e-07 2e-05 0.543 + b2 4.57e-07 2e-05 0.457 + + domain πD(B) λD(B) +---------------------------------------------------------------- + b1 1.086e-05 2e-05 + b2 9.14e-06 2e-05 + + +status of random variable `C': + domain π(C) λ(C) belief +---------------------------------------------------------------- + c1 1.32e-07 2e-05 0.132 + c2 8.68e-07 2e-05 0.868 + + domain πD(C) λD(C) +---------------------------------------------------------------- + c1 2.64e-06 2e-05 + c2 1.736e-05 2e-05 + + +status of random variable `D': + domain π(D) λ(D) belief +---------------------------------------------------------------- + d1 1.83470608e-10 1 0.45867652 + d2 2.16529392e-10 1 0.54132348 + +λ message B --> A + λB(a1) = [p(b1|a1)].λ(b1) + [p(b2|a1)].λ(b2) = [(0.03)]x2e-05 + [(0.97)]x2e-05 = 2e-05 + λB(a2) = [p(b1|a2)].λ(b1) + [p(b2|a2)].λ(b2) = [(0.6)]x2e-05 + [(0.4)]x2e-05 = 2e-05 +λ message C --> A + λC(a1) = [p(c1|a1)].λ(c1) + [p(c2|a1)].λ(c2) = [(0.24)]x2e-05 + [(0.76)]x2e-05 = 2e-05 + λC(a2) = [p(c1|a2)].λ(c1) + [p(c2|a2)].λ(c2) = [(0.12)]x2e-05 + [(0.88)]x2e-05 = 2e-05 +λ message D --> B + λD(b1) = [p(d1|b1,c1).πD(c1) + p(d1|b1,c2).πD(c2)].λ(d1) + [p(d2|b1,c1).πD(c1) + p(d2|b1,c2).πD(c2)].λ(d2) = [(0.2x2.64e-06) + (0.7x1.736e-05)]x1 + [(0.8x2.64e-06) + (0.3x1.736e-05)]x1 = 2e-05 + λD(b2) = [p(d1|b2,c1).πD(c1) + p(d1|b2,c2).πD(c2)].λ(d1) + [p(d2|b2,c1).πD(c1) + p(d2|b2,c2).πD(c2)].λ(d2) = [(0.45x2.64e-06) + (0.22x1.736e-05)]x1 + [(0.55x2.64e-06) + (0.78x1.736e-05)]x1 = 2e-05 +λ message D --> C + λD(c1) = [p(d1|b1,c1).πD(b1) + p(d1|b2,c1).πD(b2)].λ(d1) + [p(d2|b1,c1).πD(b1) + p(d2|b2,c1).πD(b2)].λ(d2) = [(0.2x1.086e-05) + (0.45x9.14e-06)]x1 + [(0.8x1.086e-05) + (0.55x9.14e-06)]x1 = 2e-05 + λD(c2) = [p(d1|b1,c2).πD(b1) + p(d1|b2,c2).πD(b2)].λ(d1) + [p(d2|b1,c2).πD(b1) + p(d2|b2,c2).πD(b2)].λ(d2) = [(0.7x1.086e-05) + (0.22x9.14e-06)]x1 + [(0.3x1.086e-05) + (0.78x9.14e-06)]x1 = 2e-05 +π message A --> B + πB(a1) = π(a1).λC(a1) = 0.01 x 1e-05 = 1e-07 + πB(a2) = π(a2).λC(a2) = 0.09 x 1e-05 = 9e-07 +π message A --> C + πC(a1) = π(a1).λB(a1) = 0.01 x 1e-05 = 1e-07 + πC(a2) = π(a2).λB(a2) = 0.09 x 1e-05 = 9e-07 +π message B --> D + πD(b1) = π(b1) = 5.43e-07 = 5.43e-07 + πD(b2) = π(b2) = 4.57e-07 = 4.57e-07 +π message C --> D + πD(c1) = π(c1) = 1.32e-07 = 1.32e-07 + πD(c2) = π(c2) = 8.68e-07 = 8.68e-07 + +updating π & λ values +node A: + π(a1) = p(a1) = (0.01) = 0.01 + π(a2) = p(a2) = (0.09) = 0.09 + λ(a1) = λB(a1).λC(a1) = 2e-05 x 2e-05 = 4e-10 + λ(a2) = λB(a2).λC(a2) = 2e-05 x 2e-05 = 4e-10 + belief change = 0 +node B: + π(b1) = p(b1|a1).πB(a1) + p(b1|a2).πB(a2) = (0.03 x 1e-07) + (0.6 x 9e-07) = 5.43e-07 + π(b2) = p(b2|a1).πB(a1) + p(b2|a2).πB(a2) = (0.97 x 1e-07) + (0.4 x 9e-07) = 4.57e-07 + λ(b1) = λD(b1) = 2e-05 = 2e-05 + λ(b2) = λD(b2) = 2e-05 = 2e-05 + belief change = 0 +node C: + π(c1) = p(c1|a1).πC(a1) + p(c1|a2).πC(a2) = (0.24 x 1e-07) + (0.12 x 9e-07) = 1.32e-07 + π(c2) = p(c2|a1).πC(a1) + p(c2|a2).πC(a2) = (0.76 x 1e-07) + (0.88 x 9e-07) = 8.68e-07 + λ(c1) = λD(c1) = 2e-05 = 2e-05 + λ(c2) = λD(c2) = 2e-05 = 2e-05 + belief change = 0 +node D: + π(d1) = p(d1|b1,c1).πD(b1).πD(c1) + p(d1|b1,c2).πD(b1).πD(c2) + p(d1|b2,c1).πD(b2).πD(c1) + p(d1|b2,c2).πD(b2).πD(c2) = (0.2 x 5.43e-07 x 1.32e-07) + (0.7 x 5.43e-07 x 8.68e-07) + (0.45 x 4.57e-07 x 1.32e-07) + (0.22 x 4.57e-07 x 8.68e-07) = 4.5867652e-13 + π(d2) = p(d2|b1,c1).πD(b1).πD(c1) + p(d2|b1,c2).πD(b1).πD(c2) + p(d2|b2,c1).πD(b2).πD(c1) + p(d2|b2,c2).πD(b2).πD(c2) = (0.8 x 5.43e-07 x 1.32e-07) + (0.3 x 5.43e-07 x 8.68e-07) + (0.55 x 4.57e-07 x 1.32e-07) + (0.78 x 4.57e-07 x 8.68e-07) = 5.4132348e-13 + λ(d1) = 1 + λ(d2) = 1 + belief change = 1.110223025e-16 + + +******************************************************************************** +Iteration 22 +******************************************************************************** + +status of random variable `A': + domain π(A) λ(A) belief +---------------------------------------------------------------- + a1 0.01 4e-10 0.1 + a2 0.09 4e-10 0.9 + + domain πB(A) λB(A) +---------------------------------------------------------------- + a1 1e-07 2e-05 + a2 9e-07 2e-05 + + domain πC(A) λC(A) +---------------------------------------------------------------- + a1 1e-07 2e-05 + a2 9e-07 2e-05 + + +status of random variable `B': + domain π(B) λ(B) belief +---------------------------------------------------------------- + b1 5.43e-07 2e-05 0.543 + b2 4.57e-07 2e-05 0.457 + + domain πD(B) λD(B) +---------------------------------------------------------------- + b1 5.43e-07 2e-05 + b2 4.57e-07 2e-05 + + +status of random variable `C': + domain π(C) λ(C) belief +---------------------------------------------------------------- + c1 1.32e-07 2e-05 0.132 + c2 8.68e-07 2e-05 0.868 + + domain πD(C) λD(C) +---------------------------------------------------------------- + c1 1.32e-07 2e-05 + c2 8.68e-07 2e-05 + + +status of random variable `D': + domain π(D) λ(D) belief +---------------------------------------------------------------- + d1 4.5867652e-13 1 0.45867652 + d2 5.4132348e-13 1 0.54132348 + +λ message B --> A + λB(a1) = [p(b1|a1)].λ(b1) + [p(b2|a1)].λ(b2) = [(0.03)]x2e-05 + [(0.97)]x2e-05 = 2e-05 + λB(a2) = [p(b1|a2)].λ(b1) + [p(b2|a2)].λ(b2) = [(0.6)]x2e-05 + [(0.4)]x2e-05 = 2e-05 +λ message C --> A + λC(a1) = [p(c1|a1)].λ(c1) + [p(c2|a1)].λ(c2) = [(0.24)]x2e-05 + [(0.76)]x2e-05 = 2e-05 + λC(a2) = [p(c1|a2)].λ(c1) + [p(c2|a2)].λ(c2) = [(0.12)]x2e-05 + [(0.88)]x2e-05 = 2e-05 +λ message D --> B + λD(b1) = [p(d1|b1,c1).πD(c1) + p(d1|b1,c2).πD(c2)].λ(d1) + [p(d2|b1,c1).πD(c1) + p(d2|b1,c2).πD(c2)].λ(d2) = [(0.2x1.32e-07) + (0.7x8.68e-07)]x1 + [(0.8x1.32e-07) + (0.3x8.68e-07)]x1 = 1e-06 + λD(b2) = [p(d1|b2,c1).πD(c1) + p(d1|b2,c2).πD(c2)].λ(d1) + [p(d2|b2,c1).πD(c1) + p(d2|b2,c2).πD(c2)].λ(d2) = [(0.45x1.32e-07) + (0.22x8.68e-07)]x1 + [(0.55x1.32e-07) + (0.78x8.68e-07)]x1 = 1e-06 +λ message D --> C + λD(c1) = [p(d1|b1,c1).πD(b1) + p(d1|b2,c1).πD(b2)].λ(d1) + [p(d2|b1,c1).πD(b1) + p(d2|b2,c1).πD(b2)].λ(d2) = [(0.2x5.43e-07) + (0.45x4.57e-07)]x1 + [(0.8x5.43e-07) + (0.55x4.57e-07)]x1 = 1e-06 + λD(c2) = [p(d1|b1,c2).πD(b1) + p(d1|b2,c2).πD(b2)].λ(d1) + [p(d2|b1,c2).πD(b1) + p(d2|b2,c2).πD(b2)].λ(d2) = [(0.7x5.43e-07) + (0.22x4.57e-07)]x1 + [(0.3x5.43e-07) + (0.78x4.57e-07)]x1 = 1e-06 +π message A --> B + πB(a1) = π(a1).λC(a1) = 0.01 x 2e-05 = 2e-07 + πB(a2) = π(a2).λC(a2) = 0.09 x 2e-05 = 1.8e-06 +π message A --> C + πC(a1) = π(a1).λB(a1) = 0.01 x 2e-05 = 2e-07 + πC(a2) = π(a2).λB(a2) = 0.09 x 2e-05 = 1.8e-06 +π message B --> D + πD(b1) = π(b1) = 5.43e-07 = 5.43e-07 + πD(b2) = π(b2) = 4.57e-07 = 4.57e-07 +π message C --> D + πD(c1) = π(c1) = 1.32e-07 = 1.32e-07 + πD(c2) = π(c2) = 8.68e-07 = 8.68e-07 + +updating π & λ values +node A: + π(a1) = p(a1) = (0.01) = 0.01 + π(a2) = p(a2) = (0.09) = 0.09 + λ(a1) = λB(a1).λC(a1) = 2e-05 x 2e-05 = 4e-10 + λ(a2) = λB(a2).λC(a2) = 2e-05 x 2e-05 = 4e-10 + belief change = 0 +node B: + π(b1) = p(b1|a1).πB(a1) + p(b1|a2).πB(a2) = (0.03 x 2e-07) + (0.6 x 1.8e-06) = 1.086e-06 + π(b2) = p(b2|a1).πB(a1) + p(b2|a2).πB(a2) = (0.97 x 2e-07) + (0.4 x 1.8e-06) = 9.14e-07 + λ(b1) = λD(b1) = 1e-06 = 1e-06 + λ(b2) = λD(b2) = 1e-06 = 1e-06 + belief change = 5.551115123e-17 +node C: + π(c1) = p(c1|a1).πC(a1) + p(c1|a2).πC(a2) = (0.24 x 2e-07) + (0.12 x 1.8e-06) = 2.64e-07 + π(c2) = p(c2|a1).πC(a1) + p(c2|a2).πC(a2) = (0.76 x 2e-07) + (0.88 x 1.8e-06) = 1.736e-06 + λ(c1) = λD(c1) = 1e-06 = 1e-06 + λ(c2) = λD(c2) = 1e-06 = 1e-06 + belief change = 2.498001805e-16 +node D: + π(d1) = p(d1|b1,c1).πD(b1).πD(c1) + p(d1|b1,c2).πD(b1).πD(c2) + p(d1|b2,c1).πD(b2).πD(c1) + p(d1|b2,c2).πD(b2).πD(c2) = (0.2 x 5.43e-07 x 1.32e-07) + (0.7 x 5.43e-07 x 8.68e-07) + (0.45 x 4.57e-07 x 1.32e-07) + (0.22 x 4.57e-07 x 8.68e-07) = 4.5867652e-13 + π(d2) = p(d2|b1,c1).πD(b1).πD(c1) + p(d2|b1,c2).πD(b1).πD(c2) + p(d2|b2,c1).πD(b2).πD(c1) + p(d2|b2,c2).πD(b2).πD(c2) = (0.8 x 5.43e-07 x 1.32e-07) + (0.3 x 5.43e-07 x 8.68e-07) + (0.55 x 4.57e-07 x 1.32e-07) + (0.78 x 4.57e-07 x 8.68e-07) = 5.4132348e-13 + λ(d1) = 1 + λ(d2) = 1 + belief change = 0 + + +******************************************************************************** +Iteration 23 +******************************************************************************** + +status of random variable `A': + domain π(A) λ(A) belief +---------------------------------------------------------------- + a1 0.01 4e-10 0.1 + a2 0.09 4e-10 0.9 + + domain πB(A) λB(A) +---------------------------------------------------------------- + a1 2e-07 2e-05 + a2 1.8e-06 2e-05 + + domain πC(A) λC(A) +---------------------------------------------------------------- + a1 2e-07 2e-05 + a2 1.8e-06 2e-05 + + +status of random variable `B': + domain π(B) λ(B) belief +---------------------------------------------------------------- + b1 1.086e-06 1e-06 0.543 + b2 9.14e-07 1e-06 0.457 + + domain πD(B) λD(B) +---------------------------------------------------------------- + b1 5.43e-07 1e-06 + b2 4.57e-07 1e-06 + + +status of random variable `C': + domain π(C) λ(C) belief +---------------------------------------------------------------- + c1 2.64e-07 1e-06 0.132 + c2 1.736e-06 1e-06 0.868 + + domain πD(C) λD(C) +---------------------------------------------------------------- + c1 1.32e-07 1e-06 + c2 8.68e-07 1e-06 + + +status of random variable `D': + domain π(D) λ(D) belief +---------------------------------------------------------------- + d1 4.5867652e-13 1 0.45867652 + d2 5.4132348e-13 1 0.54132348 + +λ message B --> A + λB(a1) = [p(b1|a1)].λ(b1) + [p(b2|a1)].λ(b2) = [(0.03)]x1e-06 + [(0.97)]x1e-06 = 1e-06 + λB(a2) = [p(b1|a2)].λ(b1) + [p(b2|a2)].λ(b2) = [(0.6)]x1e-06 + [(0.4)]x1e-06 = 1e-06 +λ message C --> A + λC(a1) = [p(c1|a1)].λ(c1) + [p(c2|a1)].λ(c2) = [(0.24)]x1e-06 + [(0.76)]x1e-06 = 1e-06 + λC(a2) = [p(c1|a2)].λ(c1) + [p(c2|a2)].λ(c2) = [(0.12)]x1e-06 + [(0.88)]x1e-06 = 1e-06 +λ message D --> B + λD(b1) = [p(d1|b1,c1).πD(c1) + p(d1|b1,c2).πD(c2)].λ(d1) + [p(d2|b1,c1).πD(c1) + p(d2|b1,c2).πD(c2)].λ(d2) = [(0.2x1.32e-07) + (0.7x8.68e-07)]x1 + [(0.8x1.32e-07) + (0.3x8.68e-07)]x1 = 1e-06 + λD(b2) = [p(d1|b2,c1).πD(c1) + p(d1|b2,c2).πD(c2)].λ(d1) + [p(d2|b2,c1).πD(c1) + p(d2|b2,c2).πD(c2)].λ(d2) = [(0.45x1.32e-07) + (0.22x8.68e-07)]x1 + [(0.55x1.32e-07) + (0.78x8.68e-07)]x1 = 1e-06 +λ message D --> C + λD(c1) = [p(d1|b1,c1).πD(b1) + p(d1|b2,c1).πD(b2)].λ(d1) + [p(d2|b1,c1).πD(b1) + p(d2|b2,c1).πD(b2)].λ(d2) = [(0.2x5.43e-07) + (0.45x4.57e-07)]x1 + [(0.8x5.43e-07) + (0.55x4.57e-07)]x1 = 1e-06 + λD(c2) = [p(d1|b1,c2).πD(b1) + p(d1|b2,c2).πD(b2)].λ(d1) + [p(d2|b1,c2).πD(b1) + p(d2|b2,c2).πD(b2)].λ(d2) = [(0.7x5.43e-07) + (0.22x4.57e-07)]x1 + [(0.3x5.43e-07) + (0.78x4.57e-07)]x1 = 1e-06 +π message A --> B + πB(a1) = π(a1).λC(a1) = 0.01 x 2e-05 = 2e-07 + πB(a2) = π(a2).λC(a2) = 0.09 x 2e-05 = 1.8e-06 +π message A --> C + πC(a1) = π(a1).λB(a1) = 0.01 x 2e-05 = 2e-07 + πC(a2) = π(a2).λB(a2) = 0.09 x 2e-05 = 1.8e-06 +π message B --> D + πD(b1) = π(b1) = 1.086e-06 = 1.086e-06 + πD(b2) = π(b2) = 9.14e-07 = 9.14e-07 +π message C --> D + πD(c1) = π(c1) = 2.64e-07 = 2.64e-07 + πD(c2) = π(c2) = 1.736e-06 = 1.736e-06 + +updating π & λ values +node A: + π(a1) = p(a1) = (0.01) = 0.01 + π(a2) = p(a2) = (0.09) = 0.09 + λ(a1) = λB(a1).λC(a1) = 1e-06 x 1e-06 = 1e-12 + λ(a2) = λB(a2).λC(a2) = 1e-06 x 1e-06 = 1e-12 + belief change = 0 +node B: + π(b1) = p(b1|a1).πB(a1) + p(b1|a2).πB(a2) = (0.03 x 2e-07) + (0.6 x 1.8e-06) = 1.086e-06 + π(b2) = p(b2|a1).πB(a1) + p(b2|a2).πB(a2) = (0.97 x 2e-07) + (0.4 x 1.8e-06) = 9.14e-07 + λ(b1) = λD(b1) = 1e-06 = 1e-06 + λ(b2) = λD(b2) = 1e-06 = 1e-06 + belief change = 0 +node C: + π(c1) = p(c1|a1).πC(a1) + p(c1|a2).πC(a2) = (0.24 x 2e-07) + (0.12 x 1.8e-06) = 2.64e-07 + π(c2) = p(c2|a1).πC(a1) + p(c2|a2).πC(a2) = (0.76 x 2e-07) + (0.88 x 1.8e-06) = 1.736e-06 + λ(c1) = λD(c1) = 1e-06 = 1e-06 + λ(c2) = λD(c2) = 1e-06 = 1e-06 + belief change = 0 +node D: + π(d1) = p(d1|b1,c1).πD(b1).πD(c1) + p(d1|b1,c2).πD(b1).πD(c2) + p(d1|b2,c1).πD(b2).πD(c1) + p(d1|b2,c2).πD(b2).πD(c2) = (0.2 x 1.086e-06 x 2.64e-07) + (0.7 x 1.086e-06 x 1.736e-06) + (0.45 x 9.14e-07 x 2.64e-07) + (0.22 x 9.14e-07 x 1.736e-06) = 1.83470608e-12 + π(d2) = p(d2|b1,c1).πD(b1).πD(c1) + p(d2|b1,c2).πD(b1).πD(c2) + p(d2|b2,c1).πD(b2).πD(c1) + p(d2|b2,c2).πD(b2).πD(c2) = (0.8 x 1.086e-06 x 2.64e-07) + (0.3 x 1.086e-06 x 1.736e-06) + (0.55 x 9.14e-07 x 2.64e-07) + (0.78 x 9.14e-07 x 1.736e-06) = 2.16529392e-12 + λ(d1) = 1 + λ(d2) = 1 + belief change = 0 + + +******************************************************************************** +Iteration 24 +******************************************************************************** + +status of random variable `A': + domain π(A) λ(A) belief +---------------------------------------------------------------- + a1 0.01 1e-12 0.1 + a2 0.09 1e-12 0.9 + + domain πB(A) λB(A) +---------------------------------------------------------------- + a1 2e-07 1e-06 + a2 1.8e-06 1e-06 + + domain πC(A) λC(A) +---------------------------------------------------------------- + a1 2e-07 1e-06 + a2 1.8e-06 1e-06 + + +status of random variable `B': + domain π(B) λ(B) belief +---------------------------------------------------------------- + b1 1.086e-06 1e-06 0.543 + b2 9.14e-07 1e-06 0.457 + + domain πD(B) λD(B) +---------------------------------------------------------------- + b1 1.086e-06 1e-06 + b2 9.14e-07 1e-06 + + +status of random variable `C': + domain π(C) λ(C) belief +---------------------------------------------------------------- + c1 2.64e-07 1e-06 0.132 + c2 1.736e-06 1e-06 0.868 + + domain πD(C) λD(C) +---------------------------------------------------------------- + c1 2.64e-07 1e-06 + c2 1.736e-06 1e-06 + + +status of random variable `D': + domain π(D) λ(D) belief +---------------------------------------------------------------- + d1 1.83470608e-12 1 0.45867652 + d2 2.16529392e-12 1 0.54132348 + +λ message B --> A + λB(a1) = [p(b1|a1)].λ(b1) + [p(b2|a1)].λ(b2) = [(0.03)]x1e-06 + [(0.97)]x1e-06 = 1e-06 + λB(a2) = [p(b1|a2)].λ(b1) + [p(b2|a2)].λ(b2) = [(0.6)]x1e-06 + [(0.4)]x1e-06 = 1e-06 +λ message C --> A + λC(a1) = [p(c1|a1)].λ(c1) + [p(c2|a1)].λ(c2) = [(0.24)]x1e-06 + [(0.76)]x1e-06 = 1e-06 + λC(a2) = [p(c1|a2)].λ(c1) + [p(c2|a2)].λ(c2) = [(0.12)]x1e-06 + [(0.88)]x1e-06 = 1e-06 +λ message D --> B + λD(b1) = [p(d1|b1,c1).πD(c1) + p(d1|b1,c2).πD(c2)].λ(d1) + [p(d2|b1,c1).πD(c1) + p(d2|b1,c2).πD(c2)].λ(d2) = [(0.2x2.64e-07) + (0.7x1.736e-06)]x1 + [(0.8x2.64e-07) + (0.3x1.736e-06)]x1 = 2e-06 + λD(b2) = [p(d1|b2,c1).πD(c1) + p(d1|b2,c2).πD(c2)].λ(d1) + [p(d2|b2,c1).πD(c1) + p(d2|b2,c2).πD(c2)].λ(d2) = [(0.45x2.64e-07) + (0.22x1.736e-06)]x1 + [(0.55x2.64e-07) + (0.78x1.736e-06)]x1 = 2e-06 +λ message D --> C + λD(c1) = [p(d1|b1,c1).πD(b1) + p(d1|b2,c1).πD(b2)].λ(d1) + [p(d2|b1,c1).πD(b1) + p(d2|b2,c1).πD(b2)].λ(d2) = [(0.2x1.086e-06) + (0.45x9.14e-07)]x1 + [(0.8x1.086e-06) + (0.55x9.14e-07)]x1 = 2e-06 + λD(c2) = [p(d1|b1,c2).πD(b1) + p(d1|b2,c2).πD(b2)].λ(d1) + [p(d2|b1,c2).πD(b1) + p(d2|b2,c2).πD(b2)].λ(d2) = [(0.7x1.086e-06) + (0.22x9.14e-07)]x1 + [(0.3x1.086e-06) + (0.78x9.14e-07)]x1 = 2e-06 +π message A --> B + πB(a1) = π(a1).λC(a1) = 0.01 x 1e-06 = 1e-08 + πB(a2) = π(a2).λC(a2) = 0.09 x 1e-06 = 9e-08 +π message A --> C + πC(a1) = π(a1).λB(a1) = 0.01 x 1e-06 = 1e-08 + πC(a2) = π(a2).λB(a2) = 0.09 x 1e-06 = 9e-08 +π message B --> D + πD(b1) = π(b1) = 1.086e-06 = 1.086e-06 + πD(b2) = π(b2) = 9.14e-07 = 9.14e-07 +π message C --> D + πD(c1) = π(c1) = 2.64e-07 = 2.64e-07 + πD(c2) = π(c2) = 1.736e-06 = 1.736e-06 + +updating π & λ values +node A: + π(a1) = p(a1) = (0.01) = 0.01 + π(a2) = p(a2) = (0.09) = 0.09 + λ(a1) = λB(a1).λC(a1) = 1e-06 x 1e-06 = 1e-12 + λ(a2) = λB(a2).λC(a2) = 1e-06 x 1e-06 = 1e-12 + belief change = 0 +node B: + π(b1) = p(b1|a1).πB(a1) + p(b1|a2).πB(a2) = (0.03 x 1e-08) + (0.6 x 9e-08) = 5.43e-08 + π(b2) = p(b2|a1).πB(a1) + p(b2|a2).πB(a2) = (0.97 x 1e-08) + (0.4 x 9e-08) = 4.57e-08 + λ(b1) = λD(b1) = 2e-06 = 2e-06 + λ(b2) = λD(b2) = 2e-06 = 2e-06 + belief change = 5.551115123e-17 +node C: + π(c1) = p(c1|a1).πC(a1) + p(c1|a2).πC(a2) = (0.24 x 1e-08) + (0.12 x 9e-08) = 1.32e-08 + π(c2) = p(c2|a1).πC(a1) + p(c2|a2).πC(a2) = (0.76 x 1e-08) + (0.88 x 9e-08) = 8.68e-08 + λ(c1) = λD(c1) = 2e-06 = 2e-06 + λ(c2) = λD(c2) = 2e-06 = 2e-06 + belief change = 1.387778781e-16 +node D: + π(d1) = p(d1|b1,c1).πD(b1).πD(c1) + p(d1|b1,c2).πD(b1).πD(c2) + p(d1|b2,c1).πD(b2).πD(c1) + p(d1|b2,c2).πD(b2).πD(c2) = (0.2 x 1.086e-06 x 2.64e-07) + (0.7 x 1.086e-06 x 1.736e-06) + (0.45 x 9.14e-07 x 2.64e-07) + (0.22 x 9.14e-07 x 1.736e-06) = 1.83470608e-12 + π(d2) = p(d2|b1,c1).πD(b1).πD(c1) + p(d2|b1,c2).πD(b1).πD(c2) + p(d2|b2,c1).πD(b2).πD(c1) + p(d2|b2,c2).πD(b2).πD(c2) = (0.8 x 1.086e-06 x 2.64e-07) + (0.3 x 1.086e-06 x 1.736e-06) + (0.55 x 9.14e-07 x 2.64e-07) + (0.78 x 9.14e-07 x 1.736e-06) = 2.16529392e-12 + λ(d1) = 1 + λ(d2) = 1 + belief change = 0 + + +******************************************************************************** +Iteration 25 +******************************************************************************** + +status of random variable `A': + domain π(A) λ(A) belief +---------------------------------------------------------------- + a1 0.01 1e-12 0.1 + a2 0.09 1e-12 0.9 + + domain πB(A) λB(A) +---------------------------------------------------------------- + a1 1e-08 1e-06 + a2 9e-08 1e-06 + + domain πC(A) λC(A) +---------------------------------------------------------------- + a1 1e-08 1e-06 + a2 9e-08 1e-06 + + +status of random variable `B': + domain π(B) λ(B) belief +---------------------------------------------------------------- + b1 5.43e-08 2e-06 0.543 + b2 4.57e-08 2e-06 0.457 + + domain πD(B) λD(B) +---------------------------------------------------------------- + b1 1.086e-06 2e-06 + b2 9.14e-07 2e-06 + + +status of random variable `C': + domain π(C) λ(C) belief +---------------------------------------------------------------- + c1 1.32e-08 2e-06 0.132 + c2 8.68e-08 2e-06 0.868 + + domain πD(C) λD(C) +---------------------------------------------------------------- + c1 2.64e-07 2e-06 + c2 1.736e-06 2e-06 + + +status of random variable `D': + domain π(D) λ(D) belief +---------------------------------------------------------------- + d1 1.83470608e-12 1 0.45867652 + d2 2.16529392e-12 1 0.54132348 + +λ message B --> A + λB(a1) = [p(b1|a1)].λ(b1) + [p(b2|a1)].λ(b2) = [(0.03)]x2e-06 + [(0.97)]x2e-06 = 2e-06 + λB(a2) = [p(b1|a2)].λ(b1) + [p(b2|a2)].λ(b2) = [(0.6)]x2e-06 + [(0.4)]x2e-06 = 2e-06 +λ message C --> A + λC(a1) = [p(c1|a1)].λ(c1) + [p(c2|a1)].λ(c2) = [(0.24)]x2e-06 + [(0.76)]x2e-06 = 2e-06 + λC(a2) = [p(c1|a2)].λ(c1) + [p(c2|a2)].λ(c2) = [(0.12)]x2e-06 + [(0.88)]x2e-06 = 2e-06 +λ message D --> B + λD(b1) = [p(d1|b1,c1).πD(c1) + p(d1|b1,c2).πD(c2)].λ(d1) + [p(d2|b1,c1).πD(c1) + p(d2|b1,c2).πD(c2)].λ(d2) = [(0.2x2.64e-07) + (0.7x1.736e-06)]x1 + [(0.8x2.64e-07) + (0.3x1.736e-06)]x1 = 2e-06 + λD(b2) = [p(d1|b2,c1).πD(c1) + p(d1|b2,c2).πD(c2)].λ(d1) + [p(d2|b2,c1).πD(c1) + p(d2|b2,c2).πD(c2)].λ(d2) = [(0.45x2.64e-07) + (0.22x1.736e-06)]x1 + [(0.55x2.64e-07) + (0.78x1.736e-06)]x1 = 2e-06 +λ message D --> C + λD(c1) = [p(d1|b1,c1).πD(b1) + p(d1|b2,c1).πD(b2)].λ(d1) + [p(d2|b1,c1).πD(b1) + p(d2|b2,c1).πD(b2)].λ(d2) = [(0.2x1.086e-06) + (0.45x9.14e-07)]x1 + [(0.8x1.086e-06) + (0.55x9.14e-07)]x1 = 2e-06 + λD(c2) = [p(d1|b1,c2).πD(b1) + p(d1|b2,c2).πD(b2)].λ(d1) + [p(d2|b1,c2).πD(b1) + p(d2|b2,c2).πD(b2)].λ(d2) = [(0.7x1.086e-06) + (0.22x9.14e-07)]x1 + [(0.3x1.086e-06) + (0.78x9.14e-07)]x1 = 2e-06 +π message A --> B + πB(a1) = π(a1).λC(a1) = 0.01 x 1e-06 = 1e-08 + πB(a2) = π(a2).λC(a2) = 0.09 x 1e-06 = 9e-08 +π message A --> C + πC(a1) = π(a1).λB(a1) = 0.01 x 1e-06 = 1e-08 + πC(a2) = π(a2).λB(a2) = 0.09 x 1e-06 = 9e-08 +π message B --> D + πD(b1) = π(b1) = 5.43e-08 = 5.43e-08 + πD(b2) = π(b2) = 4.57e-08 = 4.57e-08 +π message C --> D + πD(c1) = π(c1) = 1.32e-08 = 1.32e-08 + πD(c2) = π(c2) = 8.68e-08 = 8.68e-08 + +updating π & λ values +node A: + π(a1) = p(a1) = (0.01) = 0.01 + π(a2) = p(a2) = (0.09) = 0.09 + λ(a1) = λB(a1).λC(a1) = 2e-06 x 2e-06 = 4e-12 + λ(a2) = λB(a2).λC(a2) = 2e-06 x 2e-06 = 4e-12 + belief change = 0 +node B: + π(b1) = p(b1|a1).πB(a1) + p(b1|a2).πB(a2) = (0.03 x 1e-08) + (0.6 x 9e-08) = 5.43e-08 + π(b2) = p(b2|a1).πB(a1) + p(b2|a2).πB(a2) = (0.97 x 1e-08) + (0.4 x 9e-08) = 4.57e-08 + λ(b1) = λD(b1) = 2e-06 = 2e-06 + λ(b2) = λD(b2) = 2e-06 = 2e-06 + belief change = 0 +node C: + π(c1) = p(c1|a1).πC(a1) + p(c1|a2).πC(a2) = (0.24 x 1e-08) + (0.12 x 9e-08) = 1.32e-08 + π(c2) = p(c2|a1).πC(a1) + p(c2|a2).πC(a2) = (0.76 x 1e-08) + (0.88 x 9e-08) = 8.68e-08 + λ(c1) = λD(c1) = 2e-06 = 2e-06 + λ(c2) = λD(c2) = 2e-06 = 2e-06 + belief change = 0 +node D: + π(d1) = p(d1|b1,c1).πD(b1).πD(c1) + p(d1|b1,c2).πD(b1).πD(c2) + p(d1|b2,c1).πD(b2).πD(c1) + p(d1|b2,c2).πD(b2).πD(c2) = (0.2 x 5.43e-08 x 1.32e-08) + (0.7 x 5.43e-08 x 8.68e-08) + (0.45 x 4.57e-08 x 1.32e-08) + (0.22 x 4.57e-08 x 8.68e-08) = 4.5867652e-15 + π(d2) = p(d2|b1,c1).πD(b1).πD(c1) + p(d2|b1,c2).πD(b1).πD(c2) + p(d2|b2,c1).πD(b2).πD(c1) + p(d2|b2,c2).πD(b2).πD(c2) = (0.8 x 5.43e-08 x 1.32e-08) + (0.3 x 5.43e-08 x 8.68e-08) + (0.55 x 4.57e-08 x 1.32e-08) + (0.78 x 4.57e-08 x 8.68e-08) = 5.4132348e-15 + λ(d1) = 1 + λ(d2) = 1 + belief change = 5.551115123e-17 + + +******************************************************************************** +Iteration 26 +******************************************************************************** + +status of random variable `A': + domain π(A) λ(A) belief +---------------------------------------------------------------- + a1 0.01 4e-12 0.1 + a2 0.09 4e-12 0.9 + + domain πB(A) λB(A) +---------------------------------------------------------------- + a1 1e-08 2e-06 + a2 9e-08 2e-06 + + domain πC(A) λC(A) +---------------------------------------------------------------- + a1 1e-08 2e-06 + a2 9e-08 2e-06 + + +status of random variable `B': + domain π(B) λ(B) belief +---------------------------------------------------------------- + b1 5.43e-08 2e-06 0.543 + b2 4.57e-08 2e-06 0.457 + + domain πD(B) λD(B) +---------------------------------------------------------------- + b1 5.43e-08 2e-06 + b2 4.57e-08 2e-06 + + +status of random variable `C': + domain π(C) λ(C) belief +---------------------------------------------------------------- + c1 1.32e-08 2e-06 0.132 + c2 8.68e-08 2e-06 0.868 + + domain πD(C) λD(C) +---------------------------------------------------------------- + c1 1.32e-08 2e-06 + c2 8.68e-08 2e-06 + + +status of random variable `D': + domain π(D) λ(D) belief +---------------------------------------------------------------- + d1 4.5867652e-15 1 0.45867652 + d2 5.4132348e-15 1 0.54132348 + +λ message B --> A + λB(a1) = [p(b1|a1)].λ(b1) + [p(b2|a1)].λ(b2) = [(0.03)]x2e-06 + [(0.97)]x2e-06 = 2e-06 + λB(a2) = [p(b1|a2)].λ(b1) + [p(b2|a2)].λ(b2) = [(0.6)]x2e-06 + [(0.4)]x2e-06 = 2e-06 +λ message C --> A + λC(a1) = [p(c1|a1)].λ(c1) + [p(c2|a1)].λ(c2) = [(0.24)]x2e-06 + [(0.76)]x2e-06 = 2e-06 + λC(a2) = [p(c1|a2)].λ(c1) + [p(c2|a2)].λ(c2) = [(0.12)]x2e-06 + [(0.88)]x2e-06 = 2e-06 +λ message D --> B + λD(b1) = [p(d1|b1,c1).πD(c1) + p(d1|b1,c2).πD(c2)].λ(d1) + [p(d2|b1,c1).πD(c1) + p(d2|b1,c2).πD(c2)].λ(d2) = [(0.2x1.32e-08) + (0.7x8.68e-08)]x1 + [(0.8x1.32e-08) + (0.3x8.68e-08)]x1 = 1e-07 + λD(b2) = [p(d1|b2,c1).πD(c1) + p(d1|b2,c2).πD(c2)].λ(d1) + [p(d2|b2,c1).πD(c1) + p(d2|b2,c2).πD(c2)].λ(d2) = [(0.45x1.32e-08) + (0.22x8.68e-08)]x1 + [(0.55x1.32e-08) + (0.78x8.68e-08)]x1 = 1e-07 +λ message D --> C + λD(c1) = [p(d1|b1,c1).πD(b1) + p(d1|b2,c1).πD(b2)].λ(d1) + [p(d2|b1,c1).πD(b1) + p(d2|b2,c1).πD(b2)].λ(d2) = [(0.2x5.43e-08) + (0.45x4.57e-08)]x1 + [(0.8x5.43e-08) + (0.55x4.57e-08)]x1 = 1e-07 + λD(c2) = [p(d1|b1,c2).πD(b1) + p(d1|b2,c2).πD(b2)].λ(d1) + [p(d2|b1,c2).πD(b1) + p(d2|b2,c2).πD(b2)].λ(d2) = [(0.7x5.43e-08) + (0.22x4.57e-08)]x1 + [(0.3x5.43e-08) + (0.78x4.57e-08)]x1 = 1e-07 +π message A --> B + πB(a1) = π(a1).λC(a1) = 0.01 x 2e-06 = 2e-08 + πB(a2) = π(a2).λC(a2) = 0.09 x 2e-06 = 1.8e-07 +π message A --> C + πC(a1) = π(a1).λB(a1) = 0.01 x 2e-06 = 2e-08 + πC(a2) = π(a2).λB(a2) = 0.09 x 2e-06 = 1.8e-07 +π message B --> D + πD(b1) = π(b1) = 5.43e-08 = 5.43e-08 + πD(b2) = π(b2) = 4.57e-08 = 4.57e-08 +π message C --> D + πD(c1) = π(c1) = 1.32e-08 = 1.32e-08 + πD(c2) = π(c2) = 8.68e-08 = 8.68e-08 + +updating π & λ values +node A: + π(a1) = p(a1) = (0.01) = 0.01 + π(a2) = p(a2) = (0.09) = 0.09 + λ(a1) = λB(a1).λC(a1) = 2e-06 x 2e-06 = 4e-12 + λ(a2) = λB(a2).λC(a2) = 2e-06 x 2e-06 = 4e-12 + belief change = 0 +node B: + π(b1) = p(b1|a1).πB(a1) + p(b1|a2).πB(a2) = (0.03 x 2e-08) + (0.6 x 1.8e-07) = 1.086e-07 + π(b2) = p(b2|a1).πB(a1) + p(b2|a2).πB(a2) = (0.97 x 2e-08) + (0.4 x 1.8e-07) = 9.14e-08 + λ(b1) = λD(b1) = 1e-07 = 1e-07 + λ(b2) = λD(b2) = 1e-07 = 1e-07 + belief change = 1.110223025e-16 +node C: + π(c1) = p(c1|a1).πC(a1) + p(c1|a2).πC(a2) = (0.24 x 2e-08) + (0.12 x 1.8e-07) = 2.64e-08 + π(c2) = p(c2|a1).πC(a1) + p(c2|a2).πC(a2) = (0.76 x 2e-08) + (0.88 x 1.8e-07) = 1.736e-07 + λ(c1) = λD(c1) = 1e-07 = 1e-07 + λ(c2) = λD(c2) = 1e-07 = 1e-07 + belief change = 2.775557562e-17 +node D: + π(d1) = p(d1|b1,c1).πD(b1).πD(c1) + p(d1|b1,c2).πD(b1).πD(c2) + p(d1|b2,c1).πD(b2).πD(c1) + p(d1|b2,c2).πD(b2).πD(c2) = (0.2 x 5.43e-08 x 1.32e-08) + (0.7 x 5.43e-08 x 8.68e-08) + (0.45 x 4.57e-08 x 1.32e-08) + (0.22 x 4.57e-08 x 8.68e-08) = 4.5867652e-15 + π(d2) = p(d2|b1,c1).πD(b1).πD(c1) + p(d2|b1,c2).πD(b1).πD(c2) + p(d2|b2,c1).πD(b2).πD(c1) + p(d2|b2,c2).πD(b2).πD(c2) = (0.8 x 5.43e-08 x 1.32e-08) + (0.3 x 5.43e-08 x 8.68e-08) + (0.55 x 4.57e-08 x 1.32e-08) + (0.78 x 4.57e-08 x 8.68e-08) = 5.4132348e-15 + λ(d1) = 1 + λ(d2) = 1 + belief change = 0 + + +******************************************************************************** +Iteration 27 +******************************************************************************** + +status of random variable `A': + domain π(A) λ(A) belief +---------------------------------------------------------------- + a1 0.01 4e-12 0.1 + a2 0.09 4e-12 0.9 + + domain πB(A) λB(A) +---------------------------------------------------------------- + a1 2e-08 2e-06 + a2 1.8e-07 2e-06 + + domain πC(A) λC(A) +---------------------------------------------------------------- + a1 2e-08 2e-06 + a2 1.8e-07 2e-06 + + +status of random variable `B': + domain π(B) λ(B) belief +---------------------------------------------------------------- + b1 1.086e-07 1e-07 0.543 + b2 9.14e-08 1e-07 0.457 + + domain πD(B) λD(B) +---------------------------------------------------------------- + b1 5.43e-08 1e-07 + b2 4.57e-08 1e-07 + + +status of random variable `C': + domain π(C) λ(C) belief +---------------------------------------------------------------- + c1 2.64e-08 1e-07 0.132 + c2 1.736e-07 1e-07 0.868 + + domain πD(C) λD(C) +---------------------------------------------------------------- + c1 1.32e-08 1e-07 + c2 8.68e-08 1e-07 + + +status of random variable `D': + domain π(D) λ(D) belief +---------------------------------------------------------------- + d1 4.5867652e-15 1 0.45867652 + d2 5.4132348e-15 1 0.54132348 + +λ message B --> A + λB(a1) = [p(b1|a1)].λ(b1) + [p(b2|a1)].λ(b2) = [(0.03)]x1e-07 + [(0.97)]x1e-07 = 1e-07 + λB(a2) = [p(b1|a2)].λ(b1) + [p(b2|a2)].λ(b2) = [(0.6)]x1e-07 + [(0.4)]x1e-07 = 1e-07 +λ message C --> A + λC(a1) = [p(c1|a1)].λ(c1) + [p(c2|a1)].λ(c2) = [(0.24)]x1e-07 + [(0.76)]x1e-07 = 1e-07 + λC(a2) = [p(c1|a2)].λ(c1) + [p(c2|a2)].λ(c2) = [(0.12)]x1e-07 + [(0.88)]x1e-07 = 1e-07 +λ message D --> B + λD(b1) = [p(d1|b1,c1).πD(c1) + p(d1|b1,c2).πD(c2)].λ(d1) + [p(d2|b1,c1).πD(c1) + p(d2|b1,c2).πD(c2)].λ(d2) = [(0.2x1.32e-08) + (0.7x8.68e-08)]x1 + [(0.8x1.32e-08) + (0.3x8.68e-08)]x1 = 1e-07 + λD(b2) = [p(d1|b2,c1).πD(c1) + p(d1|b2,c2).πD(c2)].λ(d1) + [p(d2|b2,c1).πD(c1) + p(d2|b2,c2).πD(c2)].λ(d2) = [(0.45x1.32e-08) + (0.22x8.68e-08)]x1 + [(0.55x1.32e-08) + (0.78x8.68e-08)]x1 = 1e-07 +λ message D --> C + λD(c1) = [p(d1|b1,c1).πD(b1) + p(d1|b2,c1).πD(b2)].λ(d1) + [p(d2|b1,c1).πD(b1) + p(d2|b2,c1).πD(b2)].λ(d2) = [(0.2x5.43e-08) + (0.45x4.57e-08)]x1 + [(0.8x5.43e-08) + (0.55x4.57e-08)]x1 = 1e-07 + λD(c2) = [p(d1|b1,c2).πD(b1) + p(d1|b2,c2).πD(b2)].λ(d1) + [p(d2|b1,c2).πD(b1) + p(d2|b2,c2).πD(b2)].λ(d2) = [(0.7x5.43e-08) + (0.22x4.57e-08)]x1 + [(0.3x5.43e-08) + (0.78x4.57e-08)]x1 = 1e-07 +π message A --> B + πB(a1) = π(a1).λC(a1) = 0.01 x 2e-06 = 2e-08 + πB(a2) = π(a2).λC(a2) = 0.09 x 2e-06 = 1.8e-07 +π message A --> C + πC(a1) = π(a1).λB(a1) = 0.01 x 2e-06 = 2e-08 + πC(a2) = π(a2).λB(a2) = 0.09 x 2e-06 = 1.8e-07 +π message B --> D + πD(b1) = π(b1) = 1.086e-07 = 1.086e-07 + πD(b2) = π(b2) = 9.14e-08 = 9.14e-08 +π message C --> D + πD(c1) = π(c1) = 2.64e-08 = 2.64e-08 + πD(c2) = π(c2) = 1.736e-07 = 1.736e-07 + +updating π & λ values +node A: + π(a1) = p(a1) = (0.01) = 0.01 + π(a2) = p(a2) = (0.09) = 0.09 + λ(a1) = λB(a1).λC(a1) = 1e-07 x 1e-07 = 1e-14 + λ(a2) = λB(a2).λC(a2) = 1e-07 x 1e-07 = 1e-14 + belief change = 1.249000903e-16 +node B: + π(b1) = p(b1|a1).πB(a1) + p(b1|a2).πB(a2) = (0.03 x 2e-08) + (0.6 x 1.8e-07) = 1.086e-07 + π(b2) = p(b2|a1).πB(a1) + p(b2|a2).πB(a2) = (0.97 x 2e-08) + (0.4 x 1.8e-07) = 9.14e-08 + λ(b1) = λD(b1) = 1e-07 = 1e-07 + λ(b2) = λD(b2) = 1e-07 = 1e-07 + belief change = 0 +node C: + π(c1) = p(c1|a1).πC(a1) + p(c1|a2).πC(a2) = (0.24 x 2e-08) + (0.12 x 1.8e-07) = 2.64e-08 + π(c2) = p(c2|a1).πC(a1) + p(c2|a2).πC(a2) = (0.76 x 2e-08) + (0.88 x 1.8e-07) = 1.736e-07 + λ(c1) = λD(c1) = 1e-07 = 1e-07 + λ(c2) = λD(c2) = 1e-07 = 1e-07 + belief change = 0 +node D: + π(d1) = p(d1|b1,c1).πD(b1).πD(c1) + p(d1|b1,c2).πD(b1).πD(c2) + p(d1|b2,c1).πD(b2).πD(c1) + p(d1|b2,c2).πD(b2).πD(c2) = (0.2 x 1.086e-07 x 2.64e-08) + (0.7 x 1.086e-07 x 1.736e-07) + (0.45 x 9.14e-08 x 2.64e-08) + (0.22 x 9.14e-08 x 1.736e-07) = 1.83470608e-14 + π(d2) = p(d2|b1,c1).πD(b1).πD(c1) + p(d2|b1,c2).πD(b1).πD(c2) + p(d2|b2,c1).πD(b2).πD(c1) + p(d2|b2,c2).πD(b2).πD(c2) = (0.8 x 1.086e-07 x 2.64e-08) + (0.3 x 1.086e-07 x 1.736e-07) + (0.55 x 9.14e-08 x 2.64e-08) + (0.78 x 9.14e-08 x 1.736e-07) = 2.16529392e-14 + λ(d1) = 1 + λ(d2) = 1 + belief change = 0 + + +******************************************************************************** +Iteration 28 +******************************************************************************** + +status of random variable `A': + domain π(A) λ(A) belief +---------------------------------------------------------------- + a1 0.01 1e-14 0.1 + a2 0.09 1e-14 0.9 + + domain πB(A) λB(A) +---------------------------------------------------------------- + a1 2e-08 1e-07 + a2 1.8e-07 1e-07 + + domain πC(A) λC(A) +---------------------------------------------------------------- + a1 2e-08 1e-07 + a2 1.8e-07 1e-07 + + +status of random variable `B': + domain π(B) λ(B) belief +---------------------------------------------------------------- + b1 1.086e-07 1e-07 0.543 + b2 9.14e-08 1e-07 0.457 + + domain πD(B) λD(B) +---------------------------------------------------------------- + b1 1.086e-07 1e-07 + b2 9.14e-08 1e-07 + + +status of random variable `C': + domain π(C) λ(C) belief +---------------------------------------------------------------- + c1 2.64e-08 1e-07 0.132 + c2 1.736e-07 1e-07 0.868 + + domain πD(C) λD(C) +---------------------------------------------------------------- + c1 2.64e-08 1e-07 + c2 1.736e-07 1e-07 + + +status of random variable `D': + domain π(D) λ(D) belief +---------------------------------------------------------------- + d1 1.83470608e-14 1 0.45867652 + d2 2.16529392e-14 1 0.54132348 + +λ message B --> A + λB(a1) = [p(b1|a1)].λ(b1) + [p(b2|a1)].λ(b2) = [(0.03)]x1e-07 + [(0.97)]x1e-07 = 1e-07 + λB(a2) = [p(b1|a2)].λ(b1) + [p(b2|a2)].λ(b2) = [(0.6)]x1e-07 + [(0.4)]x1e-07 = 1e-07 +λ message C --> A + λC(a1) = [p(c1|a1)].λ(c1) + [p(c2|a1)].λ(c2) = [(0.24)]x1e-07 + [(0.76)]x1e-07 = 1e-07 + λC(a2) = [p(c1|a2)].λ(c1) + [p(c2|a2)].λ(c2) = [(0.12)]x1e-07 + [(0.88)]x1e-07 = 1e-07 +λ message D --> B + λD(b1) = [p(d1|b1,c1).πD(c1) + p(d1|b1,c2).πD(c2)].λ(d1) + [p(d2|b1,c1).πD(c1) + p(d2|b1,c2).πD(c2)].λ(d2) = [(0.2x2.64e-08) + (0.7x1.736e-07)]x1 + [(0.8x2.64e-08) + (0.3x1.736e-07)]x1 = 2e-07 + λD(b2) = [p(d1|b2,c1).πD(c1) + p(d1|b2,c2).πD(c2)].λ(d1) + [p(d2|b2,c1).πD(c1) + p(d2|b2,c2).πD(c2)].λ(d2) = [(0.45x2.64e-08) + (0.22x1.736e-07)]x1 + [(0.55x2.64e-08) + (0.78x1.736e-07)]x1 = 2e-07 +λ message D --> C + λD(c1) = [p(d1|b1,c1).πD(b1) + p(d1|b2,c1).πD(b2)].λ(d1) + [p(d2|b1,c1).πD(b1) + p(d2|b2,c1).πD(b2)].λ(d2) = [(0.2x1.086e-07) + (0.45x9.14e-08)]x1 + [(0.8x1.086e-07) + (0.55x9.14e-08)]x1 = 2e-07 + λD(c2) = [p(d1|b1,c2).πD(b1) + p(d1|b2,c2).πD(b2)].λ(d1) + [p(d2|b1,c2).πD(b1) + p(d2|b2,c2).πD(b2)].λ(d2) = [(0.7x1.086e-07) + (0.22x9.14e-08)]x1 + [(0.3x1.086e-07) + (0.78x9.14e-08)]x1 = 2e-07 +π message A --> B + πB(a1) = π(a1).λC(a1) = 0.01 x 1e-07 = 1e-09 + πB(a2) = π(a2).λC(a2) = 0.09 x 1e-07 = 9e-09 +π message A --> C + πC(a1) = π(a1).λB(a1) = 0.01 x 1e-07 = 1e-09 + πC(a2) = π(a2).λB(a2) = 0.09 x 1e-07 = 9e-09 +π message B --> D + πD(b1) = π(b1) = 1.086e-07 = 1.086e-07 + πD(b2) = π(b2) = 9.14e-08 = 9.14e-08 +π message C --> D + πD(c1) = π(c1) = 2.64e-08 = 2.64e-08 + πD(c2) = π(c2) = 1.736e-07 = 1.736e-07 + +updating π & λ values +node A: + π(a1) = p(a1) = (0.01) = 0.01 + π(a2) = p(a2) = (0.09) = 0.09 + λ(a1) = λB(a1).λC(a1) = 1e-07 x 1e-07 = 1e-14 + λ(a2) = λB(a2).λC(a2) = 1e-07 x 1e-07 = 1e-14 + belief change = 0 +node B: + π(b1) = p(b1|a1).πB(a1) + p(b1|a2).πB(a2) = (0.03 x 1e-09) + (0.6 x 9e-09) = 5.43e-09 + π(b2) = p(b2|a1).πB(a1) + p(b2|a2).πB(a2) = (0.97 x 1e-09) + (0.4 x 9e-09) = 4.57e-09 + λ(b1) = λD(b1) = 2e-07 = 2e-07 + λ(b2) = λD(b2) = 2e-07 = 2e-07 + belief change = 5.551115123e-17 +node C: + π(c1) = p(c1|a1).πC(a1) + p(c1|a2).πC(a2) = (0.24 x 1e-09) + (0.12 x 9e-09) = 1.32e-09 + π(c2) = p(c2|a1).πC(a1) + p(c2|a2).πC(a2) = (0.76 x 1e-09) + (0.88 x 9e-09) = 8.68e-09 + λ(c1) = λD(c1) = 2e-07 = 2e-07 + λ(c2) = λD(c2) = 2e-07 = 2e-07 + belief change = 0 +node D: + π(d1) = p(d1|b1,c1).πD(b1).πD(c1) + p(d1|b1,c2).πD(b1).πD(c2) + p(d1|b2,c1).πD(b2).πD(c1) + p(d1|b2,c2).πD(b2).πD(c2) = (0.2 x 1.086e-07 x 2.64e-08) + (0.7 x 1.086e-07 x 1.736e-07) + (0.45 x 9.14e-08 x 2.64e-08) + (0.22 x 9.14e-08 x 1.736e-07) = 1.83470608e-14 + π(d2) = p(d2|b1,c1).πD(b1).πD(c1) + p(d2|b1,c2).πD(b1).πD(c2) + p(d2|b2,c1).πD(b2).πD(c1) + p(d2|b2,c2).πD(b2).πD(c2) = (0.8 x 1.086e-07 x 2.64e-08) + (0.3 x 1.086e-07 x 1.736e-07) + (0.55 x 9.14e-08 x 2.64e-08) + (0.78 x 9.14e-08 x 1.736e-07) = 2.16529392e-14 + λ(d1) = 1 + λ(d2) = 1 + belief change = 0 + + +******************************************************************************** +Iteration 29 +******************************************************************************** + +status of random variable `A': + domain π(A) λ(A) belief +---------------------------------------------------------------- + a1 0.01 1e-14 0.1 + a2 0.09 1e-14 0.9 + + domain πB(A) λB(A) +---------------------------------------------------------------- + a1 1e-09 1e-07 + a2 9e-09 1e-07 + + domain πC(A) λC(A) +---------------------------------------------------------------- + a1 1e-09 1e-07 + a2 9e-09 1e-07 + + +status of random variable `B': + domain π(B) λ(B) belief +---------------------------------------------------------------- + b1 5.43e-09 2e-07 0.543 + b2 4.57e-09 2e-07 0.457 + + domain πD(B) λD(B) +---------------------------------------------------------------- + b1 1.086e-07 2e-07 + b2 9.14e-08 2e-07 + + +status of random variable `C': + domain π(C) λ(C) belief +---------------------------------------------------------------- + c1 1.32e-09 2e-07 0.132 + c2 8.68e-09 2e-07 0.868 + + domain πD(C) λD(C) +---------------------------------------------------------------- + c1 2.64e-08 2e-07 + c2 1.736e-07 2e-07 + + +status of random variable `D': + domain π(D) λ(D) belief +---------------------------------------------------------------- + d1 1.83470608e-14 1 0.45867652 + d2 2.16529392e-14 1 0.54132348 + +λ message B --> A + λB(a1) = [p(b1|a1)].λ(b1) + [p(b2|a1)].λ(b2) = [(0.03)]x2e-07 + [(0.97)]x2e-07 = 2e-07 + λB(a2) = [p(b1|a2)].λ(b1) + [p(b2|a2)].λ(b2) = [(0.6)]x2e-07 + [(0.4)]x2e-07 = 2e-07 +λ message C --> A + λC(a1) = [p(c1|a1)].λ(c1) + [p(c2|a1)].λ(c2) = [(0.24)]x2e-07 + [(0.76)]x2e-07 = 2e-07 + λC(a2) = [p(c1|a2)].λ(c1) + [p(c2|a2)].λ(c2) = [(0.12)]x2e-07 + [(0.88)]x2e-07 = 2e-07 +λ message D --> B + λD(b1) = [p(d1|b1,c1).πD(c1) + p(d1|b1,c2).πD(c2)].λ(d1) + [p(d2|b1,c1).πD(c1) + p(d2|b1,c2).πD(c2)].λ(d2) = [(0.2x2.64e-08) + (0.7x1.736e-07)]x1 + [(0.8x2.64e-08) + (0.3x1.736e-07)]x1 = 2e-07 + λD(b2) = [p(d1|b2,c1).πD(c1) + p(d1|b2,c2).πD(c2)].λ(d1) + [p(d2|b2,c1).πD(c1) + p(d2|b2,c2).πD(c2)].λ(d2) = [(0.45x2.64e-08) + (0.22x1.736e-07)]x1 + [(0.55x2.64e-08) + (0.78x1.736e-07)]x1 = 2e-07 +λ message D --> C + λD(c1) = [p(d1|b1,c1).πD(b1) + p(d1|b2,c1).πD(b2)].λ(d1) + [p(d2|b1,c1).πD(b1) + p(d2|b2,c1).πD(b2)].λ(d2) = [(0.2x1.086e-07) + (0.45x9.14e-08)]x1 + [(0.8x1.086e-07) + (0.55x9.14e-08)]x1 = 2e-07 + λD(c2) = [p(d1|b1,c2).πD(b1) + p(d1|b2,c2).πD(b2)].λ(d1) + [p(d2|b1,c2).πD(b1) + p(d2|b2,c2).πD(b2)].λ(d2) = [(0.7x1.086e-07) + (0.22x9.14e-08)]x1 + [(0.3x1.086e-07) + (0.78x9.14e-08)]x1 = 2e-07 +π message A --> B + πB(a1) = π(a1).λC(a1) = 0.01 x 1e-07 = 1e-09 + πB(a2) = π(a2).λC(a2) = 0.09 x 1e-07 = 9e-09 +π message A --> C + πC(a1) = π(a1).λB(a1) = 0.01 x 1e-07 = 1e-09 + πC(a2) = π(a2).λB(a2) = 0.09 x 1e-07 = 9e-09 +π message B --> D + πD(b1) = π(b1) = 5.43e-09 = 5.43e-09 + πD(b2) = π(b2) = 4.57e-09 = 4.57e-09 +π message C --> D + πD(c1) = π(c1) = 1.32e-09 = 1.32e-09 + πD(c2) = π(c2) = 8.68e-09 = 8.68e-09 + +updating π & λ values +node A: + π(a1) = p(a1) = (0.01) = 0.01 + π(a2) = p(a2) = (0.09) = 0.09 + λ(a1) = λB(a1).λC(a1) = 2e-07 x 2e-07 = 4e-14 + λ(a2) = λB(a2).λC(a2) = 2e-07 x 2e-07 = 4e-14 + belief change = 0 +node B: + π(b1) = p(b1|a1).πB(a1) + p(b1|a2).πB(a2) = (0.03 x 1e-09) + (0.6 x 9e-09) = 5.43e-09 + π(b2) = p(b2|a1).πB(a1) + p(b2|a2).πB(a2) = (0.97 x 1e-09) + (0.4 x 9e-09) = 4.57e-09 + λ(b1) = λD(b1) = 2e-07 = 2e-07 + λ(b2) = λD(b2) = 2e-07 = 2e-07 + belief change = 0 +node C: + π(c1) = p(c1|a1).πC(a1) + p(c1|a2).πC(a2) = (0.24 x 1e-09) + (0.12 x 9e-09) = 1.32e-09 + π(c2) = p(c2|a1).πC(a1) + p(c2|a2).πC(a2) = (0.76 x 1e-09) + (0.88 x 9e-09) = 8.68e-09 + λ(c1) = λD(c1) = 2e-07 = 2e-07 + λ(c2) = λD(c2) = 2e-07 = 2e-07 + belief change = 0 +node D: + π(d1) = p(d1|b1,c1).πD(b1).πD(c1) + p(d1|b1,c2).πD(b1).πD(c2) + p(d1|b2,c1).πD(b2).πD(c1) + p(d1|b2,c2).πD(b2).πD(c2) = (0.2 x 5.43e-09 x 1.32e-09) + (0.7 x 5.43e-09 x 8.68e-09) + (0.45 x 4.57e-09 x 1.32e-09) + (0.22 x 4.57e-09 x 8.68e-09) = 4.5867652e-17 + π(d2) = p(d2|b1,c1).πD(b1).πD(c1) + p(d2|b1,c2).πD(b1).πD(c2) + p(d2|b2,c1).πD(b2).πD(c1) + p(d2|b2,c2).πD(b2).πD(c2) = (0.8 x 5.43e-09 x 1.32e-09) + (0.3 x 5.43e-09 x 8.68e-09) + (0.55 x 4.57e-09 x 1.32e-09) + (0.78 x 4.57e-09 x 8.68e-09) = 5.4132348e-17 + λ(d1) = 1 + λ(d2) = 1 + belief change = 5.551115123e-17 + + +******************************************************************************** +Iteration 30 +******************************************************************************** + +status of random variable `A': + domain π(A) λ(A) belief +---------------------------------------------------------------- + a1 0.01 4e-14 0.1 + a2 0.09 4e-14 0.9 + + domain πB(A) λB(A) +---------------------------------------------------------------- + a1 1e-09 2e-07 + a2 9e-09 2e-07 + + domain πC(A) λC(A) +---------------------------------------------------------------- + a1 1e-09 2e-07 + a2 9e-09 2e-07 + + +status of random variable `B': + domain π(B) λ(B) belief +---------------------------------------------------------------- + b1 5.43e-09 2e-07 0.543 + b2 4.57e-09 2e-07 0.457 + + domain πD(B) λD(B) +---------------------------------------------------------------- + b1 5.43e-09 2e-07 + b2 4.57e-09 2e-07 + + +status of random variable `C': + domain π(C) λ(C) belief +---------------------------------------------------------------- + c1 1.32e-09 2e-07 0.132 + c2 8.68e-09 2e-07 0.868 + + domain πD(C) λD(C) +---------------------------------------------------------------- + c1 1.32e-09 2e-07 + c2 8.68e-09 2e-07 + + +status of random variable `D': + domain π(D) λ(D) belief +---------------------------------------------------------------- + d1 4.5867652e-17 1 0.45867652 + d2 5.4132348e-17 1 0.54132348 + +λ message B --> A + λB(a1) = [p(b1|a1)].λ(b1) + [p(b2|a1)].λ(b2) = [(0.03)]x2e-07 + [(0.97)]x2e-07 = 2e-07 + λB(a2) = [p(b1|a2)].λ(b1) + [p(b2|a2)].λ(b2) = [(0.6)]x2e-07 + [(0.4)]x2e-07 = 2e-07 +λ message C --> A + λC(a1) = [p(c1|a1)].λ(c1) + [p(c2|a1)].λ(c2) = [(0.24)]x2e-07 + [(0.76)]x2e-07 = 2e-07 + λC(a2) = [p(c1|a2)].λ(c1) + [p(c2|a2)].λ(c2) = [(0.12)]x2e-07 + [(0.88)]x2e-07 = 2e-07 +λ message D --> B + λD(b1) = [p(d1|b1,c1).πD(c1) + p(d1|b1,c2).πD(c2)].λ(d1) + [p(d2|b1,c1).πD(c1) + p(d2|b1,c2).πD(c2)].λ(d2) = [(0.2x1.32e-09) + (0.7x8.68e-09)]x1 + [(0.8x1.32e-09) + (0.3x8.68e-09)]x1 = 1e-08 + λD(b2) = [p(d1|b2,c1).πD(c1) + p(d1|b2,c2).πD(c2)].λ(d1) + [p(d2|b2,c1).πD(c1) + p(d2|b2,c2).πD(c2)].λ(d2) = [(0.45x1.32e-09) + (0.22x8.68e-09)]x1 + [(0.55x1.32e-09) + (0.78x8.68e-09)]x1 = 1e-08 +λ message D --> C + λD(c1) = [p(d1|b1,c1).πD(b1) + p(d1|b2,c1).πD(b2)].λ(d1) + [p(d2|b1,c1).πD(b1) + p(d2|b2,c1).πD(b2)].λ(d2) = [(0.2x5.43e-09) + (0.45x4.57e-09)]x1 + [(0.8x5.43e-09) + (0.55x4.57e-09)]x1 = 1e-08 + λD(c2) = [p(d1|b1,c2).πD(b1) + p(d1|b2,c2).πD(b2)].λ(d1) + [p(d2|b1,c2).πD(b1) + p(d2|b2,c2).πD(b2)].λ(d2) = [(0.7x5.43e-09) + (0.22x4.57e-09)]x1 + [(0.3x5.43e-09) + (0.78x4.57e-09)]x1 = 1e-08 +π message A --> B + πB(a1) = π(a1).λC(a1) = 0.01 x 2e-07 = 2e-09 + πB(a2) = π(a2).λC(a2) = 0.09 x 2e-07 = 1.8e-08 +π message A --> C + πC(a1) = π(a1).λB(a1) = 0.01 x 2e-07 = 2e-09 + πC(a2) = π(a2).λB(a2) = 0.09 x 2e-07 = 1.8e-08 +π message B --> D + πD(b1) = π(b1) = 5.43e-09 = 5.43e-09 + πD(b2) = π(b2) = 4.57e-09 = 4.57e-09 +π message C --> D + πD(c1) = π(c1) = 1.32e-09 = 1.32e-09 + πD(c2) = π(c2) = 8.68e-09 = 8.68e-09 + +updating π & λ values +node A: + π(a1) = p(a1) = (0.01) = 0.01 + π(a2) = p(a2) = (0.09) = 0.09 + λ(a1) = λB(a1).λC(a1) = 2e-07 x 2e-07 = 4e-14 + λ(a2) = λB(a2).λC(a2) = 2e-07 x 2e-07 = 4e-14 + belief change = 0 +node B: + π(b1) = p(b1|a1).πB(a1) + p(b1|a2).πB(a2) = (0.03 x 2e-09) + (0.6 x 1.8e-08) = 1.086e-08 + π(b2) = p(b2|a1).πB(a1) + p(b2|a2).πB(a2) = (0.97 x 2e-09) + (0.4 x 1.8e-08) = 9.14e-09 + λ(b1) = λD(b1) = 1e-08 = 1e-08 + λ(b2) = λD(b2) = 1e-08 = 1e-08 + belief change = 2.220446049e-16 +node C: + π(c1) = p(c1|a1).πC(a1) + p(c1|a2).πC(a2) = (0.24 x 2e-09) + (0.12 x 1.8e-08) = 2.64e-09 + π(c2) = p(c2|a1).πC(a1) + p(c2|a2).πC(a2) = (0.76 x 2e-09) + (0.88 x 1.8e-08) = 1.736e-08 + λ(c1) = λD(c1) = 1e-08 = 1e-08 + λ(c2) = λD(c2) = 1e-08 = 1e-08 + belief change = 1.387778781e-16 +node D: + π(d1) = p(d1|b1,c1).πD(b1).πD(c1) + p(d1|b1,c2).πD(b1).πD(c2) + p(d1|b2,c1).πD(b2).πD(c1) + p(d1|b2,c2).πD(b2).πD(c2) = (0.2 x 5.43e-09 x 1.32e-09) + (0.7 x 5.43e-09 x 8.68e-09) + (0.45 x 4.57e-09 x 1.32e-09) + (0.22 x 4.57e-09 x 8.68e-09) = 4.5867652e-17 + π(d2) = p(d2|b1,c1).πD(b1).πD(c1) + p(d2|b1,c2).πD(b1).πD(c2) + p(d2|b2,c1).πD(b2).πD(c1) + p(d2|b2,c2).πD(b2).πD(c2) = (0.8 x 5.43e-09 x 1.32e-09) + (0.3 x 5.43e-09 x 8.68e-09) + (0.55 x 4.57e-09 x 1.32e-09) + (0.78 x 4.57e-09 x 8.68e-09) = 5.4132348e-17 + λ(d1) = 1 + λ(d2) = 1 + belief change = 0 + + +******************************************************************************** +Iteration 31 +******************************************************************************** + +status of random variable `A': + domain π(A) λ(A) belief +---------------------------------------------------------------- + a1 0.01 4e-14 0.1 + a2 0.09 4e-14 0.9 + + domain πB(A) λB(A) +---------------------------------------------------------------- + a1 2e-09 2e-07 + a2 1.8e-08 2e-07 + + domain πC(A) λC(A) +---------------------------------------------------------------- + a1 2e-09 2e-07 + a2 1.8e-08 2e-07 + + +status of random variable `B': + domain π(B) λ(B) belief +---------------------------------------------------------------- + b1 1.086e-08 1e-08 0.543 + b2 9.14e-09 1e-08 0.457 + + domain πD(B) λD(B) +---------------------------------------------------------------- + b1 5.43e-09 1e-08 + b2 4.57e-09 1e-08 + + +status of random variable `C': + domain π(C) λ(C) belief +---------------------------------------------------------------- + c1 2.64e-09 1e-08 0.132 + c2 1.736e-08 1e-08 0.868 + + domain πD(C) λD(C) +---------------------------------------------------------------- + c1 1.32e-09 1e-08 + c2 8.68e-09 1e-08 + + +status of random variable `D': + domain π(D) λ(D) belief +---------------------------------------------------------------- + d1 4.5867652e-17 1 0.45867652 + d2 5.4132348e-17 1 0.54132348 + +λ message B --> A + λB(a1) = [p(b1|a1)].λ(b1) + [p(b2|a1)].λ(b2) = [(0.03)]x1e-08 + [(0.97)]x1e-08 = 1e-08 + λB(a2) = [p(b1|a2)].λ(b1) + [p(b2|a2)].λ(b2) = [(0.6)]x1e-08 + [(0.4)]x1e-08 = 1e-08 +λ message C --> A + λC(a1) = [p(c1|a1)].λ(c1) + [p(c2|a1)].λ(c2) = [(0.24)]x1e-08 + [(0.76)]x1e-08 = 1e-08 + λC(a2) = [p(c1|a2)].λ(c1) + [p(c2|a2)].λ(c2) = [(0.12)]x1e-08 + [(0.88)]x1e-08 = 1e-08 +λ message D --> B + λD(b1) = [p(d1|b1,c1).πD(c1) + p(d1|b1,c2).πD(c2)].λ(d1) + [p(d2|b1,c1).πD(c1) + p(d2|b1,c2).πD(c2)].λ(d2) = [(0.2x1.32e-09) + (0.7x8.68e-09)]x1 + [(0.8x1.32e-09) + (0.3x8.68e-09)]x1 = 1e-08 + λD(b2) = [p(d1|b2,c1).πD(c1) + p(d1|b2,c2).πD(c2)].λ(d1) + [p(d2|b2,c1).πD(c1) + p(d2|b2,c2).πD(c2)].λ(d2) = [(0.45x1.32e-09) + (0.22x8.68e-09)]x1 + [(0.55x1.32e-09) + (0.78x8.68e-09)]x1 = 1e-08 +λ message D --> C + λD(c1) = [p(d1|b1,c1).πD(b1) + p(d1|b2,c1).πD(b2)].λ(d1) + [p(d2|b1,c1).πD(b1) + p(d2|b2,c1).πD(b2)].λ(d2) = [(0.2x5.43e-09) + (0.45x4.57e-09)]x1 + [(0.8x5.43e-09) + (0.55x4.57e-09)]x1 = 1e-08 + λD(c2) = [p(d1|b1,c2).πD(b1) + p(d1|b2,c2).πD(b2)].λ(d1) + [p(d2|b1,c2).πD(b1) + p(d2|b2,c2).πD(b2)].λ(d2) = [(0.7x5.43e-09) + (0.22x4.57e-09)]x1 + [(0.3x5.43e-09) + (0.78x4.57e-09)]x1 = 1e-08 +π message A --> B + πB(a1) = π(a1).λC(a1) = 0.01 x 2e-07 = 2e-09 + πB(a2) = π(a2).λC(a2) = 0.09 x 2e-07 = 1.8e-08 +π message A --> C + πC(a1) = π(a1).λB(a1) = 0.01 x 2e-07 = 2e-09 + πC(a2) = π(a2).λB(a2) = 0.09 x 2e-07 = 1.8e-08 +π message B --> D + πD(b1) = π(b1) = 1.086e-08 = 1.086e-08 + πD(b2) = π(b2) = 9.14e-09 = 9.14e-09 +π message C --> D + πD(c1) = π(c1) = 2.64e-09 = 2.64e-09 + πD(c2) = π(c2) = 1.736e-08 = 1.736e-08 + +updating π & λ values +node A: + π(a1) = p(a1) = (0.01) = 0.01 + π(a2) = p(a2) = (0.09) = 0.09 + λ(a1) = λB(a1).λC(a1) = 1e-08 x 1e-08 = 1e-16 + λ(a2) = λB(a2).λC(a2) = 1e-08 x 1e-08 = 1e-16 + belief change = 1.249000903e-16 +node B: + π(b1) = p(b1|a1).πB(a1) + p(b1|a2).πB(a2) = (0.03 x 2e-09) + (0.6 x 1.8e-08) = 1.086e-08 + π(b2) = p(b2|a1).πB(a1) + p(b2|a2).πB(a2) = (0.97 x 2e-09) + (0.4 x 1.8e-08) = 9.14e-09 + λ(b1) = λD(b1) = 1e-08 = 1e-08 + λ(b2) = λD(b2) = 1e-08 = 1e-08 + belief change = 0 +node C: + π(c1) = p(c1|a1).πC(a1) + p(c1|a2).πC(a2) = (0.24 x 2e-09) + (0.12 x 1.8e-08) = 2.64e-09 + π(c2) = p(c2|a1).πC(a1) + p(c2|a2).πC(a2) = (0.76 x 2e-09) + (0.88 x 1.8e-08) = 1.736e-08 + λ(c1) = λD(c1) = 1e-08 = 1e-08 + λ(c2) = λD(c2) = 1e-08 = 1e-08 + belief change = 0 +node D: + π(d1) = p(d1|b1,c1).πD(b1).πD(c1) + p(d1|b1,c2).πD(b1).πD(c2) + p(d1|b2,c1).πD(b2).πD(c1) + p(d1|b2,c2).πD(b2).πD(c2) = (0.2 x 1.086e-08 x 2.64e-09) + (0.7 x 1.086e-08 x 1.736e-08) + (0.45 x 9.14e-09 x 2.64e-09) + (0.22 x 9.14e-09 x 1.736e-08) = 1.83470608e-16 + π(d2) = p(d2|b1,c1).πD(b1).πD(c1) + p(d2|b1,c2).πD(b1).πD(c2) + p(d2|b2,c1).πD(b2).πD(c1) + p(d2|b2,c2).πD(b2).πD(c2) = (0.8 x 1.086e-08 x 2.64e-09) + (0.3 x 1.086e-08 x 1.736e-08) + (0.55 x 9.14e-09 x 2.64e-09) + (0.78 x 9.14e-09 x 1.736e-08) = 2.16529392e-16 + λ(d1) = 1 + λ(d2) = 1 + belief change = 0 + + +******************************************************************************** +Iteration 32 +******************************************************************************** + +status of random variable `A': + domain π(A) λ(A) belief +---------------------------------------------------------------- + a1 0.01 1e-16 0.1 + a2 0.09 1e-16 0.9 + + domain πB(A) λB(A) +---------------------------------------------------------------- + a1 2e-09 1e-08 + a2 1.8e-08 1e-08 + + domain πC(A) λC(A) +---------------------------------------------------------------- + a1 2e-09 1e-08 + a2 1.8e-08 1e-08 + + +status of random variable `B': + domain π(B) λ(B) belief +---------------------------------------------------------------- + b1 1.086e-08 1e-08 0.543 + b2 9.14e-09 1e-08 0.457 + + domain πD(B) λD(B) +---------------------------------------------------------------- + b1 1.086e-08 1e-08 + b2 9.14e-09 1e-08 + + +status of random variable `C': + domain π(C) λ(C) belief +---------------------------------------------------------------- + c1 2.64e-09 1e-08 0.132 + c2 1.736e-08 1e-08 0.868 + + domain πD(C) λD(C) +---------------------------------------------------------------- + c1 2.64e-09 1e-08 + c2 1.736e-08 1e-08 + + +status of random variable `D': + domain π(D) λ(D) belief +---------------------------------------------------------------- + d1 1.83470608e-16 1 0.45867652 + d2 2.16529392e-16 1 0.54132348 + +λ message B --> A + λB(a1) = [p(b1|a1)].λ(b1) + [p(b2|a1)].λ(b2) = [(0.03)]x1e-08 + [(0.97)]x1e-08 = 1e-08 + λB(a2) = [p(b1|a2)].λ(b1) + [p(b2|a2)].λ(b2) = [(0.6)]x1e-08 + [(0.4)]x1e-08 = 1e-08 +λ message C --> A + λC(a1) = [p(c1|a1)].λ(c1) + [p(c2|a1)].λ(c2) = [(0.24)]x1e-08 + [(0.76)]x1e-08 = 1e-08 + λC(a2) = [p(c1|a2)].λ(c1) + [p(c2|a2)].λ(c2) = [(0.12)]x1e-08 + [(0.88)]x1e-08 = 1e-08 +λ message D --> B + λD(b1) = [p(d1|b1,c1).πD(c1) + p(d1|b1,c2).πD(c2)].λ(d1) + [p(d2|b1,c1).πD(c1) + p(d2|b1,c2).πD(c2)].λ(d2) = [(0.2x2.64e-09) + (0.7x1.736e-08)]x1 + [(0.8x2.64e-09) + (0.3x1.736e-08)]x1 = 2e-08 + λD(b2) = [p(d1|b2,c1).πD(c1) + p(d1|b2,c2).πD(c2)].λ(d1) + [p(d2|b2,c1).πD(c1) + p(d2|b2,c2).πD(c2)].λ(d2) = [(0.45x2.64e-09) + (0.22x1.736e-08)]x1 + [(0.55x2.64e-09) + (0.78x1.736e-08)]x1 = 2e-08 +λ message D --> C + λD(c1) = [p(d1|b1,c1).πD(b1) + p(d1|b2,c1).πD(b2)].λ(d1) + [p(d2|b1,c1).πD(b1) + p(d2|b2,c1).πD(b2)].λ(d2) = [(0.2x1.086e-08) + (0.45x9.14e-09)]x1 + [(0.8x1.086e-08) + (0.55x9.14e-09)]x1 = 2e-08 + λD(c2) = [p(d1|b1,c2).πD(b1) + p(d1|b2,c2).πD(b2)].λ(d1) + [p(d2|b1,c2).πD(b1) + p(d2|b2,c2).πD(b2)].λ(d2) = [(0.7x1.086e-08) + (0.22x9.14e-09)]x1 + [(0.3x1.086e-08) + (0.78x9.14e-09)]x1 = 2e-08 +π message A --> B + πB(a1) = π(a1).λC(a1) = 0.01 x 1e-08 = 1e-10 + πB(a2) = π(a2).λC(a2) = 0.09 x 1e-08 = 9e-10 +π message A --> C + πC(a1) = π(a1).λB(a1) = 0.01 x 1e-08 = 1e-10 + πC(a2) = π(a2).λB(a2) = 0.09 x 1e-08 = 9e-10 +π message B --> D + πD(b1) = π(b1) = 1.086e-08 = 1.086e-08 + πD(b2) = π(b2) = 9.14e-09 = 9.14e-09 +π message C --> D + πD(c1) = π(c1) = 2.64e-09 = 2.64e-09 + πD(c2) = π(c2) = 1.736e-08 = 1.736e-08 + +updating π & λ values +node A: + π(a1) = p(a1) = (0.01) = 0.01 + π(a2) = p(a2) = (0.09) = 0.09 + λ(a1) = λB(a1).λC(a1) = 1e-08 x 1e-08 = 1e-16 + λ(a2) = λB(a2).λC(a2) = 1e-08 x 1e-08 = 1e-16 + belief change = 0 +node B: + π(b1) = p(b1|a1).πB(a1) + p(b1|a2).πB(a2) = (0.03 x 1e-10) + (0.6 x 9e-10) = 5.43e-10 + π(b2) = p(b2|a1).πB(a1) + p(b2|a2).πB(a2) = (0.97 x 1e-10) + (0.4 x 9e-10) = 4.57e-10 + λ(b1) = λD(b1) = 2e-08 = 2e-08 + λ(b2) = λD(b2) = 2e-08 = 2e-08 + belief change = 1.665334537e-16 +node C: + π(c1) = p(c1|a1).πC(a1) + p(c1|a2).πC(a2) = (0.24 x 1e-10) + (0.12 x 9e-10) = 1.32e-10 + π(c2) = p(c2|a1).πC(a1) + p(c2|a2).πC(a2) = (0.76 x 1e-10) + (0.88 x 9e-10) = 8.68e-10 + λ(c1) = λD(c1) = 2e-08 = 2e-08 + λ(c2) = λD(c2) = 2e-08 = 2e-08 + belief change = 1.387778781e-16 +node D: + π(d1) = p(d1|b1,c1).πD(b1).πD(c1) + p(d1|b1,c2).πD(b1).πD(c2) + p(d1|b2,c1).πD(b2).πD(c1) + p(d1|b2,c2).πD(b2).πD(c2) = (0.2 x 1.086e-08 x 2.64e-09) + (0.7 x 1.086e-08 x 1.736e-08) + (0.45 x 9.14e-09 x 2.64e-09) + (0.22 x 9.14e-09 x 1.736e-08) = 1.83470608e-16 + π(d2) = p(d2|b1,c1).πD(b1).πD(c1) + p(d2|b1,c2).πD(b1).πD(c2) + p(d2|b2,c1).πD(b2).πD(c1) + p(d2|b2,c2).πD(b2).πD(c2) = (0.8 x 1.086e-08 x 2.64e-09) + (0.3 x 1.086e-08 x 1.736e-08) + (0.55 x 9.14e-09 x 2.64e-09) + (0.78 x 9.14e-09 x 1.736e-08) = 2.16529392e-16 + λ(d1) = 1 + λ(d2) = 1 + belief change = 0 + + +******************************************************************************** +Iteration 33 +******************************************************************************** + +status of random variable `A': + domain π(A) λ(A) belief +---------------------------------------------------------------- + a1 0.01 1e-16 0.1 + a2 0.09 1e-16 0.9 + + domain πB(A) λB(A) +---------------------------------------------------------------- + a1 1e-10 1e-08 + a2 9e-10 1e-08 + + domain πC(A) λC(A) +---------------------------------------------------------------- + a1 1e-10 1e-08 + a2 9e-10 1e-08 + + +status of random variable `B': + domain π(B) λ(B) belief +---------------------------------------------------------------- + b1 5.43e-10 2e-08 0.543 + b2 4.57e-10 2e-08 0.457 + + domain πD(B) λD(B) +---------------------------------------------------------------- + b1 1.086e-08 2e-08 + b2 9.14e-09 2e-08 + + +status of random variable `C': + domain π(C) λ(C) belief +---------------------------------------------------------------- + c1 1.32e-10 2e-08 0.132 + c2 8.68e-10 2e-08 0.868 + + domain πD(C) λD(C) +---------------------------------------------------------------- + c1 2.64e-09 2e-08 + c2 1.736e-08 2e-08 + + +status of random variable `D': + domain π(D) λ(D) belief +---------------------------------------------------------------- + d1 1.83470608e-16 1 0.45867652 + d2 2.16529392e-16 1 0.54132348 + +λ message B --> A + λB(a1) = [p(b1|a1)].λ(b1) + [p(b2|a1)].λ(b2) = [(0.03)]x2e-08 + [(0.97)]x2e-08 = 2e-08 + λB(a2) = [p(b1|a2)].λ(b1) + [p(b2|a2)].λ(b2) = [(0.6)]x2e-08 + [(0.4)]x2e-08 = 2e-08 +λ message C --> A + λC(a1) = [p(c1|a1)].λ(c1) + [p(c2|a1)].λ(c2) = [(0.24)]x2e-08 + [(0.76)]x2e-08 = 2e-08 + λC(a2) = [p(c1|a2)].λ(c1) + [p(c2|a2)].λ(c2) = [(0.12)]x2e-08 + [(0.88)]x2e-08 = 2e-08 +λ message D --> B + λD(b1) = [p(d1|b1,c1).πD(c1) + p(d1|b1,c2).πD(c2)].λ(d1) + [p(d2|b1,c1).πD(c1) + p(d2|b1,c2).πD(c2)].λ(d2) = [(0.2x2.64e-09) + (0.7x1.736e-08)]x1 + [(0.8x2.64e-09) + (0.3x1.736e-08)]x1 = 2e-08 + λD(b2) = [p(d1|b2,c1).πD(c1) + p(d1|b2,c2).πD(c2)].λ(d1) + [p(d2|b2,c1).πD(c1) + p(d2|b2,c2).πD(c2)].λ(d2) = [(0.45x2.64e-09) + (0.22x1.736e-08)]x1 + [(0.55x2.64e-09) + (0.78x1.736e-08)]x1 = 2e-08 +λ message D --> C + λD(c1) = [p(d1|b1,c1).πD(b1) + p(d1|b2,c1).πD(b2)].λ(d1) + [p(d2|b1,c1).πD(b1) + p(d2|b2,c1).πD(b2)].λ(d2) = [(0.2x1.086e-08) + (0.45x9.14e-09)]x1 + [(0.8x1.086e-08) + (0.55x9.14e-09)]x1 = 2e-08 + λD(c2) = [p(d1|b1,c2).πD(b1) + p(d1|b2,c2).πD(b2)].λ(d1) + [p(d2|b1,c2).πD(b1) + p(d2|b2,c2).πD(b2)].λ(d2) = [(0.7x1.086e-08) + (0.22x9.14e-09)]x1 + [(0.3x1.086e-08) + (0.78x9.14e-09)]x1 = 2e-08 +π message A --> B + πB(a1) = π(a1).λC(a1) = 0.01 x 1e-08 = 1e-10 + πB(a2) = π(a2).λC(a2) = 0.09 x 1e-08 = 9e-10 +π message A --> C + πC(a1) = π(a1).λB(a1) = 0.01 x 1e-08 = 1e-10 + πC(a2) = π(a2).λB(a2) = 0.09 x 1e-08 = 9e-10 +π message B --> D + πD(b1) = π(b1) = 5.43e-10 = 5.43e-10 + πD(b2) = π(b2) = 4.57e-10 = 4.57e-10 +π message C --> D + πD(c1) = π(c1) = 1.32e-10 = 1.32e-10 + πD(c2) = π(c2) = 8.68e-10 = 8.68e-10 + +updating π & λ values +node A: + π(a1) = p(a1) = (0.01) = 0.01 + π(a2) = p(a2) = (0.09) = 0.09 + λ(a1) = λB(a1).λC(a1) = 2e-08 x 2e-08 = 4e-16 + λ(a2) = λB(a2).λC(a2) = 2e-08 x 2e-08 = 4e-16 + belief change = 0 +node B: + π(b1) = p(b1|a1).πB(a1) + p(b1|a2).πB(a2) = (0.03 x 1e-10) + (0.6 x 9e-10) = 5.43e-10 + π(b2) = p(b2|a1).πB(a1) + p(b2|a2).πB(a2) = (0.97 x 1e-10) + (0.4 x 9e-10) = 4.57e-10 + λ(b1) = λD(b1) = 2e-08 = 2e-08 + λ(b2) = λD(b2) = 2e-08 = 2e-08 + belief change = 0 +node C: + π(c1) = p(c1|a1).πC(a1) + p(c1|a2).πC(a2) = (0.24 x 1e-10) + (0.12 x 9e-10) = 1.32e-10 + π(c2) = p(c2|a1).πC(a1) + p(c2|a2).πC(a2) = (0.76 x 1e-10) + (0.88 x 9e-10) = 8.68e-10 + λ(c1) = λD(c1) = 2e-08 = 2e-08 + λ(c2) = λD(c2) = 2e-08 = 2e-08 + belief change = 0 +node D: + π(d1) = p(d1|b1,c1).πD(b1).πD(c1) + p(d1|b1,c2).πD(b1).πD(c2) + p(d1|b2,c1).πD(b2).πD(c1) + p(d1|b2,c2).πD(b2).πD(c2) = (0.2 x 5.43e-10 x 1.32e-10) + (0.7 x 5.43e-10 x 8.68e-10) + (0.45 x 4.57e-10 x 1.32e-10) + (0.22 x 4.57e-10 x 8.68e-10) = 4.5867652e-19 + π(d2) = p(d2|b1,c1).πD(b1).πD(c1) + p(d2|b1,c2).πD(b1).πD(c2) + p(d2|b2,c1).πD(b2).πD(c1) + p(d2|b2,c2).πD(b2).πD(c2) = (0.8 x 5.43e-10 x 1.32e-10) + (0.3 x 5.43e-10 x 8.68e-10) + (0.55 x 4.57e-10 x 1.32e-10) + (0.78 x 4.57e-10 x 8.68e-10) = 5.4132348e-19 + λ(d1) = 1 + λ(d2) = 1 + belief change = 1.665334537e-16 + + +******************************************************************************** +Iteration 34 +******************************************************************************** + +status of random variable `A': + domain π(A) λ(A) belief +---------------------------------------------------------------- + a1 0.01 4e-16 0.1 + a2 0.09 4e-16 0.9 + + domain πB(A) λB(A) +---------------------------------------------------------------- + a1 1e-10 2e-08 + a2 9e-10 2e-08 + + domain πC(A) λC(A) +---------------------------------------------------------------- + a1 1e-10 2e-08 + a2 9e-10 2e-08 + + +status of random variable `B': + domain π(B) λ(B) belief +---------------------------------------------------------------- + b1 5.43e-10 2e-08 0.543 + b2 4.57e-10 2e-08 0.457 + + domain πD(B) λD(B) +---------------------------------------------------------------- + b1 5.43e-10 2e-08 + b2 4.57e-10 2e-08 + + +status of random variable `C': + domain π(C) λ(C) belief +---------------------------------------------------------------- + c1 1.32e-10 2e-08 0.132 + c2 8.68e-10 2e-08 0.868 + + domain πD(C) λD(C) +---------------------------------------------------------------- + c1 1.32e-10 2e-08 + c2 8.68e-10 2e-08 + + +status of random variable `D': + domain π(D) λ(D) belief +---------------------------------------------------------------- + d1 4.5867652e-19 1 0.45867652 + d2 5.4132348e-19 1 0.54132348 + +λ message B --> A + λB(a1) = [p(b1|a1)].λ(b1) + [p(b2|a1)].λ(b2) = [(0.03)]x2e-08 + [(0.97)]x2e-08 = 2e-08 + λB(a2) = [p(b1|a2)].λ(b1) + [p(b2|a2)].λ(b2) = [(0.6)]x2e-08 + [(0.4)]x2e-08 = 2e-08 +λ message C --> A + λC(a1) = [p(c1|a1)].λ(c1) + [p(c2|a1)].λ(c2) = [(0.24)]x2e-08 + [(0.76)]x2e-08 = 2e-08 + λC(a2) = [p(c1|a2)].λ(c1) + [p(c2|a2)].λ(c2) = [(0.12)]x2e-08 + [(0.88)]x2e-08 = 2e-08 +λ message D --> B + λD(b1) = [p(d1|b1,c1).πD(c1) + p(d1|b1,c2).πD(c2)].λ(d1) + [p(d2|b1,c1).πD(c1) + p(d2|b1,c2).πD(c2)].λ(d2) = [(0.2x1.32e-10) + (0.7x8.68e-10)]x1 + [(0.8x1.32e-10) + (0.3x8.68e-10)]x1 = 1e-09 + λD(b2) = [p(d1|b2,c1).πD(c1) + p(d1|b2,c2).πD(c2)].λ(d1) + [p(d2|b2,c1).πD(c1) + p(d2|b2,c2).πD(c2)].λ(d2) = [(0.45x1.32e-10) + (0.22x8.68e-10)]x1 + [(0.55x1.32e-10) + (0.78x8.68e-10)]x1 = 1e-09 +λ message D --> C + λD(c1) = [p(d1|b1,c1).πD(b1) + p(d1|b2,c1).πD(b2)].λ(d1) + [p(d2|b1,c1).πD(b1) + p(d2|b2,c1).πD(b2)].λ(d2) = [(0.2x5.43e-10) + (0.45x4.57e-10)]x1 + [(0.8x5.43e-10) + (0.55x4.57e-10)]x1 = 1e-09 + λD(c2) = [p(d1|b1,c2).πD(b1) + p(d1|b2,c2).πD(b2)].λ(d1) + [p(d2|b1,c2).πD(b1) + p(d2|b2,c2).πD(b2)].λ(d2) = [(0.7x5.43e-10) + (0.22x4.57e-10)]x1 + [(0.3x5.43e-10) + (0.78x4.57e-10)]x1 = 1e-09 +π message A --> B + πB(a1) = π(a1).λC(a1) = 0.01 x 2e-08 = 2e-10 + πB(a2) = π(a2).λC(a2) = 0.09 x 2e-08 = 1.8e-09 +π message A --> C + πC(a1) = π(a1).λB(a1) = 0.01 x 2e-08 = 2e-10 + πC(a2) = π(a2).λB(a2) = 0.09 x 2e-08 = 1.8e-09 +π message B --> D + πD(b1) = π(b1) = 5.43e-10 = 5.43e-10 + πD(b2) = π(b2) = 4.57e-10 = 4.57e-10 +π message C --> D + πD(c1) = π(c1) = 1.32e-10 = 1.32e-10 + πD(c2) = π(c2) = 8.68e-10 = 8.68e-10 + +updating π & λ values +node A: + π(a1) = p(a1) = (0.01) = 0.01 + π(a2) = p(a2) = (0.09) = 0.09 + λ(a1) = λB(a1).λC(a1) = 2e-08 x 2e-08 = 4e-16 + λ(a2) = λB(a2).λC(a2) = 2e-08 x 2e-08 = 4e-16 + belief change = 0 +node B: + π(b1) = p(b1|a1).πB(a1) + p(b1|a2).πB(a2) = (0.03 x 2e-10) + (0.6 x 1.8e-09) = 1.086e-09 + π(b2) = p(b2|a1).πB(a1) + p(b2|a2).πB(a2) = (0.97 x 2e-10) + (0.4 x 1.8e-09) = 9.14e-10 + λ(b1) = λD(b1) = 1e-09 = 1e-09 + λ(b2) = λD(b2) = 1e-09 = 1e-09 + belief change = 1.665334537e-16 +node C: + π(c1) = p(c1|a1).πC(a1) + p(c1|a2).πC(a2) = (0.24 x 2e-10) + (0.12 x 1.8e-09) = 2.64e-10 + π(c2) = p(c2|a1).πC(a1) + p(c2|a2).πC(a2) = (0.76 x 2e-10) + (0.88 x 1.8e-09) = 1.736e-09 + λ(c1) = λD(c1) = 1e-09 = 1e-09 + λ(c2) = λD(c2) = 1e-09 = 1e-09 + belief change = 2.775557562e-17 +node D: + π(d1) = p(d1|b1,c1).πD(b1).πD(c1) + p(d1|b1,c2).πD(b1).πD(c2) + p(d1|b2,c1).πD(b2).πD(c1) + p(d1|b2,c2).πD(b2).πD(c2) = (0.2 x 5.43e-10 x 1.32e-10) + (0.7 x 5.43e-10 x 8.68e-10) + (0.45 x 4.57e-10 x 1.32e-10) + (0.22 x 4.57e-10 x 8.68e-10) = 4.5867652e-19 + π(d2) = p(d2|b1,c1).πD(b1).πD(c1) + p(d2|b1,c2).πD(b1).πD(c2) + p(d2|b2,c1).πD(b2).πD(c1) + p(d2|b2,c2).πD(b2).πD(c2) = (0.8 x 5.43e-10 x 1.32e-10) + (0.3 x 5.43e-10 x 8.68e-10) + (0.55 x 4.57e-10 x 1.32e-10) + (0.78 x 4.57e-10 x 8.68e-10) = 5.4132348e-19 + λ(d1) = 1 + λ(d2) = 1 + belief change = 0 + + +******************************************************************************** +Iteration 35 +******************************************************************************** + +status of random variable `A': + domain π(A) λ(A) belief +---------------------------------------------------------------- + a1 0.01 4e-16 0.1 + a2 0.09 4e-16 0.9 + + domain πB(A) λB(A) +---------------------------------------------------------------- + a1 2e-10 2e-08 + a2 1.8e-09 2e-08 + + domain πC(A) λC(A) +---------------------------------------------------------------- + a1 2e-10 2e-08 + a2 1.8e-09 2e-08 + + +status of random variable `B': + domain π(B) λ(B) belief +---------------------------------------------------------------- + b1 1.086e-09 1e-09 0.543 + b2 9.14e-10 1e-09 0.457 + + domain πD(B) λD(B) +---------------------------------------------------------------- + b1 5.43e-10 1e-09 + b2 4.57e-10 1e-09 + + +status of random variable `C': + domain π(C) λ(C) belief +---------------------------------------------------------------- + c1 2.64e-10 1e-09 0.132 + c2 1.736e-09 1e-09 0.868 + + domain πD(C) λD(C) +---------------------------------------------------------------- + c1 1.32e-10 1e-09 + c2 8.68e-10 1e-09 + + +status of random variable `D': + domain π(D) λ(D) belief +---------------------------------------------------------------- + d1 4.5867652e-19 1 0.45867652 + d2 5.4132348e-19 1 0.54132348 + +λ message B --> A + λB(a1) = [p(b1|a1)].λ(b1) + [p(b2|a1)].λ(b2) = [(0.03)]x1e-09 + [(0.97)]x1e-09 = 1e-09 + λB(a2) = [p(b1|a2)].λ(b1) + [p(b2|a2)].λ(b2) = [(0.6)]x1e-09 + [(0.4)]x1e-09 = 1e-09 +λ message C --> A + λC(a1) = [p(c1|a1)].λ(c1) + [p(c2|a1)].λ(c2) = [(0.24)]x1e-09 + [(0.76)]x1e-09 = 1e-09 + λC(a2) = [p(c1|a2)].λ(c1) + [p(c2|a2)].λ(c2) = [(0.12)]x1e-09 + [(0.88)]x1e-09 = 1e-09 +λ message D --> B + λD(b1) = [p(d1|b1,c1).πD(c1) + p(d1|b1,c2).πD(c2)].λ(d1) + [p(d2|b1,c1).πD(c1) + p(d2|b1,c2).πD(c2)].λ(d2) = [(0.2x1.32e-10) + (0.7x8.68e-10)]x1 + [(0.8x1.32e-10) + (0.3x8.68e-10)]x1 = 1e-09 + λD(b2) = [p(d1|b2,c1).πD(c1) + p(d1|b2,c2).πD(c2)].λ(d1) + [p(d2|b2,c1).πD(c1) + p(d2|b2,c2).πD(c2)].λ(d2) = [(0.45x1.32e-10) + (0.22x8.68e-10)]x1 + [(0.55x1.32e-10) + (0.78x8.68e-10)]x1 = 1e-09 +λ message D --> C + λD(c1) = [p(d1|b1,c1).πD(b1) + p(d1|b2,c1).πD(b2)].λ(d1) + [p(d2|b1,c1).πD(b1) + p(d2|b2,c1).πD(b2)].λ(d2) = [(0.2x5.43e-10) + (0.45x4.57e-10)]x1 + [(0.8x5.43e-10) + (0.55x4.57e-10)]x1 = 1e-09 + λD(c2) = [p(d1|b1,c2).πD(b1) + p(d1|b2,c2).πD(b2)].λ(d1) + [p(d2|b1,c2).πD(b1) + p(d2|b2,c2).πD(b2)].λ(d2) = [(0.7x5.43e-10) + (0.22x4.57e-10)]x1 + [(0.3x5.43e-10) + (0.78x4.57e-10)]x1 = 1e-09 +π message A --> B + πB(a1) = π(a1).λC(a1) = 0.01 x 2e-08 = 2e-10 + πB(a2) = π(a2).λC(a2) = 0.09 x 2e-08 = 1.8e-09 +π message A --> C + πC(a1) = π(a1).λB(a1) = 0.01 x 2e-08 = 2e-10 + πC(a2) = π(a2).λB(a2) = 0.09 x 2e-08 = 1.8e-09 +π message B --> D + πD(b1) = π(b1) = 1.086e-09 = 1.086e-09 + πD(b2) = π(b2) = 9.14e-10 = 9.14e-10 +π message C --> D + πD(c1) = π(c1) = 2.64e-10 = 2.64e-10 + πD(c2) = π(c2) = 1.736e-09 = 1.736e-09 + +updating π & λ values +node A: + π(a1) = p(a1) = (0.01) = 0.01 + π(a2) = p(a2) = (0.09) = 0.09 + λ(a1) = λB(a1).λC(a1) = 1e-09 x 1e-09 = 1e-18 + λ(a2) = λB(a2).λC(a2) = 1e-09 x 1e-09 = 1e-18 + belief change = 0 +node B: + π(b1) = p(b1|a1).πB(a1) + p(b1|a2).πB(a2) = (0.03 x 2e-10) + (0.6 x 1.8e-09) = 1.086e-09 + π(b2) = p(b2|a1).πB(a1) + p(b2|a2).πB(a2) = (0.97 x 2e-10) + (0.4 x 1.8e-09) = 9.14e-10 + λ(b1) = λD(b1) = 1e-09 = 1e-09 + λ(b2) = λD(b2) = 1e-09 = 1e-09 + belief change = 0 +node C: + π(c1) = p(c1|a1).πC(a1) + p(c1|a2).πC(a2) = (0.24 x 2e-10) + (0.12 x 1.8e-09) = 2.64e-10 + π(c2) = p(c2|a1).πC(a1) + p(c2|a2).πC(a2) = (0.76 x 2e-10) + (0.88 x 1.8e-09) = 1.736e-09 + λ(c1) = λD(c1) = 1e-09 = 1e-09 + λ(c2) = λD(c2) = 1e-09 = 1e-09 + belief change = 0 +node D: + π(d1) = p(d1|b1,c1).πD(b1).πD(c1) + p(d1|b1,c2).πD(b1).πD(c2) + p(d1|b2,c1).πD(b2).πD(c1) + p(d1|b2,c2).πD(b2).πD(c2) = (0.2 x 1.086e-09 x 2.64e-10) + (0.7 x 1.086e-09 x 1.736e-09) + (0.45 x 9.14e-10 x 2.64e-10) + (0.22 x 9.14e-10 x 1.736e-09) = 1.83470608e-18 + π(d2) = p(d2|b1,c1).πD(b1).πD(c1) + p(d2|b1,c2).πD(b1).πD(c2) + p(d2|b2,c1).πD(b2).πD(c1) + p(d2|b2,c2).πD(b2).πD(c2) = (0.8 x 1.086e-09 x 2.64e-10) + (0.3 x 1.086e-09 x 1.736e-09) + (0.55 x 9.14e-10 x 2.64e-10) + (0.78 x 9.14e-10 x 1.736e-09) = 2.16529392e-18 + λ(d1) = 1 + λ(d2) = 1 + belief change = 0 + + +******************************************************************************** +Iteration 36 +******************************************************************************** + +status of random variable `A': + domain π(A) λ(A) belief +---------------------------------------------------------------- + a1 0.01 1e-18 0.1 + a2 0.09 1e-18 0.9 + + domain πB(A) λB(A) +---------------------------------------------------------------- + a1 2e-10 1e-09 + a2 1.8e-09 1e-09 + + domain πC(A) λC(A) +---------------------------------------------------------------- + a1 2e-10 1e-09 + a2 1.8e-09 1e-09 + + +status of random variable `B': + domain π(B) λ(B) belief +---------------------------------------------------------------- + b1 1.086e-09 1e-09 0.543 + b2 9.14e-10 1e-09 0.457 + + domain πD(B) λD(B) +---------------------------------------------------------------- + b1 1.086e-09 1e-09 + b2 9.14e-10 1e-09 + + +status of random variable `C': + domain π(C) λ(C) belief +---------------------------------------------------------------- + c1 2.64e-10 1e-09 0.132 + c2 1.736e-09 1e-09 0.868 + + domain πD(C) λD(C) +---------------------------------------------------------------- + c1 2.64e-10 1e-09 + c2 1.736e-09 1e-09 + + +status of random variable `D': + domain π(D) λ(D) belief +---------------------------------------------------------------- + d1 1.83470608e-18 1 0.45867652 + d2 2.16529392e-18 1 0.54132348 + +λ message B --> A + λB(a1) = [p(b1|a1)].λ(b1) + [p(b2|a1)].λ(b2) = [(0.03)]x1e-09 + [(0.97)]x1e-09 = 1e-09 + λB(a2) = [p(b1|a2)].λ(b1) + [p(b2|a2)].λ(b2) = [(0.6)]x1e-09 + [(0.4)]x1e-09 = 1e-09 +λ message C --> A + λC(a1) = [p(c1|a1)].λ(c1) + [p(c2|a1)].λ(c2) = [(0.24)]x1e-09 + [(0.76)]x1e-09 = 1e-09 + λC(a2) = [p(c1|a2)].λ(c1) + [p(c2|a2)].λ(c2) = [(0.12)]x1e-09 + [(0.88)]x1e-09 = 1e-09 +λ message D --> B + λD(b1) = [p(d1|b1,c1).πD(c1) + p(d1|b1,c2).πD(c2)].λ(d1) + [p(d2|b1,c1).πD(c1) + p(d2|b1,c2).πD(c2)].λ(d2) = [(0.2x2.64e-10) + (0.7x1.736e-09)]x1 + [(0.8x2.64e-10) + (0.3x1.736e-09)]x1 = 2e-09 + λD(b2) = [p(d1|b2,c1).πD(c1) + p(d1|b2,c2).πD(c2)].λ(d1) + [p(d2|b2,c1).πD(c1) + p(d2|b2,c2).πD(c2)].λ(d2) = [(0.45x2.64e-10) + (0.22x1.736e-09)]x1 + [(0.55x2.64e-10) + (0.78x1.736e-09)]x1 = 2e-09 +λ message D --> C + λD(c1) = [p(d1|b1,c1).πD(b1) + p(d1|b2,c1).πD(b2)].λ(d1) + [p(d2|b1,c1).πD(b1) + p(d2|b2,c1).πD(b2)].λ(d2) = [(0.2x1.086e-09) + (0.45x9.14e-10)]x1 + [(0.8x1.086e-09) + (0.55x9.14e-10)]x1 = 2e-09 + λD(c2) = [p(d1|b1,c2).πD(b1) + p(d1|b2,c2).πD(b2)].λ(d1) + [p(d2|b1,c2).πD(b1) + p(d2|b2,c2).πD(b2)].λ(d2) = [(0.7x1.086e-09) + (0.22x9.14e-10)]x1 + [(0.3x1.086e-09) + (0.78x9.14e-10)]x1 = 2e-09 +π message A --> B + πB(a1) = π(a1).λC(a1) = 0.01 x 1e-09 = 1e-11 + πB(a2) = π(a2).λC(a2) = 0.09 x 1e-09 = 9e-11 +π message A --> C + πC(a1) = π(a1).λB(a1) = 0.01 x 1e-09 = 1e-11 + πC(a2) = π(a2).λB(a2) = 0.09 x 1e-09 = 9e-11 +π message B --> D + πD(b1) = π(b1) = 1.086e-09 = 1.086e-09 + πD(b2) = π(b2) = 9.14e-10 = 9.14e-10 +π message C --> D + πD(c1) = π(c1) = 2.64e-10 = 2.64e-10 + πD(c2) = π(c2) = 1.736e-09 = 1.736e-09 + +updating π & λ values +node A: + π(a1) = p(a1) = (0.01) = 0.01 + π(a2) = p(a2) = (0.09) = 0.09 + λ(a1) = λB(a1).λC(a1) = 1e-09 x 1e-09 = 1e-18 + λ(a2) = λB(a2).λC(a2) = 1e-09 x 1e-09 = 1e-18 + belief change = 0 +node B: + π(b1) = p(b1|a1).πB(a1) + p(b1|a2).πB(a2) = (0.03 x 1e-11) + (0.6 x 9e-11) = 5.43e-11 + π(b2) = p(b2|a1).πB(a1) + p(b2|a2).πB(a2) = (0.97 x 1e-11) + (0.4 x 9e-11) = 4.57e-11 + λ(b1) = λD(b1) = 2e-09 = 2e-09 + λ(b2) = λD(b2) = 2e-09 = 2e-09 + belief change = 0 +node C: + π(c1) = p(c1|a1).πC(a1) + p(c1|a2).πC(a2) = (0.24 x 1e-11) + (0.12 x 9e-11) = 1.32e-11 + π(c2) = p(c2|a1).πC(a1) + p(c2|a2).πC(a2) = (0.76 x 1e-11) + (0.88 x 9e-11) = 8.68e-11 + λ(c1) = λD(c1) = 2e-09 = 2e-09 + λ(c2) = λD(c2) = 2e-09 = 2e-09 + belief change = 2.775557562e-17 +node D: + π(d1) = p(d1|b1,c1).πD(b1).πD(c1) + p(d1|b1,c2).πD(b1).πD(c2) + p(d1|b2,c1).πD(b2).πD(c1) + p(d1|b2,c2).πD(b2).πD(c2) = (0.2 x 1.086e-09 x 2.64e-10) + (0.7 x 1.086e-09 x 1.736e-09) + (0.45 x 9.14e-10 x 2.64e-10) + (0.22 x 9.14e-10 x 1.736e-09) = 1.83470608e-18 + π(d2) = p(d2|b1,c1).πD(b1).πD(c1) + p(d2|b1,c2).πD(b1).πD(c2) + p(d2|b2,c1).πD(b2).πD(c1) + p(d2|b2,c2).πD(b2).πD(c2) = (0.8 x 1.086e-09 x 2.64e-10) + (0.3 x 1.086e-09 x 1.736e-09) + (0.55 x 9.14e-10 x 2.64e-10) + (0.78 x 9.14e-10 x 1.736e-09) = 2.16529392e-18 + λ(d1) = 1 + λ(d2) = 1 + belief change = 0 + + +******************************************************************************** +Iteration 37 +******************************************************************************** + +status of random variable `A': + domain π(A) λ(A) belief +---------------------------------------------------------------- + a1 0.01 1e-18 0.1 + a2 0.09 1e-18 0.9 + + domain πB(A) λB(A) +---------------------------------------------------------------- + a1 1e-11 1e-09 + a2 9e-11 1e-09 + + domain πC(A) λC(A) +---------------------------------------------------------------- + a1 1e-11 1e-09 + a2 9e-11 1e-09 + + +status of random variable `B': + domain π(B) λ(B) belief +---------------------------------------------------------------- + b1 5.43e-11 2e-09 0.543 + b2 4.57e-11 2e-09 0.457 + + domain πD(B) λD(B) +---------------------------------------------------------------- + b1 1.086e-09 2e-09 + b2 9.14e-10 2e-09 + + +status of random variable `C': + domain π(C) λ(C) belief +---------------------------------------------------------------- + c1 1.32e-11 2e-09 0.132 + c2 8.68e-11 2e-09 0.868 + + domain πD(C) λD(C) +---------------------------------------------------------------- + c1 2.64e-10 2e-09 + c2 1.736e-09 2e-09 + + +status of random variable `D': + domain π(D) λ(D) belief +---------------------------------------------------------------- + d1 1.83470608e-18 1 0.45867652 + d2 2.16529392e-18 1 0.54132348 + +λ message B --> A + λB(a1) = [p(b1|a1)].λ(b1) + [p(b2|a1)].λ(b2) = [(0.03)]x2e-09 + [(0.97)]x2e-09 = 2e-09 + λB(a2) = [p(b1|a2)].λ(b1) + [p(b2|a2)].λ(b2) = [(0.6)]x2e-09 + [(0.4)]x2e-09 = 2e-09 +λ message C --> A + λC(a1) = [p(c1|a1)].λ(c1) + [p(c2|a1)].λ(c2) = [(0.24)]x2e-09 + [(0.76)]x2e-09 = 2e-09 + λC(a2) = [p(c1|a2)].λ(c1) + [p(c2|a2)].λ(c2) = [(0.12)]x2e-09 + [(0.88)]x2e-09 = 2e-09 +λ message D --> B + λD(b1) = [p(d1|b1,c1).πD(c1) + p(d1|b1,c2).πD(c2)].λ(d1) + [p(d2|b1,c1).πD(c1) + p(d2|b1,c2).πD(c2)].λ(d2) = [(0.2x2.64e-10) + (0.7x1.736e-09)]x1 + [(0.8x2.64e-10) + (0.3x1.736e-09)]x1 = 2e-09 + λD(b2) = [p(d1|b2,c1).πD(c1) + p(d1|b2,c2).πD(c2)].λ(d1) + [p(d2|b2,c1).πD(c1) + p(d2|b2,c2).πD(c2)].λ(d2) = [(0.45x2.64e-10) + (0.22x1.736e-09)]x1 + [(0.55x2.64e-10) + (0.78x1.736e-09)]x1 = 2e-09 +λ message D --> C + λD(c1) = [p(d1|b1,c1).πD(b1) + p(d1|b2,c1).πD(b2)].λ(d1) + [p(d2|b1,c1).πD(b1) + p(d2|b2,c1).πD(b2)].λ(d2) = [(0.2x1.086e-09) + (0.45x9.14e-10)]x1 + [(0.8x1.086e-09) + (0.55x9.14e-10)]x1 = 2e-09 + λD(c2) = [p(d1|b1,c2).πD(b1) + p(d1|b2,c2).πD(b2)].λ(d1) + [p(d2|b1,c2).πD(b1) + p(d2|b2,c2).πD(b2)].λ(d2) = [(0.7x1.086e-09) + (0.22x9.14e-10)]x1 + [(0.3x1.086e-09) + (0.78x9.14e-10)]x1 = 2e-09 +π message A --> B + πB(a1) = π(a1).λC(a1) = 0.01 x 1e-09 = 1e-11 + πB(a2) = π(a2).λC(a2) = 0.09 x 1e-09 = 9e-11 +π message A --> C + πC(a1) = π(a1).λB(a1) = 0.01 x 1e-09 = 1e-11 + πC(a2) = π(a2).λB(a2) = 0.09 x 1e-09 = 9e-11 +π message B --> D + πD(b1) = π(b1) = 5.43e-11 = 5.43e-11 + πD(b2) = π(b2) = 4.57e-11 = 4.57e-11 +π message C --> D + πD(c1) = π(c1) = 1.32e-11 = 1.32e-11 + πD(c2) = π(c2) = 8.68e-11 = 8.68e-11 + +updating π & λ values +node A: + π(a1) = p(a1) = (0.01) = 0.01 + π(a2) = p(a2) = (0.09) = 0.09 + λ(a1) = λB(a1).λC(a1) = 2e-09 x 2e-09 = 4e-18 + λ(a2) = λB(a2).λC(a2) = 2e-09 x 2e-09 = 4e-18 + belief change = 0 +node B: + π(b1) = p(b1|a1).πB(a1) + p(b1|a2).πB(a2) = (0.03 x 1e-11) + (0.6 x 9e-11) = 5.43e-11 + π(b2) = p(b2|a1).πB(a1) + p(b2|a2).πB(a2) = (0.97 x 1e-11) + (0.4 x 9e-11) = 4.57e-11 + λ(b1) = λD(b1) = 2e-09 = 2e-09 + λ(b2) = λD(b2) = 2e-09 = 2e-09 + belief change = 0 +node C: + π(c1) = p(c1|a1).πC(a1) + p(c1|a2).πC(a2) = (0.24 x 1e-11) + (0.12 x 9e-11) = 1.32e-11 + π(c2) = p(c2|a1).πC(a1) + p(c2|a2).πC(a2) = (0.76 x 1e-11) + (0.88 x 9e-11) = 8.68e-11 + λ(c1) = λD(c1) = 2e-09 = 2e-09 + λ(c2) = λD(c2) = 2e-09 = 2e-09 + belief change = 0 +node D: + π(d1) = p(d1|b1,c1).πD(b1).πD(c1) + p(d1|b1,c2).πD(b1).πD(c2) + p(d1|b2,c1).πD(b2).πD(c1) + p(d1|b2,c2).πD(b2).πD(c2) = (0.2 x 5.43e-11 x 1.32e-11) + (0.7 x 5.43e-11 x 8.68e-11) + (0.45 x 4.57e-11 x 1.32e-11) + (0.22 x 4.57e-11 x 8.68e-11) = 4.5867652e-21 + π(d2) = p(d2|b1,c1).πD(b1).πD(c1) + p(d2|b1,c2).πD(b1).πD(c2) + p(d2|b2,c1).πD(b2).πD(c1) + p(d2|b2,c2).πD(b2).πD(c2) = (0.8 x 5.43e-11 x 1.32e-11) + (0.3 x 5.43e-11 x 8.68e-11) + (0.55 x 4.57e-11 x 1.32e-11) + (0.78 x 4.57e-11 x 8.68e-11) = 5.4132348e-21 + λ(d1) = 1 + λ(d2) = 1 + belief change = 2.220446049e-16 + + +******************************************************************************** +Iteration 38 +******************************************************************************** + +status of random variable `A': + domain π(A) λ(A) belief +---------------------------------------------------------------- + a1 0.01 4e-18 0.1 + a2 0.09 4e-18 0.9 + + domain πB(A) λB(A) +---------------------------------------------------------------- + a1 1e-11 2e-09 + a2 9e-11 2e-09 + + domain πC(A) λC(A) +---------------------------------------------------------------- + a1 1e-11 2e-09 + a2 9e-11 2e-09 + + +status of random variable `B': + domain π(B) λ(B) belief +---------------------------------------------------------------- + b1 5.43e-11 2e-09 0.543 + b2 4.57e-11 2e-09 0.457 + + domain πD(B) λD(B) +---------------------------------------------------------------- + b1 5.43e-11 2e-09 + b2 4.57e-11 2e-09 + + +status of random variable `C': + domain π(C) λ(C) belief +---------------------------------------------------------------- + c1 1.32e-11 2e-09 0.132 + c2 8.68e-11 2e-09 0.868 + + domain πD(C) λD(C) +---------------------------------------------------------------- + c1 1.32e-11 2e-09 + c2 8.68e-11 2e-09 + + +status of random variable `D': + domain π(D) λ(D) belief +---------------------------------------------------------------- + d1 4.5867652e-21 1 0.45867652 + d2 5.4132348e-21 1 0.54132348 + +λ message B --> A + λB(a1) = [p(b1|a1)].λ(b1) + [p(b2|a1)].λ(b2) = [(0.03)]x2e-09 + [(0.97)]x2e-09 = 2e-09 + λB(a2) = [p(b1|a2)].λ(b1) + [p(b2|a2)].λ(b2) = [(0.6)]x2e-09 + [(0.4)]x2e-09 = 2e-09 +λ message C --> A + λC(a1) = [p(c1|a1)].λ(c1) + [p(c2|a1)].λ(c2) = [(0.24)]x2e-09 + [(0.76)]x2e-09 = 2e-09 + λC(a2) = [p(c1|a2)].λ(c1) + [p(c2|a2)].λ(c2) = [(0.12)]x2e-09 + [(0.88)]x2e-09 = 2e-09 +λ message D --> B + λD(b1) = [p(d1|b1,c1).πD(c1) + p(d1|b1,c2).πD(c2)].λ(d1) + [p(d2|b1,c1).πD(c1) + p(d2|b1,c2).πD(c2)].λ(d2) = [(0.2x1.32e-11) + (0.7x8.68e-11)]x1 + [(0.8x1.32e-11) + (0.3x8.68e-11)]x1 = 1e-10 + λD(b2) = [p(d1|b2,c1).πD(c1) + p(d1|b2,c2).πD(c2)].λ(d1) + [p(d2|b2,c1).πD(c1) + p(d2|b2,c2).πD(c2)].λ(d2) = [(0.45x1.32e-11) + (0.22x8.68e-11)]x1 + [(0.55x1.32e-11) + (0.78x8.68e-11)]x1 = 1e-10 +λ message D --> C + λD(c1) = [p(d1|b1,c1).πD(b1) + p(d1|b2,c1).πD(b2)].λ(d1) + [p(d2|b1,c1).πD(b1) + p(d2|b2,c1).πD(b2)].λ(d2) = [(0.2x5.43e-11) + (0.45x4.57e-11)]x1 + [(0.8x5.43e-11) + (0.55x4.57e-11)]x1 = 1e-10 + λD(c2) = [p(d1|b1,c2).πD(b1) + p(d1|b2,c2).πD(b2)].λ(d1) + [p(d2|b1,c2).πD(b1) + p(d2|b2,c2).πD(b2)].λ(d2) = [(0.7x5.43e-11) + (0.22x4.57e-11)]x1 + [(0.3x5.43e-11) + (0.78x4.57e-11)]x1 = 1e-10 +π message A --> B + πB(a1) = π(a1).λC(a1) = 0.01 x 2e-09 = 2e-11 + πB(a2) = π(a2).λC(a2) = 0.09 x 2e-09 = 1.8e-10 +π message A --> C + πC(a1) = π(a1).λB(a1) = 0.01 x 2e-09 = 2e-11 + πC(a2) = π(a2).λB(a2) = 0.09 x 2e-09 = 1.8e-10 +π message B --> D + πD(b1) = π(b1) = 5.43e-11 = 5.43e-11 + πD(b2) = π(b2) = 4.57e-11 = 4.57e-11 +π message C --> D + πD(c1) = π(c1) = 1.32e-11 = 1.32e-11 + πD(c2) = π(c2) = 8.68e-11 = 8.68e-11 + +updating π & λ values +node A: + π(a1) = p(a1) = (0.01) = 0.01 + π(a2) = p(a2) = (0.09) = 0.09 + λ(a1) = λB(a1).λC(a1) = 2e-09 x 2e-09 = 4e-18 + λ(a2) = λB(a2).λC(a2) = 2e-09 x 2e-09 = 4e-18 + belief change = 0 +node B: + π(b1) = p(b1|a1).πB(a1) + p(b1|a2).πB(a2) = (0.03 x 2e-11) + (0.6 x 1.8e-10) = 1.086e-10 + π(b2) = p(b2|a1).πB(a1) + p(b2|a2).πB(a2) = (0.97 x 2e-11) + (0.4 x 1.8e-10) = 9.14e-11 + λ(b1) = λD(b1) = 1e-10 = 1e-10 + λ(b2) = λD(b2) = 1e-10 = 1e-10 + belief change = 1.110223025e-16 +node C: + π(c1) = p(c1|a1).πC(a1) + p(c1|a2).πC(a2) = (0.24 x 2e-11) + (0.12 x 1.8e-10) = 2.64e-11 + π(c2) = p(c2|a1).πC(a1) + p(c2|a2).πC(a2) = (0.76 x 2e-11) + (0.88 x 1.8e-10) = 1.736e-10 + λ(c1) = λD(c1) = 1e-10 = 1e-10 + λ(c2) = λD(c2) = 1e-10 = 1e-10 + belief change = 2.775557562e-17 +node D: + π(d1) = p(d1|b1,c1).πD(b1).πD(c1) + p(d1|b1,c2).πD(b1).πD(c2) + p(d1|b2,c1).πD(b2).πD(c1) + p(d1|b2,c2).πD(b2).πD(c2) = (0.2 x 5.43e-11 x 1.32e-11) + (0.7 x 5.43e-11 x 8.68e-11) + (0.45 x 4.57e-11 x 1.32e-11) + (0.22 x 4.57e-11 x 8.68e-11) = 4.5867652e-21 + π(d2) = p(d2|b1,c1).πD(b1).πD(c1) + p(d2|b1,c2).πD(b1).πD(c2) + p(d2|b2,c1).πD(b2).πD(c1) + p(d2|b2,c2).πD(b2).πD(c2) = (0.8 x 5.43e-11 x 1.32e-11) + (0.3 x 5.43e-11 x 8.68e-11) + (0.55 x 4.57e-11 x 1.32e-11) + (0.78 x 4.57e-11 x 8.68e-11) = 5.4132348e-21 + λ(d1) = 1 + λ(d2) = 1 + belief change = 0 + + +******************************************************************************** +Iteration 39 +******************************************************************************** + +status of random variable `A': + domain π(A) λ(A) belief +---------------------------------------------------------------- + a1 0.01 4e-18 0.1 + a2 0.09 4e-18 0.9 + + domain πB(A) λB(A) +---------------------------------------------------------------- + a1 2e-11 2e-09 + a2 1.8e-10 2e-09 + + domain πC(A) λC(A) +---------------------------------------------------------------- + a1 2e-11 2e-09 + a2 1.8e-10 2e-09 + + +status of random variable `B': + domain π(B) λ(B) belief +---------------------------------------------------------------- + b1 1.086e-10 1e-10 0.543 + b2 9.14e-11 1e-10 0.457 + + domain πD(B) λD(B) +---------------------------------------------------------------- + b1 5.43e-11 1e-10 + b2 4.57e-11 1e-10 + + +status of random variable `C': + domain π(C) λ(C) belief +---------------------------------------------------------------- + c1 2.64e-11 1e-10 0.132 + c2 1.736e-10 1e-10 0.868 + + domain πD(C) λD(C) +---------------------------------------------------------------- + c1 1.32e-11 1e-10 + c2 8.68e-11 1e-10 + + +status of random variable `D': + domain π(D) λ(D) belief +---------------------------------------------------------------- + d1 4.5867652e-21 1 0.45867652 + d2 5.4132348e-21 1 0.54132348 + +λ message B --> A + λB(a1) = [p(b1|a1)].λ(b1) + [p(b2|a1)].λ(b2) = [(0.03)]x1e-10 + [(0.97)]x1e-10 = 1e-10 + λB(a2) = [p(b1|a2)].λ(b1) + [p(b2|a2)].λ(b2) = [(0.6)]x1e-10 + [(0.4)]x1e-10 = 1e-10 +λ message C --> A + λC(a1) = [p(c1|a1)].λ(c1) + [p(c2|a1)].λ(c2) = [(0.24)]x1e-10 + [(0.76)]x1e-10 = 1e-10 + λC(a2) = [p(c1|a2)].λ(c1) + [p(c2|a2)].λ(c2) = [(0.12)]x1e-10 + [(0.88)]x1e-10 = 1e-10 +λ message D --> B + λD(b1) = [p(d1|b1,c1).πD(c1) + p(d1|b1,c2).πD(c2)].λ(d1) + [p(d2|b1,c1).πD(c1) + p(d2|b1,c2).πD(c2)].λ(d2) = [(0.2x1.32e-11) + (0.7x8.68e-11)]x1 + [(0.8x1.32e-11) + (0.3x8.68e-11)]x1 = 1e-10 + λD(b2) = [p(d1|b2,c1).πD(c1) + p(d1|b2,c2).πD(c2)].λ(d1) + [p(d2|b2,c1).πD(c1) + p(d2|b2,c2).πD(c2)].λ(d2) = [(0.45x1.32e-11) + (0.22x8.68e-11)]x1 + [(0.55x1.32e-11) + (0.78x8.68e-11)]x1 = 1e-10 +λ message D --> C + λD(c1) = [p(d1|b1,c1).πD(b1) + p(d1|b2,c1).πD(b2)].λ(d1) + [p(d2|b1,c1).πD(b1) + p(d2|b2,c1).πD(b2)].λ(d2) = [(0.2x5.43e-11) + (0.45x4.57e-11)]x1 + [(0.8x5.43e-11) + (0.55x4.57e-11)]x1 = 1e-10 + λD(c2) = [p(d1|b1,c2).πD(b1) + p(d1|b2,c2).πD(b2)].λ(d1) + [p(d2|b1,c2).πD(b1) + p(d2|b2,c2).πD(b2)].λ(d2) = [(0.7x5.43e-11) + (0.22x4.57e-11)]x1 + [(0.3x5.43e-11) + (0.78x4.57e-11)]x1 = 1e-10 +π message A --> B + πB(a1) = π(a1).λC(a1) = 0.01 x 2e-09 = 2e-11 + πB(a2) = π(a2).λC(a2) = 0.09 x 2e-09 = 1.8e-10 +π message A --> C + πC(a1) = π(a1).λB(a1) = 0.01 x 2e-09 = 2e-11 + πC(a2) = π(a2).λB(a2) = 0.09 x 2e-09 = 1.8e-10 +π message B --> D + πD(b1) = π(b1) = 1.086e-10 = 1.086e-10 + πD(b2) = π(b2) = 9.14e-11 = 9.14e-11 +π message C --> D + πD(c1) = π(c1) = 2.64e-11 = 2.64e-11 + πD(c2) = π(c2) = 1.736e-10 = 1.736e-10 + +updating π & λ values +node A: + π(a1) = p(a1) = (0.01) = 0.01 + π(a2) = p(a2) = (0.09) = 0.09 + λ(a1) = λB(a1).λC(a1) = 1e-10 x 1e-10 = 1e-20 + λ(a2) = λB(a2).λC(a2) = 1e-10 x 1e-10 = 1e-20 + belief change = 0 +node B: + π(b1) = p(b1|a1).πB(a1) + p(b1|a2).πB(a2) = (0.03 x 2e-11) + (0.6 x 1.8e-10) = 1.086e-10 + π(b2) = p(b2|a1).πB(a1) + p(b2|a2).πB(a2) = (0.97 x 2e-11) + (0.4 x 1.8e-10) = 9.14e-11 + λ(b1) = λD(b1) = 1e-10 = 1e-10 + λ(b2) = λD(b2) = 1e-10 = 1e-10 + belief change = 0 +node C: + π(c1) = p(c1|a1).πC(a1) + p(c1|a2).πC(a2) = (0.24 x 2e-11) + (0.12 x 1.8e-10) = 2.64e-11 + π(c2) = p(c2|a1).πC(a1) + p(c2|a2).πC(a2) = (0.76 x 2e-11) + (0.88 x 1.8e-10) = 1.736e-10 + λ(c1) = λD(c1) = 1e-10 = 1e-10 + λ(c2) = λD(c2) = 1e-10 = 1e-10 + belief change = 0 +node D: + π(d1) = p(d1|b1,c1).πD(b1).πD(c1) + p(d1|b1,c2).πD(b1).πD(c2) + p(d1|b2,c1).πD(b2).πD(c1) + p(d1|b2,c2).πD(b2).πD(c2) = (0.2 x 1.086e-10 x 2.64e-11) + (0.7 x 1.086e-10 x 1.736e-10) + (0.45 x 9.14e-11 x 2.64e-11) + (0.22 x 9.14e-11 x 1.736e-10) = 1.83470608e-20 + π(d2) = p(d2|b1,c1).πD(b1).πD(c1) + p(d2|b1,c2).πD(b1).πD(c2) + p(d2|b2,c1).πD(b2).πD(c1) + p(d2|b2,c2).πD(b2).πD(c2) = (0.8 x 1.086e-10 x 2.64e-11) + (0.3 x 1.086e-10 x 1.736e-10) + (0.55 x 9.14e-11 x 2.64e-11) + (0.78 x 9.14e-11 x 1.736e-10) = 2.16529392e-20 + λ(d1) = 1 + λ(d2) = 1 + belief change = 0 + + +******************************************************************************** +Iteration 40 +******************************************************************************** + +status of random variable `A': + domain π(A) λ(A) belief +---------------------------------------------------------------- + a1 0.01 1e-20 0.1 + a2 0.09 1e-20 0.9 + + domain πB(A) λB(A) +---------------------------------------------------------------- + a1 2e-11 1e-10 + a2 1.8e-10 1e-10 + + domain πC(A) λC(A) +---------------------------------------------------------------- + a1 2e-11 1e-10 + a2 1.8e-10 1e-10 + + +status of random variable `B': + domain π(B) λ(B) belief +---------------------------------------------------------------- + b1 1.086e-10 1e-10 0.543 + b2 9.14e-11 1e-10 0.457 + + domain πD(B) λD(B) +---------------------------------------------------------------- + b1 1.086e-10 1e-10 + b2 9.14e-11 1e-10 + + +status of random variable `C': + domain π(C) λ(C) belief +---------------------------------------------------------------- + c1 2.64e-11 1e-10 0.132 + c2 1.736e-10 1e-10 0.868 + + domain πD(C) λD(C) +---------------------------------------------------------------- + c1 2.64e-11 1e-10 + c2 1.736e-10 1e-10 + + +status of random variable `D': + domain π(D) λ(D) belief +---------------------------------------------------------------- + d1 1.83470608e-20 1 0.45867652 + d2 2.16529392e-20 1 0.54132348 + +λ message B --> A + λB(a1) = [p(b1|a1)].λ(b1) + [p(b2|a1)].λ(b2) = [(0.03)]x1e-10 + [(0.97)]x1e-10 = 1e-10 + λB(a2) = [p(b1|a2)].λ(b1) + [p(b2|a2)].λ(b2) = [(0.6)]x1e-10 + [(0.4)]x1e-10 = 1e-10 +λ message C --> A + λC(a1) = [p(c1|a1)].λ(c1) + [p(c2|a1)].λ(c2) = [(0.24)]x1e-10 + [(0.76)]x1e-10 = 1e-10 + λC(a2) = [p(c1|a2)].λ(c1) + [p(c2|a2)].λ(c2) = [(0.12)]x1e-10 + [(0.88)]x1e-10 = 1e-10 +λ message D --> B + λD(b1) = [p(d1|b1,c1).πD(c1) + p(d1|b1,c2).πD(c2)].λ(d1) + [p(d2|b1,c1).πD(c1) + p(d2|b1,c2).πD(c2)].λ(d2) = [(0.2x2.64e-11) + (0.7x1.736e-10)]x1 + [(0.8x2.64e-11) + (0.3x1.736e-10)]x1 = 2e-10 + λD(b2) = [p(d1|b2,c1).πD(c1) + p(d1|b2,c2).πD(c2)].λ(d1) + [p(d2|b2,c1).πD(c1) + p(d2|b2,c2).πD(c2)].λ(d2) = [(0.45x2.64e-11) + (0.22x1.736e-10)]x1 + [(0.55x2.64e-11) + (0.78x1.736e-10)]x1 = 2e-10 +λ message D --> C + λD(c1) = [p(d1|b1,c1).πD(b1) + p(d1|b2,c1).πD(b2)].λ(d1) + [p(d2|b1,c1).πD(b1) + p(d2|b2,c1).πD(b2)].λ(d2) = [(0.2x1.086e-10) + (0.45x9.14e-11)]x1 + [(0.8x1.086e-10) + (0.55x9.14e-11)]x1 = 2e-10 + λD(c2) = [p(d1|b1,c2).πD(b1) + p(d1|b2,c2).πD(b2)].λ(d1) + [p(d2|b1,c2).πD(b1) + p(d2|b2,c2).πD(b2)].λ(d2) = [(0.7x1.086e-10) + (0.22x9.14e-11)]x1 + [(0.3x1.086e-10) + (0.78x9.14e-11)]x1 = 2e-10 +π message A --> B + πB(a1) = π(a1).λC(a1) = 0.01 x 1e-10 = 1e-12 + πB(a2) = π(a2).λC(a2) = 0.09 x 1e-10 = 9e-12 +π message A --> C + πC(a1) = π(a1).λB(a1) = 0.01 x 1e-10 = 1e-12 + πC(a2) = π(a2).λB(a2) = 0.09 x 1e-10 = 9e-12 +π message B --> D + πD(b1) = π(b1) = 1.086e-10 = 1.086e-10 + πD(b2) = π(b2) = 9.14e-11 = 9.14e-11 +π message C --> D + πD(c1) = π(c1) = 2.64e-11 = 2.64e-11 + πD(c2) = π(c2) = 1.736e-10 = 1.736e-10 + +updating π & λ values +node A: + π(a1) = p(a1) = (0.01) = 0.01 + π(a2) = p(a2) = (0.09) = 0.09 + λ(a1) = λB(a1).λC(a1) = 1e-10 x 1e-10 = 1e-20 + λ(a2) = λB(a2).λC(a2) = 1e-10 x 1e-10 = 1e-20 + belief change = 0 +node B: + π(b1) = p(b1|a1).πB(a1) + p(b1|a2).πB(a2) = (0.03 x 1e-12) + (0.6 x 9e-12) = 5.43e-12 + π(b2) = p(b2|a1).πB(a1) + p(b2|a2).πB(a2) = (0.97 x 1e-12) + (0.4 x 9e-12) = 4.57e-12 + λ(b1) = λD(b1) = 2e-10 = 2e-10 + λ(b2) = λD(b2) = 2e-10 = 2e-10 + belief change = 1.110223025e-16 +node C: + π(c1) = p(c1|a1).πC(a1) + p(c1|a2).πC(a2) = (0.24 x 1e-12) + (0.12 x 9e-12) = 1.32e-12 + π(c2) = p(c2|a1).πC(a1) + p(c2|a2).πC(a2) = (0.76 x 1e-12) + (0.88 x 9e-12) = 8.68e-12 + λ(c1) = λD(c1) = 2e-10 = 2e-10 + λ(c2) = λD(c2) = 2e-10 = 2e-10 + belief change = 2.775557562e-17 +node D: + π(d1) = p(d1|b1,c1).πD(b1).πD(c1) + p(d1|b1,c2).πD(b1).πD(c2) + p(d1|b2,c1).πD(b2).πD(c1) + p(d1|b2,c2).πD(b2).πD(c2) = (0.2 x 1.086e-10 x 2.64e-11) + (0.7 x 1.086e-10 x 1.736e-10) + (0.45 x 9.14e-11 x 2.64e-11) + (0.22 x 9.14e-11 x 1.736e-10) = 1.83470608e-20 + π(d2) = p(d2|b1,c1).πD(b1).πD(c1) + p(d2|b1,c2).πD(b1).πD(c2) + p(d2|b2,c1).πD(b2).πD(c1) + p(d2|b2,c2).πD(b2).πD(c2) = (0.8 x 1.086e-10 x 2.64e-11) + (0.3 x 1.086e-10 x 1.736e-10) + (0.55 x 9.14e-11 x 2.64e-11) + (0.78 x 9.14e-11 x 1.736e-10) = 2.16529392e-20 + λ(d1) = 1 + λ(d2) = 1 + belief change = 0 + + +******************************************************************************** +Iteration 41 +******************************************************************************** + +status of random variable `A': + domain π(A) λ(A) belief +---------------------------------------------------------------- + a1 0.01 1e-20 0.1 + a2 0.09 1e-20 0.9 + + domain πB(A) λB(A) +---------------------------------------------------------------- + a1 1e-12 1e-10 + a2 9e-12 1e-10 + + domain πC(A) λC(A) +---------------------------------------------------------------- + a1 1e-12 1e-10 + a2 9e-12 1e-10 + + +status of random variable `B': + domain π(B) λ(B) belief +---------------------------------------------------------------- + b1 5.43e-12 2e-10 0.543 + b2 4.57e-12 2e-10 0.457 + + domain πD(B) λD(B) +---------------------------------------------------------------- + b1 1.086e-10 2e-10 + b2 9.14e-11 2e-10 + + +status of random variable `C': + domain π(C) λ(C) belief +---------------------------------------------------------------- + c1 1.32e-12 2e-10 0.132 + c2 8.68e-12 2e-10 0.868 + + domain πD(C) λD(C) +---------------------------------------------------------------- + c1 2.64e-11 2e-10 + c2 1.736e-10 2e-10 + + +status of random variable `D': + domain π(D) λ(D) belief +---------------------------------------------------------------- + d1 1.83470608e-20 1 0.45867652 + d2 2.16529392e-20 1 0.54132348 + +λ message B --> A + λB(a1) = [p(b1|a1)].λ(b1) + [p(b2|a1)].λ(b2) = [(0.03)]x2e-10 + [(0.97)]x2e-10 = 2e-10 + λB(a2) = [p(b1|a2)].λ(b1) + [p(b2|a2)].λ(b2) = [(0.6)]x2e-10 + [(0.4)]x2e-10 = 2e-10 +λ message C --> A + λC(a1) = [p(c1|a1)].λ(c1) + [p(c2|a1)].λ(c2) = [(0.24)]x2e-10 + [(0.76)]x2e-10 = 2e-10 + λC(a2) = [p(c1|a2)].λ(c1) + [p(c2|a2)].λ(c2) = [(0.12)]x2e-10 + [(0.88)]x2e-10 = 2e-10 +λ message D --> B + λD(b1) = [p(d1|b1,c1).πD(c1) + p(d1|b1,c2).πD(c2)].λ(d1) + [p(d2|b1,c1).πD(c1) + p(d2|b1,c2).πD(c2)].λ(d2) = [(0.2x2.64e-11) + (0.7x1.736e-10)]x1 + [(0.8x2.64e-11) + (0.3x1.736e-10)]x1 = 2e-10 + λD(b2) = [p(d1|b2,c1).πD(c1) + p(d1|b2,c2).πD(c2)].λ(d1) + [p(d2|b2,c1).πD(c1) + p(d2|b2,c2).πD(c2)].λ(d2) = [(0.45x2.64e-11) + (0.22x1.736e-10)]x1 + [(0.55x2.64e-11) + (0.78x1.736e-10)]x1 = 2e-10 +λ message D --> C + λD(c1) = [p(d1|b1,c1).πD(b1) + p(d1|b2,c1).πD(b2)].λ(d1) + [p(d2|b1,c1).πD(b1) + p(d2|b2,c1).πD(b2)].λ(d2) = [(0.2x1.086e-10) + (0.45x9.14e-11)]x1 + [(0.8x1.086e-10) + (0.55x9.14e-11)]x1 = 2e-10 + λD(c2) = [p(d1|b1,c2).πD(b1) + p(d1|b2,c2).πD(b2)].λ(d1) + [p(d2|b1,c2).πD(b1) + p(d2|b2,c2).πD(b2)].λ(d2) = [(0.7x1.086e-10) + (0.22x9.14e-11)]x1 + [(0.3x1.086e-10) + (0.78x9.14e-11)]x1 = 2e-10 +π message A --> B + πB(a1) = π(a1).λC(a1) = 0.01 x 1e-10 = 1e-12 + πB(a2) = π(a2).λC(a2) = 0.09 x 1e-10 = 9e-12 +π message A --> C + πC(a1) = π(a1).λB(a1) = 0.01 x 1e-10 = 1e-12 + πC(a2) = π(a2).λB(a2) = 0.09 x 1e-10 = 9e-12 +π message B --> D + πD(b1) = π(b1) = 5.43e-12 = 5.43e-12 + πD(b2) = π(b2) = 4.57e-12 = 4.57e-12 +π message C --> D + πD(c1) = π(c1) = 1.32e-12 = 1.32e-12 + πD(c2) = π(c2) = 8.68e-12 = 8.68e-12 + +updating π & λ values +node A: + π(a1) = p(a1) = (0.01) = 0.01 + π(a2) = p(a2) = (0.09) = 0.09 + λ(a1) = λB(a1).λC(a1) = 2e-10 x 2e-10 = 4e-20 + λ(a2) = λB(a2).λC(a2) = 2e-10 x 2e-10 = 4e-20 + belief change = 0 +node B: + π(b1) = p(b1|a1).πB(a1) + p(b1|a2).πB(a2) = (0.03 x 1e-12) + (0.6 x 9e-12) = 5.43e-12 + π(b2) = p(b2|a1).πB(a1) + p(b2|a2).πB(a2) = (0.97 x 1e-12) + (0.4 x 9e-12) = 4.57e-12 + λ(b1) = λD(b1) = 2e-10 = 2e-10 + λ(b2) = λD(b2) = 2e-10 = 2e-10 + belief change = 0 +node C: + π(c1) = p(c1|a1).πC(a1) + p(c1|a2).πC(a2) = (0.24 x 1e-12) + (0.12 x 9e-12) = 1.32e-12 + π(c2) = p(c2|a1).πC(a1) + p(c2|a2).πC(a2) = (0.76 x 1e-12) + (0.88 x 9e-12) = 8.68e-12 + λ(c1) = λD(c1) = 2e-10 = 2e-10 + λ(c2) = λD(c2) = 2e-10 = 2e-10 + belief change = 0 +node D: + π(d1) = p(d1|b1,c1).πD(b1).πD(c1) + p(d1|b1,c2).πD(b1).πD(c2) + p(d1|b2,c1).πD(b2).πD(c1) + p(d1|b2,c2).πD(b2).πD(c2) = (0.2 x 5.43e-12 x 1.32e-12) + (0.7 x 5.43e-12 x 8.68e-12) + (0.45 x 4.57e-12 x 1.32e-12) + (0.22 x 4.57e-12 x 8.68e-12) = 4.5867652e-23 + π(d2) = p(d2|b1,c1).πD(b1).πD(c1) + p(d2|b1,c2).πD(b1).πD(c2) + p(d2|b2,c1).πD(b2).πD(c1) + p(d2|b2,c2).πD(b2).πD(c2) = (0.8 x 5.43e-12 x 1.32e-12) + (0.3 x 5.43e-12 x 8.68e-12) + (0.55 x 4.57e-12 x 1.32e-12) + (0.78 x 4.57e-12 x 8.68e-12) = 5.4132348e-23 + λ(d1) = 1 + λ(d2) = 1 + belief change = 5.551115123e-17 + + +******************************************************************************** +Iteration 42 +******************************************************************************** + +status of random variable `A': + domain π(A) λ(A) belief +---------------------------------------------------------------- + a1 0.01 4e-20 0.1 + a2 0.09 4e-20 0.9 + + domain πB(A) λB(A) +---------------------------------------------------------------- + a1 1e-12 2e-10 + a2 9e-12 2e-10 + + domain πC(A) λC(A) +---------------------------------------------------------------- + a1 1e-12 2e-10 + a2 9e-12 2e-10 + + +status of random variable `B': + domain π(B) λ(B) belief +---------------------------------------------------------------- + b1 5.43e-12 2e-10 0.543 + b2 4.57e-12 2e-10 0.457 + + domain πD(B) λD(B) +---------------------------------------------------------------- + b1 5.43e-12 2e-10 + b2 4.57e-12 2e-10 + + +status of random variable `C': + domain π(C) λ(C) belief +---------------------------------------------------------------- + c1 1.32e-12 2e-10 0.132 + c2 8.68e-12 2e-10 0.868 + + domain πD(C) λD(C) +---------------------------------------------------------------- + c1 1.32e-12 2e-10 + c2 8.68e-12 2e-10 + + +status of random variable `D': + domain π(D) λ(D) belief +---------------------------------------------------------------- + d1 4.5867652e-23 1 0.45867652 + d2 5.4132348e-23 1 0.54132348 + +λ message B --> A + λB(a1) = [p(b1|a1)].λ(b1) + [p(b2|a1)].λ(b2) = [(0.03)]x2e-10 + [(0.97)]x2e-10 = 2e-10 + λB(a2) = [p(b1|a2)].λ(b1) + [p(b2|a2)].λ(b2) = [(0.6)]x2e-10 + [(0.4)]x2e-10 = 2e-10 +λ message C --> A + λC(a1) = [p(c1|a1)].λ(c1) + [p(c2|a1)].λ(c2) = [(0.24)]x2e-10 + [(0.76)]x2e-10 = 2e-10 + λC(a2) = [p(c1|a2)].λ(c1) + [p(c2|a2)].λ(c2) = [(0.12)]x2e-10 + [(0.88)]x2e-10 = 2e-10 +λ message D --> B + λD(b1) = [p(d1|b1,c1).πD(c1) + p(d1|b1,c2).πD(c2)].λ(d1) + [p(d2|b1,c1).πD(c1) + p(d2|b1,c2).πD(c2)].λ(d2) = [(0.2x1.32e-12) + (0.7x8.68e-12)]x1 + [(0.8x1.32e-12) + (0.3x8.68e-12)]x1 = 1e-11 + λD(b2) = [p(d1|b2,c1).πD(c1) + p(d1|b2,c2).πD(c2)].λ(d1) + [p(d2|b2,c1).πD(c1) + p(d2|b2,c2).πD(c2)].λ(d2) = [(0.45x1.32e-12) + (0.22x8.68e-12)]x1 + [(0.55x1.32e-12) + (0.78x8.68e-12)]x1 = 1e-11 +λ message D --> C + λD(c1) = [p(d1|b1,c1).πD(b1) + p(d1|b2,c1).πD(b2)].λ(d1) + [p(d2|b1,c1).πD(b1) + p(d2|b2,c1).πD(b2)].λ(d2) = [(0.2x5.43e-12) + (0.45x4.57e-12)]x1 + [(0.8x5.43e-12) + (0.55x4.57e-12)]x1 = 1e-11 + λD(c2) = [p(d1|b1,c2).πD(b1) + p(d1|b2,c2).πD(b2)].λ(d1) + [p(d2|b1,c2).πD(b1) + p(d2|b2,c2).πD(b2)].λ(d2) = [(0.7x5.43e-12) + (0.22x4.57e-12)]x1 + [(0.3x5.43e-12) + (0.78x4.57e-12)]x1 = 1e-11 +π message A --> B + πB(a1) = π(a1).λC(a1) = 0.01 x 2e-10 = 2e-12 + πB(a2) = π(a2).λC(a2) = 0.09 x 2e-10 = 1.8e-11 +π message A --> C + πC(a1) = π(a1).λB(a1) = 0.01 x 2e-10 = 2e-12 + πC(a2) = π(a2).λB(a2) = 0.09 x 2e-10 = 1.8e-11 +π message B --> D + πD(b1) = π(b1) = 5.43e-12 = 5.43e-12 + πD(b2) = π(b2) = 4.57e-12 = 4.57e-12 +π message C --> D + πD(c1) = π(c1) = 1.32e-12 = 1.32e-12 + πD(c2) = π(c2) = 8.68e-12 = 8.68e-12 + +updating π & λ values +node A: + π(a1) = p(a1) = (0.01) = 0.01 + π(a2) = p(a2) = (0.09) = 0.09 + λ(a1) = λB(a1).λC(a1) = 2e-10 x 2e-10 = 4e-20 + λ(a2) = λB(a2).λC(a2) = 2e-10 x 2e-10 = 4e-20 + belief change = 0 +node B: + π(b1) = p(b1|a1).πB(a1) + p(b1|a2).πB(a2) = (0.03 x 2e-12) + (0.6 x 1.8e-11) = 1.086e-11 + π(b2) = p(b2|a1).πB(a1) + p(b2|a2).πB(a2) = (0.97 x 2e-12) + (0.4 x 1.8e-11) = 9.14e-12 + λ(b1) = λD(b1) = 1e-11 = 1e-11 + λ(b2) = λD(b2) = 1e-11 = 1e-11 + belief change = 0 +node C: + π(c1) = p(c1|a1).πC(a1) + p(c1|a2).πC(a2) = (0.24 x 2e-12) + (0.12 x 1.8e-11) = 2.64e-12 + π(c2) = p(c2|a1).πC(a1) + p(c2|a2).πC(a2) = (0.76 x 2e-12) + (0.88 x 1.8e-11) = 1.736e-11 + λ(c1) = λD(c1) = 1e-11 = 1e-11 + λ(c2) = λD(c2) = 1e-11 = 1e-11 + belief change = 2.775557562e-17 +node D: + π(d1) = p(d1|b1,c1).πD(b1).πD(c1) + p(d1|b1,c2).πD(b1).πD(c2) + p(d1|b2,c1).πD(b2).πD(c1) + p(d1|b2,c2).πD(b2).πD(c2) = (0.2 x 5.43e-12 x 1.32e-12) + (0.7 x 5.43e-12 x 8.68e-12) + (0.45 x 4.57e-12 x 1.32e-12) + (0.22 x 4.57e-12 x 8.68e-12) = 4.5867652e-23 + π(d2) = p(d2|b1,c1).πD(b1).πD(c1) + p(d2|b1,c2).πD(b1).πD(c2) + p(d2|b2,c1).πD(b2).πD(c1) + p(d2|b2,c2).πD(b2).πD(c2) = (0.8 x 5.43e-12 x 1.32e-12) + (0.3 x 5.43e-12 x 8.68e-12) + (0.55 x 4.57e-12 x 1.32e-12) + (0.78 x 4.57e-12 x 8.68e-12) = 5.4132348e-23 + λ(d1) = 1 + λ(d2) = 1 + belief change = 0 + + +******************************************************************************** +Iteration 43 +******************************************************************************** + +status of random variable `A': + domain π(A) λ(A) belief +---------------------------------------------------------------- + a1 0.01 4e-20 0.1 + a2 0.09 4e-20 0.9 + + domain πB(A) λB(A) +---------------------------------------------------------------- + a1 2e-12 2e-10 + a2 1.8e-11 2e-10 + + domain πC(A) λC(A) +---------------------------------------------------------------- + a1 2e-12 2e-10 + a2 1.8e-11 2e-10 + + +status of random variable `B': + domain π(B) λ(B) belief +---------------------------------------------------------------- + b1 1.086e-11 1e-11 0.543 + b2 9.14e-12 1e-11 0.457 + + domain πD(B) λD(B) +---------------------------------------------------------------- + b1 5.43e-12 1e-11 + b2 4.57e-12 1e-11 + + +status of random variable `C': + domain π(C) λ(C) belief +---------------------------------------------------------------- + c1 2.64e-12 1e-11 0.132 + c2 1.736e-11 1e-11 0.868 + + domain πD(C) λD(C) +---------------------------------------------------------------- + c1 1.32e-12 1e-11 + c2 8.68e-12 1e-11 + + +status of random variable `D': + domain π(D) λ(D) belief +---------------------------------------------------------------- + d1 4.5867652e-23 1 0.45867652 + d2 5.4132348e-23 1 0.54132348 + +λ message B --> A + λB(a1) = [p(b1|a1)].λ(b1) + [p(b2|a1)].λ(b2) = [(0.03)]x1e-11 + [(0.97)]x1e-11 = 1e-11 + λB(a2) = [p(b1|a2)].λ(b1) + [p(b2|a2)].λ(b2) = [(0.6)]x1e-11 + [(0.4)]x1e-11 = 1e-11 +λ message C --> A + λC(a1) = [p(c1|a1)].λ(c1) + [p(c2|a1)].λ(c2) = [(0.24)]x1e-11 + [(0.76)]x1e-11 = 1e-11 + λC(a2) = [p(c1|a2)].λ(c1) + [p(c2|a2)].λ(c2) = [(0.12)]x1e-11 + [(0.88)]x1e-11 = 1e-11 +λ message D --> B + λD(b1) = [p(d1|b1,c1).πD(c1) + p(d1|b1,c2).πD(c2)].λ(d1) + [p(d2|b1,c1).πD(c1) + p(d2|b1,c2).πD(c2)].λ(d2) = [(0.2x1.32e-12) + (0.7x8.68e-12)]x1 + [(0.8x1.32e-12) + (0.3x8.68e-12)]x1 = 1e-11 + λD(b2) = [p(d1|b2,c1).πD(c1) + p(d1|b2,c2).πD(c2)].λ(d1) + [p(d2|b2,c1).πD(c1) + p(d2|b2,c2).πD(c2)].λ(d2) = [(0.45x1.32e-12) + (0.22x8.68e-12)]x1 + [(0.55x1.32e-12) + (0.78x8.68e-12)]x1 = 1e-11 +λ message D --> C + λD(c1) = [p(d1|b1,c1).πD(b1) + p(d1|b2,c1).πD(b2)].λ(d1) + [p(d2|b1,c1).πD(b1) + p(d2|b2,c1).πD(b2)].λ(d2) = [(0.2x5.43e-12) + (0.45x4.57e-12)]x1 + [(0.8x5.43e-12) + (0.55x4.57e-12)]x1 = 1e-11 + λD(c2) = [p(d1|b1,c2).πD(b1) + p(d1|b2,c2).πD(b2)].λ(d1) + [p(d2|b1,c2).πD(b1) + p(d2|b2,c2).πD(b2)].λ(d2) = [(0.7x5.43e-12) + (0.22x4.57e-12)]x1 + [(0.3x5.43e-12) + (0.78x4.57e-12)]x1 = 1e-11 +π message A --> B + πB(a1) = π(a1).λC(a1) = 0.01 x 2e-10 = 2e-12 + πB(a2) = π(a2).λC(a2) = 0.09 x 2e-10 = 1.8e-11 +π message A --> C + πC(a1) = π(a1).λB(a1) = 0.01 x 2e-10 = 2e-12 + πC(a2) = π(a2).λB(a2) = 0.09 x 2e-10 = 1.8e-11 +π message B --> D + πD(b1) = π(b1) = 1.086e-11 = 1.086e-11 + πD(b2) = π(b2) = 9.14e-12 = 9.14e-12 +π message C --> D + πD(c1) = π(c1) = 2.64e-12 = 2.64e-12 + πD(c2) = π(c2) = 1.736e-11 = 1.736e-11 + +updating π & λ values +node A: + π(a1) = p(a1) = (0.01) = 0.01 + π(a2) = p(a2) = (0.09) = 0.09 + λ(a1) = λB(a1).λC(a1) = 1e-11 x 1e-11 = 1e-22 + λ(a2) = λB(a2).λC(a2) = 1e-11 x 1e-11 = 1e-22 + belief change = 1.110223025e-16 +node B: + π(b1) = p(b1|a1).πB(a1) + p(b1|a2).πB(a2) = (0.03 x 2e-12) + (0.6 x 1.8e-11) = 1.086e-11 + π(b2) = p(b2|a1).πB(a1) + p(b2|a2).πB(a2) = (0.97 x 2e-12) + (0.4 x 1.8e-11) = 9.14e-12 + λ(b1) = λD(b1) = 1e-11 = 1e-11 + λ(b2) = λD(b2) = 1e-11 = 1e-11 + belief change = 0 +node C: + π(c1) = p(c1|a1).πC(a1) + p(c1|a2).πC(a2) = (0.24 x 2e-12) + (0.12 x 1.8e-11) = 2.64e-12 + π(c2) = p(c2|a1).πC(a1) + p(c2|a2).πC(a2) = (0.76 x 2e-12) + (0.88 x 1.8e-11) = 1.736e-11 + λ(c1) = λD(c1) = 1e-11 = 1e-11 + λ(c2) = λD(c2) = 1e-11 = 1e-11 + belief change = 0 +node D: + π(d1) = p(d1|b1,c1).πD(b1).πD(c1) + p(d1|b1,c2).πD(b1).πD(c2) + p(d1|b2,c1).πD(b2).πD(c1) + p(d1|b2,c2).πD(b2).πD(c2) = (0.2 x 1.086e-11 x 2.64e-12) + (0.7 x 1.086e-11 x 1.736e-11) + (0.45 x 9.14e-12 x 2.64e-12) + (0.22 x 9.14e-12 x 1.736e-11) = 1.83470608e-22 + π(d2) = p(d2|b1,c1).πD(b1).πD(c1) + p(d2|b1,c2).πD(b1).πD(c2) + p(d2|b2,c1).πD(b2).πD(c1) + p(d2|b2,c2).πD(b2).πD(c2) = (0.8 x 1.086e-11 x 2.64e-12) + (0.3 x 1.086e-11 x 1.736e-11) + (0.55 x 9.14e-12 x 2.64e-12) + (0.78 x 9.14e-12 x 1.736e-11) = 2.16529392e-22 + λ(d1) = 1 + λ(d2) = 1 + belief change = 0 + + +******************************************************************************** +Iteration 44 +******************************************************************************** + +status of random variable `A': + domain π(A) λ(A) belief +---------------------------------------------------------------- + a1 0.01 1e-22 0.1 + a2 0.09 1e-22 0.9 + + domain πB(A) λB(A) +---------------------------------------------------------------- + a1 2e-12 1e-11 + a2 1.8e-11 1e-11 + + domain πC(A) λC(A) +---------------------------------------------------------------- + a1 2e-12 1e-11 + a2 1.8e-11 1e-11 + + +status of random variable `B': + domain π(B) λ(B) belief +---------------------------------------------------------------- + b1 1.086e-11 1e-11 0.543 + b2 9.14e-12 1e-11 0.457 + + domain πD(B) λD(B) +---------------------------------------------------------------- + b1 1.086e-11 1e-11 + b2 9.14e-12 1e-11 + + +status of random variable `C': + domain π(C) λ(C) belief +---------------------------------------------------------------- + c1 2.64e-12 1e-11 0.132 + c2 1.736e-11 1e-11 0.868 + + domain πD(C) λD(C) +---------------------------------------------------------------- + c1 2.64e-12 1e-11 + c2 1.736e-11 1e-11 + + +status of random variable `D': + domain π(D) λ(D) belief +---------------------------------------------------------------- + d1 1.83470608e-22 1 0.45867652 + d2 2.16529392e-22 1 0.54132348 + +λ message B --> A + λB(a1) = [p(b1|a1)].λ(b1) + [p(b2|a1)].λ(b2) = [(0.03)]x1e-11 + [(0.97)]x1e-11 = 1e-11 + λB(a2) = [p(b1|a2)].λ(b1) + [p(b2|a2)].λ(b2) = [(0.6)]x1e-11 + [(0.4)]x1e-11 = 1e-11 +λ message C --> A + λC(a1) = [p(c1|a1)].λ(c1) + [p(c2|a1)].λ(c2) = [(0.24)]x1e-11 + [(0.76)]x1e-11 = 1e-11 + λC(a2) = [p(c1|a2)].λ(c1) + [p(c2|a2)].λ(c2) = [(0.12)]x1e-11 + [(0.88)]x1e-11 = 1e-11 +λ message D --> B + λD(b1) = [p(d1|b1,c1).πD(c1) + p(d1|b1,c2).πD(c2)].λ(d1) + [p(d2|b1,c1).πD(c1) + p(d2|b1,c2).πD(c2)].λ(d2) = [(0.2x2.64e-12) + (0.7x1.736e-11)]x1 + [(0.8x2.64e-12) + (0.3x1.736e-11)]x1 = 2e-11 + λD(b2) = [p(d1|b2,c1).πD(c1) + p(d1|b2,c2).πD(c2)].λ(d1) + [p(d2|b2,c1).πD(c1) + p(d2|b2,c2).πD(c2)].λ(d2) = [(0.45x2.64e-12) + (0.22x1.736e-11)]x1 + [(0.55x2.64e-12) + (0.78x1.736e-11)]x1 = 2e-11 +λ message D --> C + λD(c1) = [p(d1|b1,c1).πD(b1) + p(d1|b2,c1).πD(b2)].λ(d1) + [p(d2|b1,c1).πD(b1) + p(d2|b2,c1).πD(b2)].λ(d2) = [(0.2x1.086e-11) + (0.45x9.14e-12)]x1 + [(0.8x1.086e-11) + (0.55x9.14e-12)]x1 = 2e-11 + λD(c2) = [p(d1|b1,c2).πD(b1) + p(d1|b2,c2).πD(b2)].λ(d1) + [p(d2|b1,c2).πD(b1) + p(d2|b2,c2).πD(b2)].λ(d2) = [(0.7x1.086e-11) + (0.22x9.14e-12)]x1 + [(0.3x1.086e-11) + (0.78x9.14e-12)]x1 = 2e-11 +π message A --> B + πB(a1) = π(a1).λC(a1) = 0.01 x 1e-11 = 1e-13 + πB(a2) = π(a2).λC(a2) = 0.09 x 1e-11 = 9e-13 +π message A --> C + πC(a1) = π(a1).λB(a1) = 0.01 x 1e-11 = 1e-13 + πC(a2) = π(a2).λB(a2) = 0.09 x 1e-11 = 9e-13 +π message B --> D + πD(b1) = π(b1) = 1.086e-11 = 1.086e-11 + πD(b2) = π(b2) = 9.14e-12 = 9.14e-12 +π message C --> D + πD(c1) = π(c1) = 2.64e-12 = 2.64e-12 + πD(c2) = π(c2) = 1.736e-11 = 1.736e-11 + +updating π & λ values +node A: + π(a1) = p(a1) = (0.01) = 0.01 + π(a2) = p(a2) = (0.09) = 0.09 + λ(a1) = λB(a1).λC(a1) = 1e-11 x 1e-11 = 1e-22 + λ(a2) = λB(a2).λC(a2) = 1e-11 x 1e-11 = 1e-22 + belief change = 0 +node B: + π(b1) = p(b1|a1).πB(a1) + p(b1|a2).πB(a2) = (0.03 x 1e-13) + (0.6 x 9e-13) = 5.43e-13 + π(b2) = p(b2|a1).πB(a1) + p(b2|a2).πB(a2) = (0.97 x 1e-13) + (0.4 x 9e-13) = 4.57e-13 + λ(b1) = λD(b1) = 2e-11 = 2e-11 + λ(b2) = λD(b2) = 2e-11 = 2e-11 + belief change = 5.551115123e-17 +node C: + π(c1) = p(c1|a1).πC(a1) + p(c1|a2).πC(a2) = (0.24 x 1e-13) + (0.12 x 9e-13) = 1.32e-13 + π(c2) = p(c2|a1).πC(a1) + p(c2|a2).πC(a2) = (0.76 x 1e-13) + (0.88 x 9e-13) = 8.68e-13 + λ(c1) = λD(c1) = 2e-11 = 2e-11 + λ(c2) = λD(c2) = 2e-11 = 2e-11 + belief change = 0 +node D: + π(d1) = p(d1|b1,c1).πD(b1).πD(c1) + p(d1|b1,c2).πD(b1).πD(c2) + p(d1|b2,c1).πD(b2).πD(c1) + p(d1|b2,c2).πD(b2).πD(c2) = (0.2 x 1.086e-11 x 2.64e-12) + (0.7 x 1.086e-11 x 1.736e-11) + (0.45 x 9.14e-12 x 2.64e-12) + (0.22 x 9.14e-12 x 1.736e-11) = 1.83470608e-22 + π(d2) = p(d2|b1,c1).πD(b1).πD(c1) + p(d2|b1,c2).πD(b1).πD(c2) + p(d2|b2,c1).πD(b2).πD(c1) + p(d2|b2,c2).πD(b2).πD(c2) = (0.8 x 1.086e-11 x 2.64e-12) + (0.3 x 1.086e-11 x 1.736e-11) + (0.55 x 9.14e-12 x 2.64e-12) + (0.78 x 9.14e-12 x 1.736e-11) = 2.16529392e-22 + λ(d1) = 1 + λ(d2) = 1 + belief change = 0 + + +******************************************************************************** +Iteration 45 +******************************************************************************** + +status of random variable `A': + domain π(A) λ(A) belief +---------------------------------------------------------------- + a1 0.01 1e-22 0.1 + a2 0.09 1e-22 0.9 + + domain πB(A) λB(A) +---------------------------------------------------------------- + a1 1e-13 1e-11 + a2 9e-13 1e-11 + + domain πC(A) λC(A) +---------------------------------------------------------------- + a1 1e-13 1e-11 + a2 9e-13 1e-11 + + +status of random variable `B': + domain π(B) λ(B) belief +---------------------------------------------------------------- + b1 5.43e-13 2e-11 0.543 + b2 4.57e-13 2e-11 0.457 + + domain πD(B) λD(B) +---------------------------------------------------------------- + b1 1.086e-11 2e-11 + b2 9.14e-12 2e-11 + + +status of random variable `C': + domain π(C) λ(C) belief +---------------------------------------------------------------- + c1 1.32e-13 2e-11 0.132 + c2 8.68e-13 2e-11 0.868 + + domain πD(C) λD(C) +---------------------------------------------------------------- + c1 2.64e-12 2e-11 + c2 1.736e-11 2e-11 + + +status of random variable `D': + domain π(D) λ(D) belief +---------------------------------------------------------------- + d1 1.83470608e-22 1 0.45867652 + d2 2.16529392e-22 1 0.54132348 + +λ message B --> A + λB(a1) = [p(b1|a1)].λ(b1) + [p(b2|a1)].λ(b2) = [(0.03)]x2e-11 + [(0.97)]x2e-11 = 2e-11 + λB(a2) = [p(b1|a2)].λ(b1) + [p(b2|a2)].λ(b2) = [(0.6)]x2e-11 + [(0.4)]x2e-11 = 2e-11 +λ message C --> A + λC(a1) = [p(c1|a1)].λ(c1) + [p(c2|a1)].λ(c2) = [(0.24)]x2e-11 + [(0.76)]x2e-11 = 2e-11 + λC(a2) = [p(c1|a2)].λ(c1) + [p(c2|a2)].λ(c2) = [(0.12)]x2e-11 + [(0.88)]x2e-11 = 2e-11 +λ message D --> B + λD(b1) = [p(d1|b1,c1).πD(c1) + p(d1|b1,c2).πD(c2)].λ(d1) + [p(d2|b1,c1).πD(c1) + p(d2|b1,c2).πD(c2)].λ(d2) = [(0.2x2.64e-12) + (0.7x1.736e-11)]x1 + [(0.8x2.64e-12) + (0.3x1.736e-11)]x1 = 2e-11 + λD(b2) = [p(d1|b2,c1).πD(c1) + p(d1|b2,c2).πD(c2)].λ(d1) + [p(d2|b2,c1).πD(c1) + p(d2|b2,c2).πD(c2)].λ(d2) = [(0.45x2.64e-12) + (0.22x1.736e-11)]x1 + [(0.55x2.64e-12) + (0.78x1.736e-11)]x1 = 2e-11 +λ message D --> C + λD(c1) = [p(d1|b1,c1).πD(b1) + p(d1|b2,c1).πD(b2)].λ(d1) + [p(d2|b1,c1).πD(b1) + p(d2|b2,c1).πD(b2)].λ(d2) = [(0.2x1.086e-11) + (0.45x9.14e-12)]x1 + [(0.8x1.086e-11) + (0.55x9.14e-12)]x1 = 2e-11 + λD(c2) = [p(d1|b1,c2).πD(b1) + p(d1|b2,c2).πD(b2)].λ(d1) + [p(d2|b1,c2).πD(b1) + p(d2|b2,c2).πD(b2)].λ(d2) = [(0.7x1.086e-11) + (0.22x9.14e-12)]x1 + [(0.3x1.086e-11) + (0.78x9.14e-12)]x1 = 2e-11 +π message A --> B + πB(a1) = π(a1).λC(a1) = 0.01 x 1e-11 = 1e-13 + πB(a2) = π(a2).λC(a2) = 0.09 x 1e-11 = 9e-13 +π message A --> C + πC(a1) = π(a1).λB(a1) = 0.01 x 1e-11 = 1e-13 + πC(a2) = π(a2).λB(a2) = 0.09 x 1e-11 = 9e-13 +π message B --> D + πD(b1) = π(b1) = 5.43e-13 = 5.43e-13 + πD(b2) = π(b2) = 4.57e-13 = 4.57e-13 +π message C --> D + πD(c1) = π(c1) = 1.32e-13 = 1.32e-13 + πD(c2) = π(c2) = 8.68e-13 = 8.68e-13 + +updating π & λ values +node A: + π(a1) = p(a1) = (0.01) = 0.01 + π(a2) = p(a2) = (0.09) = 0.09 + λ(a1) = λB(a1).λC(a1) = 2e-11 x 2e-11 = 4e-22 + λ(a2) = λB(a2).λC(a2) = 2e-11 x 2e-11 = 4e-22 + belief change = 0 +node B: + π(b1) = p(b1|a1).πB(a1) + p(b1|a2).πB(a2) = (0.03 x 1e-13) + (0.6 x 9e-13) = 5.43e-13 + π(b2) = p(b2|a1).πB(a1) + p(b2|a2).πB(a2) = (0.97 x 1e-13) + (0.4 x 9e-13) = 4.57e-13 + λ(b1) = λD(b1) = 2e-11 = 2e-11 + λ(b2) = λD(b2) = 2e-11 = 2e-11 + belief change = 0 +node C: + π(c1) = p(c1|a1).πC(a1) + p(c1|a2).πC(a2) = (0.24 x 1e-13) + (0.12 x 9e-13) = 1.32e-13 + π(c2) = p(c2|a1).πC(a1) + p(c2|a2).πC(a2) = (0.76 x 1e-13) + (0.88 x 9e-13) = 8.68e-13 + λ(c1) = λD(c1) = 2e-11 = 2e-11 + λ(c2) = λD(c2) = 2e-11 = 2e-11 + belief change = 0 +node D: + π(d1) = p(d1|b1,c1).πD(b1).πD(c1) + p(d1|b1,c2).πD(b1).πD(c2) + p(d1|b2,c1).πD(b2).πD(c1) + p(d1|b2,c2).πD(b2).πD(c2) = (0.2 x 5.43e-13 x 1.32e-13) + (0.7 x 5.43e-13 x 8.68e-13) + (0.45 x 4.57e-13 x 1.32e-13) + (0.22 x 4.57e-13 x 8.68e-13) = 4.5867652e-25 + π(d2) = p(d2|b1,c1).πD(b1).πD(c1) + p(d2|b1,c2).πD(b1).πD(c2) + p(d2|b2,c1).πD(b2).πD(c1) + p(d2|b2,c2).πD(b2).πD(c2) = (0.8 x 5.43e-13 x 1.32e-13) + (0.3 x 5.43e-13 x 8.68e-13) + (0.55 x 4.57e-13 x 1.32e-13) + (0.78 x 4.57e-13 x 8.68e-13) = 5.4132348e-25 + λ(d1) = 1 + λ(d2) = 1 + belief change = 1.665334537e-16 + + +******************************************************************************** +Iteration 46 +******************************************************************************** + +status of random variable `A': + domain π(A) λ(A) belief +---------------------------------------------------------------- + a1 0.01 4e-22 0.1 + a2 0.09 4e-22 0.9 + + domain πB(A) λB(A) +---------------------------------------------------------------- + a1 1e-13 2e-11 + a2 9e-13 2e-11 + + domain πC(A) λC(A) +---------------------------------------------------------------- + a1 1e-13 2e-11 + a2 9e-13 2e-11 + + +status of random variable `B': + domain π(B) λ(B) belief +---------------------------------------------------------------- + b1 5.43e-13 2e-11 0.543 + b2 4.57e-13 2e-11 0.457 + + domain πD(B) λD(B) +---------------------------------------------------------------- + b1 5.43e-13 2e-11 + b2 4.57e-13 2e-11 + + +status of random variable `C': + domain π(C) λ(C) belief +---------------------------------------------------------------- + c1 1.32e-13 2e-11 0.132 + c2 8.68e-13 2e-11 0.868 + + domain πD(C) λD(C) +---------------------------------------------------------------- + c1 1.32e-13 2e-11 + c2 8.68e-13 2e-11 + + +status of random variable `D': + domain π(D) λ(D) belief +---------------------------------------------------------------- + d1 4.5867652e-25 1 0.45867652 + d2 5.4132348e-25 1 0.54132348 + +λ message B --> A + λB(a1) = [p(b1|a1)].λ(b1) + [p(b2|a1)].λ(b2) = [(0.03)]x2e-11 + [(0.97)]x2e-11 = 2e-11 + λB(a2) = [p(b1|a2)].λ(b1) + [p(b2|a2)].λ(b2) = [(0.6)]x2e-11 + [(0.4)]x2e-11 = 2e-11 +λ message C --> A + λC(a1) = [p(c1|a1)].λ(c1) + [p(c2|a1)].λ(c2) = [(0.24)]x2e-11 + [(0.76)]x2e-11 = 2e-11 + λC(a2) = [p(c1|a2)].λ(c1) + [p(c2|a2)].λ(c2) = [(0.12)]x2e-11 + [(0.88)]x2e-11 = 2e-11 +λ message D --> B + λD(b1) = [p(d1|b1,c1).πD(c1) + p(d1|b1,c2).πD(c2)].λ(d1) + [p(d2|b1,c1).πD(c1) + p(d2|b1,c2).πD(c2)].λ(d2) = [(0.2x1.32e-13) + (0.7x8.68e-13)]x1 + [(0.8x1.32e-13) + (0.3x8.68e-13)]x1 = 1e-12 + λD(b2) = [p(d1|b2,c1).πD(c1) + p(d1|b2,c2).πD(c2)].λ(d1) + [p(d2|b2,c1).πD(c1) + p(d2|b2,c2).πD(c2)].λ(d2) = [(0.45x1.32e-13) + (0.22x8.68e-13)]x1 + [(0.55x1.32e-13) + (0.78x8.68e-13)]x1 = 1e-12 +λ message D --> C + λD(c1) = [p(d1|b1,c1).πD(b1) + p(d1|b2,c1).πD(b2)].λ(d1) + [p(d2|b1,c1).πD(b1) + p(d2|b2,c1).πD(b2)].λ(d2) = [(0.2x5.43e-13) + (0.45x4.57e-13)]x1 + [(0.8x5.43e-13) + (0.55x4.57e-13)]x1 = 1e-12 + λD(c2) = [p(d1|b1,c2).πD(b1) + p(d1|b2,c2).πD(b2)].λ(d1) + [p(d2|b1,c2).πD(b1) + p(d2|b2,c2).πD(b2)].λ(d2) = [(0.7x5.43e-13) + (0.22x4.57e-13)]x1 + [(0.3x5.43e-13) + (0.78x4.57e-13)]x1 = 1e-12 +π message A --> B + πB(a1) = π(a1).λC(a1) = 0.01 x 2e-11 = 2e-13 + πB(a2) = π(a2).λC(a2) = 0.09 x 2e-11 = 1.8e-12 +π message A --> C + πC(a1) = π(a1).λB(a1) = 0.01 x 2e-11 = 2e-13 + πC(a2) = π(a2).λB(a2) = 0.09 x 2e-11 = 1.8e-12 +π message B --> D + πD(b1) = π(b1) = 5.43e-13 = 5.43e-13 + πD(b2) = π(b2) = 4.57e-13 = 4.57e-13 +π message C --> D + πD(c1) = π(c1) = 1.32e-13 = 1.32e-13 + πD(c2) = π(c2) = 8.68e-13 = 8.68e-13 + +updating π & λ values +node A: + π(a1) = p(a1) = (0.01) = 0.01 + π(a2) = p(a2) = (0.09) = 0.09 + λ(a1) = λB(a1).λC(a1) = 2e-11 x 2e-11 = 4e-22 + λ(a2) = λB(a2).λC(a2) = 2e-11 x 2e-11 = 4e-22 + belief change = 0 +node B: + π(b1) = p(b1|a1).πB(a1) + p(b1|a2).πB(a2) = (0.03 x 2e-13) + (0.6 x 1.8e-12) = 1.086e-12 + π(b2) = p(b2|a1).πB(a1) + p(b2|a2).πB(a2) = (0.97 x 2e-13) + (0.4 x 1.8e-12) = 9.14e-13 + λ(b1) = λD(b1) = 1e-12 = 1e-12 + λ(b2) = λD(b2) = 1e-12 = 1e-12 + belief change = 2.775557562e-16 +node C: + π(c1) = p(c1|a1).πC(a1) + p(c1|a2).πC(a2) = (0.24 x 2e-13) + (0.12 x 1.8e-12) = 2.64e-13 + π(c2) = p(c2|a1).πC(a1) + p(c2|a2).πC(a2) = (0.76 x 2e-13) + (0.88 x 1.8e-12) = 1.736e-12 + λ(c1) = λD(c1) = 1e-12 = 1e-12 + λ(c2) = λD(c2) = 1e-12 = 1e-12 + belief change = 2.775557562e-17 +node D: + π(d1) = p(d1|b1,c1).πD(b1).πD(c1) + p(d1|b1,c2).πD(b1).πD(c2) + p(d1|b2,c1).πD(b2).πD(c1) + p(d1|b2,c2).πD(b2).πD(c2) = (0.2 x 5.43e-13 x 1.32e-13) + (0.7 x 5.43e-13 x 8.68e-13) + (0.45 x 4.57e-13 x 1.32e-13) + (0.22 x 4.57e-13 x 8.68e-13) = 4.5867652e-25 + π(d2) = p(d2|b1,c1).πD(b1).πD(c1) + p(d2|b1,c2).πD(b1).πD(c2) + p(d2|b2,c1).πD(b2).πD(c1) + p(d2|b2,c2).πD(b2).πD(c2) = (0.8 x 5.43e-13 x 1.32e-13) + (0.3 x 5.43e-13 x 8.68e-13) + (0.55 x 4.57e-13 x 1.32e-13) + (0.78 x 4.57e-13 x 8.68e-13) = 5.4132348e-25 + λ(d1) = 1 + λ(d2) = 1 + belief change = 0 + + +******************************************************************************** +Iteration 47 +******************************************************************************** + +status of random variable `A': + domain π(A) λ(A) belief +---------------------------------------------------------------- + a1 0.01 4e-22 0.1 + a2 0.09 4e-22 0.9 + + domain πB(A) λB(A) +---------------------------------------------------------------- + a1 2e-13 2e-11 + a2 1.8e-12 2e-11 + + domain πC(A) λC(A) +---------------------------------------------------------------- + a1 2e-13 2e-11 + a2 1.8e-12 2e-11 + + +status of random variable `B': + domain π(B) λ(B) belief +---------------------------------------------------------------- + b1 1.086e-12 1e-12 0.543 + b2 9.14e-13 1e-12 0.457 + + domain πD(B) λD(B) +---------------------------------------------------------------- + b1 5.43e-13 1e-12 + b2 4.57e-13 1e-12 + + +status of random variable `C': + domain π(C) λ(C) belief +---------------------------------------------------------------- + c1 2.64e-13 1e-12 0.132 + c2 1.736e-12 1e-12 0.868 + + domain πD(C) λD(C) +---------------------------------------------------------------- + c1 1.32e-13 1e-12 + c2 8.68e-13 1e-12 + + +status of random variable `D': + domain π(D) λ(D) belief +---------------------------------------------------------------- + d1 4.5867652e-25 1 0.45867652 + d2 5.4132348e-25 1 0.54132348 + +λ message B --> A + λB(a1) = [p(b1|a1)].λ(b1) + [p(b2|a1)].λ(b2) = [(0.03)]x1e-12 + [(0.97)]x1e-12 = 1e-12 + λB(a2) = [p(b1|a2)].λ(b1) + [p(b2|a2)].λ(b2) = [(0.6)]x1e-12 + [(0.4)]x1e-12 = 1e-12 +λ message C --> A + λC(a1) = [p(c1|a1)].λ(c1) + [p(c2|a1)].λ(c2) = [(0.24)]x1e-12 + [(0.76)]x1e-12 = 1e-12 + λC(a2) = [p(c1|a2)].λ(c1) + [p(c2|a2)].λ(c2) = [(0.12)]x1e-12 + [(0.88)]x1e-12 = 1e-12 +λ message D --> B + λD(b1) = [p(d1|b1,c1).πD(c1) + p(d1|b1,c2).πD(c2)].λ(d1) + [p(d2|b1,c1).πD(c1) + p(d2|b1,c2).πD(c2)].λ(d2) = [(0.2x1.32e-13) + (0.7x8.68e-13)]x1 + [(0.8x1.32e-13) + (0.3x8.68e-13)]x1 = 1e-12 + λD(b2) = [p(d1|b2,c1).πD(c1) + p(d1|b2,c2).πD(c2)].λ(d1) + [p(d2|b2,c1).πD(c1) + p(d2|b2,c2).πD(c2)].λ(d2) = [(0.45x1.32e-13) + (0.22x8.68e-13)]x1 + [(0.55x1.32e-13) + (0.78x8.68e-13)]x1 = 1e-12 +λ message D --> C + λD(c1) = [p(d1|b1,c1).πD(b1) + p(d1|b2,c1).πD(b2)].λ(d1) + [p(d2|b1,c1).πD(b1) + p(d2|b2,c1).πD(b2)].λ(d2) = [(0.2x5.43e-13) + (0.45x4.57e-13)]x1 + [(0.8x5.43e-13) + (0.55x4.57e-13)]x1 = 1e-12 + λD(c2) = [p(d1|b1,c2).πD(b1) + p(d1|b2,c2).πD(b2)].λ(d1) + [p(d2|b1,c2).πD(b1) + p(d2|b2,c2).πD(b2)].λ(d2) = [(0.7x5.43e-13) + (0.22x4.57e-13)]x1 + [(0.3x5.43e-13) + (0.78x4.57e-13)]x1 = 1e-12 +π message A --> B + πB(a1) = π(a1).λC(a1) = 0.01 x 2e-11 = 2e-13 + πB(a2) = π(a2).λC(a2) = 0.09 x 2e-11 = 1.8e-12 +π message A --> C + πC(a1) = π(a1).λB(a1) = 0.01 x 2e-11 = 2e-13 + πC(a2) = π(a2).λB(a2) = 0.09 x 2e-11 = 1.8e-12 +π message B --> D + πD(b1) = π(b1) = 1.086e-12 = 1.086e-12 + πD(b2) = π(b2) = 9.14e-13 = 9.14e-13 +π message C --> D + πD(c1) = π(c1) = 2.64e-13 = 2.64e-13 + πD(c2) = π(c2) = 1.736e-12 = 1.736e-12 + +updating π & λ values +node A: + π(a1) = p(a1) = (0.01) = 0.01 + π(a2) = p(a2) = (0.09) = 0.09 + λ(a1) = λB(a1).λC(a1) = 1e-12 x 1e-12 = 1e-24 + λ(a2) = λB(a2).λC(a2) = 1e-12 x 1e-12 = 1e-24 + belief change = 1.110223025e-16 +node B: + π(b1) = p(b1|a1).πB(a1) + p(b1|a2).πB(a2) = (0.03 x 2e-13) + (0.6 x 1.8e-12) = 1.086e-12 + π(b2) = p(b2|a1).πB(a1) + p(b2|a2).πB(a2) = (0.97 x 2e-13) + (0.4 x 1.8e-12) = 9.14e-13 + λ(b1) = λD(b1) = 1e-12 = 1e-12 + λ(b2) = λD(b2) = 1e-12 = 1e-12 + belief change = 0 +node C: + π(c1) = p(c1|a1).πC(a1) + p(c1|a2).πC(a2) = (0.24 x 2e-13) + (0.12 x 1.8e-12) = 2.64e-13 + π(c2) = p(c2|a1).πC(a1) + p(c2|a2).πC(a2) = (0.76 x 2e-13) + (0.88 x 1.8e-12) = 1.736e-12 + λ(c1) = λD(c1) = 1e-12 = 1e-12 + λ(c2) = λD(c2) = 1e-12 = 1e-12 + belief change = 0 +node D: + π(d1) = p(d1|b1,c1).πD(b1).πD(c1) + p(d1|b1,c2).πD(b1).πD(c2) + p(d1|b2,c1).πD(b2).πD(c1) + p(d1|b2,c2).πD(b2).πD(c2) = (0.2 x 1.086e-12 x 2.64e-13) + (0.7 x 1.086e-12 x 1.736e-12) + (0.45 x 9.14e-13 x 2.64e-13) + (0.22 x 9.14e-13 x 1.736e-12) = 1.83470608e-24 + π(d2) = p(d2|b1,c1).πD(b1).πD(c1) + p(d2|b1,c2).πD(b1).πD(c2) + p(d2|b2,c1).πD(b2).πD(c1) + p(d2|b2,c2).πD(b2).πD(c2) = (0.8 x 1.086e-12 x 2.64e-13) + (0.3 x 1.086e-12 x 1.736e-12) + (0.55 x 9.14e-13 x 2.64e-13) + (0.78 x 9.14e-13 x 1.736e-12) = 2.16529392e-24 + λ(d1) = 1 + λ(d2) = 1 + belief change = 0 + + +******************************************************************************** +Iteration 48 +******************************************************************************** + +status of random variable `A': + domain π(A) λ(A) belief +---------------------------------------------------------------- + a1 0.01 1e-24 0.1 + a2 0.09 1e-24 0.9 + + domain πB(A) λB(A) +---------------------------------------------------------------- + a1 2e-13 1e-12 + a2 1.8e-12 1e-12 + + domain πC(A) λC(A) +---------------------------------------------------------------- + a1 2e-13 1e-12 + a2 1.8e-12 1e-12 + + +status of random variable `B': + domain π(B) λ(B) belief +---------------------------------------------------------------- + b1 1.086e-12 1e-12 0.543 + b2 9.14e-13 1e-12 0.457 + + domain πD(B) λD(B) +---------------------------------------------------------------- + b1 1.086e-12 1e-12 + b2 9.14e-13 1e-12 + + +status of random variable `C': + domain π(C) λ(C) belief +---------------------------------------------------------------- + c1 2.64e-13 1e-12 0.132 + c2 1.736e-12 1e-12 0.868 + + domain πD(C) λD(C) +---------------------------------------------------------------- + c1 2.64e-13 1e-12 + c2 1.736e-12 1e-12 + + +status of random variable `D': + domain π(D) λ(D) belief +---------------------------------------------------------------- + d1 1.83470608e-24 1 0.45867652 + d2 2.16529392e-24 1 0.54132348 + +λ message B --> A + λB(a1) = [p(b1|a1)].λ(b1) + [p(b2|a1)].λ(b2) = [(0.03)]x1e-12 + [(0.97)]x1e-12 = 1e-12 + λB(a2) = [p(b1|a2)].λ(b1) + [p(b2|a2)].λ(b2) = [(0.6)]x1e-12 + [(0.4)]x1e-12 = 1e-12 +λ message C --> A + λC(a1) = [p(c1|a1)].λ(c1) + [p(c2|a1)].λ(c2) = [(0.24)]x1e-12 + [(0.76)]x1e-12 = 1e-12 + λC(a2) = [p(c1|a2)].λ(c1) + [p(c2|a2)].λ(c2) = [(0.12)]x1e-12 + [(0.88)]x1e-12 = 1e-12 +λ message D --> B + λD(b1) = [p(d1|b1,c1).πD(c1) + p(d1|b1,c2).πD(c2)].λ(d1) + [p(d2|b1,c1).πD(c1) + p(d2|b1,c2).πD(c2)].λ(d2) = [(0.2x2.64e-13) + (0.7x1.736e-12)]x1 + [(0.8x2.64e-13) + (0.3x1.736e-12)]x1 = 2e-12 + λD(b2) = [p(d1|b2,c1).πD(c1) + p(d1|b2,c2).πD(c2)].λ(d1) + [p(d2|b2,c1).πD(c1) + p(d2|b2,c2).πD(c2)].λ(d2) = [(0.45x2.64e-13) + (0.22x1.736e-12)]x1 + [(0.55x2.64e-13) + (0.78x1.736e-12)]x1 = 2e-12 +λ message D --> C + λD(c1) = [p(d1|b1,c1).πD(b1) + p(d1|b2,c1).πD(b2)].λ(d1) + [p(d2|b1,c1).πD(b1) + p(d2|b2,c1).πD(b2)].λ(d2) = [(0.2x1.086e-12) + (0.45x9.14e-13)]x1 + [(0.8x1.086e-12) + (0.55x9.14e-13)]x1 = 2e-12 + λD(c2) = [p(d1|b1,c2).πD(b1) + p(d1|b2,c2).πD(b2)].λ(d1) + [p(d2|b1,c2).πD(b1) + p(d2|b2,c2).πD(b2)].λ(d2) = [(0.7x1.086e-12) + (0.22x9.14e-13)]x1 + [(0.3x1.086e-12) + (0.78x9.14e-13)]x1 = 2e-12 +π message A --> B + πB(a1) = π(a1).λC(a1) = 0.01 x 1e-12 = 1e-14 + πB(a2) = π(a2).λC(a2) = 0.09 x 1e-12 = 9e-14 +π message A --> C + πC(a1) = π(a1).λB(a1) = 0.01 x 1e-12 = 1e-14 + πC(a2) = π(a2).λB(a2) = 0.09 x 1e-12 = 9e-14 +π message B --> D + πD(b1) = π(b1) = 1.086e-12 = 1.086e-12 + πD(b2) = π(b2) = 9.14e-13 = 9.14e-13 +π message C --> D + πD(c1) = π(c1) = 2.64e-13 = 2.64e-13 + πD(c2) = π(c2) = 1.736e-12 = 1.736e-12 + +updating π & λ values +node A: + π(a1) = p(a1) = (0.01) = 0.01 + π(a2) = p(a2) = (0.09) = 0.09 + λ(a1) = λB(a1).λC(a1) = 1e-12 x 1e-12 = 1e-24 + λ(a2) = λB(a2).λC(a2) = 1e-12 x 1e-12 = 1e-24 + belief change = 0 +node B: + π(b1) = p(b1|a1).πB(a1) + p(b1|a2).πB(a2) = (0.03 x 1e-14) + (0.6 x 9e-14) = 5.43e-14 + π(b2) = p(b2|a1).πB(a1) + p(b2|a2).πB(a2) = (0.97 x 1e-14) + (0.4 x 9e-14) = 4.57e-14 + λ(b1) = λD(b1) = 2e-12 = 2e-12 + λ(b2) = λD(b2) = 2e-12 = 2e-12 + belief change = 0 +node C: + π(c1) = p(c1|a1).πC(a1) + p(c1|a2).πC(a2) = (0.24 x 1e-14) + (0.12 x 9e-14) = 1.32e-14 + π(c2) = p(c2|a1).πC(a1) + p(c2|a2).πC(a2) = (0.76 x 1e-14) + (0.88 x 9e-14) = 8.68e-14 + λ(c1) = λD(c1) = 2e-12 = 2e-12 + λ(c2) = λD(c2) = 2e-12 = 2e-12 + belief change = 1.387778781e-16 +node D: + π(d1) = p(d1|b1,c1).πD(b1).πD(c1) + p(d1|b1,c2).πD(b1).πD(c2) + p(d1|b2,c1).πD(b2).πD(c1) + p(d1|b2,c2).πD(b2).πD(c2) = (0.2 x 1.086e-12 x 2.64e-13) + (0.7 x 1.086e-12 x 1.736e-12) + (0.45 x 9.14e-13 x 2.64e-13) + (0.22 x 9.14e-13 x 1.736e-12) = 1.83470608e-24 + π(d2) = p(d2|b1,c1).πD(b1).πD(c1) + p(d2|b1,c2).πD(b1).πD(c2) + p(d2|b2,c1).πD(b2).πD(c1) + p(d2|b2,c2).πD(b2).πD(c2) = (0.8 x 1.086e-12 x 2.64e-13) + (0.3 x 1.086e-12 x 1.736e-12) + (0.55 x 9.14e-13 x 2.64e-13) + (0.78 x 9.14e-13 x 1.736e-12) = 2.16529392e-24 + λ(d1) = 1 + λ(d2) = 1 + belief change = 0 + + +******************************************************************************** +Iteration 49 +******************************************************************************** + +status of random variable `A': + domain π(A) λ(A) belief +---------------------------------------------------------------- + a1 0.01 1e-24 0.1 + a2 0.09 1e-24 0.9 + + domain πB(A) λB(A) +---------------------------------------------------------------- + a1 1e-14 1e-12 + a2 9e-14 1e-12 + + domain πC(A) λC(A) +---------------------------------------------------------------- + a1 1e-14 1e-12 + a2 9e-14 1e-12 + + +status of random variable `B': + domain π(B) λ(B) belief +---------------------------------------------------------------- + b1 5.43e-14 2e-12 0.543 + b2 4.57e-14 2e-12 0.457 + + domain πD(B) λD(B) +---------------------------------------------------------------- + b1 1.086e-12 2e-12 + b2 9.14e-13 2e-12 + + +status of random variable `C': + domain π(C) λ(C) belief +---------------------------------------------------------------- + c1 1.32e-14 2e-12 0.132 + c2 8.68e-14 2e-12 0.868 + + domain πD(C) λD(C) +---------------------------------------------------------------- + c1 2.64e-13 2e-12 + c2 1.736e-12 2e-12 + + +status of random variable `D': + domain π(D) λ(D) belief +---------------------------------------------------------------- + d1 1.83470608e-24 1 0.45867652 + d2 2.16529392e-24 1 0.54132348 + +λ message B --> A + λB(a1) = [p(b1|a1)].λ(b1) + [p(b2|a1)].λ(b2) = [(0.03)]x2e-12 + [(0.97)]x2e-12 = 2e-12 + λB(a2) = [p(b1|a2)].λ(b1) + [p(b2|a2)].λ(b2) = [(0.6)]x2e-12 + [(0.4)]x2e-12 = 2e-12 +λ message C --> A + λC(a1) = [p(c1|a1)].λ(c1) + [p(c2|a1)].λ(c2) = [(0.24)]x2e-12 + [(0.76)]x2e-12 = 2e-12 + λC(a2) = [p(c1|a2)].λ(c1) + [p(c2|a2)].λ(c2) = [(0.12)]x2e-12 + [(0.88)]x2e-12 = 2e-12 +λ message D --> B + λD(b1) = [p(d1|b1,c1).πD(c1) + p(d1|b1,c2).πD(c2)].λ(d1) + [p(d2|b1,c1).πD(c1) + p(d2|b1,c2).πD(c2)].λ(d2) = [(0.2x2.64e-13) + (0.7x1.736e-12)]x1 + [(0.8x2.64e-13) + (0.3x1.736e-12)]x1 = 2e-12 + λD(b2) = [p(d1|b2,c1).πD(c1) + p(d1|b2,c2).πD(c2)].λ(d1) + [p(d2|b2,c1).πD(c1) + p(d2|b2,c2).πD(c2)].λ(d2) = [(0.45x2.64e-13) + (0.22x1.736e-12)]x1 + [(0.55x2.64e-13) + (0.78x1.736e-12)]x1 = 2e-12 +λ message D --> C + λD(c1) = [p(d1|b1,c1).πD(b1) + p(d1|b2,c1).πD(b2)].λ(d1) + [p(d2|b1,c1).πD(b1) + p(d2|b2,c1).πD(b2)].λ(d2) = [(0.2x1.086e-12) + (0.45x9.14e-13)]x1 + [(0.8x1.086e-12) + (0.55x9.14e-13)]x1 = 2e-12 + λD(c2) = [p(d1|b1,c2).πD(b1) + p(d1|b2,c2).πD(b2)].λ(d1) + [p(d2|b1,c2).πD(b1) + p(d2|b2,c2).πD(b2)].λ(d2) = [(0.7x1.086e-12) + (0.22x9.14e-13)]x1 + [(0.3x1.086e-12) + (0.78x9.14e-13)]x1 = 2e-12 +π message A --> B + πB(a1) = π(a1).λC(a1) = 0.01 x 1e-12 = 1e-14 + πB(a2) = π(a2).λC(a2) = 0.09 x 1e-12 = 9e-14 +π message A --> C + πC(a1) = π(a1).λB(a1) = 0.01 x 1e-12 = 1e-14 + πC(a2) = π(a2).λB(a2) = 0.09 x 1e-12 = 9e-14 +π message B --> D + πD(b1) = π(b1) = 5.43e-14 = 5.43e-14 + πD(b2) = π(b2) = 4.57e-14 = 4.57e-14 +π message C --> D + πD(c1) = π(c1) = 1.32e-14 = 1.32e-14 + πD(c2) = π(c2) = 8.68e-14 = 8.68e-14 + +updating π & λ values +node A: + π(a1) = p(a1) = (0.01) = 0.01 + π(a2) = p(a2) = (0.09) = 0.09 + λ(a1) = λB(a1).λC(a1) = 2e-12 x 2e-12 = 4e-24 + λ(a2) = λB(a2).λC(a2) = 2e-12 x 2e-12 = 4e-24 + belief change = 0 +node B: + π(b1) = p(b1|a1).πB(a1) + p(b1|a2).πB(a2) = (0.03 x 1e-14) + (0.6 x 9e-14) = 5.43e-14 + π(b2) = p(b2|a1).πB(a1) + p(b2|a2).πB(a2) = (0.97 x 1e-14) + (0.4 x 9e-14) = 4.57e-14 + λ(b1) = λD(b1) = 2e-12 = 2e-12 + λ(b2) = λD(b2) = 2e-12 = 2e-12 + belief change = 0 +node C: + π(c1) = p(c1|a1).πC(a1) + p(c1|a2).πC(a2) = (0.24 x 1e-14) + (0.12 x 9e-14) = 1.32e-14 + π(c2) = p(c2|a1).πC(a1) + p(c2|a2).πC(a2) = (0.76 x 1e-14) + (0.88 x 9e-14) = 8.68e-14 + λ(c1) = λD(c1) = 2e-12 = 2e-12 + λ(c2) = λD(c2) = 2e-12 = 2e-12 + belief change = 0 +node D: + π(d1) = p(d1|b1,c1).πD(b1).πD(c1) + p(d1|b1,c2).πD(b1).πD(c2) + p(d1|b2,c1).πD(b2).πD(c1) + p(d1|b2,c2).πD(b2).πD(c2) = (0.2 x 5.43e-14 x 1.32e-14) + (0.7 x 5.43e-14 x 8.68e-14) + (0.45 x 4.57e-14 x 1.32e-14) + (0.22 x 4.57e-14 x 8.68e-14) = 4.5867652e-27 + π(d2) = p(d2|b1,c1).πD(b1).πD(c1) + p(d2|b1,c2).πD(b1).πD(c2) + p(d2|b2,c1).πD(b2).πD(c1) + p(d2|b2,c2).πD(b2).πD(c2) = (0.8 x 5.43e-14 x 1.32e-14) + (0.3 x 5.43e-14 x 8.68e-14) + (0.55 x 4.57e-14 x 1.32e-14) + (0.78 x 4.57e-14 x 8.68e-14) = 5.4132348e-27 + λ(d1) = 1 + λ(d2) = 1 + belief change = 1.110223025e-16 + + +******************************************************************************** +Iteration 50 +******************************************************************************** + +status of random variable `A': + domain π(A) λ(A) belief +---------------------------------------------------------------- + a1 0.01 4e-24 0.1 + a2 0.09 4e-24 0.9 + + domain πB(A) λB(A) +---------------------------------------------------------------- + a1 1e-14 2e-12 + a2 9e-14 2e-12 + + domain πC(A) λC(A) +---------------------------------------------------------------- + a1 1e-14 2e-12 + a2 9e-14 2e-12 + + +status of random variable `B': + domain π(B) λ(B) belief +---------------------------------------------------------------- + b1 5.43e-14 2e-12 0.543 + b2 4.57e-14 2e-12 0.457 + + domain πD(B) λD(B) +---------------------------------------------------------------- + b1 5.43e-14 2e-12 + b2 4.57e-14 2e-12 + + +status of random variable `C': + domain π(C) λ(C) belief +---------------------------------------------------------------- + c1 1.32e-14 2e-12 0.132 + c2 8.68e-14 2e-12 0.868 + + domain πD(C) λD(C) +---------------------------------------------------------------- + c1 1.32e-14 2e-12 + c2 8.68e-14 2e-12 + + +status of random variable `D': + domain π(D) λ(D) belief +---------------------------------------------------------------- + d1 4.5867652e-27 1 0.45867652 + d2 5.4132348e-27 1 0.54132348 + +λ message B --> A + λB(a1) = [p(b1|a1)].λ(b1) + [p(b2|a1)].λ(b2) = [(0.03)]x2e-12 + [(0.97)]x2e-12 = 2e-12 + λB(a2) = [p(b1|a2)].λ(b1) + [p(b2|a2)].λ(b2) = [(0.6)]x2e-12 + [(0.4)]x2e-12 = 2e-12 +λ message C --> A + λC(a1) = [p(c1|a1)].λ(c1) + [p(c2|a1)].λ(c2) = [(0.24)]x2e-12 + [(0.76)]x2e-12 = 2e-12 + λC(a2) = [p(c1|a2)].λ(c1) + [p(c2|a2)].λ(c2) = [(0.12)]x2e-12 + [(0.88)]x2e-12 = 2e-12 +λ message D --> B + λD(b1) = [p(d1|b1,c1).πD(c1) + p(d1|b1,c2).πD(c2)].λ(d1) + [p(d2|b1,c1).πD(c1) + p(d2|b1,c2).πD(c2)].λ(d2) = [(0.2x1.32e-14) + (0.7x8.68e-14)]x1 + [(0.8x1.32e-14) + (0.3x8.68e-14)]x1 = 1e-13 + λD(b2) = [p(d1|b2,c1).πD(c1) + p(d1|b2,c2).πD(c2)].λ(d1) + [p(d2|b2,c1).πD(c1) + p(d2|b2,c2).πD(c2)].λ(d2) = [(0.45x1.32e-14) + (0.22x8.68e-14)]x1 + [(0.55x1.32e-14) + (0.78x8.68e-14)]x1 = 1e-13 +λ message D --> C + λD(c1) = [p(d1|b1,c1).πD(b1) + p(d1|b2,c1).πD(b2)].λ(d1) + [p(d2|b1,c1).πD(b1) + p(d2|b2,c1).πD(b2)].λ(d2) = [(0.2x5.43e-14) + (0.45x4.57e-14)]x1 + [(0.8x5.43e-14) + (0.55x4.57e-14)]x1 = 1e-13 + λD(c2) = [p(d1|b1,c2).πD(b1) + p(d1|b2,c2).πD(b2)].λ(d1) + [p(d2|b1,c2).πD(b1) + p(d2|b2,c2).πD(b2)].λ(d2) = [(0.7x5.43e-14) + (0.22x4.57e-14)]x1 + [(0.3x5.43e-14) + (0.78x4.57e-14)]x1 = 1e-13 +π message A --> B + πB(a1) = π(a1).λC(a1) = 0.01 x 2e-12 = 2e-14 + πB(a2) = π(a2).λC(a2) = 0.09 x 2e-12 = 1.8e-13 +π message A --> C + πC(a1) = π(a1).λB(a1) = 0.01 x 2e-12 = 2e-14 + πC(a2) = π(a2).λB(a2) = 0.09 x 2e-12 = 1.8e-13 +π message B --> D + πD(b1) = π(b1) = 5.43e-14 = 5.43e-14 + πD(b2) = π(b2) = 4.57e-14 = 4.57e-14 +π message C --> D + πD(c1) = π(c1) = 1.32e-14 = 1.32e-14 + πD(c2) = π(c2) = 8.68e-14 = 8.68e-14 + +updating π & λ values +node A: + π(a1) = p(a1) = (0.01) = 0.01 + π(a2) = p(a2) = (0.09) = 0.09 + λ(a1) = λB(a1).λC(a1) = 2e-12 x 2e-12 = 4e-24 + λ(a2) = λB(a2).λC(a2) = 2e-12 x 2e-12 = 4e-24 + belief change = 0 +node B: + π(b1) = p(b1|a1).πB(a1) + p(b1|a2).πB(a2) = (0.03 x 2e-14) + (0.6 x 1.8e-13) = 1.086e-13 + π(b2) = p(b2|a1).πB(a1) + p(b2|a2).πB(a2) = (0.97 x 2e-14) + (0.4 x 1.8e-13) = 9.14e-14 + λ(b1) = λD(b1) = 1e-13 = 1e-13 + λ(b2) = λD(b2) = 1e-13 = 1e-13 + belief change = 1.665334537e-16 +node C: + π(c1) = p(c1|a1).πC(a1) + p(c1|a2).πC(a2) = (0.24 x 2e-14) + (0.12 x 1.8e-13) = 2.64e-14 + π(c2) = p(c2|a1).πC(a1) + p(c2|a2).πC(a2) = (0.76 x 2e-14) + (0.88 x 1.8e-13) = 1.736e-13 + λ(c1) = λD(c1) = 1e-13 = 1e-13 + λ(c2) = λD(c2) = 1e-13 = 1e-13 + belief change = 1.110223025e-16 +node D: + π(d1) = p(d1|b1,c1).πD(b1).πD(c1) + p(d1|b1,c2).πD(b1).πD(c2) + p(d1|b2,c1).πD(b2).πD(c1) + p(d1|b2,c2).πD(b2).πD(c2) = (0.2 x 5.43e-14 x 1.32e-14) + (0.7 x 5.43e-14 x 8.68e-14) + (0.45 x 4.57e-14 x 1.32e-14) + (0.22 x 4.57e-14 x 8.68e-14) = 4.5867652e-27 + π(d2) = p(d2|b1,c1).πD(b1).πD(c1) + p(d2|b1,c2).πD(b1).πD(c2) + p(d2|b2,c1).πD(b2).πD(c1) + p(d2|b2,c2).πD(b2).πD(c2) = (0.8 x 5.43e-14 x 1.32e-14) + (0.3 x 5.43e-14 x 8.68e-14) + (0.55 x 4.57e-14 x 1.32e-14) + (0.78 x 4.57e-14 x 8.68e-14) = 5.4132348e-27 + λ(d1) = 1 + λ(d2) = 1 + belief change = 0 + + +******************************************************************************** +Iteration 51 +******************************************************************************** + +status of random variable `A': + domain π(A) λ(A) belief +---------------------------------------------------------------- + a1 0.01 4e-24 0.1 + a2 0.09 4e-24 0.9 + + domain πB(A) λB(A) +---------------------------------------------------------------- + a1 2e-14 2e-12 + a2 1.8e-13 2e-12 + + domain πC(A) λC(A) +---------------------------------------------------------------- + a1 2e-14 2e-12 + a2 1.8e-13 2e-12 + + +status of random variable `B': + domain π(B) λ(B) belief +---------------------------------------------------------------- + b1 1.086e-13 1e-13 0.543 + b2 9.14e-14 1e-13 0.457 + + domain πD(B) λD(B) +---------------------------------------------------------------- + b1 5.43e-14 1e-13 + b2 4.57e-14 1e-13 + + +status of random variable `C': + domain π(C) λ(C) belief +---------------------------------------------------------------- + c1 2.64e-14 1e-13 0.132 + c2 1.736e-13 1e-13 0.868 + + domain πD(C) λD(C) +---------------------------------------------------------------- + c1 1.32e-14 1e-13 + c2 8.68e-14 1e-13 + + +status of random variable `D': + domain π(D) λ(D) belief +---------------------------------------------------------------- + d1 4.5867652e-27 1 0.45867652 + d2 5.4132348e-27 1 0.54132348 + +λ message B --> A + λB(a1) = [p(b1|a1)].λ(b1) + [p(b2|a1)].λ(b2) = [(0.03)]x1e-13 + [(0.97)]x1e-13 = 1e-13 + λB(a2) = [p(b1|a2)].λ(b1) + [p(b2|a2)].λ(b2) = [(0.6)]x1e-13 + [(0.4)]x1e-13 = 1e-13 +λ message C --> A + λC(a1) = [p(c1|a1)].λ(c1) + [p(c2|a1)].λ(c2) = [(0.24)]x1e-13 + [(0.76)]x1e-13 = 1e-13 + λC(a2) = [p(c1|a2)].λ(c1) + [p(c2|a2)].λ(c2) = [(0.12)]x1e-13 + [(0.88)]x1e-13 = 1e-13 +λ message D --> B + λD(b1) = [p(d1|b1,c1).πD(c1) + p(d1|b1,c2).πD(c2)].λ(d1) + [p(d2|b1,c1).πD(c1) + p(d2|b1,c2).πD(c2)].λ(d2) = [(0.2x1.32e-14) + (0.7x8.68e-14)]x1 + [(0.8x1.32e-14) + (0.3x8.68e-14)]x1 = 1e-13 + λD(b2) = [p(d1|b2,c1).πD(c1) + p(d1|b2,c2).πD(c2)].λ(d1) + [p(d2|b2,c1).πD(c1) + p(d2|b2,c2).πD(c2)].λ(d2) = [(0.45x1.32e-14) + (0.22x8.68e-14)]x1 + [(0.55x1.32e-14) + (0.78x8.68e-14)]x1 = 1e-13 +λ message D --> C + λD(c1) = [p(d1|b1,c1).πD(b1) + p(d1|b2,c1).πD(b2)].λ(d1) + [p(d2|b1,c1).πD(b1) + p(d2|b2,c1).πD(b2)].λ(d2) = [(0.2x5.43e-14) + (0.45x4.57e-14)]x1 + [(0.8x5.43e-14) + (0.55x4.57e-14)]x1 = 1e-13 + λD(c2) = [p(d1|b1,c2).πD(b1) + p(d1|b2,c2).πD(b2)].λ(d1) + [p(d2|b1,c2).πD(b1) + p(d2|b2,c2).πD(b2)].λ(d2) = [(0.7x5.43e-14) + (0.22x4.57e-14)]x1 + [(0.3x5.43e-14) + (0.78x4.57e-14)]x1 = 1e-13 +π message A --> B + πB(a1) = π(a1).λC(a1) = 0.01 x 2e-12 = 2e-14 + πB(a2) = π(a2).λC(a2) = 0.09 x 2e-12 = 1.8e-13 +π message A --> C + πC(a1) = π(a1).λB(a1) = 0.01 x 2e-12 = 2e-14 + πC(a2) = π(a2).λB(a2) = 0.09 x 2e-12 = 1.8e-13 +π message B --> D + πD(b1) = π(b1) = 1.086e-13 = 1.086e-13 + πD(b2) = π(b2) = 9.14e-14 = 9.14e-14 +π message C --> D + πD(c1) = π(c1) = 2.64e-14 = 2.64e-14 + πD(c2) = π(c2) = 1.736e-13 = 1.736e-13 + +updating π & λ values +node A: + π(a1) = p(a1) = (0.01) = 0.01 + π(a2) = p(a2) = (0.09) = 0.09 + λ(a1) = λB(a1).λC(a1) = 1e-13 x 1e-13 = 1e-26 + λ(a2) = λB(a2).λC(a2) = 1e-13 x 1e-13 = 1e-26 + belief change = 1.387778781e-16 +node B: + π(b1) = p(b1|a1).πB(a1) + p(b1|a2).πB(a2) = (0.03 x 2e-14) + (0.6 x 1.8e-13) = 1.086e-13 + π(b2) = p(b2|a1).πB(a1) + p(b2|a2).πB(a2) = (0.97 x 2e-14) + (0.4 x 1.8e-13) = 9.14e-14 + λ(b1) = λD(b1) = 1e-13 = 1e-13 + λ(b2) = λD(b2) = 1e-13 = 1e-13 + belief change = 0 +node C: + π(c1) = p(c1|a1).πC(a1) + p(c1|a2).πC(a2) = (0.24 x 2e-14) + (0.12 x 1.8e-13) = 2.64e-14 + π(c2) = p(c2|a1).πC(a1) + p(c2|a2).πC(a2) = (0.76 x 2e-14) + (0.88 x 1.8e-13) = 1.736e-13 + λ(c1) = λD(c1) = 1e-13 = 1e-13 + λ(c2) = λD(c2) = 1e-13 = 1e-13 + belief change = 0 +node D: + π(d1) = p(d1|b1,c1).πD(b1).πD(c1) + p(d1|b1,c2).πD(b1).πD(c2) + p(d1|b2,c1).πD(b2).πD(c1) + p(d1|b2,c2).πD(b2).πD(c2) = (0.2 x 1.086e-13 x 2.64e-14) + (0.7 x 1.086e-13 x 1.736e-13) + (0.45 x 9.14e-14 x 2.64e-14) + (0.22 x 9.14e-14 x 1.736e-13) = 1.83470608e-26 + π(d2) = p(d2|b1,c1).πD(b1).πD(c1) + p(d2|b1,c2).πD(b1).πD(c2) + p(d2|b2,c1).πD(b2).πD(c1) + p(d2|b2,c2).πD(b2).πD(c2) = (0.8 x 1.086e-13 x 2.64e-14) + (0.3 x 1.086e-13 x 1.736e-13) + (0.55 x 9.14e-14 x 2.64e-14) + (0.78 x 9.14e-14 x 1.736e-13) = 2.16529392e-26 + λ(d1) = 1 + λ(d2) = 1 + belief change = 0 + + +******************************************************************************** +Iteration 52 +******************************************************************************** + +status of random variable `A': + domain π(A) λ(A) belief +---------------------------------------------------------------- + a1 0.01 1e-26 0.1 + a2 0.09 1e-26 0.9 + + domain πB(A) λB(A) +---------------------------------------------------------------- + a1 2e-14 1e-13 + a2 1.8e-13 1e-13 + + domain πC(A) λC(A) +---------------------------------------------------------------- + a1 2e-14 1e-13 + a2 1.8e-13 1e-13 + + +status of random variable `B': + domain π(B) λ(B) belief +---------------------------------------------------------------- + b1 1.086e-13 1e-13 0.543 + b2 9.14e-14 1e-13 0.457 + + domain πD(B) λD(B) +---------------------------------------------------------------- + b1 1.086e-13 1e-13 + b2 9.14e-14 1e-13 + + +status of random variable `C': + domain π(C) λ(C) belief +---------------------------------------------------------------- + c1 2.64e-14 1e-13 0.132 + c2 1.736e-13 1e-13 0.868 + + domain πD(C) λD(C) +---------------------------------------------------------------- + c1 2.64e-14 1e-13 + c2 1.736e-13 1e-13 + + +status of random variable `D': + domain π(D) λ(D) belief +---------------------------------------------------------------- + d1 1.83470608e-26 1 0.45867652 + d2 2.16529392e-26 1 0.54132348 + +λ message B --> A + λB(a1) = [p(b1|a1)].λ(b1) + [p(b2|a1)].λ(b2) = [(0.03)]x1e-13 + [(0.97)]x1e-13 = 1e-13 + λB(a2) = [p(b1|a2)].λ(b1) + [p(b2|a2)].λ(b2) = [(0.6)]x1e-13 + [(0.4)]x1e-13 = 1e-13 +λ message C --> A + λC(a1) = [p(c1|a1)].λ(c1) + [p(c2|a1)].λ(c2) = [(0.24)]x1e-13 + [(0.76)]x1e-13 = 1e-13 + λC(a2) = [p(c1|a2)].λ(c1) + [p(c2|a2)].λ(c2) = [(0.12)]x1e-13 + [(0.88)]x1e-13 = 1e-13 +λ message D --> B + λD(b1) = [p(d1|b1,c1).πD(c1) + p(d1|b1,c2).πD(c2)].λ(d1) + [p(d2|b1,c1).πD(c1) + p(d2|b1,c2).πD(c2)].λ(d2) = [(0.2x2.64e-14) + (0.7x1.736e-13)]x1 + [(0.8x2.64e-14) + (0.3x1.736e-13)]x1 = 2e-13 + λD(b2) = [p(d1|b2,c1).πD(c1) + p(d1|b2,c2).πD(c2)].λ(d1) + [p(d2|b2,c1).πD(c1) + p(d2|b2,c2).πD(c2)].λ(d2) = [(0.45x2.64e-14) + (0.22x1.736e-13)]x1 + [(0.55x2.64e-14) + (0.78x1.736e-13)]x1 = 2e-13 +λ message D --> C + λD(c1) = [p(d1|b1,c1).πD(b1) + p(d1|b2,c1).πD(b2)].λ(d1) + [p(d2|b1,c1).πD(b1) + p(d2|b2,c1).πD(b2)].λ(d2) = [(0.2x1.086e-13) + (0.45x9.14e-14)]x1 + [(0.8x1.086e-13) + (0.55x9.14e-14)]x1 = 2e-13 + λD(c2) = [p(d1|b1,c2).πD(b1) + p(d1|b2,c2).πD(b2)].λ(d1) + [p(d2|b1,c2).πD(b1) + p(d2|b2,c2).πD(b2)].λ(d2) = [(0.7x1.086e-13) + (0.22x9.14e-14)]x1 + [(0.3x1.086e-13) + (0.78x9.14e-14)]x1 = 2e-13 +π message A --> B + πB(a1) = π(a1).λC(a1) = 0.01 x 1e-13 = 1e-15 + πB(a2) = π(a2).λC(a2) = 0.09 x 1e-13 = 9e-15 +π message A --> C + πC(a1) = π(a1).λB(a1) = 0.01 x 1e-13 = 1e-15 + πC(a2) = π(a2).λB(a2) = 0.09 x 1e-13 = 9e-15 +π message B --> D + πD(b1) = π(b1) = 1.086e-13 = 1.086e-13 + πD(b2) = π(b2) = 9.14e-14 = 9.14e-14 +π message C --> D + πD(c1) = π(c1) = 2.64e-14 = 2.64e-14 + πD(c2) = π(c2) = 1.736e-13 = 1.736e-13 + +updating π & λ values +node A: + π(a1) = p(a1) = (0.01) = 0.01 + π(a2) = p(a2) = (0.09) = 0.09 + λ(a1) = λB(a1).λC(a1) = 1e-13 x 1e-13 = 1e-26 + λ(a2) = λB(a2).λC(a2) = 1e-13 x 1e-13 = 1e-26 + belief change = 0 +node B: + π(b1) = p(b1|a1).πB(a1) + p(b1|a2).πB(a2) = (0.03 x 1e-15) + (0.6 x 9e-15) = 5.43e-15 + π(b2) = p(b2|a1).πB(a1) + p(b2|a2).πB(a2) = (0.97 x 1e-15) + (0.4 x 9e-15) = 4.57e-15 + λ(b1) = λD(b1) = 2e-13 = 2e-13 + λ(b2) = λD(b2) = 2e-13 = 2e-13 + belief change = 1.665334537e-16 +node C: + π(c1) = p(c1|a1).πC(a1) + p(c1|a2).πC(a2) = (0.24 x 1e-15) + (0.12 x 9e-15) = 1.32e-15 + π(c2) = p(c2|a1).πC(a1) + p(c2|a2).πC(a2) = (0.76 x 1e-15) + (0.88 x 9e-15) = 8.68e-15 + λ(c1) = λD(c1) = 2e-13 = 2e-13 + λ(c2) = λD(c2) = 2e-13 = 2e-13 + belief change = 1.387778781e-16 +node D: + π(d1) = p(d1|b1,c1).πD(b1).πD(c1) + p(d1|b1,c2).πD(b1).πD(c2) + p(d1|b2,c1).πD(b2).πD(c1) + p(d1|b2,c2).πD(b2).πD(c2) = (0.2 x 1.086e-13 x 2.64e-14) + (0.7 x 1.086e-13 x 1.736e-13) + (0.45 x 9.14e-14 x 2.64e-14) + (0.22 x 9.14e-14 x 1.736e-13) = 1.83470608e-26 + π(d2) = p(d2|b1,c1).πD(b1).πD(c1) + p(d2|b1,c2).πD(b1).πD(c2) + p(d2|b2,c1).πD(b2).πD(c1) + p(d2|b2,c2).πD(b2).πD(c2) = (0.8 x 1.086e-13 x 2.64e-14) + (0.3 x 1.086e-13 x 1.736e-13) + (0.55 x 9.14e-14 x 2.64e-14) + (0.78 x 9.14e-14 x 1.736e-13) = 2.16529392e-26 + λ(d1) = 1 + λ(d2) = 1 + belief change = 0 + + +******************************************************************************** +Iteration 53 +******************************************************************************** + +status of random variable `A': + domain π(A) λ(A) belief +---------------------------------------------------------------- + a1 0.01 1e-26 0.1 + a2 0.09 1e-26 0.9 + + domain πB(A) λB(A) +---------------------------------------------------------------- + a1 1e-15 1e-13 + a2 9e-15 1e-13 + + domain πC(A) λC(A) +---------------------------------------------------------------- + a1 1e-15 1e-13 + a2 9e-15 1e-13 + + +status of random variable `B': + domain π(B) λ(B) belief +---------------------------------------------------------------- + b1 5.43e-15 2e-13 0.543 + b2 4.57e-15 2e-13 0.457 + + domain πD(B) λD(B) +---------------------------------------------------------------- + b1 1.086e-13 2e-13 + b2 9.14e-14 2e-13 + + +status of random variable `C': + domain π(C) λ(C) belief +---------------------------------------------------------------- + c1 1.32e-15 2e-13 0.132 + c2 8.68e-15 2e-13 0.868 + + domain πD(C) λD(C) +---------------------------------------------------------------- + c1 2.64e-14 2e-13 + c2 1.736e-13 2e-13 + + +status of random variable `D': + domain π(D) λ(D) belief +---------------------------------------------------------------- + d1 1.83470608e-26 1 0.45867652 + d2 2.16529392e-26 1 0.54132348 + +λ message B --> A + λB(a1) = [p(b1|a1)].λ(b1) + [p(b2|a1)].λ(b2) = [(0.03)]x2e-13 + [(0.97)]x2e-13 = 2e-13 + λB(a2) = [p(b1|a2)].λ(b1) + [p(b2|a2)].λ(b2) = [(0.6)]x2e-13 + [(0.4)]x2e-13 = 2e-13 +λ message C --> A + λC(a1) = [p(c1|a1)].λ(c1) + [p(c2|a1)].λ(c2) = [(0.24)]x2e-13 + [(0.76)]x2e-13 = 2e-13 + λC(a2) = [p(c1|a2)].λ(c1) + [p(c2|a2)].λ(c2) = [(0.12)]x2e-13 + [(0.88)]x2e-13 = 2e-13 +λ message D --> B + λD(b1) = [p(d1|b1,c1).πD(c1) + p(d1|b1,c2).πD(c2)].λ(d1) + [p(d2|b1,c1).πD(c1) + p(d2|b1,c2).πD(c2)].λ(d2) = [(0.2x2.64e-14) + (0.7x1.736e-13)]x1 + [(0.8x2.64e-14) + (0.3x1.736e-13)]x1 = 2e-13 + λD(b2) = [p(d1|b2,c1).πD(c1) + p(d1|b2,c2).πD(c2)].λ(d1) + [p(d2|b2,c1).πD(c1) + p(d2|b2,c2).πD(c2)].λ(d2) = [(0.45x2.64e-14) + (0.22x1.736e-13)]x1 + [(0.55x2.64e-14) + (0.78x1.736e-13)]x1 = 2e-13 +λ message D --> C + λD(c1) = [p(d1|b1,c1).πD(b1) + p(d1|b2,c1).πD(b2)].λ(d1) + [p(d2|b1,c1).πD(b1) + p(d2|b2,c1).πD(b2)].λ(d2) = [(0.2x1.086e-13) + (0.45x9.14e-14)]x1 + [(0.8x1.086e-13) + (0.55x9.14e-14)]x1 = 2e-13 + λD(c2) = [p(d1|b1,c2).πD(b1) + p(d1|b2,c2).πD(b2)].λ(d1) + [p(d2|b1,c2).πD(b1) + p(d2|b2,c2).πD(b2)].λ(d2) = [(0.7x1.086e-13) + (0.22x9.14e-14)]x1 + [(0.3x1.086e-13) + (0.78x9.14e-14)]x1 = 2e-13 +π message A --> B + πB(a1) = π(a1).λC(a1) = 0.01 x 1e-13 = 1e-15 + πB(a2) = π(a2).λC(a2) = 0.09 x 1e-13 = 9e-15 +π message A --> C + πC(a1) = π(a1).λB(a1) = 0.01 x 1e-13 = 1e-15 + πC(a2) = π(a2).λB(a2) = 0.09 x 1e-13 = 9e-15 +π message B --> D + πD(b1) = π(b1) = 5.43e-15 = 5.43e-15 + πD(b2) = π(b2) = 4.57e-15 = 4.57e-15 +π message C --> D + πD(c1) = π(c1) = 1.32e-15 = 1.32e-15 + πD(c2) = π(c2) = 8.68e-15 = 8.68e-15 + +updating π & λ values +node A: + π(a1) = p(a1) = (0.01) = 0.01 + π(a2) = p(a2) = (0.09) = 0.09 + λ(a1) = λB(a1).λC(a1) = 2e-13 x 2e-13 = 4e-26 + λ(a2) = λB(a2).λC(a2) = 2e-13 x 2e-13 = 4e-26 + belief change = 0 +node B: + π(b1) = p(b1|a1).πB(a1) + p(b1|a2).πB(a2) = (0.03 x 1e-15) + (0.6 x 9e-15) = 5.43e-15 + π(b2) = p(b2|a1).πB(a1) + p(b2|a2).πB(a2) = (0.97 x 1e-15) + (0.4 x 9e-15) = 4.57e-15 + λ(b1) = λD(b1) = 2e-13 = 2e-13 + λ(b2) = λD(b2) = 2e-13 = 2e-13 + belief change = 0 +node C: + π(c1) = p(c1|a1).πC(a1) + p(c1|a2).πC(a2) = (0.24 x 1e-15) + (0.12 x 9e-15) = 1.32e-15 + π(c2) = p(c2|a1).πC(a1) + p(c2|a2).πC(a2) = (0.76 x 1e-15) + (0.88 x 9e-15) = 8.68e-15 + λ(c1) = λD(c1) = 2e-13 = 2e-13 + λ(c2) = λD(c2) = 2e-13 = 2e-13 + belief change = 0 +node D: + π(d1) = p(d1|b1,c1).πD(b1).πD(c1) + p(d1|b1,c2).πD(b1).πD(c2) + p(d1|b2,c1).πD(b2).πD(c1) + p(d1|b2,c2).πD(b2).πD(c2) = (0.2 x 5.43e-15 x 1.32e-15) + (0.7 x 5.43e-15 x 8.68e-15) + (0.45 x 4.57e-15 x 1.32e-15) + (0.22 x 4.57e-15 x 8.68e-15) = 4.5867652e-29 + π(d2) = p(d2|b1,c1).πD(b1).πD(c1) + p(d2|b1,c2).πD(b1).πD(c2) + p(d2|b2,c1).πD(b2).πD(c1) + p(d2|b2,c2).πD(b2).πD(c2) = (0.8 x 5.43e-15 x 1.32e-15) + (0.3 x 5.43e-15 x 8.68e-15) + (0.55 x 4.57e-15 x 1.32e-15) + (0.78 x 4.57e-15 x 8.68e-15) = 5.4132348e-29 + λ(d1) = 1 + λ(d2) = 1 + belief change = 1.110223025e-16 + + +******************************************************************************** +Iteration 54 +******************************************************************************** + +status of random variable `A': + domain π(A) λ(A) belief +---------------------------------------------------------------- + a1 0.01 4e-26 0.1 + a2 0.09 4e-26 0.9 + + domain πB(A) λB(A) +---------------------------------------------------------------- + a1 1e-15 2e-13 + a2 9e-15 2e-13 + + domain πC(A) λC(A) +---------------------------------------------------------------- + a1 1e-15 2e-13 + a2 9e-15 2e-13 + + +status of random variable `B': + domain π(B) λ(B) belief +---------------------------------------------------------------- + b1 5.43e-15 2e-13 0.543 + b2 4.57e-15 2e-13 0.457 + + domain πD(B) λD(B) +---------------------------------------------------------------- + b1 5.43e-15 2e-13 + b2 4.57e-15 2e-13 + + +status of random variable `C': + domain π(C) λ(C) belief +---------------------------------------------------------------- + c1 1.32e-15 2e-13 0.132 + c2 8.68e-15 2e-13 0.868 + + domain πD(C) λD(C) +---------------------------------------------------------------- + c1 1.32e-15 2e-13 + c2 8.68e-15 2e-13 + + +status of random variable `D': + domain π(D) λ(D) belief +---------------------------------------------------------------- + d1 4.5867652e-29 1 0.45867652 + d2 5.4132348e-29 1 0.54132348 + +λ message B --> A + λB(a1) = [p(b1|a1)].λ(b1) + [p(b2|a1)].λ(b2) = [(0.03)]x2e-13 + [(0.97)]x2e-13 = 2e-13 + λB(a2) = [p(b1|a2)].λ(b1) + [p(b2|a2)].λ(b2) = [(0.6)]x2e-13 + [(0.4)]x2e-13 = 2e-13 +λ message C --> A + λC(a1) = [p(c1|a1)].λ(c1) + [p(c2|a1)].λ(c2) = [(0.24)]x2e-13 + [(0.76)]x2e-13 = 2e-13 + λC(a2) = [p(c1|a2)].λ(c1) + [p(c2|a2)].λ(c2) = [(0.12)]x2e-13 + [(0.88)]x2e-13 = 2e-13 +λ message D --> B + λD(b1) = [p(d1|b1,c1).πD(c1) + p(d1|b1,c2).πD(c2)].λ(d1) + [p(d2|b1,c1).πD(c1) + p(d2|b1,c2).πD(c2)].λ(d2) = [(0.2x1.32e-15) + (0.7x8.68e-15)]x1 + [(0.8x1.32e-15) + (0.3x8.68e-15)]x1 = 1e-14 + λD(b2) = [p(d1|b2,c1).πD(c1) + p(d1|b2,c2).πD(c2)].λ(d1) + [p(d2|b2,c1).πD(c1) + p(d2|b2,c2).πD(c2)].λ(d2) = [(0.45x1.32e-15) + (0.22x8.68e-15)]x1 + [(0.55x1.32e-15) + (0.78x8.68e-15)]x1 = 1e-14 +λ message D --> C + λD(c1) = [p(d1|b1,c1).πD(b1) + p(d1|b2,c1).πD(b2)].λ(d1) + [p(d2|b1,c1).πD(b1) + p(d2|b2,c1).πD(b2)].λ(d2) = [(0.2x5.43e-15) + (0.45x4.57e-15)]x1 + [(0.8x5.43e-15) + (0.55x4.57e-15)]x1 = 1e-14 + λD(c2) = [p(d1|b1,c2).πD(b1) + p(d1|b2,c2).πD(b2)].λ(d1) + [p(d2|b1,c2).πD(b1) + p(d2|b2,c2).πD(b2)].λ(d2) = [(0.7x5.43e-15) + (0.22x4.57e-15)]x1 + [(0.3x5.43e-15) + (0.78x4.57e-15)]x1 = 1e-14 +π message A --> B + πB(a1) = π(a1).λC(a1) = 0.01 x 2e-13 = 2e-15 + πB(a2) = π(a2).λC(a2) = 0.09 x 2e-13 = 1.8e-14 +π message A --> C + πC(a1) = π(a1).λB(a1) = 0.01 x 2e-13 = 2e-15 + πC(a2) = π(a2).λB(a2) = 0.09 x 2e-13 = 1.8e-14 +π message B --> D + πD(b1) = π(b1) = 5.43e-15 = 5.43e-15 + πD(b2) = π(b2) = 4.57e-15 = 4.57e-15 +π message C --> D + πD(c1) = π(c1) = 1.32e-15 = 1.32e-15 + πD(c2) = π(c2) = 8.68e-15 = 8.68e-15 + +updating π & λ values +node A: + π(a1) = p(a1) = (0.01) = 0.01 + π(a2) = p(a2) = (0.09) = 0.09 + λ(a1) = λB(a1).λC(a1) = 2e-13 x 2e-13 = 4e-26 + λ(a2) = λB(a2).λC(a2) = 2e-13 x 2e-13 = 4e-26 + belief change = 0 +node B: + π(b1) = p(b1|a1).πB(a1) + p(b1|a2).πB(a2) = (0.03 x 2e-15) + (0.6 x 1.8e-14) = 1.086e-14 + π(b2) = p(b2|a1).πB(a1) + p(b2|a2).πB(a2) = (0.97 x 2e-15) + (0.4 x 1.8e-14) = 9.14e-15 + λ(b1) = λD(b1) = 1e-14 = 1e-14 + λ(b2) = λD(b2) = 1e-14 = 1e-14 + belief change = 3.330669074e-16 +node C: + π(c1) = p(c1|a1).πC(a1) + p(c1|a2).πC(a2) = (0.24 x 2e-15) + (0.12 x 1.8e-14) = 2.64e-15 + π(c2) = p(c2|a1).πC(a1) + p(c2|a2).πC(a2) = (0.76 x 2e-15) + (0.88 x 1.8e-14) = 1.736e-14 + λ(c1) = λD(c1) = 1e-14 = 1e-14 + λ(c2) = λD(c2) = 1e-14 = 1e-14 + belief change = 1.110223025e-16 +node D: + π(d1) = p(d1|b1,c1).πD(b1).πD(c1) + p(d1|b1,c2).πD(b1).πD(c2) + p(d1|b2,c1).πD(b2).πD(c1) + p(d1|b2,c2).πD(b2).πD(c2) = (0.2 x 5.43e-15 x 1.32e-15) + (0.7 x 5.43e-15 x 8.68e-15) + (0.45 x 4.57e-15 x 1.32e-15) + (0.22 x 4.57e-15 x 8.68e-15) = 4.5867652e-29 + π(d2) = p(d2|b1,c1).πD(b1).πD(c1) + p(d2|b1,c2).πD(b1).πD(c2) + p(d2|b2,c1).πD(b2).πD(c1) + p(d2|b2,c2).πD(b2).πD(c2) = (0.8 x 5.43e-15 x 1.32e-15) + (0.3 x 5.43e-15 x 8.68e-15) + (0.55 x 4.57e-15 x 1.32e-15) + (0.78 x 4.57e-15 x 8.68e-15) = 5.4132348e-29 + λ(d1) = 1 + λ(d2) = 1 + belief change = 0 + + +******************************************************************************** +Iteration 55 +******************************************************************************** + +status of random variable `A': + domain π(A) λ(A) belief +---------------------------------------------------------------- + a1 0.01 4e-26 0.1 + a2 0.09 4e-26 0.9 + + domain πB(A) λB(A) +---------------------------------------------------------------- + a1 2e-15 2e-13 + a2 1.8e-14 2e-13 + + domain πC(A) λC(A) +---------------------------------------------------------------- + a1 2e-15 2e-13 + a2 1.8e-14 2e-13 + + +status of random variable `B': + domain π(B) λ(B) belief +---------------------------------------------------------------- + b1 1.086e-14 1e-14 0.543 + b2 9.14e-15 1e-14 0.457 + + domain πD(B) λD(B) +---------------------------------------------------------------- + b1 5.43e-15 1e-14 + b2 4.57e-15 1e-14 + + +status of random variable `C': + domain π(C) λ(C) belief +---------------------------------------------------------------- + c1 2.64e-15 1e-14 0.132 + c2 1.736e-14 1e-14 0.868 + + domain πD(C) λD(C) +---------------------------------------------------------------- + c1 1.32e-15 1e-14 + c2 8.68e-15 1e-14 + + +status of random variable `D': + domain π(D) λ(D) belief +---------------------------------------------------------------- + d1 4.5867652e-29 1 0.45867652 + d2 5.4132348e-29 1 0.54132348 + +λ message B --> A + λB(a1) = [p(b1|a1)].λ(b1) + [p(b2|a1)].λ(b2) = [(0.03)]x1e-14 + [(0.97)]x1e-14 = 1e-14 + λB(a2) = [p(b1|a2)].λ(b1) + [p(b2|a2)].λ(b2) = [(0.6)]x1e-14 + [(0.4)]x1e-14 = 1e-14 +λ message C --> A + λC(a1) = [p(c1|a1)].λ(c1) + [p(c2|a1)].λ(c2) = [(0.24)]x1e-14 + [(0.76)]x1e-14 = 1e-14 + λC(a2) = [p(c1|a2)].λ(c1) + [p(c2|a2)].λ(c2) = [(0.12)]x1e-14 + [(0.88)]x1e-14 = 1e-14 +λ message D --> B + λD(b1) = [p(d1|b1,c1).πD(c1) + p(d1|b1,c2).πD(c2)].λ(d1) + [p(d2|b1,c1).πD(c1) + p(d2|b1,c2).πD(c2)].λ(d2) = [(0.2x1.32e-15) + (0.7x8.68e-15)]x1 + [(0.8x1.32e-15) + (0.3x8.68e-15)]x1 = 1e-14 + λD(b2) = [p(d1|b2,c1).πD(c1) + p(d1|b2,c2).πD(c2)].λ(d1) + [p(d2|b2,c1).πD(c1) + p(d2|b2,c2).πD(c2)].λ(d2) = [(0.45x1.32e-15) + (0.22x8.68e-15)]x1 + [(0.55x1.32e-15) + (0.78x8.68e-15)]x1 = 1e-14 +λ message D --> C + λD(c1) = [p(d1|b1,c1).πD(b1) + p(d1|b2,c1).πD(b2)].λ(d1) + [p(d2|b1,c1).πD(b1) + p(d2|b2,c1).πD(b2)].λ(d2) = [(0.2x5.43e-15) + (0.45x4.57e-15)]x1 + [(0.8x5.43e-15) + (0.55x4.57e-15)]x1 = 1e-14 + λD(c2) = [p(d1|b1,c2).πD(b1) + p(d1|b2,c2).πD(b2)].λ(d1) + [p(d2|b1,c2).πD(b1) + p(d2|b2,c2).πD(b2)].λ(d2) = [(0.7x5.43e-15) + (0.22x4.57e-15)]x1 + [(0.3x5.43e-15) + (0.78x4.57e-15)]x1 = 1e-14 +π message A --> B + πB(a1) = π(a1).λC(a1) = 0.01 x 2e-13 = 2e-15 + πB(a2) = π(a2).λC(a2) = 0.09 x 2e-13 = 1.8e-14 +π message A --> C + πC(a1) = π(a1).λB(a1) = 0.01 x 2e-13 = 2e-15 + πC(a2) = π(a2).λB(a2) = 0.09 x 2e-13 = 1.8e-14 +π message B --> D + πD(b1) = π(b1) = 1.086e-14 = 1.086e-14 + πD(b2) = π(b2) = 9.14e-15 = 9.14e-15 +π message C --> D + πD(c1) = π(c1) = 2.64e-15 = 2.64e-15 + πD(c2) = π(c2) = 1.736e-14 = 1.736e-14 + +updating π & λ values +node A: + π(a1) = p(a1) = (0.01) = 0.01 + π(a2) = p(a2) = (0.09) = 0.09 + λ(a1) = λB(a1).λC(a1) = 1e-14 x 1e-14 = 1e-28 + λ(a2) = λB(a2).λC(a2) = 1e-14 x 1e-14 = 1e-28 + belief change = 1.526556659e-16 +node B: + π(b1) = p(b1|a1).πB(a1) + p(b1|a2).πB(a2) = (0.03 x 2e-15) + (0.6 x 1.8e-14) = 1.086e-14 + π(b2) = p(b2|a1).πB(a1) + p(b2|a2).πB(a2) = (0.97 x 2e-15) + (0.4 x 1.8e-14) = 9.14e-15 + λ(b1) = λD(b1) = 1e-14 = 1e-14 + λ(b2) = λD(b2) = 1e-14 = 1e-14 + belief change = 0 +node C: + π(c1) = p(c1|a1).πC(a1) + p(c1|a2).πC(a2) = (0.24 x 2e-15) + (0.12 x 1.8e-14) = 2.64e-15 + π(c2) = p(c2|a1).πC(a1) + p(c2|a2).πC(a2) = (0.76 x 2e-15) + (0.88 x 1.8e-14) = 1.736e-14 + λ(c1) = λD(c1) = 1e-14 = 1e-14 + λ(c2) = λD(c2) = 1e-14 = 1e-14 + belief change = 0 +node D: + π(d1) = p(d1|b1,c1).πD(b1).πD(c1) + p(d1|b1,c2).πD(b1).πD(c2) + p(d1|b2,c1).πD(b2).πD(c1) + p(d1|b2,c2).πD(b2).πD(c2) = (0.2 x 1.086e-14 x 2.64e-15) + (0.7 x 1.086e-14 x 1.736e-14) + (0.45 x 9.14e-15 x 2.64e-15) + (0.22 x 9.14e-15 x 1.736e-14) = 1.83470608e-28 + π(d2) = p(d2|b1,c1).πD(b1).πD(c1) + p(d2|b1,c2).πD(b1).πD(c2) + p(d2|b2,c1).πD(b2).πD(c1) + p(d2|b2,c2).πD(b2).πD(c2) = (0.8 x 1.086e-14 x 2.64e-15) + (0.3 x 1.086e-14 x 1.736e-14) + (0.55 x 9.14e-15 x 2.64e-15) + (0.78 x 9.14e-15 x 1.736e-14) = 2.16529392e-28 + λ(d1) = 1 + λ(d2) = 1 + belief change = 0 + + +******************************************************************************** +Iteration 56 +******************************************************************************** + +status of random variable `A': + domain π(A) λ(A) belief +---------------------------------------------------------------- + a1 0.01 1e-28 0.1 + a2 0.09 1e-28 0.9 + + domain πB(A) λB(A) +---------------------------------------------------------------- + a1 2e-15 1e-14 + a2 1.8e-14 1e-14 + + domain πC(A) λC(A) +---------------------------------------------------------------- + a1 2e-15 1e-14 + a2 1.8e-14 1e-14 + + +status of random variable `B': + domain π(B) λ(B) belief +---------------------------------------------------------------- + b1 1.086e-14 1e-14 0.543 + b2 9.14e-15 1e-14 0.457 + + domain πD(B) λD(B) +---------------------------------------------------------------- + b1 1.086e-14 1e-14 + b2 9.14e-15 1e-14 + + +status of random variable `C': + domain π(C) λ(C) belief +---------------------------------------------------------------- + c1 2.64e-15 1e-14 0.132 + c2 1.736e-14 1e-14 0.868 + + domain πD(C) λD(C) +---------------------------------------------------------------- + c1 2.64e-15 1e-14 + c2 1.736e-14 1e-14 + + +status of random variable `D': + domain π(D) λ(D) belief +---------------------------------------------------------------- + d1 1.83470608e-28 1 0.45867652 + d2 2.16529392e-28 1 0.54132348 + +λ message B --> A + λB(a1) = [p(b1|a1)].λ(b1) + [p(b2|a1)].λ(b2) = [(0.03)]x1e-14 + [(0.97)]x1e-14 = 1e-14 + λB(a2) = [p(b1|a2)].λ(b1) + [p(b2|a2)].λ(b2) = [(0.6)]x1e-14 + [(0.4)]x1e-14 = 1e-14 +λ message C --> A + λC(a1) = [p(c1|a1)].λ(c1) + [p(c2|a1)].λ(c2) = [(0.24)]x1e-14 + [(0.76)]x1e-14 = 1e-14 + λC(a2) = [p(c1|a2)].λ(c1) + [p(c2|a2)].λ(c2) = [(0.12)]x1e-14 + [(0.88)]x1e-14 = 1e-14 +λ message D --> B + λD(b1) = [p(d1|b1,c1).πD(c1) + p(d1|b1,c2).πD(c2)].λ(d1) + [p(d2|b1,c1).πD(c1) + p(d2|b1,c2).πD(c2)].λ(d2) = [(0.2x2.64e-15) + (0.7x1.736e-14)]x1 + [(0.8x2.64e-15) + (0.3x1.736e-14)]x1 = 2e-14 + λD(b2) = [p(d1|b2,c1).πD(c1) + p(d1|b2,c2).πD(c2)].λ(d1) + [p(d2|b2,c1).πD(c1) + p(d2|b2,c2).πD(c2)].λ(d2) = [(0.45x2.64e-15) + (0.22x1.736e-14)]x1 + [(0.55x2.64e-15) + (0.78x1.736e-14)]x1 = 2e-14 +λ message D --> C + λD(c1) = [p(d1|b1,c1).πD(b1) + p(d1|b2,c1).πD(b2)].λ(d1) + [p(d2|b1,c1).πD(b1) + p(d2|b2,c1).πD(b2)].λ(d2) = [(0.2x1.086e-14) + (0.45x9.14e-15)]x1 + [(0.8x1.086e-14) + (0.55x9.14e-15)]x1 = 2e-14 + λD(c2) = [p(d1|b1,c2).πD(b1) + p(d1|b2,c2).πD(b2)].λ(d1) + [p(d2|b1,c2).πD(b1) + p(d2|b2,c2).πD(b2)].λ(d2) = [(0.7x1.086e-14) + (0.22x9.14e-15)]x1 + [(0.3x1.086e-14) + (0.78x9.14e-15)]x1 = 2e-14 +π message A --> B + πB(a1) = π(a1).λC(a1) = 0.01 x 1e-14 = 1e-16 + πB(a2) = π(a2).λC(a2) = 0.09 x 1e-14 = 9e-16 +π message A --> C + πC(a1) = π(a1).λB(a1) = 0.01 x 1e-14 = 1e-16 + πC(a2) = π(a2).λB(a2) = 0.09 x 1e-14 = 9e-16 +π message B --> D + πD(b1) = π(b1) = 1.086e-14 = 1.086e-14 + πD(b2) = π(b2) = 9.14e-15 = 9.14e-15 +π message C --> D + πD(c1) = π(c1) = 2.64e-15 = 2.64e-15 + πD(c2) = π(c2) = 1.736e-14 = 1.736e-14 + +updating π & λ values +node A: + π(a1) = p(a1) = (0.01) = 0.01 + π(a2) = p(a2) = (0.09) = 0.09 + λ(a1) = λB(a1).λC(a1) = 1e-14 x 1e-14 = 1e-28 + λ(a2) = λB(a2).λC(a2) = 1e-14 x 1e-14 = 1e-28 + belief change = 0 +node B: + π(b1) = p(b1|a1).πB(a1) + p(b1|a2).πB(a2) = (0.03 x 1e-16) + (0.6 x 9e-16) = 5.43e-16 + π(b2) = p(b2|a1).πB(a1) + p(b2|a2).πB(a2) = (0.97 x 1e-16) + (0.4 x 9e-16) = 4.57e-16 + λ(b1) = λD(b1) = 2e-14 = 2e-14 + λ(b2) = λD(b2) = 2e-14 = 2e-14 + belief change = 1.110223025e-16 +node C: + π(c1) = p(c1|a1).πC(a1) + p(c1|a2).πC(a2) = (0.24 x 1e-16) + (0.12 x 9e-16) = 1.32e-16 + π(c2) = p(c2|a1).πC(a1) + p(c2|a2).πC(a2) = (0.76 x 1e-16) + (0.88 x 9e-16) = 8.68e-16 + λ(c1) = λD(c1) = 2e-14 = 2e-14 + λ(c2) = λD(c2) = 2e-14 = 2e-14 + belief change = 0 +node D: + π(d1) = p(d1|b1,c1).πD(b1).πD(c1) + p(d1|b1,c2).πD(b1).πD(c2) + p(d1|b2,c1).πD(b2).πD(c1) + p(d1|b2,c2).πD(b2).πD(c2) = (0.2 x 1.086e-14 x 2.64e-15) + (0.7 x 1.086e-14 x 1.736e-14) + (0.45 x 9.14e-15 x 2.64e-15) + (0.22 x 9.14e-15 x 1.736e-14) = 1.83470608e-28 + π(d2) = p(d2|b1,c1).πD(b1).πD(c1) + p(d2|b1,c2).πD(b1).πD(c2) + p(d2|b2,c1).πD(b2).πD(c1) + p(d2|b2,c2).πD(b2).πD(c2) = (0.8 x 1.086e-14 x 2.64e-15) + (0.3 x 1.086e-14 x 1.736e-14) + (0.55 x 9.14e-15 x 2.64e-15) + (0.78 x 9.14e-15 x 1.736e-14) = 2.16529392e-28 + λ(d1) = 1 + λ(d2) = 1 + belief change = 0 + + +******************************************************************************** +Iteration 57 +******************************************************************************** + +status of random variable `A': + domain π(A) λ(A) belief +---------------------------------------------------------------- + a1 0.01 1e-28 0.1 + a2 0.09 1e-28 0.9 + + domain πB(A) λB(A) +---------------------------------------------------------------- + a1 1e-16 1e-14 + a2 9e-16 1e-14 + + domain πC(A) λC(A) +---------------------------------------------------------------- + a1 1e-16 1e-14 + a2 9e-16 1e-14 + + +status of random variable `B': + domain π(B) λ(B) belief +---------------------------------------------------------------- + b1 5.43e-16 2e-14 0.543 + b2 4.57e-16 2e-14 0.457 + + domain πD(B) λD(B) +---------------------------------------------------------------- + b1 1.086e-14 2e-14 + b2 9.14e-15 2e-14 + + +status of random variable `C': + domain π(C) λ(C) belief +---------------------------------------------------------------- + c1 1.32e-16 2e-14 0.132 + c2 8.68e-16 2e-14 0.868 + + domain πD(C) λD(C) +---------------------------------------------------------------- + c1 2.64e-15 2e-14 + c2 1.736e-14 2e-14 + + +status of random variable `D': + domain π(D) λ(D) belief +---------------------------------------------------------------- + d1 1.83470608e-28 1 0.45867652 + d2 2.16529392e-28 1 0.54132348 + +λ message B --> A + λB(a1) = [p(b1|a1)].λ(b1) + [p(b2|a1)].λ(b2) = [(0.03)]x2e-14 + [(0.97)]x2e-14 = 2e-14 + λB(a2) = [p(b1|a2)].λ(b1) + [p(b2|a2)].λ(b2) = [(0.6)]x2e-14 + [(0.4)]x2e-14 = 2e-14 +λ message C --> A + λC(a1) = [p(c1|a1)].λ(c1) + [p(c2|a1)].λ(c2) = [(0.24)]x2e-14 + [(0.76)]x2e-14 = 2e-14 + λC(a2) = [p(c1|a2)].λ(c1) + [p(c2|a2)].λ(c2) = [(0.12)]x2e-14 + [(0.88)]x2e-14 = 2e-14 +λ message D --> B + λD(b1) = [p(d1|b1,c1).πD(c1) + p(d1|b1,c2).πD(c2)].λ(d1) + [p(d2|b1,c1).πD(c1) + p(d2|b1,c2).πD(c2)].λ(d2) = [(0.2x2.64e-15) + (0.7x1.736e-14)]x1 + [(0.8x2.64e-15) + (0.3x1.736e-14)]x1 = 2e-14 + λD(b2) = [p(d1|b2,c1).πD(c1) + p(d1|b2,c2).πD(c2)].λ(d1) + [p(d2|b2,c1).πD(c1) + p(d2|b2,c2).πD(c2)].λ(d2) = [(0.45x2.64e-15) + (0.22x1.736e-14)]x1 + [(0.55x2.64e-15) + (0.78x1.736e-14)]x1 = 2e-14 +λ message D --> C + λD(c1) = [p(d1|b1,c1).πD(b1) + p(d1|b2,c1).πD(b2)].λ(d1) + [p(d2|b1,c1).πD(b1) + p(d2|b2,c1).πD(b2)].λ(d2) = [(0.2x1.086e-14) + (0.45x9.14e-15)]x1 + [(0.8x1.086e-14) + (0.55x9.14e-15)]x1 = 2e-14 + λD(c2) = [p(d1|b1,c2).πD(b1) + p(d1|b2,c2).πD(b2)].λ(d1) + [p(d2|b1,c2).πD(b1) + p(d2|b2,c2).πD(b2)].λ(d2) = [(0.7x1.086e-14) + (0.22x9.14e-15)]x1 + [(0.3x1.086e-14) + (0.78x9.14e-15)]x1 = 2e-14 +π message A --> B + πB(a1) = π(a1).λC(a1) = 0.01 x 1e-14 = 1e-16 + πB(a2) = π(a2).λC(a2) = 0.09 x 1e-14 = 9e-16 +π message A --> C + πC(a1) = π(a1).λB(a1) = 0.01 x 1e-14 = 1e-16 + πC(a2) = π(a2).λB(a2) = 0.09 x 1e-14 = 9e-16 +π message B --> D + πD(b1) = π(b1) = 5.43e-16 = 5.43e-16 + πD(b2) = π(b2) = 4.57e-16 = 4.57e-16 +π message C --> D + πD(c1) = π(c1) = 1.32e-16 = 1.32e-16 + πD(c2) = π(c2) = 8.68e-16 = 8.68e-16 + +updating π & λ values +node A: + π(a1) = p(a1) = (0.01) = 0.01 + π(a2) = p(a2) = (0.09) = 0.09 + λ(a1) = λB(a1).λC(a1) = 2e-14 x 2e-14 = 4e-28 + λ(a2) = λB(a2).λC(a2) = 2e-14 x 2e-14 = 4e-28 + belief change = 0 +node B: + π(b1) = p(b1|a1).πB(a1) + p(b1|a2).πB(a2) = (0.03 x 1e-16) + (0.6 x 9e-16) = 5.43e-16 + π(b2) = p(b2|a1).πB(a1) + p(b2|a2).πB(a2) = (0.97 x 1e-16) + (0.4 x 9e-16) = 4.57e-16 + λ(b1) = λD(b1) = 2e-14 = 2e-14 + λ(b2) = λD(b2) = 2e-14 = 2e-14 + belief change = 0 +node C: + π(c1) = p(c1|a1).πC(a1) + p(c1|a2).πC(a2) = (0.24 x 1e-16) + (0.12 x 9e-16) = 1.32e-16 + π(c2) = p(c2|a1).πC(a1) + p(c2|a2).πC(a2) = (0.76 x 1e-16) + (0.88 x 9e-16) = 8.68e-16 + λ(c1) = λD(c1) = 2e-14 = 2e-14 + λ(c2) = λD(c2) = 2e-14 = 2e-14 + belief change = 0 +node D: + π(d1) = p(d1|b1,c1).πD(b1).πD(c1) + p(d1|b1,c2).πD(b1).πD(c2) + p(d1|b2,c1).πD(b2).πD(c1) + p(d1|b2,c2).πD(b2).πD(c2) = (0.2 x 5.43e-16 x 1.32e-16) + (0.7 x 5.43e-16 x 8.68e-16) + (0.45 x 4.57e-16 x 1.32e-16) + (0.22 x 4.57e-16 x 8.68e-16) = 4.5867652e-31 + π(d2) = p(d2|b1,c1).πD(b1).πD(c1) + p(d2|b1,c2).πD(b1).πD(c2) + p(d2|b2,c1).πD(b2).πD(c1) + p(d2|b2,c2).πD(b2).πD(c2) = (0.8 x 5.43e-16 x 1.32e-16) + (0.3 x 5.43e-16 x 8.68e-16) + (0.55 x 4.57e-16 x 1.32e-16) + (0.78 x 4.57e-16 x 8.68e-16) = 5.4132348e-31 + λ(d1) = 1 + λ(d2) = 1 + belief change = 0 + + +******************************************************************************** +Iteration 58 +******************************************************************************** + +status of random variable `A': + domain π(A) λ(A) belief +---------------------------------------------------------------- + a1 0.01 4e-28 0.1 + a2 0.09 4e-28 0.9 + + domain πB(A) λB(A) +---------------------------------------------------------------- + a1 1e-16 2e-14 + a2 9e-16 2e-14 + + domain πC(A) λC(A) +---------------------------------------------------------------- + a1 1e-16 2e-14 + a2 9e-16 2e-14 + + +status of random variable `B': + domain π(B) λ(B) belief +---------------------------------------------------------------- + b1 5.43e-16 2e-14 0.543 + b2 4.57e-16 2e-14 0.457 + + domain πD(B) λD(B) +---------------------------------------------------------------- + b1 5.43e-16 2e-14 + b2 4.57e-16 2e-14 + + +status of random variable `C': + domain π(C) λ(C) belief +---------------------------------------------------------------- + c1 1.32e-16 2e-14 0.132 + c2 8.68e-16 2e-14 0.868 + + domain πD(C) λD(C) +---------------------------------------------------------------- + c1 1.32e-16 2e-14 + c2 8.68e-16 2e-14 + + +status of random variable `D': + domain π(D) λ(D) belief +---------------------------------------------------------------- + d1 4.5867652e-31 1 0.45867652 + d2 5.4132348e-31 1 0.54132348 + +λ message B --> A + λB(a1) = [p(b1|a1)].λ(b1) + [p(b2|a1)].λ(b2) = [(0.03)]x2e-14 + [(0.97)]x2e-14 = 2e-14 + λB(a2) = [p(b1|a2)].λ(b1) + [p(b2|a2)].λ(b2) = [(0.6)]x2e-14 + [(0.4)]x2e-14 = 2e-14 +λ message C --> A + λC(a1) = [p(c1|a1)].λ(c1) + [p(c2|a1)].λ(c2) = [(0.24)]x2e-14 + [(0.76)]x2e-14 = 2e-14 + λC(a2) = [p(c1|a2)].λ(c1) + [p(c2|a2)].λ(c2) = [(0.12)]x2e-14 + [(0.88)]x2e-14 = 2e-14 +λ message D --> B + λD(b1) = [p(d1|b1,c1).πD(c1) + p(d1|b1,c2).πD(c2)].λ(d1) + [p(d2|b1,c1).πD(c1) + p(d2|b1,c2).πD(c2)].λ(d2) = [(0.2x1.32e-16) + (0.7x8.68e-16)]x1 + [(0.8x1.32e-16) + (0.3x8.68e-16)]x1 = 1e-15 + λD(b2) = [p(d1|b2,c1).πD(c1) + p(d1|b2,c2).πD(c2)].λ(d1) + [p(d2|b2,c1).πD(c1) + p(d2|b2,c2).πD(c2)].λ(d2) = [(0.45x1.32e-16) + (0.22x8.68e-16)]x1 + [(0.55x1.32e-16) + (0.78x8.68e-16)]x1 = 1e-15 +λ message D --> C + λD(c1) = [p(d1|b1,c1).πD(b1) + p(d1|b2,c1).πD(b2)].λ(d1) + [p(d2|b1,c1).πD(b1) + p(d2|b2,c1).πD(b2)].λ(d2) = [(0.2x5.43e-16) + (0.45x4.57e-16)]x1 + [(0.8x5.43e-16) + (0.55x4.57e-16)]x1 = 1e-15 + λD(c2) = [p(d1|b1,c2).πD(b1) + p(d1|b2,c2).πD(b2)].λ(d1) + [p(d2|b1,c2).πD(b1) + p(d2|b2,c2).πD(b2)].λ(d2) = [(0.7x5.43e-16) + (0.22x4.57e-16)]x1 + [(0.3x5.43e-16) + (0.78x4.57e-16)]x1 = 1e-15 +π message A --> B + πB(a1) = π(a1).λC(a1) = 0.01 x 2e-14 = 2e-16 + πB(a2) = π(a2).λC(a2) = 0.09 x 2e-14 = 1.8e-15 +π message A --> C + πC(a1) = π(a1).λB(a1) = 0.01 x 2e-14 = 2e-16 + πC(a2) = π(a2).λB(a2) = 0.09 x 2e-14 = 1.8e-15 +π message B --> D + πD(b1) = π(b1) = 5.43e-16 = 5.43e-16 + πD(b2) = π(b2) = 4.57e-16 = 4.57e-16 +π message C --> D + πD(c1) = π(c1) = 1.32e-16 = 1.32e-16 + πD(c2) = π(c2) = 8.68e-16 = 8.68e-16 + +updating π & λ values +node A: + π(a1) = p(a1) = (0.01) = 0.01 + π(a2) = p(a2) = (0.09) = 0.09 + λ(a1) = λB(a1).λC(a1) = 2e-14 x 2e-14 = 4e-28 + λ(a2) = λB(a2).λC(a2) = 2e-14 x 2e-14 = 4e-28 + belief change = 0 +node B: + π(b1) = p(b1|a1).πB(a1) + p(b1|a2).πB(a2) = (0.03 x 2e-16) + (0.6 x 1.8e-15) = 1.086e-15 + π(b2) = p(b2|a1).πB(a1) + p(b2|a2).πB(a2) = (0.97 x 2e-16) + (0.4 x 1.8e-15) = 9.14e-16 + λ(b1) = λD(b1) = 1e-15 = 1e-15 + λ(b2) = λD(b2) = 1e-15 = 1e-15 + belief change = 5.551115123e-17 +node C: + π(c1) = p(c1|a1).πC(a1) + p(c1|a2).πC(a2) = (0.24 x 2e-16) + (0.12 x 1.8e-15) = 2.64e-16 + π(c2) = p(c2|a1).πC(a1) + p(c2|a2).πC(a2) = (0.76 x 2e-16) + (0.88 x 1.8e-15) = 1.736e-15 + λ(c1) = λD(c1) = 1e-15 = 1e-15 + λ(c2) = λD(c2) = 1e-15 = 1e-15 + belief change = 1.387778781e-16 +node D: + π(d1) = p(d1|b1,c1).πD(b1).πD(c1) + p(d1|b1,c2).πD(b1).πD(c2) + p(d1|b2,c1).πD(b2).πD(c1) + p(d1|b2,c2).πD(b2).πD(c2) = (0.2 x 5.43e-16 x 1.32e-16) + (0.7 x 5.43e-16 x 8.68e-16) + (0.45 x 4.57e-16 x 1.32e-16) + (0.22 x 4.57e-16 x 8.68e-16) = 4.5867652e-31 + π(d2) = p(d2|b1,c1).πD(b1).πD(c1) + p(d2|b1,c2).πD(b1).πD(c2) + p(d2|b2,c1).πD(b2).πD(c1) + p(d2|b2,c2).πD(b2).πD(c2) = (0.8 x 5.43e-16 x 1.32e-16) + (0.3 x 5.43e-16 x 8.68e-16) + (0.55 x 4.57e-16 x 1.32e-16) + (0.78 x 4.57e-16 x 8.68e-16) = 5.4132348e-31 + λ(d1) = 1 + λ(d2) = 1 + belief change = 0 + + +******************************************************************************** +Iteration 59 +******************************************************************************** + +status of random variable `A': + domain π(A) λ(A) belief +---------------------------------------------------------------- + a1 0.01 4e-28 0.1 + a2 0.09 4e-28 0.9 + + domain πB(A) λB(A) +---------------------------------------------------------------- + a1 2e-16 2e-14 + a2 1.8e-15 2e-14 + + domain πC(A) λC(A) +---------------------------------------------------------------- + a1 2e-16 2e-14 + a2 1.8e-15 2e-14 + + +status of random variable `B': + domain π(B) λ(B) belief +---------------------------------------------------------------- + b1 1.086e-15 1e-15 0.543 + b2 9.14e-16 1e-15 0.457 + + domain πD(B) λD(B) +---------------------------------------------------------------- + b1 5.43e-16 1e-15 + b2 4.57e-16 1e-15 + + +status of random variable `C': + domain π(C) λ(C) belief +---------------------------------------------------------------- + c1 2.64e-16 1e-15 0.132 + c2 1.736e-15 1e-15 0.868 + + domain πD(C) λD(C) +---------------------------------------------------------------- + c1 1.32e-16 1e-15 + c2 8.68e-16 1e-15 + + +status of random variable `D': + domain π(D) λ(D) belief +---------------------------------------------------------------- + d1 4.5867652e-31 1 0.45867652 + d2 5.4132348e-31 1 0.54132348 + +λ message B --> A + λB(a1) = [p(b1|a1)].λ(b1) + [p(b2|a1)].λ(b2) = [(0.03)]x1e-15 + [(0.97)]x1e-15 = 1e-15 + λB(a2) = [p(b1|a2)].λ(b1) + [p(b2|a2)].λ(b2) = [(0.6)]x1e-15 + [(0.4)]x1e-15 = 1e-15 +λ message C --> A + λC(a1) = [p(c1|a1)].λ(c1) + [p(c2|a1)].λ(c2) = [(0.24)]x1e-15 + [(0.76)]x1e-15 = 1e-15 + λC(a2) = [p(c1|a2)].λ(c1) + [p(c2|a2)].λ(c2) = [(0.12)]x1e-15 + [(0.88)]x1e-15 = 1e-15 +λ message D --> B + λD(b1) = [p(d1|b1,c1).πD(c1) + p(d1|b1,c2).πD(c2)].λ(d1) + [p(d2|b1,c1).πD(c1) + p(d2|b1,c2).πD(c2)].λ(d2) = [(0.2x1.32e-16) + (0.7x8.68e-16)]x1 + [(0.8x1.32e-16) + (0.3x8.68e-16)]x1 = 1e-15 + λD(b2) = [p(d1|b2,c1).πD(c1) + p(d1|b2,c2).πD(c2)].λ(d1) + [p(d2|b2,c1).πD(c1) + p(d2|b2,c2).πD(c2)].λ(d2) = [(0.45x1.32e-16) + (0.22x8.68e-16)]x1 + [(0.55x1.32e-16) + (0.78x8.68e-16)]x1 = 1e-15 +λ message D --> C + λD(c1) = [p(d1|b1,c1).πD(b1) + p(d1|b2,c1).πD(b2)].λ(d1) + [p(d2|b1,c1).πD(b1) + p(d2|b2,c1).πD(b2)].λ(d2) = [(0.2x5.43e-16) + (0.45x4.57e-16)]x1 + [(0.8x5.43e-16) + (0.55x4.57e-16)]x1 = 1e-15 + λD(c2) = [p(d1|b1,c2).πD(b1) + p(d1|b2,c2).πD(b2)].λ(d1) + [p(d2|b1,c2).πD(b1) + p(d2|b2,c2).πD(b2)].λ(d2) = [(0.7x5.43e-16) + (0.22x4.57e-16)]x1 + [(0.3x5.43e-16) + (0.78x4.57e-16)]x1 = 1e-15 +π message A --> B + πB(a1) = π(a1).λC(a1) = 0.01 x 2e-14 = 2e-16 + πB(a2) = π(a2).λC(a2) = 0.09 x 2e-14 = 1.8e-15 +π message A --> C + πC(a1) = π(a1).λB(a1) = 0.01 x 2e-14 = 2e-16 + πC(a2) = π(a2).λB(a2) = 0.09 x 2e-14 = 1.8e-15 +π message B --> D + πD(b1) = π(b1) = 1.086e-15 = 1.086e-15 + πD(b2) = π(b2) = 9.14e-16 = 9.14e-16 +π message C --> D + πD(c1) = π(c1) = 2.64e-16 = 2.64e-16 + πD(c2) = π(c2) = 1.736e-15 = 1.736e-15 + +updating π & λ values +node A: + π(a1) = p(a1) = (0.01) = 0.01 + π(a2) = p(a2) = (0.09) = 0.09 + λ(a1) = λB(a1).λC(a1) = 1e-15 x 1e-15 = 1e-30 + λ(a2) = λB(a2).λC(a2) = 1e-15 x 1e-15 = 1e-30 + belief change = 1.387778781e-17 +node B: + π(b1) = p(b1|a1).πB(a1) + p(b1|a2).πB(a2) = (0.03 x 2e-16) + (0.6 x 1.8e-15) = 1.086e-15 + π(b2) = p(b2|a1).πB(a1) + p(b2|a2).πB(a2) = (0.97 x 2e-16) + (0.4 x 1.8e-15) = 9.14e-16 + λ(b1) = λD(b1) = 1e-15 = 1e-15 + λ(b2) = λD(b2) = 1e-15 = 1e-15 + belief change = 0 +node C: + π(c1) = p(c1|a1).πC(a1) + p(c1|a2).πC(a2) = (0.24 x 2e-16) + (0.12 x 1.8e-15) = 2.64e-16 + π(c2) = p(c2|a1).πC(a1) + p(c2|a2).πC(a2) = (0.76 x 2e-16) + (0.88 x 1.8e-15) = 1.736e-15 + λ(c1) = λD(c1) = 1e-15 = 1e-15 + λ(c2) = λD(c2) = 1e-15 = 1e-15 + belief change = 0 +node D: + π(d1) = p(d1|b1,c1).πD(b1).πD(c1) + p(d1|b1,c2).πD(b1).πD(c2) + p(d1|b2,c1).πD(b2).πD(c1) + p(d1|b2,c2).πD(b2).πD(c2) = (0.2 x 1.086e-15 x 2.64e-16) + (0.7 x 1.086e-15 x 1.736e-15) + (0.45 x 9.14e-16 x 2.64e-16) + (0.22 x 9.14e-16 x 1.736e-15) = 1.83470608e-30 + π(d2) = p(d2|b1,c1).πD(b1).πD(c1) + p(d2|b1,c2).πD(b1).πD(c2) + p(d2|b2,c1).πD(b2).πD(c1) + p(d2|b2,c2).πD(b2).πD(c2) = (0.8 x 1.086e-15 x 2.64e-16) + (0.3 x 1.086e-15 x 1.736e-15) + (0.55 x 9.14e-16 x 2.64e-16) + (0.78 x 9.14e-16 x 1.736e-15) = 2.16529392e-30 + λ(d1) = 1 + λ(d2) = 1 + belief change = 0 + + +******************************************************************************** +Iteration 60 +******************************************************************************** + +status of random variable `A': + domain π(A) λ(A) belief +---------------------------------------------------------------- + a1 0.01 1e-30 0.1 + a2 0.09 1e-30 0.9 + + domain πB(A) λB(A) +---------------------------------------------------------------- + a1 2e-16 1e-15 + a2 1.8e-15 1e-15 + + domain πC(A) λC(A) +---------------------------------------------------------------- + a1 2e-16 1e-15 + a2 1.8e-15 1e-15 + + +status of random variable `B': + domain π(B) λ(B) belief +---------------------------------------------------------------- + b1 1.086e-15 1e-15 0.543 + b2 9.14e-16 1e-15 0.457 + + domain πD(B) λD(B) +---------------------------------------------------------------- + b1 1.086e-15 1e-15 + b2 9.14e-16 1e-15 + + +status of random variable `C': + domain π(C) λ(C) belief +---------------------------------------------------------------- + c1 2.64e-16 1e-15 0.132 + c2 1.736e-15 1e-15 0.868 + + domain πD(C) λD(C) +---------------------------------------------------------------- + c1 2.64e-16 1e-15 + c2 1.736e-15 1e-15 + + +status of random variable `D': + domain π(D) λ(D) belief +---------------------------------------------------------------- + d1 1.83470608e-30 1 0.45867652 + d2 2.16529392e-30 1 0.54132348 + +λ message B --> A + λB(a1) = [p(b1|a1)].λ(b1) + [p(b2|a1)].λ(b2) = [(0.03)]x1e-15 + [(0.97)]x1e-15 = 1e-15 + λB(a2) = [p(b1|a2)].λ(b1) + [p(b2|a2)].λ(b2) = [(0.6)]x1e-15 + [(0.4)]x1e-15 = 1e-15 +λ message C --> A + λC(a1) = [p(c1|a1)].λ(c1) + [p(c2|a1)].λ(c2) = [(0.24)]x1e-15 + [(0.76)]x1e-15 = 1e-15 + λC(a2) = [p(c1|a2)].λ(c1) + [p(c2|a2)].λ(c2) = [(0.12)]x1e-15 + [(0.88)]x1e-15 = 1e-15 +λ message D --> B + λD(b1) = [p(d1|b1,c1).πD(c1) + p(d1|b1,c2).πD(c2)].λ(d1) + [p(d2|b1,c1).πD(c1) + p(d2|b1,c2).πD(c2)].λ(d2) = [(0.2x2.64e-16) + (0.7x1.736e-15)]x1 + [(0.8x2.64e-16) + (0.3x1.736e-15)]x1 = 2e-15 + λD(b2) = [p(d1|b2,c1).πD(c1) + p(d1|b2,c2).πD(c2)].λ(d1) + [p(d2|b2,c1).πD(c1) + p(d2|b2,c2).πD(c2)].λ(d2) = [(0.45x2.64e-16) + (0.22x1.736e-15)]x1 + [(0.55x2.64e-16) + (0.78x1.736e-15)]x1 = 2e-15 +λ message D --> C + λD(c1) = [p(d1|b1,c1).πD(b1) + p(d1|b2,c1).πD(b2)].λ(d1) + [p(d2|b1,c1).πD(b1) + p(d2|b2,c1).πD(b2)].λ(d2) = [(0.2x1.086e-15) + (0.45x9.14e-16)]x1 + [(0.8x1.086e-15) + (0.55x9.14e-16)]x1 = 2e-15 + λD(c2) = [p(d1|b1,c2).πD(b1) + p(d1|b2,c2).πD(b2)].λ(d1) + [p(d2|b1,c2).πD(b1) + p(d2|b2,c2).πD(b2)].λ(d2) = [(0.7x1.086e-15) + (0.22x9.14e-16)]x1 + [(0.3x1.086e-15) + (0.78x9.14e-16)]x1 = 2e-15 +π message A --> B + πB(a1) = π(a1).λC(a1) = 0.01 x 1e-15 = 1e-17 + πB(a2) = π(a2).λC(a2) = 0.09 x 1e-15 = 9e-17 +π message A --> C + πC(a1) = π(a1).λB(a1) = 0.01 x 1e-15 = 1e-17 + πC(a2) = π(a2).λB(a2) = 0.09 x 1e-15 = 9e-17 +π message B --> D + πD(b1) = π(b1) = 1.086e-15 = 1.086e-15 + πD(b2) = π(b2) = 9.14e-16 = 9.14e-16 +π message C --> D + πD(c1) = π(c1) = 2.64e-16 = 2.64e-16 + πD(c2) = π(c2) = 1.736e-15 = 1.736e-15 + +updating π & λ values +node A: + π(a1) = p(a1) = (0.01) = 0.01 + π(a2) = p(a2) = (0.09) = 0.09 + λ(a1) = λB(a1).λC(a1) = 1e-15 x 1e-15 = 1e-30 + λ(a2) = λB(a2).λC(a2) = 1e-15 x 1e-15 = 1e-30 + belief change = 0 +node B: + π(b1) = p(b1|a1).πB(a1) + p(b1|a2).πB(a2) = (0.03 x 1e-17) + (0.6 x 9e-17) = 5.43e-17 + π(b2) = p(b2|a1).πB(a1) + p(b2|a2).πB(a2) = (0.97 x 1e-17) + (0.4 x 9e-17) = 4.57e-17 + λ(b1) = λD(b1) = 2e-15 = 2e-15 + λ(b2) = λD(b2) = 2e-15 = 2e-15 + belief change = 0 +node C: + π(c1) = p(c1|a1).πC(a1) + p(c1|a2).πC(a2) = (0.24 x 1e-17) + (0.12 x 9e-17) = 1.32e-17 + π(c2) = p(c2|a1).πC(a1) + p(c2|a2).πC(a2) = (0.76 x 1e-17) + (0.88 x 9e-17) = 8.68e-17 + λ(c1) = λD(c1) = 2e-15 = 2e-15 + λ(c2) = λD(c2) = 2e-15 = 2e-15 + belief change = 2.498001805e-16 +node D: + π(d1) = p(d1|b1,c1).πD(b1).πD(c1) + p(d1|b1,c2).πD(b1).πD(c2) + p(d1|b2,c1).πD(b2).πD(c1) + p(d1|b2,c2).πD(b2).πD(c2) = (0.2 x 1.086e-15 x 2.64e-16) + (0.7 x 1.086e-15 x 1.736e-15) + (0.45 x 9.14e-16 x 2.64e-16) + (0.22 x 9.14e-16 x 1.736e-15) = 1.83470608e-30 + π(d2) = p(d2|b1,c1).πD(b1).πD(c1) + p(d2|b1,c2).πD(b1).πD(c2) + p(d2|b2,c1).πD(b2).πD(c1) + p(d2|b2,c2).πD(b2).πD(c2) = (0.8 x 1.086e-15 x 2.64e-16) + (0.3 x 1.086e-15 x 1.736e-15) + (0.55 x 9.14e-16 x 2.64e-16) + (0.78 x 9.14e-16 x 1.736e-15) = 2.16529392e-30 + λ(d1) = 1 + λ(d2) = 1 + belief change = 0 + + +******************************************************************************** +Iteration 61 +******************************************************************************** + +status of random variable `A': + domain π(A) λ(A) belief +---------------------------------------------------------------- + a1 0.01 1e-30 0.1 + a2 0.09 1e-30 0.9 + + domain πB(A) λB(A) +---------------------------------------------------------------- + a1 1e-17 1e-15 + a2 9e-17 1e-15 + + domain πC(A) λC(A) +---------------------------------------------------------------- + a1 1e-17 1e-15 + a2 9e-17 1e-15 + + +status of random variable `B': + domain π(B) λ(B) belief +---------------------------------------------------------------- + b1 5.43e-17 2e-15 0.543 + b2 4.57e-17 2e-15 0.457 + + domain πD(B) λD(B) +---------------------------------------------------------------- + b1 1.086e-15 2e-15 + b2 9.14e-16 2e-15 + + +status of random variable `C': + domain π(C) λ(C) belief +---------------------------------------------------------------- + c1 1.32e-17 2e-15 0.132 + c2 8.68e-17 2e-15 0.868 + + domain πD(C) λD(C) +---------------------------------------------------------------- + c1 2.64e-16 2e-15 + c2 1.736e-15 2e-15 + + +status of random variable `D': + domain π(D) λ(D) belief +---------------------------------------------------------------- + d1 1.83470608e-30 1 0.45867652 + d2 2.16529392e-30 1 0.54132348 + +λ message B --> A + λB(a1) = [p(b1|a1)].λ(b1) + [p(b2|a1)].λ(b2) = [(0.03)]x2e-15 + [(0.97)]x2e-15 = 2e-15 + λB(a2) = [p(b1|a2)].λ(b1) + [p(b2|a2)].λ(b2) = [(0.6)]x2e-15 + [(0.4)]x2e-15 = 2e-15 +λ message C --> A + λC(a1) = [p(c1|a1)].λ(c1) + [p(c2|a1)].λ(c2) = [(0.24)]x2e-15 + [(0.76)]x2e-15 = 2e-15 + λC(a2) = [p(c1|a2)].λ(c1) + [p(c2|a2)].λ(c2) = [(0.12)]x2e-15 + [(0.88)]x2e-15 = 2e-15 +λ message D --> B + λD(b1) = [p(d1|b1,c1).πD(c1) + p(d1|b1,c2).πD(c2)].λ(d1) + [p(d2|b1,c1).πD(c1) + p(d2|b1,c2).πD(c2)].λ(d2) = [(0.2x2.64e-16) + (0.7x1.736e-15)]x1 + [(0.8x2.64e-16) + (0.3x1.736e-15)]x1 = 2e-15 + λD(b2) = [p(d1|b2,c1).πD(c1) + p(d1|b2,c2).πD(c2)].λ(d1) + [p(d2|b2,c1).πD(c1) + p(d2|b2,c2).πD(c2)].λ(d2) = [(0.45x2.64e-16) + (0.22x1.736e-15)]x1 + [(0.55x2.64e-16) + (0.78x1.736e-15)]x1 = 2e-15 +λ message D --> C + λD(c1) = [p(d1|b1,c1).πD(b1) + p(d1|b2,c1).πD(b2)].λ(d1) + [p(d2|b1,c1).πD(b1) + p(d2|b2,c1).πD(b2)].λ(d2) = [(0.2x1.086e-15) + (0.45x9.14e-16)]x1 + [(0.8x1.086e-15) + (0.55x9.14e-16)]x1 = 2e-15 + λD(c2) = [p(d1|b1,c2).πD(b1) + p(d1|b2,c2).πD(b2)].λ(d1) + [p(d2|b1,c2).πD(b1) + p(d2|b2,c2).πD(b2)].λ(d2) = [(0.7x1.086e-15) + (0.22x9.14e-16)]x1 + [(0.3x1.086e-15) + (0.78x9.14e-16)]x1 = 2e-15 +π message A --> B + πB(a1) = π(a1).λC(a1) = 0.01 x 1e-15 = 1e-17 + πB(a2) = π(a2).λC(a2) = 0.09 x 1e-15 = 9e-17 +π message A --> C + πC(a1) = π(a1).λB(a1) = 0.01 x 1e-15 = 1e-17 + πC(a2) = π(a2).λB(a2) = 0.09 x 1e-15 = 9e-17 +π message B --> D + πD(b1) = π(b1) = 5.43e-17 = 5.43e-17 + πD(b2) = π(b2) = 4.57e-17 = 4.57e-17 +π message C --> D + πD(c1) = π(c1) = 1.32e-17 = 1.32e-17 + πD(c2) = π(c2) = 8.68e-17 = 8.68e-17 + +updating π & λ values +node A: + π(a1) = p(a1) = (0.01) = 0.01 + π(a2) = p(a2) = (0.09) = 0.09 + λ(a1) = λB(a1).λC(a1) = 2e-15 x 2e-15 = 4e-30 + λ(a2) = λB(a2).λC(a2) = 2e-15 x 2e-15 = 4e-30 + belief change = 0 +node B: + π(b1) = p(b1|a1).πB(a1) + p(b1|a2).πB(a2) = (0.03 x 1e-17) + (0.6 x 9e-17) = 5.43e-17 + π(b2) = p(b2|a1).πB(a1) + p(b2|a2).πB(a2) = (0.97 x 1e-17) + (0.4 x 9e-17) = 4.57e-17 + λ(b1) = λD(b1) = 2e-15 = 2e-15 + λ(b2) = λD(b2) = 2e-15 = 2e-15 + belief change = 0 +node C: + π(c1) = p(c1|a1).πC(a1) + p(c1|a2).πC(a2) = (0.24 x 1e-17) + (0.12 x 9e-17) = 1.32e-17 + π(c2) = p(c2|a1).πC(a1) + p(c2|a2).πC(a2) = (0.76 x 1e-17) + (0.88 x 9e-17) = 8.68e-17 + λ(c1) = λD(c1) = 2e-15 = 2e-15 + λ(c2) = λD(c2) = 2e-15 = 2e-15 + belief change = 0 +node D: + π(d1) = p(d1|b1,c1).πD(b1).πD(c1) + p(d1|b1,c2).πD(b1).πD(c2) + p(d1|b2,c1).πD(b2).πD(c1) + p(d1|b2,c2).πD(b2).πD(c2) = (0.2 x 5.43e-17 x 1.32e-17) + (0.7 x 5.43e-17 x 8.68e-17) + (0.45 x 4.57e-17 x 1.32e-17) + (0.22 x 4.57e-17 x 8.68e-17) = 4.5867652e-33 + π(d2) = p(d2|b1,c1).πD(b1).πD(c1) + p(d2|b1,c2).πD(b1).πD(c2) + p(d2|b2,c1).πD(b2).πD(c1) + p(d2|b2,c2).πD(b2).πD(c2) = (0.8 x 5.43e-17 x 1.32e-17) + (0.3 x 5.43e-17 x 8.68e-17) + (0.55 x 4.57e-17 x 1.32e-17) + (0.78 x 4.57e-17 x 8.68e-17) = 5.4132348e-33 + λ(d1) = 1 + λ(d2) = 1 + belief change = 2.220446049e-16 + + +******************************************************************************** +Iteration 62 +******************************************************************************** + +status of random variable `A': + domain π(A) λ(A) belief +---------------------------------------------------------------- + a1 0.01 4e-30 0.1 + a2 0.09 4e-30 0.9 + + domain πB(A) λB(A) +---------------------------------------------------------------- + a1 1e-17 2e-15 + a2 9e-17 2e-15 + + domain πC(A) λC(A) +---------------------------------------------------------------- + a1 1e-17 2e-15 + a2 9e-17 2e-15 + + +status of random variable `B': + domain π(B) λ(B) belief +---------------------------------------------------------------- + b1 5.43e-17 2e-15 0.543 + b2 4.57e-17 2e-15 0.457 + + domain πD(B) λD(B) +---------------------------------------------------------------- + b1 5.43e-17 2e-15 + b2 4.57e-17 2e-15 + + +status of random variable `C': + domain π(C) λ(C) belief +---------------------------------------------------------------- + c1 1.32e-17 2e-15 0.132 + c2 8.68e-17 2e-15 0.868 + + domain πD(C) λD(C) +---------------------------------------------------------------- + c1 1.32e-17 2e-15 + c2 8.68e-17 2e-15 + + +status of random variable `D': + domain π(D) λ(D) belief +---------------------------------------------------------------- + d1 4.5867652e-33 1 0.45867652 + d2 5.4132348e-33 1 0.54132348 + +λ message B --> A + λB(a1) = [p(b1|a1)].λ(b1) + [p(b2|a1)].λ(b2) = [(0.03)]x2e-15 + [(0.97)]x2e-15 = 2e-15 + λB(a2) = [p(b1|a2)].λ(b1) + [p(b2|a2)].λ(b2) = [(0.6)]x2e-15 + [(0.4)]x2e-15 = 2e-15 +λ message C --> A + λC(a1) = [p(c1|a1)].λ(c1) + [p(c2|a1)].λ(c2) = [(0.24)]x2e-15 + [(0.76)]x2e-15 = 2e-15 + λC(a2) = [p(c1|a2)].λ(c1) + [p(c2|a2)].λ(c2) = [(0.12)]x2e-15 + [(0.88)]x2e-15 = 2e-15 +λ message D --> B + λD(b1) = [p(d1|b1,c1).πD(c1) + p(d1|b1,c2).πD(c2)].λ(d1) + [p(d2|b1,c1).πD(c1) + p(d2|b1,c2).πD(c2)].λ(d2) = [(0.2x1.32e-17) + (0.7x8.68e-17)]x1 + [(0.8x1.32e-17) + (0.3x8.68e-17)]x1 = 1e-16 + λD(b2) = [p(d1|b2,c1).πD(c1) + p(d1|b2,c2).πD(c2)].λ(d1) + [p(d2|b2,c1).πD(c1) + p(d2|b2,c2).πD(c2)].λ(d2) = [(0.45x1.32e-17) + (0.22x8.68e-17)]x1 + [(0.55x1.32e-17) + (0.78x8.68e-17)]x1 = 1e-16 +λ message D --> C + λD(c1) = [p(d1|b1,c1).πD(b1) + p(d1|b2,c1).πD(b2)].λ(d1) + [p(d2|b1,c1).πD(b1) + p(d2|b2,c1).πD(b2)].λ(d2) = [(0.2x5.43e-17) + (0.45x4.57e-17)]x1 + [(0.8x5.43e-17) + (0.55x4.57e-17)]x1 = 1e-16 + λD(c2) = [p(d1|b1,c2).πD(b1) + p(d1|b2,c2).πD(b2)].λ(d1) + [p(d2|b1,c2).πD(b1) + p(d2|b2,c2).πD(b2)].λ(d2) = [(0.7x5.43e-17) + (0.22x4.57e-17)]x1 + [(0.3x5.43e-17) + (0.78x4.57e-17)]x1 = 1e-16 +π message A --> B + πB(a1) = π(a1).λC(a1) = 0.01 x 2e-15 = 2e-17 + πB(a2) = π(a2).λC(a2) = 0.09 x 2e-15 = 1.8e-16 +π message A --> C + πC(a1) = π(a1).λB(a1) = 0.01 x 2e-15 = 2e-17 + πC(a2) = π(a2).λB(a2) = 0.09 x 2e-15 = 1.8e-16 +π message B --> D + πD(b1) = π(b1) = 5.43e-17 = 5.43e-17 + πD(b2) = π(b2) = 4.57e-17 = 4.57e-17 +π message C --> D + πD(c1) = π(c1) = 1.32e-17 = 1.32e-17 + πD(c2) = π(c2) = 8.68e-17 = 8.68e-17 + +updating π & λ values +node A: + π(a1) = p(a1) = (0.01) = 0.01 + π(a2) = p(a2) = (0.09) = 0.09 + λ(a1) = λB(a1).λC(a1) = 2e-15 x 2e-15 = 4e-30 + λ(a2) = λB(a2).λC(a2) = 2e-15 x 2e-15 = 4e-30 + belief change = 0 +node B: + π(b1) = p(b1|a1).πB(a1) + p(b1|a2).πB(a2) = (0.03 x 2e-17) + (0.6 x 1.8e-16) = 1.086e-16 + π(b2) = p(b2|a1).πB(a1) + p(b2|a2).πB(a2) = (0.97 x 2e-17) + (0.4 x 1.8e-16) = 9.14e-17 + λ(b1) = λD(b1) = 1e-16 = 1e-16 + λ(b2) = λD(b2) = 1e-16 = 1e-16 + belief change = 0 +node C: + π(c1) = p(c1|a1).πC(a1) + p(c1|a2).πC(a2) = (0.24 x 2e-17) + (0.12 x 1.8e-16) = 2.64e-17 + π(c2) = p(c2|a1).πC(a1) + p(c2|a2).πC(a2) = (0.76 x 2e-17) + (0.88 x 1.8e-16) = 1.736e-16 + λ(c1) = λD(c1) = 1e-16 = 1e-16 + λ(c2) = λD(c2) = 1e-16 = 1e-16 + belief change = 1.110223025e-16 +node D: + π(d1) = p(d1|b1,c1).πD(b1).πD(c1) + p(d1|b1,c2).πD(b1).πD(c2) + p(d1|b2,c1).πD(b2).πD(c1) + p(d1|b2,c2).πD(b2).πD(c2) = (0.2 x 5.43e-17 x 1.32e-17) + (0.7 x 5.43e-17 x 8.68e-17) + (0.45 x 4.57e-17 x 1.32e-17) + (0.22 x 4.57e-17 x 8.68e-17) = 4.5867652e-33 + π(d2) = p(d2|b1,c1).πD(b1).πD(c1) + p(d2|b1,c2).πD(b1).πD(c2) + p(d2|b2,c1).πD(b2).πD(c1) + p(d2|b2,c2).πD(b2).πD(c2) = (0.8 x 5.43e-17 x 1.32e-17) + (0.3 x 5.43e-17 x 8.68e-17) + (0.55 x 4.57e-17 x 1.32e-17) + (0.78 x 4.57e-17 x 8.68e-17) = 5.4132348e-33 + λ(d1) = 1 + λ(d2) = 1 + belief change = 0 + + +******************************************************************************** +Iteration 63 +******************************************************************************** + +status of random variable `A': + domain π(A) λ(A) belief +---------------------------------------------------------------- + a1 0.01 4e-30 0.1 + a2 0.09 4e-30 0.9 + + domain πB(A) λB(A) +---------------------------------------------------------------- + a1 2e-17 2e-15 + a2 1.8e-16 2e-15 + + domain πC(A) λC(A) +---------------------------------------------------------------- + a1 2e-17 2e-15 + a2 1.8e-16 2e-15 + + +status of random variable `B': + domain π(B) λ(B) belief +---------------------------------------------------------------- + b1 1.086e-16 1e-16 0.543 + b2 9.14e-17 1e-16 0.457 + + domain πD(B) λD(B) +---------------------------------------------------------------- + b1 5.43e-17 1e-16 + b2 4.57e-17 1e-16 + + +status of random variable `C': + domain π(C) λ(C) belief +---------------------------------------------------------------- + c1 2.64e-17 1e-16 0.132 + c2 1.736e-16 1e-16 0.868 + + domain πD(C) λD(C) +---------------------------------------------------------------- + c1 1.32e-17 1e-16 + c2 8.68e-17 1e-16 + + +status of random variable `D': + domain π(D) λ(D) belief +---------------------------------------------------------------- + d1 4.5867652e-33 1 0.45867652 + d2 5.4132348e-33 1 0.54132348 + +λ message B --> A + λB(a1) = [p(b1|a1)].λ(b1) + [p(b2|a1)].λ(b2) = [(0.03)]x1e-16 + [(0.97)]x1e-16 = 1e-16 + λB(a2) = [p(b1|a2)].λ(b1) + [p(b2|a2)].λ(b2) = [(0.6)]x1e-16 + [(0.4)]x1e-16 = 1e-16 +λ message C --> A + λC(a1) = [p(c1|a1)].λ(c1) + [p(c2|a1)].λ(c2) = [(0.24)]x1e-16 + [(0.76)]x1e-16 = 1e-16 + λC(a2) = [p(c1|a2)].λ(c1) + [p(c2|a2)].λ(c2) = [(0.12)]x1e-16 + [(0.88)]x1e-16 = 1e-16 +λ message D --> B + λD(b1) = [p(d1|b1,c1).πD(c1) + p(d1|b1,c2).πD(c2)].λ(d1) + [p(d2|b1,c1).πD(c1) + p(d2|b1,c2).πD(c2)].λ(d2) = [(0.2x1.32e-17) + (0.7x8.68e-17)]x1 + [(0.8x1.32e-17) + (0.3x8.68e-17)]x1 = 1e-16 + λD(b2) = [p(d1|b2,c1).πD(c1) + p(d1|b2,c2).πD(c2)].λ(d1) + [p(d2|b2,c1).πD(c1) + p(d2|b2,c2).πD(c2)].λ(d2) = [(0.45x1.32e-17) + (0.22x8.68e-17)]x1 + [(0.55x1.32e-17) + (0.78x8.68e-17)]x1 = 1e-16 +λ message D --> C + λD(c1) = [p(d1|b1,c1).πD(b1) + p(d1|b2,c1).πD(b2)].λ(d1) + [p(d2|b1,c1).πD(b1) + p(d2|b2,c1).πD(b2)].λ(d2) = [(0.2x5.43e-17) + (0.45x4.57e-17)]x1 + [(0.8x5.43e-17) + (0.55x4.57e-17)]x1 = 1e-16 + λD(c2) = [p(d1|b1,c2).πD(b1) + p(d1|b2,c2).πD(b2)].λ(d1) + [p(d2|b1,c2).πD(b1) + p(d2|b2,c2).πD(b2)].λ(d2) = [(0.7x5.43e-17) + (0.22x4.57e-17)]x1 + [(0.3x5.43e-17) + (0.78x4.57e-17)]x1 = 1e-16 +π message A --> B + πB(a1) = π(a1).λC(a1) = 0.01 x 2e-15 = 2e-17 + πB(a2) = π(a2).λC(a2) = 0.09 x 2e-15 = 1.8e-16 +π message A --> C + πC(a1) = π(a1).λB(a1) = 0.01 x 2e-15 = 2e-17 + πC(a2) = π(a2).λB(a2) = 0.09 x 2e-15 = 1.8e-16 +π message B --> D + πD(b1) = π(b1) = 1.086e-16 = 1.086e-16 + πD(b2) = π(b2) = 9.14e-17 = 9.14e-17 +π message C --> D + πD(c1) = π(c1) = 2.64e-17 = 2.64e-17 + πD(c2) = π(c2) = 1.736e-16 = 1.736e-16 + +updating π & λ values +node A: + π(a1) = p(a1) = (0.01) = 0.01 + π(a2) = p(a2) = (0.09) = 0.09 + λ(a1) = λB(a1).λC(a1) = 1e-16 x 1e-16 = 1e-32 + λ(a2) = λB(a2).λC(a2) = 1e-16 x 1e-16 = 1e-32 + belief change = 0 +node B: + π(b1) = p(b1|a1).πB(a1) + p(b1|a2).πB(a2) = (0.03 x 2e-17) + (0.6 x 1.8e-16) = 1.086e-16 + π(b2) = p(b2|a1).πB(a1) + p(b2|a2).πB(a2) = (0.97 x 2e-17) + (0.4 x 1.8e-16) = 9.14e-17 + λ(b1) = λD(b1) = 1e-16 = 1e-16 + λ(b2) = λD(b2) = 1e-16 = 1e-16 + belief change = 0 +node C: + π(c1) = p(c1|a1).πC(a1) + p(c1|a2).πC(a2) = (0.24 x 2e-17) + (0.12 x 1.8e-16) = 2.64e-17 + π(c2) = p(c2|a1).πC(a1) + p(c2|a2).πC(a2) = (0.76 x 2e-17) + (0.88 x 1.8e-16) = 1.736e-16 + λ(c1) = λD(c1) = 1e-16 = 1e-16 + λ(c2) = λD(c2) = 1e-16 = 1e-16 + belief change = 0 +node D: + π(d1) = p(d1|b1,c1).πD(b1).πD(c1) + p(d1|b1,c2).πD(b1).πD(c2) + p(d1|b2,c1).πD(b2).πD(c1) + p(d1|b2,c2).πD(b2).πD(c2) = (0.2 x 1.086e-16 x 2.64e-17) + (0.7 x 1.086e-16 x 1.736e-16) + (0.45 x 9.14e-17 x 2.64e-17) + (0.22 x 9.14e-17 x 1.736e-16) = 1.83470608e-32 + π(d2) = p(d2|b1,c1).πD(b1).πD(c1) + p(d2|b1,c2).πD(b1).πD(c2) + p(d2|b2,c1).πD(b2).πD(c1) + p(d2|b2,c2).πD(b2).πD(c2) = (0.8 x 1.086e-16 x 2.64e-17) + (0.3 x 1.086e-16 x 1.736e-16) + (0.55 x 9.14e-17 x 2.64e-17) + (0.78 x 9.14e-17 x 1.736e-16) = 2.16529392e-32 + λ(d1) = 1 + λ(d2) = 1 + belief change = 0 + + +******************************************************************************** +Iteration 64 +******************************************************************************** + +status of random variable `A': + domain π(A) λ(A) belief +---------------------------------------------------------------- + a1 0.01 1e-32 0.1 + a2 0.09 1e-32 0.9 + + domain πB(A) λB(A) +---------------------------------------------------------------- + a1 2e-17 1e-16 + a2 1.8e-16 1e-16 + + domain πC(A) λC(A) +---------------------------------------------------------------- + a1 2e-17 1e-16 + a2 1.8e-16 1e-16 + + +status of random variable `B': + domain π(B) λ(B) belief +---------------------------------------------------------------- + b1 1.086e-16 1e-16 0.543 + b2 9.14e-17 1e-16 0.457 + + domain πD(B) λD(B) +---------------------------------------------------------------- + b1 1.086e-16 1e-16 + b2 9.14e-17 1e-16 + + +status of random variable `C': + domain π(C) λ(C) belief +---------------------------------------------------------------- + c1 2.64e-17 1e-16 0.132 + c2 1.736e-16 1e-16 0.868 + + domain πD(C) λD(C) +---------------------------------------------------------------- + c1 2.64e-17 1e-16 + c2 1.736e-16 1e-16 + + +status of random variable `D': + domain π(D) λ(D) belief +---------------------------------------------------------------- + d1 1.83470608e-32 1 0.45867652 + d2 2.16529392e-32 1 0.54132348 + +λ message B --> A + λB(a1) = [p(b1|a1)].λ(b1) + [p(b2|a1)].λ(b2) = [(0.03)]x1e-16 + [(0.97)]x1e-16 = 1e-16 + λB(a2) = [p(b1|a2)].λ(b1) + [p(b2|a2)].λ(b2) = [(0.6)]x1e-16 + [(0.4)]x1e-16 = 1e-16 +λ message C --> A + λC(a1) = [p(c1|a1)].λ(c1) + [p(c2|a1)].λ(c2) = [(0.24)]x1e-16 + [(0.76)]x1e-16 = 1e-16 + λC(a2) = [p(c1|a2)].λ(c1) + [p(c2|a2)].λ(c2) = [(0.12)]x1e-16 + [(0.88)]x1e-16 = 1e-16 +λ message D --> B + λD(b1) = [p(d1|b1,c1).πD(c1) + p(d1|b1,c2).πD(c2)].λ(d1) + [p(d2|b1,c1).πD(c1) + p(d2|b1,c2).πD(c2)].λ(d2) = [(0.2x2.64e-17) + (0.7x1.736e-16)]x1 + [(0.8x2.64e-17) + (0.3x1.736e-16)]x1 = 2e-16 + λD(b2) = [p(d1|b2,c1).πD(c1) + p(d1|b2,c2).πD(c2)].λ(d1) + [p(d2|b2,c1).πD(c1) + p(d2|b2,c2).πD(c2)].λ(d2) = [(0.45x2.64e-17) + (0.22x1.736e-16)]x1 + [(0.55x2.64e-17) + (0.78x1.736e-16)]x1 = 2e-16 +λ message D --> C + λD(c1) = [p(d1|b1,c1).πD(b1) + p(d1|b2,c1).πD(b2)].λ(d1) + [p(d2|b1,c1).πD(b1) + p(d2|b2,c1).πD(b2)].λ(d2) = [(0.2x1.086e-16) + (0.45x9.14e-17)]x1 + [(0.8x1.086e-16) + (0.55x9.14e-17)]x1 = 2e-16 + λD(c2) = [p(d1|b1,c2).πD(b1) + p(d1|b2,c2).πD(b2)].λ(d1) + [p(d2|b1,c2).πD(b1) + p(d2|b2,c2).πD(b2)].λ(d2) = [(0.7x1.086e-16) + (0.22x9.14e-17)]x1 + [(0.3x1.086e-16) + (0.78x9.14e-17)]x1 = 2e-16 +π message A --> B + πB(a1) = π(a1).λC(a1) = 0.01 x 1e-16 = 1e-18 + πB(a2) = π(a2).λC(a2) = 0.09 x 1e-16 = 9e-18 +π message A --> C + πC(a1) = π(a1).λB(a1) = 0.01 x 1e-16 = 1e-18 + πC(a2) = π(a2).λB(a2) = 0.09 x 1e-16 = 9e-18 +π message B --> D + πD(b1) = π(b1) = 1.086e-16 = 1.086e-16 + πD(b2) = π(b2) = 9.14e-17 = 9.14e-17 +π message C --> D + πD(c1) = π(c1) = 2.64e-17 = 2.64e-17 + πD(c2) = π(c2) = 1.736e-16 = 1.736e-16 + +updating π & λ values +node A: + π(a1) = p(a1) = (0.01) = 0.01 + π(a2) = p(a2) = (0.09) = 0.09 + λ(a1) = λB(a1).λC(a1) = 1e-16 x 1e-16 = 1e-32 + λ(a2) = λB(a2).λC(a2) = 1e-16 x 1e-16 = 1e-32 + belief change = 0 +node B: + π(b1) = p(b1|a1).πB(a1) + p(b1|a2).πB(a2) = (0.03 x 1e-18) + (0.6 x 9e-18) = 5.43e-18 + π(b2) = p(b2|a1).πB(a1) + p(b2|a2).πB(a2) = (0.97 x 1e-18) + (0.4 x 9e-18) = 4.57e-18 + λ(b1) = λD(b1) = 2e-16 = 2e-16 + λ(b2) = λD(b2) = 2e-16 = 2e-16 + belief change = 1.665334537e-16 +node C: + π(c1) = p(c1|a1).πC(a1) + p(c1|a2).πC(a2) = (0.24 x 1e-18) + (0.12 x 9e-18) = 1.32e-18 + π(c2) = p(c2|a1).πC(a1) + p(c2|a2).πC(a2) = (0.76 x 1e-18) + (0.88 x 9e-18) = 8.68e-18 + λ(c1) = λD(c1) = 2e-16 = 2e-16 + λ(c2) = λD(c2) = 2e-16 = 2e-16 + belief change = 1.110223025e-16 +node D: + π(d1) = p(d1|b1,c1).πD(b1).πD(c1) + p(d1|b1,c2).πD(b1).πD(c2) + p(d1|b2,c1).πD(b2).πD(c1) + p(d1|b2,c2).πD(b2).πD(c2) = (0.2 x 1.086e-16 x 2.64e-17) + (0.7 x 1.086e-16 x 1.736e-16) + (0.45 x 9.14e-17 x 2.64e-17) + (0.22 x 9.14e-17 x 1.736e-16) = 1.83470608e-32 + π(d2) = p(d2|b1,c1).πD(b1).πD(c1) + p(d2|b1,c2).πD(b1).πD(c2) + p(d2|b2,c1).πD(b2).πD(c1) + p(d2|b2,c2).πD(b2).πD(c2) = (0.8 x 1.086e-16 x 2.64e-17) + (0.3 x 1.086e-16 x 1.736e-16) + (0.55 x 9.14e-17 x 2.64e-17) + (0.78 x 9.14e-17 x 1.736e-16) = 2.16529392e-32 + λ(d1) = 1 + λ(d2) = 1 + belief change = 0 + + +******************************************************************************** +Iteration 65 +******************************************************************************** + +status of random variable `A': + domain π(A) λ(A) belief +---------------------------------------------------------------- + a1 0.01 1e-32 0.1 + a2 0.09 1e-32 0.9 + + domain πB(A) λB(A) +---------------------------------------------------------------- + a1 1e-18 1e-16 + a2 9e-18 1e-16 + + domain πC(A) λC(A) +---------------------------------------------------------------- + a1 1e-18 1e-16 + a2 9e-18 1e-16 + + +status of random variable `B': + domain π(B) λ(B) belief +---------------------------------------------------------------- + b1 5.43e-18 2e-16 0.543 + b2 4.57e-18 2e-16 0.457 + + domain πD(B) λD(B) +---------------------------------------------------------------- + b1 1.086e-16 2e-16 + b2 9.14e-17 2e-16 + + +status of random variable `C': + domain π(C) λ(C) belief +---------------------------------------------------------------- + c1 1.32e-18 2e-16 0.132 + c2 8.68e-18 2e-16 0.868 + + domain πD(C) λD(C) +---------------------------------------------------------------- + c1 2.64e-17 2e-16 + c2 1.736e-16 2e-16 + + +status of random variable `D': + domain π(D) λ(D) belief +---------------------------------------------------------------- + d1 1.83470608e-32 1 0.45867652 + d2 2.16529392e-32 1 0.54132348 + +λ message B --> A + λB(a1) = [p(b1|a1)].λ(b1) + [p(b2|a1)].λ(b2) = [(0.03)]x2e-16 + [(0.97)]x2e-16 = 2e-16 + λB(a2) = [p(b1|a2)].λ(b1) + [p(b2|a2)].λ(b2) = [(0.6)]x2e-16 + [(0.4)]x2e-16 = 2e-16 +λ message C --> A + λC(a1) = [p(c1|a1)].λ(c1) + [p(c2|a1)].λ(c2) = [(0.24)]x2e-16 + [(0.76)]x2e-16 = 2e-16 + λC(a2) = [p(c1|a2)].λ(c1) + [p(c2|a2)].λ(c2) = [(0.12)]x2e-16 + [(0.88)]x2e-16 = 2e-16 +λ message D --> B + λD(b1) = [p(d1|b1,c1).πD(c1) + p(d1|b1,c2).πD(c2)].λ(d1) + [p(d2|b1,c1).πD(c1) + p(d2|b1,c2).πD(c2)].λ(d2) = [(0.2x2.64e-17) + (0.7x1.736e-16)]x1 + [(0.8x2.64e-17) + (0.3x1.736e-16)]x1 = 2e-16 + λD(b2) = [p(d1|b2,c1).πD(c1) + p(d1|b2,c2).πD(c2)].λ(d1) + [p(d2|b2,c1).πD(c1) + p(d2|b2,c2).πD(c2)].λ(d2) = [(0.45x2.64e-17) + (0.22x1.736e-16)]x1 + [(0.55x2.64e-17) + (0.78x1.736e-16)]x1 = 2e-16 +λ message D --> C + λD(c1) = [p(d1|b1,c1).πD(b1) + p(d1|b2,c1).πD(b2)].λ(d1) + [p(d2|b1,c1).πD(b1) + p(d2|b2,c1).πD(b2)].λ(d2) = [(0.2x1.086e-16) + (0.45x9.14e-17)]x1 + [(0.8x1.086e-16) + (0.55x9.14e-17)]x1 = 2e-16 + λD(c2) = [p(d1|b1,c2).πD(b1) + p(d1|b2,c2).πD(b2)].λ(d1) + [p(d2|b1,c2).πD(b1) + p(d2|b2,c2).πD(b2)].λ(d2) = [(0.7x1.086e-16) + (0.22x9.14e-17)]x1 + [(0.3x1.086e-16) + (0.78x9.14e-17)]x1 = 2e-16 +π message A --> B + πB(a1) = π(a1).λC(a1) = 0.01 x 1e-16 = 1e-18 + πB(a2) = π(a2).λC(a2) = 0.09 x 1e-16 = 9e-18 +π message A --> C + πC(a1) = π(a1).λB(a1) = 0.01 x 1e-16 = 1e-18 + πC(a2) = π(a2).λB(a2) = 0.09 x 1e-16 = 9e-18 +π message B --> D + πD(b1) = π(b1) = 5.43e-18 = 5.43e-18 + πD(b2) = π(b2) = 4.57e-18 = 4.57e-18 +π message C --> D + πD(c1) = π(c1) = 1.32e-18 = 1.32e-18 + πD(c2) = π(c2) = 8.68e-18 = 8.68e-18 + +updating π & λ values +node A: + π(a1) = p(a1) = (0.01) = 0.01 + π(a2) = p(a2) = (0.09) = 0.09 + λ(a1) = λB(a1).λC(a1) = 2e-16 x 2e-16 = 4e-32 + λ(a2) = λB(a2).λC(a2) = 2e-16 x 2e-16 = 4e-32 + belief change = 0 +node B: + π(b1) = p(b1|a1).πB(a1) + p(b1|a2).πB(a2) = (0.03 x 1e-18) + (0.6 x 9e-18) = 5.43e-18 + π(b2) = p(b2|a1).πB(a1) + p(b2|a2).πB(a2) = (0.97 x 1e-18) + (0.4 x 9e-18) = 4.57e-18 + λ(b1) = λD(b1) = 2e-16 = 2e-16 + λ(b2) = λD(b2) = 2e-16 = 2e-16 + belief change = 0 +node C: + π(c1) = p(c1|a1).πC(a1) + p(c1|a2).πC(a2) = (0.24 x 1e-18) + (0.12 x 9e-18) = 1.32e-18 + π(c2) = p(c2|a1).πC(a1) + p(c2|a2).πC(a2) = (0.76 x 1e-18) + (0.88 x 9e-18) = 8.68e-18 + λ(c1) = λD(c1) = 2e-16 = 2e-16 + λ(c2) = λD(c2) = 2e-16 = 2e-16 + belief change = 0 +node D: + π(d1) = p(d1|b1,c1).πD(b1).πD(c1) + p(d1|b1,c2).πD(b1).πD(c2) + p(d1|b2,c1).πD(b2).πD(c1) + p(d1|b2,c2).πD(b2).πD(c2) = (0.2 x 5.43e-18 x 1.32e-18) + (0.7 x 5.43e-18 x 8.68e-18) + (0.45 x 4.57e-18 x 1.32e-18) + (0.22 x 4.57e-18 x 8.68e-18) = 4.5867652e-35 + π(d2) = p(d2|b1,c1).πD(b1).πD(c1) + p(d2|b1,c2).πD(b1).πD(c2) + p(d2|b2,c1).πD(b2).πD(c1) + p(d2|b2,c2).πD(b2).πD(c2) = (0.8 x 5.43e-18 x 1.32e-18) + (0.3 x 5.43e-18 x 8.68e-18) + (0.55 x 4.57e-18 x 1.32e-18) + (0.78 x 4.57e-18 x 8.68e-18) = 5.4132348e-35 + λ(d1) = 1 + λ(d2) = 1 + belief change = 5.551115123e-17 + + +******************************************************************************** +Iteration 66 +******************************************************************************** + +status of random variable `A': + domain π(A) λ(A) belief +---------------------------------------------------------------- + a1 0.01 4e-32 0.1 + a2 0.09 4e-32 0.9 + + domain πB(A) λB(A) +---------------------------------------------------------------- + a1 1e-18 2e-16 + a2 9e-18 2e-16 + + domain πC(A) λC(A) +---------------------------------------------------------------- + a1 1e-18 2e-16 + a2 9e-18 2e-16 + + +status of random variable `B': + domain π(B) λ(B) belief +---------------------------------------------------------------- + b1 5.43e-18 2e-16 0.543 + b2 4.57e-18 2e-16 0.457 + + domain πD(B) λD(B) +---------------------------------------------------------------- + b1 5.43e-18 2e-16 + b2 4.57e-18 2e-16 + + +status of random variable `C': + domain π(C) λ(C) belief +---------------------------------------------------------------- + c1 1.32e-18 2e-16 0.132 + c2 8.68e-18 2e-16 0.868 + + domain πD(C) λD(C) +---------------------------------------------------------------- + c1 1.32e-18 2e-16 + c2 8.68e-18 2e-16 + + +status of random variable `D': + domain π(D) λ(D) belief +---------------------------------------------------------------- + d1 4.5867652e-35 1 0.45867652 + d2 5.4132348e-35 1 0.54132348 + +λ message B --> A + λB(a1) = [p(b1|a1)].λ(b1) + [p(b2|a1)].λ(b2) = [(0.03)]x2e-16 + [(0.97)]x2e-16 = 2e-16 + λB(a2) = [p(b1|a2)].λ(b1) + [p(b2|a2)].λ(b2) = [(0.6)]x2e-16 + [(0.4)]x2e-16 = 2e-16 +λ message C --> A + λC(a1) = [p(c1|a1)].λ(c1) + [p(c2|a1)].λ(c2) = [(0.24)]x2e-16 + [(0.76)]x2e-16 = 2e-16 + λC(a2) = [p(c1|a2)].λ(c1) + [p(c2|a2)].λ(c2) = [(0.12)]x2e-16 + [(0.88)]x2e-16 = 2e-16 +λ message D --> B + λD(b1) = [p(d1|b1,c1).πD(c1) + p(d1|b1,c2).πD(c2)].λ(d1) + [p(d2|b1,c1).πD(c1) + p(d2|b1,c2).πD(c2)].λ(d2) = [(0.2x1.32e-18) + (0.7x8.68e-18)]x1 + [(0.8x1.32e-18) + (0.3x8.68e-18)]x1 = 1e-17 + λD(b2) = [p(d1|b2,c1).πD(c1) + p(d1|b2,c2).πD(c2)].λ(d1) + [p(d2|b2,c1).πD(c1) + p(d2|b2,c2).πD(c2)].λ(d2) = [(0.45x1.32e-18) + (0.22x8.68e-18)]x1 + [(0.55x1.32e-18) + (0.78x8.68e-18)]x1 = 1e-17 +λ message D --> C + λD(c1) = [p(d1|b1,c1).πD(b1) + p(d1|b2,c1).πD(b2)].λ(d1) + [p(d2|b1,c1).πD(b1) + p(d2|b2,c1).πD(b2)].λ(d2) = [(0.2x5.43e-18) + (0.45x4.57e-18)]x1 + [(0.8x5.43e-18) + (0.55x4.57e-18)]x1 = 1e-17 + λD(c2) = [p(d1|b1,c2).πD(b1) + p(d1|b2,c2).πD(b2)].λ(d1) + [p(d2|b1,c2).πD(b1) + p(d2|b2,c2).πD(b2)].λ(d2) = [(0.7x5.43e-18) + (0.22x4.57e-18)]x1 + [(0.3x5.43e-18) + (0.78x4.57e-18)]x1 = 1e-17 +π message A --> B + πB(a1) = π(a1).λC(a1) = 0.01 x 2e-16 = 2e-18 + πB(a2) = π(a2).λC(a2) = 0.09 x 2e-16 = 1.8e-17 +π message A --> C + πC(a1) = π(a1).λB(a1) = 0.01 x 2e-16 = 2e-18 + πC(a2) = π(a2).λB(a2) = 0.09 x 2e-16 = 1.8e-17 +π message B --> D + πD(b1) = π(b1) = 5.43e-18 = 5.43e-18 + πD(b2) = π(b2) = 4.57e-18 = 4.57e-18 +π message C --> D + πD(c1) = π(c1) = 1.32e-18 = 1.32e-18 + πD(c2) = π(c2) = 8.68e-18 = 8.68e-18 + +updating π & λ values +node A: + π(a1) = p(a1) = (0.01) = 0.01 + π(a2) = p(a2) = (0.09) = 0.09 + λ(a1) = λB(a1).λC(a1) = 2e-16 x 2e-16 = 4e-32 + λ(a2) = λB(a2).λC(a2) = 2e-16 x 2e-16 = 4e-32 + belief change = 0 +node B: + π(b1) = p(b1|a1).πB(a1) + p(b1|a2).πB(a2) = (0.03 x 2e-18) + (0.6 x 1.8e-17) = 1.086e-17 + π(b2) = p(b2|a1).πB(a1) + p(b2|a2).πB(a2) = (0.97 x 2e-18) + (0.4 x 1.8e-17) = 9.14e-18 + λ(b1) = λD(b1) = 1e-17 = 1e-17 + λ(b2) = λD(b2) = 1e-17 = 1e-17 + belief change = 1.665334537e-16 +node C: + π(c1) = p(c1|a1).πC(a1) + p(c1|a2).πC(a2) = (0.24 x 2e-18) + (0.12 x 1.8e-17) = 2.64e-18 + π(c2) = p(c2|a1).πC(a1) + p(c2|a2).πC(a2) = (0.76 x 2e-18) + (0.88 x 1.8e-17) = 1.736e-17 + λ(c1) = λD(c1) = 1e-17 = 1e-17 + λ(c2) = λD(c2) = 1e-17 = 1e-17 + belief change = 1.387778781e-16 +node D: + π(d1) = p(d1|b1,c1).πD(b1).πD(c1) + p(d1|b1,c2).πD(b1).πD(c2) + p(d1|b2,c1).πD(b2).πD(c1) + p(d1|b2,c2).πD(b2).πD(c2) = (0.2 x 5.43e-18 x 1.32e-18) + (0.7 x 5.43e-18 x 8.68e-18) + (0.45 x 4.57e-18 x 1.32e-18) + (0.22 x 4.57e-18 x 8.68e-18) = 4.5867652e-35 + π(d2) = p(d2|b1,c1).πD(b1).πD(c1) + p(d2|b1,c2).πD(b1).πD(c2) + p(d2|b2,c1).πD(b2).πD(c1) + p(d2|b2,c2).πD(b2).πD(c2) = (0.8 x 5.43e-18 x 1.32e-18) + (0.3 x 5.43e-18 x 8.68e-18) + (0.55 x 4.57e-18 x 1.32e-18) + (0.78 x 4.57e-18 x 8.68e-18) = 5.4132348e-35 + λ(d1) = 1 + λ(d2) = 1 + belief change = 0 + + +******************************************************************************** +Iteration 67 +******************************************************************************** + +status of random variable `A': + domain π(A) λ(A) belief +---------------------------------------------------------------- + a1 0.01 4e-32 0.1 + a2 0.09 4e-32 0.9 + + domain πB(A) λB(A) +---------------------------------------------------------------- + a1 2e-18 2e-16 + a2 1.8e-17 2e-16 + + domain πC(A) λC(A) +---------------------------------------------------------------- + a1 2e-18 2e-16 + a2 1.8e-17 2e-16 + + +status of random variable `B': + domain π(B) λ(B) belief +---------------------------------------------------------------- + b1 1.086e-17 1e-17 0.543 + b2 9.14e-18 1e-17 0.457 + + domain πD(B) λD(B) +---------------------------------------------------------------- + b1 5.43e-18 1e-17 + b2 4.57e-18 1e-17 + + +status of random variable `C': + domain π(C) λ(C) belief +---------------------------------------------------------------- + c1 2.64e-18 1e-17 0.132 + c2 1.736e-17 1e-17 0.868 + + domain πD(C) λD(C) +---------------------------------------------------------------- + c1 1.32e-18 1e-17 + c2 8.68e-18 1e-17 + + +status of random variable `D': + domain π(D) λ(D) belief +---------------------------------------------------------------- + d1 4.5867652e-35 1 0.45867652 + d2 5.4132348e-35 1 0.54132348 + +λ message B --> A + λB(a1) = [p(b1|a1)].λ(b1) + [p(b2|a1)].λ(b2) = [(0.03)]x1e-17 + [(0.97)]x1e-17 = 1e-17 + λB(a2) = [p(b1|a2)].λ(b1) + [p(b2|a2)].λ(b2) = [(0.6)]x1e-17 + [(0.4)]x1e-17 = 1e-17 +λ message C --> A + λC(a1) = [p(c1|a1)].λ(c1) + [p(c2|a1)].λ(c2) = [(0.24)]x1e-17 + [(0.76)]x1e-17 = 1e-17 + λC(a2) = [p(c1|a2)].λ(c1) + [p(c2|a2)].λ(c2) = [(0.12)]x1e-17 + [(0.88)]x1e-17 = 1e-17 +λ message D --> B + λD(b1) = [p(d1|b1,c1).πD(c1) + p(d1|b1,c2).πD(c2)].λ(d1) + [p(d2|b1,c1).πD(c1) + p(d2|b1,c2).πD(c2)].λ(d2) = [(0.2x1.32e-18) + (0.7x8.68e-18)]x1 + [(0.8x1.32e-18) + (0.3x8.68e-18)]x1 = 1e-17 + λD(b2) = [p(d1|b2,c1).πD(c1) + p(d1|b2,c2).πD(c2)].λ(d1) + [p(d2|b2,c1).πD(c1) + p(d2|b2,c2).πD(c2)].λ(d2) = [(0.45x1.32e-18) + (0.22x8.68e-18)]x1 + [(0.55x1.32e-18) + (0.78x8.68e-18)]x1 = 1e-17 +λ message D --> C + λD(c1) = [p(d1|b1,c1).πD(b1) + p(d1|b2,c1).πD(b2)].λ(d1) + [p(d2|b1,c1).πD(b1) + p(d2|b2,c1).πD(b2)].λ(d2) = [(0.2x5.43e-18) + (0.45x4.57e-18)]x1 + [(0.8x5.43e-18) + (0.55x4.57e-18)]x1 = 1e-17 + λD(c2) = [p(d1|b1,c2).πD(b1) + p(d1|b2,c2).πD(b2)].λ(d1) + [p(d2|b1,c2).πD(b1) + p(d2|b2,c2).πD(b2)].λ(d2) = [(0.7x5.43e-18) + (0.22x4.57e-18)]x1 + [(0.3x5.43e-18) + (0.78x4.57e-18)]x1 = 1e-17 +π message A --> B + πB(a1) = π(a1).λC(a1) = 0.01 x 2e-16 = 2e-18 + πB(a2) = π(a2).λC(a2) = 0.09 x 2e-16 = 1.8e-17 +π message A --> C + πC(a1) = π(a1).λB(a1) = 0.01 x 2e-16 = 2e-18 + πC(a2) = π(a2).λB(a2) = 0.09 x 2e-16 = 1.8e-17 +π message B --> D + πD(b1) = π(b1) = 1.086e-17 = 1.086e-17 + πD(b2) = π(b2) = 9.14e-18 = 9.14e-18 +π message C --> D + πD(c1) = π(c1) = 2.64e-18 = 2.64e-18 + πD(c2) = π(c2) = 1.736e-17 = 1.736e-17 + +updating π & λ values +node A: + π(a1) = p(a1) = (0.01) = 0.01 + π(a2) = p(a2) = (0.09) = 0.09 + λ(a1) = λB(a1).λC(a1) = 1e-17 x 1e-17 = 1e-34 + λ(a2) = λB(a2).λC(a2) = 1e-17 x 1e-17 = 1e-34 + belief change = 2.775557562e-17 +node B: + π(b1) = p(b1|a1).πB(a1) + p(b1|a2).πB(a2) = (0.03 x 2e-18) + (0.6 x 1.8e-17) = 1.086e-17 + π(b2) = p(b2|a1).πB(a1) + p(b2|a2).πB(a2) = (0.97 x 2e-18) + (0.4 x 1.8e-17) = 9.14e-18 + λ(b1) = λD(b1) = 1e-17 = 1e-17 + λ(b2) = λD(b2) = 1e-17 = 1e-17 + belief change = 0 +node C: + π(c1) = p(c1|a1).πC(a1) + p(c1|a2).πC(a2) = (0.24 x 2e-18) + (0.12 x 1.8e-17) = 2.64e-18 + π(c2) = p(c2|a1).πC(a1) + p(c2|a2).πC(a2) = (0.76 x 2e-18) + (0.88 x 1.8e-17) = 1.736e-17 + λ(c1) = λD(c1) = 1e-17 = 1e-17 + λ(c2) = λD(c2) = 1e-17 = 1e-17 + belief change = 0 +node D: + π(d1) = p(d1|b1,c1).πD(b1).πD(c1) + p(d1|b1,c2).πD(b1).πD(c2) + p(d1|b2,c1).πD(b2).πD(c1) + p(d1|b2,c2).πD(b2).πD(c2) = (0.2 x 1.086e-17 x 2.64e-18) + (0.7 x 1.086e-17 x 1.736e-17) + (0.45 x 9.14e-18 x 2.64e-18) + (0.22 x 9.14e-18 x 1.736e-17) = 1.83470608e-34 + π(d2) = p(d2|b1,c1).πD(b1).πD(c1) + p(d2|b1,c2).πD(b1).πD(c2) + p(d2|b2,c1).πD(b2).πD(c1) + p(d2|b2,c2).πD(b2).πD(c2) = (0.8 x 1.086e-17 x 2.64e-18) + (0.3 x 1.086e-17 x 1.736e-17) + (0.55 x 9.14e-18 x 2.64e-18) + (0.78 x 9.14e-18 x 1.736e-17) = 2.16529392e-34 + λ(d1) = 1 + λ(d2) = 1 + belief change = 0 + + +******************************************************************************** +Iteration 68 +******************************************************************************** + +status of random variable `A': + domain π(A) λ(A) belief +---------------------------------------------------------------- + a1 0.01 1e-34 0.1 + a2 0.09 1e-34 0.9 + + domain πB(A) λB(A) +---------------------------------------------------------------- + a1 2e-18 1e-17 + a2 1.8e-17 1e-17 + + domain πC(A) λC(A) +---------------------------------------------------------------- + a1 2e-18 1e-17 + a2 1.8e-17 1e-17 + + +status of random variable `B': + domain π(B) λ(B) belief +---------------------------------------------------------------- + b1 1.086e-17 1e-17 0.543 + b2 9.14e-18 1e-17 0.457 + + domain πD(B) λD(B) +---------------------------------------------------------------- + b1 1.086e-17 1e-17 + b2 9.14e-18 1e-17 + + +status of random variable `C': + domain π(C) λ(C) belief +---------------------------------------------------------------- + c1 2.64e-18 1e-17 0.132 + c2 1.736e-17 1e-17 0.868 + + domain πD(C) λD(C) +---------------------------------------------------------------- + c1 2.64e-18 1e-17 + c2 1.736e-17 1e-17 + + +status of random variable `D': + domain π(D) λ(D) belief +---------------------------------------------------------------- + d1 1.83470608e-34 1 0.45867652 + d2 2.16529392e-34 1 0.54132348 + +λ message B --> A + λB(a1) = [p(b1|a1)].λ(b1) + [p(b2|a1)].λ(b2) = [(0.03)]x1e-17 + [(0.97)]x1e-17 = 1e-17 + λB(a2) = [p(b1|a2)].λ(b1) + [p(b2|a2)].λ(b2) = [(0.6)]x1e-17 + [(0.4)]x1e-17 = 1e-17 +λ message C --> A + λC(a1) = [p(c1|a1)].λ(c1) + [p(c2|a1)].λ(c2) = [(0.24)]x1e-17 + [(0.76)]x1e-17 = 1e-17 + λC(a2) = [p(c1|a2)].λ(c1) + [p(c2|a2)].λ(c2) = [(0.12)]x1e-17 + [(0.88)]x1e-17 = 1e-17 +λ message D --> B + λD(b1) = [p(d1|b1,c1).πD(c1) + p(d1|b1,c2).πD(c2)].λ(d1) + [p(d2|b1,c1).πD(c1) + p(d2|b1,c2).πD(c2)].λ(d2) = [(0.2x2.64e-18) + (0.7x1.736e-17)]x1 + [(0.8x2.64e-18) + (0.3x1.736e-17)]x1 = 2e-17 + λD(b2) = [p(d1|b2,c1).πD(c1) + p(d1|b2,c2).πD(c2)].λ(d1) + [p(d2|b2,c1).πD(c1) + p(d2|b2,c2).πD(c2)].λ(d2) = [(0.45x2.64e-18) + (0.22x1.736e-17)]x1 + [(0.55x2.64e-18) + (0.78x1.736e-17)]x1 = 2e-17 +λ message D --> C + λD(c1) = [p(d1|b1,c1).πD(b1) + p(d1|b2,c1).πD(b2)].λ(d1) + [p(d2|b1,c1).πD(b1) + p(d2|b2,c1).πD(b2)].λ(d2) = [(0.2x1.086e-17) + (0.45x9.14e-18)]x1 + [(0.8x1.086e-17) + (0.55x9.14e-18)]x1 = 2e-17 + λD(c2) = [p(d1|b1,c2).πD(b1) + p(d1|b2,c2).πD(b2)].λ(d1) + [p(d2|b1,c2).πD(b1) + p(d2|b2,c2).πD(b2)].λ(d2) = [(0.7x1.086e-17) + (0.22x9.14e-18)]x1 + [(0.3x1.086e-17) + (0.78x9.14e-18)]x1 = 2e-17 +π message A --> B + πB(a1) = π(a1).λC(a1) = 0.01 x 1e-17 = 1e-19 + πB(a2) = π(a2).λC(a2) = 0.09 x 1e-17 = 9e-19 +π message A --> C + πC(a1) = π(a1).λB(a1) = 0.01 x 1e-17 = 1e-19 + πC(a2) = π(a2).λB(a2) = 0.09 x 1e-17 = 9e-19 +π message B --> D + πD(b1) = π(b1) = 1.086e-17 = 1.086e-17 + πD(b2) = π(b2) = 9.14e-18 = 9.14e-18 +π message C --> D + πD(c1) = π(c1) = 2.64e-18 = 2.64e-18 + πD(c2) = π(c2) = 1.736e-17 = 1.736e-17 + +updating π & λ values +node A: + π(a1) = p(a1) = (0.01) = 0.01 + π(a2) = p(a2) = (0.09) = 0.09 + λ(a1) = λB(a1).λC(a1) = 1e-17 x 1e-17 = 1e-34 + λ(a2) = λB(a2).λC(a2) = 1e-17 x 1e-17 = 1e-34 + belief change = 0 +node B: + π(b1) = p(b1|a1).πB(a1) + p(b1|a2).πB(a2) = (0.03 x 1e-19) + (0.6 x 9e-19) = 5.43e-19 + π(b2) = p(b2|a1).πB(a1) + p(b2|a2).πB(a2) = (0.97 x 1e-19) + (0.4 x 9e-19) = 4.57e-19 + λ(b1) = λD(b1) = 2e-17 = 2e-17 + λ(b2) = λD(b2) = 2e-17 = 2e-17 + belief change = 5.551115123e-17 +node C: + π(c1) = p(c1|a1).πC(a1) + p(c1|a2).πC(a2) = (0.24 x 1e-19) + (0.12 x 9e-19) = 1.32e-19 + π(c2) = p(c2|a1).πC(a1) + p(c2|a2).πC(a2) = (0.76 x 1e-19) + (0.88 x 9e-19) = 8.68e-19 + λ(c1) = λD(c1) = 2e-17 = 2e-17 + λ(c2) = λD(c2) = 2e-17 = 2e-17 + belief change = 1.110223025e-16 +node D: + π(d1) = p(d1|b1,c1).πD(b1).πD(c1) + p(d1|b1,c2).πD(b1).πD(c2) + p(d1|b2,c1).πD(b2).πD(c1) + p(d1|b2,c2).πD(b2).πD(c2) = (0.2 x 1.086e-17 x 2.64e-18) + (0.7 x 1.086e-17 x 1.736e-17) + (0.45 x 9.14e-18 x 2.64e-18) + (0.22 x 9.14e-18 x 1.736e-17) = 1.83470608e-34 + π(d2) = p(d2|b1,c1).πD(b1).πD(c1) + p(d2|b1,c2).πD(b1).πD(c2) + p(d2|b2,c1).πD(b2).πD(c1) + p(d2|b2,c2).πD(b2).πD(c2) = (0.8 x 1.086e-17 x 2.64e-18) + (0.3 x 1.086e-17 x 1.736e-17) + (0.55 x 9.14e-18 x 2.64e-18) + (0.78 x 9.14e-18 x 1.736e-17) = 2.16529392e-34 + λ(d1) = 1 + λ(d2) = 1 + belief change = 0 + + +******************************************************************************** +Iteration 69 +******************************************************************************** + +status of random variable `A': + domain π(A) λ(A) belief +---------------------------------------------------------------- + a1 0.01 1e-34 0.1 + a2 0.09 1e-34 0.9 + + domain πB(A) λB(A) +---------------------------------------------------------------- + a1 1e-19 1e-17 + a2 9e-19 1e-17 + + domain πC(A) λC(A) +---------------------------------------------------------------- + a1 1e-19 1e-17 + a2 9e-19 1e-17 + + +status of random variable `B': + domain π(B) λ(B) belief +---------------------------------------------------------------- + b1 5.43e-19 2e-17 0.543 + b2 4.57e-19 2e-17 0.457 + + domain πD(B) λD(B) +---------------------------------------------------------------- + b1 1.086e-17 2e-17 + b2 9.14e-18 2e-17 + + +status of random variable `C': + domain π(C) λ(C) belief +---------------------------------------------------------------- + c1 1.32e-19 2e-17 0.132 + c2 8.68e-19 2e-17 0.868 + + domain πD(C) λD(C) +---------------------------------------------------------------- + c1 2.64e-18 2e-17 + c2 1.736e-17 2e-17 + + +status of random variable `D': + domain π(D) λ(D) belief +---------------------------------------------------------------- + d1 1.83470608e-34 1 0.45867652 + d2 2.16529392e-34 1 0.54132348 + +λ message B --> A + λB(a1) = [p(b1|a1)].λ(b1) + [p(b2|a1)].λ(b2) = [(0.03)]x2e-17 + [(0.97)]x2e-17 = 2e-17 + λB(a2) = [p(b1|a2)].λ(b1) + [p(b2|a2)].λ(b2) = [(0.6)]x2e-17 + [(0.4)]x2e-17 = 2e-17 +λ message C --> A + λC(a1) = [p(c1|a1)].λ(c1) + [p(c2|a1)].λ(c2) = [(0.24)]x2e-17 + [(0.76)]x2e-17 = 2e-17 + λC(a2) = [p(c1|a2)].λ(c1) + [p(c2|a2)].λ(c2) = [(0.12)]x2e-17 + [(0.88)]x2e-17 = 2e-17 +λ message D --> B + λD(b1) = [p(d1|b1,c1).πD(c1) + p(d1|b1,c2).πD(c2)].λ(d1) + [p(d2|b1,c1).πD(c1) + p(d2|b1,c2).πD(c2)].λ(d2) = [(0.2x2.64e-18) + (0.7x1.736e-17)]x1 + [(0.8x2.64e-18) + (0.3x1.736e-17)]x1 = 2e-17 + λD(b2) = [p(d1|b2,c1).πD(c1) + p(d1|b2,c2).πD(c2)].λ(d1) + [p(d2|b2,c1).πD(c1) + p(d2|b2,c2).πD(c2)].λ(d2) = [(0.45x2.64e-18) + (0.22x1.736e-17)]x1 + [(0.55x2.64e-18) + (0.78x1.736e-17)]x1 = 2e-17 +λ message D --> C + λD(c1) = [p(d1|b1,c1).πD(b1) + p(d1|b2,c1).πD(b2)].λ(d1) + [p(d2|b1,c1).πD(b1) + p(d2|b2,c1).πD(b2)].λ(d2) = [(0.2x1.086e-17) + (0.45x9.14e-18)]x1 + [(0.8x1.086e-17) + (0.55x9.14e-18)]x1 = 2e-17 + λD(c2) = [p(d1|b1,c2).πD(b1) + p(d1|b2,c2).πD(b2)].λ(d1) + [p(d2|b1,c2).πD(b1) + p(d2|b2,c2).πD(b2)].λ(d2) = [(0.7x1.086e-17) + (0.22x9.14e-18)]x1 + [(0.3x1.086e-17) + (0.78x9.14e-18)]x1 = 2e-17 +π message A --> B + πB(a1) = π(a1).λC(a1) = 0.01 x 1e-17 = 1e-19 + πB(a2) = π(a2).λC(a2) = 0.09 x 1e-17 = 9e-19 +π message A --> C + πC(a1) = π(a1).λB(a1) = 0.01 x 1e-17 = 1e-19 + πC(a2) = π(a2).λB(a2) = 0.09 x 1e-17 = 9e-19 +π message B --> D + πD(b1) = π(b1) = 5.43e-19 = 5.43e-19 + πD(b2) = π(b2) = 4.57e-19 = 4.57e-19 +π message C --> D + πD(c1) = π(c1) = 1.32e-19 = 1.32e-19 + πD(c2) = π(c2) = 8.68e-19 = 8.68e-19 + +updating π & λ values +node A: + π(a1) = p(a1) = (0.01) = 0.01 + π(a2) = p(a2) = (0.09) = 0.09 + λ(a1) = λB(a1).λC(a1) = 2e-17 x 2e-17 = 4e-34 + λ(a2) = λB(a2).λC(a2) = 2e-17 x 2e-17 = 4e-34 + belief change = 0 +node B: + π(b1) = p(b1|a1).πB(a1) + p(b1|a2).πB(a2) = (0.03 x 1e-19) + (0.6 x 9e-19) = 5.43e-19 + π(b2) = p(b2|a1).πB(a1) + p(b2|a2).πB(a2) = (0.97 x 1e-19) + (0.4 x 9e-19) = 4.57e-19 + λ(b1) = λD(b1) = 2e-17 = 2e-17 + λ(b2) = λD(b2) = 2e-17 = 2e-17 + belief change = 0 +node C: + π(c1) = p(c1|a1).πC(a1) + p(c1|a2).πC(a2) = (0.24 x 1e-19) + (0.12 x 9e-19) = 1.32e-19 + π(c2) = p(c2|a1).πC(a1) + p(c2|a2).πC(a2) = (0.76 x 1e-19) + (0.88 x 9e-19) = 8.68e-19 + λ(c1) = λD(c1) = 2e-17 = 2e-17 + λ(c2) = λD(c2) = 2e-17 = 2e-17 + belief change = 0 +node D: + π(d1) = p(d1|b1,c1).πD(b1).πD(c1) + p(d1|b1,c2).πD(b1).πD(c2) + p(d1|b2,c1).πD(b2).πD(c1) + p(d1|b2,c2).πD(b2).πD(c2) = (0.2 x 5.43e-19 x 1.32e-19) + (0.7 x 5.43e-19 x 8.68e-19) + (0.45 x 4.57e-19 x 1.32e-19) + (0.22 x 4.57e-19 x 8.68e-19) = 4.5867652e-37 + π(d2) = p(d2|b1,c1).πD(b1).πD(c1) + p(d2|b1,c2).πD(b1).πD(c2) + p(d2|b2,c1).πD(b2).πD(c1) + p(d2|b2,c2).πD(b2).πD(c2) = (0.8 x 5.43e-19 x 1.32e-19) + (0.3 x 5.43e-19 x 8.68e-19) + (0.55 x 4.57e-19 x 1.32e-19) + (0.78 x 4.57e-19 x 8.68e-19) = 5.4132348e-37 + λ(d1) = 1 + λ(d2) = 1 + belief change = 0 + + +******************************************************************************** +Iteration 70 +******************************************************************************** + +status of random variable `A': + domain π(A) λ(A) belief +---------------------------------------------------------------- + a1 0.01 4e-34 0.1 + a2 0.09 4e-34 0.9 + + domain πB(A) λB(A) +---------------------------------------------------------------- + a1 1e-19 2e-17 + a2 9e-19 2e-17 + + domain πC(A) λC(A) +---------------------------------------------------------------- + a1 1e-19 2e-17 + a2 9e-19 2e-17 + + +status of random variable `B': + domain π(B) λ(B) belief +---------------------------------------------------------------- + b1 5.43e-19 2e-17 0.543 + b2 4.57e-19 2e-17 0.457 + + domain πD(B) λD(B) +---------------------------------------------------------------- + b1 5.43e-19 2e-17 + b2 4.57e-19 2e-17 + + +status of random variable `C': + domain π(C) λ(C) belief +---------------------------------------------------------------- + c1 1.32e-19 2e-17 0.132 + c2 8.68e-19 2e-17 0.868 + + domain πD(C) λD(C) +---------------------------------------------------------------- + c1 1.32e-19 2e-17 + c2 8.68e-19 2e-17 + + +status of random variable `D': + domain π(D) λ(D) belief +---------------------------------------------------------------- + d1 4.5867652e-37 1 0.45867652 + d2 5.4132348e-37 1 0.54132348 + +λ message B --> A + λB(a1) = [p(b1|a1)].λ(b1) + [p(b2|a1)].λ(b2) = [(0.03)]x2e-17 + [(0.97)]x2e-17 = 2e-17 + λB(a2) = [p(b1|a2)].λ(b1) + [p(b2|a2)].λ(b2) = [(0.6)]x2e-17 + [(0.4)]x2e-17 = 2e-17 +λ message C --> A + λC(a1) = [p(c1|a1)].λ(c1) + [p(c2|a1)].λ(c2) = [(0.24)]x2e-17 + [(0.76)]x2e-17 = 2e-17 + λC(a2) = [p(c1|a2)].λ(c1) + [p(c2|a2)].λ(c2) = [(0.12)]x2e-17 + [(0.88)]x2e-17 = 2e-17 +λ message D --> B + λD(b1) = [p(d1|b1,c1).πD(c1) + p(d1|b1,c2).πD(c2)].λ(d1) + [p(d2|b1,c1).πD(c1) + p(d2|b1,c2).πD(c2)].λ(d2) = [(0.2x1.32e-19) + (0.7x8.68e-19)]x1 + [(0.8x1.32e-19) + (0.3x8.68e-19)]x1 = 1e-18 + λD(b2) = [p(d1|b2,c1).πD(c1) + p(d1|b2,c2).πD(c2)].λ(d1) + [p(d2|b2,c1).πD(c1) + p(d2|b2,c2).πD(c2)].λ(d2) = [(0.45x1.32e-19) + (0.22x8.68e-19)]x1 + [(0.55x1.32e-19) + (0.78x8.68e-19)]x1 = 1e-18 +λ message D --> C + λD(c1) = [p(d1|b1,c1).πD(b1) + p(d1|b2,c1).πD(b2)].λ(d1) + [p(d2|b1,c1).πD(b1) + p(d2|b2,c1).πD(b2)].λ(d2) = [(0.2x5.43e-19) + (0.45x4.57e-19)]x1 + [(0.8x5.43e-19) + (0.55x4.57e-19)]x1 = 1e-18 + λD(c2) = [p(d1|b1,c2).πD(b1) + p(d1|b2,c2).πD(b2)].λ(d1) + [p(d2|b1,c2).πD(b1) + p(d2|b2,c2).πD(b2)].λ(d2) = [(0.7x5.43e-19) + (0.22x4.57e-19)]x1 + [(0.3x5.43e-19) + (0.78x4.57e-19)]x1 = 1e-18 +π message A --> B + πB(a1) = π(a1).λC(a1) = 0.01 x 2e-17 = 2e-19 + πB(a2) = π(a2).λC(a2) = 0.09 x 2e-17 = 1.8e-18 +π message A --> C + πC(a1) = π(a1).λB(a1) = 0.01 x 2e-17 = 2e-19 + πC(a2) = π(a2).λB(a2) = 0.09 x 2e-17 = 1.8e-18 +π message B --> D + πD(b1) = π(b1) = 5.43e-19 = 5.43e-19 + πD(b2) = π(b2) = 4.57e-19 = 4.57e-19 +π message C --> D + πD(c1) = π(c1) = 1.32e-19 = 1.32e-19 + πD(c2) = π(c2) = 8.68e-19 = 8.68e-19 + +updating π & λ values +node A: + π(a1) = p(a1) = (0.01) = 0.01 + π(a2) = p(a2) = (0.09) = 0.09 + λ(a1) = λB(a1).λC(a1) = 2e-17 x 2e-17 = 4e-34 + λ(a2) = λB(a2).λC(a2) = 2e-17 x 2e-17 = 4e-34 + belief change = 0 +node B: + π(b1) = p(b1|a1).πB(a1) + p(b1|a2).πB(a2) = (0.03 x 2e-19) + (0.6 x 1.8e-18) = 1.086e-18 + π(b2) = p(b2|a1).πB(a1) + p(b2|a2).πB(a2) = (0.97 x 2e-19) + (0.4 x 1.8e-18) = 9.14e-19 + λ(b1) = λD(b1) = 1e-18 = 1e-18 + λ(b2) = λD(b2) = 1e-18 = 1e-18 + belief change = 5.551115123e-17 +node C: + π(c1) = p(c1|a1).πC(a1) + p(c1|a2).πC(a2) = (0.24 x 2e-19) + (0.12 x 1.8e-18) = 2.64e-19 + π(c2) = p(c2|a1).πC(a1) + p(c2|a2).πC(a2) = (0.76 x 2e-19) + (0.88 x 1.8e-18) = 1.736e-18 + λ(c1) = λD(c1) = 1e-18 = 1e-18 + λ(c2) = λD(c2) = 1e-18 = 1e-18 + belief change = 2.775557562e-17 +node D: + π(d1) = p(d1|b1,c1).πD(b1).πD(c1) + p(d1|b1,c2).πD(b1).πD(c2) + p(d1|b2,c1).πD(b2).πD(c1) + p(d1|b2,c2).πD(b2).πD(c2) = (0.2 x 5.43e-19 x 1.32e-19) + (0.7 x 5.43e-19 x 8.68e-19) + (0.45 x 4.57e-19 x 1.32e-19) + (0.22 x 4.57e-19 x 8.68e-19) = 4.5867652e-37 + π(d2) = p(d2|b1,c1).πD(b1).πD(c1) + p(d2|b1,c2).πD(b1).πD(c2) + p(d2|b2,c1).πD(b2).πD(c1) + p(d2|b2,c2).πD(b2).πD(c2) = (0.8 x 5.43e-19 x 1.32e-19) + (0.3 x 5.43e-19 x 8.68e-19) + (0.55 x 4.57e-19 x 1.32e-19) + (0.78 x 4.57e-19 x 8.68e-19) = 5.4132348e-37 + λ(d1) = 1 + λ(d2) = 1 + belief change = 0 + + +******************************************************************************** +Iteration 71 +******************************************************************************** + +status of random variable `A': + domain π(A) λ(A) belief +---------------------------------------------------------------- + a1 0.01 4e-34 0.1 + a2 0.09 4e-34 0.9 + + domain πB(A) λB(A) +---------------------------------------------------------------- + a1 2e-19 2e-17 + a2 1.8e-18 2e-17 + + domain πC(A) λC(A) +---------------------------------------------------------------- + a1 2e-19 2e-17 + a2 1.8e-18 2e-17 + + +status of random variable `B': + domain π(B) λ(B) belief +---------------------------------------------------------------- + b1 1.086e-18 1e-18 0.543 + b2 9.14e-19 1e-18 0.457 + + domain πD(B) λD(B) +---------------------------------------------------------------- + b1 5.43e-19 1e-18 + b2 4.57e-19 1e-18 + + +status of random variable `C': + domain π(C) λ(C) belief +---------------------------------------------------------------- + c1 2.64e-19 1e-18 0.132 + c2 1.736e-18 1e-18 0.868 + + domain πD(C) λD(C) +---------------------------------------------------------------- + c1 1.32e-19 1e-18 + c2 8.68e-19 1e-18 + + +status of random variable `D': + domain π(D) λ(D) belief +---------------------------------------------------------------- + d1 4.5867652e-37 1 0.45867652 + d2 5.4132348e-37 1 0.54132348 + +λ message B --> A + λB(a1) = [p(b1|a1)].λ(b1) + [p(b2|a1)].λ(b2) = [(0.03)]x1e-18 + [(0.97)]x1e-18 = 1e-18 + λB(a2) = [p(b1|a2)].λ(b1) + [p(b2|a2)].λ(b2) = [(0.6)]x1e-18 + [(0.4)]x1e-18 = 1e-18 +λ message C --> A + λC(a1) = [p(c1|a1)].λ(c1) + [p(c2|a1)].λ(c2) = [(0.24)]x1e-18 + [(0.76)]x1e-18 = 1e-18 + λC(a2) = [p(c1|a2)].λ(c1) + [p(c2|a2)].λ(c2) = [(0.12)]x1e-18 + [(0.88)]x1e-18 = 1e-18 +λ message D --> B + λD(b1) = [p(d1|b1,c1).πD(c1) + p(d1|b1,c2).πD(c2)].λ(d1) + [p(d2|b1,c1).πD(c1) + p(d2|b1,c2).πD(c2)].λ(d2) = [(0.2x1.32e-19) + (0.7x8.68e-19)]x1 + [(0.8x1.32e-19) + (0.3x8.68e-19)]x1 = 1e-18 + λD(b2) = [p(d1|b2,c1).πD(c1) + p(d1|b2,c2).πD(c2)].λ(d1) + [p(d2|b2,c1).πD(c1) + p(d2|b2,c2).πD(c2)].λ(d2) = [(0.45x1.32e-19) + (0.22x8.68e-19)]x1 + [(0.55x1.32e-19) + (0.78x8.68e-19)]x1 = 1e-18 +λ message D --> C + λD(c1) = [p(d1|b1,c1).πD(b1) + p(d1|b2,c1).πD(b2)].λ(d1) + [p(d2|b1,c1).πD(b1) + p(d2|b2,c1).πD(b2)].λ(d2) = [(0.2x5.43e-19) + (0.45x4.57e-19)]x1 + [(0.8x5.43e-19) + (0.55x4.57e-19)]x1 = 1e-18 + λD(c2) = [p(d1|b1,c2).πD(b1) + p(d1|b2,c2).πD(b2)].λ(d1) + [p(d2|b1,c2).πD(b1) + p(d2|b2,c2).πD(b2)].λ(d2) = [(0.7x5.43e-19) + (0.22x4.57e-19)]x1 + [(0.3x5.43e-19) + (0.78x4.57e-19)]x1 = 1e-18 +π message A --> B + πB(a1) = π(a1).λC(a1) = 0.01 x 2e-17 = 2e-19 + πB(a2) = π(a2).λC(a2) = 0.09 x 2e-17 = 1.8e-18 +π message A --> C + πC(a1) = π(a1).λB(a1) = 0.01 x 2e-17 = 2e-19 + πC(a2) = π(a2).λB(a2) = 0.09 x 2e-17 = 1.8e-18 +π message B --> D + πD(b1) = π(b1) = 1.086e-18 = 1.086e-18 + πD(b2) = π(b2) = 9.14e-19 = 9.14e-19 +π message C --> D + πD(c1) = π(c1) = 2.64e-19 = 2.64e-19 + πD(c2) = π(c2) = 1.736e-18 = 1.736e-18 + +updating π & λ values +node A: + π(a1) = p(a1) = (0.01) = 0.01 + π(a2) = p(a2) = (0.09) = 0.09 + λ(a1) = λB(a1).λC(a1) = 1e-18 x 1e-18 = 1e-36 + λ(a2) = λB(a2).λC(a2) = 1e-18 x 1e-18 = 1e-36 + belief change = 1.110223025e-16 +node B: + π(b1) = p(b1|a1).πB(a1) + p(b1|a2).πB(a2) = (0.03 x 2e-19) + (0.6 x 1.8e-18) = 1.086e-18 + π(b2) = p(b2|a1).πB(a1) + p(b2|a2).πB(a2) = (0.97 x 2e-19) + (0.4 x 1.8e-18) = 9.14e-19 + λ(b1) = λD(b1) = 1e-18 = 1e-18 + λ(b2) = λD(b2) = 1e-18 = 1e-18 + belief change = 0 +node C: + π(c1) = p(c1|a1).πC(a1) + p(c1|a2).πC(a2) = (0.24 x 2e-19) + (0.12 x 1.8e-18) = 2.64e-19 + π(c2) = p(c2|a1).πC(a1) + p(c2|a2).πC(a2) = (0.76 x 2e-19) + (0.88 x 1.8e-18) = 1.736e-18 + λ(c1) = λD(c1) = 1e-18 = 1e-18 + λ(c2) = λD(c2) = 1e-18 = 1e-18 + belief change = 0 +node D: + π(d1) = p(d1|b1,c1).πD(b1).πD(c1) + p(d1|b1,c2).πD(b1).πD(c2) + p(d1|b2,c1).πD(b2).πD(c1) + p(d1|b2,c2).πD(b2).πD(c2) = (0.2 x 1.086e-18 x 2.64e-19) + (0.7 x 1.086e-18 x 1.736e-18) + (0.45 x 9.14e-19 x 2.64e-19) + (0.22 x 9.14e-19 x 1.736e-18) = 1.83470608e-36 + π(d2) = p(d2|b1,c1).πD(b1).πD(c1) + p(d2|b1,c2).πD(b1).πD(c2) + p(d2|b2,c1).πD(b2).πD(c1) + p(d2|b2,c2).πD(b2).πD(c2) = (0.8 x 1.086e-18 x 2.64e-19) + (0.3 x 1.086e-18 x 1.736e-18) + (0.55 x 9.14e-19 x 2.64e-19) + (0.78 x 9.14e-19 x 1.736e-18) = 2.16529392e-36 + λ(d1) = 1 + λ(d2) = 1 + belief change = 0 + + +******************************************************************************** +Iteration 72 +******************************************************************************** + +status of random variable `A': + domain π(A) λ(A) belief +---------------------------------------------------------------- + a1 0.01 1e-36 0.1 + a2 0.09 1e-36 0.9 + + domain πB(A) λB(A) +---------------------------------------------------------------- + a1 2e-19 1e-18 + a2 1.8e-18 1e-18 + + domain πC(A) λC(A) +---------------------------------------------------------------- + a1 2e-19 1e-18 + a2 1.8e-18 1e-18 + + +status of random variable `B': + domain π(B) λ(B) belief +---------------------------------------------------------------- + b1 1.086e-18 1e-18 0.543 + b2 9.14e-19 1e-18 0.457 + + domain πD(B) λD(B) +---------------------------------------------------------------- + b1 1.086e-18 1e-18 + b2 9.14e-19 1e-18 + + +status of random variable `C': + domain π(C) λ(C) belief +---------------------------------------------------------------- + c1 2.64e-19 1e-18 0.132 + c2 1.736e-18 1e-18 0.868 + + domain πD(C) λD(C) +---------------------------------------------------------------- + c1 2.64e-19 1e-18 + c2 1.736e-18 1e-18 + + +status of random variable `D': + domain π(D) λ(D) belief +---------------------------------------------------------------- + d1 1.83470608e-36 1 0.45867652 + d2 2.16529392e-36 1 0.54132348 + +λ message B --> A + λB(a1) = [p(b1|a1)].λ(b1) + [p(b2|a1)].λ(b2) = [(0.03)]x1e-18 + [(0.97)]x1e-18 = 1e-18 + λB(a2) = [p(b1|a2)].λ(b1) + [p(b2|a2)].λ(b2) = [(0.6)]x1e-18 + [(0.4)]x1e-18 = 1e-18 +λ message C --> A + λC(a1) = [p(c1|a1)].λ(c1) + [p(c2|a1)].λ(c2) = [(0.24)]x1e-18 + [(0.76)]x1e-18 = 1e-18 + λC(a2) = [p(c1|a2)].λ(c1) + [p(c2|a2)].λ(c2) = [(0.12)]x1e-18 + [(0.88)]x1e-18 = 1e-18 +λ message D --> B + λD(b1) = [p(d1|b1,c1).πD(c1) + p(d1|b1,c2).πD(c2)].λ(d1) + [p(d2|b1,c1).πD(c1) + p(d2|b1,c2).πD(c2)].λ(d2) = [(0.2x2.64e-19) + (0.7x1.736e-18)]x1 + [(0.8x2.64e-19) + (0.3x1.736e-18)]x1 = 2e-18 + λD(b2) = [p(d1|b2,c1).πD(c1) + p(d1|b2,c2).πD(c2)].λ(d1) + [p(d2|b2,c1).πD(c1) + p(d2|b2,c2).πD(c2)].λ(d2) = [(0.45x2.64e-19) + (0.22x1.736e-18)]x1 + [(0.55x2.64e-19) + (0.78x1.736e-18)]x1 = 2e-18 +λ message D --> C + λD(c1) = [p(d1|b1,c1).πD(b1) + p(d1|b2,c1).πD(b2)].λ(d1) + [p(d2|b1,c1).πD(b1) + p(d2|b2,c1).πD(b2)].λ(d2) = [(0.2x1.086e-18) + (0.45x9.14e-19)]x1 + [(0.8x1.086e-18) + (0.55x9.14e-19)]x1 = 2e-18 + λD(c2) = [p(d1|b1,c2).πD(b1) + p(d1|b2,c2).πD(b2)].λ(d1) + [p(d2|b1,c2).πD(b1) + p(d2|b2,c2).πD(b2)].λ(d2) = [(0.7x1.086e-18) + (0.22x9.14e-19)]x1 + [(0.3x1.086e-18) + (0.78x9.14e-19)]x1 = 2e-18 +π message A --> B + πB(a1) = π(a1).λC(a1) = 0.01 x 1e-18 = 1e-20 + πB(a2) = π(a2).λC(a2) = 0.09 x 1e-18 = 9e-20 +π message A --> C + πC(a1) = π(a1).λB(a1) = 0.01 x 1e-18 = 1e-20 + πC(a2) = π(a2).λB(a2) = 0.09 x 1e-18 = 9e-20 +π message B --> D + πD(b1) = π(b1) = 1.086e-18 = 1.086e-18 + πD(b2) = π(b2) = 9.14e-19 = 9.14e-19 +π message C --> D + πD(c1) = π(c1) = 2.64e-19 = 2.64e-19 + πD(c2) = π(c2) = 1.736e-18 = 1.736e-18 + +updating π & λ values +node A: + π(a1) = p(a1) = (0.01) = 0.01 + π(a2) = p(a2) = (0.09) = 0.09 + λ(a1) = λB(a1).λC(a1) = 1e-18 x 1e-18 = 1e-36 + λ(a2) = λB(a2).λC(a2) = 1e-18 x 1e-18 = 1e-36 + belief change = 0 +node B: + π(b1) = p(b1|a1).πB(a1) + p(b1|a2).πB(a2) = (0.03 x 1e-20) + (0.6 x 9e-20) = 5.43e-20 + π(b2) = p(b2|a1).πB(a1) + p(b2|a2).πB(a2) = (0.97 x 1e-20) + (0.4 x 9e-20) = 4.57e-20 + λ(b1) = λD(b1) = 2e-18 = 2e-18 + λ(b2) = λD(b2) = 2e-18 = 2e-18 + belief change = 1.110223025e-16 +node C: + π(c1) = p(c1|a1).πC(a1) + p(c1|a2).πC(a2) = (0.24 x 1e-20) + (0.12 x 9e-20) = 1.32e-20 + π(c2) = p(c2|a1).πC(a1) + p(c2|a2).πC(a2) = (0.76 x 1e-20) + (0.88 x 9e-20) = 8.68e-20 + λ(c1) = λD(c1) = 2e-18 = 2e-18 + λ(c2) = λD(c2) = 2e-18 = 2e-18 + belief change = 1.387778781e-16 +node D: + π(d1) = p(d1|b1,c1).πD(b1).πD(c1) + p(d1|b1,c2).πD(b1).πD(c2) + p(d1|b2,c1).πD(b2).πD(c1) + p(d1|b2,c2).πD(b2).πD(c2) = (0.2 x 1.086e-18 x 2.64e-19) + (0.7 x 1.086e-18 x 1.736e-18) + (0.45 x 9.14e-19 x 2.64e-19) + (0.22 x 9.14e-19 x 1.736e-18) = 1.83470608e-36 + π(d2) = p(d2|b1,c1).πD(b1).πD(c1) + p(d2|b1,c2).πD(b1).πD(c2) + p(d2|b2,c1).πD(b2).πD(c1) + p(d2|b2,c2).πD(b2).πD(c2) = (0.8 x 1.086e-18 x 2.64e-19) + (0.3 x 1.086e-18 x 1.736e-18) + (0.55 x 9.14e-19 x 2.64e-19) + (0.78 x 9.14e-19 x 1.736e-18) = 2.16529392e-36 + λ(d1) = 1 + λ(d2) = 1 + belief change = 0 + + +******************************************************************************** +Iteration 73 +******************************************************************************** + +status of random variable `A': + domain π(A) λ(A) belief +---------------------------------------------------------------- + a1 0.01 1e-36 0.1 + a2 0.09 1e-36 0.9 + + domain πB(A) λB(A) +---------------------------------------------------------------- + a1 1e-20 1e-18 + a2 9e-20 1e-18 + + domain πC(A) λC(A) +---------------------------------------------------------------- + a1 1e-20 1e-18 + a2 9e-20 1e-18 + + +status of random variable `B': + domain π(B) λ(B) belief +---------------------------------------------------------------- + b1 5.43e-20 2e-18 0.543 + b2 4.57e-20 2e-18 0.457 + + domain πD(B) λD(B) +---------------------------------------------------------------- + b1 1.086e-18 2e-18 + b2 9.14e-19 2e-18 + + +status of random variable `C': + domain π(C) λ(C) belief +---------------------------------------------------------------- + c1 1.32e-20 2e-18 0.132 + c2 8.68e-20 2e-18 0.868 + + domain πD(C) λD(C) +---------------------------------------------------------------- + c1 2.64e-19 2e-18 + c2 1.736e-18 2e-18 + + +status of random variable `D': + domain π(D) λ(D) belief +---------------------------------------------------------------- + d1 1.83470608e-36 1 0.45867652 + d2 2.16529392e-36 1 0.54132348 + +λ message B --> A + λB(a1) = [p(b1|a1)].λ(b1) + [p(b2|a1)].λ(b2) = [(0.03)]x2e-18 + [(0.97)]x2e-18 = 2e-18 + λB(a2) = [p(b1|a2)].λ(b1) + [p(b2|a2)].λ(b2) = [(0.6)]x2e-18 + [(0.4)]x2e-18 = 2e-18 +λ message C --> A + λC(a1) = [p(c1|a1)].λ(c1) + [p(c2|a1)].λ(c2) = [(0.24)]x2e-18 + [(0.76)]x2e-18 = 2e-18 + λC(a2) = [p(c1|a2)].λ(c1) + [p(c2|a2)].λ(c2) = [(0.12)]x2e-18 + [(0.88)]x2e-18 = 2e-18 +λ message D --> B + λD(b1) = [p(d1|b1,c1).πD(c1) + p(d1|b1,c2).πD(c2)].λ(d1) + [p(d2|b1,c1).πD(c1) + p(d2|b1,c2).πD(c2)].λ(d2) = [(0.2x2.64e-19) + (0.7x1.736e-18)]x1 + [(0.8x2.64e-19) + (0.3x1.736e-18)]x1 = 2e-18 + λD(b2) = [p(d1|b2,c1).πD(c1) + p(d1|b2,c2).πD(c2)].λ(d1) + [p(d2|b2,c1).πD(c1) + p(d2|b2,c2).πD(c2)].λ(d2) = [(0.45x2.64e-19) + (0.22x1.736e-18)]x1 + [(0.55x2.64e-19) + (0.78x1.736e-18)]x1 = 2e-18 +λ message D --> C + λD(c1) = [p(d1|b1,c1).πD(b1) + p(d1|b2,c1).πD(b2)].λ(d1) + [p(d2|b1,c1).πD(b1) + p(d2|b2,c1).πD(b2)].λ(d2) = [(0.2x1.086e-18) + (0.45x9.14e-19)]x1 + [(0.8x1.086e-18) + (0.55x9.14e-19)]x1 = 2e-18 + λD(c2) = [p(d1|b1,c2).πD(b1) + p(d1|b2,c2).πD(b2)].λ(d1) + [p(d2|b1,c2).πD(b1) + p(d2|b2,c2).πD(b2)].λ(d2) = [(0.7x1.086e-18) + (0.22x9.14e-19)]x1 + [(0.3x1.086e-18) + (0.78x9.14e-19)]x1 = 2e-18 +π message A --> B + πB(a1) = π(a1).λC(a1) = 0.01 x 1e-18 = 1e-20 + πB(a2) = π(a2).λC(a2) = 0.09 x 1e-18 = 9e-20 +π message A --> C + πC(a1) = π(a1).λB(a1) = 0.01 x 1e-18 = 1e-20 + πC(a2) = π(a2).λB(a2) = 0.09 x 1e-18 = 9e-20 +π message B --> D + πD(b1) = π(b1) = 5.43e-20 = 5.43e-20 + πD(b2) = π(b2) = 4.57e-20 = 4.57e-20 +π message C --> D + πD(c1) = π(c1) = 1.32e-20 = 1.32e-20 + πD(c2) = π(c2) = 8.68e-20 = 8.68e-20 + +updating π & λ values +node A: + π(a1) = p(a1) = (0.01) = 0.01 + π(a2) = p(a2) = (0.09) = 0.09 + λ(a1) = λB(a1).λC(a1) = 2e-18 x 2e-18 = 4e-36 + λ(a2) = λB(a2).λC(a2) = 2e-18 x 2e-18 = 4e-36 + belief change = 0 +node B: + π(b1) = p(b1|a1).πB(a1) + p(b1|a2).πB(a2) = (0.03 x 1e-20) + (0.6 x 9e-20) = 5.43e-20 + π(b2) = p(b2|a1).πB(a1) + p(b2|a2).πB(a2) = (0.97 x 1e-20) + (0.4 x 9e-20) = 4.57e-20 + λ(b1) = λD(b1) = 2e-18 = 2e-18 + λ(b2) = λD(b2) = 2e-18 = 2e-18 + belief change = 0 +node C: + π(c1) = p(c1|a1).πC(a1) + p(c1|a2).πC(a2) = (0.24 x 1e-20) + (0.12 x 9e-20) = 1.32e-20 + π(c2) = p(c2|a1).πC(a1) + p(c2|a2).πC(a2) = (0.76 x 1e-20) + (0.88 x 9e-20) = 8.68e-20 + λ(c1) = λD(c1) = 2e-18 = 2e-18 + λ(c2) = λD(c2) = 2e-18 = 2e-18 + belief change = 0 +node D: + π(d1) = p(d1|b1,c1).πD(b1).πD(c1) + p(d1|b1,c2).πD(b1).πD(c2) + p(d1|b2,c1).πD(b2).πD(c1) + p(d1|b2,c2).πD(b2).πD(c2) = (0.2 x 5.43e-20 x 1.32e-20) + (0.7 x 5.43e-20 x 8.68e-20) + (0.45 x 4.57e-20 x 1.32e-20) + (0.22 x 4.57e-20 x 8.68e-20) = 4.5867652e-39 + π(d2) = p(d2|b1,c1).πD(b1).πD(c1) + p(d2|b1,c2).πD(b1).πD(c2) + p(d2|b2,c1).πD(b2).πD(c1) + p(d2|b2,c2).πD(b2).πD(c2) = (0.8 x 5.43e-20 x 1.32e-20) + (0.3 x 5.43e-20 x 8.68e-20) + (0.55 x 4.57e-20 x 1.32e-20) + (0.78 x 4.57e-20 x 8.68e-20) = 5.4132348e-39 + λ(d1) = 1 + λ(d2) = 1 + belief change = 0 + + +******************************************************************************** +Iteration 74 +******************************************************************************** + +status of random variable `A': + domain π(A) λ(A) belief +---------------------------------------------------------------- + a1 0.01 4e-36 0.1 + a2 0.09 4e-36 0.9 + + domain πB(A) λB(A) +---------------------------------------------------------------- + a1 1e-20 2e-18 + a2 9e-20 2e-18 + + domain πC(A) λC(A) +---------------------------------------------------------------- + a1 1e-20 2e-18 + a2 9e-20 2e-18 + + +status of random variable `B': + domain π(B) λ(B) belief +---------------------------------------------------------------- + b1 5.43e-20 2e-18 0.543 + b2 4.57e-20 2e-18 0.457 + + domain πD(B) λD(B) +---------------------------------------------------------------- + b1 5.43e-20 2e-18 + b2 4.57e-20 2e-18 + + +status of random variable `C': + domain π(C) λ(C) belief +---------------------------------------------------------------- + c1 1.32e-20 2e-18 0.132 + c2 8.68e-20 2e-18 0.868 + + domain πD(C) λD(C) +---------------------------------------------------------------- + c1 1.32e-20 2e-18 + c2 8.68e-20 2e-18 + + +status of random variable `D': + domain π(D) λ(D) belief +---------------------------------------------------------------- + d1 4.5867652e-39 1 0.45867652 + d2 5.4132348e-39 1 0.54132348 + +λ message B --> A + λB(a1) = [p(b1|a1)].λ(b1) + [p(b2|a1)].λ(b2) = [(0.03)]x2e-18 + [(0.97)]x2e-18 = 2e-18 + λB(a2) = [p(b1|a2)].λ(b1) + [p(b2|a2)].λ(b2) = [(0.6)]x2e-18 + [(0.4)]x2e-18 = 2e-18 +λ message C --> A + λC(a1) = [p(c1|a1)].λ(c1) + [p(c2|a1)].λ(c2) = [(0.24)]x2e-18 + [(0.76)]x2e-18 = 2e-18 + λC(a2) = [p(c1|a2)].λ(c1) + [p(c2|a2)].λ(c2) = [(0.12)]x2e-18 + [(0.88)]x2e-18 = 2e-18 +λ message D --> B + λD(b1) = [p(d1|b1,c1).πD(c1) + p(d1|b1,c2).πD(c2)].λ(d1) + [p(d2|b1,c1).πD(c1) + p(d2|b1,c2).πD(c2)].λ(d2) = [(0.2x1.32e-20) + (0.7x8.68e-20)]x1 + [(0.8x1.32e-20) + (0.3x8.68e-20)]x1 = 1e-19 + λD(b2) = [p(d1|b2,c1).πD(c1) + p(d1|b2,c2).πD(c2)].λ(d1) + [p(d2|b2,c1).πD(c1) + p(d2|b2,c2).πD(c2)].λ(d2) = [(0.45x1.32e-20) + (0.22x8.68e-20)]x1 + [(0.55x1.32e-20) + (0.78x8.68e-20)]x1 = 1e-19 +λ message D --> C + λD(c1) = [p(d1|b1,c1).πD(b1) + p(d1|b2,c1).πD(b2)].λ(d1) + [p(d2|b1,c1).πD(b1) + p(d2|b2,c1).πD(b2)].λ(d2) = [(0.2x5.43e-20) + (0.45x4.57e-20)]x1 + [(0.8x5.43e-20) + (0.55x4.57e-20)]x1 = 1e-19 + λD(c2) = [p(d1|b1,c2).πD(b1) + p(d1|b2,c2).πD(b2)].λ(d1) + [p(d2|b1,c2).πD(b1) + p(d2|b2,c2).πD(b2)].λ(d2) = [(0.7x5.43e-20) + (0.22x4.57e-20)]x1 + [(0.3x5.43e-20) + (0.78x4.57e-20)]x1 = 1e-19 +π message A --> B + πB(a1) = π(a1).λC(a1) = 0.01 x 2e-18 = 2e-20 + πB(a2) = π(a2).λC(a2) = 0.09 x 2e-18 = 1.8e-19 +π message A --> C + πC(a1) = π(a1).λB(a1) = 0.01 x 2e-18 = 2e-20 + πC(a2) = π(a2).λB(a2) = 0.09 x 2e-18 = 1.8e-19 +π message B --> D + πD(b1) = π(b1) = 5.43e-20 = 5.43e-20 + πD(b2) = π(b2) = 4.57e-20 = 4.57e-20 +π message C --> D + πD(c1) = π(c1) = 1.32e-20 = 1.32e-20 + πD(c2) = π(c2) = 8.68e-20 = 8.68e-20 + +updating π & λ values +node A: + π(a1) = p(a1) = (0.01) = 0.01 + π(a2) = p(a2) = (0.09) = 0.09 + λ(a1) = λB(a1).λC(a1) = 2e-18 x 2e-18 = 4e-36 + λ(a2) = λB(a2).λC(a2) = 2e-18 x 2e-18 = 4e-36 + belief change = 0 +node B: + π(b1) = p(b1|a1).πB(a1) + p(b1|a2).πB(a2) = (0.03 x 2e-20) + (0.6 x 1.8e-19) = 1.086e-19 + π(b2) = p(b2|a1).πB(a1) + p(b2|a2).πB(a2) = (0.97 x 2e-20) + (0.4 x 1.8e-19) = 9.14e-20 + λ(b1) = λD(b1) = 1e-19 = 1e-19 + λ(b2) = λD(b2) = 1e-19 = 1e-19 + belief change = 5.551115123e-17 +node C: + π(c1) = p(c1|a1).πC(a1) + p(c1|a2).πC(a2) = (0.24 x 2e-20) + (0.12 x 1.8e-19) = 2.64e-20 + π(c2) = p(c2|a1).πC(a1) + p(c2|a2).πC(a2) = (0.76 x 2e-20) + (0.88 x 1.8e-19) = 1.736e-19 + λ(c1) = λD(c1) = 1e-19 = 1e-19 + λ(c2) = λD(c2) = 1e-19 = 1e-19 + belief change = 0 +node D: + π(d1) = p(d1|b1,c1).πD(b1).πD(c1) + p(d1|b1,c2).πD(b1).πD(c2) + p(d1|b2,c1).πD(b2).πD(c1) + p(d1|b2,c2).πD(b2).πD(c2) = (0.2 x 5.43e-20 x 1.32e-20) + (0.7 x 5.43e-20 x 8.68e-20) + (0.45 x 4.57e-20 x 1.32e-20) + (0.22 x 4.57e-20 x 8.68e-20) = 4.5867652e-39 + π(d2) = p(d2|b1,c1).πD(b1).πD(c1) + p(d2|b1,c2).πD(b1).πD(c2) + p(d2|b2,c1).πD(b2).πD(c1) + p(d2|b2,c2).πD(b2).πD(c2) = (0.8 x 5.43e-20 x 1.32e-20) + (0.3 x 5.43e-20 x 8.68e-20) + (0.55 x 4.57e-20 x 1.32e-20) + (0.78 x 4.57e-20 x 8.68e-20) = 5.4132348e-39 + λ(d1) = 1 + λ(d2) = 1 + belief change = 0 + + +******************************************************************************** +Iteration 75 +******************************************************************************** + +status of random variable `A': + domain π(A) λ(A) belief +---------------------------------------------------------------- + a1 0.01 4e-36 0.1 + a2 0.09 4e-36 0.9 + + domain πB(A) λB(A) +---------------------------------------------------------------- + a1 2e-20 2e-18 + a2 1.8e-19 2e-18 + + domain πC(A) λC(A) +---------------------------------------------------------------- + a1 2e-20 2e-18 + a2 1.8e-19 2e-18 + + +status of random variable `B': + domain π(B) λ(B) belief +---------------------------------------------------------------- + b1 1.086e-19 1e-19 0.543 + b2 9.14e-20 1e-19 0.457 + + domain πD(B) λD(B) +---------------------------------------------------------------- + b1 5.43e-20 1e-19 + b2 4.57e-20 1e-19 + + +status of random variable `C': + domain π(C) λ(C) belief +---------------------------------------------------------------- + c1 2.64e-20 1e-19 0.132 + c2 1.736e-19 1e-19 0.868 + + domain πD(C) λD(C) +---------------------------------------------------------------- + c1 1.32e-20 1e-19 + c2 8.68e-20 1e-19 + + +status of random variable `D': + domain π(D) λ(D) belief +---------------------------------------------------------------- + d1 4.5867652e-39 1 0.45867652 + d2 5.4132348e-39 1 0.54132348 + +λ message B --> A + λB(a1) = [p(b1|a1)].λ(b1) + [p(b2|a1)].λ(b2) = [(0.03)]x1e-19 + [(0.97)]x1e-19 = 1e-19 + λB(a2) = [p(b1|a2)].λ(b1) + [p(b2|a2)].λ(b2) = [(0.6)]x1e-19 + [(0.4)]x1e-19 = 1e-19 +λ message C --> A + λC(a1) = [p(c1|a1)].λ(c1) + [p(c2|a1)].λ(c2) = [(0.24)]x1e-19 + [(0.76)]x1e-19 = 1e-19 + λC(a2) = [p(c1|a2)].λ(c1) + [p(c2|a2)].λ(c2) = [(0.12)]x1e-19 + [(0.88)]x1e-19 = 1e-19 +λ message D --> B + λD(b1) = [p(d1|b1,c1).πD(c1) + p(d1|b1,c2).πD(c2)].λ(d1) + [p(d2|b1,c1).πD(c1) + p(d2|b1,c2).πD(c2)].λ(d2) = [(0.2x1.32e-20) + (0.7x8.68e-20)]x1 + [(0.8x1.32e-20) + (0.3x8.68e-20)]x1 = 1e-19 + λD(b2) = [p(d1|b2,c1).πD(c1) + p(d1|b2,c2).πD(c2)].λ(d1) + [p(d2|b2,c1).πD(c1) + p(d2|b2,c2).πD(c2)].λ(d2) = [(0.45x1.32e-20) + (0.22x8.68e-20)]x1 + [(0.55x1.32e-20) + (0.78x8.68e-20)]x1 = 1e-19 +λ message D --> C + λD(c1) = [p(d1|b1,c1).πD(b1) + p(d1|b2,c1).πD(b2)].λ(d1) + [p(d2|b1,c1).πD(b1) + p(d2|b2,c1).πD(b2)].λ(d2) = [(0.2x5.43e-20) + (0.45x4.57e-20)]x1 + [(0.8x5.43e-20) + (0.55x4.57e-20)]x1 = 1e-19 + λD(c2) = [p(d1|b1,c2).πD(b1) + p(d1|b2,c2).πD(b2)].λ(d1) + [p(d2|b1,c2).πD(b1) + p(d2|b2,c2).πD(b2)].λ(d2) = [(0.7x5.43e-20) + (0.22x4.57e-20)]x1 + [(0.3x5.43e-20) + (0.78x4.57e-20)]x1 = 1e-19 +π message A --> B + πB(a1) = π(a1).λC(a1) = 0.01 x 2e-18 = 2e-20 + πB(a2) = π(a2).λC(a2) = 0.09 x 2e-18 = 1.8e-19 +π message A --> C + πC(a1) = π(a1).λB(a1) = 0.01 x 2e-18 = 2e-20 + πC(a2) = π(a2).λB(a2) = 0.09 x 2e-18 = 1.8e-19 +π message B --> D + πD(b1) = π(b1) = 1.086e-19 = 1.086e-19 + πD(b2) = π(b2) = 9.14e-20 = 9.14e-20 +π message C --> D + πD(c1) = π(c1) = 2.64e-20 = 2.64e-20 + πD(c2) = π(c2) = 1.736e-19 = 1.736e-19 + +updating π & λ values +node A: + π(a1) = p(a1) = (0.01) = 0.01 + π(a2) = p(a2) = (0.09) = 0.09 + λ(a1) = λB(a1).λC(a1) = 1e-19 x 1e-19 = 1e-38 + λ(a2) = λB(a2).λC(a2) = 1e-19 x 1e-19 = 1e-38 + belief change = 1.249000903e-16 +node B: + π(b1) = p(b1|a1).πB(a1) + p(b1|a2).πB(a2) = (0.03 x 2e-20) + (0.6 x 1.8e-19) = 1.086e-19 + π(b2) = p(b2|a1).πB(a1) + p(b2|a2).πB(a2) = (0.97 x 2e-20) + (0.4 x 1.8e-19) = 9.14e-20 + λ(b1) = λD(b1) = 1e-19 = 1e-19 + λ(b2) = λD(b2) = 1e-19 = 1e-19 + belief change = 0 +node C: + π(c1) = p(c1|a1).πC(a1) + p(c1|a2).πC(a2) = (0.24 x 2e-20) + (0.12 x 1.8e-19) = 2.64e-20 + π(c2) = p(c2|a1).πC(a1) + p(c2|a2).πC(a2) = (0.76 x 2e-20) + (0.88 x 1.8e-19) = 1.736e-19 + λ(c1) = λD(c1) = 1e-19 = 1e-19 + λ(c2) = λD(c2) = 1e-19 = 1e-19 + belief change = 0 +node D: + π(d1) = p(d1|b1,c1).πD(b1).πD(c1) + p(d1|b1,c2).πD(b1).πD(c2) + p(d1|b2,c1).πD(b2).πD(c1) + p(d1|b2,c2).πD(b2).πD(c2) = (0.2 x 1.086e-19 x 2.64e-20) + (0.7 x 1.086e-19 x 1.736e-19) + (0.45 x 9.14e-20 x 2.64e-20) + (0.22 x 9.14e-20 x 1.736e-19) = 1.83470608e-38 + π(d2) = p(d2|b1,c1).πD(b1).πD(c1) + p(d2|b1,c2).πD(b1).πD(c2) + p(d2|b2,c1).πD(b2).πD(c1) + p(d2|b2,c2).πD(b2).πD(c2) = (0.8 x 1.086e-19 x 2.64e-20) + (0.3 x 1.086e-19 x 1.736e-19) + (0.55 x 9.14e-20 x 2.64e-20) + (0.78 x 9.14e-20 x 1.736e-19) = 2.16529392e-38 + λ(d1) = 1 + λ(d2) = 1 + belief change = 0 + + +******************************************************************************** +Iteration 76 +******************************************************************************** + +status of random variable `A': + domain π(A) λ(A) belief +---------------------------------------------------------------- + a1 0.01 1e-38 0.1 + a2 0.09 1e-38 0.9 + + domain πB(A) λB(A) +---------------------------------------------------------------- + a1 2e-20 1e-19 + a2 1.8e-19 1e-19 + + domain πC(A) λC(A) +---------------------------------------------------------------- + a1 2e-20 1e-19 + a2 1.8e-19 1e-19 + + +status of random variable `B': + domain π(B) λ(B) belief +---------------------------------------------------------------- + b1 1.086e-19 1e-19 0.543 + b2 9.14e-20 1e-19 0.457 + + domain πD(B) λD(B) +---------------------------------------------------------------- + b1 1.086e-19 1e-19 + b2 9.14e-20 1e-19 + + +status of random variable `C': + domain π(C) λ(C) belief +---------------------------------------------------------------- + c1 2.64e-20 1e-19 0.132 + c2 1.736e-19 1e-19 0.868 + + domain πD(C) λD(C) +---------------------------------------------------------------- + c1 2.64e-20 1e-19 + c2 1.736e-19 1e-19 + + +status of random variable `D': + domain π(D) λ(D) belief +---------------------------------------------------------------- + d1 1.83470608e-38 1 0.45867652 + d2 2.16529392e-38 1 0.54132348 + +λ message B --> A + λB(a1) = [p(b1|a1)].λ(b1) + [p(b2|a1)].λ(b2) = [(0.03)]x1e-19 + [(0.97)]x1e-19 = 1e-19 + λB(a2) = [p(b1|a2)].λ(b1) + [p(b2|a2)].λ(b2) = [(0.6)]x1e-19 + [(0.4)]x1e-19 = 1e-19 +λ message C --> A + λC(a1) = [p(c1|a1)].λ(c1) + [p(c2|a1)].λ(c2) = [(0.24)]x1e-19 + [(0.76)]x1e-19 = 1e-19 + λC(a2) = [p(c1|a2)].λ(c1) + [p(c2|a2)].λ(c2) = [(0.12)]x1e-19 + [(0.88)]x1e-19 = 1e-19 +λ message D --> B + λD(b1) = [p(d1|b1,c1).πD(c1) + p(d1|b1,c2).πD(c2)].λ(d1) + [p(d2|b1,c1).πD(c1) + p(d2|b1,c2).πD(c2)].λ(d2) = [(0.2x2.64e-20) + (0.7x1.736e-19)]x1 + [(0.8x2.64e-20) + (0.3x1.736e-19)]x1 = 2e-19 + λD(b2) = [p(d1|b2,c1).πD(c1) + p(d1|b2,c2).πD(c2)].λ(d1) + [p(d2|b2,c1).πD(c1) + p(d2|b2,c2).πD(c2)].λ(d2) = [(0.45x2.64e-20) + (0.22x1.736e-19)]x1 + [(0.55x2.64e-20) + (0.78x1.736e-19)]x1 = 2e-19 +λ message D --> C + λD(c1) = [p(d1|b1,c1).πD(b1) + p(d1|b2,c1).πD(b2)].λ(d1) + [p(d2|b1,c1).πD(b1) + p(d2|b2,c1).πD(b2)].λ(d2) = [(0.2x1.086e-19) + (0.45x9.14e-20)]x1 + [(0.8x1.086e-19) + (0.55x9.14e-20)]x1 = 2e-19 + λD(c2) = [p(d1|b1,c2).πD(b1) + p(d1|b2,c2).πD(b2)].λ(d1) + [p(d2|b1,c2).πD(b1) + p(d2|b2,c2).πD(b2)].λ(d2) = [(0.7x1.086e-19) + (0.22x9.14e-20)]x1 + [(0.3x1.086e-19) + (0.78x9.14e-20)]x1 = 2e-19 +π message A --> B + πB(a1) = π(a1).λC(a1) = 0.01 x 1e-19 = 1e-21 + πB(a2) = π(a2).λC(a2) = 0.09 x 1e-19 = 9e-21 +π message A --> C + πC(a1) = π(a1).λB(a1) = 0.01 x 1e-19 = 1e-21 + πC(a2) = π(a2).λB(a2) = 0.09 x 1e-19 = 9e-21 +π message B --> D + πD(b1) = π(b1) = 1.086e-19 = 1.086e-19 + πD(b2) = π(b2) = 9.14e-20 = 9.14e-20 +π message C --> D + πD(c1) = π(c1) = 2.64e-20 = 2.64e-20 + πD(c2) = π(c2) = 1.736e-19 = 1.736e-19 + +updating π & λ values +node A: + π(a1) = p(a1) = (0.01) = 0.01 + π(a2) = p(a2) = (0.09) = 0.09 + λ(a1) = λB(a1).λC(a1) = 1e-19 x 1e-19 = 1e-38 + λ(a2) = λB(a2).λC(a2) = 1e-19 x 1e-19 = 1e-38 + belief change = 0 +node B: + π(b1) = p(b1|a1).πB(a1) + p(b1|a2).πB(a2) = (0.03 x 1e-21) + (0.6 x 9e-21) = 5.43e-21 + π(b2) = p(b2|a1).πB(a1) + p(b2|a2).πB(a2) = (0.97 x 1e-21) + (0.4 x 9e-21) = 4.57e-21 + λ(b1) = λD(b1) = 2e-19 = 2e-19 + λ(b2) = λD(b2) = 2e-19 = 2e-19 + belief change = 5.551115123e-17 +node C: + π(c1) = p(c1|a1).πC(a1) + p(c1|a2).πC(a2) = (0.24 x 1e-21) + (0.12 x 9e-21) = 1.32e-21 + π(c2) = p(c2|a1).πC(a1) + p(c2|a2).πC(a2) = (0.76 x 1e-21) + (0.88 x 9e-21) = 8.68e-21 + λ(c1) = λD(c1) = 2e-19 = 2e-19 + λ(c2) = λD(c2) = 2e-19 = 2e-19 + belief change = 1.387778781e-16 +node D: + π(d1) = p(d1|b1,c1).πD(b1).πD(c1) + p(d1|b1,c2).πD(b1).πD(c2) + p(d1|b2,c1).πD(b2).πD(c1) + p(d1|b2,c2).πD(b2).πD(c2) = (0.2 x 1.086e-19 x 2.64e-20) + (0.7 x 1.086e-19 x 1.736e-19) + (0.45 x 9.14e-20 x 2.64e-20) + (0.22 x 9.14e-20 x 1.736e-19) = 1.83470608e-38 + π(d2) = p(d2|b1,c1).πD(b1).πD(c1) + p(d2|b1,c2).πD(b1).πD(c2) + p(d2|b2,c1).πD(b2).πD(c1) + p(d2|b2,c2).πD(b2).πD(c2) = (0.8 x 1.086e-19 x 2.64e-20) + (0.3 x 1.086e-19 x 1.736e-19) + (0.55 x 9.14e-20 x 2.64e-20) + (0.78 x 9.14e-20 x 1.736e-19) = 2.16529392e-38 + λ(d1) = 1 + λ(d2) = 1 + belief change = 0 + + +******************************************************************************** +Iteration 77 +******************************************************************************** + +status of random variable `A': + domain π(A) λ(A) belief +---------------------------------------------------------------- + a1 0.01 1e-38 0.1 + a2 0.09 1e-38 0.9 + + domain πB(A) λB(A) +---------------------------------------------------------------- + a1 1e-21 1e-19 + a2 9e-21 1e-19 + + domain πC(A) λC(A) +---------------------------------------------------------------- + a1 1e-21 1e-19 + a2 9e-21 1e-19 + + +status of random variable `B': + domain π(B) λ(B) belief +---------------------------------------------------------------- + b1 5.43e-21 2e-19 0.543 + b2 4.57e-21 2e-19 0.457 + + domain πD(B) λD(B) +---------------------------------------------------------------- + b1 1.086e-19 2e-19 + b2 9.14e-20 2e-19 + + +status of random variable `C': + domain π(C) λ(C) belief +---------------------------------------------------------------- + c1 1.32e-21 2e-19 0.132 + c2 8.68e-21 2e-19 0.868 + + domain πD(C) λD(C) +---------------------------------------------------------------- + c1 2.64e-20 2e-19 + c2 1.736e-19 2e-19 + + +status of random variable `D': + domain π(D) λ(D) belief +---------------------------------------------------------------- + d1 1.83470608e-38 1 0.45867652 + d2 2.16529392e-38 1 0.54132348 + +λ message B --> A + λB(a1) = [p(b1|a1)].λ(b1) + [p(b2|a1)].λ(b2) = [(0.03)]x2e-19 + [(0.97)]x2e-19 = 2e-19 + λB(a2) = [p(b1|a2)].λ(b1) + [p(b2|a2)].λ(b2) = [(0.6)]x2e-19 + [(0.4)]x2e-19 = 2e-19 +λ message C --> A + λC(a1) = [p(c1|a1)].λ(c1) + [p(c2|a1)].λ(c2) = [(0.24)]x2e-19 + [(0.76)]x2e-19 = 2e-19 + λC(a2) = [p(c1|a2)].λ(c1) + [p(c2|a2)].λ(c2) = [(0.12)]x2e-19 + [(0.88)]x2e-19 = 2e-19 +λ message D --> B + λD(b1) = [p(d1|b1,c1).πD(c1) + p(d1|b1,c2).πD(c2)].λ(d1) + [p(d2|b1,c1).πD(c1) + p(d2|b1,c2).πD(c2)].λ(d2) = [(0.2x2.64e-20) + (0.7x1.736e-19)]x1 + [(0.8x2.64e-20) + (0.3x1.736e-19)]x1 = 2e-19 + λD(b2) = [p(d1|b2,c1).πD(c1) + p(d1|b2,c2).πD(c2)].λ(d1) + [p(d2|b2,c1).πD(c1) + p(d2|b2,c2).πD(c2)].λ(d2) = [(0.45x2.64e-20) + (0.22x1.736e-19)]x1 + [(0.55x2.64e-20) + (0.78x1.736e-19)]x1 = 2e-19 +λ message D --> C + λD(c1) = [p(d1|b1,c1).πD(b1) + p(d1|b2,c1).πD(b2)].λ(d1) + [p(d2|b1,c1).πD(b1) + p(d2|b2,c1).πD(b2)].λ(d2) = [(0.2x1.086e-19) + (0.45x9.14e-20)]x1 + [(0.8x1.086e-19) + (0.55x9.14e-20)]x1 = 2e-19 + λD(c2) = [p(d1|b1,c2).πD(b1) + p(d1|b2,c2).πD(b2)].λ(d1) + [p(d2|b1,c2).πD(b1) + p(d2|b2,c2).πD(b2)].λ(d2) = [(0.7x1.086e-19) + (0.22x9.14e-20)]x1 + [(0.3x1.086e-19) + (0.78x9.14e-20)]x1 = 2e-19 +π message A --> B + πB(a1) = π(a1).λC(a1) = 0.01 x 1e-19 = 1e-21 + πB(a2) = π(a2).λC(a2) = 0.09 x 1e-19 = 9e-21 +π message A --> C + πC(a1) = π(a1).λB(a1) = 0.01 x 1e-19 = 1e-21 + πC(a2) = π(a2).λB(a2) = 0.09 x 1e-19 = 9e-21 +π message B --> D + πD(b1) = π(b1) = 5.43e-21 = 5.43e-21 + πD(b2) = π(b2) = 4.57e-21 = 4.57e-21 +π message C --> D + πD(c1) = π(c1) = 1.32e-21 = 1.32e-21 + πD(c2) = π(c2) = 8.68e-21 = 8.68e-21 + +updating π & λ values +node A: + π(a1) = p(a1) = (0.01) = 0.01 + π(a2) = p(a2) = (0.09) = 0.09 + λ(a1) = λB(a1).λC(a1) = 2e-19 x 2e-19 = 4e-38 + λ(a2) = λB(a2).λC(a2) = 2e-19 x 2e-19 = 4e-38 + belief change = 0 +node B: + π(b1) = p(b1|a1).πB(a1) + p(b1|a2).πB(a2) = (0.03 x 1e-21) + (0.6 x 9e-21) = 5.43e-21 + π(b2) = p(b2|a1).πB(a1) + p(b2|a2).πB(a2) = (0.97 x 1e-21) + (0.4 x 9e-21) = 4.57e-21 + λ(b1) = λD(b1) = 2e-19 = 2e-19 + λ(b2) = λD(b2) = 2e-19 = 2e-19 + belief change = 0 +node C: + π(c1) = p(c1|a1).πC(a1) + p(c1|a2).πC(a2) = (0.24 x 1e-21) + (0.12 x 9e-21) = 1.32e-21 + π(c2) = p(c2|a1).πC(a1) + p(c2|a2).πC(a2) = (0.76 x 1e-21) + (0.88 x 9e-21) = 8.68e-21 + λ(c1) = λD(c1) = 2e-19 = 2e-19 + λ(c2) = λD(c2) = 2e-19 = 2e-19 + belief change = 0 +node D: + π(d1) = p(d1|b1,c1).πD(b1).πD(c1) + p(d1|b1,c2).πD(b1).πD(c2) + p(d1|b2,c1).πD(b2).πD(c1) + p(d1|b2,c2).πD(b2).πD(c2) = (0.2 x 5.43e-21 x 1.32e-21) + (0.7 x 5.43e-21 x 8.68e-21) + (0.45 x 4.57e-21 x 1.32e-21) + (0.22 x 4.57e-21 x 8.68e-21) = 4.5867652e-41 + π(d2) = p(d2|b1,c1).πD(b1).πD(c1) + p(d2|b1,c2).πD(b1).πD(c2) + p(d2|b2,c1).πD(b2).πD(c1) + p(d2|b2,c2).πD(b2).πD(c2) = (0.8 x 5.43e-21 x 1.32e-21) + (0.3 x 5.43e-21 x 8.68e-21) + (0.55 x 4.57e-21 x 1.32e-21) + (0.78 x 4.57e-21 x 8.68e-21) = 5.4132348e-41 + λ(d1) = 1 + λ(d2) = 1 + belief change = 0 + + +******************************************************************************** +Iteration 78 +******************************************************************************** + +status of random variable `A': + domain π(A) λ(A) belief +---------------------------------------------------------------- + a1 0.01 4e-38 0.1 + a2 0.09 4e-38 0.9 + + domain πB(A) λB(A) +---------------------------------------------------------------- + a1 1e-21 2e-19 + a2 9e-21 2e-19 + + domain πC(A) λC(A) +---------------------------------------------------------------- + a1 1e-21 2e-19 + a2 9e-21 2e-19 + + +status of random variable `B': + domain π(B) λ(B) belief +---------------------------------------------------------------- + b1 5.43e-21 2e-19 0.543 + b2 4.57e-21 2e-19 0.457 + + domain πD(B) λD(B) +---------------------------------------------------------------- + b1 5.43e-21 2e-19 + b2 4.57e-21 2e-19 + + +status of random variable `C': + domain π(C) λ(C) belief +---------------------------------------------------------------- + c1 1.32e-21 2e-19 0.132 + c2 8.68e-21 2e-19 0.868 + + domain πD(C) λD(C) +---------------------------------------------------------------- + c1 1.32e-21 2e-19 + c2 8.68e-21 2e-19 + + +status of random variable `D': + domain π(D) λ(D) belief +---------------------------------------------------------------- + d1 4.5867652e-41 1 0.45867652 + d2 5.4132348e-41 1 0.54132348 + +λ message B --> A + λB(a1) = [p(b1|a1)].λ(b1) + [p(b2|a1)].λ(b2) = [(0.03)]x2e-19 + [(0.97)]x2e-19 = 2e-19 + λB(a2) = [p(b1|a2)].λ(b1) + [p(b2|a2)].λ(b2) = [(0.6)]x2e-19 + [(0.4)]x2e-19 = 2e-19 +λ message C --> A + λC(a1) = [p(c1|a1)].λ(c1) + [p(c2|a1)].λ(c2) = [(0.24)]x2e-19 + [(0.76)]x2e-19 = 2e-19 + λC(a2) = [p(c1|a2)].λ(c1) + [p(c2|a2)].λ(c2) = [(0.12)]x2e-19 + [(0.88)]x2e-19 = 2e-19 +λ message D --> B + λD(b1) = [p(d1|b1,c1).πD(c1) + p(d1|b1,c2).πD(c2)].λ(d1) + [p(d2|b1,c1).πD(c1) + p(d2|b1,c2).πD(c2)].λ(d2) = [(0.2x1.32e-21) + (0.7x8.68e-21)]x1 + [(0.8x1.32e-21) + (0.3x8.68e-21)]x1 = 1e-20 + λD(b2) = [p(d1|b2,c1).πD(c1) + p(d1|b2,c2).πD(c2)].λ(d1) + [p(d2|b2,c1).πD(c1) + p(d2|b2,c2).πD(c2)].λ(d2) = [(0.45x1.32e-21) + (0.22x8.68e-21)]x1 + [(0.55x1.32e-21) + (0.78x8.68e-21)]x1 = 1e-20 +λ message D --> C + λD(c1) = [p(d1|b1,c1).πD(b1) + p(d1|b2,c1).πD(b2)].λ(d1) + [p(d2|b1,c1).πD(b1) + p(d2|b2,c1).πD(b2)].λ(d2) = [(0.2x5.43e-21) + (0.45x4.57e-21)]x1 + [(0.8x5.43e-21) + (0.55x4.57e-21)]x1 = 1e-20 + λD(c2) = [p(d1|b1,c2).πD(b1) + p(d1|b2,c2).πD(b2)].λ(d1) + [p(d2|b1,c2).πD(b1) + p(d2|b2,c2).πD(b2)].λ(d2) = [(0.7x5.43e-21) + (0.22x4.57e-21)]x1 + [(0.3x5.43e-21) + (0.78x4.57e-21)]x1 = 1e-20 +π message A --> B + πB(a1) = π(a1).λC(a1) = 0.01 x 2e-19 = 2e-21 + πB(a2) = π(a2).λC(a2) = 0.09 x 2e-19 = 1.8e-20 +π message A --> C + πC(a1) = π(a1).λB(a1) = 0.01 x 2e-19 = 2e-21 + πC(a2) = π(a2).λB(a2) = 0.09 x 2e-19 = 1.8e-20 +π message B --> D + πD(b1) = π(b1) = 5.43e-21 = 5.43e-21 + πD(b2) = π(b2) = 4.57e-21 = 4.57e-21 +π message C --> D + πD(c1) = π(c1) = 1.32e-21 = 1.32e-21 + πD(c2) = π(c2) = 8.68e-21 = 8.68e-21 + +updating π & λ values +node A: + π(a1) = p(a1) = (0.01) = 0.01 + π(a2) = p(a2) = (0.09) = 0.09 + λ(a1) = λB(a1).λC(a1) = 2e-19 x 2e-19 = 4e-38 + λ(a2) = λB(a2).λC(a2) = 2e-19 x 2e-19 = 4e-38 + belief change = 0 +node B: + π(b1) = p(b1|a1).πB(a1) + p(b1|a2).πB(a2) = (0.03 x 2e-21) + (0.6 x 1.8e-20) = 1.086e-20 + π(b2) = p(b2|a1).πB(a1) + p(b2|a2).πB(a2) = (0.97 x 2e-21) + (0.4 x 1.8e-20) = 9.14e-21 + λ(b1) = λD(b1) = 1e-20 = 1e-20 + λ(b2) = λD(b2) = 1e-20 = 1e-20 + belief change = 5.551115123e-17 +node C: + π(c1) = p(c1|a1).πC(a1) + p(c1|a2).πC(a2) = (0.24 x 2e-21) + (0.12 x 1.8e-20) = 2.64e-21 + π(c2) = p(c2|a1).πC(a1) + p(c2|a2).πC(a2) = (0.76 x 2e-21) + (0.88 x 1.8e-20) = 1.736e-20 + λ(c1) = λD(c1) = 1e-20 = 1e-20 + λ(c2) = λD(c2) = 1e-20 = 1e-20 + belief change = 1.110223025e-16 +node D: + π(d1) = p(d1|b1,c1).πD(b1).πD(c1) + p(d1|b1,c2).πD(b1).πD(c2) + p(d1|b2,c1).πD(b2).πD(c1) + p(d1|b2,c2).πD(b2).πD(c2) = (0.2 x 5.43e-21 x 1.32e-21) + (0.7 x 5.43e-21 x 8.68e-21) + (0.45 x 4.57e-21 x 1.32e-21) + (0.22 x 4.57e-21 x 8.68e-21) = 4.5867652e-41 + π(d2) = p(d2|b1,c1).πD(b1).πD(c1) + p(d2|b1,c2).πD(b1).πD(c2) + p(d2|b2,c1).πD(b2).πD(c1) + p(d2|b2,c2).πD(b2).πD(c2) = (0.8 x 5.43e-21 x 1.32e-21) + (0.3 x 5.43e-21 x 8.68e-21) + (0.55 x 4.57e-21 x 1.32e-21) + (0.78 x 4.57e-21 x 8.68e-21) = 5.4132348e-41 + λ(d1) = 1 + λ(d2) = 1 + belief change = 0 + + +******************************************************************************** +Iteration 79 +******************************************************************************** + +status of random variable `A': + domain π(A) λ(A) belief +---------------------------------------------------------------- + a1 0.01 4e-38 0.1 + a2 0.09 4e-38 0.9 + + domain πB(A) λB(A) +---------------------------------------------------------------- + a1 2e-21 2e-19 + a2 1.8e-20 2e-19 + + domain πC(A) λC(A) +---------------------------------------------------------------- + a1 2e-21 2e-19 + a2 1.8e-20 2e-19 + + +status of random variable `B': + domain π(B) λ(B) belief +---------------------------------------------------------------- + b1 1.086e-20 1e-20 0.543 + b2 9.14e-21 1e-20 0.457 + + domain πD(B) λD(B) +---------------------------------------------------------------- + b1 5.43e-21 1e-20 + b2 4.57e-21 1e-20 + + +status of random variable `C': + domain π(C) λ(C) belief +---------------------------------------------------------------- + c1 2.64e-21 1e-20 0.132 + c2 1.736e-20 1e-20 0.868 + + domain πD(C) λD(C) +---------------------------------------------------------------- + c1 1.32e-21 1e-20 + c2 8.68e-21 1e-20 + + +status of random variable `D': + domain π(D) λ(D) belief +---------------------------------------------------------------- + d1 4.5867652e-41 1 0.45867652 + d2 5.4132348e-41 1 0.54132348 + +λ message B --> A + λB(a1) = [p(b1|a1)].λ(b1) + [p(b2|a1)].λ(b2) = [(0.03)]x1e-20 + [(0.97)]x1e-20 = 1e-20 + λB(a2) = [p(b1|a2)].λ(b1) + [p(b2|a2)].λ(b2) = [(0.6)]x1e-20 + [(0.4)]x1e-20 = 1e-20 +λ message C --> A + λC(a1) = [p(c1|a1)].λ(c1) + [p(c2|a1)].λ(c2) = [(0.24)]x1e-20 + [(0.76)]x1e-20 = 1e-20 + λC(a2) = [p(c1|a2)].λ(c1) + [p(c2|a2)].λ(c2) = [(0.12)]x1e-20 + [(0.88)]x1e-20 = 1e-20 +λ message D --> B + λD(b1) = [p(d1|b1,c1).πD(c1) + p(d1|b1,c2).πD(c2)].λ(d1) + [p(d2|b1,c1).πD(c1) + p(d2|b1,c2).πD(c2)].λ(d2) = [(0.2x1.32e-21) + (0.7x8.68e-21)]x1 + [(0.8x1.32e-21) + (0.3x8.68e-21)]x1 = 1e-20 + λD(b2) = [p(d1|b2,c1).πD(c1) + p(d1|b2,c2).πD(c2)].λ(d1) + [p(d2|b2,c1).πD(c1) + p(d2|b2,c2).πD(c2)].λ(d2) = [(0.45x1.32e-21) + (0.22x8.68e-21)]x1 + [(0.55x1.32e-21) + (0.78x8.68e-21)]x1 = 1e-20 +λ message D --> C + λD(c1) = [p(d1|b1,c1).πD(b1) + p(d1|b2,c1).πD(b2)].λ(d1) + [p(d2|b1,c1).πD(b1) + p(d2|b2,c1).πD(b2)].λ(d2) = [(0.2x5.43e-21) + (0.45x4.57e-21)]x1 + [(0.8x5.43e-21) + (0.55x4.57e-21)]x1 = 1e-20 + λD(c2) = [p(d1|b1,c2).πD(b1) + p(d1|b2,c2).πD(b2)].λ(d1) + [p(d2|b1,c2).πD(b1) + p(d2|b2,c2).πD(b2)].λ(d2) = [(0.7x5.43e-21) + (0.22x4.57e-21)]x1 + [(0.3x5.43e-21) + (0.78x4.57e-21)]x1 = 1e-20 +π message A --> B + πB(a1) = π(a1).λC(a1) = 0.01 x 2e-19 = 2e-21 + πB(a2) = π(a2).λC(a2) = 0.09 x 2e-19 = 1.8e-20 +π message A --> C + πC(a1) = π(a1).λB(a1) = 0.01 x 2e-19 = 2e-21 + πC(a2) = π(a2).λB(a2) = 0.09 x 2e-19 = 1.8e-20 +π message B --> D + πD(b1) = π(b1) = 1.086e-20 = 1.086e-20 + πD(b2) = π(b2) = 9.14e-21 = 9.14e-21 +π message C --> D + πD(c1) = π(c1) = 2.64e-21 = 2.64e-21 + πD(c2) = π(c2) = 1.736e-20 = 1.736e-20 + +updating π & λ values +node A: + π(a1) = p(a1) = (0.01) = 0.01 + π(a2) = p(a2) = (0.09) = 0.09 + λ(a1) = λB(a1).λC(a1) = 1e-20 x 1e-20 = 1e-40 + λ(a2) = λB(a2).λC(a2) = 1e-20 x 1e-20 = 1e-40 + belief change = 1.249000903e-16 +node B: + π(b1) = p(b1|a1).πB(a1) + p(b1|a2).πB(a2) = (0.03 x 2e-21) + (0.6 x 1.8e-20) = 1.086e-20 + π(b2) = p(b2|a1).πB(a1) + p(b2|a2).πB(a2) = (0.97 x 2e-21) + (0.4 x 1.8e-20) = 9.14e-21 + λ(b1) = λD(b1) = 1e-20 = 1e-20 + λ(b2) = λD(b2) = 1e-20 = 1e-20 + belief change = 0 +node C: + π(c1) = p(c1|a1).πC(a1) + p(c1|a2).πC(a2) = (0.24 x 2e-21) + (0.12 x 1.8e-20) = 2.64e-21 + π(c2) = p(c2|a1).πC(a1) + p(c2|a2).πC(a2) = (0.76 x 2e-21) + (0.88 x 1.8e-20) = 1.736e-20 + λ(c1) = λD(c1) = 1e-20 = 1e-20 + λ(c2) = λD(c2) = 1e-20 = 1e-20 + belief change = 0 +node D: + π(d1) = p(d1|b1,c1).πD(b1).πD(c1) + p(d1|b1,c2).πD(b1).πD(c2) + p(d1|b2,c1).πD(b2).πD(c1) + p(d1|b2,c2).πD(b2).πD(c2) = (0.2 x 1.086e-20 x 2.64e-21) + (0.7 x 1.086e-20 x 1.736e-20) + (0.45 x 9.14e-21 x 2.64e-21) + (0.22 x 9.14e-21 x 1.736e-20) = 1.83470608e-40 + π(d2) = p(d2|b1,c1).πD(b1).πD(c1) + p(d2|b1,c2).πD(b1).πD(c2) + p(d2|b2,c1).πD(b2).πD(c1) + p(d2|b2,c2).πD(b2).πD(c2) = (0.8 x 1.086e-20 x 2.64e-21) + (0.3 x 1.086e-20 x 1.736e-20) + (0.55 x 9.14e-21 x 2.64e-21) + (0.78 x 9.14e-21 x 1.736e-20) = 2.16529392e-40 + λ(d1) = 1 + λ(d2) = 1 + belief change = 0 + + +******************************************************************************** +Iteration 80 +******************************************************************************** + +status of random variable `A': + domain π(A) λ(A) belief +---------------------------------------------------------------- + a1 0.01 1e-40 0.1 + a2 0.09 1e-40 0.9 + + domain πB(A) λB(A) +---------------------------------------------------------------- + a1 2e-21 1e-20 + a2 1.8e-20 1e-20 + + domain πC(A) λC(A) +---------------------------------------------------------------- + a1 2e-21 1e-20 + a2 1.8e-20 1e-20 + + +status of random variable `B': + domain π(B) λ(B) belief +---------------------------------------------------------------- + b1 1.086e-20 1e-20 0.543 + b2 9.14e-21 1e-20 0.457 + + domain πD(B) λD(B) +---------------------------------------------------------------- + b1 1.086e-20 1e-20 + b2 9.14e-21 1e-20 + + +status of random variable `C': + domain π(C) λ(C) belief +---------------------------------------------------------------- + c1 2.64e-21 1e-20 0.132 + c2 1.736e-20 1e-20 0.868 + + domain πD(C) λD(C) +---------------------------------------------------------------- + c1 2.64e-21 1e-20 + c2 1.736e-20 1e-20 + + +status of random variable `D': + domain π(D) λ(D) belief +---------------------------------------------------------------- + d1 1.83470608e-40 1 0.45867652 + d2 2.16529392e-40 1 0.54132348 + +λ message B --> A + λB(a1) = [p(b1|a1)].λ(b1) + [p(b2|a1)].λ(b2) = [(0.03)]x1e-20 + [(0.97)]x1e-20 = 1e-20 + λB(a2) = [p(b1|a2)].λ(b1) + [p(b2|a2)].λ(b2) = [(0.6)]x1e-20 + [(0.4)]x1e-20 = 1e-20 +λ message C --> A + λC(a1) = [p(c1|a1)].λ(c1) + [p(c2|a1)].λ(c2) = [(0.24)]x1e-20 + [(0.76)]x1e-20 = 1e-20 + λC(a2) = [p(c1|a2)].λ(c1) + [p(c2|a2)].λ(c2) = [(0.12)]x1e-20 + [(0.88)]x1e-20 = 1e-20 +λ message D --> B + λD(b1) = [p(d1|b1,c1).πD(c1) + p(d1|b1,c2).πD(c2)].λ(d1) + [p(d2|b1,c1).πD(c1) + p(d2|b1,c2).πD(c2)].λ(d2) = [(0.2x2.64e-21) + (0.7x1.736e-20)]x1 + [(0.8x2.64e-21) + (0.3x1.736e-20)]x1 = 2e-20 + λD(b2) = [p(d1|b2,c1).πD(c1) + p(d1|b2,c2).πD(c2)].λ(d1) + [p(d2|b2,c1).πD(c1) + p(d2|b2,c2).πD(c2)].λ(d2) = [(0.45x2.64e-21) + (0.22x1.736e-20)]x1 + [(0.55x2.64e-21) + (0.78x1.736e-20)]x1 = 2e-20 +λ message D --> C + λD(c1) = [p(d1|b1,c1).πD(b1) + p(d1|b2,c1).πD(b2)].λ(d1) + [p(d2|b1,c1).πD(b1) + p(d2|b2,c1).πD(b2)].λ(d2) = [(0.2x1.086e-20) + (0.45x9.14e-21)]x1 + [(0.8x1.086e-20) + (0.55x9.14e-21)]x1 = 2e-20 + λD(c2) = [p(d1|b1,c2).πD(b1) + p(d1|b2,c2).πD(b2)].λ(d1) + [p(d2|b1,c2).πD(b1) + p(d2|b2,c2).πD(b2)].λ(d2) = [(0.7x1.086e-20) + (0.22x9.14e-21)]x1 + [(0.3x1.086e-20) + (0.78x9.14e-21)]x1 = 2e-20 +π message A --> B + πB(a1) = π(a1).λC(a1) = 0.01 x 1e-20 = 1e-22 + πB(a2) = π(a2).λC(a2) = 0.09 x 1e-20 = 9e-22 +π message A --> C + πC(a1) = π(a1).λB(a1) = 0.01 x 1e-20 = 1e-22 + πC(a2) = π(a2).λB(a2) = 0.09 x 1e-20 = 9e-22 +π message B --> D + πD(b1) = π(b1) = 1.086e-20 = 1.086e-20 + πD(b2) = π(b2) = 9.14e-21 = 9.14e-21 +π message C --> D + πD(c1) = π(c1) = 2.64e-21 = 2.64e-21 + πD(c2) = π(c2) = 1.736e-20 = 1.736e-20 + +updating π & λ values +node A: + π(a1) = p(a1) = (0.01) = 0.01 + π(a2) = p(a2) = (0.09) = 0.09 + λ(a1) = λB(a1).λC(a1) = 1e-20 x 1e-20 = 1e-40 + λ(a2) = λB(a2).λC(a2) = 1e-20 x 1e-20 = 1e-40 + belief change = 0 +node B: + π(b1) = p(b1|a1).πB(a1) + p(b1|a2).πB(a2) = (0.03 x 1e-22) + (0.6 x 9e-22) = 5.43e-22 + π(b2) = p(b2|a1).πB(a1) + p(b2|a2).πB(a2) = (0.97 x 1e-22) + (0.4 x 9e-22) = 4.57e-22 + λ(b1) = λD(b1) = 2e-20 = 2e-20 + λ(b2) = λD(b2) = 2e-20 = 2e-20 + belief change = 5.551115123e-17 +node C: + π(c1) = p(c1|a1).πC(a1) + p(c1|a2).πC(a2) = (0.24 x 1e-22) + (0.12 x 9e-22) = 1.32e-22 + π(c2) = p(c2|a1).πC(a1) + p(c2|a2).πC(a2) = (0.76 x 1e-22) + (0.88 x 9e-22) = 8.68e-22 + λ(c1) = λD(c1) = 2e-20 = 2e-20 + λ(c2) = λD(c2) = 2e-20 = 2e-20 + belief change = 2.775557562e-17 +node D: + π(d1) = p(d1|b1,c1).πD(b1).πD(c1) + p(d1|b1,c2).πD(b1).πD(c2) + p(d1|b2,c1).πD(b2).πD(c1) + p(d1|b2,c2).πD(b2).πD(c2) = (0.2 x 1.086e-20 x 2.64e-21) + (0.7 x 1.086e-20 x 1.736e-20) + (0.45 x 9.14e-21 x 2.64e-21) + (0.22 x 9.14e-21 x 1.736e-20) = 1.83470608e-40 + π(d2) = p(d2|b1,c1).πD(b1).πD(c1) + p(d2|b1,c2).πD(b1).πD(c2) + p(d2|b2,c1).πD(b2).πD(c1) + p(d2|b2,c2).πD(b2).πD(c2) = (0.8 x 1.086e-20 x 2.64e-21) + (0.3 x 1.086e-20 x 1.736e-20) + (0.55 x 9.14e-21 x 2.64e-21) + (0.78 x 9.14e-21 x 1.736e-20) = 2.16529392e-40 + λ(d1) = 1 + λ(d2) = 1 + belief change = 0 + + +******************************************************************************** +Iteration 81 +******************************************************************************** + +status of random variable `A': + domain π(A) λ(A) belief +---------------------------------------------------------------- + a1 0.01 1e-40 0.1 + a2 0.09 1e-40 0.9 + + domain πB(A) λB(A) +---------------------------------------------------------------- + a1 1e-22 1e-20 + a2 9e-22 1e-20 + + domain πC(A) λC(A) +---------------------------------------------------------------- + a1 1e-22 1e-20 + a2 9e-22 1e-20 + + +status of random variable `B': + domain π(B) λ(B) belief +---------------------------------------------------------------- + b1 5.43e-22 2e-20 0.543 + b2 4.57e-22 2e-20 0.457 + + domain πD(B) λD(B) +---------------------------------------------------------------- + b1 1.086e-20 2e-20 + b2 9.14e-21 2e-20 + + +status of random variable `C': + domain π(C) λ(C) belief +---------------------------------------------------------------- + c1 1.32e-22 2e-20 0.132 + c2 8.68e-22 2e-20 0.868 + + domain πD(C) λD(C) +---------------------------------------------------------------- + c1 2.64e-21 2e-20 + c2 1.736e-20 2e-20 + + +status of random variable `D': + domain π(D) λ(D) belief +---------------------------------------------------------------- + d1 1.83470608e-40 1 0.45867652 + d2 2.16529392e-40 1 0.54132348 + +λ message B --> A + λB(a1) = [p(b1|a1)].λ(b1) + [p(b2|a1)].λ(b2) = [(0.03)]x2e-20 + [(0.97)]x2e-20 = 2e-20 + λB(a2) = [p(b1|a2)].λ(b1) + [p(b2|a2)].λ(b2) = [(0.6)]x2e-20 + [(0.4)]x2e-20 = 2e-20 +λ message C --> A + λC(a1) = [p(c1|a1)].λ(c1) + [p(c2|a1)].λ(c2) = [(0.24)]x2e-20 + [(0.76)]x2e-20 = 2e-20 + λC(a2) = [p(c1|a2)].λ(c1) + [p(c2|a2)].λ(c2) = [(0.12)]x2e-20 + [(0.88)]x2e-20 = 2e-20 +λ message D --> B + λD(b1) = [p(d1|b1,c1).πD(c1) + p(d1|b1,c2).πD(c2)].λ(d1) + [p(d2|b1,c1).πD(c1) + p(d2|b1,c2).πD(c2)].λ(d2) = [(0.2x2.64e-21) + (0.7x1.736e-20)]x1 + [(0.8x2.64e-21) + (0.3x1.736e-20)]x1 = 2e-20 + λD(b2) = [p(d1|b2,c1).πD(c1) + p(d1|b2,c2).πD(c2)].λ(d1) + [p(d2|b2,c1).πD(c1) + p(d2|b2,c2).πD(c2)].λ(d2) = [(0.45x2.64e-21) + (0.22x1.736e-20)]x1 + [(0.55x2.64e-21) + (0.78x1.736e-20)]x1 = 2e-20 +λ message D --> C + λD(c1) = [p(d1|b1,c1).πD(b1) + p(d1|b2,c1).πD(b2)].λ(d1) + [p(d2|b1,c1).πD(b1) + p(d2|b2,c1).πD(b2)].λ(d2) = [(0.2x1.086e-20) + (0.45x9.14e-21)]x1 + [(0.8x1.086e-20) + (0.55x9.14e-21)]x1 = 2e-20 + λD(c2) = [p(d1|b1,c2).πD(b1) + p(d1|b2,c2).πD(b2)].λ(d1) + [p(d2|b1,c2).πD(b1) + p(d2|b2,c2).πD(b2)].λ(d2) = [(0.7x1.086e-20) + (0.22x9.14e-21)]x1 + [(0.3x1.086e-20) + (0.78x9.14e-21)]x1 = 2e-20 +π message A --> B + πB(a1) = π(a1).λC(a1) = 0.01 x 1e-20 = 1e-22 + πB(a2) = π(a2).λC(a2) = 0.09 x 1e-20 = 9e-22 +π message A --> C + πC(a1) = π(a1).λB(a1) = 0.01 x 1e-20 = 1e-22 + πC(a2) = π(a2).λB(a2) = 0.09 x 1e-20 = 9e-22 +π message B --> D + πD(b1) = π(b1) = 5.43e-22 = 5.43e-22 + πD(b2) = π(b2) = 4.57e-22 = 4.57e-22 +π message C --> D + πD(c1) = π(c1) = 1.32e-22 = 1.32e-22 + πD(c2) = π(c2) = 8.68e-22 = 8.68e-22 + +updating π & λ values +node A: + π(a1) = p(a1) = (0.01) = 0.01 + π(a2) = p(a2) = (0.09) = 0.09 + λ(a1) = λB(a1).λC(a1) = 2e-20 x 2e-20 = 4e-40 + λ(a2) = λB(a2).λC(a2) = 2e-20 x 2e-20 = 4e-40 + belief change = 0 +node B: + π(b1) = p(b1|a1).πB(a1) + p(b1|a2).πB(a2) = (0.03 x 1e-22) + (0.6 x 9e-22) = 5.43e-22 + π(b2) = p(b2|a1).πB(a1) + p(b2|a2).πB(a2) = (0.97 x 1e-22) + (0.4 x 9e-22) = 4.57e-22 + λ(b1) = λD(b1) = 2e-20 = 2e-20 + λ(b2) = λD(b2) = 2e-20 = 2e-20 + belief change = 0 +node C: + π(c1) = p(c1|a1).πC(a1) + p(c1|a2).πC(a2) = (0.24 x 1e-22) + (0.12 x 9e-22) = 1.32e-22 + π(c2) = p(c2|a1).πC(a1) + p(c2|a2).πC(a2) = (0.76 x 1e-22) + (0.88 x 9e-22) = 8.68e-22 + λ(c1) = λD(c1) = 2e-20 = 2e-20 + λ(c2) = λD(c2) = 2e-20 = 2e-20 + belief change = 0 +node D: + π(d1) = p(d1|b1,c1).πD(b1).πD(c1) + p(d1|b1,c2).πD(b1).πD(c2) + p(d1|b2,c1).πD(b2).πD(c1) + p(d1|b2,c2).πD(b2).πD(c2) = (0.2 x 5.43e-22 x 1.32e-22) + (0.7 x 5.43e-22 x 8.68e-22) + (0.45 x 4.57e-22 x 1.32e-22) + (0.22 x 4.57e-22 x 8.68e-22) = 4.5867652e-43 + π(d2) = p(d2|b1,c1).πD(b1).πD(c1) + p(d2|b1,c2).πD(b1).πD(c2) + p(d2|b2,c1).πD(b2).πD(c1) + p(d2|b2,c2).πD(b2).πD(c2) = (0.8 x 5.43e-22 x 1.32e-22) + (0.3 x 5.43e-22 x 8.68e-22) + (0.55 x 4.57e-22 x 1.32e-22) + (0.78 x 4.57e-22 x 8.68e-22) = 5.4132348e-43 + λ(d1) = 1 + λ(d2) = 1 + belief change = 1.665334537e-16 + + +******************************************************************************** +Iteration 82 +******************************************************************************** + +status of random variable `A': + domain π(A) λ(A) belief +---------------------------------------------------------------- + a1 0.01 4e-40 0.1 + a2 0.09 4e-40 0.9 + + domain πB(A) λB(A) +---------------------------------------------------------------- + a1 1e-22 2e-20 + a2 9e-22 2e-20 + + domain πC(A) λC(A) +---------------------------------------------------------------- + a1 1e-22 2e-20 + a2 9e-22 2e-20 + + +status of random variable `B': + domain π(B) λ(B) belief +---------------------------------------------------------------- + b1 5.43e-22 2e-20 0.543 + b2 4.57e-22 2e-20 0.457 + + domain πD(B) λD(B) +---------------------------------------------------------------- + b1 5.43e-22 2e-20 + b2 4.57e-22 2e-20 + + +status of random variable `C': + domain π(C) λ(C) belief +---------------------------------------------------------------- + c1 1.32e-22 2e-20 0.132 + c2 8.68e-22 2e-20 0.868 + + domain πD(C) λD(C) +---------------------------------------------------------------- + c1 1.32e-22 2e-20 + c2 8.68e-22 2e-20 + + +status of random variable `D': + domain π(D) λ(D) belief +---------------------------------------------------------------- + d1 4.5867652e-43 1 0.45867652 + d2 5.4132348e-43 1 0.54132348 + +λ message B --> A + λB(a1) = [p(b1|a1)].λ(b1) + [p(b2|a1)].λ(b2) = [(0.03)]x2e-20 + [(0.97)]x2e-20 = 2e-20 + λB(a2) = [p(b1|a2)].λ(b1) + [p(b2|a2)].λ(b2) = [(0.6)]x2e-20 + [(0.4)]x2e-20 = 2e-20 +λ message C --> A + λC(a1) = [p(c1|a1)].λ(c1) + [p(c2|a1)].λ(c2) = [(0.24)]x2e-20 + [(0.76)]x2e-20 = 2e-20 + λC(a2) = [p(c1|a2)].λ(c1) + [p(c2|a2)].λ(c2) = [(0.12)]x2e-20 + [(0.88)]x2e-20 = 2e-20 +λ message D --> B + λD(b1) = [p(d1|b1,c1).πD(c1) + p(d1|b1,c2).πD(c2)].λ(d1) + [p(d2|b1,c1).πD(c1) + p(d2|b1,c2).πD(c2)].λ(d2) = [(0.2x1.32e-22) + (0.7x8.68e-22)]x1 + [(0.8x1.32e-22) + (0.3x8.68e-22)]x1 = 1e-21 + λD(b2) = [p(d1|b2,c1).πD(c1) + p(d1|b2,c2).πD(c2)].λ(d1) + [p(d2|b2,c1).πD(c1) + p(d2|b2,c2).πD(c2)].λ(d2) = [(0.45x1.32e-22) + (0.22x8.68e-22)]x1 + [(0.55x1.32e-22) + (0.78x8.68e-22)]x1 = 1e-21 +λ message D --> C + λD(c1) = [p(d1|b1,c1).πD(b1) + p(d1|b2,c1).πD(b2)].λ(d1) + [p(d2|b1,c1).πD(b1) + p(d2|b2,c1).πD(b2)].λ(d2) = [(0.2x5.43e-22) + (0.45x4.57e-22)]x1 + [(0.8x5.43e-22) + (0.55x4.57e-22)]x1 = 1e-21 + λD(c2) = [p(d1|b1,c2).πD(b1) + p(d1|b2,c2).πD(b2)].λ(d1) + [p(d2|b1,c2).πD(b1) + p(d2|b2,c2).πD(b2)].λ(d2) = [(0.7x5.43e-22) + (0.22x4.57e-22)]x1 + [(0.3x5.43e-22) + (0.78x4.57e-22)]x1 = 1e-21 +π message A --> B + πB(a1) = π(a1).λC(a1) = 0.01 x 2e-20 = 2e-22 + πB(a2) = π(a2).λC(a2) = 0.09 x 2e-20 = 1.8e-21 +π message A --> C + πC(a1) = π(a1).λB(a1) = 0.01 x 2e-20 = 2e-22 + πC(a2) = π(a2).λB(a2) = 0.09 x 2e-20 = 1.8e-21 +π message B --> D + πD(b1) = π(b1) = 5.43e-22 = 5.43e-22 + πD(b2) = π(b2) = 4.57e-22 = 4.57e-22 +π message C --> D + πD(c1) = π(c1) = 1.32e-22 = 1.32e-22 + πD(c2) = π(c2) = 8.68e-22 = 8.68e-22 + +updating π & λ values +node A: + π(a1) = p(a1) = (0.01) = 0.01 + π(a2) = p(a2) = (0.09) = 0.09 + λ(a1) = λB(a1).λC(a1) = 2e-20 x 2e-20 = 4e-40 + λ(a2) = λB(a2).λC(a2) = 2e-20 x 2e-20 = 4e-40 + belief change = 0 +node B: + π(b1) = p(b1|a1).πB(a1) + p(b1|a2).πB(a2) = (0.03 x 2e-22) + (0.6 x 1.8e-21) = 1.086e-21 + π(b2) = p(b2|a1).πB(a1) + p(b2|a2).πB(a2) = (0.97 x 2e-22) + (0.4 x 1.8e-21) = 9.14e-22 + λ(b1) = λD(b1) = 1e-21 = 1e-21 + λ(b2) = λD(b2) = 1e-21 = 1e-21 + belief change = 1.110223025e-16 +node C: + π(c1) = p(c1|a1).πC(a1) + p(c1|a2).πC(a2) = (0.24 x 2e-22) + (0.12 x 1.8e-21) = 2.64e-22 + π(c2) = p(c2|a1).πC(a1) + p(c2|a2).πC(a2) = (0.76 x 2e-22) + (0.88 x 1.8e-21) = 1.736e-21 + λ(c1) = λD(c1) = 1e-21 = 1e-21 + λ(c2) = λD(c2) = 1e-21 = 1e-21 + belief change = 2.775557562e-17 +node D: + π(d1) = p(d1|b1,c1).πD(b1).πD(c1) + p(d1|b1,c2).πD(b1).πD(c2) + p(d1|b2,c1).πD(b2).πD(c1) + p(d1|b2,c2).πD(b2).πD(c2) = (0.2 x 5.43e-22 x 1.32e-22) + (0.7 x 5.43e-22 x 8.68e-22) + (0.45 x 4.57e-22 x 1.32e-22) + (0.22 x 4.57e-22 x 8.68e-22) = 4.5867652e-43 + π(d2) = p(d2|b1,c1).πD(b1).πD(c1) + p(d2|b1,c2).πD(b1).πD(c2) + p(d2|b2,c1).πD(b2).πD(c1) + p(d2|b2,c2).πD(b2).πD(c2) = (0.8 x 5.43e-22 x 1.32e-22) + (0.3 x 5.43e-22 x 8.68e-22) + (0.55 x 4.57e-22 x 1.32e-22) + (0.78 x 4.57e-22 x 8.68e-22) = 5.4132348e-43 + λ(d1) = 1 + λ(d2) = 1 + belief change = 0 + + +******************************************************************************** +Iteration 83 +******************************************************************************** + +status of random variable `A': + domain π(A) λ(A) belief +---------------------------------------------------------------- + a1 0.01 4e-40 0.1 + a2 0.09 4e-40 0.9 + + domain πB(A) λB(A) +---------------------------------------------------------------- + a1 2e-22 2e-20 + a2 1.8e-21 2e-20 + + domain πC(A) λC(A) +---------------------------------------------------------------- + a1 2e-22 2e-20 + a2 1.8e-21 2e-20 + + +status of random variable `B': + domain π(B) λ(B) belief +---------------------------------------------------------------- + b1 1.086e-21 1e-21 0.543 + b2 9.14e-22 1e-21 0.457 + + domain πD(B) λD(B) +---------------------------------------------------------------- + b1 5.43e-22 1e-21 + b2 4.57e-22 1e-21 + + +status of random variable `C': + domain π(C) λ(C) belief +---------------------------------------------------------------- + c1 2.64e-22 1e-21 0.132 + c2 1.736e-21 1e-21 0.868 + + domain πD(C) λD(C) +---------------------------------------------------------------- + c1 1.32e-22 1e-21 + c2 8.68e-22 1e-21 + + +status of random variable `D': + domain π(D) λ(D) belief +---------------------------------------------------------------- + d1 4.5867652e-43 1 0.45867652 + d2 5.4132348e-43 1 0.54132348 + +λ message B --> A + λB(a1) = [p(b1|a1)].λ(b1) + [p(b2|a1)].λ(b2) = [(0.03)]x1e-21 + [(0.97)]x1e-21 = 1e-21 + λB(a2) = [p(b1|a2)].λ(b1) + [p(b2|a2)].λ(b2) = [(0.6)]x1e-21 + [(0.4)]x1e-21 = 1e-21 +λ message C --> A + λC(a1) = [p(c1|a1)].λ(c1) + [p(c2|a1)].λ(c2) = [(0.24)]x1e-21 + [(0.76)]x1e-21 = 1e-21 + λC(a2) = [p(c1|a2)].λ(c1) + [p(c2|a2)].λ(c2) = [(0.12)]x1e-21 + [(0.88)]x1e-21 = 1e-21 +λ message D --> B + λD(b1) = [p(d1|b1,c1).πD(c1) + p(d1|b1,c2).πD(c2)].λ(d1) + [p(d2|b1,c1).πD(c1) + p(d2|b1,c2).πD(c2)].λ(d2) = [(0.2x1.32e-22) + (0.7x8.68e-22)]x1 + [(0.8x1.32e-22) + (0.3x8.68e-22)]x1 = 1e-21 + λD(b2) = [p(d1|b2,c1).πD(c1) + p(d1|b2,c2).πD(c2)].λ(d1) + [p(d2|b2,c1).πD(c1) + p(d2|b2,c2).πD(c2)].λ(d2) = [(0.45x1.32e-22) + (0.22x8.68e-22)]x1 + [(0.55x1.32e-22) + (0.78x8.68e-22)]x1 = 1e-21 +λ message D --> C + λD(c1) = [p(d1|b1,c1).πD(b1) + p(d1|b2,c1).πD(b2)].λ(d1) + [p(d2|b1,c1).πD(b1) + p(d2|b2,c1).πD(b2)].λ(d2) = [(0.2x5.43e-22) + (0.45x4.57e-22)]x1 + [(0.8x5.43e-22) + (0.55x4.57e-22)]x1 = 1e-21 + λD(c2) = [p(d1|b1,c2).πD(b1) + p(d1|b2,c2).πD(b2)].λ(d1) + [p(d2|b1,c2).πD(b1) + p(d2|b2,c2).πD(b2)].λ(d2) = [(0.7x5.43e-22) + (0.22x4.57e-22)]x1 + [(0.3x5.43e-22) + (0.78x4.57e-22)]x1 = 1e-21 +π message A --> B + πB(a1) = π(a1).λC(a1) = 0.01 x 2e-20 = 2e-22 + πB(a2) = π(a2).λC(a2) = 0.09 x 2e-20 = 1.8e-21 +π message A --> C + πC(a1) = π(a1).λB(a1) = 0.01 x 2e-20 = 2e-22 + πC(a2) = π(a2).λB(a2) = 0.09 x 2e-20 = 1.8e-21 +π message B --> D + πD(b1) = π(b1) = 1.086e-21 = 1.086e-21 + πD(b2) = π(b2) = 9.14e-22 = 9.14e-22 +π message C --> D + πD(c1) = π(c1) = 2.64e-22 = 2.64e-22 + πD(c2) = π(c2) = 1.736e-21 = 1.736e-21 + +updating π & λ values +node A: + π(a1) = p(a1) = (0.01) = 0.01 + π(a2) = p(a2) = (0.09) = 0.09 + λ(a1) = λB(a1).λC(a1) = 1e-21 x 1e-21 = 1e-42 + λ(a2) = λB(a2).λC(a2) = 1e-21 x 1e-21 = 1e-42 + belief change = 1.249000903e-16 +node B: + π(b1) = p(b1|a1).πB(a1) + p(b1|a2).πB(a2) = (0.03 x 2e-22) + (0.6 x 1.8e-21) = 1.086e-21 + π(b2) = p(b2|a1).πB(a1) + p(b2|a2).πB(a2) = (0.97 x 2e-22) + (0.4 x 1.8e-21) = 9.14e-22 + λ(b1) = λD(b1) = 1e-21 = 1e-21 + λ(b2) = λD(b2) = 1e-21 = 1e-21 + belief change = 0 +node C: + π(c1) = p(c1|a1).πC(a1) + p(c1|a2).πC(a2) = (0.24 x 2e-22) + (0.12 x 1.8e-21) = 2.64e-22 + π(c2) = p(c2|a1).πC(a1) + p(c2|a2).πC(a2) = (0.76 x 2e-22) + (0.88 x 1.8e-21) = 1.736e-21 + λ(c1) = λD(c1) = 1e-21 = 1e-21 + λ(c2) = λD(c2) = 1e-21 = 1e-21 + belief change = 0 +node D: + π(d1) = p(d1|b1,c1).πD(b1).πD(c1) + p(d1|b1,c2).πD(b1).πD(c2) + p(d1|b2,c1).πD(b2).πD(c1) + p(d1|b2,c2).πD(b2).πD(c2) = (0.2 x 1.086e-21 x 2.64e-22) + (0.7 x 1.086e-21 x 1.736e-21) + (0.45 x 9.14e-22 x 2.64e-22) + (0.22 x 9.14e-22 x 1.736e-21) = 1.83470608e-42 + π(d2) = p(d2|b1,c1).πD(b1).πD(c1) + p(d2|b1,c2).πD(b1).πD(c2) + p(d2|b2,c1).πD(b2).πD(c1) + p(d2|b2,c2).πD(b2).πD(c2) = (0.8 x 1.086e-21 x 2.64e-22) + (0.3 x 1.086e-21 x 1.736e-21) + (0.55 x 9.14e-22 x 2.64e-22) + (0.78 x 9.14e-22 x 1.736e-21) = 2.16529392e-42 + λ(d1) = 1 + λ(d2) = 1 + belief change = 0 + + +******************************************************************************** +Iteration 84 +******************************************************************************** + +status of random variable `A': + domain π(A) λ(A) belief +---------------------------------------------------------------- + a1 0.01 1e-42 0.1 + a2 0.09 1e-42 0.9 + + domain πB(A) λB(A) +---------------------------------------------------------------- + a1 2e-22 1e-21 + a2 1.8e-21 1e-21 + + domain πC(A) λC(A) +---------------------------------------------------------------- + a1 2e-22 1e-21 + a2 1.8e-21 1e-21 + + +status of random variable `B': + domain π(B) λ(B) belief +---------------------------------------------------------------- + b1 1.086e-21 1e-21 0.543 + b2 9.14e-22 1e-21 0.457 + + domain πD(B) λD(B) +---------------------------------------------------------------- + b1 1.086e-21 1e-21 + b2 9.14e-22 1e-21 + + +status of random variable `C': + domain π(C) λ(C) belief +---------------------------------------------------------------- + c1 2.64e-22 1e-21 0.132 + c2 1.736e-21 1e-21 0.868 + + domain πD(C) λD(C) +---------------------------------------------------------------- + c1 2.64e-22 1e-21 + c2 1.736e-21 1e-21 + + +status of random variable `D': + domain π(D) λ(D) belief +---------------------------------------------------------------- + d1 1.83470608e-42 1 0.45867652 + d2 2.16529392e-42 1 0.54132348 + +λ message B --> A + λB(a1) = [p(b1|a1)].λ(b1) + [p(b2|a1)].λ(b2) = [(0.03)]x1e-21 + [(0.97)]x1e-21 = 1e-21 + λB(a2) = [p(b1|a2)].λ(b1) + [p(b2|a2)].λ(b2) = [(0.6)]x1e-21 + [(0.4)]x1e-21 = 1e-21 +λ message C --> A + λC(a1) = [p(c1|a1)].λ(c1) + [p(c2|a1)].λ(c2) = [(0.24)]x1e-21 + [(0.76)]x1e-21 = 1e-21 + λC(a2) = [p(c1|a2)].λ(c1) + [p(c2|a2)].λ(c2) = [(0.12)]x1e-21 + [(0.88)]x1e-21 = 1e-21 +λ message D --> B + λD(b1) = [p(d1|b1,c1).πD(c1) + p(d1|b1,c2).πD(c2)].λ(d1) + [p(d2|b1,c1).πD(c1) + p(d2|b1,c2).πD(c2)].λ(d2) = [(0.2x2.64e-22) + (0.7x1.736e-21)]x1 + [(0.8x2.64e-22) + (0.3x1.736e-21)]x1 = 2e-21 + λD(b2) = [p(d1|b2,c1).πD(c1) + p(d1|b2,c2).πD(c2)].λ(d1) + [p(d2|b2,c1).πD(c1) + p(d2|b2,c2).πD(c2)].λ(d2) = [(0.45x2.64e-22) + (0.22x1.736e-21)]x1 + [(0.55x2.64e-22) + (0.78x1.736e-21)]x1 = 2e-21 +λ message D --> C + λD(c1) = [p(d1|b1,c1).πD(b1) + p(d1|b2,c1).πD(b2)].λ(d1) + [p(d2|b1,c1).πD(b1) + p(d2|b2,c1).πD(b2)].λ(d2) = [(0.2x1.086e-21) + (0.45x9.14e-22)]x1 + [(0.8x1.086e-21) + (0.55x9.14e-22)]x1 = 2e-21 + λD(c2) = [p(d1|b1,c2).πD(b1) + p(d1|b2,c2).πD(b2)].λ(d1) + [p(d2|b1,c2).πD(b1) + p(d2|b2,c2).πD(b2)].λ(d2) = [(0.7x1.086e-21) + (0.22x9.14e-22)]x1 + [(0.3x1.086e-21) + (0.78x9.14e-22)]x1 = 2e-21 +π message A --> B + πB(a1) = π(a1).λC(a1) = 0.01 x 1e-21 = 1e-23 + πB(a2) = π(a2).λC(a2) = 0.09 x 1e-21 = 9e-23 +π message A --> C + πC(a1) = π(a1).λB(a1) = 0.01 x 1e-21 = 1e-23 + πC(a2) = π(a2).λB(a2) = 0.09 x 1e-21 = 9e-23 +π message B --> D + πD(b1) = π(b1) = 1.086e-21 = 1.086e-21 + πD(b2) = π(b2) = 9.14e-22 = 9.14e-22 +π message C --> D + πD(c1) = π(c1) = 2.64e-22 = 2.64e-22 + πD(c2) = π(c2) = 1.736e-21 = 1.736e-21 + +updating π & λ values +node A: + π(a1) = p(a1) = (0.01) = 0.01 + π(a2) = p(a2) = (0.09) = 0.09 + λ(a1) = λB(a1).λC(a1) = 1e-21 x 1e-21 = 1e-42 + λ(a2) = λB(a2).λC(a2) = 1e-21 x 1e-21 = 1e-42 + belief change = 0 +node B: + π(b1) = p(b1|a1).πB(a1) + p(b1|a2).πB(a2) = (0.03 x 1e-23) + (0.6 x 9e-23) = 5.43e-23 + π(b2) = p(b2|a1).πB(a1) + p(b2|a2).πB(a2) = (0.97 x 1e-23) + (0.4 x 9e-23) = 4.57e-23 + λ(b1) = λD(b1) = 2e-21 = 2e-21 + λ(b2) = λD(b2) = 2e-21 = 2e-21 + belief change = 2.220446049e-16 +node C: + π(c1) = p(c1|a1).πC(a1) + p(c1|a2).πC(a2) = (0.24 x 1e-23) + (0.12 x 9e-23) = 1.32e-23 + π(c2) = p(c2|a1).πC(a1) + p(c2|a2).πC(a2) = (0.76 x 1e-23) + (0.88 x 9e-23) = 8.68e-23 + λ(c1) = λD(c1) = 2e-21 = 2e-21 + λ(c2) = λD(c2) = 2e-21 = 2e-21 + belief change = 0 +node D: + π(d1) = p(d1|b1,c1).πD(b1).πD(c1) + p(d1|b1,c2).πD(b1).πD(c2) + p(d1|b2,c1).πD(b2).πD(c1) + p(d1|b2,c2).πD(b2).πD(c2) = (0.2 x 1.086e-21 x 2.64e-22) + (0.7 x 1.086e-21 x 1.736e-21) + (0.45 x 9.14e-22 x 2.64e-22) + (0.22 x 9.14e-22 x 1.736e-21) = 1.83470608e-42 + π(d2) = p(d2|b1,c1).πD(b1).πD(c1) + p(d2|b1,c2).πD(b1).πD(c2) + p(d2|b2,c1).πD(b2).πD(c1) + p(d2|b2,c2).πD(b2).πD(c2) = (0.8 x 1.086e-21 x 2.64e-22) + (0.3 x 1.086e-21 x 1.736e-21) + (0.55 x 9.14e-22 x 2.64e-22) + (0.78 x 9.14e-22 x 1.736e-21) = 2.16529392e-42 + λ(d1) = 1 + λ(d2) = 1 + belief change = 0 + + +******************************************************************************** +Iteration 85 +******************************************************************************** + +status of random variable `A': + domain π(A) λ(A) belief +---------------------------------------------------------------- + a1 0.01 1e-42 0.1 + a2 0.09 1e-42 0.9 + + domain πB(A) λB(A) +---------------------------------------------------------------- + a1 1e-23 1e-21 + a2 9e-23 1e-21 + + domain πC(A) λC(A) +---------------------------------------------------------------- + a1 1e-23 1e-21 + a2 9e-23 1e-21 + + +status of random variable `B': + domain π(B) λ(B) belief +---------------------------------------------------------------- + b1 5.43e-23 2e-21 0.543 + b2 4.57e-23 2e-21 0.457 + + domain πD(B) λD(B) +---------------------------------------------------------------- + b1 1.086e-21 2e-21 + b2 9.14e-22 2e-21 + + +status of random variable `C': + domain π(C) λ(C) belief +---------------------------------------------------------------- + c1 1.32e-23 2e-21 0.132 + c2 8.68e-23 2e-21 0.868 + + domain πD(C) λD(C) +---------------------------------------------------------------- + c1 2.64e-22 2e-21 + c2 1.736e-21 2e-21 + + +status of random variable `D': + domain π(D) λ(D) belief +---------------------------------------------------------------- + d1 1.83470608e-42 1 0.45867652 + d2 2.16529392e-42 1 0.54132348 + +λ message B --> A + λB(a1) = [p(b1|a1)].λ(b1) + [p(b2|a1)].λ(b2) = [(0.03)]x2e-21 + [(0.97)]x2e-21 = 2e-21 + λB(a2) = [p(b1|a2)].λ(b1) + [p(b2|a2)].λ(b2) = [(0.6)]x2e-21 + [(0.4)]x2e-21 = 2e-21 +λ message C --> A + λC(a1) = [p(c1|a1)].λ(c1) + [p(c2|a1)].λ(c2) = [(0.24)]x2e-21 + [(0.76)]x2e-21 = 2e-21 + λC(a2) = [p(c1|a2)].λ(c1) + [p(c2|a2)].λ(c2) = [(0.12)]x2e-21 + [(0.88)]x2e-21 = 2e-21 +λ message D --> B + λD(b1) = [p(d1|b1,c1).πD(c1) + p(d1|b1,c2).πD(c2)].λ(d1) + [p(d2|b1,c1).πD(c1) + p(d2|b1,c2).πD(c2)].λ(d2) = [(0.2x2.64e-22) + (0.7x1.736e-21)]x1 + [(0.8x2.64e-22) + (0.3x1.736e-21)]x1 = 2e-21 + λD(b2) = [p(d1|b2,c1).πD(c1) + p(d1|b2,c2).πD(c2)].λ(d1) + [p(d2|b2,c1).πD(c1) + p(d2|b2,c2).πD(c2)].λ(d2) = [(0.45x2.64e-22) + (0.22x1.736e-21)]x1 + [(0.55x2.64e-22) + (0.78x1.736e-21)]x1 = 2e-21 +λ message D --> C + λD(c1) = [p(d1|b1,c1).πD(b1) + p(d1|b2,c1).πD(b2)].λ(d1) + [p(d2|b1,c1).πD(b1) + p(d2|b2,c1).πD(b2)].λ(d2) = [(0.2x1.086e-21) + (0.45x9.14e-22)]x1 + [(0.8x1.086e-21) + (0.55x9.14e-22)]x1 = 2e-21 + λD(c2) = [p(d1|b1,c2).πD(b1) + p(d1|b2,c2).πD(b2)].λ(d1) + [p(d2|b1,c2).πD(b1) + p(d2|b2,c2).πD(b2)].λ(d2) = [(0.7x1.086e-21) + (0.22x9.14e-22)]x1 + [(0.3x1.086e-21) + (0.78x9.14e-22)]x1 = 2e-21 +π message A --> B + πB(a1) = π(a1).λC(a1) = 0.01 x 1e-21 = 1e-23 + πB(a2) = π(a2).λC(a2) = 0.09 x 1e-21 = 9e-23 +π message A --> C + πC(a1) = π(a1).λB(a1) = 0.01 x 1e-21 = 1e-23 + πC(a2) = π(a2).λB(a2) = 0.09 x 1e-21 = 9e-23 +π message B --> D + πD(b1) = π(b1) = 5.43e-23 = 5.43e-23 + πD(b2) = π(b2) = 4.57e-23 = 4.57e-23 +π message C --> D + πD(c1) = π(c1) = 1.32e-23 = 1.32e-23 + πD(c2) = π(c2) = 8.68e-23 = 8.68e-23 + +updating π & λ values +node A: + π(a1) = p(a1) = (0.01) = 0.01 + π(a2) = p(a2) = (0.09) = 0.09 + λ(a1) = λB(a1).λC(a1) = 2e-21 x 2e-21 = 4e-42 + λ(a2) = λB(a2).λC(a2) = 2e-21 x 2e-21 = 4e-42 + belief change = 0 +node B: + π(b1) = p(b1|a1).πB(a1) + p(b1|a2).πB(a2) = (0.03 x 1e-23) + (0.6 x 9e-23) = 5.43e-23 + π(b2) = p(b2|a1).πB(a1) + p(b2|a2).πB(a2) = (0.97 x 1e-23) + (0.4 x 9e-23) = 4.57e-23 + λ(b1) = λD(b1) = 2e-21 = 2e-21 + λ(b2) = λD(b2) = 2e-21 = 2e-21 + belief change = 0 +node C: + π(c1) = p(c1|a1).πC(a1) + p(c1|a2).πC(a2) = (0.24 x 1e-23) + (0.12 x 9e-23) = 1.32e-23 + π(c2) = p(c2|a1).πC(a1) + p(c2|a2).πC(a2) = (0.76 x 1e-23) + (0.88 x 9e-23) = 8.68e-23 + λ(c1) = λD(c1) = 2e-21 = 2e-21 + λ(c2) = λD(c2) = 2e-21 = 2e-21 + belief change = 0 +node D: + π(d1) = p(d1|b1,c1).πD(b1).πD(c1) + p(d1|b1,c2).πD(b1).πD(c2) + p(d1|b2,c1).πD(b2).πD(c1) + p(d1|b2,c2).πD(b2).πD(c2) = (0.2 x 5.43e-23 x 1.32e-23) + (0.7 x 5.43e-23 x 8.68e-23) + (0.45 x 4.57e-23 x 1.32e-23) + (0.22 x 4.57e-23 x 8.68e-23) = 4.5867652e-45 + π(d2) = p(d2|b1,c1).πD(b1).πD(c1) + p(d2|b1,c2).πD(b1).πD(c2) + p(d2|b2,c1).πD(b2).πD(c1) + p(d2|b2,c2).πD(b2).πD(c2) = (0.8 x 5.43e-23 x 1.32e-23) + (0.3 x 5.43e-23 x 8.68e-23) + (0.55 x 4.57e-23 x 1.32e-23) + (0.78 x 4.57e-23 x 8.68e-23) = 5.4132348e-45 + λ(d1) = 1 + λ(d2) = 1 + belief change = 2.220446049e-16 + + +******************************************************************************** +Iteration 86 +******************************************************************************** + +status of random variable `A': + domain π(A) λ(A) belief +---------------------------------------------------------------- + a1 0.01 4e-42 0.1 + a2 0.09 4e-42 0.9 + + domain πB(A) λB(A) +---------------------------------------------------------------- + a1 1e-23 2e-21 + a2 9e-23 2e-21 + + domain πC(A) λC(A) +---------------------------------------------------------------- + a1 1e-23 2e-21 + a2 9e-23 2e-21 + + +status of random variable `B': + domain π(B) λ(B) belief +---------------------------------------------------------------- + b1 5.43e-23 2e-21 0.543 + b2 4.57e-23 2e-21 0.457 + + domain πD(B) λD(B) +---------------------------------------------------------------- + b1 5.43e-23 2e-21 + b2 4.57e-23 2e-21 + + +status of random variable `C': + domain π(C) λ(C) belief +---------------------------------------------------------------- + c1 1.32e-23 2e-21 0.132 + c2 8.68e-23 2e-21 0.868 + + domain πD(C) λD(C) +---------------------------------------------------------------- + c1 1.32e-23 2e-21 + c2 8.68e-23 2e-21 + + +status of random variable `D': + domain π(D) λ(D) belief +---------------------------------------------------------------- + d1 4.5867652e-45 1 0.45867652 + d2 5.4132348e-45 1 0.54132348 + +λ message B --> A + λB(a1) = [p(b1|a1)].λ(b1) + [p(b2|a1)].λ(b2) = [(0.03)]x2e-21 + [(0.97)]x2e-21 = 2e-21 + λB(a2) = [p(b1|a2)].λ(b1) + [p(b2|a2)].λ(b2) = [(0.6)]x2e-21 + [(0.4)]x2e-21 = 2e-21 +λ message C --> A + λC(a1) = [p(c1|a1)].λ(c1) + [p(c2|a1)].λ(c2) = [(0.24)]x2e-21 + [(0.76)]x2e-21 = 2e-21 + λC(a2) = [p(c1|a2)].λ(c1) + [p(c2|a2)].λ(c2) = [(0.12)]x2e-21 + [(0.88)]x2e-21 = 2e-21 +λ message D --> B + λD(b1) = [p(d1|b1,c1).πD(c1) + p(d1|b1,c2).πD(c2)].λ(d1) + [p(d2|b1,c1).πD(c1) + p(d2|b1,c2).πD(c2)].λ(d2) = [(0.2x1.32e-23) + (0.7x8.68e-23)]x1 + [(0.8x1.32e-23) + (0.3x8.68e-23)]x1 = 1e-22 + λD(b2) = [p(d1|b2,c1).πD(c1) + p(d1|b2,c2).πD(c2)].λ(d1) + [p(d2|b2,c1).πD(c1) + p(d2|b2,c2).πD(c2)].λ(d2) = [(0.45x1.32e-23) + (0.22x8.68e-23)]x1 + [(0.55x1.32e-23) + (0.78x8.68e-23)]x1 = 1e-22 +λ message D --> C + λD(c1) = [p(d1|b1,c1).πD(b1) + p(d1|b2,c1).πD(b2)].λ(d1) + [p(d2|b1,c1).πD(b1) + p(d2|b2,c1).πD(b2)].λ(d2) = [(0.2x5.43e-23) + (0.45x4.57e-23)]x1 + [(0.8x5.43e-23) + (0.55x4.57e-23)]x1 = 1e-22 + λD(c2) = [p(d1|b1,c2).πD(b1) + p(d1|b2,c2).πD(b2)].λ(d1) + [p(d2|b1,c2).πD(b1) + p(d2|b2,c2).πD(b2)].λ(d2) = [(0.7x5.43e-23) + (0.22x4.57e-23)]x1 + [(0.3x5.43e-23) + (0.78x4.57e-23)]x1 = 1e-22 +π message A --> B + πB(a1) = π(a1).λC(a1) = 0.01 x 2e-21 = 2e-23 + πB(a2) = π(a2).λC(a2) = 0.09 x 2e-21 = 1.8e-22 +π message A --> C + πC(a1) = π(a1).λB(a1) = 0.01 x 2e-21 = 2e-23 + πC(a2) = π(a2).λB(a2) = 0.09 x 2e-21 = 1.8e-22 +π message B --> D + πD(b1) = π(b1) = 5.43e-23 = 5.43e-23 + πD(b2) = π(b2) = 4.57e-23 = 4.57e-23 +π message C --> D + πD(c1) = π(c1) = 1.32e-23 = 1.32e-23 + πD(c2) = π(c2) = 8.68e-23 = 8.68e-23 + +updating π & λ values +node A: + π(a1) = p(a1) = (0.01) = 0.01 + π(a2) = p(a2) = (0.09) = 0.09 + λ(a1) = λB(a1).λC(a1) = 2e-21 x 2e-21 = 4e-42 + λ(a2) = λB(a2).λC(a2) = 2e-21 x 2e-21 = 4e-42 + belief change = 0 +node B: + π(b1) = p(b1|a1).πB(a1) + p(b1|a2).πB(a2) = (0.03 x 2e-23) + (0.6 x 1.8e-22) = 1.086e-22 + π(b2) = p(b2|a1).πB(a1) + p(b2|a2).πB(a2) = (0.97 x 2e-23) + (0.4 x 1.8e-22) = 9.14e-23 + λ(b1) = λD(b1) = 1e-22 = 1e-22 + λ(b2) = λD(b2) = 1e-22 = 1e-22 + belief change = 1.110223025e-16 +node C: + π(c1) = p(c1|a1).πC(a1) + p(c1|a2).πC(a2) = (0.24 x 2e-23) + (0.12 x 1.8e-22) = 2.64e-23 + π(c2) = p(c2|a1).πC(a1) + p(c2|a2).πC(a2) = (0.76 x 2e-23) + (0.88 x 1.8e-22) = 1.736e-22 + λ(c1) = λD(c1) = 1e-22 = 1e-22 + λ(c2) = λD(c2) = 1e-22 = 1e-22 + belief change = 0 +node D: + π(d1) = p(d1|b1,c1).πD(b1).πD(c1) + p(d1|b1,c2).πD(b1).πD(c2) + p(d1|b2,c1).πD(b2).πD(c1) + p(d1|b2,c2).πD(b2).πD(c2) = (0.2 x 5.43e-23 x 1.32e-23) + (0.7 x 5.43e-23 x 8.68e-23) + (0.45 x 4.57e-23 x 1.32e-23) + (0.22 x 4.57e-23 x 8.68e-23) = 4.5867652e-45 + π(d2) = p(d2|b1,c1).πD(b1).πD(c1) + p(d2|b1,c2).πD(b1).πD(c2) + p(d2|b2,c1).πD(b2).πD(c1) + p(d2|b2,c2).πD(b2).πD(c2) = (0.8 x 5.43e-23 x 1.32e-23) + (0.3 x 5.43e-23 x 8.68e-23) + (0.55 x 4.57e-23 x 1.32e-23) + (0.78 x 4.57e-23 x 8.68e-23) = 5.4132348e-45 + λ(d1) = 1 + λ(d2) = 1 + belief change = 0 + + +******************************************************************************** +Iteration 87 +******************************************************************************** + +status of random variable `A': + domain π(A) λ(A) belief +---------------------------------------------------------------- + a1 0.01 4e-42 0.1 + a2 0.09 4e-42 0.9 + + domain πB(A) λB(A) +---------------------------------------------------------------- + a1 2e-23 2e-21 + a2 1.8e-22 2e-21 + + domain πC(A) λC(A) +---------------------------------------------------------------- + a1 2e-23 2e-21 + a2 1.8e-22 2e-21 + + +status of random variable `B': + domain π(B) λ(B) belief +---------------------------------------------------------------- + b1 1.086e-22 1e-22 0.543 + b2 9.14e-23 1e-22 0.457 + + domain πD(B) λD(B) +---------------------------------------------------------------- + b1 5.43e-23 1e-22 + b2 4.57e-23 1e-22 + + +status of random variable `C': + domain π(C) λ(C) belief +---------------------------------------------------------------- + c1 2.64e-23 1e-22 0.132 + c2 1.736e-22 1e-22 0.868 + + domain πD(C) λD(C) +---------------------------------------------------------------- + c1 1.32e-23 1e-22 + c2 8.68e-23 1e-22 + + +status of random variable `D': + domain π(D) λ(D) belief +---------------------------------------------------------------- + d1 4.5867652e-45 1 0.45867652 + d2 5.4132348e-45 1 0.54132348 + +λ message B --> A + λB(a1) = [p(b1|a1)].λ(b1) + [p(b2|a1)].λ(b2) = [(0.03)]x1e-22 + [(0.97)]x1e-22 = 1e-22 + λB(a2) = [p(b1|a2)].λ(b1) + [p(b2|a2)].λ(b2) = [(0.6)]x1e-22 + [(0.4)]x1e-22 = 1e-22 +λ message C --> A + λC(a1) = [p(c1|a1)].λ(c1) + [p(c2|a1)].λ(c2) = [(0.24)]x1e-22 + [(0.76)]x1e-22 = 1e-22 + λC(a2) = [p(c1|a2)].λ(c1) + [p(c2|a2)].λ(c2) = [(0.12)]x1e-22 + [(0.88)]x1e-22 = 1e-22 +λ message D --> B + λD(b1) = [p(d1|b1,c1).πD(c1) + p(d1|b1,c2).πD(c2)].λ(d1) + [p(d2|b1,c1).πD(c1) + p(d2|b1,c2).πD(c2)].λ(d2) = [(0.2x1.32e-23) + (0.7x8.68e-23)]x1 + [(0.8x1.32e-23) + (0.3x8.68e-23)]x1 = 1e-22 + λD(b2) = [p(d1|b2,c1).πD(c1) + p(d1|b2,c2).πD(c2)].λ(d1) + [p(d2|b2,c1).πD(c1) + p(d2|b2,c2).πD(c2)].λ(d2) = [(0.45x1.32e-23) + (0.22x8.68e-23)]x1 + [(0.55x1.32e-23) + (0.78x8.68e-23)]x1 = 1e-22 +λ message D --> C + λD(c1) = [p(d1|b1,c1).πD(b1) + p(d1|b2,c1).πD(b2)].λ(d1) + [p(d2|b1,c1).πD(b1) + p(d2|b2,c1).πD(b2)].λ(d2) = [(0.2x5.43e-23) + (0.45x4.57e-23)]x1 + [(0.8x5.43e-23) + (0.55x4.57e-23)]x1 = 1e-22 + λD(c2) = [p(d1|b1,c2).πD(b1) + p(d1|b2,c2).πD(b2)].λ(d1) + [p(d2|b1,c2).πD(b1) + p(d2|b2,c2).πD(b2)].λ(d2) = [(0.7x5.43e-23) + (0.22x4.57e-23)]x1 + [(0.3x5.43e-23) + (0.78x4.57e-23)]x1 = 1e-22 +π message A --> B + πB(a1) = π(a1).λC(a1) = 0.01 x 2e-21 = 2e-23 + πB(a2) = π(a2).λC(a2) = 0.09 x 2e-21 = 1.8e-22 +π message A --> C + πC(a1) = π(a1).λB(a1) = 0.01 x 2e-21 = 2e-23 + πC(a2) = π(a2).λB(a2) = 0.09 x 2e-21 = 1.8e-22 +π message B --> D + πD(b1) = π(b1) = 1.086e-22 = 1.086e-22 + πD(b2) = π(b2) = 9.14e-23 = 9.14e-23 +π message C --> D + πD(c1) = π(c1) = 2.64e-23 = 2.64e-23 + πD(c2) = π(c2) = 1.736e-22 = 1.736e-22 + +updating π & λ values +node A: + π(a1) = p(a1) = (0.01) = 0.01 + π(a2) = p(a2) = (0.09) = 0.09 + λ(a1) = λB(a1).λC(a1) = 1e-22 x 1e-22 = 1e-44 + λ(a2) = λB(a2).λC(a2) = 1e-22 x 1e-22 = 1e-44 + belief change = 1.387778781e-17 +node B: + π(b1) = p(b1|a1).πB(a1) + p(b1|a2).πB(a2) = (0.03 x 2e-23) + (0.6 x 1.8e-22) = 1.086e-22 + π(b2) = p(b2|a1).πB(a1) + p(b2|a2).πB(a2) = (0.97 x 2e-23) + (0.4 x 1.8e-22) = 9.14e-23 + λ(b1) = λD(b1) = 1e-22 = 1e-22 + λ(b2) = λD(b2) = 1e-22 = 1e-22 + belief change = 0 +node C: + π(c1) = p(c1|a1).πC(a1) + p(c1|a2).πC(a2) = (0.24 x 2e-23) + (0.12 x 1.8e-22) = 2.64e-23 + π(c2) = p(c2|a1).πC(a1) + p(c2|a2).πC(a2) = (0.76 x 2e-23) + (0.88 x 1.8e-22) = 1.736e-22 + λ(c1) = λD(c1) = 1e-22 = 1e-22 + λ(c2) = λD(c2) = 1e-22 = 1e-22 + belief change = 0 +node D: + π(d1) = p(d1|b1,c1).πD(b1).πD(c1) + p(d1|b1,c2).πD(b1).πD(c2) + p(d1|b2,c1).πD(b2).πD(c1) + p(d1|b2,c2).πD(b2).πD(c2) = (0.2 x 1.086e-22 x 2.64e-23) + (0.7 x 1.086e-22 x 1.736e-22) + (0.45 x 9.14e-23 x 2.64e-23) + (0.22 x 9.14e-23 x 1.736e-22) = 1.83470608e-44 + π(d2) = p(d2|b1,c1).πD(b1).πD(c1) + p(d2|b1,c2).πD(b1).πD(c2) + p(d2|b2,c1).πD(b2).πD(c1) + p(d2|b2,c2).πD(b2).πD(c2) = (0.8 x 1.086e-22 x 2.64e-23) + (0.3 x 1.086e-22 x 1.736e-22) + (0.55 x 9.14e-23 x 2.64e-23) + (0.78 x 9.14e-23 x 1.736e-22) = 2.16529392e-44 + λ(d1) = 1 + λ(d2) = 1 + belief change = 0 + + +******************************************************************************** +Iteration 88 +******************************************************************************** + +status of random variable `A': + domain π(A) λ(A) belief +---------------------------------------------------------------- + a1 0.01 1e-44 0.1 + a2 0.09 1e-44 0.9 + + domain πB(A) λB(A) +---------------------------------------------------------------- + a1 2e-23 1e-22 + a2 1.8e-22 1e-22 + + domain πC(A) λC(A) +---------------------------------------------------------------- + a1 2e-23 1e-22 + a2 1.8e-22 1e-22 + + +status of random variable `B': + domain π(B) λ(B) belief +---------------------------------------------------------------- + b1 1.086e-22 1e-22 0.543 + b2 9.14e-23 1e-22 0.457 + + domain πD(B) λD(B) +---------------------------------------------------------------- + b1 1.086e-22 1e-22 + b2 9.14e-23 1e-22 + + +status of random variable `C': + domain π(C) λ(C) belief +---------------------------------------------------------------- + c1 2.64e-23 1e-22 0.132 + c2 1.736e-22 1e-22 0.868 + + domain πD(C) λD(C) +---------------------------------------------------------------- + c1 2.64e-23 1e-22 + c2 1.736e-22 1e-22 + + +status of random variable `D': + domain π(D) λ(D) belief +---------------------------------------------------------------- + d1 1.83470608e-44 1 0.45867652 + d2 2.16529392e-44 1 0.54132348 + +λ message B --> A + λB(a1) = [p(b1|a1)].λ(b1) + [p(b2|a1)].λ(b2) = [(0.03)]x1e-22 + [(0.97)]x1e-22 = 1e-22 + λB(a2) = [p(b1|a2)].λ(b1) + [p(b2|a2)].λ(b2) = [(0.6)]x1e-22 + [(0.4)]x1e-22 = 1e-22 +λ message C --> A + λC(a1) = [p(c1|a1)].λ(c1) + [p(c2|a1)].λ(c2) = [(0.24)]x1e-22 + [(0.76)]x1e-22 = 1e-22 + λC(a2) = [p(c1|a2)].λ(c1) + [p(c2|a2)].λ(c2) = [(0.12)]x1e-22 + [(0.88)]x1e-22 = 1e-22 +λ message D --> B + λD(b1) = [p(d1|b1,c1).πD(c1) + p(d1|b1,c2).πD(c2)].λ(d1) + [p(d2|b1,c1).πD(c1) + p(d2|b1,c2).πD(c2)].λ(d2) = [(0.2x2.64e-23) + (0.7x1.736e-22)]x1 + [(0.8x2.64e-23) + (0.3x1.736e-22)]x1 = 2e-22 + λD(b2) = [p(d1|b2,c1).πD(c1) + p(d1|b2,c2).πD(c2)].λ(d1) + [p(d2|b2,c1).πD(c1) + p(d2|b2,c2).πD(c2)].λ(d2) = [(0.45x2.64e-23) + (0.22x1.736e-22)]x1 + [(0.55x2.64e-23) + (0.78x1.736e-22)]x1 = 2e-22 +λ message D --> C + λD(c1) = [p(d1|b1,c1).πD(b1) + p(d1|b2,c1).πD(b2)].λ(d1) + [p(d2|b1,c1).πD(b1) + p(d2|b2,c1).πD(b2)].λ(d2) = [(0.2x1.086e-22) + (0.45x9.14e-23)]x1 + [(0.8x1.086e-22) + (0.55x9.14e-23)]x1 = 2e-22 + λD(c2) = [p(d1|b1,c2).πD(b1) + p(d1|b2,c2).πD(b2)].λ(d1) + [p(d2|b1,c2).πD(b1) + p(d2|b2,c2).πD(b2)].λ(d2) = [(0.7x1.086e-22) + (0.22x9.14e-23)]x1 + [(0.3x1.086e-22) + (0.78x9.14e-23)]x1 = 2e-22 +π message A --> B + πB(a1) = π(a1).λC(a1) = 0.01 x 1e-22 = 1e-24 + πB(a2) = π(a2).λC(a2) = 0.09 x 1e-22 = 9e-24 +π message A --> C + πC(a1) = π(a1).λB(a1) = 0.01 x 1e-22 = 1e-24 + πC(a2) = π(a2).λB(a2) = 0.09 x 1e-22 = 9e-24 +π message B --> D + πD(b1) = π(b1) = 1.086e-22 = 1.086e-22 + πD(b2) = π(b2) = 9.14e-23 = 9.14e-23 +π message C --> D + πD(c1) = π(c1) = 2.64e-23 = 2.64e-23 + πD(c2) = π(c2) = 1.736e-22 = 1.736e-22 + +updating π & λ values +node A: + π(a1) = p(a1) = (0.01) = 0.01 + π(a2) = p(a2) = (0.09) = 0.09 + λ(a1) = λB(a1).λC(a1) = 1e-22 x 1e-22 = 1e-44 + λ(a2) = λB(a2).λC(a2) = 1e-22 x 1e-22 = 1e-44 + belief change = 0 +node B: + π(b1) = p(b1|a1).πB(a1) + p(b1|a2).πB(a2) = (0.03 x 1e-24) + (0.6 x 9e-24) = 5.43e-24 + π(b2) = p(b2|a1).πB(a1) + p(b2|a2).πB(a2) = (0.97 x 1e-24) + (0.4 x 9e-24) = 4.57e-24 + λ(b1) = λD(b1) = 2e-22 = 2e-22 + λ(b2) = λD(b2) = 2e-22 = 2e-22 + belief change = 0 +node C: + π(c1) = p(c1|a1).πC(a1) + p(c1|a2).πC(a2) = (0.24 x 1e-24) + (0.12 x 9e-24) = 1.32e-24 + π(c2) = p(c2|a1).πC(a1) + p(c2|a2).πC(a2) = (0.76 x 1e-24) + (0.88 x 9e-24) = 8.68e-24 + λ(c1) = λD(c1) = 2e-22 = 2e-22 + λ(c2) = λD(c2) = 2e-22 = 2e-22 + belief change = 0 +node D: + π(d1) = p(d1|b1,c1).πD(b1).πD(c1) + p(d1|b1,c2).πD(b1).πD(c2) + p(d1|b2,c1).πD(b2).πD(c1) + p(d1|b2,c2).πD(b2).πD(c2) = (0.2 x 1.086e-22 x 2.64e-23) + (0.7 x 1.086e-22 x 1.736e-22) + (0.45 x 9.14e-23 x 2.64e-23) + (0.22 x 9.14e-23 x 1.736e-22) = 1.83470608e-44 + π(d2) = p(d2|b1,c1).πD(b1).πD(c1) + p(d2|b1,c2).πD(b1).πD(c2) + p(d2|b2,c1).πD(b2).πD(c1) + p(d2|b2,c2).πD(b2).πD(c2) = (0.8 x 1.086e-22 x 2.64e-23) + (0.3 x 1.086e-22 x 1.736e-22) + (0.55 x 9.14e-23 x 2.64e-23) + (0.78 x 9.14e-23 x 1.736e-22) = 2.16529392e-44 + λ(d1) = 1 + λ(d2) = 1 + belief change = 0 + + +******************************************************************************** +Iteration 89 +******************************************************************************** + +status of random variable `A': + domain π(A) λ(A) belief +---------------------------------------------------------------- + a1 0.01 1e-44 0.1 + a2 0.09 1e-44 0.9 + + domain πB(A) λB(A) +---------------------------------------------------------------- + a1 1e-24 1e-22 + a2 9e-24 1e-22 + + domain πC(A) λC(A) +---------------------------------------------------------------- + a1 1e-24 1e-22 + a2 9e-24 1e-22 + + +status of random variable `B': + domain π(B) λ(B) belief +---------------------------------------------------------------- + b1 5.43e-24 2e-22 0.543 + b2 4.57e-24 2e-22 0.457 + + domain πD(B) λD(B) +---------------------------------------------------------------- + b1 1.086e-22 2e-22 + b2 9.14e-23 2e-22 + + +status of random variable `C': + domain π(C) λ(C) belief +---------------------------------------------------------------- + c1 1.32e-24 2e-22 0.132 + c2 8.68e-24 2e-22 0.868 + + domain πD(C) λD(C) +---------------------------------------------------------------- + c1 2.64e-23 2e-22 + c2 1.736e-22 2e-22 + + +status of random variable `D': + domain π(D) λ(D) belief +---------------------------------------------------------------- + d1 1.83470608e-44 1 0.45867652 + d2 2.16529392e-44 1 0.54132348 + +λ message B --> A + λB(a1) = [p(b1|a1)].λ(b1) + [p(b2|a1)].λ(b2) = [(0.03)]x2e-22 + [(0.97)]x2e-22 = 2e-22 + λB(a2) = [p(b1|a2)].λ(b1) + [p(b2|a2)].λ(b2) = [(0.6)]x2e-22 + [(0.4)]x2e-22 = 2e-22 +λ message C --> A + λC(a1) = [p(c1|a1)].λ(c1) + [p(c2|a1)].λ(c2) = [(0.24)]x2e-22 + [(0.76)]x2e-22 = 2e-22 + λC(a2) = [p(c1|a2)].λ(c1) + [p(c2|a2)].λ(c2) = [(0.12)]x2e-22 + [(0.88)]x2e-22 = 2e-22 +λ message D --> B + λD(b1) = [p(d1|b1,c1).πD(c1) + p(d1|b1,c2).πD(c2)].λ(d1) + [p(d2|b1,c1).πD(c1) + p(d2|b1,c2).πD(c2)].λ(d2) = [(0.2x2.64e-23) + (0.7x1.736e-22)]x1 + [(0.8x2.64e-23) + (0.3x1.736e-22)]x1 = 2e-22 + λD(b2) = [p(d1|b2,c1).πD(c1) + p(d1|b2,c2).πD(c2)].λ(d1) + [p(d2|b2,c1).πD(c1) + p(d2|b2,c2).πD(c2)].λ(d2) = [(0.45x2.64e-23) + (0.22x1.736e-22)]x1 + [(0.55x2.64e-23) + (0.78x1.736e-22)]x1 = 2e-22 +λ message D --> C + λD(c1) = [p(d1|b1,c1).πD(b1) + p(d1|b2,c1).πD(b2)].λ(d1) + [p(d2|b1,c1).πD(b1) + p(d2|b2,c1).πD(b2)].λ(d2) = [(0.2x1.086e-22) + (0.45x9.14e-23)]x1 + [(0.8x1.086e-22) + (0.55x9.14e-23)]x1 = 2e-22 + λD(c2) = [p(d1|b1,c2).πD(b1) + p(d1|b2,c2).πD(b2)].λ(d1) + [p(d2|b1,c2).πD(b1) + p(d2|b2,c2).πD(b2)].λ(d2) = [(0.7x1.086e-22) + (0.22x9.14e-23)]x1 + [(0.3x1.086e-22) + (0.78x9.14e-23)]x1 = 2e-22 +π message A --> B + πB(a1) = π(a1).λC(a1) = 0.01 x 1e-22 = 1e-24 + πB(a2) = π(a2).λC(a2) = 0.09 x 1e-22 = 9e-24 +π message A --> C + πC(a1) = π(a1).λB(a1) = 0.01 x 1e-22 = 1e-24 + πC(a2) = π(a2).λB(a2) = 0.09 x 1e-22 = 9e-24 +π message B --> D + πD(b1) = π(b1) = 5.43e-24 = 5.43e-24 + πD(b2) = π(b2) = 4.57e-24 = 4.57e-24 +π message C --> D + πD(c1) = π(c1) = 1.32e-24 = 1.32e-24 + πD(c2) = π(c2) = 8.68e-24 = 8.68e-24 + +updating π & λ values +node A: + π(a1) = p(a1) = (0.01) = 0.01 + π(a2) = p(a2) = (0.09) = 0.09 + λ(a1) = λB(a1).λC(a1) = 2e-22 x 2e-22 = 4e-44 + λ(a2) = λB(a2).λC(a2) = 2e-22 x 2e-22 = 4e-44 + belief change = 0 +node B: + π(b1) = p(b1|a1).πB(a1) + p(b1|a2).πB(a2) = (0.03 x 1e-24) + (0.6 x 9e-24) = 5.43e-24 + π(b2) = p(b2|a1).πB(a1) + p(b2|a2).πB(a2) = (0.97 x 1e-24) + (0.4 x 9e-24) = 4.57e-24 + λ(b1) = λD(b1) = 2e-22 = 2e-22 + λ(b2) = λD(b2) = 2e-22 = 2e-22 + belief change = 0 +node C: + π(c1) = p(c1|a1).πC(a1) + p(c1|a2).πC(a2) = (0.24 x 1e-24) + (0.12 x 9e-24) = 1.32e-24 + π(c2) = p(c2|a1).πC(a1) + p(c2|a2).πC(a2) = (0.76 x 1e-24) + (0.88 x 9e-24) = 8.68e-24 + λ(c1) = λD(c1) = 2e-22 = 2e-22 + λ(c2) = λD(c2) = 2e-22 = 2e-22 + belief change = 0 +node D: + π(d1) = p(d1|b1,c1).πD(b1).πD(c1) + p(d1|b1,c2).πD(b1).πD(c2) + p(d1|b2,c1).πD(b2).πD(c1) + p(d1|b2,c2).πD(b2).πD(c2) = (0.2 x 5.43e-24 x 1.32e-24) + (0.7 x 5.43e-24 x 8.68e-24) + (0.45 x 4.57e-24 x 1.32e-24) + (0.22 x 4.57e-24 x 8.68e-24) = 4.5867652e-47 + π(d2) = p(d2|b1,c1).πD(b1).πD(c1) + p(d2|b1,c2).πD(b1).πD(c2) + p(d2|b2,c1).πD(b2).πD(c1) + p(d2|b2,c2).πD(b2).πD(c2) = (0.8 x 5.43e-24 x 1.32e-24) + (0.3 x 5.43e-24 x 8.68e-24) + (0.55 x 4.57e-24 x 1.32e-24) + (0.78 x 4.57e-24 x 8.68e-24) = 5.4132348e-47 + λ(d1) = 1 + λ(d2) = 1 + belief change = 1.665334537e-16 + + +******************************************************************************** +Iteration 90 +******************************************************************************** + +status of random variable `A': + domain π(A) λ(A) belief +---------------------------------------------------------------- + a1 0.01 4e-44 0.1 + a2 0.09 4e-44 0.9 + + domain πB(A) λB(A) +---------------------------------------------------------------- + a1 1e-24 2e-22 + a2 9e-24 2e-22 + + domain πC(A) λC(A) +---------------------------------------------------------------- + a1 1e-24 2e-22 + a2 9e-24 2e-22 + + +status of random variable `B': + domain π(B) λ(B) belief +---------------------------------------------------------------- + b1 5.43e-24 2e-22 0.543 + b2 4.57e-24 2e-22 0.457 + + domain πD(B) λD(B) +---------------------------------------------------------------- + b1 5.43e-24 2e-22 + b2 4.57e-24 2e-22 + + +status of random variable `C': + domain π(C) λ(C) belief +---------------------------------------------------------------- + c1 1.32e-24 2e-22 0.132 + c2 8.68e-24 2e-22 0.868 + + domain πD(C) λD(C) +---------------------------------------------------------------- + c1 1.32e-24 2e-22 + c2 8.68e-24 2e-22 + + +status of random variable `D': + domain π(D) λ(D) belief +---------------------------------------------------------------- + d1 4.5867652e-47 1 0.45867652 + d2 5.4132348e-47 1 0.54132348 + +λ message B --> A + λB(a1) = [p(b1|a1)].λ(b1) + [p(b2|a1)].λ(b2) = [(0.03)]x2e-22 + [(0.97)]x2e-22 = 2e-22 + λB(a2) = [p(b1|a2)].λ(b1) + [p(b2|a2)].λ(b2) = [(0.6)]x2e-22 + [(0.4)]x2e-22 = 2e-22 +λ message C --> A + λC(a1) = [p(c1|a1)].λ(c1) + [p(c2|a1)].λ(c2) = [(0.24)]x2e-22 + [(0.76)]x2e-22 = 2e-22 + λC(a2) = [p(c1|a2)].λ(c1) + [p(c2|a2)].λ(c2) = [(0.12)]x2e-22 + [(0.88)]x2e-22 = 2e-22 +λ message D --> B + λD(b1) = [p(d1|b1,c1).πD(c1) + p(d1|b1,c2).πD(c2)].λ(d1) + [p(d2|b1,c1).πD(c1) + p(d2|b1,c2).πD(c2)].λ(d2) = [(0.2x1.32e-24) + (0.7x8.68e-24)]x1 + [(0.8x1.32e-24) + (0.3x8.68e-24)]x1 = 1e-23 + λD(b2) = [p(d1|b2,c1).πD(c1) + p(d1|b2,c2).πD(c2)].λ(d1) + [p(d2|b2,c1).πD(c1) + p(d2|b2,c2).πD(c2)].λ(d2) = [(0.45x1.32e-24) + (0.22x8.68e-24)]x1 + [(0.55x1.32e-24) + (0.78x8.68e-24)]x1 = 1e-23 +λ message D --> C + λD(c1) = [p(d1|b1,c1).πD(b1) + p(d1|b2,c1).πD(b2)].λ(d1) + [p(d2|b1,c1).πD(b1) + p(d2|b2,c1).πD(b2)].λ(d2) = [(0.2x5.43e-24) + (0.45x4.57e-24)]x1 + [(0.8x5.43e-24) + (0.55x4.57e-24)]x1 = 1e-23 + λD(c2) = [p(d1|b1,c2).πD(b1) + p(d1|b2,c2).πD(b2)].λ(d1) + [p(d2|b1,c2).πD(b1) + p(d2|b2,c2).πD(b2)].λ(d2) = [(0.7x5.43e-24) + (0.22x4.57e-24)]x1 + [(0.3x5.43e-24) + (0.78x4.57e-24)]x1 = 1e-23 +π message A --> B + πB(a1) = π(a1).λC(a1) = 0.01 x 2e-22 = 2e-24 + πB(a2) = π(a2).λC(a2) = 0.09 x 2e-22 = 1.8e-23 +π message A --> C + πC(a1) = π(a1).λB(a1) = 0.01 x 2e-22 = 2e-24 + πC(a2) = π(a2).λB(a2) = 0.09 x 2e-22 = 1.8e-23 +π message B --> D + πD(b1) = π(b1) = 5.43e-24 = 5.43e-24 + πD(b2) = π(b2) = 4.57e-24 = 4.57e-24 +π message C --> D + πD(c1) = π(c1) = 1.32e-24 = 1.32e-24 + πD(c2) = π(c2) = 8.68e-24 = 8.68e-24 + +updating π & λ values +node A: + π(a1) = p(a1) = (0.01) = 0.01 + π(a2) = p(a2) = (0.09) = 0.09 + λ(a1) = λB(a1).λC(a1) = 2e-22 x 2e-22 = 4e-44 + λ(a2) = λB(a2).λC(a2) = 2e-22 x 2e-22 = 4e-44 + belief change = 0 +node B: + π(b1) = p(b1|a1).πB(a1) + p(b1|a2).πB(a2) = (0.03 x 2e-24) + (0.6 x 1.8e-23) = 1.086e-23 + π(b2) = p(b2|a1).πB(a1) + p(b2|a2).πB(a2) = (0.97 x 2e-24) + (0.4 x 1.8e-23) = 9.14e-24 + λ(b1) = λD(b1) = 1e-23 = 1e-23 + λ(b2) = λD(b2) = 1e-23 = 1e-23 + belief change = 5.551115123e-17 +node C: + π(c1) = p(c1|a1).πC(a1) + p(c1|a2).πC(a2) = (0.24 x 2e-24) + (0.12 x 1.8e-23) = 2.64e-24 + π(c2) = p(c2|a1).πC(a1) + p(c2|a2).πC(a2) = (0.76 x 2e-24) + (0.88 x 1.8e-23) = 1.736e-23 + λ(c1) = λD(c1) = 1e-23 = 1e-23 + λ(c2) = λD(c2) = 1e-23 = 1e-23 + belief change = 0 +node D: + π(d1) = p(d1|b1,c1).πD(b1).πD(c1) + p(d1|b1,c2).πD(b1).πD(c2) + p(d1|b2,c1).πD(b2).πD(c1) + p(d1|b2,c2).πD(b2).πD(c2) = (0.2 x 5.43e-24 x 1.32e-24) + (0.7 x 5.43e-24 x 8.68e-24) + (0.45 x 4.57e-24 x 1.32e-24) + (0.22 x 4.57e-24 x 8.68e-24) = 4.5867652e-47 + π(d2) = p(d2|b1,c1).πD(b1).πD(c1) + p(d2|b1,c2).πD(b1).πD(c2) + p(d2|b2,c1).πD(b2).πD(c1) + p(d2|b2,c2).πD(b2).πD(c2) = (0.8 x 5.43e-24 x 1.32e-24) + (0.3 x 5.43e-24 x 8.68e-24) + (0.55 x 4.57e-24 x 1.32e-24) + (0.78 x 4.57e-24 x 8.68e-24) = 5.4132348e-47 + λ(d1) = 1 + λ(d2) = 1 + belief change = 0 + + +******************************************************************************** +Iteration 91 +******************************************************************************** + +status of random variable `A': + domain π(A) λ(A) belief +---------------------------------------------------------------- + a1 0.01 4e-44 0.1 + a2 0.09 4e-44 0.9 + + domain πB(A) λB(A) +---------------------------------------------------------------- + a1 2e-24 2e-22 + a2 1.8e-23 2e-22 + + domain πC(A) λC(A) +---------------------------------------------------------------- + a1 2e-24 2e-22 + a2 1.8e-23 2e-22 + + +status of random variable `B': + domain π(B) λ(B) belief +---------------------------------------------------------------- + b1 1.086e-23 1e-23 0.543 + b2 9.14e-24 1e-23 0.457 + + domain πD(B) λD(B) +---------------------------------------------------------------- + b1 5.43e-24 1e-23 + b2 4.57e-24 1e-23 + + +status of random variable `C': + domain π(C) λ(C) belief +---------------------------------------------------------------- + c1 2.64e-24 1e-23 0.132 + c2 1.736e-23 1e-23 0.868 + + domain πD(C) λD(C) +---------------------------------------------------------------- + c1 1.32e-24 1e-23 + c2 8.68e-24 1e-23 + + +status of random variable `D': + domain π(D) λ(D) belief +---------------------------------------------------------------- + d1 4.5867652e-47 1 0.45867652 + d2 5.4132348e-47 1 0.54132348 + +λ message B --> A + λB(a1) = [p(b1|a1)].λ(b1) + [p(b2|a1)].λ(b2) = [(0.03)]x1e-23 + [(0.97)]x1e-23 = 1e-23 + λB(a2) = [p(b1|a2)].λ(b1) + [p(b2|a2)].λ(b2) = [(0.6)]x1e-23 + [(0.4)]x1e-23 = 1e-23 +λ message C --> A + λC(a1) = [p(c1|a1)].λ(c1) + [p(c2|a1)].λ(c2) = [(0.24)]x1e-23 + [(0.76)]x1e-23 = 1e-23 + λC(a2) = [p(c1|a2)].λ(c1) + [p(c2|a2)].λ(c2) = [(0.12)]x1e-23 + [(0.88)]x1e-23 = 1e-23 +λ message D --> B + λD(b1) = [p(d1|b1,c1).πD(c1) + p(d1|b1,c2).πD(c2)].λ(d1) + [p(d2|b1,c1).πD(c1) + p(d2|b1,c2).πD(c2)].λ(d2) = [(0.2x1.32e-24) + (0.7x8.68e-24)]x1 + [(0.8x1.32e-24) + (0.3x8.68e-24)]x1 = 1e-23 + λD(b2) = [p(d1|b2,c1).πD(c1) + p(d1|b2,c2).πD(c2)].λ(d1) + [p(d2|b2,c1).πD(c1) + p(d2|b2,c2).πD(c2)].λ(d2) = [(0.45x1.32e-24) + (0.22x8.68e-24)]x1 + [(0.55x1.32e-24) + (0.78x8.68e-24)]x1 = 1e-23 +λ message D --> C + λD(c1) = [p(d1|b1,c1).πD(b1) + p(d1|b2,c1).πD(b2)].λ(d1) + [p(d2|b1,c1).πD(b1) + p(d2|b2,c1).πD(b2)].λ(d2) = [(0.2x5.43e-24) + (0.45x4.57e-24)]x1 + [(0.8x5.43e-24) + (0.55x4.57e-24)]x1 = 1e-23 + λD(c2) = [p(d1|b1,c2).πD(b1) + p(d1|b2,c2).πD(b2)].λ(d1) + [p(d2|b1,c2).πD(b1) + p(d2|b2,c2).πD(b2)].λ(d2) = [(0.7x5.43e-24) + (0.22x4.57e-24)]x1 + [(0.3x5.43e-24) + (0.78x4.57e-24)]x1 = 1e-23 +π message A --> B + πB(a1) = π(a1).λC(a1) = 0.01 x 2e-22 = 2e-24 + πB(a2) = π(a2).λC(a2) = 0.09 x 2e-22 = 1.8e-23 +π message A --> C + πC(a1) = π(a1).λB(a1) = 0.01 x 2e-22 = 2e-24 + πC(a2) = π(a2).λB(a2) = 0.09 x 2e-22 = 1.8e-23 +π message B --> D + πD(b1) = π(b1) = 1.086e-23 = 1.086e-23 + πD(b2) = π(b2) = 9.14e-24 = 9.14e-24 +π message C --> D + πD(c1) = π(c1) = 2.64e-24 = 2.64e-24 + πD(c2) = π(c2) = 1.736e-23 = 1.736e-23 + +updating π & λ values +node A: + π(a1) = p(a1) = (0.01) = 0.01 + π(a2) = p(a2) = (0.09) = 0.09 + λ(a1) = λB(a1).λC(a1) = 1e-23 x 1e-23 = 1e-46 + λ(a2) = λB(a2).λC(a2) = 1e-23 x 1e-23 = 1e-46 + belief change = 1.110223025e-16 +node B: + π(b1) = p(b1|a1).πB(a1) + p(b1|a2).πB(a2) = (0.03 x 2e-24) + (0.6 x 1.8e-23) = 1.086e-23 + π(b2) = p(b2|a1).πB(a1) + p(b2|a2).πB(a2) = (0.97 x 2e-24) + (0.4 x 1.8e-23) = 9.14e-24 + λ(b1) = λD(b1) = 1e-23 = 1e-23 + λ(b2) = λD(b2) = 1e-23 = 1e-23 + belief change = 0 +node C: + π(c1) = p(c1|a1).πC(a1) + p(c1|a2).πC(a2) = (0.24 x 2e-24) + (0.12 x 1.8e-23) = 2.64e-24 + π(c2) = p(c2|a1).πC(a1) + p(c2|a2).πC(a2) = (0.76 x 2e-24) + (0.88 x 1.8e-23) = 1.736e-23 + λ(c1) = λD(c1) = 1e-23 = 1e-23 + λ(c2) = λD(c2) = 1e-23 = 1e-23 + belief change = 0 +node D: + π(d1) = p(d1|b1,c1).πD(b1).πD(c1) + p(d1|b1,c2).πD(b1).πD(c2) + p(d1|b2,c1).πD(b2).πD(c1) + p(d1|b2,c2).πD(b2).πD(c2) = (0.2 x 1.086e-23 x 2.64e-24) + (0.7 x 1.086e-23 x 1.736e-23) + (0.45 x 9.14e-24 x 2.64e-24) + (0.22 x 9.14e-24 x 1.736e-23) = 1.83470608e-46 + π(d2) = p(d2|b1,c1).πD(b1).πD(c1) + p(d2|b1,c2).πD(b1).πD(c2) + p(d2|b2,c1).πD(b2).πD(c1) + p(d2|b2,c2).πD(b2).πD(c2) = (0.8 x 1.086e-23 x 2.64e-24) + (0.3 x 1.086e-23 x 1.736e-23) + (0.55 x 9.14e-24 x 2.64e-24) + (0.78 x 9.14e-24 x 1.736e-23) = 2.16529392e-46 + λ(d1) = 1 + λ(d2) = 1 + belief change = 0 + + +******************************************************************************** +Iteration 92 +******************************************************************************** + +status of random variable `A': + domain π(A) λ(A) belief +---------------------------------------------------------------- + a1 0.01 1e-46 0.1 + a2 0.09 1e-46 0.9 + + domain πB(A) λB(A) +---------------------------------------------------------------- + a1 2e-24 1e-23 + a2 1.8e-23 1e-23 + + domain πC(A) λC(A) +---------------------------------------------------------------- + a1 2e-24 1e-23 + a2 1.8e-23 1e-23 + + +status of random variable `B': + domain π(B) λ(B) belief +---------------------------------------------------------------- + b1 1.086e-23 1e-23 0.543 + b2 9.14e-24 1e-23 0.457 + + domain πD(B) λD(B) +---------------------------------------------------------------- + b1 1.086e-23 1e-23 + b2 9.14e-24 1e-23 + + +status of random variable `C': + domain π(C) λ(C) belief +---------------------------------------------------------------- + c1 2.64e-24 1e-23 0.132 + c2 1.736e-23 1e-23 0.868 + + domain πD(C) λD(C) +---------------------------------------------------------------- + c1 2.64e-24 1e-23 + c2 1.736e-23 1e-23 + + +status of random variable `D': + domain π(D) λ(D) belief +---------------------------------------------------------------- + d1 1.83470608e-46 1 0.45867652 + d2 2.16529392e-46 1 0.54132348 + +λ message B --> A + λB(a1) = [p(b1|a1)].λ(b1) + [p(b2|a1)].λ(b2) = [(0.03)]x1e-23 + [(0.97)]x1e-23 = 1e-23 + λB(a2) = [p(b1|a2)].λ(b1) + [p(b2|a2)].λ(b2) = [(0.6)]x1e-23 + [(0.4)]x1e-23 = 1e-23 +λ message C --> A + λC(a1) = [p(c1|a1)].λ(c1) + [p(c2|a1)].λ(c2) = [(0.24)]x1e-23 + [(0.76)]x1e-23 = 1e-23 + λC(a2) = [p(c1|a2)].λ(c1) + [p(c2|a2)].λ(c2) = [(0.12)]x1e-23 + [(0.88)]x1e-23 = 1e-23 +λ message D --> B + λD(b1) = [p(d1|b1,c1).πD(c1) + p(d1|b1,c2).πD(c2)].λ(d1) + [p(d2|b1,c1).πD(c1) + p(d2|b1,c2).πD(c2)].λ(d2) = [(0.2x2.64e-24) + (0.7x1.736e-23)]x1 + [(0.8x2.64e-24) + (0.3x1.736e-23)]x1 = 2e-23 + λD(b2) = [p(d1|b2,c1).πD(c1) + p(d1|b2,c2).πD(c2)].λ(d1) + [p(d2|b2,c1).πD(c1) + p(d2|b2,c2).πD(c2)].λ(d2) = [(0.45x2.64e-24) + (0.22x1.736e-23)]x1 + [(0.55x2.64e-24) + (0.78x1.736e-23)]x1 = 2e-23 +λ message D --> C + λD(c1) = [p(d1|b1,c1).πD(b1) + p(d1|b2,c1).πD(b2)].λ(d1) + [p(d2|b1,c1).πD(b1) + p(d2|b2,c1).πD(b2)].λ(d2) = [(0.2x1.086e-23) + (0.45x9.14e-24)]x1 + [(0.8x1.086e-23) + (0.55x9.14e-24)]x1 = 2e-23 + λD(c2) = [p(d1|b1,c2).πD(b1) + p(d1|b2,c2).πD(b2)].λ(d1) + [p(d2|b1,c2).πD(b1) + p(d2|b2,c2).πD(b2)].λ(d2) = [(0.7x1.086e-23) + (0.22x9.14e-24)]x1 + [(0.3x1.086e-23) + (0.78x9.14e-24)]x1 = 2e-23 +π message A --> B + πB(a1) = π(a1).λC(a1) = 0.01 x 1e-23 = 1e-25 + πB(a2) = π(a2).λC(a2) = 0.09 x 1e-23 = 9e-25 +π message A --> C + πC(a1) = π(a1).λB(a1) = 0.01 x 1e-23 = 1e-25 + πC(a2) = π(a2).λB(a2) = 0.09 x 1e-23 = 9e-25 +π message B --> D + πD(b1) = π(b1) = 1.086e-23 = 1.086e-23 + πD(b2) = π(b2) = 9.14e-24 = 9.14e-24 +π message C --> D + πD(c1) = π(c1) = 2.64e-24 = 2.64e-24 + πD(c2) = π(c2) = 1.736e-23 = 1.736e-23 + +updating π & λ values +node A: + π(a1) = p(a1) = (0.01) = 0.01 + π(a2) = p(a2) = (0.09) = 0.09 + λ(a1) = λB(a1).λC(a1) = 1e-23 x 1e-23 = 1e-46 + λ(a2) = λB(a2).λC(a2) = 1e-23 x 1e-23 = 1e-46 + belief change = 0 +node B: + π(b1) = p(b1|a1).πB(a1) + p(b1|a2).πB(a2) = (0.03 x 1e-25) + (0.6 x 9e-25) = 5.43e-25 + π(b2) = p(b2|a1).πB(a1) + p(b2|a2).πB(a2) = (0.97 x 1e-25) + (0.4 x 9e-25) = 4.57e-25 + λ(b1) = λD(b1) = 2e-23 = 2e-23 + λ(b2) = λD(b2) = 2e-23 = 2e-23 + belief change = 5.551115123e-17 +node C: + π(c1) = p(c1|a1).πC(a1) + p(c1|a2).πC(a2) = (0.24 x 1e-25) + (0.12 x 9e-25) = 1.32e-25 + π(c2) = p(c2|a1).πC(a1) + p(c2|a2).πC(a2) = (0.76 x 1e-25) + (0.88 x 9e-25) = 8.68e-25 + λ(c1) = λD(c1) = 2e-23 = 2e-23 + λ(c2) = λD(c2) = 2e-23 = 2e-23 + belief change = 2.775557562e-17 +node D: + π(d1) = p(d1|b1,c1).πD(b1).πD(c1) + p(d1|b1,c2).πD(b1).πD(c2) + p(d1|b2,c1).πD(b2).πD(c1) + p(d1|b2,c2).πD(b2).πD(c2) = (0.2 x 1.086e-23 x 2.64e-24) + (0.7 x 1.086e-23 x 1.736e-23) + (0.45 x 9.14e-24 x 2.64e-24) + (0.22 x 9.14e-24 x 1.736e-23) = 1.83470608e-46 + π(d2) = p(d2|b1,c1).πD(b1).πD(c1) + p(d2|b1,c2).πD(b1).πD(c2) + p(d2|b2,c1).πD(b2).πD(c1) + p(d2|b2,c2).πD(b2).πD(c2) = (0.8 x 1.086e-23 x 2.64e-24) + (0.3 x 1.086e-23 x 1.736e-23) + (0.55 x 9.14e-24 x 2.64e-24) + (0.78 x 9.14e-24 x 1.736e-23) = 2.16529392e-46 + λ(d1) = 1 + λ(d2) = 1 + belief change = 0 + + +******************************************************************************** +Iteration 93 +******************************************************************************** + +status of random variable `A': + domain π(A) λ(A) belief +---------------------------------------------------------------- + a1 0.01 1e-46 0.1 + a2 0.09 1e-46 0.9 + + domain πB(A) λB(A) +---------------------------------------------------------------- + a1 1e-25 1e-23 + a2 9e-25 1e-23 + + domain πC(A) λC(A) +---------------------------------------------------------------- + a1 1e-25 1e-23 + a2 9e-25 1e-23 + + +status of random variable `B': + domain π(B) λ(B) belief +---------------------------------------------------------------- + b1 5.43e-25 2e-23 0.543 + b2 4.57e-25 2e-23 0.457 + + domain πD(B) λD(B) +---------------------------------------------------------------- + b1 1.086e-23 2e-23 + b2 9.14e-24 2e-23 + + +status of random variable `C': + domain π(C) λ(C) belief +---------------------------------------------------------------- + c1 1.32e-25 2e-23 0.132 + c2 8.68e-25 2e-23 0.868 + + domain πD(C) λD(C) +---------------------------------------------------------------- + c1 2.64e-24 2e-23 + c2 1.736e-23 2e-23 + + +status of random variable `D': + domain π(D) λ(D) belief +---------------------------------------------------------------- + d1 1.83470608e-46 1 0.45867652 + d2 2.16529392e-46 1 0.54132348 + +λ message B --> A + λB(a1) = [p(b1|a1)].λ(b1) + [p(b2|a1)].λ(b2) = [(0.03)]x2e-23 + [(0.97)]x2e-23 = 2e-23 + λB(a2) = [p(b1|a2)].λ(b1) + [p(b2|a2)].λ(b2) = [(0.6)]x2e-23 + [(0.4)]x2e-23 = 2e-23 +λ message C --> A + λC(a1) = [p(c1|a1)].λ(c1) + [p(c2|a1)].λ(c2) = [(0.24)]x2e-23 + [(0.76)]x2e-23 = 2e-23 + λC(a2) = [p(c1|a2)].λ(c1) + [p(c2|a2)].λ(c2) = [(0.12)]x2e-23 + [(0.88)]x2e-23 = 2e-23 +λ message D --> B + λD(b1) = [p(d1|b1,c1).πD(c1) + p(d1|b1,c2).πD(c2)].λ(d1) + [p(d2|b1,c1).πD(c1) + p(d2|b1,c2).πD(c2)].λ(d2) = [(0.2x2.64e-24) + (0.7x1.736e-23)]x1 + [(0.8x2.64e-24) + (0.3x1.736e-23)]x1 = 2e-23 + λD(b2) = [p(d1|b2,c1).πD(c1) + p(d1|b2,c2).πD(c2)].λ(d1) + [p(d2|b2,c1).πD(c1) + p(d2|b2,c2).πD(c2)].λ(d2) = [(0.45x2.64e-24) + (0.22x1.736e-23)]x1 + [(0.55x2.64e-24) + (0.78x1.736e-23)]x1 = 2e-23 +λ message D --> C + λD(c1) = [p(d1|b1,c1).πD(b1) + p(d1|b2,c1).πD(b2)].λ(d1) + [p(d2|b1,c1).πD(b1) + p(d2|b2,c1).πD(b2)].λ(d2) = [(0.2x1.086e-23) + (0.45x9.14e-24)]x1 + [(0.8x1.086e-23) + (0.55x9.14e-24)]x1 = 2e-23 + λD(c2) = [p(d1|b1,c2).πD(b1) + p(d1|b2,c2).πD(b2)].λ(d1) + [p(d2|b1,c2).πD(b1) + p(d2|b2,c2).πD(b2)].λ(d2) = [(0.7x1.086e-23) + (0.22x9.14e-24)]x1 + [(0.3x1.086e-23) + (0.78x9.14e-24)]x1 = 2e-23 +π message A --> B + πB(a1) = π(a1).λC(a1) = 0.01 x 1e-23 = 1e-25 + πB(a2) = π(a2).λC(a2) = 0.09 x 1e-23 = 9e-25 +π message A --> C + πC(a1) = π(a1).λB(a1) = 0.01 x 1e-23 = 1e-25 + πC(a2) = π(a2).λB(a2) = 0.09 x 1e-23 = 9e-25 +π message B --> D + πD(b1) = π(b1) = 5.43e-25 = 5.43e-25 + πD(b2) = π(b2) = 4.57e-25 = 4.57e-25 +π message C --> D + πD(c1) = π(c1) = 1.32e-25 = 1.32e-25 + πD(c2) = π(c2) = 8.68e-25 = 8.68e-25 + +updating π & λ values +node A: + π(a1) = p(a1) = (0.01) = 0.01 + π(a2) = p(a2) = (0.09) = 0.09 + λ(a1) = λB(a1).λC(a1) = 2e-23 x 2e-23 = 4e-46 + λ(a2) = λB(a2).λC(a2) = 2e-23 x 2e-23 = 4e-46 + belief change = 0 +node B: + π(b1) = p(b1|a1).πB(a1) + p(b1|a2).πB(a2) = (0.03 x 1e-25) + (0.6 x 9e-25) = 5.43e-25 + π(b2) = p(b2|a1).πB(a1) + p(b2|a2).πB(a2) = (0.97 x 1e-25) + (0.4 x 9e-25) = 4.57e-25 + λ(b1) = λD(b1) = 2e-23 = 2e-23 + λ(b2) = λD(b2) = 2e-23 = 2e-23 + belief change = 0 +node C: + π(c1) = p(c1|a1).πC(a1) + p(c1|a2).πC(a2) = (0.24 x 1e-25) + (0.12 x 9e-25) = 1.32e-25 + π(c2) = p(c2|a1).πC(a1) + p(c2|a2).πC(a2) = (0.76 x 1e-25) + (0.88 x 9e-25) = 8.68e-25 + λ(c1) = λD(c1) = 2e-23 = 2e-23 + λ(c2) = λD(c2) = 2e-23 = 2e-23 + belief change = 0 +node D: + π(d1) = p(d1|b1,c1).πD(b1).πD(c1) + p(d1|b1,c2).πD(b1).πD(c2) + p(d1|b2,c1).πD(b2).πD(c1) + p(d1|b2,c2).πD(b2).πD(c2) = (0.2 x 5.43e-25 x 1.32e-25) + (0.7 x 5.43e-25 x 8.68e-25) + (0.45 x 4.57e-25 x 1.32e-25) + (0.22 x 4.57e-25 x 8.68e-25) = 4.5867652e-49 + π(d2) = p(d2|b1,c1).πD(b1).πD(c1) + p(d2|b1,c2).πD(b1).πD(c2) + p(d2|b2,c1).πD(b2).πD(c1) + p(d2|b2,c2).πD(b2).πD(c2) = (0.8 x 5.43e-25 x 1.32e-25) + (0.3 x 5.43e-25 x 8.68e-25) + (0.55 x 4.57e-25 x 1.32e-25) + (0.78 x 4.57e-25 x 8.68e-25) = 5.4132348e-49 + λ(d1) = 1 + λ(d2) = 1 + belief change = 0 + + +******************************************************************************** +Iteration 94 +******************************************************************************** + +status of random variable `A': + domain π(A) λ(A) belief +---------------------------------------------------------------- + a1 0.01 4e-46 0.1 + a2 0.09 4e-46 0.9 + + domain πB(A) λB(A) +---------------------------------------------------------------- + a1 1e-25 2e-23 + a2 9e-25 2e-23 + + domain πC(A) λC(A) +---------------------------------------------------------------- + a1 1e-25 2e-23 + a2 9e-25 2e-23 + + +status of random variable `B': + domain π(B) λ(B) belief +---------------------------------------------------------------- + b1 5.43e-25 2e-23 0.543 + b2 4.57e-25 2e-23 0.457 + + domain πD(B) λD(B) +---------------------------------------------------------------- + b1 5.43e-25 2e-23 + b2 4.57e-25 2e-23 + + +status of random variable `C': + domain π(C) λ(C) belief +---------------------------------------------------------------- + c1 1.32e-25 2e-23 0.132 + c2 8.68e-25 2e-23 0.868 + + domain πD(C) λD(C) +---------------------------------------------------------------- + c1 1.32e-25 2e-23 + c2 8.68e-25 2e-23 + + +status of random variable `D': + domain π(D) λ(D) belief +---------------------------------------------------------------- + d1 4.5867652e-49 1 0.45867652 + d2 5.4132348e-49 1 0.54132348 + +λ message B --> A + λB(a1) = [p(b1|a1)].λ(b1) + [p(b2|a1)].λ(b2) = [(0.03)]x2e-23 + [(0.97)]x2e-23 = 2e-23 + λB(a2) = [p(b1|a2)].λ(b1) + [p(b2|a2)].λ(b2) = [(0.6)]x2e-23 + [(0.4)]x2e-23 = 2e-23 +λ message C --> A + λC(a1) = [p(c1|a1)].λ(c1) + [p(c2|a1)].λ(c2) = [(0.24)]x2e-23 + [(0.76)]x2e-23 = 2e-23 + λC(a2) = [p(c1|a2)].λ(c1) + [p(c2|a2)].λ(c2) = [(0.12)]x2e-23 + [(0.88)]x2e-23 = 2e-23 +λ message D --> B + λD(b1) = [p(d1|b1,c1).πD(c1) + p(d1|b1,c2).πD(c2)].λ(d1) + [p(d2|b1,c1).πD(c1) + p(d2|b1,c2).πD(c2)].λ(d2) = [(0.2x1.32e-25) + (0.7x8.68e-25)]x1 + [(0.8x1.32e-25) + (0.3x8.68e-25)]x1 = 1e-24 + λD(b2) = [p(d1|b2,c1).πD(c1) + p(d1|b2,c2).πD(c2)].λ(d1) + [p(d2|b2,c1).πD(c1) + p(d2|b2,c2).πD(c2)].λ(d2) = [(0.45x1.32e-25) + (0.22x8.68e-25)]x1 + [(0.55x1.32e-25) + (0.78x8.68e-25)]x1 = 1e-24 +λ message D --> C + λD(c1) = [p(d1|b1,c1).πD(b1) + p(d1|b2,c1).πD(b2)].λ(d1) + [p(d2|b1,c1).πD(b1) + p(d2|b2,c1).πD(b2)].λ(d2) = [(0.2x5.43e-25) + (0.45x4.57e-25)]x1 + [(0.8x5.43e-25) + (0.55x4.57e-25)]x1 = 1e-24 + λD(c2) = [p(d1|b1,c2).πD(b1) + p(d1|b2,c2).πD(b2)].λ(d1) + [p(d2|b1,c2).πD(b1) + p(d2|b2,c2).πD(b2)].λ(d2) = [(0.7x5.43e-25) + (0.22x4.57e-25)]x1 + [(0.3x5.43e-25) + (0.78x4.57e-25)]x1 = 1e-24 +π message A --> B + πB(a1) = π(a1).λC(a1) = 0.01 x 2e-23 = 2e-25 + πB(a2) = π(a2).λC(a2) = 0.09 x 2e-23 = 1.8e-24 +π message A --> C + πC(a1) = π(a1).λB(a1) = 0.01 x 2e-23 = 2e-25 + πC(a2) = π(a2).λB(a2) = 0.09 x 2e-23 = 1.8e-24 +π message B --> D + πD(b1) = π(b1) = 5.43e-25 = 5.43e-25 + πD(b2) = π(b2) = 4.57e-25 = 4.57e-25 +π message C --> D + πD(c1) = π(c1) = 1.32e-25 = 1.32e-25 + πD(c2) = π(c2) = 8.68e-25 = 8.68e-25 + +updating π & λ values +node A: + π(a1) = p(a1) = (0.01) = 0.01 + π(a2) = p(a2) = (0.09) = 0.09 + λ(a1) = λB(a1).λC(a1) = 2e-23 x 2e-23 = 4e-46 + λ(a2) = λB(a2).λC(a2) = 2e-23 x 2e-23 = 4e-46 + belief change = 0 +node B: + π(b1) = p(b1|a1).πB(a1) + p(b1|a2).πB(a2) = (0.03 x 2e-25) + (0.6 x 1.8e-24) = 1.086e-24 + π(b2) = p(b2|a1).πB(a1) + p(b2|a2).πB(a2) = (0.97 x 2e-25) + (0.4 x 1.8e-24) = 9.14e-25 + λ(b1) = λD(b1) = 1e-24 = 1e-24 + λ(b2) = λD(b2) = 1e-24 = 1e-24 + belief change = 0 +node C: + π(c1) = p(c1|a1).πC(a1) + p(c1|a2).πC(a2) = (0.24 x 2e-25) + (0.12 x 1.8e-24) = 2.64e-25 + π(c2) = p(c2|a1).πC(a1) + p(c2|a2).πC(a2) = (0.76 x 2e-25) + (0.88 x 1.8e-24) = 1.736e-24 + λ(c1) = λD(c1) = 1e-24 = 1e-24 + λ(c2) = λD(c2) = 1e-24 = 1e-24 + belief change = 0 +node D: + π(d1) = p(d1|b1,c1).πD(b1).πD(c1) + p(d1|b1,c2).πD(b1).πD(c2) + p(d1|b2,c1).πD(b2).πD(c1) + p(d1|b2,c2).πD(b2).πD(c2) = (0.2 x 5.43e-25 x 1.32e-25) + (0.7 x 5.43e-25 x 8.68e-25) + (0.45 x 4.57e-25 x 1.32e-25) + (0.22 x 4.57e-25 x 8.68e-25) = 4.5867652e-49 + π(d2) = p(d2|b1,c1).πD(b1).πD(c1) + p(d2|b1,c2).πD(b1).πD(c2) + p(d2|b2,c1).πD(b2).πD(c1) + p(d2|b2,c2).πD(b2).πD(c2) = (0.8 x 5.43e-25 x 1.32e-25) + (0.3 x 5.43e-25 x 8.68e-25) + (0.55 x 4.57e-25 x 1.32e-25) + (0.78 x 4.57e-25 x 8.68e-25) = 5.4132348e-49 + λ(d1) = 1 + λ(d2) = 1 + belief change = 0 + + +******************************************************************************** +Iteration 95 +******************************************************************************** + +status of random variable `A': + domain π(A) λ(A) belief +---------------------------------------------------------------- + a1 0.01 4e-46 0.1 + a2 0.09 4e-46 0.9 + + domain πB(A) λB(A) +---------------------------------------------------------------- + a1 2e-25 2e-23 + a2 1.8e-24 2e-23 + + domain πC(A) λC(A) +---------------------------------------------------------------- + a1 2e-25 2e-23 + a2 1.8e-24 2e-23 + + +status of random variable `B': + domain π(B) λ(B) belief +---------------------------------------------------------------- + b1 1.086e-24 1e-24 0.543 + b2 9.14e-25 1e-24 0.457 + + domain πD(B) λD(B) +---------------------------------------------------------------- + b1 5.43e-25 1e-24 + b2 4.57e-25 1e-24 + + +status of random variable `C': + domain π(C) λ(C) belief +---------------------------------------------------------------- + c1 2.64e-25 1e-24 0.132 + c2 1.736e-24 1e-24 0.868 + + domain πD(C) λD(C) +---------------------------------------------------------------- + c1 1.32e-25 1e-24 + c2 8.68e-25 1e-24 + + +status of random variable `D': + domain π(D) λ(D) belief +---------------------------------------------------------------- + d1 4.5867652e-49 1 0.45867652 + d2 5.4132348e-49 1 0.54132348 + +λ message B --> A + λB(a1) = [p(b1|a1)].λ(b1) + [p(b2|a1)].λ(b2) = [(0.03)]x1e-24 + [(0.97)]x1e-24 = 1e-24 + λB(a2) = [p(b1|a2)].λ(b1) + [p(b2|a2)].λ(b2) = [(0.6)]x1e-24 + [(0.4)]x1e-24 = 1e-24 +λ message C --> A + λC(a1) = [p(c1|a1)].λ(c1) + [p(c2|a1)].λ(c2) = [(0.24)]x1e-24 + [(0.76)]x1e-24 = 1e-24 + λC(a2) = [p(c1|a2)].λ(c1) + [p(c2|a2)].λ(c2) = [(0.12)]x1e-24 + [(0.88)]x1e-24 = 1e-24 +λ message D --> B + λD(b1) = [p(d1|b1,c1).πD(c1) + p(d1|b1,c2).πD(c2)].λ(d1) + [p(d2|b1,c1).πD(c1) + p(d2|b1,c2).πD(c2)].λ(d2) = [(0.2x1.32e-25) + (0.7x8.68e-25)]x1 + [(0.8x1.32e-25) + (0.3x8.68e-25)]x1 = 1e-24 + λD(b2) = [p(d1|b2,c1).πD(c1) + p(d1|b2,c2).πD(c2)].λ(d1) + [p(d2|b2,c1).πD(c1) + p(d2|b2,c2).πD(c2)].λ(d2) = [(0.45x1.32e-25) + (0.22x8.68e-25)]x1 + [(0.55x1.32e-25) + (0.78x8.68e-25)]x1 = 1e-24 +λ message D --> C + λD(c1) = [p(d1|b1,c1).πD(b1) + p(d1|b2,c1).πD(b2)].λ(d1) + [p(d2|b1,c1).πD(b1) + p(d2|b2,c1).πD(b2)].λ(d2) = [(0.2x5.43e-25) + (0.45x4.57e-25)]x1 + [(0.8x5.43e-25) + (0.55x4.57e-25)]x1 = 1e-24 + λD(c2) = [p(d1|b1,c2).πD(b1) + p(d1|b2,c2).πD(b2)].λ(d1) + [p(d2|b1,c2).πD(b1) + p(d2|b2,c2).πD(b2)].λ(d2) = [(0.7x5.43e-25) + (0.22x4.57e-25)]x1 + [(0.3x5.43e-25) + (0.78x4.57e-25)]x1 = 1e-24 +π message A --> B + πB(a1) = π(a1).λC(a1) = 0.01 x 2e-23 = 2e-25 + πB(a2) = π(a2).λC(a2) = 0.09 x 2e-23 = 1.8e-24 +π message A --> C + πC(a1) = π(a1).λB(a1) = 0.01 x 2e-23 = 2e-25 + πC(a2) = π(a2).λB(a2) = 0.09 x 2e-23 = 1.8e-24 +π message B --> D + πD(b1) = π(b1) = 1.086e-24 = 1.086e-24 + πD(b2) = π(b2) = 9.14e-25 = 9.14e-25 +π message C --> D + πD(c1) = π(c1) = 2.64e-25 = 2.64e-25 + πD(c2) = π(c2) = 1.736e-24 = 1.736e-24 + +updating π & λ values +node A: + π(a1) = p(a1) = (0.01) = 0.01 + π(a2) = p(a2) = (0.09) = 0.09 + λ(a1) = λB(a1).λC(a1) = 1e-24 x 1e-24 = 1e-48 + λ(a2) = λB(a2).λC(a2) = 1e-24 x 1e-24 = 1e-48 + belief change = 1.387778781e-16 +node B: + π(b1) = p(b1|a1).πB(a1) + p(b1|a2).πB(a2) = (0.03 x 2e-25) + (0.6 x 1.8e-24) = 1.086e-24 + π(b2) = p(b2|a1).πB(a1) + p(b2|a2).πB(a2) = (0.97 x 2e-25) + (0.4 x 1.8e-24) = 9.14e-25 + λ(b1) = λD(b1) = 1e-24 = 1e-24 + λ(b2) = λD(b2) = 1e-24 = 1e-24 + belief change = 0 +node C: + π(c1) = p(c1|a1).πC(a1) + p(c1|a2).πC(a2) = (0.24 x 2e-25) + (0.12 x 1.8e-24) = 2.64e-25 + π(c2) = p(c2|a1).πC(a1) + p(c2|a2).πC(a2) = (0.76 x 2e-25) + (0.88 x 1.8e-24) = 1.736e-24 + λ(c1) = λD(c1) = 1e-24 = 1e-24 + λ(c2) = λD(c2) = 1e-24 = 1e-24 + belief change = 0 +node D: + π(d1) = p(d1|b1,c1).πD(b1).πD(c1) + p(d1|b1,c2).πD(b1).πD(c2) + p(d1|b2,c1).πD(b2).πD(c1) + p(d1|b2,c2).πD(b2).πD(c2) = (0.2 x 1.086e-24 x 2.64e-25) + (0.7 x 1.086e-24 x 1.736e-24) + (0.45 x 9.14e-25 x 2.64e-25) + (0.22 x 9.14e-25 x 1.736e-24) = 1.83470608e-48 + π(d2) = p(d2|b1,c1).πD(b1).πD(c1) + p(d2|b1,c2).πD(b1).πD(c2) + p(d2|b2,c1).πD(b2).πD(c1) + p(d2|b2,c2).πD(b2).πD(c2) = (0.8 x 1.086e-24 x 2.64e-25) + (0.3 x 1.086e-24 x 1.736e-24) + (0.55 x 9.14e-25 x 2.64e-25) + (0.78 x 9.14e-25 x 1.736e-24) = 2.16529392e-48 + λ(d1) = 1 + λ(d2) = 1 + belief change = 0 + + +******************************************************************************** +Iteration 96 +******************************************************************************** + +status of random variable `A': + domain π(A) λ(A) belief +---------------------------------------------------------------- + a1 0.01 1e-48 0.1 + a2 0.09 1e-48 0.9 + + domain πB(A) λB(A) +---------------------------------------------------------------- + a1 2e-25 1e-24 + a2 1.8e-24 1e-24 + + domain πC(A) λC(A) +---------------------------------------------------------------- + a1 2e-25 1e-24 + a2 1.8e-24 1e-24 + + +status of random variable `B': + domain π(B) λ(B) belief +---------------------------------------------------------------- + b1 1.086e-24 1e-24 0.543 + b2 9.14e-25 1e-24 0.457 + + domain πD(B) λD(B) +---------------------------------------------------------------- + b1 1.086e-24 1e-24 + b2 9.14e-25 1e-24 + + +status of random variable `C': + domain π(C) λ(C) belief +---------------------------------------------------------------- + c1 2.64e-25 1e-24 0.132 + c2 1.736e-24 1e-24 0.868 + + domain πD(C) λD(C) +---------------------------------------------------------------- + c1 2.64e-25 1e-24 + c2 1.736e-24 1e-24 + + +status of random variable `D': + domain π(D) λ(D) belief +---------------------------------------------------------------- + d1 1.83470608e-48 1 0.45867652 + d2 2.16529392e-48 1 0.54132348 + +λ message B --> A + λB(a1) = [p(b1|a1)].λ(b1) + [p(b2|a1)].λ(b2) = [(0.03)]x1e-24 + [(0.97)]x1e-24 = 1e-24 + λB(a2) = [p(b1|a2)].λ(b1) + [p(b2|a2)].λ(b2) = [(0.6)]x1e-24 + [(0.4)]x1e-24 = 1e-24 +λ message C --> A + λC(a1) = [p(c1|a1)].λ(c1) + [p(c2|a1)].λ(c2) = [(0.24)]x1e-24 + [(0.76)]x1e-24 = 1e-24 + λC(a2) = [p(c1|a2)].λ(c1) + [p(c2|a2)].λ(c2) = [(0.12)]x1e-24 + [(0.88)]x1e-24 = 1e-24 +λ message D --> B + λD(b1) = [p(d1|b1,c1).πD(c1) + p(d1|b1,c2).πD(c2)].λ(d1) + [p(d2|b1,c1).πD(c1) + p(d2|b1,c2).πD(c2)].λ(d2) = [(0.2x2.64e-25) + (0.7x1.736e-24)]x1 + [(0.8x2.64e-25) + (0.3x1.736e-24)]x1 = 2e-24 + λD(b2) = [p(d1|b2,c1).πD(c1) + p(d1|b2,c2).πD(c2)].λ(d1) + [p(d2|b2,c1).πD(c1) + p(d2|b2,c2).πD(c2)].λ(d2) = [(0.45x2.64e-25) + (0.22x1.736e-24)]x1 + [(0.55x2.64e-25) + (0.78x1.736e-24)]x1 = 2e-24 +λ message D --> C + λD(c1) = [p(d1|b1,c1).πD(b1) + p(d1|b2,c1).πD(b2)].λ(d1) + [p(d2|b1,c1).πD(b1) + p(d2|b2,c1).πD(b2)].λ(d2) = [(0.2x1.086e-24) + (0.45x9.14e-25)]x1 + [(0.8x1.086e-24) + (0.55x9.14e-25)]x1 = 2e-24 + λD(c2) = [p(d1|b1,c2).πD(b1) + p(d1|b2,c2).πD(b2)].λ(d1) + [p(d2|b1,c2).πD(b1) + p(d2|b2,c2).πD(b2)].λ(d2) = [(0.7x1.086e-24) + (0.22x9.14e-25)]x1 + [(0.3x1.086e-24) + (0.78x9.14e-25)]x1 = 2e-24 +π message A --> B + πB(a1) = π(a1).λC(a1) = 0.01 x 1e-24 = 1e-26 + πB(a2) = π(a2).λC(a2) = 0.09 x 1e-24 = 9e-26 +π message A --> C + πC(a1) = π(a1).λB(a1) = 0.01 x 1e-24 = 1e-26 + πC(a2) = π(a2).λB(a2) = 0.09 x 1e-24 = 9e-26 +π message B --> D + πD(b1) = π(b1) = 1.086e-24 = 1.086e-24 + πD(b2) = π(b2) = 9.14e-25 = 9.14e-25 +π message C --> D + πD(c1) = π(c1) = 2.64e-25 = 2.64e-25 + πD(c2) = π(c2) = 1.736e-24 = 1.736e-24 + +updating π & λ values +node A: + π(a1) = p(a1) = (0.01) = 0.01 + π(a2) = p(a2) = (0.09) = 0.09 + λ(a1) = λB(a1).λC(a1) = 1e-24 x 1e-24 = 1e-48 + λ(a2) = λB(a2).λC(a2) = 1e-24 x 1e-24 = 1e-48 + belief change = 0 +node B: + π(b1) = p(b1|a1).πB(a1) + p(b1|a2).πB(a2) = (0.03 x 1e-26) + (0.6 x 9e-26) = 5.43e-26 + π(b2) = p(b2|a1).πB(a1) + p(b2|a2).πB(a2) = (0.97 x 1e-26) + (0.4 x 9e-26) = 4.57e-26 + λ(b1) = λD(b1) = 2e-24 = 2e-24 + λ(b2) = λD(b2) = 2e-24 = 2e-24 + belief change = 1.110223025e-16 +node C: + π(c1) = p(c1|a1).πC(a1) + p(c1|a2).πC(a2) = (0.24 x 1e-26) + (0.12 x 9e-26) = 1.32e-26 + π(c2) = p(c2|a1).πC(a1) + p(c2|a2).πC(a2) = (0.76 x 1e-26) + (0.88 x 9e-26) = 8.68e-26 + λ(c1) = λD(c1) = 2e-24 = 2e-24 + λ(c2) = λD(c2) = 2e-24 = 2e-24 + belief change = 2.775557562e-17 +node D: + π(d1) = p(d1|b1,c1).πD(b1).πD(c1) + p(d1|b1,c2).πD(b1).πD(c2) + p(d1|b2,c1).πD(b2).πD(c1) + p(d1|b2,c2).πD(b2).πD(c2) = (0.2 x 1.086e-24 x 2.64e-25) + (0.7 x 1.086e-24 x 1.736e-24) + (0.45 x 9.14e-25 x 2.64e-25) + (0.22 x 9.14e-25 x 1.736e-24) = 1.83470608e-48 + π(d2) = p(d2|b1,c1).πD(b1).πD(c1) + p(d2|b1,c2).πD(b1).πD(c2) + p(d2|b2,c1).πD(b2).πD(c1) + p(d2|b2,c2).πD(b2).πD(c2) = (0.8 x 1.086e-24 x 2.64e-25) + (0.3 x 1.086e-24 x 1.736e-24) + (0.55 x 9.14e-25 x 2.64e-25) + (0.78 x 9.14e-25 x 1.736e-24) = 2.16529392e-48 + λ(d1) = 1 + λ(d2) = 1 + belief change = 0 + + +******************************************************************************** +Iteration 97 +******************************************************************************** + +status of random variable `A': + domain π(A) λ(A) belief +---------------------------------------------------------------- + a1 0.01 1e-48 0.1 + a2 0.09 1e-48 0.9 + + domain πB(A) λB(A) +---------------------------------------------------------------- + a1 1e-26 1e-24 + a2 9e-26 1e-24 + + domain πC(A) λC(A) +---------------------------------------------------------------- + a1 1e-26 1e-24 + a2 9e-26 1e-24 + + +status of random variable `B': + domain π(B) λ(B) belief +---------------------------------------------------------------- + b1 5.43e-26 2e-24 0.543 + b2 4.57e-26 2e-24 0.457 + + domain πD(B) λD(B) +---------------------------------------------------------------- + b1 1.086e-24 2e-24 + b2 9.14e-25 2e-24 + + +status of random variable `C': + domain π(C) λ(C) belief +---------------------------------------------------------------- + c1 1.32e-26 2e-24 0.132 + c2 8.68e-26 2e-24 0.868 + + domain πD(C) λD(C) +---------------------------------------------------------------- + c1 2.64e-25 2e-24 + c2 1.736e-24 2e-24 + + +status of random variable `D': + domain π(D) λ(D) belief +---------------------------------------------------------------- + d1 1.83470608e-48 1 0.45867652 + d2 2.16529392e-48 1 0.54132348 + +λ message B --> A + λB(a1) = [p(b1|a1)].λ(b1) + [p(b2|a1)].λ(b2) = [(0.03)]x2e-24 + [(0.97)]x2e-24 = 2e-24 + λB(a2) = [p(b1|a2)].λ(b1) + [p(b2|a2)].λ(b2) = [(0.6)]x2e-24 + [(0.4)]x2e-24 = 2e-24 +λ message C --> A + λC(a1) = [p(c1|a1)].λ(c1) + [p(c2|a1)].λ(c2) = [(0.24)]x2e-24 + [(0.76)]x2e-24 = 2e-24 + λC(a2) = [p(c1|a2)].λ(c1) + [p(c2|a2)].λ(c2) = [(0.12)]x2e-24 + [(0.88)]x2e-24 = 2e-24 +λ message D --> B + λD(b1) = [p(d1|b1,c1).πD(c1) + p(d1|b1,c2).πD(c2)].λ(d1) + [p(d2|b1,c1).πD(c1) + p(d2|b1,c2).πD(c2)].λ(d2) = [(0.2x2.64e-25) + (0.7x1.736e-24)]x1 + [(0.8x2.64e-25) + (0.3x1.736e-24)]x1 = 2e-24 + λD(b2) = [p(d1|b2,c1).πD(c1) + p(d1|b2,c2).πD(c2)].λ(d1) + [p(d2|b2,c1).πD(c1) + p(d2|b2,c2).πD(c2)].λ(d2) = [(0.45x2.64e-25) + (0.22x1.736e-24)]x1 + [(0.55x2.64e-25) + (0.78x1.736e-24)]x1 = 2e-24 +λ message D --> C + λD(c1) = [p(d1|b1,c1).πD(b1) + p(d1|b2,c1).πD(b2)].λ(d1) + [p(d2|b1,c1).πD(b1) + p(d2|b2,c1).πD(b2)].λ(d2) = [(0.2x1.086e-24) + (0.45x9.14e-25)]x1 + [(0.8x1.086e-24) + (0.55x9.14e-25)]x1 = 2e-24 + λD(c2) = [p(d1|b1,c2).πD(b1) + p(d1|b2,c2).πD(b2)].λ(d1) + [p(d2|b1,c2).πD(b1) + p(d2|b2,c2).πD(b2)].λ(d2) = [(0.7x1.086e-24) + (0.22x9.14e-25)]x1 + [(0.3x1.086e-24) + (0.78x9.14e-25)]x1 = 2e-24 +π message A --> B + πB(a1) = π(a1).λC(a1) = 0.01 x 1e-24 = 1e-26 + πB(a2) = π(a2).λC(a2) = 0.09 x 1e-24 = 9e-26 +π message A --> C + πC(a1) = π(a1).λB(a1) = 0.01 x 1e-24 = 1e-26 + πC(a2) = π(a2).λB(a2) = 0.09 x 1e-24 = 9e-26 +π message B --> D + πD(b1) = π(b1) = 5.43e-26 = 5.43e-26 + πD(b2) = π(b2) = 4.57e-26 = 4.57e-26 +π message C --> D + πD(c1) = π(c1) = 1.32e-26 = 1.32e-26 + πD(c2) = π(c2) = 8.68e-26 = 8.68e-26 + +updating π & λ values +node A: + π(a1) = p(a1) = (0.01) = 0.01 + π(a2) = p(a2) = (0.09) = 0.09 + λ(a1) = λB(a1).λC(a1) = 2e-24 x 2e-24 = 4e-48 + λ(a2) = λB(a2).λC(a2) = 2e-24 x 2e-24 = 4e-48 + belief change = 0 +node B: + π(b1) = p(b1|a1).πB(a1) + p(b1|a2).πB(a2) = (0.03 x 1e-26) + (0.6 x 9e-26) = 5.43e-26 + π(b2) = p(b2|a1).πB(a1) + p(b2|a2).πB(a2) = (0.97 x 1e-26) + (0.4 x 9e-26) = 4.57e-26 + λ(b1) = λD(b1) = 2e-24 = 2e-24 + λ(b2) = λD(b2) = 2e-24 = 2e-24 + belief change = 0 +node C: + π(c1) = p(c1|a1).πC(a1) + p(c1|a2).πC(a2) = (0.24 x 1e-26) + (0.12 x 9e-26) = 1.32e-26 + π(c2) = p(c2|a1).πC(a1) + p(c2|a2).πC(a2) = (0.76 x 1e-26) + (0.88 x 9e-26) = 8.68e-26 + λ(c1) = λD(c1) = 2e-24 = 2e-24 + λ(c2) = λD(c2) = 2e-24 = 2e-24 + belief change = 0 +node D: + π(d1) = p(d1|b1,c1).πD(b1).πD(c1) + p(d1|b1,c2).πD(b1).πD(c2) + p(d1|b2,c1).πD(b2).πD(c1) + p(d1|b2,c2).πD(b2).πD(c2) = (0.2 x 5.43e-26 x 1.32e-26) + (0.7 x 5.43e-26 x 8.68e-26) + (0.45 x 4.57e-26 x 1.32e-26) + (0.22 x 4.57e-26 x 8.68e-26) = 4.5867652e-51 + π(d2) = p(d2|b1,c1).πD(b1).πD(c1) + p(d2|b1,c2).πD(b1).πD(c2) + p(d2|b2,c1).πD(b2).πD(c1) + p(d2|b2,c2).πD(b2).πD(c2) = (0.8 x 5.43e-26 x 1.32e-26) + (0.3 x 5.43e-26 x 8.68e-26) + (0.55 x 4.57e-26 x 1.32e-26) + (0.78 x 4.57e-26 x 8.68e-26) = 5.4132348e-51 + λ(d1) = 1 + λ(d2) = 1 + belief change = 5.551115123e-17 + + +******************************************************************************** +Iteration 98 +******************************************************************************** + +status of random variable `A': + domain π(A) λ(A) belief +---------------------------------------------------------------- + a1 0.01 4e-48 0.1 + a2 0.09 4e-48 0.9 + + domain πB(A) λB(A) +---------------------------------------------------------------- + a1 1e-26 2e-24 + a2 9e-26 2e-24 + + domain πC(A) λC(A) +---------------------------------------------------------------- + a1 1e-26 2e-24 + a2 9e-26 2e-24 + + +status of random variable `B': + domain π(B) λ(B) belief +---------------------------------------------------------------- + b1 5.43e-26 2e-24 0.543 + b2 4.57e-26 2e-24 0.457 + + domain πD(B) λD(B) +---------------------------------------------------------------- + b1 5.43e-26 2e-24 + b2 4.57e-26 2e-24 + + +status of random variable `C': + domain π(C) λ(C) belief +---------------------------------------------------------------- + c1 1.32e-26 2e-24 0.132 + c2 8.68e-26 2e-24 0.868 + + domain πD(C) λD(C) +---------------------------------------------------------------- + c1 1.32e-26 2e-24 + c2 8.68e-26 2e-24 + + +status of random variable `D': + domain π(D) λ(D) belief +---------------------------------------------------------------- + d1 4.5867652e-51 1 0.45867652 + d2 5.4132348e-51 1 0.54132348 + +λ message B --> A + λB(a1) = [p(b1|a1)].λ(b1) + [p(b2|a1)].λ(b2) = [(0.03)]x2e-24 + [(0.97)]x2e-24 = 2e-24 + λB(a2) = [p(b1|a2)].λ(b1) + [p(b2|a2)].λ(b2) = [(0.6)]x2e-24 + [(0.4)]x2e-24 = 2e-24 +λ message C --> A + λC(a1) = [p(c1|a1)].λ(c1) + [p(c2|a1)].λ(c2) = [(0.24)]x2e-24 + [(0.76)]x2e-24 = 2e-24 + λC(a2) = [p(c1|a2)].λ(c1) + [p(c2|a2)].λ(c2) = [(0.12)]x2e-24 + [(0.88)]x2e-24 = 2e-24 +λ message D --> B + λD(b1) = [p(d1|b1,c1).πD(c1) + p(d1|b1,c2).πD(c2)].λ(d1) + [p(d2|b1,c1).πD(c1) + p(d2|b1,c2).πD(c2)].λ(d2) = [(0.2x1.32e-26) + (0.7x8.68e-26)]x1 + [(0.8x1.32e-26) + (0.3x8.68e-26)]x1 = 1e-25 + λD(b2) = [p(d1|b2,c1).πD(c1) + p(d1|b2,c2).πD(c2)].λ(d1) + [p(d2|b2,c1).πD(c1) + p(d2|b2,c2).πD(c2)].λ(d2) = [(0.45x1.32e-26) + (0.22x8.68e-26)]x1 + [(0.55x1.32e-26) + (0.78x8.68e-26)]x1 = 1e-25 +λ message D --> C + λD(c1) = [p(d1|b1,c1).πD(b1) + p(d1|b2,c1).πD(b2)].λ(d1) + [p(d2|b1,c1).πD(b1) + p(d2|b2,c1).πD(b2)].λ(d2) = [(0.2x5.43e-26) + (0.45x4.57e-26)]x1 + [(0.8x5.43e-26) + (0.55x4.57e-26)]x1 = 1e-25 + λD(c2) = [p(d1|b1,c2).πD(b1) + p(d1|b2,c2).πD(b2)].λ(d1) + [p(d2|b1,c2).πD(b1) + p(d2|b2,c2).πD(b2)].λ(d2) = [(0.7x5.43e-26) + (0.22x4.57e-26)]x1 + [(0.3x5.43e-26) + (0.78x4.57e-26)]x1 = 1e-25 +π message A --> B + πB(a1) = π(a1).λC(a1) = 0.01 x 2e-24 = 2e-26 + πB(a2) = π(a2).λC(a2) = 0.09 x 2e-24 = 1.8e-25 +π message A --> C + πC(a1) = π(a1).λB(a1) = 0.01 x 2e-24 = 2e-26 + πC(a2) = π(a2).λB(a2) = 0.09 x 2e-24 = 1.8e-25 +π message B --> D + πD(b1) = π(b1) = 5.43e-26 = 5.43e-26 + πD(b2) = π(b2) = 4.57e-26 = 4.57e-26 +π message C --> D + πD(c1) = π(c1) = 1.32e-26 = 1.32e-26 + πD(c2) = π(c2) = 8.68e-26 = 8.68e-26 + +updating π & λ values +node A: + π(a1) = p(a1) = (0.01) = 0.01 + π(a2) = p(a2) = (0.09) = 0.09 + λ(a1) = λB(a1).λC(a1) = 2e-24 x 2e-24 = 4e-48 + λ(a2) = λB(a2).λC(a2) = 2e-24 x 2e-24 = 4e-48 + belief change = 0 +node B: + π(b1) = p(b1|a1).πB(a1) + p(b1|a2).πB(a2) = (0.03 x 2e-26) + (0.6 x 1.8e-25) = 1.086e-25 + π(b2) = p(b2|a1).πB(a1) + p(b2|a2).πB(a2) = (0.97 x 2e-26) + (0.4 x 1.8e-25) = 9.14e-26 + λ(b1) = λD(b1) = 1e-25 = 1e-25 + λ(b2) = λD(b2) = 1e-25 = 1e-25 + belief change = 2.220446049e-16 +node C: + π(c1) = p(c1|a1).πC(a1) + p(c1|a2).πC(a2) = (0.24 x 2e-26) + (0.12 x 1.8e-25) = 2.64e-26 + π(c2) = p(c2|a1).πC(a1) + p(c2|a2).πC(a2) = (0.76 x 2e-26) + (0.88 x 1.8e-25) = 1.736e-25 + λ(c1) = λD(c1) = 1e-25 = 1e-25 + λ(c2) = λD(c2) = 1e-25 = 1e-25 + belief change = 2.775557562e-17 +node D: + π(d1) = p(d1|b1,c1).πD(b1).πD(c1) + p(d1|b1,c2).πD(b1).πD(c2) + p(d1|b2,c1).πD(b2).πD(c1) + p(d1|b2,c2).πD(b2).πD(c2) = (0.2 x 5.43e-26 x 1.32e-26) + (0.7 x 5.43e-26 x 8.68e-26) + (0.45 x 4.57e-26 x 1.32e-26) + (0.22 x 4.57e-26 x 8.68e-26) = 4.5867652e-51 + π(d2) = p(d2|b1,c1).πD(b1).πD(c1) + p(d2|b1,c2).πD(b1).πD(c2) + p(d2|b2,c1).πD(b2).πD(c1) + p(d2|b2,c2).πD(b2).πD(c2) = (0.8 x 5.43e-26 x 1.32e-26) + (0.3 x 5.43e-26 x 8.68e-26) + (0.55 x 4.57e-26 x 1.32e-26) + (0.78 x 4.57e-26 x 8.68e-26) = 5.4132348e-51 + λ(d1) = 1 + λ(d2) = 1 + belief change = 0 + + +******************************************************************************** +Iteration 99 +******************************************************************************** + +status of random variable `A': + domain π(A) λ(A) belief +---------------------------------------------------------------- + a1 0.01 4e-48 0.1 + a2 0.09 4e-48 0.9 + + domain πB(A) λB(A) +---------------------------------------------------------------- + a1 2e-26 2e-24 + a2 1.8e-25 2e-24 + + domain πC(A) λC(A) +---------------------------------------------------------------- + a1 2e-26 2e-24 + a2 1.8e-25 2e-24 + + +status of random variable `B': + domain π(B) λ(B) belief +---------------------------------------------------------------- + b1 1.086e-25 1e-25 0.543 + b2 9.14e-26 1e-25 0.457 + + domain πD(B) λD(B) +---------------------------------------------------------------- + b1 5.43e-26 1e-25 + b2 4.57e-26 1e-25 + + +status of random variable `C': + domain π(C) λ(C) belief +---------------------------------------------------------------- + c1 2.64e-26 1e-25 0.132 + c2 1.736e-25 1e-25 0.868 + + domain πD(C) λD(C) +---------------------------------------------------------------- + c1 1.32e-26 1e-25 + c2 8.68e-26 1e-25 + + +status of random variable `D': + domain π(D) λ(D) belief +---------------------------------------------------------------- + d1 4.5867652e-51 1 0.45867652 + d2 5.4132348e-51 1 0.54132348 + +λ message B --> A + λB(a1) = [p(b1|a1)].λ(b1) + [p(b2|a1)].λ(b2) = [(0.03)]x1e-25 + [(0.97)]x1e-25 = 1e-25 + λB(a2) = [p(b1|a2)].λ(b1) + [p(b2|a2)].λ(b2) = [(0.6)]x1e-25 + [(0.4)]x1e-25 = 1e-25 +λ message C --> A + λC(a1) = [p(c1|a1)].λ(c1) + [p(c2|a1)].λ(c2) = [(0.24)]x1e-25 + [(0.76)]x1e-25 = 1e-25 + λC(a2) = [p(c1|a2)].λ(c1) + [p(c2|a2)].λ(c2) = [(0.12)]x1e-25 + [(0.88)]x1e-25 = 1e-25 +λ message D --> B + λD(b1) = [p(d1|b1,c1).πD(c1) + p(d1|b1,c2).πD(c2)].λ(d1) + [p(d2|b1,c1).πD(c1) + p(d2|b1,c2).πD(c2)].λ(d2) = [(0.2x1.32e-26) + (0.7x8.68e-26)]x1 + [(0.8x1.32e-26) + (0.3x8.68e-26)]x1 = 1e-25 + λD(b2) = [p(d1|b2,c1).πD(c1) + p(d1|b2,c2).πD(c2)].λ(d1) + [p(d2|b2,c1).πD(c1) + p(d2|b2,c2).πD(c2)].λ(d2) = [(0.45x1.32e-26) + (0.22x8.68e-26)]x1 + [(0.55x1.32e-26) + (0.78x8.68e-26)]x1 = 1e-25 +λ message D --> C + λD(c1) = [p(d1|b1,c1).πD(b1) + p(d1|b2,c1).πD(b2)].λ(d1) + [p(d2|b1,c1).πD(b1) + p(d2|b2,c1).πD(b2)].λ(d2) = [(0.2x5.43e-26) + (0.45x4.57e-26)]x1 + [(0.8x5.43e-26) + (0.55x4.57e-26)]x1 = 1e-25 + λD(c2) = [p(d1|b1,c2).πD(b1) + p(d1|b2,c2).πD(b2)].λ(d1) + [p(d2|b1,c2).πD(b1) + p(d2|b2,c2).πD(b2)].λ(d2) = [(0.7x5.43e-26) + (0.22x4.57e-26)]x1 + [(0.3x5.43e-26) + (0.78x4.57e-26)]x1 = 1e-25 +π message A --> B + πB(a1) = π(a1).λC(a1) = 0.01 x 2e-24 = 2e-26 + πB(a2) = π(a2).λC(a2) = 0.09 x 2e-24 = 1.8e-25 +π message A --> C + πC(a1) = π(a1).λB(a1) = 0.01 x 2e-24 = 2e-26 + πC(a2) = π(a2).λB(a2) = 0.09 x 2e-24 = 1.8e-25 +π message B --> D + πD(b1) = π(b1) = 1.086e-25 = 1.086e-25 + πD(b2) = π(b2) = 9.14e-26 = 9.14e-26 +π message C --> D + πD(c1) = π(c1) = 2.64e-26 = 2.64e-26 + πD(c2) = π(c2) = 1.736e-25 = 1.736e-25 + +updating π & λ values +node A: + π(a1) = p(a1) = (0.01) = 0.01 + π(a2) = p(a2) = (0.09) = 0.09 + λ(a1) = λB(a1).λC(a1) = 1e-25 x 1e-25 = 1e-50 + λ(a2) = λB(a2).λC(a2) = 1e-25 x 1e-25 = 1e-50 + belief change = 1.387778781e-16 +node B: + π(b1) = p(b1|a1).πB(a1) + p(b1|a2).πB(a2) = (0.03 x 2e-26) + (0.6 x 1.8e-25) = 1.086e-25 + π(b2) = p(b2|a1).πB(a1) + p(b2|a2).πB(a2) = (0.97 x 2e-26) + (0.4 x 1.8e-25) = 9.14e-26 + λ(b1) = λD(b1) = 1e-25 = 1e-25 + λ(b2) = λD(b2) = 1e-25 = 1e-25 + belief change = 0 +node C: + π(c1) = p(c1|a1).πC(a1) + p(c1|a2).πC(a2) = (0.24 x 2e-26) + (0.12 x 1.8e-25) = 2.64e-26 + π(c2) = p(c2|a1).πC(a1) + p(c2|a2).πC(a2) = (0.76 x 2e-26) + (0.88 x 1.8e-25) = 1.736e-25 + λ(c1) = λD(c1) = 1e-25 = 1e-25 + λ(c2) = λD(c2) = 1e-25 = 1e-25 + belief change = 0 +node D: + π(d1) = p(d1|b1,c1).πD(b1).πD(c1) + p(d1|b1,c2).πD(b1).πD(c2) + p(d1|b2,c1).πD(b2).πD(c1) + p(d1|b2,c2).πD(b2).πD(c2) = (0.2 x 1.086e-25 x 2.64e-26) + (0.7 x 1.086e-25 x 1.736e-25) + (0.45 x 9.14e-26 x 2.64e-26) + (0.22 x 9.14e-26 x 1.736e-25) = 1.83470608e-50 + π(d2) = p(d2|b1,c1).πD(b1).πD(c1) + p(d2|b1,c2).πD(b1).πD(c2) + p(d2|b2,c1).πD(b2).πD(c1) + p(d2|b2,c2).πD(b2).πD(c2) = (0.8 x 1.086e-25 x 2.64e-26) + (0.3 x 1.086e-25 x 1.736e-25) + (0.55 x 9.14e-26 x 2.64e-26) + (0.78 x 9.14e-26 x 1.736e-25) = 2.16529392e-50 + λ(d1) = 1 + λ(d2) = 1 + belief change = 0 + +the maximum number of iterations was achieved, terminating... +beliefs for variable `A': + domain belief +---------------------------------- + a1 0.1 + a2 0.9 + +beliefs for variable `B': + domain belief +---------------------------------- + b1 0.543 + b2 0.457 + +beliefs for variable `C': + domain belief +---------------------------------- + c1 0.132 + c2 0.868 + +beliefs for variable `D': + domain belief +---------------------------------- + d1 0.45867652 + d2 0.54132348 + diff --git a/packages/CLPBN/clpbn/bp/simple-loop.seq.txt b/packages/CLPBN/clpbn/bp/simple-loop.seq.txt new file mode 100644 index 000000000..ff7fec8b6 --- /dev/null +++ b/packages/CLPBN/clpbn/bp/simple-loop.seq.txt @@ -0,0 +1,85 @@ +Variable: A +Domain: a1, a2 +Parents: +Childs: B, C +cpt +---------------- +a1 0.01 +a2 0.09 + +Variable: B +Domain: b1, b2 +Parents: A +Childs: D +cpt a1, a2, +---------------------------- +b1 0.03 0.6 +b2 0.97 0.4 + +Variable: C +Domain: c1, c2 +Parents: A +Childs: D +cpt a1, a2, +---------------------------- +c1 0.24 0.12 +c2 0.76 0.88 + +Variable: D +Domain: d1, d2 +Parents: B, C +Childs: +cpt b1,c1, b1,c2, b2,c1, b2,c2, +---------------------------------------------------- +d1 0.2 0.7 0.45 0.22 +d2 0.8 0.3 0.55 0.78 + +initializing solver + schedule = sequential + maxIter = 100 + accuracy = 0 +sending pi message from `A' to `B' + πB(a1) = π(a1).λC(a1) = 0.01 x 1 = 0.01 + πB(a2) = π(a2).λC(a2) = 0.09 x 1 = 0.09 + π(b1) = p(b1|a1).πB(a1) + p(b1|a2).πB(a2) = (0.03 x 0.01) + (0.6 x 0.09) = 0.0543 + π(b2) = p(b2|a1).πB(a1) + p(b2|a2).πB(a2) = (0.97 x 0.01) + (0.4 x 0.09) = 0.0457 +sending pi message from `B' to `D' + πD(b1) = π(b1) = 0.0543 = 0.0543 + πD(b2) = π(b2) = 0.0457 = 0.0457 + π(d1) = p(d1|b1,c1).πD(b1).πD(c1) + p(d1|b1,c2).πD(b1).πD(c2) + p(d1|b2,c1).πD(b2).πD(c1) + p(d1|b2,c2).πD(b2).πD(c2) = (0.2 x 0.0543 x 1) + (0.7 x 0.0543 x 1) + (0.45 x 0.0457 x 1) + (0.22 x 0.0457 x 1) = 0.079489 + π(d2) = p(d2|b1,c1).πD(b1).πD(c1) + p(d2|b1,c2).πD(b1).πD(c2) + p(d2|b2,c1).πD(b2).πD(c1) + p(d2|b2,c2).πD(b2).πD(c2) = (0.8 x 0.0543 x 1) + (0.3 x 0.0543 x 1) + (0.55 x 0.0457 x 1) + (0.78 x 0.0457 x 1) = 0.120511 +sending pi message from `A' to `C' + πC(a1) = π(a1).λB(a1) = 0.01 x 1 = 0.01 + πC(a2) = π(a2).λB(a2) = 0.09 x 1 = 0.09 + π(c1) = p(c1|a1).πC(a1) + p(c1|a2).πC(a2) = (0.24 x 0.01) + (0.12 x 0.09) = 0.0132 + π(c2) = p(c2|a1).πC(a1) + p(c2|a2).πC(a2) = (0.76 x 0.01) + (0.88 x 0.09) = 0.0868 +sending pi message from `C' to `D' + πD(c1) = π(c1) = 0.0132 = 0.0132 + πD(c2) = π(c2) = 0.0868 = 0.0868 + π(d1) = p(d1|b1,c1).πD(b1).πD(c1) + p(d1|b1,c2).πD(b1).πD(c2) + p(d1|b2,c1).πD(b2).πD(c1) + p(d1|b2,c2).πD(b2).πD(c2) = (0.2 x 0.0543 x 0.0132) + (0.7 x 0.0543 x 0.0868) + (0.45 x 0.0457 x 0.0132) + (0.22 x 0.0457 x 0.0868) = 0.00458677 + π(d2) = p(d2|b1,c1).πD(b1).πD(c1) + p(d2|b1,c2).πD(b1).πD(c2) + p(d2|b2,c1).πD(b2).πD(c1) + p(d2|b2,c2).πD(b2).πD(c2) = (0.8 x 0.0543 x 0.0132) + (0.3 x 0.0543 x 0.0868) + (0.55 x 0.0457 x 0.0132) + (0.78 x 0.0457 x 0.0868) = 0.00541323 + +beliefs for variable `A': + domain belief +---------------------------------- + a1 0.1 + a2 0.9 + +beliefs for variable `B': + domain belief +---------------------------------- + b1 0.543 + b2 0.457 + +beliefs for variable `C': + domain belief +---------------------------------- + c1 0.132 + c2 0.868 + +beliefs for variable `D': + domain belief +---------------------------------- + d1 0.45867652 + d2 0.54132348 + diff --git a/packages/CLPBN/clpbn/bp/xmlParser/AFPL-license.txt b/packages/CLPBN/clpbn/bp/xmlParser/AFPL-license.txt new file mode 100644 index 000000000..0a0cb39e1 --- /dev/null +++ b/packages/CLPBN/clpbn/bp/xmlParser/AFPL-license.txt @@ -0,0 +1,241 @@ +Aladdin Free Public License +(Version 8, November 18, 1999) + +Copyright (C) 1994, 1995, 1997, 1998, 1999 Aladdin Enterprises, +Menlo Park, California, U.S.A. All rights reserved. + + *NOTE:* This License is not the same as any of the GNU Licenses + published by the Free + Software Foundation . Its terms are + substantially different from those of the GNU Licenses. If you are + familiar with the GNU Licenses, please read this license with extra + care. + +Aladdin Enterprises hereby grants to anyone the permission to apply this +License to their own work, as long as the entire License (including the +above notices and this paragraph) is copied with no changes, additions, +or deletions except for changing the first paragraph of Section 0 to +include a suitable description of the work to which the license is being +applied and of the person or entity that holds the copyright in the +work, and, if the License is being applied to a work created in a +country other than the United States, replacing the first paragraph of +Section 6 with an appropriate reference to the laws of the appropriate +country. + + + 0. Subject Matter + +This License applies to the computer program known as "XMLParser library". +The "Program", below, refers to such program. The Program +is a copyrighted work whose copyright is held by Frank Vanden Berghen +(the "Licensor"). + +A "work based on the Program" means either the Program or any derivative +work of the Program, as defined in the United States Copyright Act of +1976, such as a translation or a modification. + +* BY MODIFYING OR DISTRIBUTING THE PROGRAM (OR ANY WORK BASED ON THE +PROGRAM), YOU INDICATE YOUR ACCEPTANCE OF THIS LICENSE TO DO SO, AND ALL +ITS TERMS AND CONDITIONS FOR COPYING, DISTRIBUTING OR MODIFYING THE +PROGRAM OR WORKS BASED ON IT. NOTHING OTHER THAN THIS LICENSE GRANTS YOU +PERMISSION TO MODIFY OR DISTRIBUTE THE PROGRAM OR ITS DERIVATIVE WORKS. +THESE ACTIONS ARE PROHIBITED BY LAW. IF YOU DO NOT ACCEPT THESE TERMS +AND CONDITIONS, DO NOT MODIFY OR DISTRIBUTE THE PROGRAM. * + + + 1. Licenses. + +Licensor hereby grants you the following rights, provided that you +comply with all of the restrictions set forth in this License and +provided, further, that you distribute an unmodified copy of this +License with the Program: + +(a) + You may copy and distribute literal (i.e., verbatim) copies of the + Program's source code as you receive it throughout the world, in any + medium. +(b) + You may modify the Program, create works based on the Program and + distribute copies of such throughout the world, in any medium. + + + 2. Restrictions. + +This license is subject to the following restrictions: + +(a) + Distribution of the Program or any work based on the Program by a + commercial organization to any third party is prohibited if any + payment is made in connection with such distribution, whether + directly (as in payment for a copy of the Program) or indirectly (as + in payment for some service related to the Program, or payment for + some product or service that includes a copy of the Program "without + charge"; these are only examples, and not an exhaustive enumeration + of prohibited activities). The following methods of distribution + involving payment shall not in and of themselves be a violation of + this restriction: + + (i) + Posting the Program on a public access information storage and + retrieval service for which a fee is received for retrieving + information (such as an on-line service), provided that the fee + is not content-dependent (i.e., the fee would be the same for + retrieving the same volume of information consisting of random + data) and that access to the service and to the Program is + available independent of any other product or service. An + example of a service that does not fall under this section is an + on-line service that is operated by a company and that is only + available to customers of that company. (This is not an + exhaustive enumeration.) + (ii) + Distributing the Program on removable computer-readable media, + provided that the files containing the Program are reproduced + entirely and verbatim on such media, that all information on + such media be redistributable for non-commercial purposes + without charge, and that such media are distributed by + themselves (except for accompanying documentation) independent + of any other product or service. Examples of such media include + CD-ROM, magnetic tape, and optical storage media. (This is not + intended to be an exhaustive list.) An example of a distribution + that does not fall under this section is a CD-ROM included in a + book or magazine. (This is not an exhaustive enumeration.) + +(b) + Activities other than copying, distribution and modification of the + Program are not subject to this License and they are outside its + scope. Functional use (running) of the Program is not restricted, + and any output produced through the use of the Program is subject to + this license only if its contents constitute a work based on the + Program (independent of having been made by running the Program). +(c) + You must meet all of the following conditions with respect to any + work that you distribute or publish that in whole or in part + contains or is derived from the Program or any part thereof ("the + Work"): + + (i) + If you have modified the Program, you must cause the Work to + carry prominent notices stating that you have modified the + Program's files and the date of any change. In each source file + that you have modified, you must include a prominent notice that + you have modified the file, including your name, your e-mail + address (if any), and the date and purpose of the change; + (ii) + You must cause the Work to be licensed as a whole and at no + charge to all third parties under the terms of this License; + (iii) + If the Work normally reads commands interactively when run, you + must cause it, at each time the Work commences operation, to + print or display an announcement including an appropriate + copyright notice and a notice that there is no warranty (or + else, saying that you provide a warranty). Such notice must also + state that users may redistribute the Work only under the + conditions of this License and tell the user how to view the + copy of this License included with the Work. (Exceptions: if the + Program is interactive but normally prints or displays such an + announcement only at the request of a user, such as in an "About + box", the Work is required to print or display the notice only + under the same circumstances; if the Program itself is + interactive but does not normally print such an announcement, + the Work is not required to print an announcement.); + (iv) + You must accompany the Work with the complete corresponding + machine-readable source code, delivered on a medium customarily + used for software interchange. The source code for a work means + the preferred form of the work for making modifications to it. + For an executable work, complete source code means all the + source code for all modules it contains, plus any associated + interface definition files, plus the scripts used to control + compilation and installation of the executable code. If you + distribute with the Work any component that is normally + distributed (in either source or binary form) with the major + components (compiler, kernel, and so on) of the operating system + on which the executable runs, you must also distribute the + source code of that component if you have it and are allowed to + do so; + (v) + If you distribute any written or printed material at all with + the Work, such material must include either a written copy of + this License, or a prominent written indication that the Work is + covered by this License and written instructions for printing + and/or displaying the copy of the License on the distribution + medium; + (vi) + You may not impose any further restrictions on the recipient's + exercise of the rights granted herein. + +If distribution of executable or object code is made by offering the +equivalent ability to copy from a designated place, then offering +equivalent ability to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source code along with the object code. + + + 3. Reservation of Rights. + +No rights are granted to the Program except as expressly set forth +herein. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt otherwise +to copy, modify, sublicense or distribute the Program is void, and will +automatically terminate your rights under this License. However, parties +who have received copies, or rights, from you under this License will +not have their licenses terminated so long as such parties remain in +full compliance. + + + 4. Other Restrictions. + +If the distribution and/or use of the Program is restricted in certain +countries for any reason, Licensor may add an explicit geographical +distribution limitation excluding those countries, so that distribution +is permitted only in or among countries not thus excluded. In such case, +this License incorporates the limitation as if written in the body of +this License. + + + 5. Limitations. + +* THE PROGRAM IS PROVIDED TO YOU "AS IS," WITHOUT WARRANTY. THERE IS NO +WARRANTY FOR THE PROGRAM, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT +NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. THE +ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH +YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL +NECESSARY SERVICING, REPAIR OR CORRECTION. * + +* IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL LICENSOR, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE +PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS +OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR +THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. * + + + 6. General. + +This License is governed by the laws of Belgium., excluding choice of +law rules. + +If any part of this License is found to be in conflict with the law, +that part shall be interpreted in its broadest meaning consistent with +the law, and no other parts of the License shall be affected. + +For United States Government users, the Program is provided with +*RESTRICTED RIGHTS*. If you are a unit or agency of the United States +Government or are acquiring the Program for any such unit or agency, the +following apply: + + If the unit or agency is the Department of Defense ("DOD"), the + Program and its documentation are classified as "commercial computer + software" and "commercial computer software documentation" + respectively and, pursuant to DFAR Section 227.7202, the Government + is acquiring the Program and its documentation in accordance with + the terms of this License. If the unit or agency is other than DOD, + the Program and its documentation are classified as "commercial + computer software" and "commercial computer software documentation" + respectively and, pursuant to FAR Section 12.212, the Government is + acquiring the Program and its documentation in accordance with the + terms of this License. diff --git a/packages/CLPBN/clpbn/bp/xmlParser/xmlParser.cpp b/packages/CLPBN/clpbn/bp/xmlParser/xmlParser.cpp new file mode 100644 index 000000000..aa5d670e1 --- /dev/null +++ b/packages/CLPBN/clpbn/bp/xmlParser/xmlParser.cpp @@ -0,0 +1,2936 @@ +/** + **************************************************************************** + *

XML.c - implementation file for basic XML parser written in ANSI C++ + * for portability. It works by using recursion and a node tree for breaking + * down the elements of an XML document.

+ * + * @version V2.42 + * @author Frank Vanden Berghen + * + * NOTE: + * + * If you add "#define STRICT_PARSING", on the first line of this file + * the parser will see the following XML-stream: + * some textother text + * as an error. Otherwise, this tring will be equivalent to: + * some textother text + * + * NOTE: + * + * If you add "#define APPROXIMATE_PARSING" on the first line of this file + * the parser will see the following XML-stream: + * + * + * + * as equivalent to the following XML-stream: + * + * + * + * This can be useful for badly-formed XML-streams but prevent the use + * of the following XML-stream (problem is: tags at contiguous levels + * have the same names): + * + * + * + * + * + * + * NOTE: + * + * If you add "#define _XMLPARSER_NO_MESSAGEBOX_" on the first line of this file + * the "openFileHelper" function will always display error messages inside the + * console instead of inside a message-box-window. Message-box-windows are + * available on windows 9x/NT/2000/XP/Vista only. + * + * Copyright (c) 2002, Business-Insight + * Business-Insight + * All rights reserved. + * See the file "AFPL-license.txt" about the licensing terms + * + **************************************************************************** + */ +#ifndef _CRT_SECURE_NO_DEPRECATE +#define _CRT_SECURE_NO_DEPRECATE +#endif +#include "xmlParser.h" +#ifdef _XMLWINDOWS +//#ifdef _DEBUG +//#define _CRTDBG_MAP_ALLOC +//#include +//#endif +#define WIN32_LEAN_AND_MEAN +#include // to have IsTextUnicode, MultiByteToWideChar, WideCharToMultiByte to handle unicode files + // to have "MessageBoxA" to display error messages for openFilHelper +#endif + +#include +#include +#include +#include +#include + +XMLCSTR XMLNode::getVersion() { return _CXML("v2.42"); } +void freeXMLString(XMLSTR t){if(t)free(t);} + +static XMLNode::XMLCharEncoding characterEncoding=XMLNode::char_encoding_UTF8; +static char guessWideCharChars=1, dropWhiteSpace=1, removeCommentsInMiddleOfText=1; + +inline int mmin( const int t1, const int t2 ) { return t1 < t2 ? t1 : t2; } + +// You can modify the initialization of the variable "XMLClearTags" below +// to change the clearTags that are currently recognized by the library. +// The number on the second columns is the length of the string inside the +// first column. +// The "") }, + { _CXML("") }, + { _CXML("") }, + { _CXML("
")    ,5,  _CXML("
") }, +// { _CXML("")}, + { NULL ,0, NULL } +}; + +// You can modify the initialization of the variable "XMLEntities" below +// to change the character entities that are currently recognized by the library. +// The number on the second columns is the length of the string inside the +// first column. Additionally, the syntaxes " " and " " are recognized. +typedef struct { XMLCSTR s; int l; XMLCHAR c;} XMLCharacterEntity; +static XMLCharacterEntity XMLEntities[] = +{ + { _CXML("&" ), 5, _CXML('&' )}, + { _CXML("<" ), 4, _CXML('<' )}, + { _CXML(">" ), 4, _CXML('>' )}, + { _CXML("""), 6, _CXML('\"')}, + { _CXML("'"), 6, _CXML('\'')}, + { NULL , 0, '\0' } +}; + +// When rendering the XMLNode to a string (using the "createXMLString" function), +// you can ask for a beautiful formatting. This formatting is using the +// following indentation character: +#define INDENTCHAR _CXML('\t') + +// The following function parses the XML errors into a user friendly string. +// You can edit this to change the output language of the library to something else. +XMLCSTR XMLNode::getError(XMLError xerror) +{ + switch (xerror) + { + case eXMLErrorNone: return _CXML("No error"); + case eXMLErrorMissingEndTag: return _CXML("Warning: Unmatched end tag"); + case eXMLErrorNoXMLTagFound: return _CXML("Warning: No XML tag found"); + case eXMLErrorEmpty: return _CXML("Error: No XML data"); + case eXMLErrorMissingTagName: return _CXML("Error: Missing start tag name"); + case eXMLErrorMissingEndTagName: return _CXML("Error: Missing end tag name"); + case eXMLErrorUnmatchedEndTag: return _CXML("Error: Unmatched end tag"); + case eXMLErrorUnmatchedEndClearTag: return _CXML("Error: Unmatched clear tag end"); + case eXMLErrorUnexpectedToken: return _CXML("Error: Unexpected token found"); + case eXMLErrorNoElements: return _CXML("Error: No elements found"); + case eXMLErrorFileNotFound: return _CXML("Error: File not found"); + case eXMLErrorFirstTagNotFound: return _CXML("Error: First Tag not found"); + case eXMLErrorUnknownCharacterEntity:return _CXML("Error: Unknown character entity"); + case eXMLErrorCharacterCodeAbove255: return _CXML("Error: Character code above 255 is forbidden in MultiByte char mode."); + case eXMLErrorCharConversionError: return _CXML("Error: unable to convert between WideChar and MultiByte chars"); + case eXMLErrorCannotOpenWriteFile: return _CXML("Error: unable to open file for writing"); + case eXMLErrorCannotWriteFile: return _CXML("Error: cannot write into file"); + + case eXMLErrorBase64DataSizeIsNotMultipleOf4: return _CXML("Warning: Base64-string length is not a multiple of 4"); + case eXMLErrorBase64DecodeTruncatedData: return _CXML("Warning: Base64-string is truncated"); + case eXMLErrorBase64DecodeIllegalCharacter: return _CXML("Error: Base64-string contains an illegal character"); + case eXMLErrorBase64DecodeBufferTooSmall: return _CXML("Error: Base64 decode output buffer is too small"); + }; + return _CXML("Unknown"); +} + +///////////////////////////////////////////////////////////////////////// +// Here start the abstraction layer to be OS-independent // +///////////////////////////////////////////////////////////////////////// + +// Here is an abstraction layer to access some common string manipulation functions. +// The abstraction layer is currently working for gcc, Microsoft Visual Studio 6.0, +// Microsoft Visual Studio .NET, CC (sun compiler) and Borland C++. +// If you plan to "port" the library to a new system/compiler, all you have to do is +// to edit the following lines. +#ifdef XML_NO_WIDE_CHAR +char myIsTextWideChar(const void *b, int len) { return FALSE; } +#else + #if defined (UNDER_CE) || !defined(_XMLWINDOWS) + char myIsTextWideChar(const void *b, int len) // inspired by the Wine API: RtlIsTextUnicode + { +#ifdef sun + // for SPARC processors: wchar_t* buffers must always be alligned, otherwise it's a char* buffer. + if ((((unsigned long)b)%sizeof(wchar_t))!=0) return FALSE; +#endif + const wchar_t *s=(const wchar_t*)b; + + // buffer too small: + if (len<(int)sizeof(wchar_t)) return FALSE; + + // odd length test + if (len&1) return FALSE; + + /* only checks the first 256 characters */ + len=mmin(256,len/sizeof(wchar_t)); + + // Check for the special byte order: + if (*((unsigned short*)s) == 0xFFFE) return TRUE; // IS_TEXT_UNICODE_REVERSE_SIGNATURE; + if (*((unsigned short*)s) == 0xFEFF) return TRUE; // IS_TEXT_UNICODE_SIGNATURE + + // checks for ASCII characters in the UNICODE stream + int i,stats=0; + for (i=0; ilen/2) return TRUE; + + // Check for UNICODE NULL chars + for (i=0; i + static inline int xstrnicmp(XMLCSTR c1, XMLCSTR c2, int l) { return wsncasecmp(c1,c2,l);} + static inline int xstrncmp(XMLCSTR c1, XMLCSTR c2, int l) { return wsncmp(c1,c2,l);} + static inline int xstricmp(XMLCSTR c1, XMLCSTR c2) { return wscasecmp(c1,c2); } + #else + static inline int xstrncmp(XMLCSTR c1, XMLCSTR c2, int l) { return wcsncmp(c1,c2,l);} + #ifdef __linux__ + // for gcc/linux + static inline int xstrnicmp(XMLCSTR c1, XMLCSTR c2, int l) { return wcsncasecmp(c1,c2,l);} + static inline int xstricmp(XMLCSTR c1, XMLCSTR c2) { return wcscasecmp(c1,c2); } + #else + #include + // for gcc/non-linux (MacOS X 10.3, FreeBSD 6.0, NetBSD 3.0, OpenBSD 3.8, AIX 4.3.2, HP-UX 11, IRIX 6.5, OSF/1 5.1, Cygwin, mingw) + static inline int xstricmp(XMLCSTR c1, XMLCSTR c2) + { + wchar_t left,right; + do + { + left=towlower(*c1++); right=towlower(*c2++); + } while (left&&(left==right)); + return (int)left-(int)right; + } + static inline int xstrnicmp(XMLCSTR c1, XMLCSTR c2, int l) + { + wchar_t left,right; + while(l--) + { + left=towlower(*c1++); right=towlower(*c2++); + if ((!left)||(left!=right)) return (int)left-(int)right; + } + return 0; + } + #endif + #endif + static inline XMLSTR xstrstr(XMLCSTR c1, XMLCSTR c2) { return (XMLSTR)wcsstr(c1,c2); } + static inline XMLSTR xstrcpy(XMLSTR c1, XMLCSTR c2) { return (XMLSTR)wcscpy(c1,c2); } + static inline FILE *xfopen(XMLCSTR filename,XMLCSTR mode) + { + char *filenameAscii=myWideCharToMultiByte(filename); + FILE *f; + if (mode[0]==_CXML('r')) f=fopen(filenameAscii,"rb"); + else f=fopen(filenameAscii,"wb"); + free(filenameAscii); + return f; + } + #else + static inline FILE *xfopen(XMLCSTR filename,XMLCSTR mode) { return fopen(filename,mode); } + static inline int xstrlen(XMLCSTR c) { return strlen(c); } + static inline int xstrnicmp(XMLCSTR c1, XMLCSTR c2, int l) { return strncasecmp(c1,c2,l);} + static inline int xstrncmp(XMLCSTR c1, XMLCSTR c2, int l) { return strncmp(c1,c2,l);} + static inline int xstricmp(XMLCSTR c1, XMLCSTR c2) { return strcasecmp(c1,c2); } + static inline XMLSTR xstrstr(XMLCSTR c1, XMLCSTR c2) { return (XMLSTR)strstr(c1,c2); } + static inline XMLSTR xstrcpy(XMLSTR c1, XMLCSTR c2) { return (XMLSTR)strcpy(c1,c2); } + #endif + static inline int _strnicmp(const char *c1,const char *c2, int l) { return strncasecmp(c1,c2,l);} +#endif + + +/////////////////////////////////////////////////////////////////////////////// +// the "xmltoc,xmltob,xmltoi,xmltol,xmltof,xmltoa" functions // +/////////////////////////////////////////////////////////////////////////////// +// These 6 functions are not used inside the XMLparser. +// There are only here as "convenience" functions for the user. +// If you don't need them, you can delete them without any trouble. +#ifdef _XMLWIDECHAR + #ifdef _XMLWINDOWS + // for Microsoft Visual Studio 6.0 and Microsoft Visual Studio .NET and Borland C++ Builder 6.0 + char xmltob(XMLCSTR t,char v){ if (t&&(*t)) return (char)_wtoi(t); return v; } + int xmltoi(XMLCSTR t,int v){ if (t&&(*t)) return _wtoi(t); return v; } + long xmltol(XMLCSTR t,long v){ if (t&&(*t)) return _wtol(t); return v; } + double xmltof(XMLCSTR t,double v){ if (t&&(*t)) swscanf(t, L"%lf", &v); /*v=_wtof(t);*/ return v; } + #else + #ifdef sun + // for CC + #include + char xmltob(XMLCSTR t,char v){ if (t) return (char)wstol(t,NULL,10); return v; } + int xmltoi(XMLCSTR t,int v){ if (t) return (int)wstol(t,NULL,10); return v; } + long xmltol(XMLCSTR t,long v){ if (t) return wstol(t,NULL,10); return v; } + #else + // for gcc + char xmltob(XMLCSTR t,char v){ if (t) return (char)wcstol(t,NULL,10); return v; } + int xmltoi(XMLCSTR t,int v){ if (t) return (int)wcstol(t,NULL,10); return v; } + long xmltol(XMLCSTR t,long v){ if (t) return wcstol(t,NULL,10); return v; } + #endif + double xmltof(XMLCSTR t,double v){ if (t&&(*t)) swscanf(t, L"%lf", &v); /*v=_wtof(t);*/ return v; } + #endif +#else + char xmltob(XMLCSTR t,char v){ if (t&&(*t)) return (char)atoi(t); return v; } + int xmltoi(XMLCSTR t,int v){ if (t&&(*t)) return atoi(t); return v; } + long xmltol(XMLCSTR t,long v){ if (t&&(*t)) return atol(t); return v; } + double xmltof(XMLCSTR t,double v){ if (t&&(*t)) return atof(t); return v; } +#endif +XMLCSTR xmltoa(XMLCSTR t, XMLCSTR v){ if (t) return t; return v; } +XMLCHAR xmltoc(XMLCSTR t,const XMLCHAR v){ if (t&&(*t)) return *t; return v; } + +///////////////////////////////////////////////////////////////////////// +// the "openFileHelper" function // +///////////////////////////////////////////////////////////////////////// + +// Since each application has its own way to report and deal with errors, you should modify & rewrite +// the following "openFileHelper" function to get an "error reporting mechanism" tailored to your needs. +XMLNode XMLNode::openFileHelper(XMLCSTR filename, XMLCSTR tag) +{ + // guess the value of the global parameter "characterEncoding" + // (the guess is based on the first 200 bytes of the file). + FILE *f=xfopen(filename,_CXML("rb")); + if (f) + { + char bb[205]; + int l=(int)fread(bb,1,200,f); + setGlobalOptions(guessCharEncoding(bb,l),guessWideCharChars,dropWhiteSpace,removeCommentsInMiddleOfText); + fclose(f); + } + + // parse the file + XMLResults pResults; + XMLNode xnode=XMLNode::parseFile(filename,tag,&pResults); + + // display error message (if any) + if (pResults.error != eXMLErrorNone) + { + // create message + char message[2000],*s1=(char*)"",*s3=(char*)""; XMLCSTR s2=_CXML(""); + if (pResults.error==eXMLErrorFirstTagNotFound) { s1=(char*)"First Tag should be '"; s2=tag; s3=(char*)"'.\n"; } + snprintf(message,2000, +#ifdef _XMLWIDECHAR + "XML Parsing error inside file '%S'.\n%S\nAt line %i, column %i.\n%s%S%s" +#else + "XML Parsing error inside file '%s'.\n%s\nAt line %i, column %i.\n%s%s%s" +#endif + ,filename,XMLNode::getError(pResults.error),pResults.nLine,pResults.nColumn,s1,s2,s3); + + // display message +#if defined(_XMLWINDOWS) && !defined(UNDER_CE) && !defined(_XMLPARSER_NO_MESSAGEBOX_) + MessageBoxA(NULL,message,"XML Parsing error",MB_OK|MB_ICONERROR|MB_TOPMOST); +#else + printf("%s",message); +#endif + exit(255); + } + return xnode; +} + +///////////////////////////////////////////////////////////////////////// +// Here start the core implementation of the XMLParser library // +///////////////////////////////////////////////////////////////////////// + +// You should normally not change anything below this point. + +#ifndef _XMLWIDECHAR +// If "characterEncoding=ascii" then we assume that all characters have the same length of 1 byte. +// If "characterEncoding=UTF8" then the characters have different lengths (from 1 byte to 4 bytes). +// If "characterEncoding=ShiftJIS" then the characters have different lengths (from 1 byte to 2 bytes). +// This table is used as lookup-table to know the length of a character (in byte) based on the +// content of the first byte of the character. +// (note: if you modify this, you must always have XML_utf8ByteTable[0]=0 ). +static const char XML_utf8ByteTable[256] = +{ + // 0 1 2 3 4 5 6 7 8 9 a b c d e f + 0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,// 0x00 + 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,// 0x10 + 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,// 0x20 + 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,// 0x30 + 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,// 0x40 + 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,// 0x50 + 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,// 0x60 + 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,// 0x70 End of ASCII range + 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,// 0x80 0x80 to 0xc1 invalid + 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,// 0x90 + 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,// 0xa0 + 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,// 0xb0 + 1,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,// 0xc0 0xc2 to 0xdf 2 byte + 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,// 0xd0 + 3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,// 0xe0 0xe0 to 0xef 3 byte + 4,4,4,4,4,1,1,1,1,1,1,1,1,1,1,1 // 0xf0 0xf0 to 0xf4 4 byte, 0xf5 and higher invalid +}; +static const char XML_legacyByteTable[256] = +{ + 0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, + 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, + 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, + 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, + 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, + 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1 +}; +static const char XML_sjisByteTable[256] = +{ + // 0 1 2 3 4 5 6 7 8 9 a b c d e f + 0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,// 0x00 + 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,// 0x10 + 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,// 0x20 + 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,// 0x30 + 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,// 0x40 + 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,// 0x50 + 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,// 0x60 + 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,// 0x70 + 1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,// 0x80 0x81 to 0x9F 2 bytes + 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,// 0x90 + 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,// 0xa0 + 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,// 0xb0 + 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,// 0xc0 + 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,// 0xd0 + 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,// 0xe0 0xe0 to 0xef 2 bytes + 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1 // 0xf0 +}; +static const char XML_gb2312ByteTable[256] = +{ +// 0 1 2 3 4 5 6 7 8 9 a b c d e f + 0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,// 0x00 + 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,// 0x10 + 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,// 0x20 + 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,// 0x30 + 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,// 0x40 + 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,// 0x50 + 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,// 0x60 + 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,// 0x70 + 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,// 0x80 + 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,// 0x90 + 1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,// 0xa0 0xa1 to 0xf7 2 bytes + 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,// 0xb0 + 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,// 0xc0 + 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,// 0xd0 + 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,// 0xe0 + 2,2,2,2,2,2,2,2,1,1,1,1,1,1,1,1 // 0xf0 +}; +static const char XML_gbk_big5_ByteTable[256] = +{ + // 0 1 2 3 4 5 6 7 8 9 a b c d e f + 0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,// 0x00 + 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,// 0x10 + 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,// 0x20 + 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,// 0x30 + 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,// 0x40 + 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,// 0x50 + 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,// 0x60 + 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,// 0x70 + 1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,// 0x80 0x81 to 0xfe 2 bytes + 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,// 0x90 + 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,// 0xa0 + 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,// 0xb0 + 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,// 0xc0 + 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,// 0xd0 + 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,// 0xe0 + 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,1 // 0xf0 +}; +static const char *XML_ByteTable=(const char *)XML_utf8ByteTable; // the default is "characterEncoding=XMLNode::encoding_UTF8" +#endif + + +XMLNode XMLNode::emptyXMLNode; +XMLClear XMLNode::emptyXMLClear={ NULL, NULL, NULL}; +XMLAttribute XMLNode::emptyXMLAttribute={ NULL, NULL}; + +// Enumeration used to decipher what type a token is +typedef enum XMLTokenTypeTag +{ + eTokenText = 0, + eTokenQuotedText, + eTokenTagStart, /* "<" */ + eTokenTagEnd, /* "" */ + eTokenEquals, /* "=" */ + eTokenDeclaration, /* "" */ + eTokenClear, + eTokenError +} XMLTokenType; + +// Main structure used for parsing XML +typedef struct XML +{ + XMLCSTR lpXML; + XMLCSTR lpszText; + int nIndex,nIndexMissigEndTag; + enum XMLError error; + XMLCSTR lpEndTag; + int cbEndTag; + XMLCSTR lpNewElement; + int cbNewElement; + int nFirst; +} XML; + +typedef struct +{ + ALLXMLClearTag *pClr; + XMLCSTR pStr; +} NextToken; + +// Enumeration used when parsing attributes +typedef enum Attrib +{ + eAttribName = 0, + eAttribEquals, + eAttribValue +} Attrib; + +// Enumeration used when parsing elements to dictate whether we are currently +// inside a tag +typedef enum XMLStatus +{ + eInsideTag = 0, + eOutsideTag +} XMLStatus; + +XMLError XMLNode::writeToFile(XMLCSTR filename, const char *encoding, char nFormat) const +{ + if (!d) return eXMLErrorNone; + FILE *f=xfopen(filename,_CXML("wb")); + if (!f) return eXMLErrorCannotOpenWriteFile; +#ifdef _XMLWIDECHAR + unsigned char h[2]={ 0xFF, 0xFE }; + if (!fwrite(h,2,1,f)) + { + fclose(f); + return eXMLErrorCannotWriteFile; + } + if ((!isDeclaration())&&((d->lpszName)||(!getChildNode().isDeclaration()))) + { + if (!fwrite(L"\n",sizeof(wchar_t)*40,1,f)) + { + fclose(f); + return eXMLErrorCannotWriteFile; + } + } +#else + if ((!isDeclaration())&&((d->lpszName)||(!getChildNode().isDeclaration()))) + { + if (characterEncoding==char_encoding_UTF8) + { + // header so that windows recognize the file as UTF-8: + unsigned char h[3]={0xEF,0xBB,0xBF}; + if (!fwrite(h,3,1,f)) + { + fclose(f); + return eXMLErrorCannotWriteFile; + } + encoding="utf-8"; + } else if (characterEncoding==char_encoding_ShiftJIS) encoding="SHIFT-JIS"; + + if (!encoding) encoding="ISO-8859-1"; + if (fprintf(f,"\n",encoding)<0) + { + fclose(f); + return eXMLErrorCannotWriteFile; + } + } else + { + if (characterEncoding==char_encoding_UTF8) + { + unsigned char h[3]={0xEF,0xBB,0xBF}; + if (!fwrite(h,3,1,f)) + { + fclose(f); + return eXMLErrorCannotWriteFile; + } + } + } +#endif + int i; + XMLSTR t=createXMLString(nFormat,&i); + if (!fwrite(t,sizeof(XMLCHAR)*i,1,f)) + { + free(t); + fclose(f); + return eXMLErrorCannotWriteFile; + } + if (fclose(f)!=0) + { + free(t); + return eXMLErrorCannotWriteFile; + } + free(t); + return eXMLErrorNone; +} + +// Duplicate a given string. +XMLSTR stringDup(XMLCSTR lpszData, int cbData) +{ + if (lpszData==NULL) return NULL; + + XMLSTR lpszNew; + if (cbData==-1) cbData=(int)xstrlen(lpszData); + lpszNew = (XMLSTR)malloc((cbData+1) * sizeof(XMLCHAR)); + if (lpszNew) + { + memcpy(lpszNew, lpszData, (cbData) * sizeof(XMLCHAR)); + lpszNew[cbData] = (XMLCHAR)NULL; + } + return lpszNew; +} + +XMLSTR ToXMLStringTool::toXMLUnSafe(XMLSTR dest,XMLCSTR source) +{ + XMLSTR dd=dest; + XMLCHAR ch; + XMLCharacterEntity *entity; + while ((ch=*source)) + { + entity=XMLEntities; + do + { + if (ch==entity->c) {xstrcpy(dest,entity->s); dest+=entity->l; source++; goto out_of_loop1; } + entity++; + } while(entity->s); +#ifdef _XMLWIDECHAR + *(dest++)=*(source++); +#else + switch(XML_ByteTable[(unsigned char)ch]) + { + case 4: *(dest++)=*(source++); + case 3: *(dest++)=*(source++); + case 2: *(dest++)=*(source++); + case 1: *(dest++)=*(source++); + } +#endif +out_of_loop1: + ; + } + *dest=0; + return dd; +} + +// private (used while rendering): +int ToXMLStringTool::lengthXMLString(XMLCSTR source) +{ + int r=0; + XMLCharacterEntity *entity; + XMLCHAR ch; + while ((ch=*source)) + { + entity=XMLEntities; + do + { + if (ch==entity->c) { r+=entity->l; source++; goto out_of_loop1; } + entity++; + } while(entity->s); +#ifdef _XMLWIDECHAR + r++; source++; +#else + ch=XML_ByteTable[(unsigned char)ch]; r+=ch; source+=ch; +#endif +out_of_loop1: + ; + } + return r; +} + +ToXMLStringTool::~ToXMLStringTool(){ freeBuffer(); } +void ToXMLStringTool::freeBuffer(){ if (buf) free(buf); buf=NULL; buflen=0; } +XMLSTR ToXMLStringTool::toXML(XMLCSTR source) +{ + if (!source) + { + if (buflen<1) { buflen=1; buf=(XMLSTR)malloc(sizeof(XMLCHAR)); } + *buf=0; + return buf; + } + int l=lengthXMLString(source)+1; + if (l>buflen) { freeBuffer(); buflen=l; buf=(XMLSTR)malloc(l*sizeof(XMLCHAR)); } + return toXMLUnSafe(buf,source); +} + +// private: +XMLSTR fromXMLString(XMLCSTR s, int lo, XML *pXML) +{ + // This function is the opposite of the function "toXMLString". It decodes the escape + // sequences &, ", ', <, > and replace them by the characters + // &,",',<,>. This function is used internally by the XML Parser. All the calls to + // the XML library will always gives you back "decoded" strings. + // + // in: string (s) and length (lo) of string + // out: new allocated string converted from xml + if (!s) return NULL; + + int ll=0,j; + XMLSTR d; + XMLCSTR ss=s; + XMLCharacterEntity *entity; + while ((lo>0)&&(*s)) + { + if (*s==_CXML('&')) + { + if ((lo>2)&&(s[1]==_CXML('#'))) + { + s+=2; lo-=2; + if ((*s==_CXML('X'))||(*s==_CXML('x'))) { s++; lo--; } + while ((*s)&&(*s!=_CXML(';'))&&((lo--)>0)) s++; + if (*s!=_CXML(';')) + { + pXML->error=eXMLErrorUnknownCharacterEntity; + return NULL; + } + s++; lo--; + } else + { + entity=XMLEntities; + do + { + if ((lo>=entity->l)&&(xstrnicmp(s,entity->s,entity->l)==0)) { s+=entity->l; lo-=entity->l; break; } + entity++; + } while(entity->s); + if (!entity->s) + { + pXML->error=eXMLErrorUnknownCharacterEntity; + return NULL; + } + } + } else + { +#ifdef _XMLWIDECHAR + s++; lo--; +#else + j=XML_ByteTable[(unsigned char)*s]; s+=j; lo-=j; ll+=j-1; +#endif + } + ll++; + } + + d=(XMLSTR)malloc((ll+1)*sizeof(XMLCHAR)); + s=d; + while (ll-->0) + { + if (*ss==_CXML('&')) + { + if (ss[1]==_CXML('#')) + { + ss+=2; j=0; + if ((*ss==_CXML('X'))||(*ss==_CXML('x'))) + { + ss++; + while (*ss!=_CXML(';')) + { + if ((*ss>=_CXML('0'))&&(*ss<=_CXML('9'))) j=(j<<4)+*ss-_CXML('0'); + else if ((*ss>=_CXML('A'))&&(*ss<=_CXML('F'))) j=(j<<4)+*ss-_CXML('A')+10; + else if ((*ss>=_CXML('a'))&&(*ss<=_CXML('f'))) j=(j<<4)+*ss-_CXML('a')+10; + else { free((void*)s); pXML->error=eXMLErrorUnknownCharacterEntity;return NULL;} + ss++; + } + } else + { + while (*ss!=_CXML(';')) + { + if ((*ss>=_CXML('0'))&&(*ss<=_CXML('9'))) j=(j*10)+*ss-_CXML('0'); + else { free((void*)s); pXML->error=eXMLErrorUnknownCharacterEntity;return NULL;} + ss++; + } + } +#ifndef _XMLWIDECHAR + if (j>255) { free((void*)s); pXML->error=eXMLErrorCharacterCodeAbove255;return NULL;} +#endif + (*d++)=(XMLCHAR)j; ss++; + } else + { + entity=XMLEntities; + do + { + if (xstrnicmp(ss,entity->s,entity->l)==0) { *(d++)=entity->c; ss+=entity->l; break; } + entity++; + } while(entity->s); + } + } else + { +#ifdef _XMLWIDECHAR + *(d++)=*(ss++); +#else + switch(XML_ByteTable[(unsigned char)*ss]) + { + case 4: *(d++)=*(ss++); ll--; + case 3: *(d++)=*(ss++); ll--; + case 2: *(d++)=*(ss++); ll--; + case 1: *(d++)=*(ss++); + } +#endif + } + } + *d=0; + return (XMLSTR)s; +} + +#define XML_isSPACECHAR(ch) ((ch==_CXML('\n'))||(ch==_CXML(' '))||(ch== _CXML('\t'))||(ch==_CXML('\r'))) + +// private: +char myTagCompare(XMLCSTR cclose, XMLCSTR copen) +// !!!! WARNING strange convention&: +// return 0 if equals +// return 1 if different +{ + if (!cclose) return 1; + int l=(int)xstrlen(cclose); + if (xstrnicmp(cclose, copen, l)!=0) return 1; + const XMLCHAR c=copen[l]; + if (XML_isSPACECHAR(c)|| + (c==_CXML('/' ))|| + (c==_CXML('<' ))|| + (c==_CXML('>' ))|| + (c==_CXML('=' ))) return 0; + return 1; +} + +// Obtain the next character from the string. +static inline XMLCHAR getNextChar(XML *pXML) +{ + XMLCHAR ch = pXML->lpXML[pXML->nIndex]; +#ifdef _XMLWIDECHAR + if (ch!=0) pXML->nIndex++; +#else + pXML->nIndex+=XML_ByteTable[(unsigned char)ch]; +#endif + return ch; +} + +// Find the next token in a string. +// pcbToken contains the number of characters that have been read. +static NextToken GetNextToken(XML *pXML, int *pcbToken, enum XMLTokenTypeTag *pType) +{ + NextToken result; + XMLCHAR ch; + XMLCHAR chTemp; + int indexStart,nFoundMatch,nIsText=FALSE; + result.pClr=NULL; // prevent warning + + // Find next non-white space character + do { indexStart=pXML->nIndex; ch=getNextChar(pXML); } while XML_isSPACECHAR(ch); + + if (ch) + { + // Cache the current string pointer + result.pStr = &pXML->lpXML[indexStart]; + + // check for standard tokens + switch(ch) + { + // Check for quotes + case _CXML('\''): + case _CXML('\"'): + // Type of token + *pType = eTokenQuotedText; + chTemp = ch; + + // Set the size + nFoundMatch = FALSE; + + // Search through the string to find a matching quote + while((ch = getNextChar(pXML))) + { + if (ch==chTemp) { nFoundMatch = TRUE; break; } + if (ch==_CXML('<')) break; + } + + // If we failed to find a matching quote + if (nFoundMatch == FALSE) + { + pXML->nIndex=indexStart+1; + nIsText=TRUE; + break; + } + +// 4.02.2002 +// if (FindNonWhiteSpace(pXML)) pXML->nIndex--; + + break; + + // Equals (used with attribute values) + case _CXML('='): + *pType = eTokenEquals; + break; + + // Close tag + case _CXML('>'): + *pType = eTokenCloseTag; + break; + + // Check for tag start and tag end + case _CXML('<'): + + { + // First check whether the token is in the clear tag list (meaning it + // does not need formatting). + ALLXMLClearTag *ctag=XMLClearTags; + do + { + if (!xstrncmp(ctag->lpszOpen, result.pStr, ctag->openTagLen)) + { + result.pClr=ctag; + pXML->nIndex+=ctag->openTagLen-1; + *pType=eTokenClear; + return result; + } + ctag++; + } while(ctag->lpszOpen); + + // Peek at the next character to see if we have an end tag 'lpXML[pXML->nIndex]; + + // If we have a tag end... + if (chTemp == _CXML('/')) + { + // Set the type and ensure we point at the next character + getNextChar(pXML); + *pType = eTokenTagEnd; + } + + // If we have an XML declaration tag + else if (chTemp == _CXML('?')) + { + + // Set the type and ensure we point at the next character + getNextChar(pXML); + *pType = eTokenDeclaration; + } + + // Otherwise we must have a start tag + else + { + *pType = eTokenTagStart; + } + break; + } + + // Check to see if we have a short hand type end tag ('/>'). + case _CXML('/'): + + // Peek at the next character to see if we have a short end tag '/>' + chTemp = pXML->lpXML[pXML->nIndex]; + + // If we have a short hand end tag... + if (chTemp == _CXML('>')) + { + // Set the type and ensure we point at the next character + getNextChar(pXML); + *pType = eTokenShortHandClose; + break; + } + + // If we haven't found a short hand closing tag then drop into the + // text process + + // Other characters + default: + nIsText = TRUE; + } + + // If this is a TEXT node + if (nIsText) + { + // Indicate we are dealing with text + *pType = eTokenText; + while((ch = getNextChar(pXML))) + { + if XML_isSPACECHAR(ch) + { + indexStart++; break; + + } else if (ch==_CXML('/')) + { + // If we find a slash then this maybe text or a short hand end tag + // Peek at the next character to see it we have short hand end tag + ch=pXML->lpXML[pXML->nIndex]; + // If we found a short hand end tag then we need to exit the loop + if (ch==_CXML('>')) { pXML->nIndex--; break; } + + } else if ((ch==_CXML('<'))||(ch==_CXML('>'))||(ch==_CXML('='))) + { + pXML->nIndex--; break; + } + } + } + *pcbToken = pXML->nIndex-indexStart; + } else + { + // If we failed to obtain a valid character + *pcbToken = 0; + *pType = eTokenError; + result.pStr=NULL; + } + + return result; +} + +XMLCSTR XMLNode::updateName_WOSD(XMLSTR lpszName) +{ + if (!d) { free(lpszName); return NULL; } + if (d->lpszName&&(lpszName!=d->lpszName)) free((void*)d->lpszName); + d->lpszName=lpszName; + return lpszName; +} + +// private: +XMLNode::XMLNode(struct XMLNodeDataTag *p){ d=p; (p->ref_count)++; } +XMLNode::XMLNode(XMLNodeData *pParent, XMLSTR lpszName, char isDeclaration) +{ + d=(XMLNodeData*)malloc(sizeof(XMLNodeData)); + d->ref_count=1; + + d->lpszName=NULL; + d->nChild= 0; + d->nText = 0; + d->nClear = 0; + d->nAttribute = 0; + + d->isDeclaration = isDeclaration; + + d->pParent = pParent; + d->pChild= NULL; + d->pText= NULL; + d->pClear= NULL; + d->pAttribute= NULL; + d->pOrder= NULL; + + updateName_WOSD(lpszName); +} + +XMLNode XMLNode::createXMLTopNode_WOSD(XMLSTR lpszName, char isDeclaration) { return XMLNode(NULL,lpszName,isDeclaration); } +XMLNode XMLNode::createXMLTopNode(XMLCSTR lpszName, char isDeclaration) { return XMLNode(NULL,stringDup(lpszName),isDeclaration); } + +#define MEMORYINCREASE 50 + +static inline void myFree(void *p) { if (p) free(p); } +static inline void *myRealloc(void *p, int newsize, int memInc, int sizeofElem) +{ + if (p==NULL) { if (memInc) return malloc(memInc*sizeofElem); return malloc(sizeofElem); } + if ((memInc==0)||((newsize%memInc)==0)) p=realloc(p,(newsize+memInc)*sizeofElem); +// if (!p) +// { +// printf("XMLParser Error: Not enough memory! Aborting...\n"); exit(220); +// } + return p; +} + +// private: +XMLElementPosition XMLNode::findPosition(XMLNodeData *d, int index, XMLElementType xxtype) +{ + if (index<0) return -1; + int i=0,j=(int)((index<<2)+xxtype),*o=d->pOrder; while (o[i]!=j) i++; return i; +} + +// private: +// update "order" information when deleting a content of a XMLNode +int XMLNode::removeOrderElement(XMLNodeData *d, XMLElementType t, int index) +{ + int n=d->nChild+d->nText+d->nClear, *o=d->pOrder,i=findPosition(d,index,t); + memmove(o+i, o+i+1, (n-i)*sizeof(int)); + for (;ipOrder=(int)realloc(d->pOrder,n*sizeof(int)); + // but we skip reallocation because it's too time consuming. + // Anyway, at the end, it will be free'd completely at once. + return i; +} + +void *XMLNode::addToOrder(int memoryIncrease,int *_pos, int nc, void *p, int size, XMLElementType xtype) +{ + // in: *_pos is the position inside d->pOrder ("-1" means "EndOf") + // out: *_pos is the index inside p + p=myRealloc(p,(nc+1),memoryIncrease,size); + int n=d->nChild+d->nText+d->nClear; + d->pOrder=(int*)myRealloc(d->pOrder,n+1,memoryIncrease*3,sizeof(int)); + int pos=*_pos,*o=d->pOrder; + + if ((pos<0)||(pos>=n)) { *_pos=nc; o[n]=(int)((nc<<2)+xtype); return p; } + + int i=pos; + memmove(o+i+1, o+i, (n-i)*sizeof(int)); + + while ((pos>2; + memmove(((char*)p)+(pos+1)*size,((char*)p)+pos*size,(nc-pos)*size); + + return p; +} + +// Add a child node to the given element. +XMLNode XMLNode::addChild_priv(int memoryIncrease, XMLSTR lpszName, char isDeclaration, int pos) +{ + if (!lpszName) return emptyXMLNode; + d->pChild=(XMLNode*)addToOrder(memoryIncrease,&pos,d->nChild,d->pChild,sizeof(XMLNode),eNodeChild); + d->pChild[pos].d=NULL; + d->pChild[pos]=XMLNode(d,lpszName,isDeclaration); + d->nChild++; + return d->pChild[pos]; +} + +// Add an attribute to an element. +XMLAttribute *XMLNode::addAttribute_priv(int memoryIncrease,XMLSTR lpszName, XMLSTR lpszValuev) +{ + if (!lpszName) return &emptyXMLAttribute; + if (!d) { myFree(lpszName); myFree(lpszValuev); return &emptyXMLAttribute; } + int nc=d->nAttribute; + d->pAttribute=(XMLAttribute*)myRealloc(d->pAttribute,(nc+1),memoryIncrease,sizeof(XMLAttribute)); + XMLAttribute *pAttr=d->pAttribute+nc; + pAttr->lpszName = lpszName; + pAttr->lpszValue = lpszValuev; + d->nAttribute++; + return pAttr; +} + +// Add text to the element. +XMLCSTR XMLNode::addText_priv(int memoryIncrease, XMLSTR lpszValue, int pos) +{ + if (!lpszValue) return NULL; + if (!d) { myFree(lpszValue); return NULL; } + d->pText=(XMLCSTR*)addToOrder(memoryIncrease,&pos,d->nText,d->pText,sizeof(XMLSTR),eNodeText); + d->pText[pos]=lpszValue; + d->nText++; + return lpszValue; +} + +// Add clear (unformatted) text to the element. +XMLClear *XMLNode::addClear_priv(int memoryIncrease, XMLSTR lpszValue, XMLCSTR lpszOpen, XMLCSTR lpszClose, int pos) +{ + if (!lpszValue) return &emptyXMLClear; + if (!d) { myFree(lpszValue); return &emptyXMLClear; } + d->pClear=(XMLClear *)addToOrder(memoryIncrease,&pos,d->nClear,d->pClear,sizeof(XMLClear),eNodeClear); + XMLClear *pNewClear=d->pClear+pos; + pNewClear->lpszValue = lpszValue; + if (!lpszOpen) lpszOpen=XMLClearTags->lpszOpen; + if (!lpszClose) lpszClose=XMLClearTags->lpszClose; + pNewClear->lpszOpenTag = lpszOpen; + pNewClear->lpszCloseTag = lpszClose; + d->nClear++; + return pNewClear; +} + +// private: +// Parse a clear (unformatted) type node. +char XMLNode::parseClearTag(void *px, void *_pClear) +{ + XML *pXML=(XML *)px; + ALLXMLClearTag pClear=*((ALLXMLClearTag*)_pClear); + int cbTemp=0; + XMLCSTR lpszTemp=NULL; + XMLCSTR lpXML=&pXML->lpXML[pXML->nIndex]; + static XMLCSTR docTypeEnd=_CXML("]>"); + + // Find the closing tag + // Seems the ')) { lpszTemp=pCh; break; } +#ifdef _XMLWIDECHAR + pCh++; +#else + pCh+=XML_ByteTable[(unsigned char)(*pCh)]; +#endif + } + } else lpszTemp=xstrstr(lpXML, pClear.lpszClose); + + if (lpszTemp) + { + // Cache the size and increment the index + cbTemp = (int)(lpszTemp - lpXML); + + pXML->nIndex += cbTemp+(int)xstrlen(pClear.lpszClose); + + // Add the clear node to the current element + addClear_priv(MEMORYINCREASE,stringDup(lpXML,cbTemp), pClear.lpszOpen, pClear.lpszClose,-1); + return 0; + } + + // If we failed to find the end tag + pXML->error = eXMLErrorUnmatchedEndClearTag; + return 1; +} + +void XMLNode::exactMemory(XMLNodeData *d) +{ + if (d->pOrder) d->pOrder=(int*)realloc(d->pOrder,(d->nChild+d->nText+d->nClear)*sizeof(int)); + if (d->pChild) d->pChild=(XMLNode*)realloc(d->pChild,d->nChild*sizeof(XMLNode)); + if (d->pAttribute) d->pAttribute=(XMLAttribute*)realloc(d->pAttribute,d->nAttribute*sizeof(XMLAttribute)); + if (d->pText) d->pText=(XMLCSTR*)realloc(d->pText,d->nText*sizeof(XMLSTR)); + if (d->pClear) d->pClear=(XMLClear *)realloc(d->pClear,d->nClear*sizeof(XMLClear)); +} + +char XMLNode::maybeAddTxT(void *pa, XMLCSTR tokenPStr) +{ + XML *pXML=(XML *)pa; + XMLCSTR lpszText=pXML->lpszText; + if (!lpszText) return 0; + if (dropWhiteSpace) while (XML_isSPACECHAR(*lpszText)&&(lpszText!=tokenPStr)) lpszText++; + int cbText = (int)(tokenPStr - lpszText); + if (!cbText) { pXML->lpszText=NULL; return 0; } + if (dropWhiteSpace) { cbText--; while ((cbText)&&XML_isSPACECHAR(lpszText[cbText])) cbText--; cbText++; } + if (!cbText) { pXML->lpszText=NULL; return 0; } + XMLSTR lpt=fromXMLString(lpszText,cbText,pXML); + if (!lpt) return 1; + pXML->lpszText=NULL; + if (removeCommentsInMiddleOfText && d->nText && d->nClear) + { + // if the previous insertion was a comment () AND + // if the previous previous insertion was a text then, delete the comment and append the text + int n=d->nChild+d->nText+d->nClear-1,*o=d->pOrder; + if (((o[n]&3)==eNodeClear)&&((o[n-1]&3)==eNodeText)) + { + int i=o[n]>>2; + if (d->pClear[i].lpszOpenTag==XMLClearTags[2].lpszOpen) + { + deleteClear(i); + i=o[n-1]>>2; + n=xstrlen(d->pText[i]); + int n2=xstrlen(lpt)+1; + d->pText[i]=(XMLSTR)realloc((void*)d->pText[i],(n+n2)*sizeof(XMLCHAR)); + if (!d->pText[i]) return 1; + memcpy((void*)(d->pText[i]+n),lpt,n2*sizeof(XMLCHAR)); + free(lpt); + return 0; + } + } + } + addText_priv(MEMORYINCREASE,lpt,-1); + return 0; +} +// private: +// Recursively parse an XML element. +int XMLNode::ParseXMLElement(void *pa) +{ + XML *pXML=(XML *)pa; + int cbToken; + enum XMLTokenTypeTag xtype; + NextToken token; + XMLCSTR lpszTemp=NULL; + int cbTemp=0; + char nDeclaration; + XMLNode pNew; + enum XMLStatus status; // inside or outside a tag + enum Attrib attrib = eAttribName; + + assert(pXML); + + // If this is the first call to the function + if (pXML->nFirst) + { + // Assume we are outside of a tag definition + pXML->nFirst = FALSE; + status = eOutsideTag; + } else + { + // If this is not the first call then we should only be called when inside a tag. + status = eInsideTag; + } + + // Iterate through the tokens in the document + for(;;) + { + // Obtain the next token + token = GetNextToken(pXML, &cbToken, &xtype); + + if (xtype != eTokenError) + { + // Check the current status + switch(status) + { + + // If we are outside of a tag definition + case eOutsideTag: + + // Check what type of token we obtained + switch(xtype) + { + // If we have found text or quoted text + case eTokenText: + case eTokenCloseTag: /* '>' */ + case eTokenShortHandClose: /* '/>' */ + case eTokenQuotedText: + case eTokenEquals: + break; + + // If we found a start tag '<' and declarations 'error = eXMLErrorMissingTagName; + return FALSE; + } + + // If we found a new element which is the same as this + // element then we need to pass this back to the caller.. + +#ifdef APPROXIMATE_PARSING + if (d->lpszName && + myTagCompare(d->lpszName, token.pStr) == 0) + { + // Indicate to the caller that it needs to create a + // new element. + pXML->lpNewElement = token.pStr; + pXML->cbNewElement = cbToken; + return TRUE; + } else +#endif + { + // If the name of the new element differs from the name of + // the current element we need to add the new element to + // the current one and recurse + pNew = addChild_priv(MEMORYINCREASE,stringDup(token.pStr,cbToken), nDeclaration,-1); + + while (!pNew.isEmpty()) + { + // Callself to process the new node. If we return + // FALSE this means we dont have any more + // processing to do... + + if (!pNew.ParseXMLElement(pXML)) return FALSE; + else + { + // If the call to recurse this function + // evented in a end tag specified in XML then + // we need to unwind the calls to this + // function until we find the appropriate node + // (the element name and end tag name must + // match) + if (pXML->cbEndTag) + { + // If we are back at the root node then we + // have an unmatched end tag + if (!d->lpszName) + { + pXML->error=eXMLErrorUnmatchedEndTag; + return FALSE; + } + + // If the end tag matches the name of this + // element then we only need to unwind + // once more... + + if (myTagCompare(d->lpszName, pXML->lpEndTag)==0) + { + pXML->cbEndTag = 0; + } + + return TRUE; + } else + if (pXML->cbNewElement) + { + // If the call indicated a new element is to + // be created on THIS element. + + // If the name of this element matches the + // name of the element we need to create + // then we need to return to the caller + // and let it process the element. + + if (myTagCompare(d->lpszName, pXML->lpNewElement)==0) + { + return TRUE; + } + + // Add the new element and recurse + pNew = addChild_priv(MEMORYINCREASE,stringDup(pXML->lpNewElement,pXML->cbNewElement),0,-1); + pXML->cbNewElement = 0; + } + else + { + // If we didn't have a new element to create + pNew = emptyXMLNode; + + } + } + } + } + break; + + // If we found an end tag + case eTokenTagEnd: + + // If we have node text then add this to the element + if (maybeAddTxT(pXML,token.pStr)) return FALSE; + + // Find the name of the end tag + token = GetNextToken(pXML, &cbTemp, &xtype); + + // The end tag should be text + if (xtype != eTokenText) + { + pXML->error = eXMLErrorMissingEndTagName; + return FALSE; + } + lpszTemp = token.pStr; + + // After the end tag we should find a closing tag + token = GetNextToken(pXML, &cbToken, &xtype); + if (xtype != eTokenCloseTag) + { + pXML->error = eXMLErrorMissingEndTagName; + return FALSE; + } + pXML->lpszText=pXML->lpXML+pXML->nIndex; + + // We need to return to the previous caller. If the name + // of the tag cannot be found we need to keep returning to + // caller until we find a match + if (myTagCompare(d->lpszName, lpszTemp) != 0) +#ifdef STRICT_PARSING + { + pXML->error=eXMLErrorUnmatchedEndTag; + pXML->nIndexMissigEndTag=pXML->nIndex; + return FALSE; + } +#else + { + pXML->error=eXMLErrorMissingEndTag; + pXML->nIndexMissigEndTag=pXML->nIndex; + pXML->lpEndTag = lpszTemp; + pXML->cbEndTag = cbTemp; + } +#endif + + // Return to the caller + exactMemory(d); + return TRUE; + + // If we found a clear (unformatted) token + case eTokenClear: + // If we have node text then add this to the element + if (maybeAddTxT(pXML,token.pStr)) return FALSE; + if (parseClearTag(pXML, token.pClr)) return FALSE; + pXML->lpszText=pXML->lpXML+pXML->nIndex; + break; + + default: + break; + } + break; + + // If we are inside a tag definition we need to search for attributes + case eInsideTag: + + // Check what part of the attribute (name, equals, value) we + // are looking for. + switch(attrib) + { + // If we are looking for a new attribute + case eAttribName: + + // Check what the current token type is + switch(xtype) + { + // If the current type is text... + // Eg. 'attribute' + case eTokenText: + // Cache the token then indicate that we are next to + // look for the equals + lpszTemp = token.pStr; + cbTemp = cbToken; + attrib = eAttribEquals; + break; + + // If we found a closing tag... + // Eg. '>' + case eTokenCloseTag: + // We are now outside the tag + status = eOutsideTag; + pXML->lpszText=pXML->lpXML+pXML->nIndex; + break; + + // If we found a short hand '/>' closing tag then we can + // return to the caller + case eTokenShortHandClose: + exactMemory(d); + pXML->lpszText=pXML->lpXML+pXML->nIndex; + return TRUE; + + // Errors... + case eTokenQuotedText: /* '"SomeText"' */ + case eTokenTagStart: /* '<' */ + case eTokenTagEnd: /* 'error = eXMLErrorUnexpectedToken; + return FALSE; + default: break; + } + break; + + // If we are looking for an equals + case eAttribEquals: + // Check what the current token type is + switch(xtype) + { + // If the current type is text... + // Eg. 'Attribute AnotherAttribute' + case eTokenText: + // Add the unvalued attribute to the list + addAttribute_priv(MEMORYINCREASE,stringDup(lpszTemp,cbTemp), NULL); + // Cache the token then indicate. We are next to + // look for the equals attribute + lpszTemp = token.pStr; + cbTemp = cbToken; + break; + + // If we found a closing tag 'Attribute >' or a short hand + // closing tag 'Attribute />' + case eTokenShortHandClose: + case eTokenCloseTag: + // If we are a declaration element 'lpszText=pXML->lpXML+pXML->nIndex; + + if (d->isDeclaration && + (lpszTemp[cbTemp-1]) == _CXML('?')) + { + cbTemp--; + if (d->pParent && d->pParent->pParent) xtype = eTokenShortHandClose; + } + + if (cbTemp) + { + // Add the unvalued attribute to the list + addAttribute_priv(MEMORYINCREASE,stringDup(lpszTemp,cbTemp), NULL); + } + + // If this is the end of the tag then return to the caller + if (xtype == eTokenShortHandClose) + { + exactMemory(d); + return TRUE; + } + + // We are now outside the tag + status = eOutsideTag; + break; + + // If we found the equals token... + // Eg. 'Attribute =' + case eTokenEquals: + // Indicate that we next need to search for the value + // for the attribute + attrib = eAttribValue; + break; + + // Errors... + case eTokenQuotedText: /* 'Attribute "InvalidAttr"'*/ + case eTokenTagStart: /* 'Attribute <' */ + case eTokenTagEnd: /* 'Attribute error = eXMLErrorUnexpectedToken; + return FALSE; + default: break; + } + break; + + // If we are looking for an attribute value + case eAttribValue: + // Check what the current token type is + switch(xtype) + { + // If the current type is text or quoted text... + // Eg. 'Attribute = "Value"' or 'Attribute = Value' or + // 'Attribute = 'Value''. + case eTokenText: + case eTokenQuotedText: + // If we are a declaration element 'isDeclaration && + (token.pStr[cbToken-1]) == _CXML('?')) + { + cbToken--; + } + + if (cbTemp) + { + // Add the valued attribute to the list + if (xtype==eTokenQuotedText) { token.pStr++; cbToken-=2; } + XMLSTR attrVal=(XMLSTR)token.pStr; + if (attrVal) + { + attrVal=fromXMLString(attrVal,cbToken,pXML); + if (!attrVal) return FALSE; + } + addAttribute_priv(MEMORYINCREASE,stringDup(lpszTemp,cbTemp),attrVal); + } + + // Indicate we are searching for a new attribute + attrib = eAttribName; + break; + + // Errors... + case eTokenTagStart: /* 'Attr = <' */ + case eTokenTagEnd: /* 'Attr = ' */ + case eTokenShortHandClose: /* "Attr = />" */ + case eTokenEquals: /* 'Attr = =' */ + case eTokenDeclaration: /* 'Attr = error = eXMLErrorUnexpectedToken; + return FALSE; + break; + default: break; + } + } + } + } + // If we failed to obtain the next token + else + { + if ((!d->isDeclaration)&&(d->pParent)) + { +#ifdef STRICT_PARSING + pXML->error=eXMLErrorUnmatchedEndTag; +#else + pXML->error=eXMLErrorMissingEndTag; +#endif + pXML->nIndexMissigEndTag=pXML->nIndex; + } + maybeAddTxT(pXML,pXML->lpXML+pXML->nIndex); + return FALSE; + } + } +} + +// Count the number of lines and columns in an XML string. +static void CountLinesAndColumns(XMLCSTR lpXML, int nUpto, XMLResults *pResults) +{ + XMLCHAR ch; + assert(lpXML); + assert(pResults); + + struct XML xml={ lpXML,lpXML, 0, 0, eXMLErrorNone, NULL, 0, NULL, 0, TRUE }; + + pResults->nLine = 1; + pResults->nColumn = 1; + while (xml.nIndexnColumn++; + else + { + pResults->nLine++; + pResults->nColumn=1; + } + } +} + +// Parse XML and return the root element. +XMLNode XMLNode::parseString(XMLCSTR lpszXML, XMLCSTR tag, XMLResults *pResults) +{ + if (!lpszXML) + { + if (pResults) + { + pResults->error=eXMLErrorNoElements; + pResults->nLine=0; + pResults->nColumn=0; + } + return emptyXMLNode; + } + + XMLNode xnode(NULL,NULL,FALSE); + struct XML xml={ lpszXML, lpszXML, 0, 0, eXMLErrorNone, NULL, 0, NULL, 0, TRUE }; + + // Create header element + xnode.ParseXMLElement(&xml); + enum XMLError error = xml.error; + if (!xnode.nChildNode()) error=eXMLErrorNoXMLTagFound; + if ((xnode.nChildNode()==1)&&(xnode.nElement()==1)) xnode=xnode.getChildNode(); // skip the empty node + + // If no error occurred + if ((error==eXMLErrorNone)||(error==eXMLErrorMissingEndTag)||(error==eXMLErrorNoXMLTagFound)) + { + XMLCSTR name=xnode.getName(); + if (tag&&(*tag)&&((!name)||(xstricmp(name,tag)))) + { + xnode=xnode.getChildNode(tag); + if (xnode.isEmpty()) + { + if (pResults) + { + pResults->error=eXMLErrorFirstTagNotFound; + pResults->nLine=0; + pResults->nColumn=0; + } + return emptyXMLNode; + } + } + } else + { + // Cleanup: this will destroy all the nodes + xnode = emptyXMLNode; + } + + + // If we have been given somewhere to place results + if (pResults) + { + pResults->error = error; + + // If we have an error + if (error!=eXMLErrorNone) + { + if (error==eXMLErrorMissingEndTag) xml.nIndex=xml.nIndexMissigEndTag; + // Find which line and column it starts on. + CountLinesAndColumns(xml.lpXML, xml.nIndex, pResults); + } + } + return xnode; +} + +XMLNode XMLNode::parseFile(XMLCSTR filename, XMLCSTR tag, XMLResults *pResults) +{ + if (pResults) { pResults->nLine=0; pResults->nColumn=0; } + FILE *f=xfopen(filename,_CXML("rb")); + if (f==NULL) { if (pResults) pResults->error=eXMLErrorFileNotFound; return emptyXMLNode; } + fseek(f,0,SEEK_END); + int l=(int)ftell(f),headerSz=0; + if (!l) { if (pResults) pResults->error=eXMLErrorEmpty; fclose(f); return emptyXMLNode; } + fseek(f,0,SEEK_SET); + unsigned char *buf=(unsigned char*)malloc(l+4); + l=(int)fread(buf,1,l,f); + fclose(f); + buf[l]=0;buf[l+1]=0;buf[l+2]=0;buf[l+3]=0; +#ifdef _XMLWIDECHAR + if (guessWideCharChars) + { + if (!myIsTextWideChar(buf,l)) + { + XMLNode::XMLCharEncoding ce=XMLNode::char_encoding_legacy; + if ((buf[0]==0xef)&&(buf[1]==0xbb)&&(buf[2]==0xbf)) { headerSz=3; ce=XMLNode::char_encoding_UTF8; } + XMLSTR b2=myMultiByteToWideChar((const char*)(buf+headerSz),ce); + free(buf); buf=(unsigned char*)b2; headerSz=0; + } else + { + if ((buf[0]==0xef)&&(buf[1]==0xff)) headerSz=2; + if ((buf[0]==0xff)&&(buf[1]==0xfe)) headerSz=2; + } + } else + { + if ((buf[0]==0xef)&&(buf[1]==0xff)) headerSz=2; + if ((buf[0]==0xff)&&(buf[1]==0xfe)) headerSz=2; + if ((buf[0]==0xef)&&(buf[1]==0xbb)&&(buf[2]==0xbf)) headerSz=3; + } +#else + if (guessWideCharChars) + { + if (myIsTextWideChar(buf,l)) + { + if ((buf[0]==0xef)&&(buf[1]==0xff)) headerSz=2; + if ((buf[0]==0xff)&&(buf[1]==0xfe)) headerSz=2; + char *b2=myWideCharToMultiByte((const wchar_t*)(buf+headerSz)); + free(buf); buf=(unsigned char*)b2; headerSz=0; + } else + { + if ((buf[0]==0xef)&&(buf[1]==0xbb)&&(buf[2]==0xbf)) headerSz=3; + } + } else + { + if ((buf[0]==0xef)&&(buf[1]==0xff)) headerSz=2; + if ((buf[0]==0xff)&&(buf[1]==0xfe)) headerSz=2; + if ((buf[0]==0xef)&&(buf[1]==0xbb)&&(buf[2]==0xbf)) headerSz=3; + } +#endif + + if (!buf) { if (pResults) pResults->error=eXMLErrorCharConversionError; return emptyXMLNode; } + XMLNode x=parseString((XMLSTR)(buf+headerSz),tag,pResults); + free(buf); + return x; +} + +static inline void charmemset(XMLSTR dest,XMLCHAR c,int l) { while (l--) *(dest++)=c; } +// private: +// Creates an user friendly XML string from a given element with +// appropriate white space and carriage returns. +// +// This recurses through all subnodes then adds contents of the nodes to the +// string. +int XMLNode::CreateXMLStringR(XMLNodeData *pEntry, XMLSTR lpszMarker, int nFormat) +{ + int nResult = 0; + int cb=nFormat<0?0:nFormat; + int cbElement; + int nChildFormat=-1; + int nElementI=pEntry->nChild+pEntry->nText+pEntry->nClear; + int i,j; + if ((nFormat>=0)&&(nElementI==1)&&(pEntry->nText==1)&&(!pEntry->isDeclaration)) nFormat=-2; + + assert(pEntry); + +#define LENSTR(lpsz) (lpsz ? xstrlen(lpsz) : 0) + + // If the element has no name then assume this is the head node. + cbElement = (int)LENSTR(pEntry->lpszName); + + if (cbElement) + { + // "isDeclaration) lpszMarker[nResult++]=_CXML('?'); + xstrcpy(&lpszMarker[nResult], pEntry->lpszName); + nResult+=cbElement; + lpszMarker[nResult++]=_CXML(' '); + + } else + { + nResult+=cbElement+2+cb; + if (pEntry->isDeclaration) nResult++; + } + + // Enumerate attributes and add them to the string + XMLAttribute *pAttr=pEntry->pAttribute; + for (i=0; inAttribute; i++) + { + // "Attrib + cb = (int)LENSTR(pAttr->lpszName); + if (cb) + { + if (lpszMarker) xstrcpy(&lpszMarker[nResult], pAttr->lpszName); + nResult += cb; + // "Attrib=Value " + if (pAttr->lpszValue) + { + cb=(int)ToXMLStringTool::lengthXMLString(pAttr->lpszValue); + if (lpszMarker) + { + lpszMarker[nResult]=_CXML('='); + lpszMarker[nResult+1]=_CXML('"'); + if (cb) ToXMLStringTool::toXMLUnSafe(&lpszMarker[nResult+2],pAttr->lpszValue); + lpszMarker[nResult+cb+2]=_CXML('"'); + } + nResult+=cb+3; + } + if (lpszMarker) lpszMarker[nResult] = _CXML(' '); + nResult++; + } + pAttr++; + } + + if (pEntry->isDeclaration) + { + if (lpszMarker) + { + lpszMarker[nResult-1]=_CXML('?'); + lpszMarker[nResult]=_CXML('>'); + } + nResult++; + if (nFormat!=-1) + { + if (lpszMarker) lpszMarker[nResult]=_CXML('\n'); + nResult++; + } + } else + // If there are child nodes we need to terminate the start tag + if (nElementI) + { + if (lpszMarker) lpszMarker[nResult-1]=_CXML('>'); + if (nFormat>=0) + { + if (lpszMarker) lpszMarker[nResult]=_CXML('\n'); + nResult++; + } + } else nResult--; + } + + // Calculate the child format for when we recurse. This is used to + // determine the number of spaces used for prefixes. + if (nFormat!=-1) + { + if (cbElement&&(!pEntry->isDeclaration)) nChildFormat=nFormat+1; + else nChildFormat=nFormat; + } + + // Enumerate through remaining children + for (i=0; ipOrder[i]; + switch((XMLElementType)(j&3)) + { + // Text nodes + case eNodeText: + { + // "Text" + XMLCSTR pChild=pEntry->pText[j>>2]; + cb = (int)ToXMLStringTool::lengthXMLString(pChild); + if (cb) + { + if (nFormat>=0) + { + if (lpszMarker) + { + charmemset(&lpszMarker[nResult],INDENTCHAR,nFormat+1); + ToXMLStringTool::toXMLUnSafe(&lpszMarker[nResult+nFormat+1],pChild); + lpszMarker[nResult+nFormat+1+cb]=_CXML('\n'); + } + nResult+=cb+nFormat+2; + } else + { + if (lpszMarker) ToXMLStringTool::toXMLUnSafe(&lpszMarker[nResult], pChild); + nResult += cb; + } + } + break; + } + + // Clear type nodes + case eNodeClear: + { + XMLClear *pChild=pEntry->pClear+(j>>2); + // "OpenTag" + cb = (int)LENSTR(pChild->lpszOpenTag); + if (cb) + { + if (nFormat!=-1) + { + if (lpszMarker) + { + charmemset(&lpszMarker[nResult], INDENTCHAR, nFormat+1); + xstrcpy(&lpszMarker[nResult+nFormat+1], pChild->lpszOpenTag); + } + nResult+=cb+nFormat+1; + } + else + { + if (lpszMarker)xstrcpy(&lpszMarker[nResult], pChild->lpszOpenTag); + nResult += cb; + } + } + + // "OpenTag Value" + cb = (int)LENSTR(pChild->lpszValue); + if (cb) + { + if (lpszMarker) xstrcpy(&lpszMarker[nResult], pChild->lpszValue); + nResult += cb; + } + + // "OpenTag Value CloseTag" + cb = (int)LENSTR(pChild->lpszCloseTag); + if (cb) + { + if (lpszMarker) xstrcpy(&lpszMarker[nResult], pChild->lpszCloseTag); + nResult += cb; + } + + if (nFormat!=-1) + { + if (lpszMarker) lpszMarker[nResult] = _CXML('\n'); + nResult++; + } + break; + } + + // Element nodes + case eNodeChild: + { + // Recursively add child nodes + nResult += CreateXMLStringR(pEntry->pChild[j>>2].d, lpszMarker ? lpszMarker + nResult : 0, nChildFormat); + break; + } + default: break; + } + } + + if ((cbElement)&&(!pEntry->isDeclaration)) + { + // If we have child entries we need to use long XML notation for + // closing the element - "blah blah blah" + if (nElementI) + { + // "\0" + if (lpszMarker) + { + if (nFormat >=0) + { + charmemset(&lpszMarker[nResult], INDENTCHAR,nFormat); + nResult+=nFormat; + } + + lpszMarker[nResult]=_CXML('<'); lpszMarker[nResult+1]=_CXML('/'); + nResult += 2; + xstrcpy(&lpszMarker[nResult], pEntry->lpszName); + nResult += cbElement; + + lpszMarker[nResult]=_CXML('>'); + if (nFormat == -1) nResult++; + else + { + lpszMarker[nResult+1]=_CXML('\n'); + nResult+=2; + } + } else + { + if (nFormat>=0) nResult+=cbElement+4+nFormat; + else if (nFormat==-1) nResult+=cbElement+3; + else nResult+=cbElement+4; + } + } else + { + // If there are no children we can use shorthand XML notation - + // "" + // "/>\0" + if (lpszMarker) + { + lpszMarker[nResult]=_CXML('/'); lpszMarker[nResult+1]=_CXML('>'); + if (nFormat != -1) lpszMarker[nResult+2]=_CXML('\n'); + } + nResult += nFormat == -1 ? 2 : 3; + } + } + + return nResult; +} + +#undef LENSTR + +// Create an XML string +// @param int nFormat - 0 if no formatting is required +// otherwise nonzero for formatted text +// with carriage returns and indentation. +// @param int *pnSize - [out] pointer to the size of the +// returned string not including the +// NULL terminator. +// @return XMLSTR - Allocated XML string, you must free +// this with free(). +XMLSTR XMLNode::createXMLString(int nFormat, int *pnSize) const +{ + if (!d) { if (pnSize) *pnSize=0; return NULL; } + + XMLSTR lpszResult = NULL; + int cbStr; + + // Recursively Calculate the size of the XML string + if (!dropWhiteSpace) nFormat=0; + nFormat = nFormat ? 0 : -1; + cbStr = CreateXMLStringR(d, 0, nFormat); + // Alllocate memory for the XML string + the NULL terminator and + // create the recursively XML string. + lpszResult=(XMLSTR)malloc((cbStr+1)*sizeof(XMLCHAR)); + CreateXMLStringR(d, lpszResult, nFormat); + lpszResult[cbStr]=_CXML('\0'); + if (pnSize) *pnSize = cbStr; + return lpszResult; +} + +int XMLNode::detachFromParent(XMLNodeData *d) +{ + XMLNode *pa=d->pParent->pChild; + int i=0; + while (((void*)(pa[i].d))!=((void*)d)) i++; + d->pParent->nChild--; + if (d->pParent->nChild) memmove(pa+i,pa+i+1,(d->pParent->nChild-i)*sizeof(XMLNode)); + else { free(pa); d->pParent->pChild=NULL; } + return removeOrderElement(d->pParent,eNodeChild,i); +} + +XMLNode::~XMLNode() +{ + if (!d) return; + d->ref_count--; + emptyTheNode(0); +} +void XMLNode::deleteNodeContent() +{ + if (!d) return; + if (d->pParent) { detachFromParent(d); d->pParent=NULL; d->ref_count--; } + emptyTheNode(1); +} +void XMLNode::emptyTheNode(char force) +{ + XMLNodeData *dd=d; // warning: must stay this way! + if ((dd->ref_count==0)||force) + { + if (d->pParent) detachFromParent(d); + int i; + XMLNode *pc; + for(i=0; inChild; i++) + { + pc=dd->pChild+i; + pc->d->pParent=NULL; + pc->d->ref_count--; + pc->emptyTheNode(force); + } + myFree(dd->pChild); + for(i=0; inText; i++) free((void*)dd->pText[i]); + myFree(dd->pText); + for(i=0; inClear; i++) free((void*)dd->pClear[i].lpszValue); + myFree(dd->pClear); + for(i=0; inAttribute; i++) + { + free((void*)dd->pAttribute[i].lpszName); + if (dd->pAttribute[i].lpszValue) free((void*)dd->pAttribute[i].lpszValue); + } + myFree(dd->pAttribute); + myFree(dd->pOrder); + myFree((void*)dd->lpszName); + dd->nChild=0; dd->nText=0; dd->nClear=0; dd->nAttribute=0; + dd->pChild=NULL; dd->pText=NULL; dd->pClear=NULL; dd->pAttribute=NULL; + dd->pOrder=NULL; dd->lpszName=NULL; dd->pParent=NULL; + } + if (dd->ref_count==0) + { + free(dd); + d=NULL; + } +} + +XMLNode& XMLNode::operator=( const XMLNode& A ) +{ + // shallow copy + if (this != &A) + { + if (d) { d->ref_count--; emptyTheNode(0); } + d=A.d; + if (d) (d->ref_count) ++ ; + } + return *this; +} + +XMLNode::XMLNode(const XMLNode &A) +{ + // shallow copy + d=A.d; + if (d) (d->ref_count)++ ; +} + +XMLNode XMLNode::deepCopy() const +{ + if (!d) return XMLNode::emptyXMLNode; + XMLNode x(NULL,stringDup(d->lpszName),d->isDeclaration); + XMLNodeData *p=x.d; + int n=d->nAttribute; + if (n) + { + p->nAttribute=n; p->pAttribute=(XMLAttribute*)malloc(n*sizeof(XMLAttribute)); + while (n--) + { + p->pAttribute[n].lpszName=stringDup(d->pAttribute[n].lpszName); + p->pAttribute[n].lpszValue=stringDup(d->pAttribute[n].lpszValue); + } + } + if (d->pOrder) + { + n=(d->nChild+d->nText+d->nClear)*sizeof(int); p->pOrder=(int*)malloc(n); memcpy(p->pOrder,d->pOrder,n); + } + n=d->nText; + if (n) + { + p->nText=n; p->pText=(XMLCSTR*)malloc(n*sizeof(XMLCSTR)); + while(n--) p->pText[n]=stringDup(d->pText[n]); + } + n=d->nClear; + if (n) + { + p->nClear=n; p->pClear=(XMLClear*)malloc(n*sizeof(XMLClear)); + while (n--) + { + p->pClear[n].lpszCloseTag=d->pClear[n].lpszCloseTag; + p->pClear[n].lpszOpenTag=d->pClear[n].lpszOpenTag; + p->pClear[n].lpszValue=stringDup(d->pClear[n].lpszValue); + } + } + n=d->nChild; + if (n) + { + p->nChild=n; p->pChild=(XMLNode*)malloc(n*sizeof(XMLNode)); + while (n--) + { + p->pChild[n].d=NULL; + p->pChild[n]=d->pChild[n].deepCopy(); + p->pChild[n].d->pParent=p; + } + } + return x; +} + +XMLNode XMLNode::addChild(XMLNode childNode, int pos) +{ + XMLNodeData *dc=childNode.d; + if ((!dc)||(!d)) return childNode; + if (!dc->lpszName) + { + // this is a root node: todo: correct fix + int j=pos; + while (dc->nChild) + { + addChild(dc->pChild[0],j); + if (pos>=0) j++; + } + return childNode; + } + if (dc->pParent) { if ((detachFromParent(dc)<=pos)&&(dc->pParent==d)) pos--; } else dc->ref_count++; + dc->pParent=d; +// int nc=d->nChild; +// d->pChild=(XMLNode*)myRealloc(d->pChild,(nc+1),memoryIncrease,sizeof(XMLNode)); + d->pChild=(XMLNode*)addToOrder(0,&pos,d->nChild,d->pChild,sizeof(XMLNode),eNodeChild); + d->pChild[pos].d=dc; + d->nChild++; + return childNode; +} + +void XMLNode::deleteAttribute(int i) +{ + if ((!d)||(i<0)||(i>=d->nAttribute)) return; + d->nAttribute--; + XMLAttribute *p=d->pAttribute+i; + free((void*)p->lpszName); + if (p->lpszValue) free((void*)p->lpszValue); + if (d->nAttribute) memmove(p,p+1,(d->nAttribute-i)*sizeof(XMLAttribute)); else { free(p); d->pAttribute=NULL; } +} + +void XMLNode::deleteAttribute(XMLAttribute *a){ if (a) deleteAttribute(a->lpszName); } +void XMLNode::deleteAttribute(XMLCSTR lpszName) +{ + int j=0; + getAttribute(lpszName,&j); + if (j) deleteAttribute(j-1); +} + +XMLAttribute *XMLNode::updateAttribute_WOSD(XMLSTR lpszNewValue, XMLSTR lpszNewName,int i) +{ + if (!d) { if (lpszNewValue) free(lpszNewValue); if (lpszNewName) free(lpszNewName); return NULL; } + if (i>=d->nAttribute) + { + if (lpszNewName) return addAttribute_WOSD(lpszNewName,lpszNewValue); + return NULL; + } + XMLAttribute *p=d->pAttribute+i; + if (p->lpszValue&&p->lpszValue!=lpszNewValue) free((void*)p->lpszValue); + p->lpszValue=lpszNewValue; + if (lpszNewName&&p->lpszName!=lpszNewName) { free((void*)p->lpszName); p->lpszName=lpszNewName; }; + return p; +} + +XMLAttribute *XMLNode::updateAttribute_WOSD(XMLAttribute *newAttribute, XMLAttribute *oldAttribute) +{ + if (oldAttribute) return updateAttribute_WOSD((XMLSTR)newAttribute->lpszValue,(XMLSTR)newAttribute->lpszName,oldAttribute->lpszName); + return addAttribute_WOSD((XMLSTR)newAttribute->lpszName,(XMLSTR)newAttribute->lpszValue); +} + +XMLAttribute *XMLNode::updateAttribute_WOSD(XMLSTR lpszNewValue, XMLSTR lpszNewName,XMLCSTR lpszOldName) +{ + int j=0; + getAttribute(lpszOldName,&j); + if (j) return updateAttribute_WOSD(lpszNewValue,lpszNewName,j-1); + else + { + if (lpszNewName) return addAttribute_WOSD(lpszNewName,lpszNewValue); + else return addAttribute_WOSD(stringDup(lpszOldName),lpszNewValue); + } +} + +int XMLNode::indexText(XMLCSTR lpszValue) const +{ + if (!d) return -1; + int i,l=d->nText; + if (!lpszValue) { if (l) return 0; return -1; } + XMLCSTR *p=d->pText; + for (i=0; i=d->nText)) return; + d->nText--; + XMLCSTR *p=d->pText+i; + free((void*)*p); + if (d->nText) memmove(p,p+1,(d->nText-i)*sizeof(XMLCSTR)); else { free(p); d->pText=NULL; } + removeOrderElement(d,eNodeText,i); +} + +void XMLNode::deleteText(XMLCSTR lpszValue) { deleteText(indexText(lpszValue)); } + +XMLCSTR XMLNode::updateText_WOSD(XMLSTR lpszNewValue, int i) +{ + if (!d) { if (lpszNewValue) free(lpszNewValue); return NULL; } + if (i>=d->nText) return addText_WOSD(lpszNewValue); + XMLCSTR *p=d->pText+i; + if (*p!=lpszNewValue) { free((void*)*p); *p=lpszNewValue; } + return lpszNewValue; +} + +XMLCSTR XMLNode::updateText_WOSD(XMLSTR lpszNewValue, XMLCSTR lpszOldValue) +{ + if (!d) { if (lpszNewValue) free(lpszNewValue); return NULL; } + int i=indexText(lpszOldValue); + if (i>=0) return updateText_WOSD(lpszNewValue,i); + return addText_WOSD(lpszNewValue); +} + +void XMLNode::deleteClear(int i) +{ + if ((!d)||(i<0)||(i>=d->nClear)) return; + d->nClear--; + XMLClear *p=d->pClear+i; + free((void*)p->lpszValue); + if (d->nClear) memmove(p,p+1,(d->nClear-i)*sizeof(XMLClear)); else { free(p); d->pClear=NULL; } + removeOrderElement(d,eNodeClear,i); +} + +int XMLNode::indexClear(XMLCSTR lpszValue) const +{ + if (!d) return -1; + int i,l=d->nClear; + if (!lpszValue) { if (l) return 0; return -1; } + XMLClear *p=d->pClear; + for (i=0; ilpszValue); } + +XMLClear *XMLNode::updateClear_WOSD(XMLSTR lpszNewContent, int i) +{ + if (!d) { if (lpszNewContent) free(lpszNewContent); return NULL; } + if (i>=d->nClear) return addClear_WOSD(lpszNewContent); + XMLClear *p=d->pClear+i; + if (lpszNewContent!=p->lpszValue) { free((void*)p->lpszValue); p->lpszValue=lpszNewContent; } + return p; +} + +XMLClear *XMLNode::updateClear_WOSD(XMLSTR lpszNewContent, XMLCSTR lpszOldValue) +{ + if (!d) { if (lpszNewContent) free(lpszNewContent); return NULL; } + int i=indexClear(lpszOldValue); + if (i>=0) return updateClear_WOSD(lpszNewContent,i); + return addClear_WOSD(lpszNewContent); +} + +XMLClear *XMLNode::updateClear_WOSD(XMLClear *newP,XMLClear *oldP) +{ + if (oldP) return updateClear_WOSD((XMLSTR)newP->lpszValue,(XMLSTR)oldP->lpszValue); + return NULL; +} + +int XMLNode::nChildNode(XMLCSTR name) const +{ + if (!d) return 0; + int i,j=0,n=d->nChild; + XMLNode *pc=d->pChild; + for (i=0; id->lpszName, name)==0) j++; + pc++; + } + return j; +} + +XMLNode XMLNode::getChildNode(XMLCSTR name, int *j) const +{ + if (!d) return emptyXMLNode; + int i=0,n=d->nChild; + if (j) i=*j; + XMLNode *pc=d->pChild+i; + for (; id->lpszName, name)) + { + if (j) *j=i+1; + return *pc; + } + pc++; + } + return emptyXMLNode; +} + +XMLNode XMLNode::getChildNode(XMLCSTR name, int j) const +{ + if (!d) return emptyXMLNode; + if (j>=0) + { + int i=0; + while (j-->0) getChildNode(name,&i); + return getChildNode(name,&i); + } + int i=d->nChild; + while (i--) if (!xstricmp(name,d->pChild[i].d->lpszName)) break; + if (i<0) return emptyXMLNode; + return getChildNode(i); +} + +XMLNode XMLNode::getChildNodeByPath(XMLCSTR _path, char createMissing, XMLCHAR sep) +{ + XMLSTR path=stringDup(_path); + XMLNode x=getChildNodeByPathNonConst(path,createMissing,sep); + if (path) free(path); + return x; +} + +XMLNode XMLNode::getChildNodeByPathNonConst(XMLSTR path, char createIfMissing, XMLCHAR sep) +{ + if ((!path)||(!(*path))) return *this; + XMLNode xn,xbase=*this; + XMLCHAR *tend1,sepString[2]; sepString[0]=sep; sepString[1]=0; + tend1=xstrstr(path,sepString); + while(tend1) + { + *tend1=0; + xn=xbase.getChildNode(path); + if (xn.isEmpty()) + { + if (createIfMissing) xn=xbase.addChild(path); + else { *tend1=sep; return XMLNode::emptyXMLNode; } + } + *tend1=sep; + xbase=xn; + path=tend1+1; + tend1=xstrstr(path,sepString); + } + xn=xbase.getChildNode(path); + if (xn.isEmpty()&&createIfMissing) xn=xbase.addChild(path); + return xn; +} + +XMLElementPosition XMLNode::positionOfText (int i) const { if (i>=d->nText ) i=d->nText-1; return findPosition(d,i,eNodeText ); } +XMLElementPosition XMLNode::positionOfClear (int i) const { if (i>=d->nClear) i=d->nClear-1; return findPosition(d,i,eNodeClear); } +XMLElementPosition XMLNode::positionOfChildNode(int i) const { if (i>=d->nChild) i=d->nChild-1; return findPosition(d,i,eNodeChild); } +XMLElementPosition XMLNode::positionOfText (XMLCSTR lpszValue) const { return positionOfText (indexText (lpszValue)); } +XMLElementPosition XMLNode::positionOfClear(XMLCSTR lpszValue) const { return positionOfClear(indexClear(lpszValue)); } +XMLElementPosition XMLNode::positionOfClear(XMLClear *a) const { if (a) return positionOfClear(a->lpszValue); return positionOfClear(); } +XMLElementPosition XMLNode::positionOfChildNode(XMLNode x) const +{ + if ((!d)||(!x.d)) return -1; + XMLNodeData *dd=x.d; + XMLNode *pc=d->pChild; + int i=d->nChild; + while (i--) if (pc[i].d==dd) return findPosition(d,i,eNodeChild); + return -1; +} +XMLElementPosition XMLNode::positionOfChildNode(XMLCSTR name, int count) const +{ + if (!name) return positionOfChildNode(count); + int j=0; + do { getChildNode(name,&j); if (j<0) return -1; } while (count--); + return findPosition(d,j-1,eNodeChild); +} + +XMLNode XMLNode::getChildNodeWithAttribute(XMLCSTR name,XMLCSTR attributeName,XMLCSTR attributeValue, int *k) const +{ + int i=0,j; + if (k) i=*k; + XMLNode x; + XMLCSTR t; + do + { + x=getChildNode(name,&i); + if (!x.isEmpty()) + { + if (attributeValue) + { + j=0; + do + { + t=x.getAttribute(attributeName,&j); + if (t&&(xstricmp(attributeValue,t)==0)) { if (k) *k=i; return x; } + } while (t); + } else + { + if (x.isAttributeSet(attributeName)) { if (k) *k=i; return x; } + } + } + } while (!x.isEmpty()); + return emptyXMLNode; +} + +// Find an attribute on an node. +XMLCSTR XMLNode::getAttribute(XMLCSTR lpszAttrib, int *j) const +{ + if (!d) return NULL; + int i=0,n=d->nAttribute; + if (j) i=*j; + XMLAttribute *pAttr=d->pAttribute+i; + for (; ilpszName, lpszAttrib)==0) + { + if (j) *j=i+1; + return pAttr->lpszValue; + } + pAttr++; + } + return NULL; +} + +char XMLNode::isAttributeSet(XMLCSTR lpszAttrib) const +{ + if (!d) return FALSE; + int i,n=d->nAttribute; + XMLAttribute *pAttr=d->pAttribute; + for (i=0; ilpszName, lpszAttrib)==0) + { + return TRUE; + } + pAttr++; + } + return FALSE; +} + +XMLCSTR XMLNode::getAttribute(XMLCSTR name, int j) const +{ + if (!d) return NULL; + int i=0; + while (j-->0) getAttribute(name,&i); + return getAttribute(name,&i); +} + +XMLNodeContents XMLNode::enumContents(int i) const +{ + XMLNodeContents c; + if (!d) { c.etype=eNodeNULL; return c; } + if (inAttribute) + { + c.etype=eNodeAttribute; + c.attrib=d->pAttribute[i]; + return c; + } + i-=d->nAttribute; + c.etype=(XMLElementType)(d->pOrder[i]&3); + i=(d->pOrder[i])>>2; + switch (c.etype) + { + case eNodeChild: c.child = d->pChild[i]; break; + case eNodeText: c.text = d->pText[i]; break; + case eNodeClear: c.clear = d->pClear[i]; break; + default: break; + } + return c; +} + +XMLCSTR XMLNode::getName() const { if (!d) return NULL; return d->lpszName; } +int XMLNode::nText() const { if (!d) return 0; return d->nText; } +int XMLNode::nChildNode() const { if (!d) return 0; return d->nChild; } +int XMLNode::nAttribute() const { if (!d) return 0; return d->nAttribute; } +int XMLNode::nClear() const { if (!d) return 0; return d->nClear; } +int XMLNode::nElement() const { if (!d) return 0; return d->nAttribute+d->nChild+d->nText+d->nClear; } +XMLClear XMLNode::getClear (int i) const { if ((!d)||(i>=d->nClear )) return emptyXMLClear; return d->pClear[i]; } +XMLAttribute XMLNode::getAttribute (int i) const { if ((!d)||(i>=d->nAttribute)) return emptyXMLAttribute; return d->pAttribute[i]; } +XMLCSTR XMLNode::getAttributeName (int i) const { if ((!d)||(i>=d->nAttribute)) return NULL; return d->pAttribute[i].lpszName; } +XMLCSTR XMLNode::getAttributeValue(int i) const { if ((!d)||(i>=d->nAttribute)) return NULL; return d->pAttribute[i].lpszValue; } +XMLCSTR XMLNode::getText (int i) const { if ((!d)||(i>=d->nText )) return NULL; return d->pText[i]; } +XMLNode XMLNode::getChildNode (int i) const { if ((!d)||(i>=d->nChild )) return emptyXMLNode; return d->pChild[i]; } +XMLNode XMLNode::getParentNode ( ) const { if ((!d)||(!d->pParent )) return emptyXMLNode; return XMLNode(d->pParent); } +char XMLNode::isDeclaration ( ) const { if (!d) return 0; return d->isDeclaration; } +char XMLNode::isEmpty ( ) const { return (d==NULL); } +XMLNode XMLNode::emptyNode ( ) { return XMLNode::emptyXMLNode; } + +XMLNode XMLNode::addChild(XMLCSTR lpszName, char isDeclaration, XMLElementPosition pos) + { return addChild_priv(0,stringDup(lpszName),isDeclaration,pos); } +XMLNode XMLNode::addChild_WOSD(XMLSTR lpszName, char isDeclaration, XMLElementPosition pos) + { return addChild_priv(0,lpszName,isDeclaration,pos); } +XMLAttribute *XMLNode::addAttribute(XMLCSTR lpszName, XMLCSTR lpszValue) + { return addAttribute_priv(0,stringDup(lpszName),stringDup(lpszValue)); } +XMLAttribute *XMLNode::addAttribute_WOSD(XMLSTR lpszName, XMLSTR lpszValuev) + { return addAttribute_priv(0,lpszName,lpszValuev); } +XMLCSTR XMLNode::addText(XMLCSTR lpszValue, XMLElementPosition pos) + { return addText_priv(0,stringDup(lpszValue),pos); } +XMLCSTR XMLNode::addText_WOSD(XMLSTR lpszValue, XMLElementPosition pos) + { return addText_priv(0,lpszValue,pos); } +XMLClear *XMLNode::addClear(XMLCSTR lpszValue, XMLCSTR lpszOpen, XMLCSTR lpszClose, XMLElementPosition pos) + { return addClear_priv(0,stringDup(lpszValue),lpszOpen,lpszClose,pos); } +XMLClear *XMLNode::addClear_WOSD(XMLSTR lpszValue, XMLCSTR lpszOpen, XMLCSTR lpszClose, XMLElementPosition pos) + { return addClear_priv(0,lpszValue,lpszOpen,lpszClose,pos); } +XMLCSTR XMLNode::updateName(XMLCSTR lpszName) + { return updateName_WOSD(stringDup(lpszName)); } +XMLAttribute *XMLNode::updateAttribute(XMLAttribute *newAttribute, XMLAttribute *oldAttribute) + { return updateAttribute_WOSD(stringDup(newAttribute->lpszValue),stringDup(newAttribute->lpszName),oldAttribute->lpszName); } +XMLAttribute *XMLNode::updateAttribute(XMLCSTR lpszNewValue, XMLCSTR lpszNewName,int i) + { return updateAttribute_WOSD(stringDup(lpszNewValue),stringDup(lpszNewName),i); } +XMLAttribute *XMLNode::updateAttribute(XMLCSTR lpszNewValue, XMLCSTR lpszNewName,XMLCSTR lpszOldName) + { return updateAttribute_WOSD(stringDup(lpszNewValue),stringDup(lpszNewName),lpszOldName); } +XMLCSTR XMLNode::updateText(XMLCSTR lpszNewValue, int i) + { return updateText_WOSD(stringDup(lpszNewValue),i); } +XMLCSTR XMLNode::updateText(XMLCSTR lpszNewValue, XMLCSTR lpszOldValue) + { return updateText_WOSD(stringDup(lpszNewValue),lpszOldValue); } +XMLClear *XMLNode::updateClear(XMLCSTR lpszNewContent, int i) + { return updateClear_WOSD(stringDup(lpszNewContent),i); } +XMLClear *XMLNode::updateClear(XMLCSTR lpszNewValue, XMLCSTR lpszOldValue) + { return updateClear_WOSD(stringDup(lpszNewValue),lpszOldValue); } +XMLClear *XMLNode::updateClear(XMLClear *newP,XMLClear *oldP) + { return updateClear_WOSD(stringDup(newP->lpszValue),oldP->lpszValue); } + +char XMLNode::setGlobalOptions(XMLCharEncoding _characterEncoding, char _guessWideCharChars, + char _dropWhiteSpace, char _removeCommentsInMiddleOfText) +{ + guessWideCharChars=_guessWideCharChars; dropWhiteSpace=_dropWhiteSpace; removeCommentsInMiddleOfText=_removeCommentsInMiddleOfText; +#ifdef _XMLWIDECHAR + if (_characterEncoding) characterEncoding=_characterEncoding; +#else + switch(_characterEncoding) + { + case char_encoding_UTF8: characterEncoding=_characterEncoding; XML_ByteTable=XML_utf8ByteTable; break; + case char_encoding_legacy: characterEncoding=_characterEncoding; XML_ByteTable=XML_legacyByteTable; break; + case char_encoding_ShiftJIS: characterEncoding=_characterEncoding; XML_ByteTable=XML_sjisByteTable; break; + case char_encoding_GB2312: characterEncoding=_characterEncoding; XML_ByteTable=XML_gb2312ByteTable; break; + case char_encoding_Big5: + case char_encoding_GBK: characterEncoding=_characterEncoding; XML_ByteTable=XML_gbk_big5_ByteTable; break; + default: return 1; + } +#endif + return 0; +} + +XMLNode::XMLCharEncoding XMLNode::guessCharEncoding(void *buf,int l, char useXMLEncodingAttribute) +{ +#ifdef _XMLWIDECHAR + return (XMLCharEncoding)0; +#else + if (l<25) return (XMLCharEncoding)0; + if (guessWideCharChars&&(myIsTextWideChar(buf,l))) return (XMLCharEncoding)0; + unsigned char *b=(unsigned char*)buf; + if ((b[0]==0xef)&&(b[1]==0xbb)&&(b[2]==0xbf)) return char_encoding_UTF8; + + // Match utf-8 model ? + XMLCharEncoding bestGuess=char_encoding_UTF8; + int i=0; + while (i>2 ]; + *(curr++)=base64EncodeTable[(inbuf[0]<<4)&0x3F]; + *(curr++)=base64Fillchar; + *(curr++)=base64Fillchar; + } else if (eLen==2) + { + j=(inbuf[0]<<8)|inbuf[1]; + *(curr++)=base64EncodeTable[ j>>10 ]; + *(curr++)=base64EncodeTable[(j>> 4)&0x3f]; + *(curr++)=base64EncodeTable[(j<< 2)&0x3f]; + *(curr++)=base64Fillchar; + } + *(curr++)=0; + return (XMLSTR)buf; +} + +unsigned int XMLParserBase64Tool::decodeSize(XMLCSTR data,XMLError *xe) +{ + if (!data) return 0; + if (xe) *xe=eXMLErrorNone; + int size=0; + unsigned char c; + //skip any extra characters (e.g. newlines or spaces) + while (*data) + { +#ifdef _XMLWIDECHAR + if (*data>255) { if (xe) *xe=eXMLErrorBase64DecodeIllegalCharacter; return 0; } +#endif + c=base64DecodeTable[(unsigned char)(*data)]; + if (c<97) size++; + else if (c==98) { if (xe) *xe=eXMLErrorBase64DecodeIllegalCharacter; return 0; } + data++; + } + if (xe&&(size%4!=0)) *xe=eXMLErrorBase64DataSizeIsNotMultipleOf4; + if (size==0) return 0; + do { data--; size--; } while(*data==base64Fillchar); size++; + return (unsigned int)((size*3)/4); +} + +unsigned char XMLParserBase64Tool::decode(XMLCSTR data, unsigned char *buf, int len, XMLError *xe) +{ + if (!data) return 0; + if (xe) *xe=eXMLErrorNone; + int i=0,p=0; + unsigned char d,c; + for(;;) + { + +#ifdef _XMLWIDECHAR +#define BASE64DECODE_READ_NEXT_CHAR(c) \ + do { \ + if (data[i]>255){ c=98; break; } \ + c=base64DecodeTable[(unsigned char)data[i++]]; \ + }while (c==97); \ + if(c==98){ if(xe)*xe=eXMLErrorBase64DecodeIllegalCharacter; return 0; } +#else +#define BASE64DECODE_READ_NEXT_CHAR(c) \ + do { c=base64DecodeTable[(unsigned char)data[i++]]; }while (c==97); \ + if(c==98){ if(xe)*xe=eXMLErrorBase64DecodeIllegalCharacter; return 0; } +#endif + + BASE64DECODE_READ_NEXT_CHAR(c) + if (c==99) { return 2; } + if (c==96) + { + if (p==(int)len) return 2; + if (xe) *xe=eXMLErrorBase64DecodeTruncatedData; + return 1; + } + + BASE64DECODE_READ_NEXT_CHAR(d) + if ((d==99)||(d==96)) { if (xe) *xe=eXMLErrorBase64DecodeTruncatedData; return 1; } + if (p==(int)len) { if (xe) *xe=eXMLErrorBase64DecodeBufferTooSmall; return 0; } + buf[p++]=(unsigned char)((c<<2)|((d>>4)&0x3)); + + BASE64DECODE_READ_NEXT_CHAR(c) + if (c==99) { if (xe) *xe=eXMLErrorBase64DecodeTruncatedData; return 1; } + if (p==(int)len) + { + if (c==96) return 2; + if (xe) *xe=eXMLErrorBase64DecodeBufferTooSmall; + return 0; + } + if (c==96) { if (xe) *xe=eXMLErrorBase64DecodeTruncatedData; return 1; } + buf[p++]=(unsigned char)(((d<<4)&0xf0)|((c>>2)&0xf)); + + BASE64DECODE_READ_NEXT_CHAR(d) + if (d==99 ) { if (xe) *xe=eXMLErrorBase64DecodeTruncatedData; return 1; } + if (p==(int)len) + { + if (d==96) return 2; + if (xe) *xe=eXMLErrorBase64DecodeBufferTooSmall; + return 0; + } + if (d==96) { if (xe) *xe=eXMLErrorBase64DecodeTruncatedData; return 1; } + buf[p++]=(unsigned char)(((c<<6)&0xc0)|d); + } +} +#undef BASE64DECODE_READ_NEXT_CHAR + +void XMLParserBase64Tool::alloc(int newsize) +{ + if ((!buf)&&(newsize)) { buf=malloc(newsize); buflen=newsize; return; } + if (newsize>buflen) { buf=realloc(buf,newsize); buflen=newsize; } +} + +unsigned char *XMLParserBase64Tool::decode(XMLCSTR data, int *outlen, XMLError *xe) +{ + if (xe) *xe=eXMLErrorNone; + if (!data) { *outlen=0; return (unsigned char*)""; } + unsigned int len=decodeSize(data,xe); + if (outlen) *outlen=len; + if (!len) return NULL; + alloc(len+1); + if(!decode(data,(unsigned char*)buf,len,xe)){ return NULL; } + return (unsigned char*)buf; +} + diff --git a/packages/CLPBN/clpbn/bp/xmlParser/xmlParser.h b/packages/CLPBN/clpbn/bp/xmlParser/xmlParser.h new file mode 100644 index 000000000..49c7ce9cc --- /dev/null +++ b/packages/CLPBN/clpbn/bp/xmlParser/xmlParser.h @@ -0,0 +1,734 @@ + +/****************************************************************************/ +/*! \mainpage XMLParser library + * \section intro_sec Introduction + * + * This is a basic XML parser written in ANSI C++ for portability. + * It works by using recursion and a node tree for breaking + * down the elements of an XML document. + * + * @version V2.42 + * @author Frank Vanden Berghen + * + * Copyright (c) 2002, Business-Insight + * Business-Insight + * All rights reserved. + * See the file AFPL-license.txt about the licensing terms + * + * \section tutorial First Tutorial + * You can follow a simple Tutorial to know the basics... + * + * \section usage General usage: How to include the XMLParser library inside your project. + * + * The library is composed of two files: xmlParser.cpp and + * xmlParser.h. These are the ONLY 2 files that you need when + * using the library inside your own projects. + * + * All the functions of the library are documented inside the comments of the file + * xmlParser.h. These comments can be transformed in + * full-fledged HTML documentation using the DOXYGEN software: simply type: "doxygen doxy.cfg" + * + * By default, the XMLParser library uses (char*) for string representation.To use the (wchar_t*) + * version of the library, you need to define the "_UNICODE" preprocessor definition variable + * (this is usually done inside your project definition file) (This is done automatically for you + * when using Visual Studio). + * + * \section example Advanced Tutorial and Many Examples of usage. + * + * Some very small introductory examples are described inside the Tutorial file + * xmlParser.html + * + * Some additional small examples are also inside the file xmlTest.cpp + * (for the "char*" version of the library) and inside the file + * xmlTestUnicode.cpp (for the "wchar_t*" + * version of the library). If you have a question, please review these additionnal examples + * before sending an e-mail to the author. + * + * To build the examples: + * - linux/unix: type "make" + * - solaris: type "make -f makefile.solaris" + * - windows: Visual Studio: double-click on xmlParser.dsw + * (under Visual Studio .NET, the .dsp and .dsw files will be automatically converted to .vcproj and .sln files) + * + * In order to build the examples you need some additional files: + * - linux/unix: makefile + * - solaris: makefile.solaris + * - windows: Visual Studio: *.dsp, xmlParser.dsw and also xmlParser.lib and xmlParser.dll + * + * \section debugging Debugging with the XMLParser library + * + * \subsection debugwin Debugging under WINDOWS + * + * Inside Visual C++, the "debug versions" of the memory allocation functions are + * very slow: Do not forget to compile in "release mode" to get maximum speed. + * When I had to debug a software that was using the XMLParser Library, it was usually + * a nightmare because the library was sooOOOoooo slow in debug mode (because of the + * slow memory allocations in Debug mode). To solve this + * problem, during all the debugging session, I am now using a very fast DLL version of the + * XMLParser Library (the DLL is compiled in release mode). Using the DLL version of + * the XMLParser Library allows me to have lightening XML parsing speed even in debug! + * Other than that, the DLL version is useless: In the release version of my tool, + * I always use the normal, ".cpp"-based, XMLParser Library (I simply include the + * xmlParser.cpp and + * xmlParser.h files into the project). + * + * The file XMLNodeAutoexp.txt contains some + * "tweaks" that improve substancially the display of the content of the XMLNode objects + * inside the Visual Studio Debugger. Believe me, once you have seen inside the debugger + * the "smooth" display of the XMLNode objects, you cannot live without it anymore! + * + * \subsection debuglinux Debugging under LINUX/UNIX + * + * The speed of the debug version of the XMLParser library is tolerable so no extra + * work.has been done. + * + ****************************************************************************/ + +#ifndef __INCLUDE_XML_NODE__ +#define __INCLUDE_XML_NODE__ + +#include + +#ifdef _UNICODE +// If you comment the next "define" line then the library will never "switch to" _UNICODE (wchar_t*) mode (16/32 bits per characters). +// This is useful when you get error messages like: +// 'XMLNode::openFileHelper' : cannot convert parameter 2 from 'const char [5]' to 'const wchar_t *' +// The _XMLWIDECHAR preprocessor variable force the XMLParser library into either utf16/32-mode (the proprocessor variable +// must be defined) or utf8-mode(the pre-processor variable must be undefined). +#define _XMLWIDECHAR +#endif + +#if defined(WIN32) || defined(UNDER_CE) || defined(_WIN32) || defined(WIN64) || defined(__BORLANDC__) +// comment the next line if you are under windows and the compiler is not Microsoft Visual Studio (6.0 or .NET) or Borland +#define _XMLWINDOWS +#endif + +#ifdef XMLDLLENTRY +#undef XMLDLLENTRY +#endif +#ifdef _USE_XMLPARSER_DLL +#ifdef _DLL_EXPORTS_ +#define XMLDLLENTRY __declspec(dllexport) +#else +#define XMLDLLENTRY __declspec(dllimport) +#endif +#else +#define XMLDLLENTRY +#endif + +// uncomment the next line if you want no support for wchar_t* (no need for the or libraries anymore to compile) +//#define XML_NO_WIDE_CHAR + +#ifdef XML_NO_WIDE_CHAR +#undef _XMLWINDOWS +#undef _XMLWIDECHAR +#endif + +#ifdef _XMLWINDOWS +#include +#else +#define XMLDLLENTRY +#ifndef XML_NO_WIDE_CHAR +#include // to have 'wcsrtombs' for ANSI version + // to have 'mbsrtowcs' for WIDECHAR version +#endif +#endif + +// Some common types for char set portable code +#ifdef _XMLWIDECHAR + #define _CXML(c) L ## c + #define XMLCSTR const wchar_t * + #define XMLSTR wchar_t * + #define XMLCHAR wchar_t +#else + #define _CXML(c) c + #define XMLCSTR const char * + #define XMLSTR char * + #define XMLCHAR char +#endif +#ifndef FALSE + #define FALSE 0 +#endif /* FALSE */ +#ifndef TRUE + #define TRUE 1 +#endif /* TRUE */ + + +/// Enumeration for XML parse errors. +typedef enum XMLError +{ + eXMLErrorNone = 0, + eXMLErrorMissingEndTag, + eXMLErrorNoXMLTagFound, + eXMLErrorEmpty, + eXMLErrorMissingTagName, + eXMLErrorMissingEndTagName, + eXMLErrorUnmatchedEndTag, + eXMLErrorUnmatchedEndClearTag, + eXMLErrorUnexpectedToken, + eXMLErrorNoElements, + eXMLErrorFileNotFound, + eXMLErrorFirstTagNotFound, + eXMLErrorUnknownCharacterEntity, + eXMLErrorCharacterCodeAbove255, + eXMLErrorCharConversionError, + eXMLErrorCannotOpenWriteFile, + eXMLErrorCannotWriteFile, + + eXMLErrorBase64DataSizeIsNotMultipleOf4, + eXMLErrorBase64DecodeIllegalCharacter, + eXMLErrorBase64DecodeTruncatedData, + eXMLErrorBase64DecodeBufferTooSmall +} XMLError; + + +/// Enumeration used to manage type of data. Use in conjunction with structure XMLNodeContents +typedef enum XMLElementType +{ + eNodeChild=0, + eNodeAttribute=1, + eNodeText=2, + eNodeClear=3, + eNodeNULL=4 +} XMLElementType; + +/// Structure used to obtain error details if the parse fails. +typedef struct XMLResults +{ + enum XMLError error; + int nLine,nColumn; +} XMLResults; + +/// Structure for XML clear (unformatted) node (usually comments) +typedef struct XMLClear { + XMLCSTR lpszValue; XMLCSTR lpszOpenTag; XMLCSTR lpszCloseTag; +} XMLClear; + +/// Structure for XML attribute. +typedef struct XMLAttribute { + XMLCSTR lpszName; XMLCSTR lpszValue; +} XMLAttribute; + +/// XMLElementPosition are not interchangeable with simple indexes +typedef int XMLElementPosition; + +struct XMLNodeContents; + +/** @defgroup XMLParserGeneral The XML parser */ + +/// Main Class representing a XML node +/** + * All operations are performed using this class. + * \note The constructors of the XMLNode class are protected, so use instead one of these four methods to get your first instance of XMLNode: + *
    + *
  • XMLNode::parseString
  • + *
  • XMLNode::parseFile
  • + *
  • XMLNode::openFileHelper
  • + *
  • XMLNode::createXMLTopNode (or XMLNode::createXMLTopNode_WOSD)
  • + *
*/ +typedef struct XMLDLLENTRY XMLNode +{ + private: + + struct XMLNodeDataTag; + + /// Constructors are protected, so use instead one of: XMLNode::parseString, XMLNode::parseFile, XMLNode::openFileHelper, XMLNode::createXMLTopNode + XMLNode(struct XMLNodeDataTag *pParent, XMLSTR lpszName, char isDeclaration); + /// Constructors are protected, so use instead one of: XMLNode::parseString, XMLNode::parseFile, XMLNode::openFileHelper, XMLNode::createXMLTopNode + XMLNode(struct XMLNodeDataTag *p); + + public: + static XMLCSTR getVersion();///< Return the XMLParser library version number + + /** @defgroup conversions Parsing XML files/strings to an XMLNode structure and Rendering XMLNode's to files/string. + * @ingroup XMLParserGeneral + * @{ */ + + /// Parse an XML string and return the root of a XMLNode tree representing the string. + static XMLNode parseString (XMLCSTR lpXMLString, XMLCSTR tag=NULL, XMLResults *pResults=NULL); + /**< The "parseString" function parse an XML string and return the root of a XMLNode tree. The "opposite" of this function is + * the function "createXMLString" that re-creates an XML string from an XMLNode tree. If the XML document is corrupted, the + * "parseString" method will initialize the "pResults" variable with some information that can be used to trace the error. + * If you still want to parse the file, you can use the APPROXIMATE_PARSING option as explained inside the note at the + * beginning of the "xmlParser.cpp" file. + * + * @param lpXMLString the XML string to parse + * @param tag the name of the first tag inside the XML file. If the tag parameter is omitted, this function returns a node that represents the head of the xml document including the declaration term (). + * @param pResults a pointer to a XMLResults variable that will contain some information that can be used to trace the XML parsing error. You can have a user-friendly explanation of the parsing error with the "getError" function. + */ + + /// Parse an XML file and return the root of a XMLNode tree representing the file. + static XMLNode parseFile (XMLCSTR filename, XMLCSTR tag=NULL, XMLResults *pResults=NULL); + /**< The "parseFile" function parse an XML file and return the root of a XMLNode tree. The "opposite" of this function is + * the function "writeToFile" that re-creates an XML file from an XMLNode tree. If the XML document is corrupted, the + * "parseFile" method will initialize the "pResults" variable with some information that can be used to trace the error. + * If you still want to parse the file, you can use the APPROXIMATE_PARSING option as explained inside the note at the + * beginning of the "xmlParser.cpp" file. + * + * @param filename the path to the XML file to parse + * @param tag the name of the first tag inside the XML file. If the tag parameter is omitted, this function returns a node that represents the head of the xml document including the declaration term (). + * @param pResults a pointer to a XMLResults variable that will contain some information that can be used to trace the XML parsing error. You can have a user-friendly explanation of the parsing error with the "getError" function. + */ + + /// Parse an XML file and return the root of a XMLNode tree representing the file. A very crude error checking is made. An attempt to guess the Char Encoding used in the file is made. + static XMLNode openFileHelper(XMLCSTR filename, XMLCSTR tag=NULL); + /**< The "openFileHelper" function reports to the screen all the warnings and errors that occurred during parsing of the XML file. + * This function also tries to guess char Encoding (UTF-8, ASCII or SHIT-JIS) based on the first 200 bytes of the file. Since each + * application has its own way to report and deal with errors, you should rather use the "parseFile" function to parse XML files + * and program yourself thereafter an "error reporting" tailored for your needs (instead of using the very crude "error reporting" + * mechanism included inside the "openFileHelper" function). + * + * If the XML document is corrupted, the "openFileHelper" method will: + * - display an error message on the console (or inside a messageBox for windows). + * - stop execution (exit). + * + * I strongly suggest that you write your own "openFileHelper" method tailored to your needs. If you still want to parse + * the file, you can use the APPROXIMATE_PARSING option as explained inside the note at the beginning of the "xmlParser.cpp" file. + * + * @param filename the path of the XML file to parse. + * @param tag the name of the first tag inside the XML file. If the tag parameter is omitted, this function returns a node that represents the head of the xml document including the declaration term (). + */ + + static XMLCSTR getError(XMLError error); ///< this gives you a user-friendly explanation of the parsing error + + /// Create an XML string starting from the current XMLNode. + XMLSTR createXMLString(int nFormat=1, int *pnSize=NULL) const; + /**< The returned string should be free'd using the "freeXMLString" function. + * + * If nFormat==0, no formatting is required otherwise this returns an user friendly XML string from a given element + * with appropriate white spaces and carriage returns. if pnSize is given it returns the size in character of the string. */ + + /// Save the content of an xmlNode inside a file + XMLError writeToFile(XMLCSTR filename, + const char *encoding=NULL, + char nFormat=1) const; + /**< If nFormat==0, no formatting is required otherwise this returns an user friendly XML string from a given element with appropriate white spaces and carriage returns. + * If the global parameter "characterEncoding==encoding_UTF8", then the "encoding" parameter is ignored and always set to "utf-8". + * If the global parameter "characterEncoding==encoding_ShiftJIS", then the "encoding" parameter is ignored and always set to "SHIFT-JIS". + * If "_XMLWIDECHAR=1", then the "encoding" parameter is ignored and always set to "utf-16". + * If no "encoding" parameter is given the "ISO-8859-1" encoding is used. */ + /** @} */ + + /** @defgroup navigate Navigate the XMLNode structure + * @ingroup XMLParserGeneral + * @{ */ + XMLCSTR getName() const; ///< name of the node + XMLCSTR getText(int i=0) const; ///< return ith text field + int nText() const; ///< nbr of text field + XMLNode getParentNode() const; ///< return the parent node + XMLNode getChildNode(int i=0) const; ///< return ith child node + XMLNode getChildNode(XMLCSTR name, int i) const; ///< return ith child node with specific name (return an empty node if failing). If i==-1, this returns the last XMLNode with the given name. + XMLNode getChildNode(XMLCSTR name, int *i=NULL) const; ///< return next child node with specific name (return an empty node if failing) + XMLNode getChildNodeWithAttribute(XMLCSTR tagName, + XMLCSTR attributeName, + XMLCSTR attributeValue=NULL, + int *i=NULL) const; ///< return child node with specific name/attribute (return an empty node if failing) + XMLNode getChildNodeByPath(XMLCSTR path, char createNodeIfMissing=0, XMLCHAR sep='/'); + ///< return the first child node with specific path + XMLNode getChildNodeByPathNonConst(XMLSTR path, char createNodeIfMissing=0, XMLCHAR sep='/'); + ///< return the first child node with specific path. + + int nChildNode(XMLCSTR name) const; ///< return the number of child node with specific name + int nChildNode() const; ///< nbr of child node + XMLAttribute getAttribute(int i=0) const; ///< return ith attribute + XMLCSTR getAttributeName(int i=0) const; ///< return ith attribute name + XMLCSTR getAttributeValue(int i=0) const; ///< return ith attribute value + char isAttributeSet(XMLCSTR name) const; ///< test if an attribute with a specific name is given + XMLCSTR getAttribute(XMLCSTR name, int i) const; ///< return ith attribute content with specific name (return a NULL if failing) + XMLCSTR getAttribute(XMLCSTR name, int *i=NULL) const; ///< return next attribute content with specific name (return a NULL if failing) + int nAttribute() const; ///< nbr of attribute + XMLClear getClear(int i=0) const; ///< return ith clear field (comments) + int nClear() const; ///< nbr of clear field + XMLNodeContents enumContents(XMLElementPosition i) const; ///< enumerate all the different contents (attribute,child,text, clear) of the current XMLNode. The order is reflecting the order of the original file/string. NOTE: 0 <= i < nElement(); + int nElement() const; ///< nbr of different contents for current node + char isEmpty() const; ///< is this node Empty? + char isDeclaration() const; ///< is this node a declaration + XMLNode deepCopy() const; ///< deep copy (duplicate/clone) a XMLNode + static XMLNode emptyNode(); ///< return XMLNode::emptyXMLNode; + /** @} */ + + ~XMLNode(); + XMLNode(const XMLNode &A); ///< to allow shallow/fast copy: + XMLNode& operator=( const XMLNode& A ); ///< to allow shallow/fast copy: + + XMLNode(): d(NULL){}; + static XMLNode emptyXMLNode; + static XMLClear emptyXMLClear; + static XMLAttribute emptyXMLAttribute; + + /** @defgroup xmlModify Create or Update the XMLNode structure + * @ingroup XMLParserGeneral + * The functions in this group allows you to create from scratch (or update) a XMLNode structure. Start by creating your top + * node with the "createXMLTopNode" function and then add new nodes with the "addChild" function. The parameter 'pos' gives + * the position where the childNode, the text or the XMLClearTag will be inserted. The default value (pos=-1) inserts at the + * end. The value (pos=0) insert at the beginning (Insertion at the beginning is slower than at the end).
+ * + * REMARK: 0 <= pos < nChild()+nText()+nClear()
+ */ + + /** @defgroup creation Creating from scratch a XMLNode structure + * @ingroup xmlModify + * @{ */ + static XMLNode createXMLTopNode(XMLCSTR lpszName, char isDeclaration=FALSE); ///< Create the top node of an XMLNode structure + XMLNode addChild(XMLCSTR lpszName, char isDeclaration=FALSE, XMLElementPosition pos=-1); ///< Add a new child node + XMLNode addChild(XMLNode nodeToAdd, XMLElementPosition pos=-1); ///< If the "nodeToAdd" has some parents, it will be detached from it's parents before being attached to the current XMLNode + XMLAttribute *addAttribute(XMLCSTR lpszName, XMLCSTR lpszValuev); ///< Add a new attribute + XMLCSTR addText(XMLCSTR lpszValue, XMLElementPosition pos=-1); ///< Add a new text content + XMLClear *addClear(XMLCSTR lpszValue, XMLCSTR lpszOpen=NULL, XMLCSTR lpszClose=NULL, XMLElementPosition pos=-1); + /**< Add a new clear tag + * @param lpszOpen default value "" + */ + /** @} */ + + /** @defgroup xmlUpdate Updating Nodes + * @ingroup xmlModify + * Some update functions: + * @{ + */ + XMLCSTR updateName(XMLCSTR lpszName); ///< change node's name + XMLAttribute *updateAttribute(XMLAttribute *newAttribute, XMLAttribute *oldAttribute); ///< if the attribute to update is missing, a new one will be added + XMLAttribute *updateAttribute(XMLCSTR lpszNewValue, XMLCSTR lpszNewName=NULL,int i=0); ///< if the attribute to update is missing, a new one will be added + XMLAttribute *updateAttribute(XMLCSTR lpszNewValue, XMLCSTR lpszNewName,XMLCSTR lpszOldName);///< set lpszNewName=NULL if you don't want to change the name of the attribute if the attribute to update is missing, a new one will be added + XMLCSTR updateText(XMLCSTR lpszNewValue, int i=0); ///< if the text to update is missing, a new one will be added + XMLCSTR updateText(XMLCSTR lpszNewValue, XMLCSTR lpszOldValue); ///< if the text to update is missing, a new one will be added + XMLClear *updateClear(XMLCSTR lpszNewContent, int i=0); ///< if the clearTag to update is missing, a new one will be added + XMLClear *updateClear(XMLClear *newP,XMLClear *oldP); ///< if the clearTag to update is missing, a new one will be added + XMLClear *updateClear(XMLCSTR lpszNewValue, XMLCSTR lpszOldValue); ///< if the clearTag to update is missing, a new one will be added + /** @} */ + + /** @defgroup xmlDelete Deleting Nodes or Attributes + * @ingroup xmlModify + * Some deletion functions: + * @{ + */ + /// The "deleteNodeContent" function forces the deletion of the content of this XMLNode and the subtree. + void deleteNodeContent(); + /**< \note The XMLNode instances that are referring to the part of the subtree that has been deleted CANNOT be used anymore!!. Unexpected results will occur if you continue using them. */ + void deleteAttribute(int i=0); ///< Delete the ith attribute of the current XMLNode + void deleteAttribute(XMLCSTR lpszName); ///< Delete the attribute with the given name (the "strcmp" function is used to find the right attribute) + void deleteAttribute(XMLAttribute *anAttribute); ///< Delete the attribute with the name "anAttribute->lpszName" (the "strcmp" function is used to find the right attribute) + void deleteText(int i=0); ///< Delete the Ith text content of the current XMLNode + void deleteText(XMLCSTR lpszValue); ///< Delete the text content "lpszValue" inside the current XMLNode (direct "pointer-to-pointer" comparison is used to find the right text) + void deleteClear(int i=0); ///< Delete the Ith clear tag inside the current XMLNode + void deleteClear(XMLCSTR lpszValue); ///< Delete the clear tag "lpszValue" inside the current XMLNode (direct "pointer-to-pointer" comparison is used to find the clear tag) + void deleteClear(XMLClear *p); ///< Delete the clear tag "p" inside the current XMLNode (direct "pointer-to-pointer" comparison on the lpszName of the clear tag is used to find the clear tag) + /** @} */ + + /** @defgroup xmlWOSD ???_WOSD functions. + * @ingroup xmlModify + * The strings given as parameters for the "add" and "update" methods that have a name with + * the postfix "_WOSD" (that means "WithOut String Duplication")(for example "addText_WOSD") + * will be free'd by the XMLNode class. For example, it means that this is incorrect: + * \code + * xNode.addText_WOSD("foo"); + * xNode.updateAttribute_WOSD("#newcolor" ,NULL,"color"); + * \endcode + * In opposition, this is correct: + * \code + * xNode.addText("foo"); + * xNode.addText_WOSD(stringDup("foo")); + * xNode.updateAttribute("#newcolor" ,NULL,"color"); + * xNode.updateAttribute_WOSD(stringDup("#newcolor"),NULL,"color"); + * \endcode + * Typically, you will never do: + * \code + * char *b=(char*)malloc(...); + * xNode.addText(b); + * free(b); + * \endcode + * ... but rather: + * \code + * char *b=(char*)malloc(...); + * xNode.addText_WOSD(b); + * \endcode + * ('free(b)' is performed by the XMLNode class) + * @{ */ + static XMLNode createXMLTopNode_WOSD(XMLSTR lpszName, char isDeclaration=FALSE); ///< Create the top node of an XMLNode structure + XMLNode addChild_WOSD(XMLSTR lpszName, char isDeclaration=FALSE, XMLElementPosition pos=-1); ///< Add a new child node + XMLAttribute *addAttribute_WOSD(XMLSTR lpszName, XMLSTR lpszValue); ///< Add a new attribute + XMLCSTR addText_WOSD(XMLSTR lpszValue, XMLElementPosition pos=-1); ///< Add a new text content + XMLClear *addClear_WOSD(XMLSTR lpszValue, XMLCSTR lpszOpen=NULL, XMLCSTR lpszClose=NULL, XMLElementPosition pos=-1); ///< Add a new clear Tag + + XMLCSTR updateName_WOSD(XMLSTR lpszName); ///< change node's name + XMLAttribute *updateAttribute_WOSD(XMLAttribute *newAttribute, XMLAttribute *oldAttribute); ///< if the attribute to update is missing, a new one will be added + XMLAttribute *updateAttribute_WOSD(XMLSTR lpszNewValue, XMLSTR lpszNewName=NULL,int i=0); ///< if the attribute to update is missing, a new one will be added + XMLAttribute *updateAttribute_WOSD(XMLSTR lpszNewValue, XMLSTR lpszNewName,XMLCSTR lpszOldName); ///< set lpszNewName=NULL if you don't want to change the name of the attribute if the attribute to update is missing, a new one will be added + XMLCSTR updateText_WOSD(XMLSTR lpszNewValue, int i=0); ///< if the text to update is missing, a new one will be added + XMLCSTR updateText_WOSD(XMLSTR lpszNewValue, XMLCSTR lpszOldValue); ///< if the text to update is missing, a new one will be added + XMLClear *updateClear_WOSD(XMLSTR lpszNewContent, int i=0); ///< if the clearTag to update is missing, a new one will be added + XMLClear *updateClear_WOSD(XMLClear *newP,XMLClear *oldP); ///< if the clearTag to update is missing, a new one will be added + XMLClear *updateClear_WOSD(XMLSTR lpszNewValue, XMLCSTR lpszOldValue); ///< if the clearTag to update is missing, a new one will be added + /** @} */ + + /** @defgroup xmlPosition Position helper functions (use in conjunction with the update&add functions + * @ingroup xmlModify + * These are some useful functions when you want to insert a childNode, a text or a XMLClearTag in the + * middle (at a specified position) of a XMLNode tree already constructed. The value returned by these + * methods is to be used as last parameter (parameter 'pos') of addChild, addText or addClear. + * @{ */ + XMLElementPosition positionOfText(int i=0) const; + XMLElementPosition positionOfText(XMLCSTR lpszValue) const; + XMLElementPosition positionOfClear(int i=0) const; + XMLElementPosition positionOfClear(XMLCSTR lpszValue) const; + XMLElementPosition positionOfClear(XMLClear *a) const; + XMLElementPosition positionOfChildNode(int i=0) const; + XMLElementPosition positionOfChildNode(XMLNode x) const; + XMLElementPosition positionOfChildNode(XMLCSTR name, int i=0) const; ///< return the position of the ith childNode with the specified name if (name==NULL) return the position of the ith childNode + /** @} */ + + /// Enumeration for XML character encoding. + typedef enum XMLCharEncoding + { + char_encoding_error=0, + char_encoding_UTF8=1, + char_encoding_legacy=2, + char_encoding_ShiftJIS=3, + char_encoding_GB2312=4, + char_encoding_Big5=5, + char_encoding_GBK=6 // this is actually the same as Big5 + } XMLCharEncoding; + + /** \addtogroup conversions + * @{ */ + + /// Sets the global options for the conversions + static char setGlobalOptions(XMLCharEncoding characterEncoding=XMLNode::char_encoding_UTF8, char guessWideCharChars=1, + char dropWhiteSpace=1, char removeCommentsInMiddleOfText=1); + /**< The "setGlobalOptions" function allows you to change four global parameters that affect string & file + * parsing. First of all, you most-probably will never have to change these 3 global parameters. + * + * @param guessWideCharChars If "guessWideCharChars"=1 and if this library is compiled in WideChar mode, then the + * XMLNode::parseFile and XMLNode::openFileHelper functions will test if the file contains ASCII + * characters. If this is the case, then the file will be loaded and converted in memory to + * WideChar before being parsed. If 0, no conversion will be performed. + * + * @param guessWideCharChars If "guessWideCharChars"=1 and if this library is compiled in ASCII/UTF8/char* mode, then the + * XMLNode::parseFile and XMLNode::openFileHelper functions will test if the file contains WideChar + * characters. If this is the case, then the file will be loaded and converted in memory to + * ASCII/UTF8/char* before being parsed. If 0, no conversion will be performed. + * + * @param characterEncoding This parameter is only meaningful when compiling in char* mode (multibyte character mode). + * In wchar_t* (wide char mode), this parameter is ignored. This parameter should be one of the + * three currently recognized encodings: XMLNode::encoding_UTF8, XMLNode::encoding_ascii, + * XMLNode::encoding_ShiftJIS. + * + * @param dropWhiteSpace In most situations, text fields containing only white spaces (and carriage returns) + * are useless. Even more, these "empty" text fields are annoying because they increase the + * complexity of the user's code for parsing. So, 99% of the time, it's better to drop + * the "empty" text fields. However The XML specification indicates that no white spaces + * should be lost when parsing the file. So to be perfectly XML-compliant, you should set + * dropWhiteSpace=0. A note of caution: if you set "dropWhiteSpace=0", the parser will be + * slower and your code will be more complex. + * + * @param removeCommentsInMiddleOfText To explain this parameter, let's consider this code: + * \code + * XMLNode x=XMLNode::parseString("foobarchu","a"); + * \endcode + * If removeCommentsInMiddleOfText=0, then we will have: + * \code + * x.getText(0) -> "foo" + * x.getText(1) -> "bar" + * x.getText(2) -> "chu" + * x.getClear(0) --> "" + * x.getClear(1) --> "" + * \endcode + * If removeCommentsInMiddleOfText=1, then we will have: + * \code + * x.getText(0) -> "foobar" + * x.getText(1) -> "chu" + * x.getClear(0) --> "" + * \endcode + * + * \return "0" when there are no errors. If you try to set an unrecognized encoding then the return value will be "1" to signal an error. + * + * \note Sometime, it's useful to set "guessWideCharChars=0" to disable any conversion + * because the test to detect the file-type (ASCII/UTF8/char* or WideChar) may fail (rarely). */ + + /// Guess the character encoding of the string (ascii, utf8 or shift-JIS) + static XMLCharEncoding guessCharEncoding(void *buffer, int bufLen, char useXMLEncodingAttribute=1); + /**< The "guessCharEncoding" function try to guess the character encoding. You most-probably will never + * have to use this function. It then returns the appropriate value of the global parameter + * "characterEncoding" described in the XMLNode::setGlobalOptions. The guess is based on the content of a buffer of length + * "bufLen" bytes that contains the first bytes (minimum 25 bytes; 200 bytes is a good value) of the + * file to be parsed. The XMLNode::openFileHelper function is using this function to automatically compute + * the value of the "characterEncoding" global parameter. There are several heuristics used to do the + * guess. One of the heuristic is based on the "encoding" attribute. The original XML specifications + * forbids to use this attribute to do the guess but you can still use it if you set + * "useXMLEncodingAttribute" to 1 (this is the default behavior and the behavior of most parsers). + * If an inconsistency in the encoding is detected, then the return value is "0". */ + /** @} */ + + private: + // these are functions and structures used internally by the XMLNode class (don't bother about them): + + typedef struct XMLNodeDataTag // to allow shallow copy and "intelligent/smart" pointers (automatic delete): + { + XMLCSTR lpszName; // Element name (=NULL if root) + int nChild, // Number of child nodes + nText, // Number of text fields + nClear, // Number of Clear fields (comments) + nAttribute; // Number of attributes + char isDeclaration; // Whether node is an XML declaration - '' + struct XMLNodeDataTag *pParent; // Pointer to parent element (=NULL if root) + XMLNode *pChild; // Array of child nodes + XMLCSTR *pText; // Array of text fields + XMLClear *pClear; // Array of clear fields + XMLAttribute *pAttribute; // Array of attributes + int *pOrder; // order of the child_nodes,text_fields,clear_fields + int ref_count; // for garbage collection (smart pointers) + } XMLNodeData; + XMLNodeData *d; + + char parseClearTag(void *px, void *pa); + char maybeAddTxT(void *pa, XMLCSTR tokenPStr); + int ParseXMLElement(void *pXML); + void *addToOrder(int memInc, int *_pos, int nc, void *p, int size, XMLElementType xtype); + int indexText(XMLCSTR lpszValue) const; + int indexClear(XMLCSTR lpszValue) const; + XMLNode addChild_priv(int,XMLSTR,char,int); + XMLAttribute *addAttribute_priv(int,XMLSTR,XMLSTR); + XMLCSTR addText_priv(int,XMLSTR,int); + XMLClear *addClear_priv(int,XMLSTR,XMLCSTR,XMLCSTR,int); + void emptyTheNode(char force); + static inline XMLElementPosition findPosition(XMLNodeData *d, int index, XMLElementType xtype); + static int CreateXMLStringR(XMLNodeData *pEntry, XMLSTR lpszMarker, int nFormat); + static int removeOrderElement(XMLNodeData *d, XMLElementType t, int index); + static void exactMemory(XMLNodeData *d); + static int detachFromParent(XMLNodeData *d); +} XMLNode; + +/// This structure is given by the function XMLNode::enumContents. +typedef struct XMLNodeContents +{ + /// This dictates what's the content of the XMLNodeContent + enum XMLElementType etype; + /**< should be an union to access the appropriate data. Compiler does not allow union of object with constructor... too bad. */ + XMLNode child; + XMLAttribute attrib; + XMLCSTR text; + XMLClear clear; + +} XMLNodeContents; + +/** @defgroup StringAlloc String Allocation/Free functions + * @ingroup xmlModify + * @{ */ +/// Duplicate (copy in a new allocated buffer) the source string. +XMLDLLENTRY XMLSTR stringDup(XMLCSTR source, int cbData=-1); +/**< This is + * a very handy function when used with all the "XMLNode::*_WOSD" functions (\link xmlWOSD \endlink). + * @param cbData If !=0 then cbData is the number of chars to duplicate. New strings allocated with + * this function should be free'd using the "freeXMLString" function. */ + +/// to free the string allocated inside the "stringDup" function or the "createXMLString" function. +XMLDLLENTRY void freeXMLString(XMLSTR t); // {free(t);} +/** @} */ + +/** @defgroup atoX ato? like functions + * @ingroup XMLParserGeneral + * The "xmlto?" functions are equivalents to the atoi, atol, atof functions. + * The only difference is: If the variable "xmlString" is NULL, than the return value + * is "defautValue". These 6 functions are only here as "convenience" functions for the + * user (they are not used inside the XMLparser). If you don't need them, you can + * delete them without any trouble. + * + * @{ */ +XMLDLLENTRY char xmltob(XMLCSTR xmlString,char defautValue=0); +XMLDLLENTRY int xmltoi(XMLCSTR xmlString,int defautValue=0); +XMLDLLENTRY long xmltol(XMLCSTR xmlString,long defautValue=0); +XMLDLLENTRY double xmltof(XMLCSTR xmlString,double defautValue=.0); +XMLDLLENTRY XMLCSTR xmltoa(XMLCSTR xmlString,XMLCSTR defautValue=_CXML("")); +XMLDLLENTRY XMLCHAR xmltoc(XMLCSTR xmlString,const XMLCHAR defautValue=_CXML('\0')); +/** @} */ + +/** @defgroup ToXMLStringTool Helper class to create XML files using "printf", "fprintf", "cout",... functions. + * @ingroup XMLParserGeneral + * @{ */ +/// Helper class to create XML files using "printf", "fprintf", "cout",... functions. +/** The ToXMLStringTool class helps you creating XML files using "printf", "fprintf", "cout",... functions. + * The "ToXMLStringTool" class is processing strings so that all the characters + * &,",',<,> are replaced by their XML equivalent: + * \verbatim &, ", ', <, > \endverbatim + * Using the "ToXMLStringTool class" and the "fprintf function" is THE most efficient + * way to produce VERY large XML documents VERY fast. + * \note If you are creating from scratch an XML file using the provided XMLNode class + * you must not use the "ToXMLStringTool" class (because the "XMLNode" class does the + * processing job for you during rendering).*/ +typedef struct XMLDLLENTRY ToXMLStringTool +{ +public: + ToXMLStringTool(): buf(NULL),buflen(0){} + ~ToXMLStringTool(); + void freeBuffer();///