Page 4: User-Interaction
Interface System
Contributed by Luiza Da Silva
Revised by Xuan Thuy Tran
[Go back to
Page 3: Design Layout | Go on to Page 5: Acquire Engine Architecture]
1 Overview
The User-Interaction Interface System (UIIS) provides the interface between the user and the Acquire System. The user will provide information so that the Acquire session can be set up. Only one user will be allowed to interface with the system at a specific time. Primarily, the output of the system (the session tally and the game history) will be saved on a file. But the UIIS must be flexible enough to allow a GUI system to eventually be built on top of it.
The UIIS will be comprised of Agents and Agent Connectors that do not have to be all necessarily running on the same machine. Figure 1.1 shows an overview of the system:
![]() |
|
As you can see from the picture above, there are two major components in the UIIS: the user, and the Controller. The Controller will receive the input from the user, locate Agents, and associate the Agents to the Heuristic the user would like each to use. Also, the Controller has to be able to locate and communicate with the Referee Engine (see the diagram at the top of the Design Layout section) to inform it of the number of games to be played in the session, and where the Agents are located. After the necessary Agents and Heuristics are initialized and the server was located, the Agents connect to the Engine, and the games begin.
2 Supporting Classes
The diagram below shows an overview of the Controller, its classes, and their relationships:
![]() |
|
3 UIIS Class Structure
User
The human user will provide input for the system so the session can get started. The user will enter input as strings, conveying the following information:
- How many Agents will play in this session.
- What heuristic will be assigned to each Agent in the session.
- An integer defining how many games are to be played in the session.
- Which Referee Engine the Agents will use as their domain.
- Where Agents should be (physically) located.The user will receive the output at the end of the session. The output will be primarily saved in a file. The file will contain the following information:
- Name/number of the Agent who won the session and which Heuristic it used.
- A tally or histogram of how many games (if any) each Agent won during the session.
- The History of each game in the session.
User
name_
user_IPstart() Fields:
name_ :: the name (or nickname) provided by the user.
user_IP :: address or machine user is connected to.
Methods:
start() :: initiates program; more specifically, the UCC will activate the Controller, and the Controller, in its turn, will activate the Referee agent, through the the AgentControllerConnector.
Controller
The Controller needs to receive the Input object from the UCC and locate Agents, and associate chosen Heuristics to each one of them. Their Connectors will receive the location from the Referee Engine, and will try to subscribe to it, so the game can get started.
Controller
heuristics_[]
session_
referee_Controller()
~Controller()
getInput()
sendSectionObj()Fields:
heuristics_[] :: structure that associates Agents with the Heuristics the user chose
session_ :: Session object
referee_ :: references the Referee Engine.
Methods:
Controller :: class constructor
~Controller :: class destructor
getInput() :: method that gets Input object from UserControllerConnector
sendSession() :: sends Session object to the AgentControllerConnector. The session object will be sent to the Referee Engine when it is located by the ACC.
Input
An Input object is created by the UserControllerConnector with data entered by the user. The Input object contains important information that needs to be passed to the Controller, such as the number of players, and the Heuristics that should be associated with each Agent.
The Controller will take the information about the Agents and use it to communicate with the Agents through the Controller's AgentControllerConnector.
Input
num_players
heuristic[]
location[]Input()
~Input()
setNumOfPlayers()
addHeuristic()
addIPAddress()Fields:
num_players :: number of agents playing the session
heuristic[] :: the heuristics being used in the session
location []:: location of the agents (IP addresses)
Methods:
Input() :: class constructor
~Input() :: class destructor
setNumOfPlayers() :: sets the number of players
addHeuristic() :: adds a heuristic description to the set of Heurisitics to be used in the session.
addIPAddress() :: adds an IP address of an Agent to the set of Agents that should be used in the system.
Output
An Output object is created in the Controller after the session is over and the results of the games played need to be presented to the user. The output will consist of statistics about the Agents that participated in the session, their Heuristics, and a history of moves. The output data is encapsulated inside the Output object, that is passed to the UserControllerAgent.
Output
winner_agent
winner_heuristic
tally[]
history[]Output()
~Output()
createTally()
setWinnerAgent()
setWinnerHeuristic()
setHistory()Fields:
winner_agent :: records which agent won the session
winner_heuristic :: records which heuristic the winner agent used
tally[] :: contains the tally of the session
history[] :: contains the history of the games played
Methods:
Output() :: class constructor
~Output() :: class destructor
createTally() :: creates tally/statistics about the session that has been played.
setWinnerAgent() :: sets the overall result of the session, i.e., the overall winner Agent.
setWinnerHeuristic() :: sets the overall result of the session, and in this case, which Heuristic was the overall winner in the session.
setHistory() :: sets the History of the session.
4 Class Relationship Diagram
Figure 5.1: The User-Controller Interface System UML Diagram
[Go back to Page 3: Design Layout | Go on to Page 5: Acquire Engine Architecture]