Algorithms Library Toolkit
A toolkit for algorithms, especially for algorithms on formal languages
Static Public Member Functions
automaton::generate::RandomAutomatonFactory Class Reference

#include <RandomAutomatonFactory.h>

Static Public Member Functions

template<class SymbolType >
static automaton::NFA< SymbolType, unsigned > generateNFA (size_t statesCount, const ext::set< SymbolType > &alphabet, double density)
 
static automaton::NFA< std::string, unsigned > generateNFA (size_t statesCount, size_t alphabetSize, bool randomizedAlphabet, double density)
 

Detailed Description

Generator of random automata.

The underlying generation algorithm is from Leslie, T: Efficient Approaches to Subset Construction, 1995.

Member Function Documentation

◆ generateNFA() [1/2]

template<class SymbolType >
automaton::NFA< SymbolType, unsigned > automaton::generate::RandomAutomatonFactory::generateNFA ( size_t  statesCount,
const ext::set< SymbolType > &  alphabet,
double  density 
)
static

Generates a random finite automaton.

Template Parameters
SymbolTypethe type of terminal symbols of the random automaton
Parameters
statesCountnumber of states in the generated automaton
alphabetInput alphabet of the automaton
densitydensity of the transition function (double from interval 0-100)
Returns
random nondeterministic finite automaton

◆ generateNFA() [2/2]

automaton::NFA< std::string, unsigned > automaton::generate::RandomAutomatonFactory::generateNFA ( size_t  statesCount,
size_t  alphabetSize,
bool  randomizedAlphabet,
double  density 
)
static

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Generates a random finite automaton.

Parameters
statesCountnumber of states in the generated automaton
alphabetSizesize of the alphabet (1-26)
randomizedAlphabetselects random symbols from a-z range if true
densitydensity of the transition function (0-100). 100 means every possible transition is created
Returns
random nondeterministic finite automaton

The documentation for this class was generated from the following files: