diff --git a/propulate/propagators/ga.py b/propulate/propagators/ga.py index 3bef081..164362d 100644 --- a/propulate/propagators/ga.py +++ b/propulate/propagators/ga.py @@ -85,7 +85,10 @@ def __call__(self, ind: Individual) -> Individual: # type: ignore[override] for i in to_mutate: if isinstance(ind[i], int): # Return randomly selected element from int range(start, stop, step). - ind[i] = self.rng.randint(*self.limits[i]) + if len(self.limits[i]) == 2: + ind[i] = self.rng.randint(*self.limits[i]) + else: + ind[i] = self.rng.choice(self.limits[i]) elif isinstance(ind[i], float): # Return random floating point number within limits. ind[i] = self.rng.uniform(*self.limits[i])