From c9c025618571db61d431924934eef6d01a30182a Mon Sep 17 00:00:00 2001 From: Andrea Censi Date: Fri, 26 May 2023 17:41:21 +0200 Subject: misc --- README.md | 73 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 73 insertions(+) create mode 100644 README.md (limited to 'README.md') 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 + + + +### 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. -- cgit v1.2.1