Presentasi sedang didownload. Silahkan tunggu

Presentasi sedang didownload. Silahkan tunggu

Fuzzy Logic & Markov Systems Session 09

Presentasi serupa


Presentasi berjudul: "Fuzzy Logic & Markov Systems Session 09"— Transcript presentasi:

1 Fuzzy Logic & Markov Systems Session 09
Course : COMP6228 – Artificial Intelligence Effective Period : February 2017 Fuzzy Logic & Markov Systems Session 09

2 After completing this session, students are expected to be able to:
Learning Objective After completing this session, students are expected to be able to: LO 2 : Explain concepts of AI Techniques in Games

3 Content Introduction to Fuzzy logic Fuzzy Logic Decision Making
Fuzzy State Machines Markov Processes Markov State Machine

4 Fuzzy Logic Decision Making
Fuzzy logic studies reasoning systems in which the notions of truth and falsehood are considered in a graded fashion, in contrast with classical mathematics where only absolutly true statements are considered. fuzzy logic is used for decision making and control systems Bob's Health Prof. Lotfi Zadeh

5 Fuzzy Logic Controller Flow

6 Fuzzy Sets Theory Classical Set vs Fuzzy set Membership value
1 1 175 Height(cm) 175 Height(cm) Universe of discourse

7 example Bina Nusantara University

8 example Bina Nusantara University

9 Fuzzy components Bina Nusantara University 9 Bina Nusantara University

10 fuzification Fuzzyfikasi: proses memetakan nilai crisp (numerik) ke dalam himpunan fuzzy dan menentukan derajat keanggotaannya di dalam himpunan fuzzy. Bina Nusantara University

11 Operations on Fuzzy Relation
Bina Nusantara University

12 Membership functions Bina Nusantara University

13 Bina Nusantara University

14 Bina Nusantara University

15 example Bina Nusantara University

16 answer Bina Nusantara University

17 Bina Nusantara University

18 Example Suatu perusahaan minuman akan memproduksi minuman jenis ABC. Dari data 1 bulan terakhir, permintaan terbesar hingga mencapai 6000 botol/hari, dan permintaan terkecil sampai 500 botol/hari. Persediaan barang digudang terbanyak sampai 800 botol/hari, dan terkecil pernah sampai 200 botol/hari. Sampai saat ini, perusahaan baru mampu memproduksi barang maksimum 9000 botol/hari, demi efisiensi mesin dan SDM tiap hari diharapkan perusahaan memproduksi paling tidak 3000 botol. Bina Nusantara University

19 [R1] IF Permintaan TURUN And Persediaan BANYAK
Apabila proses produksi perusahaan tersebut menggunakan 4 aturan fuzzy sbb: [R1] IF Permintaan TURUN And Persediaan BANYAK THEN Produksi Barang BERKURANG; {R2] IF Permintaan TURUN And Persediaan SEDIKIT [R3] IF Permintaan NAIK And Persediaan BANYAK THEN Produksi Barang BERTAMBAH; [R4] IF Permintaan NAIK And Persediaan SEDIKIT Berapa botol minuman jenis XYZ yang harus diproduksi, jika jumlah permintaan sebanyak 4500 botol, dan persediaan di gudang masih 400 botol? Bina Nusantara University

20 Ada 3 variabel fuzzy yang akan dimodelkan, yaitu:
Permintaan; terdiri-atas 2 himpunan fuzzy, yaitu: NAIK dan TURUN Cari nilai keanggotaan: PmtTURUN[4500] = ( )/5500 = 0,27 PmtNAIK[4500] = ( )/5500 = 0,72 Fungsi keanggotaan variabel Permintaan Bina Nusantara University

21 Persediaan; terdiri-atas 2 himpunan fuzzy, yaitu: SEDIKIT dan BANYAK
PsdSEDIKIT[400] = ( )/600 = 0,667 PsdBANYAK[400] = ( )/600 = 0,33 Fungsi keanggotaan variabel Persediaan Bina Nusantara University

22 Produksi barang; terdiri-atas 2 himpunan fuzzy, yaitu: BERKURANG dan BERTAMBAH
Fungsi keanggotaan variabel Produksi Barang Bina Nusantara University

23 Sekarang kita cari nilai z untuk setiap aturan pada aplikasi fungsi implikasinya:
[R1] IF Permintaan TURUN And Persediaan BANYAK THEN Produksi Barang BERKURANG; -predikat1 = PmtTURUN  PsdBANYAK = min(PmtTURUN [4500],PsdBANYAK[700]) = min(0,27; 0,83) = 0,27 Lihat himpunan Produksi Barang BERKURANG, (9000-z)/6000 = 0,27 ---> z1 = 7380

