Specifications: Please read the project specs (in documents directory).
Authors: The Duy Nguyen and Ramon Javier L. Felipe VI.
Acknowledgement: referee
source code is originally written by the
University of Melbourne, COMP30024, Semester 1, 2024; modified and tweaked by the authors.
You can also play the game here:
https://comp30024.pages.gitlab.unimelb.edu.au/2023s1/infexion-playground/
- To run:
$ python3 referee agent agent
- Recommended run:
where the tags, respectively, represent: space and time limit allowed, unicode-allowed, and ansi-color allowed.
$ python3 referee agent agent -s -t -u -c
Windows does not support ansi formatting by default, so to enable it, do as follows:
- Open Registry Editor
- Go to HKEY_CURRENT_USER folder
- Double-click on Console folder
- Select Edit, New, DWORD
- Name it VirtualTerminalLevel, and choose Modify
- Fill in Value Data 10 in Hexadecimal
- Save
- Choose Edit Configuration at Run
- Click "+", or New, Python
- Choose Module name (instead of Script path)
- Parameters:
agent agent -s -t -c -u
(the last 2 tags are optional, as discussed) - Environment Variable:
PYTHONUNBUFFERED=1
- Choose a Python Interpreter (must be Python 3.10 or newer)
- Working directory: "../AI-part-B"
- In Execution, tick Emulate terminal in output console
Advanced running will concern mostly with agent parameters. These are the 4 ways you could call your agent in the program command:
-
The most conventional way is to specify your agent class as
Agent
in an un-capitalized package name (i.e.agent
,greedy
, etc.). With this, the command should be:$ python3 referee agent greedy
-
The second conventional way is to specify your package as
agent
(again, the casing of packages and classes are very important). Doing this, likewise, allows you to name your agent class anything, as long as its first character is capitalized (i.e.GreedyAgent
,MinimaxAgent
, etc.). With this, the command should be:$ python3 referee GreedyAgent MinimaxAgent
-
If specified by agent (the second way), then there are specific abbreviations that may be of convenience to use:
A
forAgent
- If the word
R
(in any casing) is included, it will representRandomAgent
- If the word
G
(in any casing) is included, it will representGreedyAgent
- If
MC
(in any casing) is included, it will representMonteCarloAgent
- If
MS
(in any casing) is included, it will representMinimaxShallowAgent
- If
NG
(in any casing) is included, it will representNegaScoutAgent
Example: The following will run GreedyAgent and RandomAgent specifically in the
agent
package:$ python3 referee GA R
Note that abbreviations, for the sake of convenience, to be triggered, the agent's parameters in the command must have length of less than 5. Otherwise, the program will simply consider the input as verbose.
-
The final way is verbose, meaning to specify the entire directory for the agent. The user should enter the agent in this format:
package/path/to/Agent
.
Note that the deliminator/
may be replaced with\
or.
instead, but everything must be uniformed. An example is you put yourNegamaxAgent
agent in a script namedagents
. The path to that script is:my_agent/minimax/agents
, wheremy_agent
is top-level package, same level asreferee
. Then the command would be like this:$ python3 referee agent my_agent/minimax/agents/NegamaxAgent