Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GSoC 2022: Manas Sivakumar Week 5 #229

Merged
merged 29 commits into from
Jul 18, 2022

Conversation

Manas23601
Copy link

@Manas23601 Manas23601 commented Jul 10, 2022

Changes proposed in this pull request:

  • Updated docqueries.
  • Made small changes to knapsack function signature and data processing in sql and src.
  • Completed knapsack driver implementation.
  • Created necessary structs in c_common, c_types and driver folders for internal processing inside knapsack driver.
  • Tested out knapsack function without ortools processing using doc_queries_generator.pl.

@Manas23601 Manas23601 added the manas-2022 Done by Manas Sivakumar label Jul 10, 2022
@Manas23601
Copy link
Author

Manas23601 commented Jul 10, 2022

The procedure to add google-or tools is not clear to me.
I explored two approaches :

  1. Use the find_package function:
  • This requires us to add the ortools root directory (which contains ortools.config) to the cmake_prefix_path. The problem with this approach is once you add ortools you have to add its dependencies as well to cmake_prefix_path(absl was the first one to come) and later the dependency's dependencies (sub dependency).

  • After doing this for some time, I noticed some target files were missing in the location where it was looked for but was available in an another location. I Initially thought of looping over the folder and including all the src and config files but there doesn't seem to be any pattern in which the files are located within the directory.

  1. Using add_directory:
  • In this step you only need to add the ortools directory to the cmake. It apparently builds ortools with the existing cmake project and the dependencies are stored in the build folder.

  • The problem here is in order to run a program with ortools files, the program needs to be inside the ortools folder and be run with make build SOURCE=\file\location and make run SOURCE=\file\location commands. I have no idea how to use ortools normally now after I have built it. Is there any option where I could just import the libraries ?

  • VROOM seems to work in the above fashion. It is build separately and the src and lib files are included. but for ortools these files are all over the place

@Manas23601
Copy link
Author

I also want to know at which location I can add my get_weights_values (processes the sql function and returns array of values) function. Should I add it to an existing file like orders.h or maybe create my own file knapsck.h

@Manas23601
Copy link
Author

Processing test: docqueries/or_tools/knapsack.test.sql test run time: 0.120599 FAIL
$stats = {
'docqueries/or_tools/test.conf' => [
{
'comment' => 'test for or-tools',
'docqueries/or_tools/knapsack.test.sql' => 'FAILED: 0a1,34

BEGIN;
BEGIN
SET client_min_messages TO NOTICE;
SET
CREATE TABLE knapsack_data(
weight INTEGER,
cost INTEGER);
CREATE TABLE
INSERT INTO knapsack_data (weight, cost)
VALUES
(12, 4),
(2, 2),
(1, 1),
(4, 10),
(1, 2);
INSERT 0 5
SELECT *
FROM knapsack_data;
weight | cost
--------+------
12 | 4
2 | 2
1 | 1
4 | 10
1 | 2
(5 rows)

SELECT *
FROM vrp_knapsack($$SELECT weight, cost FROM knapsack_data$$, 3);
WARNING: Stopping execution
CONTEXT: SQL function "vrp_knapsack" statement 1
ROLLBACK;
ROLLBACK
Binary file /tmp/pgr-test-runner-88443 matches'
}
],
'z_crash' => 0,
'z_fail' => 1,
'z_pass' => 0
};

@cvvergara
Copy link
Member

now throwing up to where you have revised code?
"WARNING: Stopping execution"
Like in the stream in the begining of the week.
good

@cvvergara
Copy link
Member

cvvergara commented Jul 14, 2022

To update the .result file

tools/testers/doc_queries_generator.pl -alg or_tools -doc 

@Manas23601 Manas23601 marked this pull request as ready for review July 18, 2022 18:48
@Manas23601 Manas23601 merged commit ff9b1aa into pgRouting:manas-2022 Jul 18, 2022
@Manas23601 Manas23601 changed the title GSoC 22 : Manas Sivakumar Week 5 GSoC 2022 : Manas Sivakumar Week 5 Sep 11, 2022
@Manas23601 Manas23601 changed the title GSoC 2022 : Manas Sivakumar Week 5 GSoC 2022: Manas Sivakumar Week 5 Sep 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
manas-2022 Done by Manas Sivakumar
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants