2 """
3 Differential evolution optimizer.
4
5 This implements `park.fit.Fitter`.
6 """
7
9 """
10 Parameters are defined by `park.fitmc.fitmc`.
11 """
12 pass
13
14 - def fit(self, objective, handler):
15 """
16 Run a monte carlo fit.
17
18 This procedure maps a local optimizer across a set of initial points.
19 """
20 fitde(objective, self.localfit, self.start_points, handler)
21
22 -def fitde(fitness,n,handler):
23 """
24 Run a differential evolution fit.
25
26 This procedure maps a local optimizer across a set of n initial points.
27 The initial parameter value defined by the fitness parameters defines
28 one initial point. The remainder are randomly generated within the
29 bounds of the problem.
30
31 localfit is the local optimizer to use. It should be a bounded
32 optimizer following the `park.fitmc.LocalFit` interface.
33
34 handler accepts updates to the current best set of fit parameters.
35 See `park.fitresult.FitHandler` for details.
36 """
37 P = fitutil.populate(fitness.fit_parameters(), radius=100, elitism=True)
38 pmap.pmapreduce(MapMC(localfit,fitness),
39 CollectMC(n,handler),
40 P)
41