← Documentation
ADS-IDAC Engine 5.0.0
KBSystemDecompositionUnit.cpp
Go to the documentation of this file.
1// KBSystemDecompositionUnit.cpp: implementation of the KBSystemDecompositionUnit class.
2//
4
6using namespace std;
7
9// Construction/Destruction
11
13{
14
15}
16
18{
19
20}
23
24
26 bool related = false;
27 int i = 0;
28 int n_count = related_subsystem.size();
29 while(i < n_count && !related){
30 if(related_subsystem[i] == _sub_system) related = true;
31 };
32 return related;
33}
35 int n_count = _kb_unit->getNumberOfRelatedSubsystem();
36 bool related = false;
37 int i = 0;
38 while (!related && i < n_count){
39 related = this->checkWhetherRelatedBaseOnSystem(_kb_unit->getRelatedSubsystem(i));
40 }
41 return related;
42}
44 int sub_sys;
46 fin >> sub_sys;
47 while(sub_sys != 999){
48 related_subsystem.push_back(sub_sys);
49 fin >> sub_sys;
50 };
51}
53 int sys_n;
54 fin >> sys_n;
55 while(sys_n != 999){
56 related_subsystem.push_back(sys_n);
57 fin >> sys_n;
58 }
59}
61 int i;
63 for(i = 0; i < _kup.related_subsystem.size(); i++){
64 related_subsystem.push_back(_kup.related_subsystem.at(i));
65 }
66}
68 int i, num;
69 this->saveKBElementToFile(fout);
70 num = this->related_subsystem.size();
71 fout << num << ' ';
72 for(i = 0; i < num; i++){
73 fout << related_subsystem.at(i) << ' ';
74 }
75 fout << '\n';
76}
78 int i, num, i_value;
80 fin >> num;
81 for(i = 0; i < num; i++){
82 fin >> i_value;
83 related_subsystem.push_back(i_value);
84 }
85}
void readInfoFromFile(std::ifstream &)
Definition: KBElement.cpp:27
void retrieveKBElementFromFile(std::ifstream &)
Definition: KBElement.cpp:36
void saveKBElementToFile(std::ofstream &)
Definition: KBElement.cpp:33
void copyKBElement(KBElement &)
Definition: KBElement.cpp:30
void retrieveKBSystemDecompositionUnitFromFile(std::ifstream &)
void readInfoFromFileIntegrated(std::ifstream &)
void readInfoFromFile(std::ifstream &)
void copyKBSystemDecompositionUnit(KBSystemDecompositionUnit &)
bool checkWhetherRelatedBasedOnInfo(KBSystemDecompositionUnit *)
void saveKBSystemDecompositionUnitToFile(std::ofstream &)