Code located at https://github.com/SirSkaro/cs-7641-assignment-2
- Clone the repository
- Import the project as a Maven project into your favorite IDE (that has Maven support)
- Configure the project to use JDK17 (JDK8 or 11 will probably work too)
- Clone the repository
- Setup and activate a virtual environment with Python 3.10.
- If using Anaconda/miniconda, you can simply use a command like "conda create -n bchurchill6_assignment1 python=3.10".
- Otherwise, download a distribution of Python 3.10 manually and use it to run "python -m venv bchurchill6_assignment2"
- Install requirements. With the base of the project as the working directory, you can run the command "pip install -r requirements.txt"
Create a run configuration using Assignment.java
as the entry point. One of four commandline arguments are required:
part1
: Randomized optimization algorithms over 3 problemsexport1
: Perform the optimization problems many times and print the results to a .csv filespart2
: Randomized optimization algorithms to train neural networkexport2
: Randomized optimization algorithms to train neural network multiple times and print the results to .csv files
No other configuration is possible from the commandline. Any other modification will require code changes.
Running export1
or export2
will create .csv files where each line contains a three-tuple of <train time, iterations, score>. Don't do export2
unless you want to hear your CPU scream for 12+ hours. These .csv files are used by the Python scripts to create graphs.
First, copy any CSV files created from the Java code into the root directory of the Python code.
Using an interactive interpreter (with your virtual environments), run the following code:
from graph import Problem
import graph
# graph results for 150-Queens
graph.graph_problem(Problem.N_QUEENS)
# graph results for Four Peaks
graph.graph_problem(Problem.FOUR_PEAKS)
# graph results for Traveling Salesman
graph.graph_problem(Problem.TRAVELING_SALESMAN)
#graph results for Neural Network
graph.graph_nn()