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

arand: fix previous commit

parent 6b5330d3
No related branches found
No related tags found
No related merge requests found
...@@ -122,7 +122,7 @@ FSM RandomAutomatonFactory::LeslieConnectedNFA( size_t n, const deque<Symbol> & ...@@ -122,7 +122,7 @@ FSM RandomAutomatonFactory::LeslieConnectedNFA( size_t n, const deque<Symbol> &
// --------- // ---------
} }
   
for( State q : Q ) for( State const& q : Q )
{ {
if( automata.getTransitionsFromState( q ).size( ) == 0 && rand( ) % 100 < 90 ) if( automata.getTransitionsFromState( q ).size( ) == 0 && rand( ) % 100 < 90 )
automata.addFinalState( q ); automata.addFinalState( q );
...@@ -133,10 +133,20 @@ FSM RandomAutomatonFactory::LeslieConnectedNFA( size_t n, const deque<Symbol> & ...@@ -133,10 +133,20 @@ FSM RandomAutomatonFactory::LeslieConnectedNFA( size_t n, const deque<Symbol> &
if( automata.getFinalStates( ).size( ) == 0 ) if( automata.getFinalStates( ).size( ) == 0 )
{ {
if( n == 1 ) if( n == 1 )
{
automata.addFinalState( * automata.getInitialStates( ).begin( ) ); automata.addFinalState( * automata.getInitialStates( ).begin( ) );
}
else else
//todo: change {
automata.addFinalState( * automata.getInitialStates( ).begin( ) ); for( State const& q : Q )
{
if( automata.getTransitionsFromState( q ).size( ) == 0 )
{
automata.addFinalState( q );
break;
}
}
}
} }
   
double mnn100 = 100.0 / alphabet.size( ) / n / n; double mnn100 = 100.0 / alphabet.size( ) / n / n;
......
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