E D R , A S I H C RSS

ALittle Ai Seminar

TableOfContent

 œ

„‹จ Othello AI งŒ“ค–ดณดธฐ

ˆœ„œ

  • „‹จ Othello ฃฐ— Œ€ํ•œ „ช…
  • 1ฐจ ตฌํ˜„
  • approach : state machine
  • approach : minimax

ํŒ€ ตฌ„

2-3ช… ‹ 1ํŒ€œกœ. ํŒ€ ‚ด—Š”
  • ํŒŒดฌ ํ”„กœทธž˜ฐ €Šฅํ•œ ‚ฌžŒ 1ช… ดƒ
  • ˜คธกœ ฒŒž„„ •„Š” ‚ฌžŒด 1ช… ดƒ

ํ˜€, ตฌํ˜„ žฒด€ „‹จํ•˜€กœ „‹จํžˆ ฌธฒ•„ „›€ฐ›•„„œ ํ”„กœทธž˜ฐ „ํ–‰ํ•ด„ ข‹Œ

ดšฉ ํˆด“ค(„˜ํ•  ฒƒ)

š” ํดž˜Šค

class Board
getPutableList(self,aStone)
ํ•ด‹ Œ ƒ‰— Œ€ํ•œ †“„ ˆ˜ žˆŠ” œ„˜“ค ํ„ฐํ”Œ“ค„ €‹ค
(col,row)“ค ฆฌŠคํŠธ

count(self,aStone)
ํ•ด‹ Œ ƒ‰„ „‹ค

isPutable(self, aCol, aRow, aStone)
ํ•ด‹ Œ ƒ‰ ํ•ด‹ œ„˜— †“„ ˆ˜ žˆŠ”€ —ฌ€ ํ…ŒŠคํŠธ(true/false)

tsGameOver(self)
ฒŒž„ ข…ฃŒ กฐƒํƒœ— „‹ฌํ–ˆŠ”€— Œ€ํ•œ —ฌ€

class Player
name(self)
ํ•ด‹ ํ”Œ ˆด–ด˜ ด„„ ‚˜ํƒ€ƒ„

put(self)
‹ค œ Œ„ †“Œ

isPutable(self,aCol,aRow)
žธฐ ž‹ ด †“„ ˆ˜ žˆŠ” œ„˜ธ€— Œ€ํ•œ —ฌ€ ฒดํฌ

getStoneColor(self)
ž‹ ˜ Œ ƒ‰— Œ€ํ•ด ŠคํŠธง„ ฆฌํ„

getPutableList(self)
ํ•ด‹ ํ”Œ ˆด–ด€ †“„ ˆ˜ žˆŠ” œ„˜“ค— Œ€ํ•œ ฆฌŠคํŠธ –ป–ด˜ด.

1 minute tutorial

ธฐณธ ˆŒ€

~cpp
from Player import Player

class DefaultComputerPlayer(Player):
	def __init__(self,aStone, aBoard):
		Player.__init__(self, aStone, aBoard)
	def name(self):	return "MyName~"
	def execute(self):
	        putableList = self.getPutableList()
                posX,posY = putableList[0]
		return self.put(posX,posY)

Evaluator interface

~cpp
from evaluator import Evaluator
class SimpleEvaluator(Evaluator):
	def __init__(self,aBoardSize=8):
		Evaluator.__init__(self,aBoardSize)

	# ํ•ด‹ ํŒ— Œ€ํ•ด ํ‰€ํ•˜Š” ํ•จˆ˜
	# stone — Œ€ํ•ด„œ ด ํŒด ช‡ งœฆฌ ํŒธ€— Œ€ํ•ด  ˆ˜ งคธด‹ค
	def evaluate(self,board,stone):
                return board.count(stone)

Simple Heuristic Table

50   4 16 12 12 16   4 50
 4 -30 -4 -5 -5 -4 -30  4 
16  -4  1  0  0  1  -4 16
12  -5	0  0  0  0  -5 12
12  -5 	0  0  0  0  -5 12
16  -4	1  0  0  1  -4 16
 4 -30 -4 -5 -5 -4 -30  4
50   4 16 12 12 16   4 50

Œ€ „ ฒฐ

ํŒ€ช… ž‘„ž ฝ”“œ
Namsang ƒ„ญ,  •ํ˜„, ณดฐฝ ALittleAiSeminar/Namsang
Smart ธฐ›…, „ ํ˜ธ, ํœ˜™ Upload(zeropage):SmartPlayer.py
NonNamsang ˆ˜ƒ, ํ˜„ํƒœ, ทœํ˜„
Upload:CheepPlayer.zip
Upload:SmartPlayer.py
Valid XHTML 1.0! Valid CSS! powered by MoniWiki
last modified 2021-02-07 05:22:21
Processing time 0.0173 sec