Modular_Class_of_state.h 1.86 KB
Newer Older
Jaime Arias's avatar
Jaime Arias committed
1
2
3
4
5
#ifndef MODULAR_CLASS_OF_STATE
#define MODULAR_CLASS_OF_STATE
//#include"Modular_Edge.h"
//#include<hash_map.h>
#include <set>
Jaime Arias's avatar
Jaime Arias committed
6
#include "Net.hpp"
Jaime Arias's avatar
Jaime Arias committed
7
//#include <vector>
Jaime Arias's avatar
Jaime Arias committed
8
9
10
11
#include "bdd.h"
//_____________________   Vecteur d'entier : repr�sente les id des bdd relatifs
//� un �tat synchronis� de n GO _________________________ typedef vector<bdd>
// SynchronizedState; struct less_SynchronizedState
Jaime Arias's avatar
Jaime Arias committed
12
//{
Jaime Arias's avatar
Jaime Arias committed
13
// bool operator()(const SynchronizedState,const SynchronizedState)const;
Jaime Arias's avatar
Jaime Arias committed
14
//};
Jaime Arias's avatar
Jaime Arias committed
15
16
// inline bool less_SynchronizedState::operator ()(const SynchronizedState
// p1,const SynchronizedState p2)const
Jaime Arias's avatar
Jaime Arias committed
17
//{
Jaime Arias's avatar
Jaime Arias committed
18
19

// for(int i=0;i<p1.size();i++)
Jaime Arias's avatar
Jaime Arias committed
20
21
//	if(p1[i].id()>p2[i].id())
//		return false;
Jaime Arias's avatar
Jaime Arias committed
22
23
// return true;

Jaime Arias's avatar
Jaime Arias committed
24
//}
Jaime Arias's avatar
Jaime Arias committed
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
// typedef set<SynchronizedState, less_SynchronizedState> Gen_Prod_Synch;
class Modular_Class_Of_State {
  // friend struct less_modular_class_of_state;
 public:
  Modular_Class_Of_State() { boucle = blocage = Visited = 0; }
  vector<bdd> State;
  bool boucle;
  bool blocage;
  bool Visited;
  set<pair<Modular_Class_Of_State *, string> > Predecessors;
  set<pair<Modular_Class_Of_State *, string> > Successors;
  friend ostream &operator<<(ostream &os, const Modular_Class_Of_State &c) {
    os << "{";
    for (unsigned int k = 0; k < c.State.size(); k++)
      os << c.State[k].id() << ", ";
    os << "}";
    return (os);
  }
Jaime Arias's avatar
Jaime Arias committed
43
44
45
};
/*____________________ MODULAR EDGE________________*/
class Modular_Class_Of_State;
Jaime Arias's avatar
Jaime Arias committed
46
47
48
typedef pair<Modular_Class_Of_State *, string> Modular_Edge;
struct LessModularEdge {
  bool operator()(const Modular_Edge, const Modular_Edge) const;
Jaime Arias's avatar
Jaime Arias committed
49
};
Jaime Arias's avatar
Jaime Arias committed
50
51
52
53
54
inline bool LessModularEdge::operator()(const Modular_Edge a1,
                                        const Modular_Edge a2) const {
  // cout<<"on compare les etiquettes des arcs : "<<a1.second<<" avec
  // "<<a2.second<<endl;
  return (a1.first < a2.first);
Jaime Arias's avatar
Jaime Arias committed
55
}
Jaime Arias's avatar
Jaime Arias committed
56
typedef set<Modular_Edge, LessModularEdge> Modular_Edges;
Jaime Arias's avatar
Jaime Arias committed
57
#endif