<<<<<<< HEAD ======= >>>>>>> 36cce3c7378a5c3df4fdb33637490d3507fdb395

Functionality

The prototype offers several functions, which are described on this page.

Simulation

The main mode of the prototype is the simulation function. It runs a faux-distributed stream reasoner by use of multiprocessing. To ensure accuracy of the simulation, each reasoner node is given its own process, and all communication is handled via sockets. It is invoked via the simulate command.

# Example
distributed-sr simulate test/MMedia.lars < test/MMedia-01.log

# Example using a single node
distributed-sr simulate -s test/MMedia.lars < test/MMedia-01.log

# Example using Ticker as a reasoner
distributed-sr simulate --ticker ticker/Ticker-assembly.jar --tick-interval 1 test/MMedia.lars < test/MMedia-01.log

The simulation is fed with a log of the following form.

2019-01-16T10:00:00 alpha(5);+ rtm50;+
2019-01-16T10:00:10 alpha(5);- alpha(15);+
2019-01-16T10:00:21 rtm50;- alpha(15);+
2019-01-16T10:00:25 alpha(15);- alpha(25);+
2019-01-16T10:00:55 alpha(25);-
2019-01-16T10:01:00 alpha(5);+ rtm50;+
2019-01-16T10:01:10 alpha(5);- alpha(15);+
2019-01-16T10:01:21 rtm50;- alpha(15);+
2019-01-16T10:01:25 alpha(15);- alpha(25);+
2019-01-16T10:01:55 alpha(25)-

Every line starts with a timestamp at which its events should occur. It is then followed by a space separated list of atoms and phase transitions. A phase transition can be either + or -, indicating whether an atom is now true or false. As outlined in the paper, an atoms truth state remains unchanged until a change has been observed. All atoms start out as false.

The -s parameter forces the system into single node mode. In this mode, the decomposition step is disabled and only a single reasoner node will be spawned.

Evaluation

The evaluation command allows replication of our experiments, and is how our experiments were conducted. It has several subcommands. All subcommands share access to the same set of test cases:

  1. mmedia. The “Video” domain.
  2. content-retrieval. The “Content Retrieval” domain. Not used in the paper.
  3. nqueens-2. A 2-stage version of the N-Queens problem.
  4. nqueens-4. A 4-stage version of the N-Queens problem.
  5. nqueens-6. A 6-stage version of the N-Queens problem.

Total-Time Test

The total-time subcommand runs CPU Time measurements on a given test case. It accepts all valid parameters to simulate, as well as the following

  • -w (default = 1) determines the window size to be used in the encoding. While this may seem ambiguous in general, none of the test cases used have multiple window sizes.
  • -e (optional) determines the number of events in the stream used for the test. If omitted, a series of tests will be run with event stream sizes 100,200,…,1000.

Load Test

The load-test command runs the latency measurements as outlined in the paper. It also accepts all valid parameters to simulate to set up the reasoner, as well as

  • -w (default = 1) determines the window size to be used in the encoding. While this may seem ambiguous in general, none of the test cases used have multiple window sizes.
  • -u (default = 1.0) determines the upper bound of the tick interval range to test.
  • -l (default = 0.1) determines the lower bound of the tick interval range to test.
  • --step (default = 0.05) determines the step width for the tick interval range.

Note that for load testing, external reasoners will have their tick frequency set in accordance to the tick interval automatically!

Outputting Test Cases

Finally, test cases can be outputted for inspection, or use with some other reasoner, by using the dump-case subcommand. The -e flag will dump the encoding, whereas the -l flag will generate an input log of given size.

Graph Output

The show-graph command can be used to inspect the dependency graph or the component graph generated from a given input problem. It depends on the xdot tool being installed and in your $PATH!

It expects a graph as a parameter. The valid options are dep and comp and should be self explanatory.

If the graph is needed for some further processing, the tool generates a GraphViz file in /tmp/, which is not deleted after execution. This can be used if access to the underlying GraphViz data is required.

Linearization and Transpilation

A stratification of a LARS program can be obtained with the linearize command. It will decompose the input program and output it in chunks, respecting the dependencies in the program. Note that this is a debug tool and may or may not break unexpectedly.

A further debug tool is the transpile command, which outputs the transpiled version of the LARS program, as required by our reasoning nodes. The output ASP is quite comparable to the input LARS, but with extended atoms replaced through external functions. See the paper for details.

<<<<<<< HEAD ======= >>>>>>> 36cce3c7378a5c3df4fdb33637490d3507fdb395