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

arand: change to final states gen

parent ed7899b8
No related branches found
No related tags found
No related merge requests found
...@@ -123,8 +123,12 @@ FSM RandomAutomatonFactory::LeslieConnectedNFA( size_t n, const deque<Symbol> & ...@@ -123,8 +123,12 @@ FSM RandomAutomatonFactory::LeslieConnectedNFA( size_t n, const deque<Symbol> &
} }
   
for( State q : Q ) for( State q : Q )
if( automata.getTransitionsFromState( q ).size( ) == 0 ) {
if( automata.getTransitionsFromState( q ).size( ) == 0 && rand( ) % 100 < 90 )
automata.addFinalState( q );
else if( automata.getTransitionsFromState( q ).size( ) > 0 && rand( ) % 100 < 10 )
automata.addFinalState( q ); automata.addFinalState( q );
}
   
if( n == 1 ) if( n == 1 )
automata.addFinalState( * automata.getInitialStates( ).begin( ) ); automata.addFinalState( * automata.getInitialStates( ).begin( ) );
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment