-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added command line functions to plan and tune
- "jaxplan plan" will plan - "jaxplan tune" will tune
- Loading branch information
1 parent
dcb6aed
commit 016bd87
Showing
5 changed files
with
45 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import argparse | ||
|
||
from pyRDDLGym_jax.examples import run_plan, run_tune | ||
|
||
def main(): | ||
parser = argparse.ArgumentParser(description="Command line parser for the JaxPlan planner.") | ||
subparsers = parser.add_subparsers(dest="jaxplan", required=True) | ||
|
||
# planning | ||
parser_plan = subparsers.add_parser("plan", help="Executes JaxPlan on a specified RDDL problem and method (slp, drp, or replan).") | ||
parser_plan.add_argument('args', nargs=argparse.REMAINDER) | ||
|
||
# tuning | ||
parser_tune = subparsers.add_parser("tune", help="Tunes JaxPlan on a specified RDDL problem and method (slp, drp, or replan).") | ||
parser_tune.add_argument('args', nargs=argparse.REMAINDER) | ||
|
||
# dispatch | ||
args = parser.parse_args() | ||
if args.jaxplan == "plan": | ||
run_plan.run_from_args(args.args) | ||
elif args.jaxplan == "tune": | ||
run_tune.run_from_args(args.args) | ||
else: | ||
parser.print_help() | ||
|
||
if __name__ == "__main__": | ||
main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters