After sending the info byte the client enters the main loop. Each iteration of this loop is a simulation.
The client will wait for the rules. First there comes 2 bytes with some boolean rules:
Lower_X_Bound_Is_Known
Upper_X_Bound_Is_Known
Lower_Y_Bound_Is_Known
Upper_Y_Bound_Is_Known
Number_Of_Homes_Is_Known
Number_Of_Items_Is_Known
Number_Of_Enemies_Is_Known
Number_Of_Dangers_Is_Known
(agent direction is parallell with y-axis)
(agent direction is negative)
Ammunition_Is_Limited
Cost_Is_Limited
Score_Is_Limited
Can_Recharge_Ammunition_At_Home
Neutralized_Enemy_Becomes_Item
Neutralization_Stops_At_First_Enemy
negative | parallell with y-axis | Initial_Direction |
0 | 0 | East |
0 | 1 | North |
1 | 0 | West |
1 | 1 | South |
Then the client reads the following rules:
Size in bytes | Format | Rule |
1 | Natural | Neutralization_Range |
2 | Natural | Move_Cost |
2 | Natural | Turn_Cost |
2 | Natural | Grab_Cost |
2 | Natural | Neutralize_Cost |
2 | Natural | Item_Reward |
2 | Natural | Neutralize_Reward |
2 | Natural | Home_Reward |
4 | Natural | Initial_Cost |
4 | Integer | Initial_Score |
Then the client reads the following rules if and only if certain conditions are fulfilled. The conditions are based on previously read rules.
Condition | Size in bytes | Format | Rule |
Lower_X_Bound_Is_Known | 1 | Integer | Lower_X_Bound |
Upper_X_Bound_Is_Known | 1 | Integer | Upper_X_Bound |
Lower_Y_Bound_Is_Known | 1 | Integer | Lower_Y_Bound |
Upper_X_Bound_Is_Known | 1 | Integer | Upper_X_Bound |
Number_Of_Homes_Is_Known | 2 | Natural | Number_Of_Homes |
Number_Of_Items_Is_Known | 2 | Natural | Number_Of_Items |
Number_Of_Enemies_Is_Known | 2 | Natural | Number_Of_Enemies |
Number_Of_Dangers_Is_Known | 2 | Natural | Number_Of_Dangers |
Ammunition_Is_Limited | 2 | Natural | Ammunition_Capacity |
Ammunition_Is_Limited | 2 | Natural | Initial_Ammunition |
Cost_Is_Limited | 4 | Natural | Cost_Limit |
Score_Is_Limited | 4 | Integer | Score_Limit |
Then the client reads the first percept. The bits of the percept are interpreted as follwos:
Home
Item
Hostility
Bump
Fear
Enemy_Neutralized
(unused)
End
Then the client reads information about the tiles that the agent should know about (except for the tile at (0, 0) for which the client already got the information through the first percept). This is done in a loop. In each iteration it reads information about a tile. If the byte is 0, it exits the loop. Otherwise it reads the x-coordinate (1 byte) and the y-coordinate (1 byte). The tile information byte is interpreted as follows:
If bit 1 is True and bit 2 is True the tile is clear without enemy and
bit 3 tells wether the tile has a home.
bit 4 tells wether the tile has an item.
bit 5 tells wether the tile has percept hostility.
bit 6 tells wether the tile has percept fear.
If bit 1 is True and bit 2 is False the tile is clear with an enemy and
bit 3 tells wether the tile has a home.
bit 4 tells wether the tile has an item.
If bit 1 is False and bit 2 is True the tile is wall.
If bit 1 is False and bit 2 is False the tile is danger and bit 3 tells wether the tile has an enemy.
The follwoing bytes are interpreted as percepts until the percept includes End. Then the following 4 bytes are interpreted as an integer containing the score. Then the main loop continues with a new iteration.
The client is allowed to send data while the simulation is performed. This data can be of a few different kinds:
A request to perform an action.
A request to clear all symbols on the map.
A request to show a symbol on a tile. Only 1 symbol can be shown on a tile.
A request to not show any symbol on a tile.
A text message.
Number | Interpretation |
0 | Action Shut_Off |
1 | Action Move |
2 | Action Turn_Left |
3 | Action Turn_Right |
4 | Action Grab |
5 | Action Neutralize |
6 | Clear all symbols on the map |
7 | Pause the simulation (so that the user can take a look at the debug output and then continue) |
8 .. 99 | (unused) |
100 .. 199 | Symbol number 0 .. 99 |
200 | Symbol Number_Sign (#). |
201 | Symbol Question (?) |
201 | Symbol Question_Exclaimation (?!) |
203 | Symbol Unreachable |
204 | Symbol Irrelevant |
205 | Symbol Danger |
206 | Symbol Possible_Danger |
207 | Symbol Enemy |
208 | Symbol Possible_Enemy |
209 | Symbol Enemy and Danger |
210 | Symbol Possible_Enemy and Danger |
211 | Symbol Enemy and Possible_Danger |
212 | Symbol Possible_Enemy and Possible_Danger |
213 | Symbol Plan_Shut_Off |
214 | Symbol Arrow_ENWS (East, North, West, South) |
215 | Symbol Arrow__NWS (North, West, South) |
216 | Symbol Arrow_E_WS (East, West, South) |
217 | Symbol Arrow___WS (West, South) |
218 | Symbol Arrow_EN_S (East, North, South) |
219 | Symbol Arrow__N_S (North, South) |
220 | Symbol Arrow_E__S (East, South) |
221 | Symbol Arrow____S (South) |
222 | Symbol Arrow_ENW_ (East, North, West) |
223 | Symbol Arrow__NW_ (North, West) |
224 | Symbol Arrow_E_W_ (East, West) |
225 | Symbol Arrow___W_ (West) |
226 | Symbol Arrow_EN__ (East, North) |
227 | Symbol Arrow__N__ (North) |
228 | Symbol Arrow_E___ (East) |
229 | Symbol None (remove) |
230 .. 254 | (unused) |
255 | Text message |
When sending a symbol the client should send 2 more bytes containing the x-coordinate and y-coordinate respectively. When sending a text message the client should send a 2 byte natural containing the size of the text message, followed by that number of bytes containing the message. The client can send any number of symbol and text message requests, but when it has sent an action it must wait for a percept before it is allowed to send anything again. So the agent is only allowed to send 1 action at a time. When it has sent one, it has to wait for a percept before it can send the next action.
Would you like to make a comment or contribute an update to this page?
Send feedback to the KDE Docs Team