0001 function objectiveString = getObjectiveString(max, objectiveNames, objectiveValues)
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015 objectiveString='';
0016
0017 if max==true
0018 objectiveString=[objectiveString 'MAX: '];
0019 else
0020 objectiveString=[objectiveString 'MIN: '];
0021 end
0022
0023
0024 for i=1:length(objectiveNames)
0025
0026 if i>1
0027 if objectiveValues(i)==1
0028 objectiveString=[objectiveString ' + ' objectiveNames{i}];
0029 continue;
0030 end
0031 if objectiveValues(i)==-1
0032 objectiveString=[objectiveString ' - ' objectiveNames{i}];
0033 continue;
0034 end
0035 if objectiveValues(i)>=0
0036 objectiveString=[objectiveString ' + ' num2str(objectiveValues(i)) ' ' objectiveNames{i}];
0037 else
0038 objectiveString=[objectiveString ' - ' num2str(abs(objectiveValues(i))) ' ' objectiveNames{i}];
0039 end
0040 else
0041 if objectiveValues(i)==1
0042 objectiveString=[objectiveString objectiveNames{i}];
0043 continue;
0044 end
0045 if objectiveValues(i)==-1
0046 objectiveString=[objectiveString '- ' objectiveNames{i}];
0047 continue;
0048 end
0049 if objectiveValues(i)>=0
0050 objectiveString=[objectiveString num2str(objectiveValues(i)) ' ' objectiveNames{i}];
0051 else
0052 objectiveString=[objectiveString '- ' num2str(abs(objectiveValues(i))) ' ' objectiveNames{i}];
0053 end
0054 end
0055 end
0056 end