MEC304 – Optimization 2024-2025 Semester 1

Hello, if you have any need, please feel free to consult us, this is my wechat: wx91due

MEC304 – Optimization 2024-2025 Semester 1
Department of Mechatronics and Robotics, Xi’ an Jiaotong-Liverpool University

Coursework

Key Information

Deadline:
15 December 2024, 6 PM
Where:
Learning Mall
Assessment:
50% of Final Marks
Outcomes Assessed:
A. Optimization methods for system analysis and modelling
B. Apply optimization methods to practical problems
C. Use optimization algorithm development to achieve engineering optimization solution.
D. Resolve the basic engineering optimization problems using a variety of programming, design and simulation tools

1 Section A (50%):

1.1 Background:

The Pac-Man project was developed for UC Berkeley’s introductory artificial intelligence course. They apply an array of AI techniques to playing Pac-Man. However, these projects don’t focus on building AI for video games. Instead, they teach foundational AI concepts, such as informed state-space search, probabilistic inference, and reinforcement learning. These concepts

underly real-world application areas such as natural language processing, computer vision, and robotics.

The aims of this project are to improve your understanding of the Ant Colony Optimization (ACO) algorithms [1] and to experience how to derive heuristics, using the Berkely Pac Man framework 1. Through studying and understanding of the animal-inspired optimization methods, use of the methods to model the gaming system, implementation of the methods in Python, this demonstrates a real-case scenario of applying optimization methods in resolving practical problems. All the learning outcomes will be assessed through this exemplary application.

1.2 Environment Set Up

macOS


If you are running macOS High Sierra (10.13.6) or higher version, mac OS contains a Python 2 . x by default, you don’t have to install any additional software. Alternatively, you can download and install python 2.7.18 from here.4

Windows

You can download and install python 2.7.18 from here. Remember to tick ’Add Python To Path’

1.3 Task

Test

Run following command


python - V


in Terminal (macOS) or Command Line (CMD in Windows). If you successfully installed the python with the correct version, the output will be similar to


ZirendeiMac : ˜ ziren $ python -V
Python 2.7.18


Note that python subversion may vary, but ensure your python version is OVER 2.7 and NOT 3.x. Now you may navigate to project folder using ’cd’ command and try

python pacman.py

Pacman lives in a shiny blue world of twisting corridors and tasty round treats. Navigating this world efficiently will be Pacman’s first step in mastering his domain.

Task 1 (10%)

By default, we implemented a simple AI which moves completely random using AntAgent class. Your task is based on AntAgent and try to implement your algorithms under AntAgent class. Many useful methods (equivalent to functions) you may use in this project have been described in pacmanAgents.py. You should not change any files other than pac- manAgents. py. You should not import any additional libraries into your code, excepting numpy if needed.

Your first task is implementing basic ACO algorithm to compute a shortest path to find one food under easy mode. The general ACO algorithm can be described as follows:

1. start from yourpacman location cp and plan a path to good cf

2. from cp , send out n ants to find the food
3. during each node selection stage,
(a) Key feature 1: the ant tends to move to the next node with higher probability, but the node with lower probability should also have chance
(b) Key feature 2: the ant leaves pheromone when it goes through a path and the pheromone is decaying with time.
1. if the goal achieves, calculate the total length of the path and override the best path if the current simulation has shorter distance

More details, such as equations and calculations, of ACO can be found in [1]. To run your AntAgent in pacman game under easy mode,


Python pacman. py - p AntAgent -l medium


The command above tells the computer to use AntAgent as its search agent, which is implemented in pacmanAgents.py.

To get the full mark, you should consider how duplicated simulations can be avoided. Highlight and write a simple description in your implementation.

Task 2 (10%)

Your second task is improving the ACO algorithm implemented in the Task 1 to find multiple foods, under medium mode. To run your AntAgent in pacman game under medium mode,

Python pacman. py - p AntAgent -l medium

The implementation should be compatible with Task 1.

Task 3: Challenge Task(10%)

In the challenge mode, there will be some ghosts chasing the pacman. The game will be ended if any of ghosts catches the Pac- man. Your final task is further improving ACO algorithm to eat multiple food and not be caught by enemies. To run your AntAgent in pacman game under challenge mode,

The implementation should be compatible with Task 1 and Task 2.

Task 3 will be tested 10 times to calculate the probability, though it is not large testing number.

Report (20%)

After implementing the algorithm, a report is also required. A suggested structure of the report will include cover page, table of contents, list of figures, list of tables, introduction, problem statement, methodology, Results and analysis, conclusions, references. A critical thinking section is also required to reflect your work in this assessment and general study of this module. IEEE referencing system is recommended.

2 Section B: (50%):

2.1 Traveling Salesman Problem using Ant Colony Optimization

Given a list of 10 cities and the distances between each pair of cities, what is the shortest possible route that visits each city and returns to the origin city?

2.2 Task

Write code for implementing the ACO algorithm using Matlab to find the best route.(Assume there are 10 cities and you can design the coordinates of the cities by yourselves) (20%).

Provide a report including problem statement, methodology, results, analysis, conclusions and references (30%).

2.3 Requirements


  • Write and implement algorithm in Matlab
  • Find solution for the optimization problem
  • Draft a report with more than 2 pages in main body
  • Your report should include all the required sections
  • Your report should be based on your own understanding
  • Reference any sources you use with the IEEE Referencing system


3 Marking Criteria for Implementation

The marks are broken down as follows:

Section # and description
Marks
Section A(task 1): eat food
5
Section A(task 1): optimal solution (shortest path)
5
Section A(task 2): eat multiple foods
5
Section A(task 2): optimal solution (shortest paths)
5
Section A(task 3): eat multiple foods
5
Section A(task 3): optimal solution (shortest paths)
5
Section A:report
20
Section B: algorithm
20
Section B: report
30

Academic Misconduct

The University misconduct policy applies. Students are encouraged to discussthe assignment topics, but all submitted work must represent the individual’s understanding of the topic.

The subject staff take academic misconduct seriously. In the past, we have prosecuted several students that have breached the university policy. Often this results in receiving 0 marks for the assessment, and in some cases, has resulted in failure of the subject.

Important: As part of marking, we run all submissions via a code similarity comparison tool. These tools are quite sophisticated and are not easily fooled by attempts to make code look different. In short, if you copy code from classmates or from online sources, you risk facing academic misconduct charges.

Licensing Information

Section A is modified from UC Berkeley AI courses, http://ai.berkeley.edu

References

[1] Dorigo, M., Birattari, M., and Stutzle, T. Ant colony optimization. IEEE computationa

发表评论

电子邮件地址不会被公开。 必填项已用*标注