rozwiazanie zadan Task202, Task203 i Task204
This commit is contained in:
parent
c58a151e84
commit
d428ccfa51
6
automata/Task202.py
Normal file
6
automata/Task202.py
Normal file
@ -0,0 +1,6 @@
|
||||
def get_number_of_final_states(automaton):
|
||||
number_of_states = 0
|
||||
for state in range(automaton.get_number_of_states()):
|
||||
if automaton.is_final_state(state):
|
||||
number_of_states += 1
|
||||
return number_of_states
|
6
automata/Task203.py
Normal file
6
automata/Task203.py
Normal file
@ -0,0 +1,6 @@
|
||||
def get_number_of_transitions(automaton, symbol):
|
||||
number_of_transitions = 0
|
||||
for state in range(automaton.get_number_of_states()):
|
||||
if automaton.get_target_state(state, symbol) is not None:
|
||||
number_of_transitions += 1
|
||||
return number_of_transitions
|
6
automata/Task204.py
Normal file
6
automata/Task204.py
Normal file
@ -0,0 +1,6 @@
|
||||
def get_number_of_loops(automaton, symbol):
|
||||
number_of_loops = 0
|
||||
for state in range(automaton.get_number_of_states()):
|
||||
if automaton.get_target_state(state, symbol) == state:
|
||||
number_of_loops += 1
|
||||
return number_of_loops
|
Loading…
Reference in New Issue
Block a user