Home > src > BN_pol_rec > Hsand > updateEvidence.m

updateEvidence

PURPOSE ^

SYNOPSIS ^

function [soft_ev_elem, oldData_elem] = updateEvidence(soft_ev_elem, oldData_elem, vi_pos, pos_new, fi_vec)

DESCRIPTION ^

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 
0002 function  [soft_ev_elem, oldData_elem] = updateEvidence(soft_ev_elem, oldData_elem, vi_pos, pos_new, fi_vec)
0003 
0004 global image_struct; 
0005 global roads_struct;
0006 global simulationTime;
0007 
0008 load namesOfNodes;
0009 own_force_pos = vi_pos;
0010 soft_ev = cell(size(soft_ev_elem));
0011 if  isempty((soft_ev_elem{Prev_Discovered})) < 1
0012     soft_ev{Prev_Discovered} = soft_ev_elem{Prev_Discovered};
0013     soft_ev{Prev_PolicyCompany} = soft_ev_elem{Prev_PolicyCompany};
0014     soft_ev{Prev_PolicyPlatoon1} = soft_ev_elem{Prev_PolicyPlatoon1};
0015     soft_ev{Prev_PolicyPlatoon2} = soft_ev_elem{Prev_PolicyPlatoon2}; 
0016     soft_ev{Prev_PolicyPlatoon3} = soft_ev_elem{Prev_PolicyPlatoon3};
0017     soft_ev{Prev_Formation21} = soft_ev_elem{Prev_Formation21}; 
0018 end;
0019  %---------------------------------------------------------------------
0020  soft_ev{ForceBalance} = [0.33 0.34 0.33]; 
0021  %Intial belief abot force balace. May also change but in this example is the same during
0022  airDist = getDistance(pos_new, vi_pos);
0023     soft_ev{Distance} = airDist;
0024     enemy11 = round(mediumPoint(pos_new(1,:), pos_new(2,:), pos_new(3,:)));
0025     enemy12 = round(mediumPoint(pos_new(4,:), pos_new(5,:), pos_new(6,:)));
0026     enemy13 = round(mediumPoint(pos_new(7,:), pos_new(8,:), pos_new(9,:)));
0027     enemy_vec11 = round(mediumPoint(fi_vec(1,:), fi_vec(2,:), fi_vec(3,:)));
0028     enemy_vec12 = round(mediumPoint(fi_vec(4,:), fi_vec(5,:), fi_vec(6,:)));
0029     enemy_vec13 = round(mediumPoint(fi_vec(7,:), fi_vec(8,:), fi_vec(9,:)));
0030     [cost11] = getNewCost(enemy11, own_force_pos);
0031     soft_ev{Time11} = getTime( cost11, enemy11, own_force_pos); 
0032     [fuzzy_costChange11, oldData_elem.oldCost11, oldData_elem.oldSimulationTime11] = getCostChange(oldData_elem.oldCost11, cost11, oldData_elem.oldSimulationTime11, enemy11, own_force_pos);
0033     soft_ev{costChange11} = fuzzy_costChange11;
0034     [cost12] = getNewCost(enemy12, own_force_pos);
0035     soft_ev{Time12} = getTime( cost12, enemy12, own_force_pos) ;
0036     [fuzzy_costChange12, oldData_elem.oldCost12, oldData_elem.oldSimulationTime12] = getCostChange(oldData_elem.oldCost12, cost12, oldData_elem.oldSimulationTime12, enemy12, own_force_pos);
0037     soft_ev{costChange12} = fuzzy_costChange12;
0038     [cost13] = getNewCost(enemy13, own_force_pos);
0039     soft_ev{Time13} = getTime( cost13, enemy13, own_force_pos);
0040     [fuzzy_costChange13, oldData_elem.oldCost13, oldData_elem.oldSimulationTime13] = getCostChange(oldData_elem.oldCost13, cost13, oldData_elem.oldSimulationTime13, enemy13, own_force_pos);
0041     soft_ev{costChange13} =  fuzzy_costChange13; 
0042     oldData_elem.pos_old = pos_new;
0043     soft_ev_elem = soft_ev; 
0044  
0045 
0046

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