README.md 1.99 KB
Newer Older
1 2
# washpower-simulering

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 74 75 76 77 78 79 80 81 82 83 84 85 86 87
Simulation of washing programs, on the basis of a prototype from Washpower.

This project contains:
- `generator`: The Python-based generator.
- `washpower-tsp`: A submodule of [washpower-tsp](https://git.sofusrose.com/so-rose/washpower-tsp), which is itself a fork of [RofolfoPichardo/LinKernighanTSP](https://github.com/RodolfoPichardo/LinKernighanTSP).


## Documentation

The full documentation, including usage instructions, can be found at [docs.sofus.dev](https://docs.sofus.dev/washpower).



# Running the Code

## Running the Generator

`Note that Python 3.7+ is required to run this project.`

Ensure you're running a Debian-based Linux like Ubuntu (which includes a Windows-based WSL), and grab the basics:

```shell
sudo apt install python3.7  # Or higher
sudo apt install virtualenv
sudo apt install build-essential  # Not strictly required, but a really good idea.
```

Get dependencies through a virtualenv as follows:

```shell
cd generator
virtualenv --python=python3.7 .venv  # Replace with any python3.7+
. .venv/bin/activate
pip install -r requirements.txt
```

Ensure you're in the virtual environment. Then you can run:

```shell
./main.py --help
```



## Running the (experimental) LKH Pather

The LKH pather is Java-based, so you'll need a recent OpenJDK (or equivilant), as well as ant. You can get them by running something like:

```shell
sudo apt install openjdk-11-jdk openjdk-11-jre ant
```

First, clone the submodule `washpower-tsp` and compile it:

```shell
cd washpower-tsp
ant jar-unsigned
cd ../generator
```

Then you can run the generator with it, by running something like:

```shell
./main.py -p near_ideal --lkh-jar ../washpower-tsp/build/path.jar gen-sphere viz -m path
```


# Development

## Developing the Generator

To develop the package, make sure to run:

```shell
cd generator
pip install -r requirements_dev.txt
```

Then you can, for example, compile the documentation:

```shell
cd docs
make html
make latexpdf  # Requires a working texlive installation.
```
88