blob: 69bd087ff72d07bd12a6e153b8b5050cffdc0fdf (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
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.
|