Title: Application of Genetic Algorithms for Construction of Moore Automaton and Systems of Interacting Mealy Automata in
1Application of Genetic Algorithms for
Construction of Moore Automaton and Systems of
Interacting Mealy Automata in Artificial Ant
Problem
- A. Davydov, D. Sokolov, F. Tsarev
- Scientific advisor prof. A. Shalyto
- 2008
2Automata based programming
- Proposed in Russia in 1991
- Software systems are developed as well as
automation of engineering (and other) process - Control system is a system of interacting finite
state machines
- States
- Events and input variables
- Output events
- Finite state machine
- System of finite state machines
3Method advantages
- Effective for systems with complicated behavior
- Formal and understandable behavior description
- Automatic code generation from transition
diagrams - Possibility of program verification
- Project documentation
4Problem
- The general difficulty in automata based
programming is automata construction - In a majority of cases automata are designed
manually - Heuristic automata construction is often very
hard and time-consuming - The solution is to use genetic programming for
automatic finite state machines generation
5Artificial ant problem
- Torus 32x32
- 89 cells with food
- 200 steps
- The locations of food are fixed
- Goal is to create an ant which can eat all food
in 200 steps
6What ant can do?
- Determine is there food in front of it
- Do one of these actions in one step
- step forward and eat food if it is in the next
cell - turn left
- turn right
- nothing
7Finite state machine method of ant description
- Automaton with transitions action (Mealy).
Automaton with transitions action (Moore).
System (couple) of automata which interact by
nesting - It is easy to create automata with many states
- There is Mealy automaton with 5 states which
allow to eat 81 units of food
8Genetic Algorithms 1
- Jefferson D., Collins R., Cooper C., Dyer M.,
Flowers M., Korf R., Taylor C., Wang A. The
Genesys System. 1992. - Coding automata to bit string
- Automaton with 13 states which solves this problem
9Genetic Algorithms 2
- Angeline P. J., Pollack J. Evolutionary Module
Acquisition // Proceedings of the Second Annual
Conference on Evolutionary Programming. 1993. - Coding automata to bit string freezing
- Automaton with 11 states which solves this
problem in 193 steps
10Genetic Algorithms 3
- Chambers L. D. Practical Handbook of Genetic
Algorithms, Volume 3, Chapter 26, 6 Algorithms
to Improve the Convergence of a Genetic Algorithm
with a Finite State Machine Genome. CRC Press,
1999. - Coding automata to bit string canonical
representation - Automaton with 8 states which solves this problem
11Genetic Algorithms 4
- Tsarev F., Shalyto A. About construction of
automata with minimal number of states for
Artificial ant problem /Proceedings of X
international conference of soft compitation and
measurement. SPbETU LETI. Vol.2, 2007, pp.
8891. (in Russian) - Genetic programming
12Mealy automaton with 7 states
- Two automata with 7 seven were created after
exploring over 160 and 230 millions of automata
13Problem
- Only Mealy automata are discussed in all papers
- Goal of this work creating Moore automata and
systems of interacting Mealy automata
14Approach proposed 1
- Island genetic algorithm
- Automaton start state description of states
internal automaton - State two transitions action in state (only
for Moore automata) - Transitions number of state to which this
transition leads action (only for Mealy
automaton)
15Approach proposed 2
- class Automaton
- Transition transitions
- int initialState
- Automaton nestedAutomaton
- char stateAction // for Moore automata
-
16Initial generation creation
- A predefined number of automata (systems of
automata) is randomly generated - All automata consists of the same number of states
17Next generation creation 1
- Elitism
- Fixed part of individuals move to next generation
- For other individuals tournament strategy.
Choose two pairs of individual, mutation or
crossover with some probability is applied to
best individuals of each pair
18Next generation creation 2
- Evolution on island is independent from other
islands - After fixed number of generation islands exchange
fixed part of elite individuals
19Moore automaton mutation
- Change start state
- Change one of state actions
- Change the state to which one of the transitions
leads - Change transition condition
20Mealy automata system mutation
- Change start state
- Delete (insert) transition (only for external
automaton) - Change the state to which one of transitions
leads - Change transition action
- Internal automaton mutation
21Moore automata crossover
- Input two individuals
- Output two individuals
- Parents P1 and P2
- Child S1 and S2
- Start state S1.is P1.is and S2.is P2.is, or
S1.is P2.is and S2.is P1.is
22Transitions crossover
- State i
- There is food in front of ant ? P1(i, 0)
- There is no food in front of ant ? P1(i, 1)
- Similarly P2(i, 0), P2(i, 1), S1(i, 0), S1(i,1),
S2(i, 0), S2(i, 1) - There are 4 variants for S1(i, 0), S1(i,1), S2(i,
0), S2(i, 1)
23Four variants
24Systems of Mealy automata crossover
- External automata the same way as for Moore
automata - Internal automaton crossover is done with some
probability
25Fitness function for Moore automata
-
- F number of units of food which ant eats in 200
steps - T number of step when ant eats last unit of food
26Fitness function for systems of Moore automata
-
- F number of units of food which ant eats in 200
steps - T number of step when ant eats last unit of
food - Z number of visited states in external
automaton - C coefficient
27Generation mutation
- After fixed number of generations there is big
mutation - Big mutation all individuals either change to
mutants or change to randomly generated
individuals
28Adjustable parameters of genetic algorithm 1
- Number of islands
- Population size on an island
- Time between big mutations
- Part of islands which is destroyed in big
mutation - Part of individuals which moves to next
generation - Time to exchange of individual between islands
29Adjustable parameters of genetic algorithm 2
- Number of exchangeable individuals
- Parameters of small mutation
- Parameters of crossover
- Ratio of mutants, randomly generated
individuals and children - ? external automaton influence coefficient
30Moore automaton
- This automaton allows ant to eat all food in 198
steps
31System of pair nested automata
- This automata system allows ant to eat 87 units
of food in 198 steps
32Thank you!