summaryrefslogtreecommitdiffstats
path: root/README.md
diff options
context:
space:
mode:
authorAndrea Censi <AndreaCensi@users.noreply.github.com>2023-05-26 17:41:21 +0200
committerAndrea Censi <AndreaCensi@users.noreply.github.com>2023-05-26 17:41:21 +0200
commitc9c025618571db61d431924934eef6d01a30182a (patch)
tree4c1931472cdad12648a52eb95d0da2e7762bfbff /README.md
parentinit (diff)
downloadact4e-mcdp-c9c025618571db61d431924934eef6d01a30182a.tar.gz
act4e-mcdp-c9c025618571db61d431924934eef6d01a30182a.zip
misc
Diffstat (limited to '')
-rw-r--r--README.md73
1 files changed, 73 insertions, 0 deletions
diff --git a/README.md b/README.md
new file mode 100644
index 0000000..69bd087
--- /dev/null
+++ b/README.md
@@ -0,0 +1,73 @@
+## Setup
+
+### Install Docker
+
+<ul>
+ <li> (Mac, Linux) Follow the [installation instructions](https://docs.docker.com/get-docker/) </li>
+ <li>(Windows):
+ <ul>
+ <li>Follow the manual installation steps for Windows Subsystem for Linux [here](https://docs.microsoft.com/en-us/windows/wsl/install). On step 1, follow the recommendation of updating to WSL 2. You do not necessarily need to install Windows Terminal. </li>
+ <li>Now go [here](https://docs.docker.com/desktop/windows/install/) and follow the "Install Docker Desktop on Windows" instructions. You can then start Docker Desktop and follow the quick start quide.</li>
+ </ul>
+ </li>
+</ul>
+
+### Install VS Code.
+
+Select File -> Open and select *the entire folder*.
+
+VS Code will propose to install "Dev Container". Click "install".
+
+VS Code will give you a message similar to:
+
+> Folder contains a Dev Container configuration file. Reopen folder to develop in a container.
+
+Select "Reopen in container".
+
+Now you should have the folder open while VS Code is in "container development mode".
+
+You can create a new terminal using Terminal -> New Terminal.
+
+## Running tests
+
+Install this package and dependencies using:
+
+ pip install -e .
+
+The main dependency installed is `ACT4E-mcdp` which is also available [on this repo](https://github.com/ACT4E/ACT4E-mcdp).
+That library takes care of parsing the models and queries.
+
+If we tell you to update the library, use this:
+
+ pip install -U ACT4E-mcdp
+
+Use this command to download the test cases:
+
+ act4e-mcdp-download-tests --out downloaded
+
+Then you have available a few test cases in the directory `downloaded/`.
+
+You should be able to run this solver:
+
+ act4e-mcdp-solve \
+ --solver act4e_mcdp_solution.MySolution \
+ --query FixFunMinRes \
+ --model downloaded/lib1-parts.e03_splitter1.models.mcdpr1.yaml \
+ --data '{f: 10}'
+
+In turn:
+
+* `--solver act4e_mcdp_solution.MySolution`: this selects your solver;
+* `--query FixFunMinRes`: this selects `FixFunMinRes` (other choice: `FixResMaxFun`);
+* `--model downloaded/lib1-parts.e03_splitter1.models.mcdpr1.yaml`: this selects the model to use for optimization;
+* `--data '{f: 10}'`: this selects the query to give. It is a YAML dictionary with a key for each functionality name.
+
+You will see the result in the logs:
+
+```
+INFO query: {'f': Decimal('10')}
+INFO solution: UpperSet(minima=[])
+```
+
+The template `act4e_mcdp_solution.MySolution` always returns an empty `UpperSet` (= infeasible).
+At this point, you can start implementing your solver.