Home > src > BN_pol_rec > Hsand > getPolicyDistribution.m

getPolicyDistribution

PURPOSE ^

returns policy distribution for each particle of a platoon or company (choice)% Indata

SYNOPSIS ^

function [pol_dist] = getPolicyDistribution(Family_plRec, choice)

DESCRIPTION ^

 returns policy distribution for each particle of a platoon or company (choice)% Indata
 Family_plRec - a policy distribution matrix of size MxN where M is the number of particles and N is 4
 choice - either 'cmp', 'plt1', 'plt2', or 'plt3'
 ALTERED  050120 - minor change (rjo)

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function [pol_dist] = getPolicyDistribution(Family_plRec, choice)
0002 % returns policy distribution for each particle of a platoon or company (choice)% Indata
0003 % Family_plRec - a policy distribution matrix of size MxN where M is the number of particles and N is 4
0004 % choice - either 'cmp', 'plt1', 'plt2', or 'plt3'
0005 % ALTERED  050120 - minor change (rjo)
0006 
0007 switch choice
0008   case 'cmp'
0009     idx = 1;
0010   case 'plt1'
0011     idx = 2;
0012   case 'plt2'
0013     idx = 3;
0014   case 'plt3'
0015     idx = 4;
0016   otherwise
0017     disp(['getPolicyDistribution: Wrong value for parameter choice: ' choice]);
0018 end
0019 
0020 [noOfParticles, noOfStructs] = size( Family_plRec );
0021 pol_dist = [];
0022 
0023 %Family_plRec{1, 1}.CmpPol' %'
0024 %Family_plRec{1, 2}.PltPol'
0025 
0026 %Family_plRec{1,1}
0027 %Family_plRec{1,2}
0028 
0029 if strcmp(choice, 'cmp')
0030   for p = 1:noOfParticles
0031     pol_dist = [pol_dist; Family_plRec{p, idx}.CmpPol'];
0032   end;
0033 else
0034   for p = 1:noOfParticles
0035     pol_dist = [pol_dist; Family_plRec{p, idx}.PltPol'];
0036   end;
0037 end;
0038

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