Skip to content

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

16 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 

Repository files navigation

How to run

How to run individual sets of C++ implementations

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.

How to run the individual set of Prolog implementations

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>').

How to run an experimetal analysis and test Google OR-Tools implementations

In order to compile the analyzer and the solvers, the following should suffice:

cd src/build

cmake .. -DCMAKE_PREFIX_PATH=~/or-tools

cmake --build .

Test the solvers for the original problem and extensions - at the src directory

./build/test_solvers < data/data1_10/partition.txt

Test the greedy implementations and OR-Tools - at the src directory

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

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.

Run experimental analysis

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.

How to run the graph visualizer

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

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages