Skip to content

Commit

Permalink
(#67) Added seed parameter for reproducibility
Browse files Browse the repository at this point in the history
  • Loading branch information
SevgiAkten committed Nov 4, 2024
1 parent 47779a6 commit b2dba52
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 3 deletions.
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,6 @@ print("Best solution:", result[1], "\nBest solution chromosome:", result[0])
# Best solution: 0.0
# Best solution chromosome: [0.0, 0.0, 0.0, 0.0, 0.0]

# Note that the result could be different because the algorithm includes randomness.
```

We have provided a basic example above. If you're interested in exploring more examples, you have two options:
Expand Down
1 change: 0 additions & 1 deletion paper/paper.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,6 @@ print("Best solution:", result[1], "\nBest solution chromosome:", result[0])
# Best solution: 0.0
# Best solution chromosome: [0.0, 0.0, 0.0, 0.0, 0.0]

# Note that the result could be different because the algorithm includes randomness.
```


Expand Down
3 changes: 2 additions & 1 deletion pycellga/optimizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,8 @@
from typing import Callable, List, Tuple
from collections.abc import Callable


np.random.seed(100)
random.seed(100)

def cga(
n_cols: int,
Expand Down

0 comments on commit b2dba52

Please sign in to comment.