forked from takashi-chikayama/Software-for-IPSJ-International-AI-Programming-Contest-SamurAI-Coding-2019-2020
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmanager.html
157 lines (155 loc) · 5.09 KB
/
manager.html
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
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" href="samuraidocs.css" >
<link rel="icon" href="../icons/samurai-icon.png" >
<title>SamurAI Dig Here Game Manager</title>
</head>
<body>
<span style="float:left">
<a href="manager-jp.html" target="_blank">日本語</a>
</span>
<h1>SamurAI Dig Here Game Manager</h1>
<center>
<p>
IPSJ Programming Contest Committee<br>
2019/10/03
</p>
<p>
The <em>SamurAI Dig Here</em> game manager is a tool to play
games of <em>SamurAI Dig Here</em> between two player agent
programs and generates log of the games.
</p>
</center>
<h2>Functionalities</h2>
<p>
The SamurAI Dig Here game manager is for the following.
<dl>
<dt>Playing games:</dt>
<dd>
Given a game field configuration, a game by between two
player player agent programs can be played, writing out the
play log of the game.
</dd>
<dt>Generating communication logs:</dt>
<dd>
During games,
copies of the data sent from the manager to player agent
programs can be saved to an external file,
which may be useful for debugging player agent programs.
</dd>
<dt>Verifying play logs:</dt>
<dd>
A play log file given can be checked for its consistency.
</dd>
</dl>
</p>
<h2>Usage</h2>
<p>
The command line should be in the following format.
<pre>
./manager [<em>options</em>] <<em>log</em>> [<<em>player1</em>> <<em>player2</em>>]
</pre>
</p>
<h3>Game Field</h3>
<p>
The argument <<em>log</em>> is a path to a file describing the
game field configuration and (possibly empty) play logs on the
field. This file is usually prepared with
<a href="help.html"> the SamurAI Dig Here web page</a> with the
file name extension "<tt>.dighere</tt>".
</p>
<h3>Player Programs</h3>
<p>
When the arguments <<em>player1</em>> and
<<em>player2</em>> are omitted, the manager checks the
consistency of the log file.
</p>
<p>
When <<em>player1</em>> and <<em>player2</em>> are
given, they are interpreted as paths to the player agent
programs. The manager make these two players play a game on the
game field specified by the given path <<em>log</em>>.
See below for more details.
</p>
<h3>Options</h3>
<p>
The following options are available.
<dl>
<dt><tt>-S</tt>:</dt>
<dd>
Output summary of each game step played to the standard error.
The summary consists of the following lines.
<div class="exampleText">
<pre>
Step: 4
Golds known: 6@(6,6) 8@(2,7)
Agent 0@(7,6) dig (6,6)X 59960 msec left
Agent 1@(2,6) dig (2,7) 59960 msec left
Agent 2@(7,5) move (6,6) 59147 msec left
Agent 3@(3,6) move (4,5) 59589 msec left
Scores are 0:8</pre>
</div>
<ul>
<li>
The step number of the game step.
</li>
<li>
Information on apparent treasures:
their amounts and positions.
</li>
<li>
The positions, play plans, and think time left of four agents,
one line for each agent.
The coordinates of cell to move to, dig up, or fill up
are also displayed.
When the plan cannot be actually taken because of
conflicts with plans of other agents,
it is followed by an <tt>X</tt> to indicate it.
</li>
<li>
Scores of both teams up to this step.
</li>
</ul>
An example is shown in the figure on the right. In this
example, the samurai (agent 0) planned to dig apparent
treasure at (6,6) but as the dog of the same team (agent 2)
moves to the same cell, digging was not successful.
Meanwhile, the apparent treasure at (2,7) is dug out by the
opponent samurai (agent 1), resulting in the scores of 0 and
8.
</dd>
<dt><tt>-D <<em>path</em>></tt></dt>
<dd>
Copies of the data send from the manager to player programs
are saved in to the files with specified path. As there are
four agents, the output goes to four files with paths
generated by appending agent IDs to the <<em>path</em>>
specified.
The IDs are the following.
<table>
<tr><td>0:</td><td>Samurai of player 1</td></tr>
<tr><td>1:</td><td>Samurai of player 2</td></tr>
<tr><td>2:</td><td>Dog of player 1</td></tr>
<tr><td>3:</td><td>Dog of player 2</td></tr>
</table>
</dd>
</dl>
</p>
<h2>Player Processes</h2>
<p>
Player programs are run as children processes of the manager.
Two processes each for both teams, one controlling the samurai
and the other controlling the dog, are run with the same
program. Which agent is to controlled can be known by the data
sent from the manager.
</p>
<p>
Each of the processes is given game status data from the
standard input stream in each game step. It should respond with
a play plan for the step. Further details can be found in the
document <a href="rules.html">SamurAI Dig Here Game Rules</a>.
</p>
</body>
</html>