Skip to content
Snippets Groups Projects
Commit 0593724d authored by Sean Sedwards's avatar Sean Sedwards
Browse files

Merge branch 'update_doc' into 'master'

update doc, scripts (from bitbucket)

See merge request !1
parents ae9f7219 596303ce
No related branches found
No related tags found
1 merge request!1update doc, scripts (from bitbucket)
...@@ -4,35 +4,39 @@ Requirements ...@@ -4,35 +4,39 @@ Requirements
============ ============
* Python 3.6 * Python 3.6
* `requirements.txt <../requirements.txt>`_ for package list. * Sphinx
* Please check `requirements.txt` for python package list.
Installation Installation
============ ============
* Run the install script: :code:`scripts/install.sh` * Run the install dependencies script: `./scripts/install_dependencies.sh` to install pip3 and required python packages.
Note: The script checks if dependencies folder exists in the project root folder. If it does, it will install from the local packages in that folder,
else will install required packages from the internet. If you do not have an internet connection and the dependencies folder does not exist,
you will need to run `./scripts/download_dependencies.sh` using a machine with an internet connection first and transfer that folder.
Documentation Documentation
============= =============
* For documentation, we use *Sphinx* * Open `./documentation/index.html` to view the documentation
* If `install.sh` was run, use :code:`scripts/generate_doc.sh launch` to view documentation or open `index.html <./documentation/index.html>`_ . * If the file does not exist, use command `./scripts/generate_doc.sh build` to generate documentation first. Note that this requires Sphinx to be installed.
* If not, use :code:`scripts/generate_doc.sh build` to generate documentation first.
Replicate Results Replicate Results
================= =================
These are the minimum steps required to replicate the results for simple_intersection environment. For a detailed user guide, it is recommended to view the documentation. These are the minimum steps required to replicate the results for simple_intersection environment. For a detailed user guide, it is recommended to view the documentation.
* Run `scripts/install.sh` * Run `./scripts/install_dependencies.sh` to install python dependencies.
* Low-level policies: * Low-level policies:
* To train all low-level policies from scratch: `python low_level_policy_main.py --train` * To train all low-level policies from scratch: `python3 low_level_policy_main.py --train`
* To train a single low-level, for example wait: `python low_level_policy_main.py --option=wait --train` * To train a single low-level, for example wait: `python3 low_level_policy_main.py --option=wait --train`
* To test these trained low-level policies: `python low_level_policy_main.py --test --saved_policy_in_root` * To test these trained low-level policies: `python3 low_level_policy_main.py --test --saved_policy_in_root`
* To test one of these trained low-level policies, for example wait: `python low_level_policy_main.py --option=wait --test --saved_policy_in_root` * To test one of these trained low-level policies, for example wait: `python3 low_level_policy_main.py --option=wait --test --saved_policy_in_root`
* High-level policy: * High-level policy:
* To train high-level policy from scratch using the given low-level policies: `python high_level_policy_main.py --train` * To train high-level policy from scratch using the given low-level policies: `python3 high_level_policy_main.py --train`
* To evaluate this trained high-level policy: `python high_level_policy_main.py --evaluate --saved_policy_in_root` * To evaluate this trained high-level policy: `python3 high_level_policy_main.py --evaluate --saved_policy_in_root`
* To run MCTS using the high-level policy: `python mcts.py` * To run MCTS using the high-level policy: `python3 mcts.py`
Coding Standards Coding Standards
================ ================
...@@ -42,7 +46,7 @@ It is not necessary to keep these in mind while coding, but before ...@@ -42,7 +46,7 @@ It is not necessary to keep these in mind while coding, but before
submitting a pull request, do these two steps for each python file you submitting a pull request, do these two steps for each python file you
have modified. have modified.
1. :code:`yapf -i YOUR_MODIFIED_FILE.py` 1. `yapf -i YOUR_MODIFIED_FILE.py`
2. :code:`docformatter --in-place YOUR_MODIFIED_FILE.py` 2. `docformatter --in-place YOUR_MODIFIED_FILE.py`
:code:`yapf` formats the code and :code:`docformatter` formats the docstrings. `yapf` formats the code and `docformatter` formats the docstrings.
\ No newline at end of file \ No newline at end of file
setuptools==39.2.0
wheel==0.31.1
numpy==1.14.3 numpy==1.14.3
pyglet==1.3.2 pyglet==1.3.2
Sphinx==1.7.8 Sphinx==1.7.8
yapf==0.23.0 yapf==0.23.0
docformatter==1.0 docformatter==1.0
recommonmark==0.4.0 recommonmark==0.4.0
tensorflow==1.8.0
keras-rl==0.4.2 keras-rl==0.4.2
h5py==2.8.0 h5py==2.8.0
gym==0.10.5 gym==0.10.5
stable_baselines==2.1.1 tqdm==4.23.4
\ No newline at end of file
#!/bin/bash #!/bin/bash
# files are to be relative from scripts directory
DEPENDENCY_DIRECTORY="../dependencies" DEPENDENCY_DIRECTORY="../dependencies"
PIP_PACKAGE_FOLDER="$DEPENDENCY_DIRECTORY/pip_packages" PIP_PACKAGE_FOLDER="$DEPENDENCY_DIRECTORY/pip_packages"
PIP_SETUP_FOLDER="$DEPENDENCY_DIRECTORY/pip" DEB_PACKAGE_FOLDER="$DEPENDENCY_DIRECTORY/deb"
PIP_FILE_NAME="pip-18.1"
REQUIREMENTS_FILE="../requirements.txt" REQUIREMENTS_FILE="../requirements.txt"
PIP_LINK="https://files.pythonhosted.org/packages/45/ae/8a0ad77defb7cc903f09e551d88b443304a9bd6e6f124e75c0fbbf6de8f7/pip-18.1.tar.gz"
\ No newline at end of file # DEB links
DEB_LINKS=("http://archive.ubuntu.com/ubuntu/pool/universe/p/python-pip/python3-pip_9.0.1-2_all.deb" \
"http://archive.ubuntu.com/ubuntu/pool/universe/p/python-pip/python-pip-whl_9.0.1-2_all.deb" \
"https://launchpadlibrarian.net/363338860/python3-lib2to3_3.6.5-3_all.deb" \
"https://launchpadlibrarian.net/363338856/python3-distutils_3.6.5-3_all.deb")
#!/bin/bash #!/bin/bash
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
source dependencies_config.sh source "$SCRIPT_DIR/dependencies_config.sh"
# Create folders # Create folders
mkdir $DEPENDENCY_DIRECTORY mkdir $SCRIPT_DIR/$DEPENDENCY_DIRECTORY
mkdir $PIP_SETUP_FOLDER mkdir $SCRIPT_DIR/$DEB_PACKAGE_FOLDER
mkdir $PIP_PACKAGE_FOLDER mkdir $SCRIPT_DIR/$PIP_PACKAGE_FOLDER
# Download pip # Download debs
wget -P $PIP_SETUP_FOLDER $PIP_LINK for LINK in "${DEB_LINKS[@]}"
do
:
wget -P $SCRIPT_DIR/$DEB_PACKAGE_FOLDER "$LINK"
done
# Download pip packeges using requirements file # Download pip packeges using requirements file
pip download -r $REQUIREMENTS_FILE -d $PIP_PACKAGE_FOLDER pip download -r $SCRIPT_DIR/$REQUIREMENTS_FILE -d $SCRIPT_DIR/$PIP_PACKAGE_FOLDER
\ No newline at end of file \ No newline at end of file
#!/bin/bash
sh ./install_dependencies.sh
sh ./generate_doc.sh clean
sh ./generate_doc.sh build
#!/bin/bash #!/bin/bash
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
source $SCRIPT_DIR/dependencies_config.sh
source dependencies_config.sh cd $SCRIPT_DIR
# Install pip # Install python3-pip
if ! [ -x "$(command -v pip3)" ]; then echo "Installing python3-pip and dependant packages..."
echo "Installing pip3..." DEB_LIST=""
if [ -d "$DEPENDENCY_DIRECTORY" ]; then if [ -d "$DEPENDENCY_DIRECTORY" ]; then
tar -xvzf "$PIP_SETUP_FOLDER/$PIP_FILE_NAME.tar.gz" cd $DEB_PACKAGE_FOLDER
python3 "./$PIP_FILE_NAME/setup.py" install for filename in *.deb; do
rm -rf "./$PIP_FILE_NAME" DEB_LIST+="$filename "
else done
sudo apt-get update sudo dpkg -i $DEB_LIST
sudo apt-get install python3-pip cd $SCRIPT_DIR
fi else
sudo apt-get update
sudo apt-get install python3-pip
fi fi
# Install packages in requirements.txt # Install packages in requirements.txt
if [ -d "$DEPENDENCY_DIRECTORY" ]; then if [ -d "$DEPENDENCY_DIRECTORY" ]; then
pip3 install --no-index --find-links=$PIP_PACKAGE_FOLDER -r $REQUIREMENTS_FILE --user pip3 install --no-index --find-links=$PIP_PACKAGE_FOLDER setuptools
pip3 install --no-index --find-links=$PIP_PACKAGE_FOLDER wheel
pip3 install --no-index --find-links=$PIP_PACKAGE_FOLDER -r $REQUIREMENTS_FILE
else else
pip3 install -r $REQUIREMENTS_FILE --user pip3 install -r $REQUIREMENTS_FILE --user
fi fi
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment