/aima-all/release/javadoc/aima-core/aima/core/search/adversarial/Game.html
HTML | 358 lines | 299 code | 39 blank | 20 comment | 0 complexity | c3955f5bf17d6f47f02b8b10e4dc5c65 MD5 | raw file
Possible License(s): GPL-3.0, Apache-2.0
- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
- <!--NewPage-->
- <HTML>
- <HEAD>
- <!-- Generated by javadoc (build 1.6.0_20) on Sun Jan 08 15:29:12 PST 2012 -->
- <TITLE>
- Game
- </TITLE>
-
- <META NAME="date" CONTENT="2012-01-08">
-
- <LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../stylesheet.css" TITLE="Style">
-
- <SCRIPT type="text/javascript">
- function windowTitle()
- {
- if (location.href.indexOf('is-external=true') == -1) {
- parent.document.title="Game";
- }
- }
- </SCRIPT>
- <NOSCRIPT>
- </NOSCRIPT>
-
- </HEAD>
-
- <BODY BGCOLOR="white" onload="windowTitle();">
- <HR>
-
-
- <!-- ========= START OF TOP NAVBAR ======= -->
- <A NAME="navbar_top"><!-- --></A>
- <A HREF="#skip-navbar_top" title="Skip navigation links"></A>
- <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
- <TR>
- <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
- <A NAME="navbar_top_firstrow"><!-- --></A>
- <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
- <TR ALIGN="center" VALIGN="top">
- <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD>
- <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD>
- <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD>
- <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD>
- <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD>
- <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD>
- <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD>
- </TR>
- </TABLE>
- </TD>
- <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
- </EM>
- </TD>
- </TR>
-
- <TR>
- <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
- <A HREF="../../../../aima/core/search/adversarial/AlphaBetaSearch.html" title="class in aima.core.search.adversarial"><B>PREV CLASS</B></A>
- <A HREF="../../../../aima/core/search/adversarial/IterativeDeepeningAlphaBetaSearch.html" title="class in aima.core.search.adversarial"><B>NEXT CLASS</B></A></FONT></TD>
- <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
- <A HREF="../../../../index.html?aima/core/search/adversarial/Game.html" target="_top"><B>FRAMES</B></A>
- <A HREF="Game.html" target="_top"><B>NO FRAMES</B></A>
- <SCRIPT type="text/javascript">
- <!--
- if(window==top) {
- document.writeln('<A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>');
- }
- //-->
- </SCRIPT>
- <NOSCRIPT>
- <A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>
- </NOSCRIPT>
-
-
- </FONT></TD>
- </TR>
- <TR>
- <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
- SUMMARY: NESTED | FIELD | CONSTR | <A HREF="#method_summary">METHOD</A></FONT></TD>
- <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
- DETAIL: FIELD | CONSTR | <A HREF="#method_detail">METHOD</A></FONT></TD>
- </TR>
- </TABLE>
- <A NAME="skip-navbar_top"></A>
- <!-- ========= END OF TOP NAVBAR ========= -->
-
- <HR>
- <!-- ======== START OF CLASS DATA ======== -->
- <H2>
- <FONT SIZE="-1">
- aima.core.search.adversarial</FONT>
- <BR>
- Interface Game<STATE,ACTION,PLAYER></H2>
- <DL>
- <DT><DT><B>Type Parameters:</B><DD><CODE>STATE</CODE> - Type which is used for states in the game.<DD><CODE>ACTION</CODE> - Type which is used for actions in the game.<DD><CODE>PLAYER</CODE> - Type which is used for players in the game.</DL>
- <DL>
- <DT><B>All Known Implementing Classes:</B> <DD><A HREF="../../../../aima/core/environment/connectfour/ConnectFourGame.html" title="class in aima.core.environment.connectfour">ConnectFourGame</A>, <A HREF="../../../../aima/core/environment/tictactoe/TicTacToeGame.html" title="class in aima.core.environment.tictactoe">TicTacToeGame</A></DD>
- </DL>
- <HR>
- <DL>
- <DT><PRE>public interface <B>Game<STATE,ACTION,PLAYER></B></DL>
- </PRE>
-
- <P>
- Artificial Intelligence A Modern Approach (3rd Edition): page 165.<br>
- <br>
- A game can be formally defined as a kind of search problem with the following
- elements: <br>
- <ul>
- <li>S0: The initial state, which specifies how the game is set up at the
- start.</li>
- <li>PLAYER(s): Defines which player has the move in a state.</li>
- <li>ACTIONS(s): Returns the set of legal moves in a state.</li>
- <li>RESULT(s, a): The transition model, which defines the result of a move.</li>
- <li>TERMINAL-TEST(s): A terminal test, which is true when the game is over
- and false TERMINAL STATES otherwise. States where the game has ended are
- called terminal states.</li>
- <li>UTILITY(s, p): A utility function (also called an objective function or
- payoff function), defines the final numeric value for a game that ends in
- terminal state s for a player p. In chess, the outcome is a win, loss, or
- draw, with values +1, 0, or 1/2 . Some games have a wider variety of possible
- outcomes; the payoffs in backgammon range from 0 to +192. A zero-sum game is
- (confusingly) defined as one where the total payoff to all players is the
- same for every instance of the game. Chess is zero-sum because every game has
- payoff of either 0 + 1, 1 + 0 or 1/2 + 1/2 . "Constant-sum" would have been a
- better term, but zero-sum is traditional and makes sense if you imagine each
- player is charged an entry fee of 1/2.</li>
- </ul>
- <P>
-
- <P>
- <DL>
- <DT><B>Author:</B></DT>
- <DD>Ruediger Lunde</DD>
- </DL>
- <HR>
-
- <P>
-
- <!-- ========== METHOD SUMMARY =========== -->
-
- <A NAME="method_summary"><!-- --></A>
- <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
- <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
- <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
- <B>Method Summary</B></FONT></TH>
- </TR>
- <TR BGCOLOR="white" CLASS="TableRowColor">
- <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
- <CODE> java.util.List<<A HREF="../../../../aima/core/search/adversarial/Game.html" title="type parameter in Game">ACTION</A>></CODE></FONT></TD>
- <TD><CODE><B><A HREF="../../../../aima/core/search/adversarial/Game.html#getActions(STATE)">getActions</A></B>(<A HREF="../../../../aima/core/search/adversarial/Game.html" title="type parameter in Game">STATE</A> state)</CODE>
-
- <BR>
- </TD>
- </TR>
- <TR BGCOLOR="white" CLASS="TableRowColor">
- <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
- <CODE> <A HREF="../../../../aima/core/search/adversarial/Game.html" title="type parameter in Game">STATE</A></CODE></FONT></TD>
- <TD><CODE><B><A HREF="../../../../aima/core/search/adversarial/Game.html#getInitialState()">getInitialState</A></B>()</CODE>
-
- <BR>
- </TD>
- </TR>
- <TR BGCOLOR="white" CLASS="TableRowColor">
- <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
- <CODE> <A HREF="../../../../aima/core/search/adversarial/Game.html" title="type parameter in Game">PLAYER</A></CODE></FONT></TD>
- <TD><CODE><B><A HREF="../../../../aima/core/search/adversarial/Game.html#getPlayer(STATE)">getPlayer</A></B>(<A HREF="../../../../aima/core/search/adversarial/Game.html" title="type parameter in Game">STATE</A> state)</CODE>
-
- <BR>
- </TD>
- </TR>
- <TR BGCOLOR="white" CLASS="TableRowColor">
- <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
- <CODE> <A HREF="../../../../aima/core/search/adversarial/Game.html" title="type parameter in Game">PLAYER</A>[]</CODE></FONT></TD>
- <TD><CODE><B><A HREF="../../../../aima/core/search/adversarial/Game.html#getPlayers()">getPlayers</A></B>()</CODE>
-
- <BR>
- </TD>
- </TR>
- <TR BGCOLOR="white" CLASS="TableRowColor">
- <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
- <CODE> <A HREF="../../../../aima/core/search/adversarial/Game.html" title="type parameter in Game">STATE</A></CODE></FONT></TD>
- <TD><CODE><B><A HREF="../../../../aima/core/search/adversarial/Game.html#getResult(STATE, ACTION)">getResult</A></B>(<A HREF="../../../../aima/core/search/adversarial/Game.html" title="type parameter in Game">STATE</A> state,
- <A HREF="../../../../aima/core/search/adversarial/Game.html" title="type parameter in Game">ACTION</A> action)</CODE>
-
- <BR>
- </TD>
- </TR>
- <TR BGCOLOR="white" CLASS="TableRowColor">
- <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
- <CODE> double</CODE></FONT></TD>
- <TD><CODE><B><A HREF="../../../../aima/core/search/adversarial/Game.html#getUtility(STATE, PLAYER)">getUtility</A></B>(<A HREF="../../../../aima/core/search/adversarial/Game.html" title="type parameter in Game">STATE</A> state,
- <A HREF="../../../../aima/core/search/adversarial/Game.html" title="type parameter in Game">PLAYER</A> player)</CODE>
-
- <BR>
- </TD>
- </TR>
- <TR BGCOLOR="white" CLASS="TableRowColor">
- <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
- <CODE> boolean</CODE></FONT></TD>
- <TD><CODE><B><A HREF="../../../../aima/core/search/adversarial/Game.html#isTerminal(STATE)">isTerminal</A></B>(<A HREF="../../../../aima/core/search/adversarial/Game.html" title="type parameter in Game">STATE</A> state)</CODE>
-
- <BR>
- </TD>
- </TR>
- </TABLE>
-
- <P>
-
- <!-- ============ METHOD DETAIL ========== -->
-
- <A NAME="method_detail"><!-- --></A>
- <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
- <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
- <TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
- <B>Method Detail</B></FONT></TH>
- </TR>
- </TABLE>
-
- <A NAME="getInitialState()"><!-- --></A><H3>
- getInitialState</H3>
- <PRE>
- <A HREF="../../../../aima/core/search/adversarial/Game.html" title="type parameter in Game">STATE</A> <B>getInitialState</B>()</PRE>
- <DL>
- <DD><DL>
- </DL>
- </DD>
- </DL>
- <HR>
-
- <A NAME="getPlayers()"><!-- --></A><H3>
- getPlayers</H3>
- <PRE>
- <A HREF="../../../../aima/core/search/adversarial/Game.html" title="type parameter in Game">PLAYER</A>[] <B>getPlayers</B>()</PRE>
- <DL>
- <DD><DL>
- </DL>
- </DD>
- </DL>
- <HR>
-
- <A NAME="getPlayer(java.lang.Object)"><!-- --></A><A NAME="getPlayer(STATE)"><!-- --></A><H3>
- getPlayer</H3>
- <PRE>
- <A HREF="../../../../aima/core/search/adversarial/Game.html" title="type parameter in Game">PLAYER</A> <B>getPlayer</B>(<A HREF="../../../../aima/core/search/adversarial/Game.html" title="type parameter in Game">STATE</A> state)</PRE>
- <DL>
- <DD><DL>
- </DL>
- </DD>
- </DL>
- <HR>
-
- <A NAME="getActions(java.lang.Object)"><!-- --></A><A NAME="getActions(STATE)"><!-- --></A><H3>
- getActions</H3>
- <PRE>
- java.util.List<<A HREF="../../../../aima/core/search/adversarial/Game.html" title="type parameter in Game">ACTION</A>> <B>getActions</B>(<A HREF="../../../../aima/core/search/adversarial/Game.html" title="type parameter in Game">STATE</A> state)</PRE>
- <DL>
- <DD><DL>
- </DL>
- </DD>
- </DL>
- <HR>
-
- <A NAME="getResult(java.lang.Object,java.lang.Object)"><!-- --></A><A NAME="getResult(STATE, ACTION)"><!-- --></A><H3>
- getResult</H3>
- <PRE>
- <A HREF="../../../../aima/core/search/adversarial/Game.html" title="type parameter in Game">STATE</A> <B>getResult</B>(<A HREF="../../../../aima/core/search/adversarial/Game.html" title="type parameter in Game">STATE</A> state,
- <A HREF="../../../../aima/core/search/adversarial/Game.html" title="type parameter in Game">ACTION</A> action)</PRE>
- <DL>
- <DD><DL>
- </DL>
- </DD>
- </DL>
- <HR>
-
- <A NAME="isTerminal(java.lang.Object)"><!-- --></A><A NAME="isTerminal(STATE)"><!-- --></A><H3>
- isTerminal</H3>
- <PRE>
- boolean <B>isTerminal</B>(<A HREF="../../../../aima/core/search/adversarial/Game.html" title="type parameter in Game">STATE</A> state)</PRE>
- <DL>
- <DD><DL>
- </DL>
- </DD>
- </DL>
- <HR>
-
- <A NAME="getUtility(java.lang.Object,java.lang.Object)"><!-- --></A><A NAME="getUtility(STATE, PLAYER)"><!-- --></A><H3>
- getUtility</H3>
- <PRE>
- double <B>getUtility</B>(<A HREF="../../../../aima/core/search/adversarial/Game.html" title="type parameter in Game">STATE</A> state,
- <A HREF="../../../../aima/core/search/adversarial/Game.html" title="type parameter in Game">PLAYER</A> player)</PRE>
- <DL>
- <DD><DL>
- </DL>
- </DD>
- </DL>
- <!-- ========= END OF CLASS DATA ========= -->
- <HR>
-
-
- <!-- ======= START OF BOTTOM NAVBAR ====== -->
- <A NAME="navbar_bottom"><!-- --></A>
- <A HREF="#skip-navbar_bottom" title="Skip navigation links"></A>
- <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
- <TR>
- <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
- <A NAME="navbar_bottom_firstrow"><!-- --></A>
- <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
- <TR ALIGN="center" VALIGN="top">
- <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD>
- <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD>
- <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD>
- <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD>
- <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD>
- <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD>
- <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD>
- </TR>
- </TABLE>
- </TD>
- <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
- </EM>
- </TD>
- </TR>
-
- <TR>
- <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
- <A HREF="../../../../aima/core/search/adversarial/AlphaBetaSearch.html" title="class in aima.core.search.adversarial"><B>PREV CLASS</B></A>
- <A HREF="../../../../aima/core/search/adversarial/IterativeDeepeningAlphaBetaSearch.html" title="class in aima.core.search.adversarial"><B>NEXT CLASS</B></A></FONT></TD>
- <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
- <A HREF="../../../../index.html?aima/core/search/adversarial/Game.html" target="_top"><B>FRAMES</B></A>
- <A HREF="Game.html" target="_top"><B>NO FRAMES</B></A>
- <SCRIPT type="text/javascript">
- <!--
- if(window==top) {
- document.writeln('<A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>');
- }
- //-->
- </SCRIPT>
- <NOSCRIPT>
- <A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>
- </NOSCRIPT>
-
-
- </FONT></TD>
- </TR>
- <TR>
- <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
- SUMMARY: NESTED | FIELD | CONSTR | <A HREF="#method_summary">METHOD</A></FONT></TD>
- <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
- DETAIL: FIELD | CONSTR | <A HREF="#method_detail">METHOD</A></FONT></TD>
- </TR>
- </TABLE>
- <A NAME="skip-navbar_bottom"></A>
- <!-- ======== END OF BOTTOM NAVBAR ======= -->
-
- <HR>
-
- </BODY>
- </HTML>