@@ -122,31 +122,6 @@ MPTime getMaxOfColUntilRow(Matrix &M, uint colNumber, uint rowNumber) {
122
122
return largestEl;
123
123
}
124
124
125
- /*
126
- * Loads an entity from its starting '{' to the corresponding '}'
127
- */
128
- std::string loadEntity (std::ifstream &stream, std::string line) {
129
- std::string out = line;
130
- size_t openBracketCount = 0 ;
131
- size_t closeBracketCount = 0 ;
132
- openBracketCount += std::count (line.begin (), line.end (), ' {' );
133
- closeBracketCount += std::count (line.begin (), line.end (), ' }' );
134
-
135
- // get the whole activity {} into a string
136
- while (getline (stream, line)) {
137
-
138
- openBracketCount += std::count (line.begin (), line.end (), ' {' );
139
- closeBracketCount += std::count (line.begin (), line.end (), ' }' );
140
- out += line;
141
-
142
- if (openBracketCount == closeBracketCount) {
143
- openBracketCount = 0 ;
144
- closeBracketCount = 0 ;
145
- break ;
146
- }
147
- }
148
- return out;
149
- }
150
125
std::shared_ptr<MaxPlusAutomaton> SMPLS::convertToMaxPlusAutomaton () const {
151
126
auto mpa = std::make_shared<MaxPlusAutomaton>();
152
127
// transposeMatrices();
@@ -163,14 +138,14 @@ std::shared_ptr<MaxPlusAutomaton> SMPLS::convertToMaxPlusAutomaton() const {
163
138
if (!e.empty ()) {
164
139
MPString label = (dynamic_cast <ELSEdgeRef>(*e.begin ()))->getLabel ();
165
140
166
- for (const auto &smIt : this ->sm ) {
141
+ for (const auto &smIt : this ->mm ) {
167
142
if ((smIt).first == label) {
168
143
nrTokens = (smIt).second ->getCols ();
169
144
break ;
170
145
}
171
146
}
172
147
} else {
173
- nrTokens = (*this ->sm .begin ()).second ->getCols ();
148
+ nrTokens = (*this ->mm .begin ()).second ->getCols ();
174
149
}
175
150
// create a state for (q, k)
176
151
const CId qId = (dynamic_cast <ELSState &>(qq)).getLabel ();
@@ -222,7 +197,7 @@ std::shared_ptr<MaxPlusAutomaton> SMPLS::convertToMaxPlusAutomaton() const {
222
197
const auto *tr = dynamic_cast <ELSEdgeRef>(e);
223
198
CId q2Id = dynamic_cast <ELSStateRef>(tr->getDestination ())->getLabel ();
224
199
MPString sc = tr->getLabel ();
225
- std::shared_ptr<Matrix> Ms = this ->sm .at (sc);
200
+ std::shared_ptr<Matrix> Ms = this ->mm .at (sc);
226
201
size_t r = Ms->getRows ();
227
202
size_t c = Ms->getCols ();
228
203
@@ -347,7 +322,7 @@ std::shared_ptr<MaxPlusAutomaton> SMPLSwithEvents::convertToMaxPlusAutomaton() {
347
322
* all square (to the size of the biggest matrix) by adding rows and cols of -infty
348
323
*/
349
324
void SMPLSwithEvents::makeMatricesSquare () {
350
- for (const auto &it : this ->sm ) {
325
+ for (const auto &it : this ->mm ) {
351
326
std::shared_ptr<Matrix> m = it.second ;
352
327
m->addCols (biggestMatrixSize - m->getCols ());
353
328
m->addRows (biggestMatrixSize - m->getRows ());
@@ -356,7 +331,7 @@ void SMPLSwithEvents::makeMatricesSquare() {
356
331
357
332
// transposes all matrices of the SMPLS
358
333
void SMPLS::transposeMatrices () {
359
- for (auto &it : this ->sm ) {
334
+ for (auto &it : this ->mm ) {
360
335
it.second = it.second ->getTransposedCopy ();
361
336
}
362
337
}
@@ -548,7 +523,7 @@ void SMPLSwithEvents::prepareMatrices(const IOAState &s,
548
523
eList.insert (outputActionEventName);
549
524
}
550
525
551
- this ->sm [modeName] = sMatrix ;
526
+ this ->mm [modeName] = sMatrix ;
552
527
visitedEdges.insert (e);
553
528
554
529
// we need this later to make all matrices square
@@ -762,7 +737,7 @@ bool SMPLSwithEvents::compareEventLists(EventList &l1, EventList &l2) {
762
737
763
738
void SMPLSwithEvents::dissectModeMatrices () {
764
739
ModeMatrices::iterator s;
765
- for (const auto &s : this ->sm ) {
740
+ for (const auto &s : this ->mm ) {
766
741
numberOfResources = 0 ;
767
742
std::shared_ptr<DissectedModeMatrix> dis = std::make_shared<DissectedModeMatrix>();
768
743
dis->core .insert (s);
0 commit comments