Skip to content

Commit

Permalink
Fixed path setting for colab, included OAT function copying after loa…
Browse files Browse the repository at this point in the history
…ding
  • Loading branch information
DimitriWeiss committed Oct 12, 2023
1 parent 3301de9 commit 6c46c2e
Show file tree
Hide file tree
Showing 30 changed files with 49 additions and 194 deletions.
25 changes: 0 additions & 25 deletions .readthedocs.yaml

This file was deleted.

9 changes: 0 additions & 9 deletions README.rst

This file was deleted.

21 changes: 0 additions & 21 deletions docs/Makefile

This file was deleted.

35 changes: 0 additions & 35 deletions docs/make.bat

This file was deleted.

3 changes: 0 additions & 3 deletions docs/requirements.txt

This file was deleted.

7 changes: 0 additions & 7 deletions docs/source/api.rst

This file was deleted.

52 changes: 0 additions & 52 deletions docs/source/conf.py

This file was deleted.

12 changes: 0 additions & 12 deletions docs/source/index.rst

This file was deleted.

21 changes: 0 additions & 21 deletions docs/source/usage.rst

This file was deleted.

8 changes: 0 additions & 8 deletions pyproject.toml

This file was deleted.

4 changes: 4 additions & 0 deletions up_ac/OAT_configurator.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,8 @@ def planner_feedback(config, instance, reader):
float: Feedback value based on the planner's performance.
"""
path = os.getcwd().rsplit('up-ac', 1)[0]
if path[-1] != "/":
path += "/"
path += 'up-ac/up_ac'
sys.path.append(r"{}".format(path))

Expand Down Expand Up @@ -242,6 +244,8 @@ def set_scenario(self, engine, param_space, gaci,
param_file = gaci.get_ps_oat(param_space)

path = os.getcwd().rsplit('up-ac', 2)[0]
if path[-1] != "/":
path += "/"
path += 'up-ac/up_ac'

path_to_xml = f'{path}/OAT/{engine}parameterTree.xml'
Expand Down
4 changes: 4 additions & 0 deletions up_ac/Smac_configurator.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,8 @@ def solve(config, metric, engine,
return feedback

path = os.getcwd().rsplit('up-ac', 1)[0]
if path[-1] != "/":
path += "/"
path += 'up-ac/up_ac/utils'

self.feedback_path = path
Expand Down Expand Up @@ -219,6 +221,8 @@ def optimize(self, feedback_function=None, gray_box=False):
if feedback_function is not None:
# Import feedback function, since dask cannot pickle local objects
path = os.getcwd().rsplit('up-ac', 1)[0]
if path[-1] != "/":
path += "/"
path += 'up-ac/up_ac/utils'
sys.path.append(r"{}".format(path))
from load_smac_feedback import get_feedback
Expand Down
2 changes: 2 additions & 0 deletions up_ac/examples/enhsp_Irace_configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@

# make sure test can be run from anywhere
path = os.getcwd().rsplit('up-ac', 1)[0]
if path[-1] != "/":
path += "/"
path += 'up-ac/up_ac'
if not os.path.isfile(sys.path[0] + '/configurators.py') and \
'up-ac' in sys.path[0]:
Expand Down
2 changes: 2 additions & 0 deletions up_ac/examples/enhsp_OAT_configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

# make sure test can be run from anywhere
path = os.getcwd().rsplit('up-ac', 1)[0]
if path[-1] != "/":
path += "/"
path += 'up-ac/up_ac'
if not os.path.isfile(sys.path[0] + '/configurators.py') and \
'up-ac' in sys.path[0]:
Expand Down
2 changes: 2 additions & 0 deletions up_ac/examples/enhsp_Smac_configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@

# make sure test can be run from anywhere
path = os.getcwd().rsplit('up-ac', 1)[0]
if path[-1] != "/":
path += "/"
path += 'up-ac/up_ac'
if not os.path.isfile(sys.path[0] + '/configurators.py') and \
'up-ac' in sys.path[0]:
Expand Down
2 changes: 2 additions & 0 deletions up_ac/examples/fast-downward_Irace_configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@

# make sure test can be run from anywhere
path = os.getcwd().rsplit('up-ac', 1)[0]
if path[-1] != "/":
path += "/"
path += 'up-ac/up_ac'
if not os.path.isfile(sys.path[0] + '/configurators.py') and \
'up-ac' in sys.path[0]:
Expand Down
2 changes: 2 additions & 0 deletions up_ac/examples/fast-downward_OAT_configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

# make sure test can be run from anywhere
path = os.getcwd().rsplit('up-ac', 1)[0]
if path[-1] != "/":
path += "/"
path += 'up-ac/up_ac'
if not os.path.isfile(sys.path[0] + '/configurators.py') and \
'up-ac' in sys.path[0]:
Expand Down
2 changes: 2 additions & 0 deletions up_ac/examples/fast-downward_Smac_configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@

# make sure test can be run from anywhere
path = os.getcwd().rsplit('up-ac', 1)[0]
if path[-1] != "/":
path += "/"
path += 'up-ac/up_ac'
if not os.path.isfile(sys.path[0] + '/configurators.py') and \
'up-ac' in sys.path[0]:
Expand Down
2 changes: 2 additions & 0 deletions up_ac/examples/lpg_Irace_configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@

# make sure test can be run from anywhere
path = os.getcwd().rsplit('up-ac', 1)[0]
if path[-1] != "/":
path += "/"
path += 'up-ac/up_ac'
if not os.path.isfile(sys.path[0] + '/configurators.py') and \
'up-ac' in sys.path[0]:
Expand Down
2 changes: 2 additions & 0 deletions up_ac/examples/lpg_OAT_configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

# make sure test can be run from anywhere
path = os.getcwd().rsplit('up-ac', 1)[0]
if path[-1] != "/":
path += "/"
path += 'up-ac/up_ac'
if not os.path.isfile(sys.path[0] + '/configurators.py') and \
'up-ac' in sys.path[0]:
Expand Down
2 changes: 2 additions & 0 deletions up_ac/examples/lpg_Smac_configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@

# make sure test can be run from anywhere
path = os.getcwd().rsplit('up-ac', 1)[0]
if path[-1] != "/":
path += "/"
path += 'up-ac/up_ac'
if not os.path.isfile(sys.path[0] + '/configurators.py') and \
'up-ac' in sys.path[0]:
Expand Down
2 changes: 2 additions & 0 deletions up_ac/examples/pyperplan_Irace_configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@

# make sure test can be run from anywhere
path = os.getcwd().rsplit('up-ac', 1)[0]
if path[-1] != "/":
path += "/"
path += 'up-ac/up_ac'
if not os.path.isfile(sys.path[0] + '/configurators.py') and \
'up-ac' in sys.path[0]:
Expand Down
2 changes: 2 additions & 0 deletions up_ac/examples/pyperplan_OAT_configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

# make sure test can be run from anywhere
path = os.getcwd().rsplit('up-ac', 1)[0]
if path[-1] != "/":
path += "/"
path += 'up-ac/up_ac'
if not os.path.isfile(sys.path[0] + '/configurators.py') and \
'up-ac' in sys.path[0]:
Expand Down
2 changes: 2 additions & 0 deletions up_ac/examples/pyperplan_Smac_configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@

# make sure test can be run from anywhere
path = os.getcwd().rsplit('up-ac', 1)[0]
if path[-1] != "/":
path += "/"
path += 'up-ac/up_ac'
if not os.path.isfile(sys.path[0] + '/configurators.py') and \
'up-ac' in sys.path[0]:
Expand Down
2 changes: 2 additions & 0 deletions up_ac/examples/tamer_Irace_configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@

# make sure test can be run from anywhere
path = os.getcwd().rsplit('up-ac', 1)[0]
if path[-1] != "/":
path += "/"
path += 'up-ac/up_ac'
if not os.path.isfile(sys.path[0] + '/configurators.py') and \
'up-ac' in sys.path[0]:
Expand Down
2 changes: 2 additions & 0 deletions up_ac/examples/tamer_OAT_configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

# make sure test can be run from anywhere
path = os.getcwd().rsplit('up-ac', 1)[0]
if path[-1] != "/":
path += "/"
path += 'up-ac/up_ac'
if not os.path.isfile(sys.path[0] + '/configurators.py') and \
'up-ac' in sys.path[0]:
Expand Down
2 changes: 2 additions & 0 deletions up_ac/examples/tamer_Smac_configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@

# make sure test can be run from anywhere
path = os.getcwd().rsplit('up-ac', 1)[0]
if path[-1] != "/":
path += "/"
path += 'up-ac/up_ac'
if not os.path.isfile(sys.path[0] + '/configurators.py') and \
'up-ac' in sys.path[0]:
Expand Down
2 changes: 2 additions & 0 deletions up_ac/utils/call_engine_OAT.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@

# Make sure modules are accesible
path = os.getcwd().rsplit('up_ac', 2)[0]
if path[-1] != "/":
path += "/"
path += 'up_ac'
sys.path.append(r"{}".format(path))

Expand Down
Loading

0 comments on commit 6c46c2e

Please sign in to comment.