-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgetConfData.m
More file actions
24 lines (22 loc) · 1001 Bytes
/
getConfData.m
File metadata and controls
24 lines (22 loc) · 1001 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
function [confFinishTime, lastTargetIndex] = getConfData(currConf,agentTakeoffTime,speed,oldConfSize,target2TargetDistance,targetsData,v)
targetsData_BEGIN_COL =4;
targetsData_DURATION_COL =6;
% inital data
currTime = agentTakeoffTime;
currTarget = 0;
if (v)
fprintf('\t\t\t\tcurrTarget %i, currTime %10.2f\n',currTarget,currTime);
end
for i=1:oldConfSize
ithTarget = find(currConf == i);
flightTime = target2TargetDistance(currTarget + 1,ithTarget + 1)/(speed*60*60);
ithTargetStart = max(targetsData(ithTarget,targetsData_BEGIN_COL),currTime + flightTime);
currTime = ithTargetStart + targetsData(ithTarget,targetsData_DURATION_COL);
currTarget = ithTarget;
if (v)
fprintf('\t\t\t\tcurrTarget %i, currTime %10.2f, targetStart %10.2f\n',currTarget,currTime,ithTargetStart);
end
end
lastTargetIndex = find(currConf == oldConfSize);
confFinishTime = currTime;
end