]> rtime.felk.cvut.cz Git - hubacji1/iamcar2.git/commitdiff
Add test cases 13 and 14
authorJiri Vlasak <hubacji1@fel.cvut.cz>
Thu, 2 Jan 2020 15:15:48 +0000 (16:15 +0100)
committerJiri Vlasak <hubacji1@fel.cvut.cz>
Thu, 2 Jan 2020 15:27:36 +0000 (16:27 +0100)
CMakeLists.txt
README.md
src/test13.cc [new file with mode: 0644]
src/test14.cc [new file with mode: 0644]

index 16c62de14acd540fa0dd43a4f89ff748b8706132..7bd0fe0bf04e1783299aa208ea76cf2bcfbdc349 100644 (file)
@@ -49,3 +49,5 @@ add_executable(test9 src/test9.cc)
 add_executable(test10 src/test10.cc)
 add_executable(test11 src/test11.cc)
 add_executable(test12 src/test12.cc)
+add_executable(test13 src/test13.cc)
+add_executable(test14 src/test14.cc)
index 23404f617e51c6acbbb0087cbf4b9912798ee5d5..3795439d9b8b9a1c5abdeb09e201be58cdff241b 100644 (file)
--- a/README.md
+++ b/README.md
@@ -60,6 +60,8 @@ The following are expected in the output along with *plan*:
 
 ## Test files
 There is a list of test files and what they include:
+- `test14.cc`: cute, grid, RS-heur, dijkstra (`ce9`).
+- `test13.cc`: cute, grid, RS-RS, dijkstra (`ce8`).
 - `test12.cc`: cute collision, grid structure, RS for both -- build and search
   cost (`ce6`).
 - `test11.cc`: cute collision, grid structure, RS for build, Matej's heuristics
diff --git a/src/test13.cc b/src/test13.cc
new file mode 100644 (file)
index 0000000..e616503
--- /dev/null
@@ -0,0 +1,38 @@
+#include <chrono>
+#include <iostream>
+#include <jsoncpp/json/json.h>
+
+#include "rrtce.h"
+#define EPP RRTCE8
+
+std::chrono::high_resolution_clock::time_point TSTART_;
+std::chrono::high_resolution_clock::time_point TEND_;
+inline void TSTART() { TSTART_ = std::chrono::high_resolution_clock::now(); }
+inline void TEND() { TEND_ = std::chrono::high_resolution_clock::now(); }
+inline double TDIFF()
+{
+        std::chrono::duration<double> DT_;
+        DT_ = std::chrono::duration_cast<std::chrono::duration<double>>(
+                TEND_ - TSTART_
+        );
+        return DT_.count();
+}
+inline void TPRINT(const char *what)
+{
+        std::cerr << what << ": " << TDIFF() << std::endl;
+}
+
+int main()
+{
+        Json::Value jvi; // JSON input
+        std::cin >> jvi;
+
+        EPP epp;
+        epp.json(jvi);
+        epp.init();
+
+        while (epp.next()) {}
+
+        std::cout << epp.json() << std::endl;
+        return 0;
+}
diff --git a/src/test14.cc b/src/test14.cc
new file mode 100644 (file)
index 0000000..5571b5c
--- /dev/null
@@ -0,0 +1,38 @@
+#include <chrono>
+#include <iostream>
+#include <jsoncpp/json/json.h>
+
+#include "rrtce.h"
+#define EPP RRTCE9
+
+std::chrono::high_resolution_clock::time_point TSTART_;
+std::chrono::high_resolution_clock::time_point TEND_;
+inline void TSTART() { TSTART_ = std::chrono::high_resolution_clock::now(); }
+inline void TEND() { TEND_ = std::chrono::high_resolution_clock::now(); }
+inline double TDIFF()
+{
+        std::chrono::duration<double> DT_;
+        DT_ = std::chrono::duration_cast<std::chrono::duration<double>>(
+                TEND_ - TSTART_
+        );
+        return DT_.count();
+}
+inline void TPRINT(const char *what)
+{
+        std::cerr << what << ": " << TDIFF() << std::endl;
+}
+
+int main()
+{
+        Json::Value jvi; // JSON input
+        std::cin >> jvi;
+
+        EPP epp;
+        epp.json(jvi);
+        epp.init();
+
+        while (epp.next()) {}
+
+        std::cout << epp.json() << std::endl;
+        return 0;
+}