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
cd155a58
Commit
cd155a58
authored
Apr 08, 2022
by
Mario Teixeira Parente
Browse files
Merge remote-tracking branch 'base/main' into main
parents
545e21b6
81815628
Changes
3
Hide whitespace changes
Inline
Side-by-side
lib/tas/benchmarking.py
View file @
cd155a58
...
...
@@ -246,10 +246,9 @@ class BenefitMeasureApproximationErrorByNorm(BenefitMeasure):
class
TASAutonomousApproach
():
def
__init__
(
self
,
name
:
str
,
random_see
d
:
int
)
->
None
:
def
__init__
(
self
,
name
:
str
,
i
d
:
int
)
->
None
:
self
.
name
=
name
self
.
id
=
random_seed
self
.
random_state
=
np
.
random
.
RandomState
(
seed
=
random_seed
)
self
.
id
=
id
@
abstractmethod
def
initialize
(
self
,
cost_measures
:
list
[
CostMeasure
],
test_case
:
TASTestCase
,
...
...
tas/approaches/dummies.py
View file @
cd155a58
...
...
@@ -12,8 +12,10 @@ class RandomnessApproach(TASAutonomousApproach):
"""Class representing an autonomous approach that measures uniformly at random
within the `limits`"""
def
__init__
(
self
,
random_seed
:
int
)
->
None
:
super
().
__init__
(
"approach_random"
,
random_seed
)
def
__init__
(
self
,
id
:
int
)
->
None
:
super
().
__init__
(
"approach_random"
,
id
)
self
.
random_state
=
np
.
random
.
default_rng
(
seed
=
id
)
def
initialize
(
self
,
cost_measures
:
list
[
CostMeasure
],
test_case
:
TASTestCase
,
cost_milestone_values
:
list
[
list
[
float
]],
metric
:
AngleMapInducedMetric
)
\
...
...
@@ -37,8 +39,8 @@ class GridApproach(TASAutonomousApproach):
"""Class representing an autonomous approach that measures on a regular grid
within the `limits`"""
def
__init__
(
self
,
random_see
d
:
int
)
->
None
:
super
().
__init__
(
"approach_grid"
,
random_see
d
)
def
__init__
(
self
,
i
d
:
int
)
->
None
:
super
().
__init__
(
"approach_grid"
,
i
d
)
def
initialize
(
self
,
cost_measures
:
list
[
CostMeasure
],
test_case
:
TASTestCase
,
cost_milestone_values
:
list
[
list
[
float
]],
metric
:
AngleMapInducedMetric
)
\
...
...
tas/setting.py
View file @
cd155a58
...
...
@@ -16,8 +16,8 @@ from tas.approaches import ARIANEApproach as Approach
## Approach ##
random_see
d
=
0
if
len
(
sys
.
argv
)
<
2
else
int
(
sys
.
argv
[
1
])
approach
=
Approach
(
random_see
d
)
i
d
=
0
if
len
(
sys
.
argv
)
<
2
else
int
(
sys
.
argv
[
1
])
approach
=
Approach
(
i
d
)
##
## Folders ##
...
...
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