Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
AINX
base-ariane-fork
Commits
59d48d56
Commit
59d48d56
authored
Apr 08, 2022
by
Mario Teixeira Parente
Browse files
rename 'rng' to 'random_state'
parent
077f9b66
Changes
2
Hide whitespace changes
Inline
Side-by-side
lib/tas/benchmarking.py
View file @
59d48d56
...
...
@@ -249,7 +249,7 @@ class TASAutonomousApproach():
def
__init__
(
self
,
name
:
str
,
random_seed
:
int
)
->
None
:
self
.
name
=
name
self
.
id
=
random_seed
self
.
r
ng
=
np
.
random
.
default_rng
(
seed
=
random_seed
)
self
.
r
andom_state
=
np
.
random
.
default_rng
(
seed
=
random_seed
)
@
abstractmethod
def
initialize
(
self
,
cost_measures
:
list
[
CostMeasure
],
test_case
:
TASTestCase
,
...
...
tas/approaches/dummies.py
View file @
59d48d56
...
...
@@ -26,7 +26,7 @@ class RandomnessApproach(TASAutonomousApproach):
def
next
(
self
)
->
Tuple
[
list
[
float
],
float
]:
while
True
:
location
=
self
.
r
ng
.
uniform
(
low
=
self
.
limits
[:,
0
],
high
=
self
.
limits
[:,
1
])
location
=
self
.
r
andom_state
.
uniform
(
low
=
self
.
limits
[:,
0
],
high
=
self
.
limits
[:,
1
])
# Check if location is valid
if
len
(
filter_valid_locations
([
location
],
test_case
=
self
.
test_case
))
>
0
:
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment