In order to run our AC-3 implementation, the following should suffice:
At the src directory:
g++ ac3.cpp -o ac3
./ac3 < '<input_file>'
Keep in mind that our main functions use standard IO by default.
In order to run our Prolog implementation using the clpfd library, the following should suffice:
swipl -q -s solver.pl -g "solve('<input_file>', '<output_fule>')." -t halt
Or, more flexibly:
swipl solver.pl
And then, from within the interactive console:
solve('<input_file>', '<output_file>').
In order to compile the analyzer and the solvers, the following should suffice:
cd src/build
cmake .. -DCMAKE_PREFIX_PATH=~/or-tools
cmake --build .
./build/test_solvers < data/data1_10/partition.txt
In each line, it will print name of the algorithm, number of guards given and time to execute in microseconds
./build/experimental_analysis < data/data1_10/partition.txt
Examples can be found at the src/data directory. Each sub-directory here includes a file partition.txt that is an example of a partition.
To make an analysis, partitions will be generated using our professor's generator. The following should suffice for a complete analysis as described in the report:
Before that guarantee that the generator was compiled. At the src directory:
cd PartsRectangulares/PartsRectangulares && gcc rectParts.c
Then at src directory:
./do_experimental_analysis.sh
Additionally, there's a way to selectively analyse partitions. The following is a prime example:
./build/experimental_analysis < data/data1_10/partition.txt
The experimental_analysis.cpp program expects a partition just like those generated by our professor's generator. Therefore, any such file can be used for this, which means data/data1_10/partition.txt is not special in any way. The output will show up in the console.
Also, note that the numbers in data<partitions>_<rectangles>/ are representative of the idx of the partition in the data directory and the number of rectangles, respectively, from left to right.
Just a reminder: the output includes multiple lines, where each line is composed of three elements. First, the name of the algorithm that was used; second, the solution (number of guards) and, lastly, the number of microseconds it took the algorithm to compute the solution.
The graph visualizer uses the data generated by the experiments. More particularly, it uses the results.txt files from each data/data<number>_<number>/ directory. Make sure NumPy is installed. The following should suffice:
python3 graphs_experimental_analysis.py