Skip to content

Commit

Permalink
Merge branch 'release-0.2.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
pobermei committed Feb 28, 2018
2 parents 0f5512d + 4aa5c2a commit 63a1887
Show file tree
Hide file tree
Showing 110 changed files with 7,390 additions and 3,119 deletions.
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "generator/lib/pyyaml"]
path = generator/lib/pyyaml
url = https://github.com/yaml/pyyaml.git
63 changes: 63 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
# Changelog


## 0.2.0

### Added

- Docs:
- Add description for checker
- Add description for experiments
- Checker:
- Add checker for C and M domain
- Generator:
- Add incremental multi-shot generation to manage grounding size
- Add a multitude of generator options to fine-tune the resulting instances
- Add support for YAML-formatted batch scripts
- Add batch generation scripts for different domains and layouts
- Add ground program observer for analytical output of grounding size
- Visualizer:
- Add support for manually adding orders via GUI
- Add rudimentary support to stream orders
- Add rudimentary support for exogenous events
- Add various convenience features to GUI
- Add various command line options and piping support
- Misc:
- Add new small example instance

### Changed

- Docs:
- Migrate from org-mode to markdown format
- Revise specification
- Revise description of the generator, visualizer and instance sets
- Checker:
- Revise checker for A and B domain
- Generator:
- Refactor code to support different generation modes
- Change generator ASP encoding to reduce grounding size
- Remove python batch scripts
- Rename main generator script to `gen`
- Visualizer:
- Refactor whole source code for better maintainability and robustness
- Make windows for orders and inventory dockable in sidebar
- Rename main visualizer script to `viz`
- Misc:
- Remove old example instance

### Fixed

- Docs:
- Fix incorrect links and missing images in documentation
- Generator:
- Fix exception for invocation w/o arguments
- Fix solve calls to work with clingo 5.2.x API
- Visualizer:
- Fix closing of sockets after communication with solver terminates
- Fix solve calls to work with clingo 5.2.x API


## 0.1.0

Initial Release

11 changes: 0 additions & 11 deletions CHANGES.org

This file was deleted.

3 changes: 2 additions & 1 deletion LICENSE.org → LICENSE.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
* The MIT License (MIT)
# The MIT License (MIT)

Copyright (c) 2017 Philipp Obermeier, Thomas Otto

Expand All @@ -19,3 +19,4 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

16 changes: 16 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# ASPRILO [![Github Release](https://img.shields.io/github/release/potassco/asprilo/all.svg)](https://github.com/potassco/asprilo/releases)

## About

This is source tree of **ASPRILO**, an intra-logistics benchmark suite for answer set
programming. For further details, please consult the documentation on our website at
<https://asprilo.github.io/>.


## Directory Structure

- `./docs/` contains the documentation sources
- `./checker/` contains the instance generator sources
- `./generator/` contains the instance generator sources
- `./visualizer/` contains the instance visualizer sources

16 changes: 0 additions & 16 deletions README.org

This file was deleted.

1 change: 1 addition & 0 deletions checker/README.md
64 changes: 64 additions & 0 deletions checker/encodings/a/action-deliver.lp
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
% = ACTION: PICKUP, PUTDOWN, DELIVER ===========================================


% - Domain ---------------------------------------------------------------------

action(deliver, (O, P, Q)) :- init(object(order, O), value(line, (P, RQ))),
Q = 1..RQ . % RQ and Q are the requested
% and delivered quantity, resp.


% - Preconditions - Verification -----------------------------------------------

% Robot not at picking station
err(deliver, notAtPS, (R, T)) :- occurs(object(robot, R), action(deliver, (_, _, _)), T );
holds(object( robot, R), value( at, (X, Y) ), T-1);
not holds(object( pickingStation, _), value( at, (X, Y) ), T-1).

% Robot not carrying a shelf
err(deliver, noShelf, (R, T)) :- occurs(object(robot, R), action(deliver, (_, _, _)), T);
{ holds( object(robot, R), value( carries, S ), T-1) :
holds( object(shelf, S), _ , T-1) } < 1.

% Robot delivers product that is not requested at picking stations
err(deliver, noOrder, (R, T)) :- occurs(object(robot, R ), action(deliver, (O, P, _)), T );
holds( object( robot, R ), value( at, (X, Y) ), T-1);
holds( object( pickingStation, PS), value( at, (X, Y) ), T-1);
holds( object(order, O ), value( pickingStation, PS ), T-1);
not holds(object(order, O ), value( line, (P, _) ), T-1).

