Skip to content
Snippets Groups Projects
Commit f00af6b1 authored by Tomáš Pecka's avatar Tomáš Pecka
Browse files

arand: Always generate at least one final state.

parent 7eb5f53e
No related branches found
No related tags found
No related merge requests found
...@@ -130,8 +130,14 @@ FSM RandomAutomatonFactory::LeslieConnectedNFA( size_t n, const deque<Symbol> & ...@@ -130,8 +130,14 @@ FSM RandomAutomatonFactory::LeslieConnectedNFA( size_t n, const deque<Symbol> &
automata.addFinalState( q ); automata.addFinalState( q );
} }
   
if( n == 1 ) if( automata.getFinalStates( ).size( ) == 0 )
automata.addFinalState( * automata.getInitialStates( ).begin( ) ); {
if( n == 1 )
automata.addFinalState( * automata.getInitialStates( ).begin( ) );
else
//todo: change
automata.addFinalState( * automata.getInitialStates( ).begin( ) );
}
   
double mnn100 = 100.0 / alphabet.size( ) / n / n; double mnn100 = 100.0 / alphabet.size( ) / n / n;
while( automata.getTransitions( ).size( ) * mnn100 < density ) while( automata.getTransitions( ).size( ) * mnn100 < density )
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment