• Tidak ada hasil yang ditemukan

M5 Pengambilan Keputusan dalam manajemen

N/A
N/A
Protected

Academic year: 2018

Membagikan "M5 Pengambilan Keputusan dalam manajemen "

Copied!
43
0
0

Teks penuh

(1)

DECISION MAKING

(2)

PENGERTIAN

 Decision Making adalah serangkaian

algoritma yang dirancang dengan memasukan beberapa kemungkinan langkah yang bisa diambil oleh suatu aplikasi

 Pada game, decision making memberikan

kemampuan suatu karakter untuk menentukan langkah apa yang akan diambil.

 Decision making dilakukan dengan cara

(3)

PENGERTIAN

 Algoritma decision making kerap digunakan dalam aplikasi game

(4)

Decision Tree

 Keunggulan

 Cepat & mudah diimplementasikan, mudah

dimengerti

 Modular, Re-usable

 Dapat dipelajari  Dapat dikonstruksi

(5)

Decision Tree

 Problem Setting

 Memberi seperangkat pengetahuan, kita perlu untuk menghasilkan tindakan yang sesuai dari serangkaian tindakan yang mungkin.

 Some actions are triggered by a large set of inputs

 E.g. For an ant AI to Evade, it requires player to be <

20 units away, player’s health to be > 50% and ant’s health to be < 25%. There are 3 input conditions.

 Beberapa kondisi input mungkin lebih signifikan dari

sejumlah input yang ada.

(6)

Decision Tree

 Problem Setting

 Kita butuh suatu metode untuk

mengelompokkan sejumlah input secara bersamaan pada setiap action

 Kita harus mengizinkan input-input yang

(7)

Decision Tree

 Decision Tree (DT) dibuat dari kumpulan

decision point yang terhubung.

 Tree dimulai dari decision (root)

 Setiap decision (dimulai dari root), satu dari sekumpulan pilihan yang ada dipilih

 Pilihan dibuat berdasarkan kondisi yang dihasilkan dari character’s knowledge/values

 Lanjutkan tree sampai tidak ada lagi decision yang diambil

(8)

Decision Tree

 Contoh decision tree dari karakter soldier

Root

Leaf

(9)

Decision Tree

(10)

Decisions

 Decision di tree harus sederhana

 Cek untuk yang bernilai single atau bernilai

boolean (do not normally join inputs with Boolean logic)

 Possible types of decisions and their data types

 Boolean – True/False

 Enumeration – Matches one of the given set of

values

 Numeric value – Value within given range  Vector (2D/3D) – Vector has length within a

(11)

Combinations of Decisions

 Decision tree adalah efisien karena decision yang sederhana – hanya satu kondisi pengujian pada satu waktu

 Ketika pengujian kombinasi boolean (AND/OR) diperlukan, beberapa sturktur

tree dapat digunakan untuk

(12)

Combinations of Decisions

 To AND two decisions

together, place them in series, the 1st

decision needs to be true to consider the 2nd, in order to get to action 1

 To OR two decisions

(13)

Decision Complexity

 In a tree structure, the number of decisions

that need to be

considered is usually smaller than the

number of decisions in the tree

(14)

Branching in DTs

Deep binary DT

 The same value (color) may

be checked up to 3 times

 Slightly better: Order the

checks so that the most likely state comes first

Flat DT with 4 branches  Using 4 branches, the

structure is flatter and

requires only one decision check

(15)

Binary Better?

 It is still more common to find binary DT

implementations

 Underlying nature of codes usually simplifies

down to a series of binary tests (if/else)

 Speed savings not significantly better with

higher order branching

 Binary DTs are easier to optimize

 Many tree optimization/compression

techniques are for binary trees

(16)

Performance

 DTs (binary) usually take no memory and performance is linear with the number of nodes visited

 Ideal case  If each decision takes a constant time and tree is balanced,

(17)

Balancing the Tree

 DTs run the fastest when trees are

balanced

 A balanced tree has about the same

number of leaves on each branch

 Both these trees have 8 behaviors

and 7 decisions, but one is extremely

(18)

Balanced vs. Unbalanced

