From 97ee296a8fff1ba22b1d7aec9526ad57394fe215 Mon Sep 17 00:00:00 2001 From: "carter.fendley" Date: Fri, 14 Jun 2024 16:26:39 -0400 Subject: [PATCH] Minor script / README updates --- examples/QTable/README.md | 13 ++++++++++++- examples/QTable/scripts/sim_launch.sh | 3 ++- examples/pLearn/README.md | 14 ++++++++++++-- 3 files changed, 26 insertions(+), 4 deletions(-) diff --git a/examples/QTable/README.md b/examples/QTable/README.md index 8f7857c..3630219 100644 --- a/examples/QTable/README.md +++ b/examples/QTable/README.md @@ -110,12 +110,23 @@ To launch a gui simulation and the model, we can use the following script syntax **NOTE:** If run without a `--model` flag, the run script will run whatever model is defined by `DEFAULT_RUN_MODEL` in `model/constants.py` Further, you can change the name of the "enemy" that your agent will look for by the following syntax -``` +```bash ./run.sh --model trained/my_cool_model/3000.npy --enemy evan ``` This is helpful using trained agents in missions which they were not trained in. +## Testing models + +To test a model's preformance you can use the following script syntax +```bash +./test.sh +# Or +./test.sh --model trained/my_cool_model/3000.npy +# Or +./test.sh --model trained/my_cool_model/3000.npy --episodes 1000 +``` + ## Debugging ### Debugging the simulation while training diff --git a/examples/QTable/scripts/sim_launch.sh b/examples/QTable/scripts/sim_launch.sh index cf95037..8da07cd 100755 --- a/examples/QTable/scripts/sim_launch.sh +++ b/examples/QTable/scripts/sim_launch.sh @@ -4,6 +4,7 @@ DIRNAME="$(dirname $0)" cd $DIRNAME TIME_WARP="10" +# TIME_WARP="1" # Change below to --log for logging LOGGING="" @@ -26,7 +27,7 @@ cd .. cd shoreside ./launch_shoreside.sh --no_gui $LOGGING $TIME_WARP >& /dev/null & - # ./launch_shoreside.sh $LOGGING $TIME_WARP >& /dev/null & +# ./launch_shoreside.sh $LOGGING $TIME_WARP >& /dev/null & sleep 5 echo "DEPLOYING" uPokeDB targ_shoreside.moos DEPLOY_ALL=true MOOS_MANUAL_OVERRIDE_ALL=false diff --git a/examples/pLearn/README.md b/examples/pLearn/README.md index 54bf42c..102a665 100644 --- a/examples/pLearn/README.md +++ b/examples/pLearn/README.md @@ -29,10 +29,12 @@ Firstly, make sure your trained model exists in a file structure like this... Launching the simulation comes in two steps. You will need two consoles **INSIDE** the moos-ivp-agent's docker container... so utilize the `./docker.sh connect` functionality. -You can use the `run.sh` script to launch both the MOOS-IvP simulation and the model. +You can use the `run.sh` script to launch both the MOOS-IvP simulation and the model. A optional `--debug` flag can be added to launch some graphs showing internal model state. -``` +```bash ./run.sh +# Or +./run.sh --debug ``` **OR** @@ -43,6 +45,14 @@ You can use the `run.sh` script to launch both the MOOS-IvP simulation and the m **NOTE:** If no `--model` is provided, the `run.py` script will run the model in the `model/trained/topModel/model` directory. +For an example you can use the an existing pre-trained model: + +```bash +./run.sh --model model/trained/topModel/model/ +# Or +./run.sh --model model/trained/topModel/model/ --debug +``` + After the GUI window pops up, you can push the `DEPLOY` button in the lower right. ## Debugging existing models