asprilo Encodings
About
This is a collection of encodings for asprilo.
Directory Structure
The encodings are grouped in three root directories wrt. their problem domains:
-
./abccontains encoding for asprilo domains A, B and C -
./mcontains encodings for asprilo domain M -
./controlcontains encodings for supplementary features such as task assignment, highway constraints, etc. for all (some) asprilo domains
File Name Convention
We adopt the following name conventions for the encoding files:
-
For the base name of encoding files
-
capital letters
M,P,P, andDstand for actions move, pickup, putdown, and deliver -
lower case suffixes
-c,-b, and-aindicate the addressed problem domain -
specifically, this applies to all files matching
./abc/goal-D-{a,b,c}.*./control/control-{a,b,c,m}.*./control/assign-{a,bcm}.*- etc.
-
-
File extensions
*.lp*,*.ilp,*.clp,*.iclpand*.dlpstand for regular, incremental, constraint, incremental constraint logic and difference logic programs, resp.- sometimes we need to disambiguate further, e.g. we use capital
Cin*.Clpand*``*.iClpto indicate that we use constraints for both robot & shelf positions and product quantities
- sometimes we need to disambiguate further, e.g. we use capital
-
Omissions of such indicators are treated like wild-cards, i.e., general applicability
-
Compatibility of encoding files is achieved by combing those with same (or similar) attributes.
Interface to asprilo I/O Format
-
Files with base name prefix
input*andoutput*handle I/O between asprilo and the encodings, e.g../input.lp ./m/output-M.lp ./m/output-M.ilp ./abc/output-MPPD.ilp ./abc/output-MPPD.lp ...
-
Specifically,
input.lpconverts asprilo instances to the format used in action theories andoutput*files convert the resulting plan into the format of asprilo
Action Theory
-
Files with base name prefix
action*hold action theories, e.g../m/action-M.lp ./m/action-M.ilp ./abc/action-MPP.ilp ./abc/action-MPP.lp ...
-
Encoded actions are move, pickup, and put-down.
Goal Conditions
-
Files with base name prefix
goal*hold goal conditions, e.g../m/goal-M.ilp ./m/goal-M.lp ./abc/goal-D-a.lp ./abc/goal-D-a.ilp ./abc/goal-D-b.lp ./abc/goal-D-b.ilp ...
-
Except for asprilo domain M, they define what constitutes a delivery action indicated by capital letter
Din the file names. -
Goal conditions depend on the asprilo domain and, hence, use in directory
.abc/base name suffixes*-a,*-b*-cfor distinction
Product Quantities
-
Files with base name prefix
quantities*deal with amounts of products, e.g./abc/quantities.clp ./abc/quantities.iclp ./abc/quantities.ilp ./abc/quantities.lp
-
Goal condition encodings for domain A include quantity encodings fitting to their logic program type (
*.lp,*.ilp,.clp, etc.)
Strategies
-
Files with base name prefix
strategyspecify strategies, e.g../abc/strategy-MPP.ilp ./abc/strategy-MPP.lp
-
Some strategies may not work with all layouts!
-
Experimental feature!
Highways
-
Files with base name prefix
highwaysspecify conditions for highway gird nodes, e.g../control/highways.lp ./control/highways.ilp ./control/highways.clp ./control/highways.iclp
Optimization
-
Files with base name prefix
optimization*specify objective functions, e.g../abc/optimization.lp ./abc/optimization.ilp
-
Experimental feature!
Heuristics
-
Files with base name prefix
heuristic*specifying heuristics with clingo's#heuristicdirective, e.g../control/heuristic.lp ./control/heuristic.ilp
-
Experimental feature!
Encoding Shorthands
-
Files with base name prefix
encoding*provide shorthands to call matching action theory and goal encodings, e.g../abc/encoding-a.lp ./abc/encoding-a.ilp ./abc/encoding-b.lp ./abc/encoding-b.ilp ./abc/encoding-c.lp ./abc/encoding-c.ilp ./m/encoding.lp ./m/encoding.ilp ...
-
This helps to shorten some calls (e.g. for benchmarking) and illustrate which encoding files fit together
Invocation Examples
-
Some warehouse layouts merged with orders can be found in the directory
./examplesMany of them contain (uncommented) calls in their header, e.g.clingo action-MPP.lp strategy-MPP.lp goal-D-c.lp show.lp \ examples/x4_y4_n16_r2_s3_ps1_pr2_u4_o2_N1.lp -c horizon=8 -
There are also auxiliary bash scripts that for a clean output of facts:
- ./
clingo1factsto print only facts in one line - ./
clingo2factsto additionally print each fact in a new line (--out-ifs='\n')
- ./
asprilo Visualization
You can display your instance and plan execution in the asprilo's visualizer on the command-line by running
clingo $OPTS $ENCODINGS --outf=0 -V0 --out-atomf=%s. | \
head -n 1 | \
$VIZUALIZERwhere
$ENCODINGSholds your list of encoding file paths$OPTSholds your clingo options- clingo options
--outf=0 -V0 --out-atomf=%s.formats the output answer set in adherence to asprilo's input format - UNIX command
head -n1strips off the trailing(UN)SATISFIABLE $VIZUALIZERholds the path to the asprilo visualizer script
For example
clingo abc/{action-MPP.lp,goal-D-c.lp} examples/x4_y4_n16_r2_s3_ps1_pr2_u4_o2_N1.lp -c horizon=8
output-MPPD.lp --outf=0 -V0 --out-atomf=%s. | head -n1 | $VISUALIZER