Getting Started¶
Installation¶
We use the Poetry tool which is a dependency management and packaging tool in Python. It allows you to declare the libraries your project depends on and it will manage (install/update) them for you. Please follow the installation of poetry .
After you’ve installed poetry, you can install partx by running the following command in the root of the project:
poetry install
Basic Usage¶
To run Part-X, we need a black-box function and initialize the parameters of Part-X. Once the black-box function the parameters are passed to the algorith, the algorithm outputs information including the best point, the statistics and much more. During the course of the algorithm, various files are generated to log the information from the optimizer, store various intermediate representations of the algorithms and files that speed up the process of result generation. These ideas are explored in detail.
There are two ways to run Part-X algorithms.
Standalone Usage
The idea here is to find 0-Level Set of a function. To run Part-X standalone, the inputs and the ouputs are decribed on the following pages.
Examples in demos/Non-LinearBenchmarks. To run these:
Goldstein-Price function without any constraint:
poetry run python demos/Non-LinearBenchmarks/GoldsteinPrice_noConstraints.py
Goldstein-Price function with constraint:
poetry run python demos/Non-LinearBenchmarks/GoldsteinPrice_withConstraints.py
Usage with Psy-Taliro
- The Part-X is used along with Psy-TaLiRo tool to generate falsifying points as well as provide probabilistic guarantees. Examples are as follows:
Examples in demos/ArchBenchmarks. To run these:
Automatic Transmission Benchmark with the AT1 Specification:
poetry run python demos/ArchBenchmarks/benchmarks AT1 -f "demo_partx_AT1"
Note
Note: To run the simulink model, you have to install MATLAB engine in the environment in order to run the MATLAB Engine in python. Current experiments involving simuulink model have been test with MATLAB R2021b and python3.8. To install, here are instructions:
Copy the poetry environment information:
poetry env info --path
Change directory to engine folder in MATLAB R2021b
cd /usr/local/MATLAB/R2021b/extern/engines/python/
Install MATLAB engine in python by running the following command, where <PATH> is from Step 1
sudo python3.8 setup.py install --prefix="<PATH>"