Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Return results when the algorithms finish #173

Merged
merged 1 commit into from
Aug 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions marllib/marl/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -309,11 +309,11 @@ def fit(self, env: Tuple[MultiAgentEnv, Dict], model: Tuple[Any, Dict], stop: Di
self.config_dict['algorithm'] = self.name

if self.algo_type == "IL":
run_il(self.config_dict, env_instance, model_class, stop=stop)
return run_il(self.config_dict, env_instance, model_class, stop=stop)
elif self.algo_type == "VD":
run_vd(self.config_dict, env_instance, model_class, stop=stop)
return run_vd(self.config_dict, env_instance, model_class, stop=stop)
elif self.algo_type == "CC":
run_cc(self.config_dict, env_instance, model_class, stop=stop)
return run_cc(self.config_dict, env_instance, model_class, stop=stop)
else:
raise ValueError("not supported type {}".format(self.algo_type))

Expand Down
2 changes: 2 additions & 0 deletions marllib/marl/algos/run_cc.py
Original file line number Diff line number Diff line change
Expand Up @@ -195,3 +195,5 @@ def run_cc(exp_info, env, model, stop=None):
restore_config)

ray.shutdown()

return results
3 changes: 3 additions & 0 deletions marllib/marl/algos/run_il.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,3 +153,6 @@ def run_il(exp_info, env, model, stop=None):
results = POlICY_REGISTRY[exp_info["algorithm"]](model, exp_info, run_config, env_info, stop_config,
restore_config)
ray.shutdown()

return results

3 changes: 3 additions & 0 deletions marllib/marl/algos/run_vd.py
Original file line number Diff line number Diff line change
Expand Up @@ -208,3 +208,6 @@ def run_vd(exp_info, env, model, stop=None):
results = POlICY_REGISTRY[exp_info["algorithm"]](model, exp_info, run_config, env_info, stop_config,
restore_config)
ray.shutdown()

return results