dispAvailablePb

PURPOSE ^

% Function for displaying available multi-objective problems

SYNOPSIS ^

function dispAvailablePb(txt)

DESCRIPTION ^

% Function for displaying available multi-objective problems
 L. LAURENT --  04/05/2018 -- luc.laurent@lecnam.net

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 %% Function for displaying available multi-objective problems
0002 % L. LAURENT --  04/05/2018 -- luc.laurent@lecnam.net
0003 
0004 % optiGTest - set of testing functions    A toolbox to easy manipulate functions.
0005 % Copyright (C) 2018  Luc LAURENT <luc.laurent@lecnam.net>
0006 %
0007 % This program is free software: you can redistribute it and/or modify
0008 % it under the terms of the GNU General Public License as published by
0009 % the Free Software Foundation, either version 3 of the License, or
0010 % (at your option) any later version.
0011 %
0012 % This program is distributed in the hope that it will be useful,
0013 % but WITHOUT ANY WARRANTY; without even the implied warranty of
0014 % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
0015 % GNU General Public License for more details.
0016 %
0017 % You should have received a copy of the GNU General Public License
0018 % along with this program.  If not, see <http://www.gnu.org/licenses/>.
0019 
0020 function dispAvailablePb(txt)
0021 
0022 if nargin==0
0023     txt='';
0024 end
0025 flagUn=false;
0026 flagCons=false;
0027 flagMulti=false;
0028 switch txt
0029     case {'cons','Cons','constrained','Constrained','constraint','Constraint'}
0030         flagCons=true;
0031     case {'uncons','unCons','unconstrained','unConstrained'}
0032         flagUn=true;
0033     case {'multi','Multi','multiObjective','multiobjective'}
0034         flagUn=true;
0035     otherwise
0036         flagUn=true;
0037         flagCons=true;
0038         flagMulti=true;
0039 end
0040 
0041 %extract name of porblems
0042 strPbUn=loadDimUn();
0043 strPbCons=loadProbCons();
0044 strPbMulti=loadProbMulti();
0045 %
0046 listPbUn=fieldnames(strPbUn);
0047 listPbCons=fieldnames(strPbCons);
0048 listPbMulti=fieldnames(strPbMulti);
0049 %count information
0050 funCount=@(x,y,n)numel(x(n).(y));
0051 nbConsPb=cellfun(@(x)funCount(strPbCons,x,3),listPbCons);
0052 nbMultiConsPb=cellfun(@(x)funCount(strPbMulti,x,3),listPbMulti);
0053 nbMultiObjPb=cellfun(@(x)funCount(strPbMulti,x,1),listPbMulti);
0054 %
0055 %Show existing problems
0056 Ofprintf('=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=\n');
0057 Ofprintf('Available test problems\n');
0058 if flagUn
0059     Ofprintf('------------------------\n');
0060     cellfun(@(X)Ofprintf('Unconstrained: %s\n',X),listPbUn);
0061     Ofprintf('------------------------\n');
0062 end
0063 if flagCons
0064     Ofprintf('------------------------\n');
0065     cellfun(@(X,Y,Z)Ofprintf('Constrained: %s (nb constraints: %i)\n',X,Y),...
0066         listPbCons,num2cell(nbConsPb));
0067     Ofprintf('------------------------\n');
0068 end
0069 if flagMulti
0070     Ofprintf('------------------------\n');
0071     cellfun(@(X,Y,Z)Ofprintf('Multiobjective: %s (nb objective/constraints: %i/%i)\n',X,Y,Z),...
0072         listPbMulti,num2cell(nbMultiObjPb),num2cell(nbMultiConsPb));
0073     Ofprintf('------------------------\n');
0074 end
0075 Ofprintf('=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=\n');
0076 end

Generated on Tue 28-May-2019 16:00:34 by m2html © 2005