forked from nathantim/amputee_gait_simulation
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathprintOptInfo.m
70 lines (65 loc) · 3.93 KB
/
printOptInfo.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
function printOptInfo(dataStruct,b_bold)
try
if nargin <2
b_bold = false;
end
cost = dataStruct.cost.data;
if ~isnan(cost)
time = dataStruct.timeVector.data;
% metabolicEnergyWang = dataStruct.E.data(contains(string(dataStruct.E.info),'Wang'));
metabolicEnergyUmb10 = dataStruct.E.data(contains(string(dataStruct.E.info),'Umberger (2010)'));
CoTUmb10 = dataStruct.CoT.data(contains(string(dataStruct.CoT.info),'Umberger (2010)'));
meanVel = dataStruct.vMean.data;
stepLengthASIstruct = dataStruct.stepLengthASIstruct.data;
stepTimeASIstruct = dataStruct.stepTimeASIstruct.data;
timeCost = dataStruct.timeCost.data;
% velCost = dataStruct.velCost.data;
sumOfStopTorques = dataStruct.sumTstop.data;
maxCMGTorque = dataStruct.maxCMGTorque.data;
maxCMGdeltaH = dataStruct.maxCMGdeltaH.data;
% controlRMSE = dataStruct.controlRMSE.data;
% HATPos = dataStruct.HATPos.data;
if b_bold
fprintf(['-- <strong> t_sim: %2.2f</strong>, Cost: %2.2f, CoT: %.2f, Em: %.0f, <strong>v_avg: %2.2f</strong>, ',...
'sumStopT: %1.0f, stepLengthASI: %2.1f%%, stepTimeASI: %2.1f%%,',...
' maxCMGdeltaH: %3.1f, maxCMGTorque: %3.1f --\n'],...
time(end), cost, CoTUmb10, metabolicEnergyUmb10,...
meanVel,sumOfStopTorques, stepLengthASIstruct.ASImean, stepTimeASIstruct.ASImean, ...
maxCMGdeltaH, maxCMGTorque);
else
fprintf(['-- t_sim: %2.2f, Cost: %2.2f, CoT: %.2f, Em: %.0f, v_avg: %2.2f, ',...
'sumStopT: %1.0f, stepLengthASI: %2.1f%%, stepTimeASI: %2.1f%%,',...
' maxCMGdeltaH: %3.1f, maxCMGTorque: %3.1f --\n'],...
time(end), cost, CoTUmb10, metabolicEnergyUmb10,...
meanVel,sumOfStopTorques, stepLengthASIstruct.ASImean, stepTimeASIstruct.ASImean, ...
maxCMGdeltaH, maxCMGTorque);
end
% if b_bold
% fprintf(['-- <strong> t_sim: %2.2f</strong>, Cost: %2.2f, E_m (Wang): %.0f, E_m(Umb10): %.0f, <strong>avg v_step: %2.2f</strong>, ',...
% 'sumStopT: %3.0f, avg t_step: %1.2f, avg l_step: %1.2f, timeCost: %2.2f, velCost: %2.2f, maxCMGTorque: %3.1f --\n'],...
% time(end), cost, metabolicEnergyWang, metabolicEnergyUmb10,...
% meanVel,sumOfStopTorques, meanStepTime, meanStepLength, timeCost, velCost, maxCMGTorque);
% else
% fprintf(['-- t_sim: %2.2f, Cost: %2.2f, E_m (Wang): %.0f, E_m(Umb10): %.0f, avg v_step: %2.2f, ',...
% 'sumStopT: %1.0f, avg t_step: %1.2f, avg l_step: %1.2f, timeCost: %2.2f, velCost: %2.2f, maxCMGTorque: %3.1f --\n'],...
% time(end), cost, metabolicEnergyWang, metabolicEnergyUmb10,...
% meanVel,sumOfStopTorques, meanStepTime, meanStepLength, timeCost, velCost, maxCMGTorque);
% end
else
fprintf('Cost: %d \n',cost);
end
catch ME
warning(ME.message)
end
end
% if b_bold
% fprintf(['-- <strong> t_sim: %2.2f</strong>, Cost: %2.2f, E_m (Wang): %.0f, E_m(Umb10): %.0f, <strong>avg v_step: %2.2f</strong>, ',...
% 'avg t_step: %1.2f, avg l_step: %1.2f, ASI l_step: %2.2f, ASI t_step: %2.2f, timeCost: %2.2f, velCost: %2.2f --\n'],...
% time(end), cost, metabolicEnergyWang, metabolicEnergyUmb10,...
% meanVel, meanStepTime, meanStepLength,round(ASIStepLength,2),round(ASIStepTime,2), timeCost, velCost);
% else
% fprintf(['-- t_sim: %2.2f, Cost: %2.2f, E_m (Wang): %.0f, E_m(Umb10): %.0f, avg v_step: %2.2f, ',...
% 'avg t_step: %1.2f, avg l_step: %1.2f, ASI l_step: %2.2f, ASI t_step: %2.2f, timeCost: %2.2f, velCost: %2.2f --\n'],...
% time(end), cost, metabolicEnergyWang, metabolicEnergyUmb10,...
% meanVel, meanStepTime, meanStepLength,round(ASIStepLength,2),round(ASIStepTime,2), timeCost, velCost);
% end