Skip to content

Commit

Permalink
Fix smac-validate (#762)
Browse files Browse the repository at this point in the history
Fix smac-validate
  • Loading branch information
filipbartek authored Aug 26, 2021
1 parent c50f531 commit 22077ce
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
5 changes: 5 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# 1.0.2

## Minor Changes
* Made smac-validate.py consistent with runhistory and tae.

# 1.0.1

## Minor Changes
Expand Down
6 changes: 4 additions & 2 deletions scripts/smac-validate.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
if cmd_folder not in sys.path:
sys.path.insert(0, cmd_folder)

from smac.runhistory.runhistory import average_cost
from smac.runhistory.runhistory import RunHistory
from smac.scenario.scenario import Scenario
from smac.stats.stats import Stats
Expand Down Expand Up @@ -83,13 +82,16 @@
scenario = Scenario(args_.scenario, cmd_options={'output_dir': ""})
traj_logger = TrajLogger(None, Stats(scenario))
trajectory = traj_logger.read_traj_aclib_format(args_.trajectory, scenario.cs)
stats = Stats(scenario)
if args_.tae == "old":
tae = ExecuteTARunOld(ta=scenario.ta,
stats=stats,
run_obj=scenario.run_obj,
par_factor=scenario.par_factor,
cost_for_crash=scenario.cost_for_crash)
if args_.tae == "aclib":
tae = ExecuteTARunAClib(ta=scenario.ta,
stats=stats,
run_obj=scenario.run_obj,
par_factor=scenario.par_factor,
cost_for_crash=scenario.cost_for_crash)
Expand All @@ -98,7 +100,7 @@

# Load runhistory
if args_.runhistory:
runhistory = RunHistory(average_cost)
runhistory = RunHistory()
for rh_path in args_.runhistory:
runhistory.update_from_json(rh_path, scenario.cs)
else:
Expand Down

0 comments on commit 22077ce

Please sign in to comment.