26#include <ext/algorithm>
59 template <
class SymbolType >
108 template <
class SymbolType >
112template <
class SymbolType >
115 return RandomAutomatonFactory::LeslieConnectedNFA ( statesCount, alphabet2, density );
118template <
class SymbolType >
132 for(
size_t i = 0;
i < n;
i ++ ) {
133 VStates.push_back(
false );
140 }
else if( n == 1 ) {
154 while( unvisited != 0 ) {
165 for(
const unsigned &
q : Q ) {
172 if(
automaton.getFinalStates( ).empty ( ) ) {
176 for(
const unsigned &
q : Q ) {
177 if(
automaton.getTransitionsFromState(
q ).empty ( ) ) {
185 double mnn100 = 100.0 /
alphabet.size( ) / n / n;
186 while(
automaton.getTransitions ( ).size ( ) * mnn100 < density ) {
195 for (
const auto & t :
automaton.getTransitions ( ) )
196 alphabetUsage.erase ( t.first.second );
198 for (
const auto & kv : alphabetUsage )
Nondeterministic finite automaton. Accepts regular languages.
Definition: NFA.h:66
Definition: RandomAutomatonFactory.h:47
static automaton::NFA< SymbolType, unsigned > generateNFA(size_t statesCount, const ext::set< SymbolType > &alphabet, double density)
Definition: RandomAutomatonFactory.h:113
Basic exception from which all other exceptions are derived.
Definition: CommonException.h:21
Class extending the deque class from the standard library. Original reason is to allow printing of th...
Definition: deque.hpp:44
static semirandom_device & semirandom
The reference to singleton semirandom device.
Definition: random.hpp:147
Definition: BarSymbol.cpp:12
int i
Definition: AllEpsilonClosure.h:118
q
Definition: SingleInitialStateEpsilonTransition.h:85
Definition: ToGrammar.h:31