How to run
To run A-CMA DQN-based agents, you should run two applications along side: the A-CMA refactoring tool and its DQN server.
Run DQN server
DQN server contains a deep neural network named Deep Q-Network which is developed by python language. So in order to run DQN server, you should have python 3 installed and running on your computer.
First of all, clone DQN server from GitHub:
$ git clone https://github.com/hrahmadi71/acma_dqn_server.git
Then you should go to the directory and create a virtual environment in it:
$ cd acma_dqn_server
$ python3 -m venv .venv
After you’ve create virtual environment, you should enable it. On Linux or Mac, use this command:
$ source .venv/bin/activate
On Windows, use this command:
$ .venv\Scrips\activate
After enabling virtual environment, you can install the requirements of DQN server:
(.venv)$ pip install -r requirements.txt
Then run the server (on the default address which is localhost:5000
):
(.venv)$ flask run
There’s 4 pre-trained models which you can use for refactoring: model_1
to model_4
. To use one of pretrained models, go to address localhost:5000
via a web-browser, you must see a swagger panel. Then in the swagger panel, click on /load_weights/
then click on Try it out
button and change the string
to the name of a model. for example:
{
"model_name": "model_1"
}
Run A-CMA
In order to run A-CMA tool, you must have java installed and running on your computer. After you’ve installed and configured java on your computer, you can run A-CMA, so first of all, clone it from its repository:
$ git clone https://github.com/hrahmadi71/a-cma.git
Then go to the a-cma
directory:
$ cd ./a-cma
Now you can compile a-cma
or run it without compiling. If you are in Linux or Mac you can run it via bash:
$ bash A-CMA/run.sh
If you are using Windows you can run the bat file:
$ .\A-CMA\run.bat