Skip to content

Commit

Permalink
Merge branch 'release-0.4.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
pobermei committed Sep 8, 2021
2 parents d368aed + 36c63bc commit 5978543
Show file tree
Hide file tree
Showing 28 changed files with 429 additions and 223 deletions.
17 changes: 16 additions & 1 deletion CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,28 @@
# Changelog

## Ongoing
## 0.4.0

### Added

- Docs:
- Add specification for new domain Md

- Misc:
- Add script to convert instance between M-domain and Md-domain

### Changed

- Generator:
- Revise for clingo 5.5 compatibility
- Visualizer:
- Revise for clingo 5.5 compatibility

### Fixed

- Checker:
- Fix checker to detect swapping conflicts
- Generator:
- Fix incompatibility between incremental mode (`-I`) and cli option `--oap`

## 0.3.0

Expand Down
2 changes: 1 addition & 1 deletion checker/encodings/a/static.lp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ err(static, collNode, (OT, X, Y, T)) :- { holds(object(OT, _), value(at
err(static, collSwap, (OT, R1, R2, T)) :- holds(object(OT, R1), value(at, (X1, Y1)), T);
holds(object(OT, R2), value(at, (X2, Y2)), T);
holds(object(OT, R1), value(at, (X2, Y2)), T-1);
holds(object(OT, R1), value(at, (X1, Y1)), T-1);
holds(object(OT, R2), value(at, (X1, Y1)), T-1);
R1<R2, |X2-X1|+|Y2-Y1|==1.

% An object can only be at one postion at the same time.
Expand Down
2 changes: 1 addition & 1 deletion docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ output:

# What is *asprilo*?

**asprilo** is an benchmarking framework to study typical scenarios in intra-logistics and warehouse
**asprilo** is a benchmarking framework to study typical scenarios in intra-logistics and warehouse
automation with multiple mobile robots. It offers a concise specification of this problem domain
accompanied by a set of tools to generate benchmark instances, verify plans, as well as visualize
both instances and plans. Due to the diverse and complex nature of this domain, asprilo offers an
Expand Down
44 changes: 42 additions & 2 deletions docs/specification.md
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ for a robot at a picking station, all deliveries can be processed in parallel an
time step.


## Domain M: Movements Only <a id="cid-8dcd778b-8504-449d-9811-39ec61c50cbb"></a>
## Domain M: Movements Only<a id="cid-8dcd778b-8504-449d-9811-39ec61c50cbb"></a>

This is a exhaustive simplification of [domain A](#cid-b0f981f8-3202-42c0-a46e-aa6f1a52629b) in
the sense the only action that robots can perform is move, i.e., there are no pickup, putdown or
Expand All @@ -224,7 +224,37 @@ delivery actions in plans. Further, the following constraints apply:
An order line is fulfilled if a robot is located under the shelf that contains the order
line's requested product at the end of the plan execution.


### Domain Md: Destinations for Domain M<a id="md"></a>

The domain Md provides an alternative view on the [domain M](#cid-8dcd778b-8504-449d-9811-39ec61c50cbb)
to more naturally state [*Multi-Agent Path Finding* (*MAPF*)](http://mapf.info/) instances within the asprilo framework.
That is, although semantically equivalent to [M](#cid-8dcd778b-8504-449d-9811-39ec61c50cbb), domain Md
allows to explicitly state robot *destinations* as objects of an instance, in contrast.
Moreover, in M,
a destination at the coordinates (x,y) is implicitly represented by a singleton order requesting a product.
The latter is additionally expected to be exclusively stored (in single quantity) on a shelf which is located at the same coordinates (x,y).
In comparison,
within an Md instance,
we can state the same destination directly as an object of type *destination* located at (x,y).
A plan solves an Md instance if every destination is occupied by a robot at the end.
This is equivalent to the goal of M which expects that each shelf holding a requested product shares its location with a robot at the plan's end.

Existing instances in M can be translated to Md format by augmenting (or replacing) the related orders, products and shelves with
the corresponding destination objects by applying the rule in encoding `./misc/augment-m-to-md.lp`
(or via the show statements in encoding `./misc/convert-m-to-md.lp`).
Analogously, for the opposite augmentation (conversion) from Md to M,
use encoding `./misc/augment-md-to-m.lp` (`./misc/convert-md-to-m.lp`).
For convenience, there is also a augmentation/conversion bash script `./misc/convert-md.sh`:

``` bash
Usage: convert-md.sh --m2md|--md2m|--am2md|--amd2m INSTANCE_FILE
--m2md: M to Md conversion
--m2md: Md to M conversion
--am2md: M to Md augmentation
--amd2m: Md to M augmentation
```

*Limited Tools Support*: at present, the visualizer and checker only support Md instances that were created by augmentation of an M instance.

# Input Format<a id="org46f96aa"></a>

Expand Down Expand Up @@ -395,6 +425,16 @@ on the problem domain scope as follows:

states that pickingStation 1 is at location (2,3).

### Destinations (for [domain Md](#md) only!)<a id="type-dest"></a>

[Destinations](#md) use object-type `dest` for their specification.

- Exclusive to domain [Md](#md):
- The grid position of a destination is indicated by attribute `at`, e.g.

init(object(destination,d), value(at,(x,y))).

states that destination `d` is located at coordinates `(x,y)`


# Output Format<a id="org544aa9b"></a>
Expand Down
18 changes: 9 additions & 9 deletions docs/visualizer.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ output:
This is the user manual of the instance and plan visualizer of [ASPRILO](index.md).

# Installation
It is recommended to install the visualizer with anaconda. First download and install Anaconda from [www.anaconda.com/download](https://www.anaconda.com/download). Then add the potassco channel to your `Anaconda` enviroment:
It is recommended to install the visualizer with anaconda. First download and install Anaconda from [www.anaconda.com/download](https://www.anaconda.com/download). Then add the potassco channel to your `Anaconda` environment:
`conda config --add channels potassco`
The latest version also requires the 'dev' channel from potassco:
`conda config --add channels potassco/label/dev`
Expand All @@ -32,7 +32,7 @@ The visualizer requires the following software installed on your system:
3. [Qt5](http://qt-project.org/qt5)
4. [PyQt5](http://pyqt.sourceforge.net/Docs/PyQt5/installation.html), version 5.6 or later

# Deinstallation
# Uninstallation
To remove the visualizer from your system run the command:
`conda remove asprilo-visualizer`.

Expand Down Expand Up @@ -120,16 +120,16 @@ You can find the control widget on the right hand side of the visualizer. It pro
![control.gif](img/control.gif)

## Parser
You can open the parser with the `[STRG + P]` keys or the menu `Tools->Parser`. The parser shows all loaded programs in the left text field. A program can be an instance or a plan. If more than one program is loaded you can use the tabs to switch between them. The programs can be modified. The right text field shows all atoms that are currently in the solvers model. Use the `reset grounder` button to clear them. The `reset actions` button will clear all current actions in the current model while the `reset model` button will clear the whole model including all objects and all actions. You can reload the current shown program with `reload program` and delete it with `delete program`. `delete programs` will delete all current loaded instances from the parser and will reload all defalut files that are set in the settings. `parse programm` will sent all instances to the solver and start the solving process. The resulting model will be added to the current model. To load an instance or a plan use the methods described at [Loading Instances/Plans](#Loading-Instances/Plans). You can add an empty program be clicking the `add empty program` button.
You can open the parser with the `[STRG + P]` keys or the menu `Tools->Parser`. The parser shows all loaded programs in the left text field. A program can be an instance or a plan. If more than one program is loaded you can use the tabs to switch between them. The programs can be modified. The right text field shows all atoms that are currently in the solvers model. Use the `reset grounder` button to clear them. The `reset actions` button will clear all current actions in the current model while the `reset model` button will clear the whole model including all objects and all actions. You can reload the current shown program with `reload program` and delete it with `delete program`. `delete programs` will delete all current loaded instances from the parser and will reload all default files that are set in the settings. `parse programm` will sent all instances to the solver and start the solving process. The resulting model will be added to the current model. To load an instance or a plan use the methods described at [Loading Instances/Plans](#Loading-Instances/Plans). You can add an empty program be clicking the `add empty program` button.
![parser.gif](img/parser.gif)

## Editor
The visualizer allows also the editing of instances. You can [load an instance](#Loading-Instances/Plans) or create a new one `File->New instance [STRG + N]`. To remove or add objects right click on a node on the model display. You can add and remove robots, shelves, picking stations, charging stations and highways. Objects can also be moved by drag and drop from one node to another. Objects can only be dropped into enabled nodes. To enable a node right click on a disabled node and left click in the context menu on `enable node`. You also can disable nodes by right click on a enabled node and left click in the context menu on `disable node`. Use the grid size window `Tools->Grid Size` to adjust the grid of the instance. Products can be edited in the orders window `Tools->Orders`. To add a product right click on a shelf and choose `add product`. Right click on a product entry and then click on `remove product` to remove a product from a shelf. Orders can be edited the same way in the orders window `Tools->orders`. If a robot and a shelf are on the same node you can use the `pick up` or `put down` option in the nodes context menu to let the robot pick up or put down the shelf. You can edit an instance until the instance was sended to the solver or a plan was loaded. As soon as one `occurs` atom was added to the model it is no longer possible to edit it. To save an instance use `File->Save instance [STRG + I]`. To save a plan use `File->Save plan [STRG + A]`.
The visualizer allows also the editing of instances. You can [load an instance](#Loading-Instances/Plans) or create a new one `File->New instance [STRG + N]`. To remove or add objects right click on a node on the model display. You can add and remove robots, shelves, picking stations, charging stations and highways. Objects can also be moved by drag and drop from one node to another. Objects can only be dropped into enabled nodes. To enable a node right click on a disabled node and left click in the context menu on `enable node`. You also can disable nodes by right click on a enabled node and left click in the context menu on `disable node`. Use the grid size window `Tools->Grid Size` to adjust the grid of the instance. Products can be edited in the orders window `Tools->Orders`. To add a product right click on a shelf and choose `add product`. Right click on a product entry and then click on `remove product` to remove a product from a shelf. Orders can be edited the same way in the orders window `Tools->orders`. If a robot and a shelf are on the same node you can use the `pick up` or `put down` option in the nodes context menu to let the robot pick up or put down the shelf. You can edit an instance until the instance was sent to the solver or a plan was loaded. As soon as one `occurs` atom was added to the model it is no longer possible to edit it. To save an instance use `File->Save instance [STRG + I]`. To save a plan use `File->Save plan [STRG + A]`.
![editor.gif](img/editor1.gif)
![editor.gif](img/editor2.gif)

## Tools
If you open the orders window, the products window or the tasks window in the `Tools` menu or with shortcuts these windows will be added to the right hand side of the main window. To create separate windows just drag and drop these windows on the desktop. Most windows can be drag and dropped to create new windows or put multiple windows together in one. The tasks window will only be available in gtapf mode while the orders window and the products window will only be available in asprilo mode. While the visualisation of a plan the orders table and the task table are highlighting orderlines and tasks that are changed. If you are using a interactive solver script you can use the orders window to add new orders while displaying a solution. Add new orders and click on `send orders` to send all added orders to the solver. The solver will calculate a new plan and send it to the visualizer. The new plan will regard the new orders. With a simulator script you can automate this process. You also can discard added orders by clicking on the `discard orders` button. Only highlighted orders will be send or discarded. All orders that are displayed in the orders table but are not regarded by the plan are highlighted. You can use the paths tool to show the paths of individuell robots. Klick at the checkboxes to enable or disable a robot path and then click on the `ok` button to apply the changes.
If you open the orders window, the products window or the tasks window in the `Tools` menu or with shortcuts these windows will be added to the right hand side of the main window. To create separate windows just drag and drop these windows on the desktop. Most windows can be drag and dropped to create new windows or put multiple windows together in one. The tasks window will only be available in gtapf mode while the orders window and the products window will only be available in asprilo mode. While the visualisation of a plan the orders table and the task table are highlighting orderlines and tasks that are changed. If you are using a interactive solver script you can use the orders window to add new orders while displaying a solution. Add new orders and click on `send orders` to send all added orders to the solver. The solver will calculate a new plan and send it to the visualizer. The new plan will regard the new orders. With a simulator script you can automate this process. You also can discard added orders by clicking on the `discard orders` button. Only highlighted orders will be send or discarded. All orders that are displayed in the orders table but are not regarded by the plan are highlighted. You can use the paths tool to show the paths of individual robots. Click at the checkboxes to enable or disable a robot path and then click on the `ok` button to apply the changes.
![path.gif](img/path.gif)

## Settings
Expand All @@ -142,12 +142,12 @@ A solver script can be started separately or with the `Network->Initialize solve
![solver.gif](img/solver2.gif)

### Communication
The visualizer uses a number of commands to communicate with a solver. All these commands begin with the characters `%$` to not confuse these commands with asp atoms. Every massage that is sended by the visualizer ends with the `\n` character and the visualizer expects that every message it receives ends with this character as well. A message that contains an additional `n` can be treated as two messages what can causes errors. If the visualizer is receiving a message the visualizer waits until the `n` character was received. So if the message is missing this character the visualizer can be stuck. Every command and every atom that is sended should be separated with the `.` token. The visualizer sends atoms from instances which are described in [Instance format](#Instance-format) and expects atoms in [Plan format](#Plan-format). The visualizer sends the following commands to a solver:
1. `%$RESET.` will be sended if a new instance was loaded and is to be solved. The visualizer sends the new instance after this command.
2. `%$DONE([STEP]).` will be sended if the visualizer has finished the visualisation of the time step `STEP`. Since the visualizer expects an anwswer to this you should always send a message back to the visualizer if this command was received even if it is only an empty message `\n`. Note: An empty message should also end with `\n`.
The visualizer uses a number of commands to communicate with a solver. All these commands begin with the characters `%$` to not confuse these commands with asp atoms. Every massage that is sent by the visualizer ends with the `\n` character and the visualizer expects that every message it receives ends with this character as well. A message that contains an additional `n` can be treated as two messages what can causes errors. If the visualizer is receiving a message the visualizer waits until the `n` character was received. So if the message is missing this character the visualizer can be stuck. Every command and every atom that is sent should be separated with the `.` token. The visualizer sends atoms from instances which are described in [Instance format](#Instance-format) and expects atoms in [Plan format](#Plan-format). The visualizer sends the following commands to a solver:
1. `%$RESET.` will be sent if a new instance was loaded and is to be solved. The visualizer sends the new instance after this command.
2. `%$DONE([STEP]).` will be sent if the visualizer has finished the visualisation of the time step `STEP`. Since the visualizer expects an answer to this you should always send a message back to the visualizer if this command was received even if it is only an empty message `\n`. Note: An empty message should also end with `\n`.

## Simulator
The simulator sends instances and orders to the visualizer. There is an example simulator script provided by the visualizer. You can find it in the scipts directory [here]({{ site.asprilo_src_url }}/visualizer/scripts). If you have installed the visualizer by conda the simulator will be installed too and can be run by running `viz-simulator` in a console. You can start a simulator with the `Network->Initialize simulator` option. If you start it from the visualizer you can enter a command line to start the simulator and it will be connected automatically to the visualizer. Use `Network->Simulate` to connect the visualizer to an already started simulator. Use this to connect to a separately started simulator. If you start a new simulator with the visualizer or close the visualizer the connection to the simulator will be closed. The simulator will receive the same input stream as the solver from the visualizer and the simulator should react in a similar way.
The example simulator will send a `%$RESET.` command to the visualizer when a connection was established to clear the visualizers old instance data. Then it will read an given instance file and will send all atoms from the file to the visualizer. The example simulator accepts the atoms described in [Instance format](#Instance-format). It also accepts atoms with a third argument. The third argument will be interpreted as a time step and the simulator will send this atom after the time step was reached.
E.g.`init(object(order, 1), value(pickingStation, 1), 2). init(object(order, 1), value(line, (1, 1), 2).` is an order that will be sended to the visualizer when the visualizer reaches time step 2.
E.g.`init(object(order, 1), value(pickingStation, 1), 2). init(object(order, 1), value(line, (1, 1), 2).` is an order that will be sent to the visualizer when the visualizer reaches time step 2.
![solver.gif](img/simulator.gif)
Loading

0 comments on commit 5978543

Please sign in to comment.