File tree Expand file tree Collapse file tree 2 files changed +8
-1
lines changed Expand file tree Collapse file tree 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 {
687687 return nullptr ;
688688 };
689689
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+
690695 StateRef<StateLabelType, EdgeLabelType> checkStateLabeled (const StateLabelType &l) {
691696 if (this ->states .hasStateWithLabel (l)) {
692697 return &(this ->states .withLabel (l));
Original file line number Diff line number Diff line change @@ -163,7 +163,9 @@ void MPAutomatonTest::testDetectCycleFSM() {
163163 fsa.addEdge (*s0, 2 , *s1);
164164 fsa.addEdge (*s1, 2 , *s2);
165165 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 );
167169
168170 FSM::Abstract::DetectCycle DC (fsa);
169171 bool hasCycle = DC.checkForCycles ();
You can’t perform that action at this time.
0 commit comments