Skip to content

Commit eb5d268

Browse files
committed
docs: polish readme
1 parent 9e89371 commit eb5d268

File tree

1 file changed

+35
-15
lines changed

1 file changed

+35
-15
lines changed

README.md

Lines changed: 35 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
<!-- badges: end -->
99

1010

11-
`Shepherd` is a Rust implementation of an algorithm solving the "random population control problem",
11+
`Shepherd` is an implementation of an algorithm solving the "random population control problem",
1212
as presented in <https://arxiv.org/abs/2411.15181>.
1313

1414
Starting from a non-deterministic finite automaton (nfa),
@@ -38,26 +38,53 @@ and displays the answer in the terminal, including a winning strategy for positi
3838

3939
Check the file ```examples.pdf``` at the root which gives an overview of all available examples.
4040

41+
## Installation
4142

42-
## Usage
43+
You can build an optimized binary (will be placed in `target/release/shepherd`) using the following command.
44+
45+
```
46+
cargo build --release
47+
```
48+
49+
To install the binary for later use this:
50+
```
51+
cargo install --path . # to install the `shepherd` binary to your $PATH
52+
```
53+
This will move the binary into to your cargo path, usually `~/.cargo/bin`, make sure to include this in your `$PATH`.
54+
55+
To run tests:
56+
```
57+
cargo test
58+
```
59+
60+
To generate html docs to `target/doc/shepherd/index.html`
61+
```
62+
cargo doc
63+
```
64+
65+
## Command-line Usage
4366

4467
```
4568
Usage: shepherd [OPTIONS] <AUTOMATON_FILE>
4669
4770
Arguments:
48-
<AUTOMATON_FILE> path to the input
71+
<AUTOMATON_FILE> Path to the input
4972
5073
Options:
5174
-f, --from <INPUT_FORMAT>
5275
The input format [default: tikz] [possible values: dot, tikz]
76+
-v, --verbose...
77+
Increase verbosity level
78+
-l, --log-output <LOG_FILE>
79+
Optional path to the log file. Defaults to stdout if not specified.
5380
-t, --to <OUTPUT_FORMAT>
5481
The output format [default: plain] [possible values: plain, tex, csv]
5582
-o, --output <OUTPUT_FILE>
56-
where to write the strategy; defaults to stdout.
83+
Where to write the strategy; defaults to stdout.
5784
-s, --state-ordering <STATE_ORDERING>
58-
The state reordering type: preserves input order, sorts alphabetically or topologically. [default: input] [possible values: input, alphabetical, topological]
85+
The state reordering type. [default: input] [possible values: input, alphabetical, topological]
5986
--solver-output <SOLVER_OUTPUT>
60-
The solver output. Either yes/no and a winning strategy (the faster). Or the full maximal winning strategy. [default: strategy] [possible values: yes-no, strategy]
87+
Solver output specification. [default: strategy] [possible values: yes-no, strategy]
6188
-h, --help
6289
Print help
6390
-V, --version
@@ -79,7 +106,7 @@ You can give the input NFA in [graphviz DOT](https://graphviz.org/docs/layouts/d
79106
by setting the input-format as "dot" and give a path to a dot-file as input file:
80107

81108
```
82-
cargo run -- -i dot -f examples/bottleneck-1-ab.dot
109+
shepherd -i dot -f examples/bottleneck-1-ab.dot
83110
```
84111

85112
The input graphs are interpret as NFA using the following convention.
@@ -101,17 +128,10 @@ and give the path to where the solution is written via the `-o` argument (defaul
101128
For a pretty latex report use
102129

103130
```
104-
cargo run -- -f examples/example1.tikz -o report.tex && pdflatex report.tex
131+
shepherd -f examples/example1.tikz -o report.tex && pdflatex report.tex
105132
```
106133

107134
The states of the NFA can be automatically reordered in order to make the generated reports more readable.
108135
Either topologically (`-s topological`) or alphabetically (`-s alphabetical`).
109136

110137

111-
## Perfs
112-
113-
```cargo build --release```
114-
115-
```./target/release/shepherd -s topological -i dot examples/bottleneck-2-staged.dot```
116-
117-

0 commit comments

Comments
 (0)