Skip to content

Commit

Permalink
fixed test and replaced todo
Browse files Browse the repository at this point in the history
  • Loading branch information
lukapecnik authored and GregaVrbancic committed Apr 15, 2019
1 parent 9a5cd71 commit d635cca
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
10 changes: 5 additions & 5 deletions NiaPy/algorithms/basic/foa.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,11 @@ def typeParameters():
Returns:
Dict[str, Callable]:
* lt (Callable[[int], bool]): TODO.
* al (Callable[[int], bool]): TODO.
* lsc (Callable[[int], bool]): TODO.
* gsc (Callable[[int], bool]): TODO.
* tr (Callable[[float], bool]): TODO.
* lt (Callable[[int], bool]): Checks if life time parameter has a proper value.
* al (Callable[[int], bool]): Checks if area limit parameter has a proper value.
* lsc (Callable[[int], bool]): Checks if local seeding changes parameter has a proper value.
* gsc (Callable[[int], bool]): Checks if global seeding changes parameter has a proper value.
* tr (Callable[[float], bool]): Checks if transfer rate parameter has a proper value.
See Also:
* :func:`NiaPy.algorithms.algorithm.Algorithm.typeParameters`
Expand Down
4 changes: 2 additions & 2 deletions NiaPy/tests/test_foa.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ def test_type_parameters(self):
self.assertFalse(tp['gsc'](0))
self.assertFalse(tp['gsc'](-1))
self.assertFalse(tp['gsc'](1.0))
self.assertTrue(tp['tr'](1))
self.assertTrue(tp['tr'](1.0))
self.assertTrue(tp['tr'](0.5))
self.assertTrue(tp['tr'](0))
self.assertTrue(tp['tr'](0.0))
self.assertFalse(tp['tr'](-1))
self.assertFalse(tp['tr'](1.1))

Expand Down
2 changes: 1 addition & 1 deletion examples/run_foa.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@
task = StoppingTask(D=10, nFES=10000, optType=OptimizationType.MINIMIZATION, benchmark=Sphere())
algo = ForestOptimizationAlgorithm(NP=20, lt=5, lsc=1, gsc=1, al=20, tr=0.35)
best = algo.run(task=task)
print best
print(best)

0 comments on commit d635cca

Please sign in to comment.