Simulates a bayesian network and tells if varibles are independent based on d-seperation.