Commit 59d48d56 authored by Mario Teixeira Parente's avatar Mario Teixeira Parente
Browse files

rename 'rng' to 'random_state'

parent 077f9b66
...@@ -249,7 +249,7 @@ class TASAutonomousApproach(): ...@@ -249,7 +249,7 @@ class TASAutonomousApproach():
def __init__(self, name: str, random_seed: int) -> None: def __init__(self, name: str, random_seed: int) -> None:
self.name = name self.name = name
self.id = random_seed self.id = random_seed
self.rng = np.random.default_rng(seed=random_seed) self.random_state = np.random.default_rng(seed=random_seed)
@abstractmethod @abstractmethod
def initialize(self, cost_measures: list[CostMeasure], test_case: TASTestCase, def initialize(self, cost_measures: list[CostMeasure], test_case: TASTestCase,
......
...@@ -26,7 +26,7 @@ class RandomnessApproach(TASAutonomousApproach): ...@@ -26,7 +26,7 @@ class RandomnessApproach(TASAutonomousApproach):
def next(self) -> Tuple[list[float], float]: def next(self) -> Tuple[list[float], float]:
while True: while True:
location = self.rng.uniform(low=self.limits[:, 0], high=self.limits[:, 1]) location = self.random_state.uniform(low=self.limits[:, 0], high=self.limits[:, 1])
# Check if location is valid # Check if location is valid
if len(filter_valid_locations([location], test_case=self.test_case)) > 0: if len(filter_valid_locations([location], test_case=self.test_case)) > 0:
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment