Skip to content

Commit c5d75dc

Browse files
committed
[Noisifier] improve doctest example
1 parent 9a0dd3e commit c5d75dc

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

build/python/src/cocoex/noiser.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,11 +56,12 @@ class Noisifier:
5656
### prepare
5757
suite = cocoex.Suite(suite_name, "", "")
5858
observer = cocoex.Observer(suite_name, "")
59+
noisifier = cocoex.noiser.Noisifier() # wrapper without internal state
5960
6061
### go
6162
for problem in suite: # this loop may take several minutes or more
6263
problem.observe_with(observer) # generates the data for cocopp
63-
problem = cocoex.noiser.Noisifier().noisify(problem) # a Noisifier
64+
problem = noisifier.noisify(problem) # wrap problem as noisy
6465
fmin(problem, problem.initial_solution, disp=False)
6566
6667
The `problem` is now a `Noisifier` but it still abides by the interface

0 commit comments

Comments
 (0)