Presentation is loading. Please wait.

Presentation is loading. Please wait.

More Metagaming General Game Playing Lecture 7

Similar presentations


Presentation on theme: "More Metagaming General Game Playing Lecture 7"— Presentation transcript:

1 More Metagaming General Game Playing Lecture 7
Michael Genesereth / David Haley Spring 2007

2 Overview Metagaming is the process of analyzing and/or modifying a game during the startclock so as to improve performance once the game begins. Examples of Metagaming Techniques: Headstart on Game-Graph Search Game Optimization Explicit Propositional / Relational Nets Compilation Factoring Dead State Removal And so forth

3 Factoring

4 Hodgepodge Hodgepodge = Chess + Othello Analysis of joint game:
Branching factor: a Branching factor: b Analysis of joint game: Branching factor as given to players: a*b Fringe of tree at depth n as given: (a*b)n Fringe of tree at depth n factored: an+bn

5 Double Tic-Tac-Toe X X O O Double Tic Tac Toe = TTT + TTT
Analysis of joint game: Branching factor: 81, 64, 49, 36, 25, 16, 9, 4, 1 Branching factor: 9, 8, 7, 6, 5, 4, 3, 2, 1 ( 2) X O X O

6 Buttons and Lights Pressing button a toggles p.
Pressing button b interchanges p and q. p q a b Propositions represent conditions that are true or false in each state of the world. Connectives express logical relationships among truth values - negation, comjunction, disjunction, and so forth. Transitions express truth in one state as a function of truth in the preceding state.

7 Double Buttons and Lights
Pressing button a toggles p. Pressing button b interchanges p and q. Pressing button c toggles s. Pressing button d interchanges s and t. p q a b c d s t Propositions represent conditions that are true or false in each state of the world. Connectives express logical relationships among truth values - negation, comjunction, disjunction, and so forth. Transitions express truth in one state as a function of truth in the preceding state.

8 Game Factoring and Its Use
Compute factors: Behavioral factoring Goal Factoring Relative Inertia Play factors Reassemble solution: Append plans Interleave plans Parallelize plans with simultaneous actions

9 Behavioral Factoring A set F of propositions and actions in a propositional net P is a behavioral factor of P if and only if there are no connections between the propositions and actions in F and those in P-F. Factors of propositional nets can be computed in polynomial time (in terms of the size of the nets). Basic Idea: For each input, compute all affected propositions (any number of steps). Combine sets into common factor if they intersect.

10 Goal Factoring Simple Case - goal is a conjunction
Partition conjuncts over behavioral factors Create new goals for each factor Complex Case - goal a disjunction of conjunctions Split each conjunct as above Check for lossless joins, i.e. when recombined, we get the same results Good: Bad: p1 & q1 | p1 & q2 p1 & q1 | p2 & q2

11 Relative Inertia Show that the propositions in a factor do not change unless one of the actions in the factor is executed. Easily proven from inertial rules: next(p) :- true(p) & -does(robot,a) & -does(robot,b) Note that we must be able to prove this for every proposition in the factor. Note that only actions in the factor can be mentioned.

12 Performance ? (time (genplan propcompbuttons)) 407 states
1,118 milliseconds. 605,728 bytes of memory allocated. (PROG A B A D E D) ? (time (multiplan propcompbuttons)) 14 states 53 milliseconds 22,320 bytes of memory allocated. Partition time: 1 millisecond.

13 Original Version p' :- a & -p p' :- b & q q' :- a & q q' :- b & p
s' :- a & -s s' :- b & -s t' :- a & t t' :- b & t p' :- c & -p p' :- d & q q' :- c & q q' :- d & p s' :- c & t s' :- d & t t' :- c & s t' :- d & s

14 Action Grouping Actions grouped according to behavior.
p' :- {a,c} & -p p' :- {b,d} & q q' :- {a,c} & q q' :- {b,d} & p s' :- {a,b} & -s s' :- {c,d} & -s t' :- {a,b} & t t' :- {c,d} & t Note the partition on propositions.

15 Import and Export Import: Export: e :- a a :- e & g e :- b b :- e & h
f :- c c :- f & g f :- d d :- f & h g :- a g :- c h :- b h :- d

16 Factored Version p' :- e & -p q' :- e & q p' :- f & q q' :- f & p
s' :- g & -s t' :- g & t s' :- h & t t' :- h & s

17 Dead State Removal

18 Latches A latch is a proposition that persists indefinitely, i.e. once it becomes true, it stays true forever. next(p) :- true(p)

19 Inhibition A proposition p inhibits a proposition q if and only if p must be false in every plan to achieve or retain q. next(q) :- does(robot,a) & -true(p) true(q) & goal :- true(r)

20 Dead State Removal If a latch p inhibits the goal in a game, then it is a good idea to avoid states in which p is true.

21 Untwisty Corridor Roles: Robot Actions: a, b, c, d
Bases: p, q1, …, q8, 1, …, 9 Goal: q8 Actions a, b, c set p. Once true p remains true. Action d successively sets q1, …, q8 iff p is false. Plan: d, d, d, d, d, d, d, d Game tree size: 349,525

22 Performance ? (time (genplan untwistycorridor)) 349,521 states
1,133,293 milliseconds. 597,682,424 bytes of memory allocated. (PROG D D D D D D D D) ? (time (strplan untwistycorridor)) 9 states 183 milliseconds 54,568 bytes of memory allocated.

23 And So Forth

24 Overview Game Reformulation is transformation of a game into one or more different games that can be played more efficiently yet yield the same result. Sample Methods: Sequential Independence - Bottleneck - Maze Parallel Independence - Hodgepodge Single player abstraction End game book to enlarge goal set - Checkers Symmetry - Tic-Tac-Toe Hierarchical Abstraction

25 Metagaming Ideal Trade-off - cost of finding structure vs savings
Find cases where cost varies with size of description (e.g. proposition set) rather than with size of expanded game graph Techniques: Graph Analysis Automated Reasoning

26


Download ppt "More Metagaming General Game Playing Lecture 7"

Similar presentations


Ads by Google