/*
 * Created on Apr 3, 2005
 *
 * TODO To change the template for this generated file go to
 * Window - Preferences - Java - Code Style - Code Templates
 */
package ps6;
import javax.swing.JFrame;

/**
 * @author knorton
 *
 * TODO To change the template for this generated type comment go to
 * Window - Preferences - Java - Code Style - Code Templates
 */
public class Prob02 {
	public static boolean[][][] map = {
			{{ true, false}, { true,  true}, {false, false}, {false, false}, { true, false}, { true,  true}, {false,  true}, { true,  true}},
			{{false, false}, {false,  true}, { true, false}, { true,  true}, { true, false}, { true,  true}, {false, false}, { true,  true}},
			{{ true,  true}, { true, false}, {false,  true}, {false, false}, {false, false}, {false, false}, { true, false}, { true, false}},
			{{ true, false}, { true,  true}, { true, false}, {false, false}, { true,  true}, { true,  true}, {false, false}, { true,  true}},
			{{false, false}, {false, false}, { true, false}, {false, false}, { true,  true}, {false, false}, { true,  true}, { true,  true}},
			{{ true,  true}, {false,  true}, { true,  true}, {false, false}, {false,  true}, {false, false}, {false, false}, { true,  true}},
			{{false, false}, { true, false}, { true, false}, {false,  true}, { true,  true}, { true,  true}, {false,  true}, { true,  true}},
			{{false,  true}, {false,  true}, { true,  true}, {false,  true}, {false,  true}, { true,  true}, {false,  true}, { true,  true}}};

	public static void main(String args[]) {
		JFrame		fr = new JFrame();
		VisualGraph 	vg = new VisualGraph(800,600);
	
		SoftEquals 	eq = vg.getGraph().createSoftEquals();
		Inverter		iv = vg.getGraph().createInverter(eq);
		iv.doDampening();
		eq.addInputGate(vg.getGraph().createEvidence(new Message(0.9,0.1)));
		eq.addInputGate(iv);
		
		vg.createProbe(iv,150,250,100,100);
		vg.createProbe(eq,550,250,100,100);
		//vg.getGraph().createProbe("x",iv);
		
		fr.getContentPane().add(vg);
		fr.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		fr.pack();
		new Thread(vg).start();
		fr.show();
	}
}
