comparison main/ga/inst/__ga_scores__.m @ 9711:d221e75701b0 octave-forge

ga: improve error message
author slackydeb
date Thu, 15 Mar 2012 02:23:42 +0000
parents 2d730c084382
children f21fb48bc6a0
comparison
equal deleted inserted replaced
9710:7df2e3ca6195 9711:d221e75701b0
12 ## 12 ##
13 ## You should have received a copy of the GNU General Public License 13 ## You should have received a copy of the GNU General Public License
14 ## along with this program; If not, see <http://www.gnu.org/licenses/>. 14 ## along with this program; If not, see <http://www.gnu.org/licenses/>.
15 15
16 ## Author: Luca Favatella <slackydeb@gmail.com> 16 ## Author: Luca Favatella <slackydeb@gmail.com>
17 ## Version: 5.5 17 ## Version: 5.5.1
18 18
19 function Scores = __ga_scores__ (problem, Population) 19 function Scores = __ga_scores__ (problem, Population)
20 if (strcmp (problem.options.Vectorized, "on")) ## using vectorized evaluation 20 if (strcmp (problem.options.Vectorized, "on")) ## using vectorized evaluation
21 if (strcmp (problem.options.UseParallel, "always")) 21 if (strcmp (problem.options.UseParallel, "always"))
22 warning ("'Vectorized' option is 'on': ignoring 'UseParallel' \ 22 warning ("'Vectorized' option is 'on': ignoring 'UseParallel' \
26 else ## not using vectorized evaluation 26 else ## not using vectorized evaluation
27 if (! strcmp (problem.options.Vectorized, "off")) 27 if (! strcmp (problem.options.Vectorized, "off"))
28 error ("'Vectorized' option must be 'on' or 'off'"); 28 error ("'Vectorized' option must be 'on' or 'off'");
29 endif 29 endif
30 if (strcmp (problem.options.UseParallel, "always")) ## using parallel evaluation 30 if (strcmp (problem.options.UseParallel, "always")) ## using parallel evaluation
31 error ("TODO: implement parallel evaluation of objective \ 31 error ("TODO: implement parallel evaluation of objective function");
32 function"); ## TODO
33 else ## using serial evaluation (i.e. loop) 32 else ## using serial evaluation (i.e. loop)
34 if (! strcmp (problem.options.UseParallel, "never")) 33 if (! strcmp (problem.options.UseParallel, "never"))
35 error ("'UseParallel' option must be 'always' or 'never'"); 34 error ("'UseParallel' option must be 'always' or 'never'");
36 endif 35 endif
37 [nrP ncP] = size (Population); 36 [nrP ncP] = size (Population);