Tree

 At its worst, performance of a severely unbalanced tree goes from O(log2 n) to

O(n)

(19)

Maximizing Performance?

 Menstrukturkan tree untuk maximum performance adalah hal yang sulit

dilakukan

 DT cukup cepat, sangat penting untuk squeeze out every drop of speed

(20)

Random Decision Tree

 Random Decision Trees adalah algoritma yang membentuk serangkaian langkah-langkah yang akan dimasukan kedalam algoritma decision trees.

 Setiap pilihan langkah yang dimasukkan pada decision trees tidak dapat diprediksi

(21)

Random Decision Tree

 Random Decision Trees pada game “Ninja Heroes" akan bekerja dengan beberapa pilihan  Jika karakter sedang tidak melakukan kegiatan

maka random decision trees akan bekerja berdasarkan nilai random yang telah ditentukan  Apabila karakter sedang berada didalam kelas

(22)

Random Decision Tree

 To introduce random choices in a DT, decision making process needs to be stable

 Rule: If there is no relevant changes in

world state, there should be no change in decision

 Consecutive frames should stay with the

chosen random decision until some world state changes

 Implementation: Allow the random decision

(23)

Random Decision Tree

 In the first decision (if not

under attack), choose

randomly to patrol or stand still

 Subsequently, continue on with

the previously chosen action

 If the parent decision takes the

‘under attack’ choice (a

different branch), get rid of the stored choice

(24)

Random Decision Tree

 If the AI continues to do the

same thing forever (because it is never under attack?), that may look strange too…

 Use a time-out scheme (a

stop timer) to reset the

previous action, and initiate a new random choice

 How about randomizing the

(25)

Combining DT with FSM

 We can replace transitions from a state (to another state) with a DT

(26)

Combining DT with FSM

 Note: If it cannot see the player, the transition

(via the DT) ends, and no new state is reached

 Otherwise, it tests for the player proximity and

(27)

Combining DT with FSM

 This FSM implements the same thing (as prev. slide),

but without the DT nodes

 Now, we have two complex conditions that need to be

