From a2330244e91af1407611100543c93412828fd327 Mon Sep 17 00:00:00 2001 From: Ghofrane Amaimi <ghofraneeamaimi@gmail.com> Date: Mon, 9 May 2022 18:14:37 +0200 Subject: [PATCH] add structures of a new node and edge of the product --- src/algorithm/CNDFS.cpp | 16 ++++++++++------ src/algorithm/CNDFS.h | 4 ++-- src/main.cpp | 1 + 3 files changed, 13 insertions(+), 8 deletions(-) diff --git a/src/algorithm/CNDFS.cpp b/src/algorithm/CNDFS.cpp index 53f1ebb..02e4c26 100644 --- a/src/algorithm/CNDFS.cpp +++ b/src/algorithm/CNDFS.cpp @@ -16,19 +16,24 @@ using namespace std; bool red=false; bool blue=false; thread_local bool cyan = false; -struct product_node{ + +struct new_state{ ModelCheckBaseMT &left; shared_ptr<spot::twa_graph> right; }; -struct product_node_succ{ - vector<pair<LDDState*, int> > succ_left; - spot::twa_succ_iterator &sadd structures of a new node and edge of the product ucc_right; +struct new_state_succ{ + LDDState *succ_left; + spot::twa_succ_iterator *succ_right; }; +vector<new_state_succ> successors_new_node; + std::mutex mtx; -//CNDFS::CNDFS(auto mK, const shared_ptr<spot::twa_graph> &mAa) : mK(mK), mAa(mAa) {} +//j'ai un problème de passage des paramétres dans le constructeur(pointeur vs adresse) +//CNDFS::CNDFS(ModelCheckBaseMT *mMcl, const shared_ptr<spot::twa_graph> &mAa) : mMcl(mMcl), mAa(mAa) {} + CNDFS::~CNDFS()=default; //structure qui represente le produit de 2 états @@ -63,7 +68,6 @@ CNDFS::~CNDFS()=default; } - //void CNDFS::spawnThreads(int n, ModelCheckBaseMT &mcl, shared_ptr<spot::twa_graph> af ) //{ // std::vector<thread> threads(n); diff --git a/src/algorithm/CNDFS.h b/src/algorithm/CNDFS.h index 547901d..c6022dd 100644 --- a/src/algorithm/CNDFS.h +++ b/src/algorithm/CNDFS.h @@ -11,9 +11,9 @@ class CNDFS { private: static ModelCheckBaseMT *mMcl; - //shared_ptr<spot::twa_graph> mAa; + shared_ptr<spot::twa_graph> mAa; public: - //CNDFS(auto mK, const shared_ptr<spot::twa_graph> &mAa); + //CNDFS(ModelCheckBaseMT *mMcl, const shared_ptr<spot::twa_graph> &mAa); virtual ~CNDFS(); //static void DfsBlue(); diff --git a/src/main.cpp b/src/main.cpp index f26d17e..73a8fcf 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -528,6 +528,7 @@ int main(int argc, char **argv) // cout <<"pointeur sur BA "<< typeid(aa).name() <<endl; CNDFS cndfs; + //CNDFS cndfs(*mcl, aa); //cndfs.DfsBlue(*mcl, aa); thread thread_1 (cndfs.DfsBlue,ref(*mcl),ref(aa)); thread thread_2 (cndfs.DfsBlue,ref(*mcl),ref(aa)); -- GitLab