Introduction
The process of creating a human or computer agent in Colored Trails is very simple. For human agents, one can directly use the graphical user interface (GUI) classes available in CT. Unless customization is needed, the researcher is freed of having to code separate agents. But even when the experiment requires custom UI elements, adding them to the existing GUI class structure is easy (see below Customization). For computer agents, one needs to implement a class handling the specific actions or moves required by that agent. CT provides a message-handling infrastructure for the low-level message-passing, reordering and guaranteed delivery. The developer only needs to specify, in game terms (e.g., board movements, chipset exchanges) what the agent is supposed to do, i.e., implement the agent's static or adaptive strategy.
Running a GUI agent
To run a GUI agent, without customization, just type from your main CT directory:
java -jar dist/ct3.jar -c ctgui.original.GUI --pin pin --client_hostip IP address or hostname
Customizing the GUI
Sometimes it is required for the GUI to be customized, to provide functionality that is not included in the standard CT distribution. This is accomplished by tweaking the following:
- In class ctgui.original.BoardWindow there is a responserequired method that handles special messages sent by the server. The command argument distinguishes the different types of messages. In the body of the method, the developer can implement custom functionality in BoardWindow or other UI classes (like TaskBar, BoardPanel, etc.).