14.01.2013 Views

Global Optimization Toolbox User's Guide - MathWorks

Global Optimization Toolbox User's Guide - MathWorks

Global Optimization Toolbox User's Guide - MathWorks

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Vectorized is 'off' — Vectorized determines whether ga evaluates<br />

an entire population with one function call in a vectorized fashion. If<br />

Vectorized is 'on', ga does not distribute the evaluation of the function,<br />

so does not use parfor.<br />

ga can have a hybrid function that runs after it finishes; see “Using a Hybrid<br />

Function” on page 5-104. If you want the hybrid function to take advantage<br />

of parallel computation, set its options separately so that UseParallel is<br />

'always'. If the hybrid function is patternsearch, setCompletePoll to 'on'<br />

so that patternsearch runs in parallel.<br />

If the hybrid function is fmincon, set the following options with optimset to<br />

have parallel gradient estimation:<br />

GradObj must not be 'on' — it can be 'off' or [].<br />

Or, if there is a nonlinear constraint function, GradConstr must not be<br />

'on' — it can be 'off' or [].<br />

To find out how to write options for the hybrid function, see “Parallel Hybrid<br />

Functions” on page 8-16.<br />

Parallel Computing with gamultiobj<br />

Parallel computing with gamultiobj works almost the same as with ga. For<br />

detailed information, see “Genetic Algorithm” on page 8-8.<br />

The difference between parallel computing with gamultiobj and ga has to<br />

do with the hybrid function. gamultiobj allows only one hybrid function,<br />

fgoalattain. This function optionally runs after gamultiobj finishes its run.<br />

Each individual in the calculated Pareto frontier, that is, the final population<br />

found by gamultiobj, becomes the starting point for an optimization using<br />

fgoalattain. These optimizations run in parallel. The number of processors<br />

performing these optimizations is the smaller of the number of individuals<br />

and the size of your matlabpool.<br />

For fgoalattain toruninparallel,setits options correctly:<br />

fgoalopts = optimset('UseParallel','always')<br />

gaoptions = gaoptimset('HybridFcn',{@fgoalattain,fgoalopts});<br />

Background<br />

8-9

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!