diff m-toolbox/classes/@LTPDAHelper/generateFunctionList.m @ 0:f0afece42f48

Import.
author Daniele Nicolodi <nicolodi@science.unitn.it>
date Wed, 23 Nov 2011 19:22:13 +0100
parents
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/m-toolbox/classes/@LTPDAHelper/generateFunctionList.m	Wed Nov 23 19:22:13 2011 +0100
@@ -0,0 +1,51 @@
+function fcns = generateFunctionList()
+  
+  fcns = [];
+  % Get current verbose level
+  vl = LTPDAprefs.verboseLevel;
+  LTPDAprefs('Display', 'verboseLevel', -1)
+  % Add each user class
+  ucls = utils.helper.ltpda_userclasses;
+  
+  %% Build the infrastructure first
+  
+  % Now go through and add the contents
+  for jj=1:numel(ucls)
+    disp(sprintf('** Building: %s', ucls{jj}));
+    % add each algorithm for this class/category
+    [clmethods, infos] = utils.helper.getPublicMethods(ucls{jj});
+    % add each method to its subcategory
+    for ll=1:numel(clmethods)
+      ii = infos(ll);
+%       fprintf('  + adding method %s/%s\n', ucls{jj}, clmethods{ll});
+      a = local_minfo2algo(ii);
+      fcns = [fcns a];
+    end
+  end
+  % set verbose level again
+  LTPDAprefs('Display', 'verboseLevel', vl)
+  
+end
+
+function a = local_minfo2algo(ii)
+  
+  a = mpipeline.jltpda.LTPDAalgorithm;
+  a.setMname(ii.mname);
+  a.setMcategory(ii.mcategory);
+  a.setMclass(ii.mclass);
+  a.setMinInputs(ii.argsmin);
+  a.setMaxInputs(ii.argsmax);
+  a.setMinOutputs(ii.outmin);
+  a.setMaxOutputs(ii.outmax);
+  
+  % get default plist for this method
+  for pp = 1:numel(ii.sets)
+    set = ii.sets{pp};
+    mpl = ii.plists(pp);
+    % build java plist
+    jpl = LTPDAworkbench.mpl2jpl(mpl);
+    a.addSetPlist(set,jpl);
+  end
+  
+end
+