added several grid-walks

added new helper methods/classes (e.g. for heading)
new test cases
optimize the dijkstra
cleanups/refactoring
added timed-benchmarks to the log
many more...
This commit is contained in:
2016-01-24 18:59:06 +01:00
parent cdf97322f8
commit 9947dced15
30 changed files with 1406 additions and 94 deletions

View File

@@ -4,23 +4,37 @@
#include <string>
#include <iostream>
#include <iomanip>
#include "Time.h"
class Log {
public:
static void add(const char* comp, const std::string what) {
addComp(comp);
std::cout << what << std::endl;
std::cout << what;
addTime();
std::cout << std::endl;
}
static void add(const std::string& component, const std::string what) {
addComp(component.c_str());
std::cout << what << std::endl;
std::cout << what;
addTime();
std::cout << std::endl;
}
private:
static void addTime() {
static auto last = Time::tick();
const auto cur = Time::tick();
std::cout << " (+" << Time::diffMS(last, cur) << "ms)";
last = cur;
}
static void addComp(const char* component) {
std::cout << "[" << std::setw(12) << std::setfill(' ') << component << "] ";
}