evaluated

 If the condition involved a time-consuming test (such

(28)

Rule-based AI

 Generally refer to AI systems that

consist of a set of if-then (or if-else) style rules

 Technically, FSMs and DTs are types of rule-based systems. Rules are used to handle state transitions and decision nodes

 But more specifically, “rule-based

(29)

Rule-based Expert Systems

 Common usages/applications in real life:

 Medical diagnosis, fraud protection, etc.

 Advantage:

 Rule-based systems can mimic the way

people think and reason given a set of known facts and knowledge about a

particular domain

 Fairly easy to program and manage (in a

(30)

Rule-based Systems for

Games

 Rule-based systems are useful in GAMES…

 Because knowledge encoded in rules is

modular

 Rules can be encoded in any order 

flexible for coding and modifying the system at a later time

(31)

Example: Medieval RTS

game

Technology Tree

 An important

element in RTS games

 Shows the links

between units to train, facilities to

(32)

Example: Medieval RTS

game

 Aim: Enable the computer opponent to keep

track of player’s current state of technology

 By collection of knowledge of the player from

the world state (resources, units, facilities)

 “Cheating” and having perfect knowledge will

not give fair and realistic AI behaviors

 How to assess state of technology?

 Sending scouts to collect information and

observe (just like what human players do)

(33)

Rule-based System Basics

 Two main components

 Working memory – Stores known facts and assertions made by the rules

 Rules memory – Contains if-then style rules that operate over the facts stored in working

memory

 As rules as triggered or fired,

 they can trigger some kind of action (such as in FSM and DT), or

(34)

Rule-based System Basics

 Sample working memory

enum TMemoryValue{Yes, No, Maybe, Unknown}; TMemoryValue Peasants;

TMemoryValue Woodcutter; TMemoryValue Stonemason; TMemoryValue Blacksmith; TMemoryValue Barracks; ...

 Contains elements that can take any one of the 4 values

 Idea: Keep track of the current “perception” of the

(35)

Rule-based System Basics

 Computer can gather facts by sending out scouts to

see if a player has built a temple (for e.g.) Temple

element will be set to Yes.

 In another way, we can use a set of if-then style

rules to infer the technology that the player has (before a scout confirms it)

 Example “temple” rule:

if(Woodcutter == Yes && Stonemason == Yes && Temple == Unknown)

(36)

Rule-based System Basics

 Inference can work the other way as well

 If the player has been observed to have a priest, it can

be inferred that the player also must have a temple, therefore, must have a barracks, a woodcutter, and a stonemason

 Example “priest” rule:

if(Priest == Yes) { Temple = Yes;

(37)

Rule-based System Basics

 You can have many more rules for this technology

tree (More examples in textbook)

 The main scheme: To write this set of rules and

execute them continuously during the game (at each iteration of the game loop or in fixed intervals)

 Maintain an up-to-date picture of the player’s

technology capabilities

 This knowledge can be used to decide when to

(38)

Rule-based System Basics

 In reality, developers to not build

rule-based systems using actual hard-coded if-statements

 Some types of inferences are hard to achieve

 Very inflexible as the rules need to be handcrafted one

by one to strike a good balance among them

 Definitely not efficient for future modifications!

 Developers often use scripting languages or shells to create and modify rules without

(39)

Inference in Rule-based

Systems

 Forward Chaining

 Match rules (if-parts) to facts in working

memory

 If a rule matches, it is fired and its

then-part is executed

 Potentially, if more than one rule matches

the given set of facts, conflict resolution phase required to figure out which rule to fire

 Conflict resolution: Many possible ways –

(40)

Inference in Rule-based

Systems

 Forward Chaining

 Example

 If working memory indicates Peasants = Yes and Woodcutter = Unknown, the rule:

if(Peasants == Yes && Woodcutter == Unknown) Woodcutter = Maybe;

, matches. So, this rule can potentially be fired

(41)

Inference in Rule-based

Systems

 Backward Chaining

 Opposite of forward chaining

 Match the then-parts, start with

outcome/goal, and figure out which rules must be fired to arrive at the outcome/goal

 E.g. Outcome is that the player has Calvary units. Work backwards – player must have

(42)

Inference in Rule-based

Systems

 Backward Chaining

 So, all the rules required to reach the

outcome are all fired.

 Work the logic backward up the technology

tree to the goal

 In practice, backward chaining is recursive

(43)

Optimization of RBS

 For small rule sets,

 Forward chaining is fast

 For large-scale rule-based systems, optimization is essential

 Many rules may be matched for firing, so

conflict resolution phase must be optimized 

Rete Algorithm

 Write your own scripting language

Referensi

Dokumen terkait

Populasi Gempol memiliki rendemen biodiesel tertinggi yaitu 88,49% lebih tinggi dari populasi Cileuweung sebesar 86,42% dan populasi Baribis sebesar 63,16%

Konsep rumah tangga pertanian adalah rumah tangga yang salah satu atau lebih anggota rumah tangganya melakukan dan bertanggungjawab dalam kegiatan pembudidayaan,

Hasil analisis regresi berganda menunjukkan bahwa GPM dan OPM berpengaruh positif signifikan untuk memprediksi perubahan laba satu tahun kedepan dengan tingkat signifikansi

Sedangkan pada suhu rendah kerja enzim tidak optimal sehingga proses enzimatik berlangsung lebih lambat, CO2 yang dihasilkan pada proses respirasi lebih rendah

Lempung pada dasarnya memiliki pori alami dan perlakuan pilarisasi menyebabkan pori baru timbul dengan ukuran mikropori 7,8 A [1]. Penelitian tersebut menunjukkan bahwa

Analisis proksimat yang dilakukan terhadap sampel ikan cakalang, beras, dan bubur instan yang meliputi kadar air, abu, protein, dan lemak.. Analisis kadar air

Skripsi yang berjudul: Minat Siswa Terhadap Mata Pelajaran Qur’an Hadist di MIN Bawan Kecamatan Barabai Kabupaten Hulu Sungai Tengah, ditulis oleh Muhammad Iberahim telah

Berdasarkan maksud dan tujuan dari penelitian ini yaitu untuk mengetahui apakah terdapat hubungan antara E-Commerce pada situs belanja online fashion Zalora