Total Complexity | 3 |
Total Lines | 14 |
Duplicated Lines | 0 % |
Changes | 2 | ||
Bugs | 0 | Features | 0 |
1 | """Contains WholeGroupPso class.""" |
||
19 | class WholeGroupPso(object): |
||
20 | """Optimize whole group.""" |
||
21 | |||
22 | def __init__(self, process, number_of_particles): |
||
23 | self.process = process |
||
24 | self.number_of_particles = number_of_particles |
||
25 | |||
26 | def optimize(self, ordered_stages_to_optimize): |
||
27 | swarm = Swarm(self.process, ordered_stages_to_optimize, |
||
28 | self.number_of_particles) |
||
29 | swarm.initialize() |
||
30 | while OptimizationController.should_continue( |
||
31 | ordered_stages_to_optimize): |
||
32 | swarm.do_single_iteration() |
||
33 |
The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:
If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.