Project exam for the course in "Combinatorial Decision Making and Optimization" of the Master's degree in Artificial Intelligence, University of Bologna.
- Pelinsu Acar (CP)
- Daniele Napolitano (SAT)
- Alessandro Folloni (MIP)
- Leonardo Petrilli (SMT)
First download only the Dockerfile, then on the working directory run:
docker build . -t cdmo
Then to run it and enter the shell:
docker run -it cdmo
NOTE: Be sure to stay on the main /src directory when running all the commands below!
To run the code for all the instances in CP, run the following command:
./CP/run_CP_all_instances.sh <solver_name> <model_name.mzn>
Where the possible solvers are:
- chuffed
- gecode
Here is an example for the CP_A_Chuffed.mzc model:
./CP/run_CP_all_instances.sh chuffed CP_A_Chuffed.mzn
To run the code for a specific instance in CP, run the following command:
./CP/run_CP_instance.sh <solver_name> <model_name.mzn> <instance_name.dzn> <output_file_name.txt>
Here is an example for the instance 1 on CP_A_Chuffed.mzc model:
./CP/run_CP_instance.sh chuffed CP_A_Chuffed.mzn inst01.dzn result.txt
After running all the models, to generate the final json files, run:
python3 ./CP/CP_json_writer.py
making sure that the output .txt files are inside ./CP/Outputs folder
To run the SAT models, run:
./SAT/run_all_sat.sh
Since we used the Gurobi solver, a licence is needed in order to run the biggest instances.
You will need to add your license parameters in the following lines and uncomment them before running the model:
"""
params = {
"WLSACCESSID": '',
"WLSSECRET": '',
"LICENSEID": ,
}
env = gp.Env(params=params)
"""
After doing that, you can run the model with the following command:
python3 ./MIP/MIP.py
To run the SMT part, run:
python3 ./SMT/SMT.py
The folder time_plots contains the plots showing the times of execcution for each model, for the instances where at least one optimal solution has been found.
(Disclaimer: Some of them are hard to read, but it serves just as an easier way to see all run times instead of having to look into each json file, and they are not included in the report file)
Running the time_plot_maker.py script will automatically create all the plots.