Home > src > BN_pol_rec > Hsand > inferPolicy.m

inferPolicy

PURPOSE ^

Inferrs policy from new evidence and DBN

SYNOPSIS ^

function [plan_rec_struct] = inferPolicy(DBN_elem, soft_ev);

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] = inferPolicy(DBN_elem, soft_ev); 
0004      %Inferrs policy from new evidence and DBN
0005      
0006      load namesOfNodes;
0007      
0008      %Make policy struct array
0009      Cmp_strct = struct('CmpPol', zeros(1,5) , 'Discovered', [0 0]', 'CmpFor', zeros(1,4));  
0010      Plt_strct = struct('PltPol', zeros(1,4));
0011      plan_rec_struct{1} = Cmp_strct;
0012      plan_rec_struct{2} = Plt_strct;
0013      plan_rec_struct{3} = Plt_strct;
0014      plan_rec_struct{4} = Plt_strct;
0015      % inferr policy
0016      engine = jtree_inf_engine(DBN_elem);
0017      [engine, ll2] = enter_evidence(engine, cell(1,N), 'soft', soft_ev);
0018      marg = marginal_nodes(engine,Discovered);
0019      disc = marg.T;
0020      marg = marginal_nodes(engine,PolicyCompany);
0021      Cmp_pol = marg.T;
0022      marg = marginal_nodes(engine,PolicyPlatoon1);
0023      pl_1__pol = marg.T;
0024      marg = marginal_nodes(engine,PolicyPlatoon2);
0025      pl_2__pol = marg.T;
0026      marg = marginal_nodes(engine,PolicyPlatoon3);
0027      pl_3__pol = marg.T;
0028      marg = marginal_nodes(engine,Formation21);
0029      Cmp_form21 = marg.T;
0030      
0031      %update cell array
0032      plan_rec_struct{1}.CmpPol = Cmp_pol;
0033      plan_rec_struct{1}.Discovered = disc;
0034      plan_rec_struct{1}.CmpFor = Cmp_form21; 
0035      plan_rec_struct{2}.PltPol = pl_1__pol; 
0036      plan_rec_struct{3}.PltPol = pl_2__pol; 
0037      plan_rec_struct{4}.PltPol = pl_3__pol; 
0038      plan_rec_struct;
0039

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