Commit 60333e15 authored by limingbo's avatar limingbo

test mergemulti traj at one place

parent 6c4443e3
This diff is collapsed.
......@@ -12,6 +12,12 @@ struct TaskInfo{
uint32_t meshId = 0;
};
struct CloseTrajInfo{
size_t index;
string trajPath;
vector<pair<uint64_t, uint64_t>> periods;
};
vector<string> getActiveTraces(
const string& activeTracePath);
......@@ -20,7 +26,7 @@ vector<string> getCloseTasks(
boost::shared_ptr<Trajectory> currTraj);
void getCrossTasks(const vector<string> &allTask,
vector<pair<string, vector<pair<uint64_t, uint64_t> > > > &crossTasks);
vector<CloseTrajInfo> &crossTasks);
bool getTaskInfo(
const string &taskPath,
......@@ -37,7 +43,7 @@ bool checkMeshOut(
const MeshOut& query,
const MeshOut& target);
vector<pair<string, vector<pair<uint64_t, uint64_t> > > > crossFilter(
vector<CloseTrajInfo> crossFilter(
const vector<TaskInfo> &filteredTaskInfo);
bool initTrajectory(const string &trajPath,
......
......@@ -35,20 +35,20 @@ int main(int argc, char *argv[])
}
activeTraces.insert(activeTraces.begin(), FLAGS_base_dir);
vector<pair<string, vector<pair<uint64_t, uint64_t>>>> crossTasks;
vector<CloseTrajInfo> crossTasks;
getCrossTasks(activeTraces, crossTasks);
if(crossTasks.size() == 0){
LOG(WARNING) << "crossTasks.size() == 0";
}else{
sort(crossTasks.begin(), crossTasks.end(),
[](const auto& query, const auto& target) {
return stoi(boost::filesystem::path(query.first).filename().string()) <
stoi(boost::filesystem::path(target.first).filename().string());
return stoi(boost::filesystem::path(query.trajPath).filename().string()) <
stoi(boost::filesystem::path(target.trajPath).filename().string());
});
}
for(auto task : crossTasks){
LOG(INFO) << "cross task chekc in: " << task.first;
LOG(INFO) << "cross task chekc in: " << task.trajPath;
}
string outputPath = FLAGS_base_dir + "/multiTraj.txt";
......@@ -61,9 +61,9 @@ int main(int argc, char *argv[])
// ofs << crossTasks.back() << std::endl;
for(auto task : crossTasks){
uint32_t meshId =
stoi(boost::filesystem::path(task.first).filename().string());
stoi(boost::filesystem::path(task.trajPath).filename().string());
ofs << meshId;
for(auto period : task.second){
for(auto period : task.periods){
ofs << setprecision(15) << " " << period.first << " " << period.second - period.first;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment