Presentation is loading. Please wait.

Presentation is loading. Please wait.

An application of the genetic programming technique to strategy development Presented By PREMKUMAR.B M.Tech(CSE) PONDICHERRY UNIVERSITY.

Similar presentations


Presentation on theme: "An application of the genetic programming technique to strategy development Presented By PREMKUMAR.B M.Tech(CSE) PONDICHERRY UNIVERSITY."— Presentation transcript:

1 An application of the genetic programming technique to strategy development Presented By PREMKUMAR.B M.Tech(CSE) PONDICHERRY UNIVERSITY.

2 Keywords: Strategy development Genetic programming (GP) Co-evolution process

3 A b s t r a c t Introduction GP for strategy development Strategies Instructions and parameter settings Conditional instructions Action instructions Fitness Parameters Results and analysis Conclusions

4 A b s t r a c t: In this paper, we will apply co-evolution and genetic programming (GP) techniques to develop two strategies: the ghost’s and players’ strategies in the Traffic Light Game. (a popular game among children). These two strategies compete against each other. The development of these strategies has achieved phenomenal success. The results encourage us to develop more complex strategies such as human learning models, cooperative robotic models.

5 Introduction In the past decades, human beings tried to develop computer intelligence such that the computer would possess powerful abilities in both computation and inference. However, it is very difficult for a computer to automatically generate effective strategies. GP is one kind of artificial intelligence technique which applies a genetic algorithm to programming. initially, a set of computer programs are randomly generated. These then breed and give birth to a growing population using the Darwinian principle of fitness.

6 This new population of programs is generated by evolutionary operations (replication, crossover, and mutation). Two program trees (parents) would generate two offspring after using the crossover operation, and some offspring with higher fitness would survive (meaning they would be selected into the next generation). Based on Darwinian Theory. the offspring will satisfy the predefined conditions. This technique is also suitable for developing strategies. Fig. 1 shows a simple example of applying the crossover operation to two strategy trees and of the generated offspring the two which have the highest fitness survive (selected) into the next generation. Traditionally, we solve a problem by using a top-down methodology.

7

8 A problem is often decomposed into sub-problems which are then solved and the solutions of which are then assembled to form the solution to the overall problem. The top-down approach is similar to the divide-and-conquer technique. some problems may exist in this approach for strategy development. first, the top-down approach for strategy development by human beings is subjective. Different views of the same problem held by different people generate different results. What then is the optimal strategy? There is no reliable answer. Second, humanly developed strategies often have ‘‘blind spots” in them. Some of actions in strategies designed by human beings may be useless and would become ‘‘dummy” actions in the developed strategy.

9 Another Approach: strategies developed by genetic programming techniques, is a bottom-up methodology. The defined functions and actions are combined automatically and dynamically to form a strategy for solving a particular problem. Based on the evolution principle, some good (optimal or near optimal) strategies with the highest fitness value. However, the bottom-up approach for developing stratagies may also involve some problems. first, the process of evolution from a set of functions and actions into a good strategy. Second, the generated results may not suit the real problem if the fitness function had not been defined well. To overcome these two problems, we apply some techniques during the evolutionary process.

10 The first problem can be improved by restricting the height of the strategy tree during the evolutionary process. To solve the second problem, we check the equivalence between the fitness function and the optimal solution of the problem. If the highest value of the fitness function is equal to the optimal solution and the higher fitness value is the better solution to the problem, then the fitness function properly represents the solution to the problem. We will apply the GP technique and co-evolution processes to evolve two sets of strategies, those of the ghost and players in the Traffic Light Game. The Traffic Light Game is popular among children. In this game, each gamer takes on the role of either the ghost (attacker) or a player (survivor).

11 The ghost chases players in this area, and the players must run away from the ghost and rescue their partners who are stuck in a ‘‘red light” state. When the ghost touches a player who is in a ‘‘green light” state, the game ends. So it is that the players want to cooperate with their partners in order to survive longer. The rules of the Traffic Light Game are as follows: 1. At the beginning of the game, one player is selected to be the ghost and the others are the players. 2. Initially, the players are all in the ‘‘green light” state and can move freely in the predefined area. A player can call ‘‘red light” at any time to enter a safe state where the ghost cannot hurt them. when a player calls ‘‘red light”, that player must stop moving and locked.

12 3. The ‘‘green light” players can move to rescue the ‘‘red light” ones by touching them at which point the state of the ‘‘red light” players returns to ‘‘green light”. 4. The game ends either when the ghost touches a player who has not called ‘‘red light” in time or when all of the players have become stuck in a ‘‘red light” state with no one to rescue them. In the latter case. In this GP based research applied to the Traffic Light Game, strategies of the ghost and players co-evolve. the end of the co-evolution processes, very good strategies have evolved among the ghost and players.

13 GP for strategy development: Strategies: In the Traffic Light Game research, we expected that the ghost and players would be able to develop some good strategies through evolution. The ghost needs to evolve a strategy for detouring around these obstacles to chase the nearest ‘‘green light” player until all players call ‘‘red light” or a ‘‘green light” player is touched by the ghost (see Fig. 2).

14

