Programming assignment – Groupwork by a team of 4-5 students
Title: JC4004 – Computational Intelligence
Note: This assignment accounts for 30% ofthe total mark of the course.
Deadline: Submit the assignment in MyAberdeen by 19. December 2024 at 23:00 (China time).Information for Plagiarism and Collusion: The source code and your report may be submitted forplagiarism check in MyAberdeen. Please refer to the slides available at MyAberdeen for moreinformation about avoiding plagiarism before you start working on the assessment. Excessive useof large language models, such as ChatGPT, for writing the code or the report can also be consideredas plagiarism. In addition, submitting similar work with another group can be considered ascollusion.
Information about Extensions: According to the new extension policy of University of Aberdeen,teachers are no longer allowed to give deadline extensions for coursework assignments. Extensionmay be requested from the school administration by e-mail: uoa-ji-evidence, such as a medical certificate. See also a separate
ocument for the extension policy. Since this assignment is a groupwork assignment, extensionswould be granted in very exceptional situations only.page 2 of 6
Introduction In this assignment, your task is to build an artificial intelligence game bot for playing the traditionalboard game Fox and Goose. Your game bot should be able to play the game on both sides, as a foxand as a goose. The detailed rules of the game are explained below. Please note that there aredifferent versions of the game: for this assignment, you should follow therules described in thiscument.ox and Goose is a two-player board game. One of the players is a fox trying to capture all thegeese.Another player represents the geese and tries to surround the fox so that it cannot move any more.The game is played on a board with 33 possible locations for the fox and the geese. In the beginning,there are 15 geese and one fox on heboard, as illustrated in the Figure 1. The white pieces are thegeese, and the red piece is the fox.The game is played in turns. In this version of the game, the fox and the geese can both move one
tep horizontally, vertically, or diagonally on their turn along the lines on the board. The playerplaying goose can select any of the geese on the board to move. Please note that diagonal movement is only allowed from some of the positions, as indicated by the lineson the board. You cannot move a piece to a position that is already taken by another piece. However, the fox canapture (or eat) a goose by jumping over it to a freeposition. Thecaptured goose is removed fromhe board. It is also possible to capture multiple geese in one turn by chaining the jumps like inCheckers. A goose cannot capture the fox. It is not mandatory tocaptureeven if it is possible, but itis mandatory for both the fox and the geese to make a move in their turn. Examples of legal movesare shown in Figure 2 below.
The goal of the geese is to surround the fox so that it cannot make any legal moves anymore. Thegoal of the fox is to capture all the geese. Theoretically, the minimum of four geese would be enoughto surround the fox; therefore, the fox wins when there are less than four geese left on the board.Examples of winning the game are shown in Figure 3.nce the fox and thegeese have a different goal and follow different rules, the game is unbalanced.herefore, the players usually play an even number of games, swapping their roles. The playerthatFigure 1. Initial positions in Fox and Goose.wins more games is the final winner. In this assignment, your task is to implement the game logic forboth the fox and the goose.Figure 2. Examples of legal moves for the geese (left) and the fox(right)espectively.Figure 3. Examples of the fox winning the game (left) and the geese winning the game (right).General Guidance and Requirements ard ispassed to the methods as a parameter, and the methods will return the next move as a fox or as aoose, respectively. Python file TestFoxAndGoose.py will be shared to demonstrate how the gametesting framework uses the Player class.
page 3 of 6page 4 of 6 The board is a 2-D list object with 7 × 7 characters representing the state of the game. Characters'F' and 'G' mark the fox and the geese, respectively. An empty position ismarked with a dot '.'
and a space ' ' marks a position that is off the playing area. The board is initialised in classFoxAndGoose in file TestFoxAndGoose.py as follows:The play_fox() and wo or more pairs of integers, where the first value represents the row, and the second valuerepresents the column on the board. The first pair is the initial position, and the second pair is thetarget position. For example, return value [[3,2],[3,3]] meansthat the piece in the 4th row, 3rdcolumn will be moved to the 4th row, 4th column. Note that the numbering starts from zero: forexample, position [0,1] is the 2 nd column of the 1 st row.The play_fox()method can return a longer list with several target positions in case the foxcaptures more than just one goose in one move. For example, return value [[3,3],[3,1],
5,3]] meansthat the fox first jumps from position [3,3] to position [3,1], capturing the goosein position [3,2], and then continues to position [5,3], capturing the goose in position [4,2].You can decide freely what kind of techniques of computational intelligence you use to implementthe game logic. You can implement additional functions and classes if necessary. However, thePlayer class should interact with the game framework only through the play_fox() andlay_goose()methods, as described above. The bot should have a reasonable complexity: in theesting phase, a time limit of 5 seconds will be applied to consider the moves. If your implementationrequires time-consuming initialisation, such as downloading a deep neural network, initialisationshould be done in the class Player constructor __init__, not the play_fox()andplay_goose()methods.You can use code generation tools and code from external sources moderately for assistingimplementation of parts of the code, but the use of any sources or tools should be explained, andou should submit the work in the course page in MyAberdeen. Your submission should include atleast two files: file TeamXX.py that includes the Python code implementing 代写JC4004 Computational Intelligence class Player withmethods play_fox() and play_goose(), and ReportXX.pdf that is the projectreport. In theile names, replace XX with team number, for example 05. As an example, we provide file Team00.py that allows you to play the game manually with moves entered by ahuman user. If your code requiresany additional files to run, such as pre-trained neural network, you should include them also in yoursubmission.Please note that it is your responsibility to make sure thatthe code in TeamXX.py works when wetest it: you should use file TestFoxAndGoose.py to import your class and to test that your code workswith the testing framework. Replace module name Team00 in module=__import__("Team00") with your own file name without .py extension. If your code has externaldependencies requiring additional installations, they should be clearly explained in the project reportor readme file included in the submission.Note that the game bots implemented by different groups will play against each other, so it is essential to ensurecompatibility. You should use Python 3. If you use any third-party packages suchas TensorFlow or PyTorch, we recommend using the latest stable version and to avoid using featureswith known backwards compatibility problems. We suggest startingwith a clean environment and tokeep track of all the installed packages and their version numbers and reporting them in the projectreport or readme file.Note that at the time of writing, the latest TensorFlow version is not compatible with the latest stablePython release 3.13.0. Therefore, if you plan to use TensorFlow, the Python version should be 3.12.7 or earlier.Thelength of the project report should be approximately 1,500 words. It is recommended to includegraphical illustrations, but screenshots of the program code should be avoided. If the codemplements some complex algorithms that are difficult to explain otherwise, flowcharts orpseudocode can be used as tools of illustration. The report should include thefollowing sections:
- Introduction: about 200 words.
- Theoretical basis, including description of the used methods and algorithms with a briejustification why those techniques were chosen: about 600 words.
- Implementation details, including the used libraries and e.g., an UML diagram or a list of thessential methods and their parameters: about 300 words.Conclusions, including self-reflection, difficulties faced, experiences from testing the code,and ideas for future improvements: about 300 words. Summary of the individual roles, including brief description of team members’ contributions:about 100 words.
- References.If you wish the results for your group to be published in the leaderboard in MyAberdeen, please givea name for your group in the report!
page 5 of 6page 6 of 6 Marking Criteria The assignment will be marked based on the project report (40 marks), methodology (40 marks), andperformance (20 marks).The project report will be marked according to the coverage of the required aspects, clarity of
presentation (including language and illustrations), consistency between the report and thesubmitted code, and relevance of the references.The methodology will be evaluated based on the suitability of the chosen methods and algorithmsfor the given task, creativity (for example, combining different methods in an unconventional way),and implementation (e.g., clarity of the source code, computational efficiency).For performance evaluation, we will test all the submitted assignments by arranging them to playagainst each other. Every submission will play against each of the other submissions twice, once as afox and once as a goose. The results will be aggregated in a league table, where a win gives one point,and a loss gives zero points. The winner will be awarded 20 marks, and the other groups will beawarded marks based on the formula:𝑚𝑖 =20𝑥𝑖𝑥𝑤𝑖𝑛𝑛𝑒𝑟where 𝑚𝑖 is the markfor group 𝑖, 𝑥𝑖 is the total points for group 𝑖, and 𝑥𝑤𝑖𝑛𝑛𝑒𝑟 is the total points forthe winner of the league.Note that if both game bots repeat moves back and forth to the same position, the game may end ina deadlock situation. To resolve deadlocks, the maximum number of movesis set to 1000. If the gamends without a winner due to a deadlock, both players will be awarded zero points.