Home > src > BN_pol_rec > Hsand > inferrPolicy.m

inferrPolicy

PURPOSE ^

Inferrs policy from new evidence and DBN

SYNOPSIS ^

function [plan_rec_struct] = inferrPolicy(DBN_Mx, soft_ev_Mx, i, j);

DESCRIPTION ^

Inferrs policy from new evidence and DBN

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 
0002 
0003      function  [plan_rec_struct] = inferrPolicy(DBN_Mx, soft_ev_Mx, i, j); 
0004      %Inferrs policy from new evidence and DBN
0005      
0006      load namesOfNodes;
0007      
0008      %Make policy cell array
0009      comp_strct = struct('CompPol', zeros(1,5) , 'Dicovered', [0 0]', 'CompFor', zeros(1,4));  
0010      platoon_strct = struct('PlatoonPol', zeros(1,4));
0011      plan_rec_struct = cell(1,4);
0012      plan_rec_struct{1} = comp_strct;
0013      plan_rec_struct{2} = platoon_strct;
0014      plan_rec_struct{3} = platoon_strct;
0015      plan_rec_struct{4} = platoon_strct;
0016       
0017      % inferr policy
0018      engine = jtree_inf_engine(DBN_Mx{i,j});
0019      soft_ev = soft_ev_Mx{i,j}; 
0020      [engine, ll2] = enter_evidence(engine, cell(1,N), 'soft', soft_ev);
0021      marg = marginal_nodes(engine,Discovered);
0022      disc = marg.T;
0023      marg = marginal_nodes(engine,PolicyCompany);
0024      comp_pol = marg.T;
0025      marg = marginal_nodes(engine,PolicyPlatoon1);
0026      pl_1__pol = marg.T;
0027      marg = marginal_nodes(engine,PolicyPlatoon2);
0028      pl_2__pol = marg.T;
0029      marg = marginal_nodes(engine,PolicyPlatoon3);
0030      pl_3__pol = marg.T;
0031      marg = marginal_nodes(engine,Formation21);
0032      comp_form21 = marg.T;
0033      
0034      %update cell array
0035      plan_rec_struct{1}.CompPol = comp_pol';
0036      plan_rec_struct{1}.Dicovered = disc;
0037      plan_rec_struct{1}.CompFor = comp_form21'; 
0038      plan_rec_struct{2}.PlatoonPol = pl_1__pol; 
0039      plan_rec_struct{3}.PlatoonPol = pl_2__pol; 
0040      plan_rec_struct{4}.PlatoonPol = pl_3__pol; 
0041      plan_rec_struct;
0042

Generated on Wed 16-Mar-2005 09:17:47 by m2html © 2003