|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectmuehle.player.Player
muehle.player.ComputerPlayer
public class ComputerPlayer
Diese Klasse implementiert den Computerspieler, der, wenn er zum Zug aufgefordert wird, eine KI aufruft und den durch die KI berechneten Zug ausführt.
| Field Summary | |
|---|---|
protected muehle.thinking.EvaluatedAction |
bestAction
Position an der geschmissen wurde, im Falle einer geschlossen Mühle |
protected int |
depthToThink
|
protected muehle.thinking.Heuristic |
heuristic
|
protected muehle.thinking.QuiescentSearch |
qs
|
protected int |
timeToThink
|
protected boolean |
useTimeToBreak
|
protected boolean |
verbose
|
| Fields inherited from class muehle.player.Player |
|---|
actions, clip, gestoppt, initStones, name, numberOfStones, opponent, play, s, stopSleeping, time |
| Constructor Summary | |
|---|---|
ComputerPlayer(java.lang.String name,
Stone s)
erstellt einen Computerspieler mit angegebenem Namen und Stein und der Spielstärke 200 |
|
ComputerPlayer(java.lang.String name,
Stone s,
muehle.thinking.Heuristic heuristic)
|
|
ComputerPlayer(java.lang.String name,
Stone s,
muehle.thinking.Heuristic h,
muehle.thinking.Heuristic evalHeuristic)
|
|
ComputerPlayer(java.lang.String name,
Stone s,
java.lang.String filenameOfHeuristic)
|
|
ComputerPlayer(java.lang.String name,
Stone s,
java.lang.String filenameOfHeuristic,
java.lang.String filenameOfEvalHeuristik)
|
|
| Method Summary | |
|---|---|
boolean |
acceptDraw(Playground p)
|
muehle.thinking.EvaluatedAction |
calculateBestAction(Playground p)
|
Action |
deleteStone(Playground p)
veranlasst den Computerplayer zum Schmeissen eines Gegnersteines. |
Player |
getClone()
clont den Computerspieler, indem ein neuer Spieler gleichen Namens und gleichen Steins mit gleicher Anzahl an gesetzen und übrigen Steinen generiert wird. |
int |
getDepthToThink()
|
double |
getEvaluatedValueOfPlayground()
|
muehle.thinking.Heuristic |
getHeuristic()
|
double |
getLambda()
|
muehle.thinking.QuiescentSearch |
getQs()
|
double |
getRandomRadius()
|
int |
getTimeToThink()
gibt die Spielstärke zurück |
boolean |
isEndgame()
|
boolean |
isUseTimeToBreak()
|
boolean |
isVerbose()
|
Action |
makeMove(Playground p)
erzeugt das KI-Objekt Minmax und führt diese KI zur Berechnung des besten Zuges iterativ aus. |
void |
setDepthToThink(int depthToThink)
|
void |
setHeuristic(muehle.thinking.Heuristic h)
|
void |
setLambda(double lambda)
|
void |
setQs(muehle.thinking.QuiescentSearch qs2)
|
void |
setRandomRadius(double randomRadius)
|
void |
setTimeToThink(int power)
setzt die Spielstärke |
void |
setUseTimeToBreak(boolean useTimeToBreak)
|
void |
setVerbose(boolean verbose)
|
java.lang.String |
toString()
Stringdarstellung des Spielers im Format: Name: xxx, InitStones: xxx, Stones: xxx, CanSet, CanJump |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected muehle.thinking.EvaluatedAction bestAction
protected muehle.thinking.Heuristic heuristic
protected boolean verbose
protected boolean useTimeToBreak
protected int timeToThink
protected int depthToThink
protected muehle.thinking.QuiescentSearch qs
| Constructor Detail |
|---|
public ComputerPlayer(java.lang.String name,
Stone s)
name - Spielernames - Stein
public ComputerPlayer(java.lang.String name,
Stone s,
muehle.thinking.Heuristic heuristic)
public ComputerPlayer(java.lang.String name,
Stone s,
java.lang.String filenameOfHeuristic)
public ComputerPlayer(java.lang.String name,
Stone s,
java.lang.String filenameOfHeuristic,
java.lang.String filenameOfEvalHeuristik)
public ComputerPlayer(java.lang.String name,
Stone s,
muehle.thinking.Heuristic h,
muehle.thinking.Heuristic evalHeuristic)
| Method Detail |
|---|
public Action makeMove(Playground p)
drop gespeichert.
makeMove in class Playerp - Playground auf dem der Zug ausgeführt werden soll
public muehle.thinking.EvaluatedAction calculateBestAction(Playground p)
public Action deleteStone(Playground p)
makeMove in drop gespeichert.
deleteStone in class Playerp - Playground, von dem gelöscht wird
public void setTimeToThink(int power)
setTimeToThink in class Playerpower - Spielstärkepublic int getTimeToThink()
getTimeToThink in class Playerpublic int getDepthToThink()
getDepthToThink in class Playerpublic void setDepthToThink(int depthToThink)
setDepthToThink in class PlayerdepthToThink - The depthToThink to set.public boolean isUseTimeToBreak()
isUseTimeToBreak in class Playerpublic void setUseTimeToBreak(boolean useTimeToBreak)
setUseTimeToBreak in class PlayeruseTimeToBreak - The useTimeToBreak to set.public Player getClone()
getClone in class Playerpublic void setQs(muehle.thinking.QuiescentSearch qs2)
public boolean acceptDraw(Playground p)
acceptDraw in class Playerpublic boolean isEndgame()
public boolean isVerbose()
public void setVerbose(boolean verbose)
setVerbose in class Playerverbose - The verbose to set.public muehle.thinking.Heuristic getHeuristic()
public void setHeuristic(muehle.thinking.Heuristic h)
h - The h to set.public double getEvaluatedValueOfPlayground()
public double getRandomRadius()
public void setRandomRadius(double randomRadius)
randomRadius - The randomRadius to set.public double getLambda()
public void setLambda(double lambda)
lambda - The lambda to set.public java.lang.String toString()
Player
toString in class Playerpublic muehle.thinking.QuiescentSearch getQs()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||