Skip to content

Commit

Permalink
Add option to specify filename for instances in GameInstanceGenerator…
Browse files Browse the repository at this point in the history
… (cleaned) (#44)

* add option to specify filename for instances in GameInstanceGenerator.generate(), default is set to instances.json to allow for backward compatibility

* inline no where else used storing function

---------

Co-authored-by: Anne Beyer <anne.beyer@uni-potsdam.de>
  • Loading branch information
phisad and Anne Beyer committed Feb 8, 2024
1 parent 5dabe26 commit 71c09ec
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions clemgame/clemgame.py
Original file line number Diff line number Diff line change
Expand Up @@ -859,12 +859,9 @@ def add_game_instance(self, experiment: Dict, game_id):
def on_generate(self):
raise NotImplementedError()

def generate(self):
def generate(self, filename="instances.json"):
self.on_generate()
self.store()

def store(self):
self.store_file(self.instances, "instances.json", sub_dir="in")
self.store_file(self.instances, filename, sub_dir="in")


def load_benchmarks(do_setup: bool = True) -> List[GameBenchmark]:
Expand Down

0 comments on commit 71c09ec

Please sign in to comment.