about summary refs log tree commit diff
path: root/sourcecodes/bnt-master/GraphViz/draw_dbn_test.m
diff options
context:
space:
mode:
authorziejd22018-03-14 23:23:33 -0500
committerGitHub2018-03-14 23:23:33 -0500
commit1ff6baa44e22b91eefb48aea6f3befa078c0489b (patch)
treee0fd79d2e32fd2aedda2eadaed0f19af3514c520 /sourcecodes/bnt-master/GraphViz/draw_dbn_test.m
parent6882395afdadf4e982b25b5215071a0932730950 (diff)
parentc80226899f5cdd9f11c163817d59445213f5bef0 (diff)
downloadBNW-1ff6baa44e22b91eefb48aea6f3befa078c0489b.tar.gz
Merge pull request #1 from ziejd2/octave_php_separate
Octave php separate
Diffstat (limited to 'sourcecodes/bnt-master/GraphViz/draw_dbn_test.m')
-rw-r--r--sourcecodes/bnt-master/GraphViz/draw_dbn_test.m68
1 files changed, 68 insertions, 0 deletions
diff --git a/sourcecodes/bnt-master/GraphViz/draw_dbn_test.m b/sourcecodes/bnt-master/GraphViz/draw_dbn_test.m
new file mode 100644
index 00000000..7d7c2367
--- /dev/null
+++ b/sourcecodes/bnt-master/GraphViz/draw_dbn_test.m
@@ -0,0 +1,68 @@
+% TEST_LAYOUT_DBN		Script to test some DBN layouts
+%
+
+% Change History :
+% Date		Time		Prog	Note
+% 17-Apr-2000	 2:40 PM	ATC	Created under MATLAB 5.3.1.29215a (R11.1)
+
+% ATC = Ali Taylan Cemgil,
+% SNN - University of Nijmegen, Department of Medical Physics and Biophysics
+% e-mail : cemgil@mbfys.kun.nl 
+
+disp('draw mhmm1')
+clf
+set(gcf, 'pos', [0   0   1024   600]);
+
+intra = zeros(3);
+intra(1,[2 3]) = 1;
+intra(2,3) = 1;
+inter = zeros(3);
+inter(1,1) = 1;
+n = 3;
+dnodes = [1 2];
+isbox = zeros(n,1); isbox(dnodes) = 1;
+unfold = 4;
+draw_dbn(intra, inter, 0, unfold, {'Q', 'M', 'Y'}, isbox);
+
+
+pause
+clf
+disp('draw water1')
+bnet = mk_water_dbn;
+unfold = 3;
+flip = 1;
+[dummyx, dummyy, h] = draw_dbn(bnet.intra, bnet.inter, flip, unfold);
+
+col = rand(size(h,1),3);
+for i=1:length(h),
+  col = rand(1,3);
+  % patches
+  set(h(i,2),'facecolor', col); drawnow;
+  % text
+  set(h(i,1),'color', 1-col); drawnow;
+end;
+
+
+pause
+clf
+disp('draw BAT static')
+% This requires BNT
+
+%sz = get(0, 'ScreenSize');
+%sv = get(gcf, 'pos');
+%set(gcf, 'units','pix','pos', sz);
+[bnet, names] = mk_bat_dbn;
+N = size(bnet.intra,1);
+G = [bnet.intra bnet.inter;
+     zeros(N,N) bnet.intra];
+names2 = names;
+for i=1:N
+  names2{i} = sprintf('%s(1)', names{i});
+  names2{i+N} = sprintf('%s(2)', names{i});
+end
+draw_graph(G, names2);
+
+pause
+disp('draw bat dbn')
+clf
+draw_dbn(bnet.intra, bnet.inter, 0, 2, names2);