00001 00002 // 00003 // Copyright (c) 2004 Model-based Embedded and Robotic Systems Group 00004 // All Rights Reserved Massachusetts Institute of Technology 00005 // 00006 // This software is provided as is. Model-based Embedded and Robotic Systems 00007 // (MERS) group does not assume any responsibility. 00008 // 00009 // Organization: Model-based Embedded and Robotic Systems Group 00010 // Massachusetts Institute of Technology 00011 // 00013 //# CHECKED MJP 08-07-2002 00014 00015 #ifndef __CONFLICT__ 00016 #define __CONFLICT__ 00017 00018 #ifdef _MSC_VER 00019 #pragma warning( disable : 4786 ) 00020 #endif 00021 00022 #include <cstdlib> 00023 #include <iostream> 00024 #include <list> 00025 #include "BFIGImplicant.h" 00026 00027 #include <Mers/Utils/Lang/String.h> 00028 00029 namespace Mers { 00030 namespace Generators { 00031 namespace BFIG { 00032 00033 class BFIGAssignment; 00034 00039 class Conflict 00040 { 00041 friend std::ostream& operator<<(std::ostream&, Conflict const &); 00042 00043 public: 00044 //---------------------------------------------------- 00045 // TYPE DEFINITIONS & OVERLOADED OPERATORS 00046 //---------------------------------------------------- 00047 //typedef BFIGAssignment* PrimeImplicantType; 00048 bool operator==(Conflict const & c) const; 00049 bool operator<(Conflict const & c) const; 00050 00051 //-------------------------------------- 00052 // CONSTRUCTOR 00053 //-------------------------------------- 00054 //Conflict(list<BFIGAssignment const *> inconsistentAssignments_pList, 00055 // list<BFIGAssignment const *> primeImplicants_pList); 00056 Conflict(list<BFIGAssignment const *> inconsistentAssignments_pList); 00057 00058 //-------------------------------------- 00059 // PUBLIC METHODS 00060 //-------------------------------------- 00061 list<BFIGAssignment const *> getInconsistentAssignments() const; 00062 00063 list<BFIGAssignment const *> getPrimeImplicants() const; 00064 00065 int getLength() const; 00066 bool isEmpty() const; 00067 00068 bool supportedBy(BFIGImplicant const * implicant) const; 00069 bool supportedBy(BFIGAssignment const * a) const; 00070 00071 String toString() const; 00072 00073 //void recordConflict(); 00074 //void trySupportingConflict(BFIGImplicant const * currentImplNode); 00075 00076 protected: 00077 Conflict(); 00078 00079 private: 00080 00081 void createPrimeImplicants(); 00082 00083 //-------------------------------------- 00084 // PRIVATE DATA MEMBERS 00085 //-------------------------------------- 00086 list<BFIGAssignment const *> inconsistentAssignments; 00087 // List of collectively inconsistent assignments. This represents an infeasible 00088 // subset of the state space where any candidate containing all of these assignments 00089 // is infeasible. 00090 00091 list<BFIGAssignment const *> primeImplicants; 00092 // All assignments that entail this conflict, that being any candidate containing 00093 // one of these assignments is guaranteed to lie outside the infeasible subspace 00094 // represented by the conflict - does this mean that it then lies inside the feasible subspace? 00095 00096 //BFIGAssignment const * currentEntailedAssignment; 00097 // The assignment in the current search state that entails this conflict. 00098 // When non-empty, this points to the assignment with the best cost that entails 00099 // the conflict. 00100 00101 00102 //----------------------------------------- 00103 // PRIVATE METHODS 00104 //----------------------------------------- 00105 00106 }; 00107 } 00108 } 00109 } 00110 00111 #endif //ndef __CONLICT__ 00112
1.5.0