File tree 2 files changed +8
-1
lines changed
2 files changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -687,6 +687,11 @@ class FiniteStateMachine : public Abstract::FiniteStateMachine {
687
687
return nullptr ;
688
688
};
689
689
690
+ void setEdgeLabel (const EdgeRef<StateLabelType, EdgeLabelType>& e, const EdgeLabelType& l) {
691
+ auto ee = std::dynamic_pointer_cast<Edge<StateLabelType, EdgeLabelType>>((*this ->edges .find (e->getId ())).second );
692
+ ee->setLabel (l);
693
+ }
694
+
690
695
StateRef<StateLabelType, EdgeLabelType> checkStateLabeled (const StateLabelType &l) {
691
696
if (this ->states .hasStateWithLabel (l)) {
692
697
return &(this ->states .withLabel (l));
Original file line number Diff line number Diff line change @@ -163,7 +163,9 @@ void MPAutomatonTest::testDetectCycleFSM() {
163
163
fsa.addEdge (*s0, 2 , *s1);
164
164
fsa.addEdge (*s1, 2 , *s2);
165
165
fsa.addEdge (*s2, 2 , *s3);
166
- fsa.addEdge (*s3, 2 , *s1);
166
+ auto e = fsa.addEdge (*s3, 2 , *s1);
167
+
168
+ fsa.setEdgeLabel (e, 5 );
167
169
168
170
FSM::Abstract::DetectCycle DC (fsa);
169
171
bool hasCycle = DC.checkForCycles ();
You can’t perform that action at this time.
0 commit comments