Skip to content

pelinsuacar/CDMO_Project

Repository files navigation

CDMO_Project

Project exam for the course in "Combinatorial Decision Making and Optimization" of the Master's degree in Artificial Intelligence, University of Bologna.

Contributors

  • Pelinsu Acar (CP)
  • Daniele Napolitano (SAT)
  • Alessandro Folloni (MIP)
  • Leonardo Petrilli (SMT)

Docker instructions

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

Run the models

NOTE: Be sure to stay on the main /src directory when running all the commands below!

CP

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

SAT

To run the SAT models, run:

./SAT/run_all_sat.sh

MIP

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

SMT

To run the SMT part, run:

python3 ./SMT/SMT.py

Time plots

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.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors 4

  •  
  •  
  •  
  •