24 {R2] IF Permintaan TURUN And Persediaan SEDIKIT THEN Produksi Barang BERKURANG; -predikat2 = PmtTURUN  PsdSEDIKIT = min(PmtTURUN [4500],PsdSEDIKIT[700]) = min(0,667; 0,337) = 0,333 Lihat himpunan Produksi Barang BERKURANG, (9000-z)/6000 = 0, > z2 = 7002 Bina Nusantara University

25 [R3] IF Permintaan NAIK And Persediaan BANYAK THEN Produksi Barang BERTAMBAH; -predikat3 = PmtNAIK  PsdBANYAK = min(PmtNAIK [4500],PsdBANYAK[400]) = min(0,72; 0,33) = 0,4 Lihat himpunan Produksi Barang BERTAMBAH, (z-3000)/6000 = 0, > z3 = 4996 Bina Nusantara University

26 [R4] IF Permintaan NAIK And Persediaan SEDIKIT
THEN Produksi Barang BERTAMBAH; -predikat4 = PmtNAIK  PsdBANYAK = min(PmtNAIK [4500],PsdSEDIKIT[400]) = min(0,72; 0,667) = 0,667 Lihat himpunan Produksi Barang BERTAMBAH, (z-3000)/6000 = 0, > z4 = 7002 Bina Nusantara University

27 calculate z Dari sini kita dapat mencari berapakah nilai z, yaitu:
Jadi jumlah minuman jenis XYZ yang harus diproduksi sebanyak 6652 botol. Bina Nusantara University

28 Bob's Healt at 65%

29 Fuzzy Logic Decision Making
Exclusive mapping to states for fuzzy decision making (look further about the process at page from your textbook)

30 Exercise Please run demo code of Fuzzy logic systems from the book:
Unity AI game programming, chapter 7

31 Fuzzy State Machines Although developers regularly talk about fuzzy state machines, they don’t always mean the same thing by it. A fuzzy state machine can be any state machine with some element of fuzziness. It can have transitions that use fuzzy logic to trigger, or it might use fuzzy states rather than conventional states. It could even do both.

32 Markov Processes Rantai markov (markov chain) adalah suatu metode yang mempelajari sifat-sifat suatu variabel pada masa sekarang yang didasarkan pada sifat-sifatnya di masa lalu dalam usaha menaksir sifat-sifat variabel tersebut di masa yang akan datang.

33 Markov Processes Conservative Markov Process
A conservative Markov process ensures that the sum of the values in the state vector does not change over time. This is essential for applications where the sum of the state vector should always be fixed (where it represents a distribution, for example, or if the values represent the number of some object in the game). The process will be conservative if all the rows in the transition matrix sum to 1.

34 Markov Processes Iterated Processes
It is normally assumed that the same transition matrix applies over and over again to the state vector. There are techniques to calculate what the final, stable values in the state vector will be (it is an eigenvector of the matrix, as long as such a vector exists). This iterative process forms a Markov chain. In game applications, however, it is common for there to be any number of different transition matrices. Different transition matrices represent different events in the game, and they update the state vector accordingly.

35 Markov Processes Returning to our sniper example, let’s say that we have a state vector representing the safety of four sniping positions: which sums to 4.0. Taking a shot from the first position will alert the enemy to its existence. The safety of that position will diminish. But, while the enemy is focusing on the direction of the attack, the other positions will be correspondingly safer. We could use the transition matrix:

36 Markov Processes to represent this case. Applying this to the state vector, we get the new safety values: which sums to 3.4. So the total safety has gone down (from 4.0 to 3.4). The safety of sniping point 1 has been decimated (from 1.0 to 0.1), but the safety of the other three points has marginally increased. There would be similar matrices for shooting from each of the other sniping points.

37 Markov Processes Notice that if each matrix had the same kind of form, the overall safety would keep decreasing. After a while, nowhere would be safe. This might be realistic (after being sniped at for a while, the enemy is likely to make sure that nowhere is safe), but in a game we might want the safety values to increase if no shots are fired. A matrix such as: would achieve this, if it is applied once for every minute that passes without gunfire.

38 Markov State Machines Using Markov processes, we can create a decision making tool that uses numeric values for its states. The state machine will need to respond to conditions or events in the game by executing a transition on the state vector. If no conditions or events occur for a while, then a default transition can occur.

39 References Ian Millington Artificial intelligence for games. Morgan Kaufmann Publishers. Burlington. ISBN: Stuart Russell. (2010). Artificial intelligence : a modern approach. 03. Pearson Education. New Jersey. ISBN:


Download ppt "Fuzzy Logic & Markov Systems Session 09"

Presentasi serupa


Iklan oleh Google