
from amachine.am_create import random_machine

from amachine.am_syntagmatics import *

# May have multiple recurrent subgraphs, terminal states, or tranistory states
m = random_machine( 
	n_states=11, 
	symbols=[ '0', '1', '2' ],
	connectedness=0.75,
	randomness=0.35 )

# Collapse to the largest recurrent subgraph
m.collapse_to_largest_strongly_connected_subgraph()

# Minimize the machine -> epsilon-machine.
m.minimize()

# Entropy rate, statistical complexity, excess entropy, crypticity 
print( f"h_mu : {m.h_mu()}" )
print( f"C_mu : {m.C_mu()}" )

# Draw the graph 
m.draw_graph( output_dir=".", show=True )

