Previous: , Up: test   [Contents][Index]


How to Reproduce Plots Represented in the Paper

How to Reproduce Plots Represented in the Paper

In subdirectory scripts in the root of the package distribution there are located bash scripts described below. The scripts do not get installed by command make install.

qsmm-test-multi.sh

A script used to prepare plots of dependency of actual efficiency of interaction with deterministic finite automatons on the number of steps at a test pass for the mode when the system is comprised of two subsystems. Such plots are included in paper “An Approach to Optimal Action Generation for a System that Interacts with the Environment” that can be accessed from the project home page. The script runs the test program in a loop, producing a new file with test results and incrementing the number of steps at a test pass for each subsequent iteration. Files with test results populate a directory specified by a script argument, and the name of each file is the number of steps (at a test pass) used to create the file.

qsmm-mk-plot-dataset.sh

A script for generating a dataset to create a plot by program gnuplot. The script processes a directory with test result files generated by the qsmm-test-multi.sh script and prints to stdout a dataset that contains two columns: the number of steps at a test pass and corresponding actual efficiency (in percents) of interaction with deterministic finite automatons.

A way to reproduce the plots of dependency of actual efficiency of interaction with automatons on the number of steps at a test pass consists of the following stages.

  1. Choose a new or an empty directory out_dir to store files with test results for a selected test mode.
  2. Run multiple tests in a selected mode using the qsmm-test-multi.sh script to populate out_dir with test result files. The name of each file in out_dir is the number of steps (at a test pass) used to create the file. The script can be invoked using command line
    $ ./qsmm-test-multi.sh -d out_dir [ -C VAL ]                \
      [ additional options ] num_in_sig num_out_sig num_states
    

    For one-letter options, a whitespace after an option letter is obligatory. Options -C VAL, -s num_model_states, and -t num_passes are passed to the test program as is. Case of a system comprised of two subsystems is only supported, so if the option -s is not specified, then the number of automaton states multiplied by 2 will be used for num_model_states. Options that control the numbers of steps at test passes are listed below.

    --ni=INT

    The initial number of steps at test passes. This is the name of the first file written to out_dir. Default value is 100.

    --nf=INT

    The final number of steps at test passes. This is the name of the last file that will be written to out_dir. Default value is 100000.

    --nd=INT

    The increment in the number of steps at test passes for each subsequent invocation of the test program when creating the next file in out_dir. Can be negative, in which case the argument of option --ni should be greater than the argument of option --nf. Such negative value can be used for the second of two simultaneous runs of the script on a dual-core processor to reduce computing time twice. Default value is 100.

  3. Extract a dataset for the gnuplot (or another) program from files in out_dir. This can be done using the qsmm-mk-plot-dataset.sh script that prints coordinates of points for the plot to stdout. The script supports options --ni, --nf, and --nd, using which it determines names of files to read from out_dir. The script can be invoked using command line
    $ ./qsmm-mk-plot-dataset.sh [ options ] out_dir | tee data_set_file
    
  4. Process the dataset by the gnuplot program to draw the plot with data points and the regression line. Sample gnuplot script to perform this task is provided in the file scripts/gnuplot.script. You may also wish to draw the plot or to obtain a function for the regression line by a program other than gnuplot.

Previous: , Up: test   [Contents][Index]