% Robot delivers higher amount than requested
err(deliver, orderAmount, (R, T)) :- occurs(object(robot, R), action(deliver, (O, P, Q)), T);
holds( object(order, O), value( line, (P, RQ) ), T-1);
Q > RQ.

% Robot delivers higher amount than available on shelf
err(deliver, shelfAmount, (R, T)) :- occurs(object(robot, R), action(deliver, (O, P, Q)), T);
holds( object(robot, R), value(carries, S ), T-1);
holds( object(product, P), value(on, (S, SQ) ) , T-1);
Q > SQ.

% Robot must deliver at least one unit
err(deliver, zeroAmount, (R, T)) :- occurs(object(robot, R), action(deliver, (_, _, 0)), T).


% - Book-Keeping: Effects -------------------------------------------------------

% Update order lines
holds(object(order, O), value(line, (P, RQ-Q)), T) :- occurs(object(robot, R), action(deliver, (O, P, Q)), T);
holds(object(order,O), value(line, (P, RQ)), T-1);
Q < RQ.
% Update product quantities on shelves

holds(object(product, P), value(on, (S, SQ-Q)), T) :- occurs(object(robot, R), action(deliver, (_, P, Q)), T );
holds( object(robot, R), value(carries, S ), T-1);
holds( object(product, P), value(on, (S, SQ) ), T-1);
Q < SQ.


% - Book-Keeping: Related Inertia Abnormals ---------------------------------------

% Remove outdated product quantites on shelves
ab(object(product, P), value(on, (S, SQ)), T) :- occurs(object(robot, R), action(deliver, (_, P, _)), T );
holds( object(robot, R), value(carries, S ), T-1);
holds( object(product, P), value(on, (S, SQ) ), T-1).
42 changes: 42 additions & 0 deletions checker/encodings/a/action-move.lp
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
% = ACTION move ================================================================

% - Domain ---------------------------------------------------------------------

action(move, (0,1)).
action(move, (1,0)).
action(move, (0,-1)).
action(move, (-1,0)).


% - Checks: Preconditions ------------------------------------------------------

% Target node non-existent
err(move, node, (R, T)) :- occurs(object(robot, R), action(move, (DX, DY)), T );
holds( object(robot, R), value(at, (X, Y)), T-1);
not holds( object(node, _), value(at, (X+DX, Y+DY)), T ).

% Movement domain violated
err(move, domain, (R, T)) :- occurs(object(robot, R), action(move, (DX, DY)), T );
holds( object(robot, R), value(at, (X, Y)), T-1);
not action(move, (DX, DY)).



%adjacent(R, DX, DY, T) :- holds( object(node, _), value(at, (X+DX, Y+DY)), T ).at(robot(R), X, Y, T-1); node(X+DX, Y+DY); action(move(DX, DY)).

% - Book-Keeping: Effects --------------------------------------------------------------------

holds(object(robot, R), value(at, (X+DX, Y+DY)), T) :- occurs(object(robot, R), action(move, (DX, DY)), T );
holds( object(robot, R), value(at, (X, Y)), T-1).

holds(object(shelf, S), value(at, (X, Y )), T) :- holds( object(robot, R), value(at, (X, Y)), T );
holds( object(robot, R), value(carries, (R, S)), T-1).


% - Book-Keeping: Related Inertia Abnormals ---------------------------------------

ab(object(robot, R), value(at, (X, Y)), T) :- holds( object(robot, R), value(at, (X, Y)), T-1);
occurs(object(robot, R), action(move, _), T ).
ab(object(shelf, S), value(at, (X, Y)), T) :- holds( object(shelf, S), value(at, (X, Y)), T-1);
occurs(object(robot, R), action(move, _), T );
holds( object(robot, R), value(carries, (R, S)), T-1).
33 changes: 33 additions & 0 deletions checker/encodings/a/action-pickup.lp
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
% = ACTION: PICKUP, PUTDOWN, DELIVER ===========================================


% - Domain ---------------------------------------------------------------------

action(pickup, ()).


% - Preconditions - Verification -----------------------------------------------

