ros_monty_hall.py
Go to the documentation of this file.
00001 #!/usr/bin/env python
00002 
00003 # monty hall example
00004 # https://github.com/eBay/bayesian-belief-networks/blob/master/docs/tutorial/tutorial.rst
00005 # rosservice call /monty_hall/query []
00006 # rosservice call /monty_hall/query [[guest_door,A]]
00007 # rosservice call /monty_hall/query [[guest_door,A],[monty_door,B]]
00008 
00009 import imp
00010 try:
00011     imp.find_module('bayesian_belief_networks')
00012 except:
00013     import roslib; roslib.load_manifest('bayesian_belief_networks')
00014 
00015 from bayesian.examples.bbns.monty_hall import *
00016 from bayesian_belief_networks.ros_utils import *
00017 
00018 import rospy
00019 
00020 rospy.init_node('monty_hall')
00021 g = ros_build_bbn(
00022     f_prize_door,
00023     f_guest_door,
00024     f_monty_door,
00025     domains=dict(
00026         prize_door=['A', 'B', 'C'],
00027         guest_door=['A', 'B', 'C'],
00028         monty_door=['A', 'B', 'C']))
00029 
00030 rospy.spin()
00031 
00032 
00033 


bayesian_belief_networks
Author(s):
autogenerated on Sat Sep 9 2017 02:33:24