diff --git a/GUI/dialogInterpolation.fig b/GUI/dialogInterpolation.fig index 81c2d78..053f93c 100644 Binary files a/GUI/dialogInterpolation.fig and b/GUI/dialogInterpolation.fig differ diff --git a/GUI/dialogInterpolation.m b/GUI/dialogInterpolation.m index 286b5c6..d308c48 100644 --- a/GUI/dialogInterpolation.m +++ b/GUI/dialogInterpolation.m @@ -24,7 +24,7 @@ % Edit the above text to modify the response to help dialogInterpolation -% Last Modified by GUIDE v2.5 03-Jul-2015 13:46:23 +% Last Modified by GUIDE v2.5 15-Mar-2017 16:54:31 % Begin initialization code - DO NOT EDIT gui_Singleton = 1; @@ -170,9 +170,9 @@ function dialogInterpolation_OpeningFcn(hObject, eventdata, handles, varargin) % the input variable which discrete varied. The remainining columns % represent input variables which stays constant of the interpolation handles.InputVarIndiceMatrix = ones(handles.nRows,nInputVar); - for iVar=2:nInputVar - handles.InputVarIndiceMatrix(:,iVar)=iVar; - end +% for iVar=2:nInputVar +% handles.InputVarIndiceMatrix(:,iVar)=iVar; +% end % InputVarValueMatrix saves concrete values for the input variable % which are used when they are fix over the interpolation. The @@ -286,6 +286,7 @@ function dialogInterpolation_OpeningFcn(hObject, eventdata, handles, varargin) % Potential index of input variables indicesWhichCouldBechosen = 1:handles.KrigingAnalysisObj.KrigingObjects{handles.currentObj}.getnInputVar; +indicesNotChosen = indicesWhichCouldBechosen; % Takes all the indices which are not yet already chosen by the popMenue switch handles.InterpolationType @@ -313,6 +314,7 @@ function dialogInterpolation_OpeningFcn(hObject, eventdata, handles, varargin) % Collect information for the entries in the table for iVar=1:length(strNames)-(handles.InterpolationType-1) +% for iVar=1:length(strNames) dataIni{iVar,1} = strNames{indicesNotChosen(iVar)}; if handles.InterpolationType==4 % nD-plot @@ -358,8 +360,9 @@ function dialogInterpolation_OpeningFcn(hObject, eventdata, handles, varargin) index2(runIndex) = find(strcmp(str{iIndex}{val(iIndex)},strNames)==1); runIndex = runIndex+1; end -index2 = unique(index2); -indices = setdiff(1:length(strNames),index2); +% index2 = unique(index2); +% indices = setdiff(1:length(strNames),index2); +indices = 1:length(strNames); % --- Executes on button press in checkboxBestData. @@ -482,8 +485,11 @@ function popupmenuInVar2_Callback(hObject, eventdata, handles) InputVarPopupValueMatrix(iIndex,currentRow) = get(popUps{iIndex},'Value'); end % Fill up the remaining part -InputVarIndiceMatrix(currentRow,4:end) =... +InputVarIndiceMatrix(currentRow,4:end) = ... setdiff(1:nInputVar,InputVarIndiceMatrix(currentRow,1:3)); +% InputVarIndiceMatrix(currentRow,1:end) = 1:nInputVar; +% InputVarIndiceMatrix(currentRow,1:end) = ... +% setdiff(1:nInputVar,InputVarIndiceMatrix(currentRow,1:3)); @@ -571,11 +577,17 @@ function pushbuttonInterpolation_Callback(hObject, eventdata, handles) errordlg(horzcat('Uncheck either "',get(handles.checkboxContourPlot,'String'),'" or "',get(handles.checkboxDisplayOptimum,'String'),'"')) error(horzcat('Uncheck either "',get(handles.checkboxContourPlot,'String'),'" or "',get(handles.checkboxDisplayOptimum,'String'),'"')) end - + + switch handles.InterpolationType case 2 chosenIndices = indicesWhichCouldBechosen1(val1); + if length(unique(chosenIndices))~= length(chosenIndices) + errordlg('Indices of input variable are not unique') + error('Indices of input variable are not unique') + end + indicesRemainingInputVar = setdiff(1:nInputVar,chosenIndices); data = get(handles.uitableInputParameters,'Data'); for iVar=1:nInputVar-1 @@ -602,6 +614,11 @@ function pushbuttonInterpolation_Callback(hObject, eventdata, handles) case 3 chosenIndices = [indicesWhichCouldBechosen1(val1),indicesWhichCouldBechosen2(val2)]; + if length(unique(chosenIndices))~= length(chosenIndices) + errordlg('Indices of input variable are not unique') + error('Indices of input variable are not unique') + end + indicesRemainingInputVar = setdiff(1:nInputVar,chosenIndices); data = get(handles.uitableInputParameters,'Data'); for iVar=1:nInputVar-2 @@ -641,7 +658,11 @@ function pushbuttonInterpolation_Callback(hObject, eventdata, handles) case 4 - + if length(unique(handles.InputVarIndiceMatrix(:,1:3)))~= length(handles.InputVarIndiceMatrix(:,1:3)) + errordlg('Indices of input variable are not unique') + error('Indices of input variable are not unique') + end + valuesRemainingInputVarValues = zeros(handles.nRows,nInputVar-3); for iVar=1:handles.nRows valuesRemainingInputVarValues(iVar,:) = handles.InputVarValueMatrix(iVar,handles.InputVarIndiceMatrix(iVar,4:end)); @@ -1018,3 +1039,11 @@ function uitableMinMaxVar_CreateFcn(hObject, eventdata, handles) % your option, any later version) which accompanies this distribution, and % is available at http://www.gnu.org/licenses/gpl.html % ============================================================================= + + +% --- If Enable == 'on', executes on mouse press in 5 pixel border. +% --- Otherwise, executes on mouse press in 5 pixel border or over popupmenuInVar1. +function popupmenuInVar1_ButtonDownFcn(hObject, eventdata, handles) +% hObject handle to popupmenuInVar1 (see GCBO) +% eventdata reserved - to be defined in a future version of MATLAB +% handles structure with handles and user data (see GUIDATA) diff --git a/GUI/dialogInterpolationGUI.fig b/GUI/dialogInterpolationGUI.fig index 99f2333..14fdbc8 100644 Binary files a/GUI/dialogInterpolationGUI.fig and b/GUI/dialogInterpolationGUI.fig differ diff --git a/GUI/dialogInterpolationGUI.m b/GUI/dialogInterpolationGUI.m index 883cd19..9f48557 100644 --- a/GUI/dialogInterpolationGUI.m +++ b/GUI/dialogInterpolationGUI.m @@ -24,7 +24,7 @@ % Edit the above text to modify the response to help dialogInterpolationGUI -% Last Modified by GUIDE v2.5 22-Jan-2015 16:17:46 +% Last Modified by GUIDE v2.5 15-Mar-2017 16:52:51 % Begin initialization code - DO NOT EDIT gui_Singleton = 1; @@ -193,3 +193,11 @@ function popupmenu4_CreateFcn(hObject, eventdata, handles) % your option, any later version) which accompanies this distribution, and % is available at http://www.gnu.org/licenses/gpl.html % ============================================================================= + + +% --- If Enable == 'on', executes on mouse press in 5 pixel border. +% --- Otherwise, executes on mouse press in 5 pixel border or over popupmenu1. +function popupmenu1_ButtonDownFcn(hObject, eventdata, handles) +% hObject handle to popupmenu1 (see GCBO) +% eventdata reserved - to be defined in a future version of MATLAB +% handles structure with handles and user data (see GUIDATA) diff --git a/dependencies/@AnalyzeKriging/plotParetoFrontData.m b/dependencies/@AnalyzeKriging/plotParetoFrontData.m index adcf075..51c0672 100644 --- a/dependencies/@AnalyzeKriging/plotParetoFrontData.m +++ b/dependencies/@AnalyzeKriging/plotParetoFrontData.m @@ -56,6 +56,7 @@ for iObjNested = 1:nObj outputMatrix(:,iObjNested) = obj.KrigingObjects{krigingObjectIndex(iObjNested)}.getOutputData; end + outputMatrix = bsxfun(@times,outputMatrix,obj.getMinMax(krigingObjectIndex)); end % ------------------------------------------------------------------------- function []=numerateSamples(nObj,paretoSamples) @@ -87,7 +88,8 @@ end % Sort ParetoSet allong th x-axis - paretoSamples = sortrows(obj.ParetoSetExperiments); + paretoSamples = bsxfun(@times,obj.ParetoSetExperiments,obj.getMinMax(krigingObjectIndex)); + paretoSamples = sortrows(paretoSamples); % Connect pareto points by a "stair" indicating dominated and non % domiated are diff --git a/dependencies/@AnalyzeKriging/plotParetoInput.m b/dependencies/@AnalyzeKriging/plotParetoInput.m index ead82c3..43d365c 100644 --- a/dependencies/@AnalyzeKriging/plotParetoInput.m +++ b/dependencies/@AnalyzeKriging/plotParetoInput.m @@ -46,8 +46,8 @@ nInputVar = length(inputIndices); % Test Input - if (nInputVar~=2&&nInputVar~=3)||~any(size(inputIndices)==1) - error('InputIndices has to be an one-dimensional array of size 2 or 3') + if (nInputVar~=1&&nInputVar~=2&&nInputVar~=3)||~any(size(inputIndices)==1) + error('InputIndices has to be an one-dimensional array of size 1, 2, or 3') end if obj.nParetoSetExperiments<=0 @@ -71,7 +71,11 @@ % Add legend warning('off','MATLAB:legend:IgnoringExtraEntries') - legend('Non-optimal Sample Points','Optimal Sample Points','Trajectory') + if nInputVar + legend('Optimal Sample Points','Trajectory') + else + legend('Non-optimal Sample Points','Optimal Sample Points','Trajectory') + end warning('on','MATLAB:legend:IgnoringExtraEntries') %% Nested Functions % --------------------------------------------------------------------- @@ -85,6 +89,16 @@ % Actual Plotting switch nInputVar + case 1 + % Mark pareto optimal + nPareto = length(obj.ParetoValuesInput(:,inputIndices(1))); + plot(1:nPareto,... + inputSorted(:,inputIndices(1)),... + 'kO','MarkerFaceColor',colorOptimal,'MarkerSize',12); + stairs(1:nPareto,... + inputSorted(:,inputIndices(1)),... + 'k','LineWidth',2); + set(gca,'XTick',1:nPareto) case 2 if obj.ShowData==1 % All data @@ -152,16 +166,30 @@ % ---------------------------------------------------------------------- function []=labelAxes() if isempty(obj.InputVarNames{krigingObjectIndex(1)}) - xlabel(horzcat('Input Variable ',num2str(inputIndices(1))),'FontSize',20); - ylabel(horzcat('Input Variable ',num2str(inputIndices(2))),'FontSize',20); - if nInputVar>2 - zlabel(horzcat('Input Variable ',num2str(inputIndices(3))),'FontSize',20); + switch nInputVar + case 1 + xlabel('Point Number','FontSize',20) + xlabel(horzcat('Input Variable ',num2str(inputIndices(1))),'FontSize',20); + case {2,3} + xlabel(horzcat('Input Variable ',num2str(inputIndices(1))),'FontSize',20); + ylabel(horzcat('Input Variable ',num2str(inputIndices(2))),'FontSize',20); + if nInputVar>2 + zlabel(horzcat('Input Variable ',num2str(inputIndices(3))),'FontSize',20); + end end else - xlabel(obj.InputVarNames{krigingObjectIndex(1)}(inputIndices(1)),'FontSize',20); - ylabel(obj.InputVarNames{krigingObjectIndex(1)}(inputIndices(2)),'FontSize',20); - if nInputVar>2 - zlabel(obj.InputVarNames{krigingObjectIndex(1)}(inputIndices(3)),'FontSize',20); + + switch nInputVar + case 1 + xlabel('Point Number','FontSize',20) + inputNames = obj.getInputVarNames(krigingObjectIndex(1)); + ylabel(inputNames(inputIndices(1)),'FontSize',20) + case {2,3} + xlabel(obj.InputVarNames{krigingObjectIndex(1)}(inputIndices(1)),'FontSize',20); + ylabel(obj.InputVarNames{krigingObjectIndex(1)}(inputIndices(2)),'FontSize',20); + if nInputVar>2 + zlabel(obj.InputVarNames{krigingObjectIndex(1)}(inputIndices(3)),'FontSize',20); + end end end end