% No shelf to pickup at location
err(pickup, noShelf, (R, T)) :- occurs(object(robot, R), action(pickup, ()), T);
holds( object(robot, R), value(at, (X, Y)), T-1);
not holds( object(shelf, _), value(at, (X, Y)), T-1).




% Robot already carries a shelf
err(pickup, carries, (R, T)) :- occurs(object(robot, R), action(pickup, ()), T);
holds(object(R, _), value(carries, _), T-1).


% - Book-Keeping: Effects --------------------------------------------------------------------

holds(object(robot, R), value(carries, S), T) :- occurs(object(robot, R), action(pickup, () ), T );
holds( object(robot, R), value(at, (X, Y)), T-1);
holds( object(shelf, S), value(at, (X, Y)), T-1).


% - Book-Keeping: Related Inertia Abnormals ---------------------------------------
%
% None.
24 changes: 24 additions & 0 deletions checker/encodings/a/action-putdown.lp
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
% = ACTION: PICKUP, PUTDOWN, DELIVER ===========================================


% - Domain ---------------------------------------------------------------------

action(putdown, ()).


% - Preconditions - Verification -----------------------------------------------

% Robot does not carry a shelf
err(putdown, noShelf, (R, T)) :- occurs(object(robot, R), action(putdown, ()), T );
not holds( object(robot, R), value(carries, _), T-1).


% - Book-Keeping: Effects --------------------------------------------------------------------
%
% None.


% - Book-Keeping: Related Inertia Abnormals ---------------------------------------

ab(object(robot, R), value(carries, S), T) :- occurs(object(robot, R), action(putdown, ()), T );
holds( object(robot, R), value(carries, S), T-1).
37 changes: 37 additions & 0 deletions checker/encodings/a/checker.lp
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
% = CHECKER ENCODINGS FOR THE A PROBLEM DOMAIN ===========================

% - Initial Setup --------------------------------------------------------------
%
% Sets up inital state, horizon and general inertia axiom

#include "init.lp".


% - Checks and Book-Keeping Entailments Per Action -----------------------------
%
% Per each action, conduct
% - checks for preconditions
% - "book-keeping" entailments for effects and related inertial abnormalities

#include "action-move.lp".
#include "action-pickup.lp".
#include "action-putdown.lp".
#include "action-deliver.lp".


% - Checks for Static Law Violations -------------------------------------------

#include "static.lp".


% - Goal condition -------------------------------------------------------------
%
% Define:
% 1. the necessary sequence of actions and preconditions to fulfill an oder; and
% 2. the general goal that all orders are fulfilled (ie., fully processed)

% Order fulfillment
#include "fulfillment.lp".

% General goal
#include "goal.lp".
8 changes: 8 additions & 0 deletions checker/encodings/a/fulfillment.lp
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
% = ORDER FULFILLMENT ==============================================================================
%
% Sequence of actions and conditions required to fulfill (i.e., fully process) an order.
%

% Remove outdated order lines
ab(object(order, O), value(line, (P, RQ)), T) :- occurs(object(robot, R), action(deliver, (O, P, _)), T );
holds( object(order, O), value( line, (P, RQ) ), T-1).
4 changes: 4 additions & 0 deletions checker/encodings/a/goal.lp
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
% = GOAL CONDITION =============================================================

err(goal, unfilledOrder, (O, P, Q, H)) :- holds(object(order, O), value(line, (P, Q)), H);
horizon(H).
16 changes: 16 additions & 0 deletions checker/encodings/a/init.lp
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
% INITIAL SETUP ================================================================

% - Initial State --------------------------------------------------------------

holds(O, V, 0) :- init(O, V).


% - Plan Length ----------------------------------------------------------------

horizon(H) :- H = #max{ 0; T : occurs( _, _, T) }.
time(1..H) :- horizon(H).


% - General Law of Interia -----------------------------------------------------

holds(O, V, T) :- holds(O, V, T-1), not ab(O, V, T), time(T).
9 changes: 9 additions & 0 deletions checker/encodings/a/show.lp
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
%% #show time/1.
%% #show action/1.
#show err/3.
%#show at/4.
%% #show moves/2.
%% #show node/2.
%% #show adjacent/4.
#show carries/3.

Loading

0 comments on commit 63a1887

Please sign in to comment.