diff --git a/ExecutionScripts/2_exps_bell.py b/ExecutionScripts/1_exps_bell.py similarity index 100% rename from ExecutionScripts/2_exps_bell.py rename to ExecutionScripts/1_exps_bell.py diff --git a/ExecutionScripts/3_exps_amplitude.py b/ExecutionScripts/2_exps_amplitude.py similarity index 100% rename from ExecutionScripts/3_exps_amplitude.py rename to ExecutionScripts/2_exps_amplitude.py diff --git a/ExecutionScripts/4_exps_real.py b/ExecutionScripts/3_exps_real.py similarity index 100% rename from ExecutionScripts/4_exps_real.py rename to ExecutionScripts/3_exps_real.py diff --git a/GenerateExperiments/experiments.py b/GenerateExperiments/experiments.py index 97fbacdbc226acf38ca45579c133b4427d9ffe4a..e838aaace8bd4119abf4c9a4c014c096c07bacdc 100644 --- a/GenerateExperiments/experiments.py +++ b/GenerateExperiments/experiments.py @@ -85,6 +85,7 @@ class Runner: # prob.writeMPS(self.model_file) if (self.model_file != ""): prob.to_json(self.model_file) + #result = prob.solve(COIN_CMD(msg=1, timeLimit=7200, logPath=self.log_file, gapRel=0.05)) result = prob.solve(GUROBI_CMD(msg=1, timeLimit=7200, logPath=self.log_file, gapRel=0.05)) print(result) @@ -423,4 +424,4 @@ class HeuristicRunner(Runner): #print("Metrics", metrics) if self.do_vis: Visualisation(solution, True) - return self.create_dict(solution, phase, DC, power_var, flex, tag) \ No newline at end of file + return self.create_dict(solution, phase, DC, power_var, flex, tag) diff --git a/README.md b/README.md index e6bcc39874f1c10a9985df0d3d9bafca0ac1aee1..4be9be01dee66560e4f5eeeef0b5f404e29df5c0 100644 --- a/README.md +++ b/README.md @@ -25,13 +25,29 @@ This directory has the following folders: ## Installing the environment It is also possible to install all dependencies using [nix](https://nixos.org/). The file [default.nix](default.nix) provides all dependencies (see buildInputs variable inside this file). +### Install dependencies using nix To install it using nix, execute the following command: ```bash nix-shell ``` -Besides the dependencies, we executed our experiments using Gurobi. So, it is necessary to have a Gurobi license to have the same results. It is possible to execute it using another solver, by modifying the file *GenerateExperiments/experiments.py* when it calls prob.solve(). However, in this case, you can have different results (mainly concerning execution time). +### Install dependencies by hand +To install it using python virtual env, execute the following commands: +```bash +python3 -m venv .venv +source .venv/bin/activate +python3 -m pip install pip==24.0 +python3 -m pip install -r requirements.txt +``` +Then install the solver (such as cbc) +```bash +sudo apt install coinor-cbc +``` + +### Details of the dependencies + +Besides the dependencies, we executed our experiments using Gurobi. So, it is necessary to have a Gurobi license to have the same results. It is possible to execute it using another solver, by modifying (comment line 89 and uncomment line 88) the file *GenerateExperiments/experiments.py* when it calls prob.solve(). However, in this case, you can have different results (mainly concerning execution time). The list of dependencies are *at least*: - pandas @@ -78,10 +94,10 @@ We have the following experimental campaigns: From the root folder (with nix activated), execute the following commands ```bash -python ExecutionScripts/1_milp.py -python ExecutionScripts/2_exps_bell.py -python ExecutionScripts/3_exps_amplitude.py -python ExecutionScripts/4_exps_real.py +python3 ExecutionScripts/1_milp.py +python3 ExecutionScripts/1_exps_bell.py +python3 ExecutionScripts/2_exps_amplitude.py +python3 ExecutionScripts/3_exps_real.py ``` This can take time to execute everything. For this reason, we make available the experiments outputs in [Zenodo](https://doi.org/10.5281/zenodo.15166838). diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000000000000000000000000000000000000..031871b47883c8befb38efb90a2fe90765438ff0 --- /dev/null +++ b/requirements.txt @@ -0,0 +1,11 @@ +setuptools +pandas +numpy +matplotlib +jupyter +ipython +pulp +colorama +termcolor +tabulate +seaborn