Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
\subtitle{Metrics}
\date{Tuesday, 22 May 2018}
\tikzset{
treenode/.style = {align=center, inner sep=0pt, text centered,
font=\sffamily},
arn_n/.style = {treenode, circle, white, font=\sffamily\bfseries, draw=black,
fill=black, text width=1.5em},% arbre rouge noir, noeud noir
arn_r/.style = {treenode, circle, red, draw=red,
text width=1.5em, very thick},% arbre rouge noir, noeud rouge
arn_x/.style = {treenode, rectangle, draw=black,
minimum width=0.5em, minimum height=0.5em},% arbre rouge noir, nil
box/.style = {draw, align=center, text centered, rectangle, draw=black, minimum height=1.25cm, minimum width=2cm}
}
\DeclareMathOperator*{\argmax}{arg\,max}
\begin{document}
\begin{frame}
\titlepage
\end{frame}
\begin{frame}{Metrics}
\begin{itemize}[<+->]
\item We talked about this last week...
\item Have a look at the evaluation slides
\item We also did this in the asteroids code.
\end{itemize}
\end{frame}
\section{Evaluation}
\begin{frame}{Basic}
\begin{itemize}
\item Look at AppMetrics
\item Add your parameters using addParameter
\item Write your fitness function
\item get the best and print it out
\end{itemize}
\end{frame}
\begin{frame}{What we need}
\begin{itemize}[<+->]
\item AI agents (We've done this yesterday)
\item Some Parameters (EntityProp, EntityCost, etc...)
\item An evaluation function
\item Some maps? (One will do...)
\end{itemize}
\end{frame}
\begin{frame}{AI Agents}
\begin{itemize}[<+->]
\item We did these yesterday.
\item We should load the AIFactory
\item Then use the factory in the evaluate
\item ai.buildAI("ProRuleRushRangedBlue", settings),
\end{itemize}
\end{frame}
\begin{frame}{Some Parameters}
\begin{itemize}[<+->]
\item evo.addParameter(new EntityProp("red\_knight", "defRanged", 0, 10, 1));
\item A min, max and step size
\item The entity and property
\end{itemize}
\end{frame}
\begin{frame}{Evaluation Function}
\begin{itemize}[<+->]
\item Run the games
\item Collect some \textbf{metrics}
\item Report the game fitness
\item (offline) analyse the metrics...
\end{itemize}
\end{frame}
\begin{frame}[fragile]{Basic}
\begin{minted}[breaklines,tabsize=2,fontsize=\footnotesize]{Java}
public Double evaluate(GameSettings settings) {
}
\end{minted}
\end{frame}
\begin{frame}[fragile]{Basic}
\begin{minted}[breaklines,tabsize=2,fontsize=\footnotesize]{Java}
public Double evaluate(GameSettings settings) {
GameState start = map.buildState(settings);
int[] winCounts = new int[2];
for (int i=0; i<10; i++) {
Controller[] controllers = new Controller[] {
ai.buildAI("ProRuleRushRangedBlue", settings),
ai.buildAI("ProRuleRushRed", settings)
};
GameState state = new GameState(start);
GameMetrics metrics = runGame(state, settings, controllers);
Integer winner = metrics.getWinner();
if (winner != null) {
winCounts[winner]++;
}
}
double score = winCounts[1] - winCounts[0];
fitnessScores.put(settings, score);
return score;
}
\end{minted}
\end{frame}
\section{Stats}
\begin{frame}[fragile]{Stats}
\begin{itemize}
\item Stats about the games
\item Stats about the turns
\item You can write files per game played - see the example
\item lots (and lots) of files...
\end{itemize}
\end{frame}
\begin{frame}[fragile]{Graphs}
\begin{figure}
\includegraphics[width=\textwidth]{tbs-peices}
\caption{What can we learn from this?}
\end{figure}
\end{frame}
\end{document}