15 In this research, the game space is 21 * 21 pixels on the screen and the players cannot cross the boundaries of the simulated world. At the initiation of the game, there are nine 4 * 2 pixel fixed-obstacles, one ghost, and twelve players all in randomly set positions (see Fig. 2). The moving speed of the ghost is set to twice that of the players so that touching the players is possible. The game comes to an end when it has run for 1500 time units, or until all ‘‘green light” players have called ‘‘red light”, or a ‘‘green light” player has been captured (touched) by the ghost. Instructions and parameter settings: In strategy development, there are two kinds of instructions used: 1) conditional instructions (functions) 2) action instructions (actions)

16 The conditional instructions are binary decisions. When the condition is true, the left sub-tree is executed; otherwise, the right sub-tree is performed. Conditional instructions: Conditional instructions of Ghost and Players: Ghost: 1.If_greener_is_beside_me: If a player with green light state is next to the ghost, then execute the left sub-tree; else, execute the right sub-tree. 2. If_move_to_goal: If the direction of movement is to the goal (a player), then execute the left sub-tree; else, execute the right sub- tree. 3. If_my_goal_is_nopass: If there is an obstacle between the ghost and the goal, then execute the left sub-tree; else, execute the right sub-tree.

17 4. If_move_forward_ok: If the next move is available (no obstacle), then execute the left sub-tree; else, execute the right sub-tree. Conditional instructions of Players: 1.If_ghost_is_beside_me: If the ghost is next to the player, then execute the left sub-tree; else execute the right subtle. 2.If_dangerous: If the distance between the ghost and the player is less than six steps, then execute the left sub-tree; else, execute the right sub-tree. 3.If_move_to_ghost: If the direction of movement is toward to the ghost, then execute the left sub-tree; else, execute the right sub-tree. 4.If_move_to_goal: If the direction of movement is to the goal (a red light player), then execute the left sub-tree; else, execute the right sub-tree.

18 5.If_someone_locked: If there is any player in a ‘‘red light” state, then execute the left sub-tree; else, execute the right sub-tree. 6.If_redder_is_beside_me: If a player in a ‘‘red light” state is next to the player, then execute the left sub-tree; else, execute the right sub-tree. 7.If_my_goal_is_nopass: If there is an obstacle between the player and the goal (a red light player), then execute the left sub-tree; else, execute the right sub-tree. 8.If_move_forward_ok: If the next move is available (no obstacle), then execute the left sub-tree; else, execute the right sub-tree.

19 Action instructions of Ghost: 1)Move_forward: Move forward one step. 2) Turn_direction: Change direction 90 degrees clockwise. 3)Capture: The ghost captures someone located next to him. Action instructions of player: 1) Call_red: The player calls ‘‘red light.” 2) Save_redder: The player touches someone located next to him. 3) Move_forward: Move forward one step. 4) Turn_direction: Change direction 90 clockwise.

20 Fitness: Fitness of ghost: Fitness_ghost(x,y) = 1500 – time. x: the strategies of the ghost; y: the strategies of the players The higher the value of fitness_ghost (x,y), the higher the fitness of x. The higher the value of fitness_player (x,y), the higher the fitness of y. Time: the execution steps of the game (0< time <1500) Fitness of player: Fitness_player(x,y) = time

21 Parameters: The size of the program population M = 100 The generations of co-evolution G = 2000. The interval between co-evolutions of generations = 100. By using elite selection and roulette wheel selection, the percentages of GP operations are as follows: crossover: 80%, replication: 10%, and mutation: 10%. Results and analysis: The strategy development of the GP is implemented by the C++ programming language. See the following figure, in this ghost can only find better stratagies.

22

23 The ghost will check to see whether some ‘‘green light” players are near to him. If yes, he captures (touches) one of the players and the game ends. If not, he checks for any obstacle- free path that exists. If yes, he moves forward; else, he changes direction. The strategy trees of the players can be devided into three parts. 1. In danger( escaping) 2. rescue (cooperating) 3. skill (detouring) the follwing trees are strategy trees of players.

24

25 Fig. shows the change in the fitness curves of both the ghost and the players. The co-evolution interval is set to 100 generations. After each set of 100 generations, the best strategies of the ghost were used to evolve the strategies of the players, and the best strategies of the players were used to evolve the strategies of the ghost. Finally, after 800 generations, the curve stabilizes showing that the best strategies for both the ghost and the players have evolved.

26

27 Fig. 6. An unexpected yet effective strategy developed by GP for the ghost.

28 In the figure, the capture function disappeard. The ghost evolve special stratagy( ghost didn’t used to caputre players ). He was only required to chass players. Fig. 7. The strategy evolved by the ghost only.

29

30 In order to verify the performance of the co-evolution strategy. Experi-mental results showed that the strategy of the ghost developed by co-evolution is much better than the strategy evolved by the ghost alone (see Fig. 7). Conclusions: In this research, we apply the GP technique to co-evolve the strategies of the ghost (attacker) and players (survivors) in the Traffic Light Game. Based on the Darwinian Theory, the offspring will satisfy the predefined conditions to a greater and greater extent during strategy development. Based on the bottom-up approach, the defined functions and actions combine automatically, dynamically, and objectively to form a good (optimal) strategy for solving a particular problem

31 Thank you


Download ppt "An application of the genetic programming technique to strategy development Presented By PREMKUMAR.B M.Tech(CSE) PONDICHERRY UNIVERSITY."

Similar presentations


Ads by Google