Home > src > BN_pol_rec > Hsand > getGround_TruthPos.m

getGround_TruthPos

PURPOSE ^

Returns true positions of enemy vehicles of company no. comp_id

SYNOPSIS ^

function [pos_enemy] = getGround_TruthPos(comp_id)

DESCRIPTION ^

 Returns true positions of enemy vehicles of company no. comp_id
 at timestep simulationTime
 The data in simulation is dividen into tre large time intervalls
 time_Interval_One = length of the first interval

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 
0002  function [pos_enemy] = getGround_TruthPos(comp_id)
0003  % Returns true positions of enemy vehicles of company no. comp_id
0004  % at timestep simulationTime
0005  % The data in simulation is dividen into tre large time intervalls
0006  % time_Interval_One = length of the first interval
0007  
0008  if ischar(comp_id)
0009     comp_id = str2num(comp_id(4));
0010  end;
0011  
0012  global simulationTime;
0013  global south_enemy;
0014  global north_enemy1;
0015  global north_enemy2;
0016  time_Interval_One = 91; 
0017  time_Interval_Two = 93;
0018 
0019  pos_enemy = [];
0020  if comp_id == 1
0021      if simulationTime < 121
0022         pos_enemy = south_enemy(simulationTime:(simulationTime+9),:);
0023      else
0024         pos_enemy = south_enemy(121:130,:);
0025      end;
0026  end;
0027  
0028  if comp_id == 2
0029      if simulationTime <= time_Interval_One 
0030         pos_enemy = [20.*ones(9,1) 164.*ones(9,1)];
0031         return;
0032      end;
0033      if (simulationTime < time_Interval_Two)&& (simulationTime > time_Interval_One) 
0034         pos_enemy = north_enemy1((simulationTime - time_Interval_One):((simulationTime - time_Interval_One)+9),:); 
0035      end;
0036      if simulationTime == time_Interval_Two
0037         pos_enemy = north_enemy2(1:9,:); 
0038      end;
0039       if simulationTime > time_Interval_Two
0040         pos_enemy = north_enemy2((simulationTime - time_Interval_Two):((simulationTime - time_Interval_Two)+9),:); 
0041      end;
0042  end;
0043  
0044  if comp_id == 3
0045       if simulationTime <= time_Interval_One 
0046         pos_enemy = [33.*ones(9,1) 159.*ones(9,1)];
0047       else 
0048         pos_enemy = north_enemy2((simulationTime - time_Interval_One):((simulationTime - time_Interval_One)+9),:); 
0049       end; 
0050  end;
0051  
0052  if isempty(pos_enemy)
0053      disp('ERROR: in getGround_TruthPos: no position returned')
0054      disp('getGround_TruthPos: comp_id '), comp_id
0055  end;
0056      
0057  
0058  
0059   
0060  
0061      
0062  
0063

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