COMP3702 Artificial Intelligence Semester 2 2024 Tutorial 3Python

Java Python COMP3702 Artificial Intelligence

Semester 2, 2024

Tutorial 3

Before you begin, please note:

•  Tutorial exercises are provided to help you understand the materials discussed in class, and to improve your skills in solving AI problems.

•  Tutorial exercises will not be graded.  However, you are highly encouraged to do them for your own learning. Moreover, we hope you get the satisfaction from solving these problems.

•  The skills you acquire in completing the tutorial exercises will help you complete the assignments.

•  You’ll get the best learning outcome when you try to solve these exercises on your own first (before your tutorial session), and use your tutorial session to ask about the difficulties you face when trying to solve this set of exercises.

•  The following data structures may be useful: heapq, queue (Queue, LifoQueue, PriorityQueue).

Exercises

Exercise 3.1. Consider the path planning problem on a 9 × 9 grid world in the figure below. The goal is to move from the star to the   ag in as few steps as possible. Crosses indicate obstacles, and attempting to traverse either an obstacle or a boundary wall is an invalid move, and does not move your agent (it should have no cost or efect).

a) Develop a state graph representation for this search problem, and implement a get successors() method for finding the next legal states to this problem, i.e. for generating successor nodes (vertices).

b) Implement BFS for this problem (using a FIFO queue) using your get successors() function.

c) Implement iterative-deepening DFS (IDDFS) for this problem using a length-limited LIFO queue, and reusing get successors().

d) Compare the performance of BFS and IDDFS in terms of:

i) The number of nodes visited/reached

ii) The number of nodes explored/expanded when the search terminates

iii) The number of nodes on the frontier when the search terminates

iv) The cost of the solution path

v) The run time of the algorithm, e.g.

from  timeit  import  default_timer

as  timer start  =  timer()

#  . . .  Run  the  code  you  want  to  time

end  =  timer()

COMP3702 Artificial Intelligence Semester 2, 2024 Tutorial 3Python

print(end  -  start)  #  Time  in  seconds,  e.g .  150 .38091952400282

Discuss your findings.

Exercise 3.2. Now consider the path planning problem with costly moves on a 9 × 9 grid world in the figure below, where costs of arriving at a state are indicated on the board and the goal is to move from the star to the flag:

a) Run BFS for this problem, reusing your answer from Exercise 3.1 (N.B. it should not use the costs on the grid).

b) Implement UCS for this problem using a priority queue.

c) Compare the performance of BFS and UCS in terms of:

i) The number of nodes visited/reached

ii) The number of nodes explored/expanded when the search terminates

iii) The number of nodes on the frontier when the search terminates

iv) The cost of the solution path

v) The run time of the algorithm

Discuss how and why these results difer from those for Exercise 3.1.

d) Now derive an admissible  heuristic for this path planning problem.

e) Using your heuristic, implement A* search for solving this path planning problem.

f) Compare the performance of UCS and A* search in terms of:

i) The number of nodes visited/reached

ii) The number of nodes explored/expanded when the search terminates

iii) The number of nodes on the frontier when the search terminates

iv) The cost of the solution path

v) The run time of the algorithm Explain these results.

Exercise 3.3. Implement A* for solving the 8-puzzle problem, assuming the goal of the 8-puzzle agent is to find the solution in as few steps as possible.

a) Discuss the heuristics you could use with your classmates.

b) Reuse the container in the program you created in the last tutorial, by modifying it to a priority queue. Along with this, revise the program, so as to use the cost from initial to the current node and the heuristics to identify which node to expand next.

c) Implement the heuristic as part of your A* search algorithm.

Exercise 3.4. Let h1 be an admissible  heuristic, where the lowest value is 0.1 and the highest value is 2.0. Suppose that for any state s:

•  h2 (s) = h1 (s) + 5,

•  h3 (s) = 2h1 (s),

•  h4 (s) = cos(h1 (s) * π), and

•  h5 (s) = h1 (s) * |cos(h1 (s) * π)|         

【四轴飞行器】非线性三自由度四轴飞行器模拟器研究(Matlab代码实现)内容概要:本文围绕非线性三自由度四轴飞行器模拟器的研究展开,重点介绍了基于Matlab的建模与仿真方法。通过对四轴飞行器的动力学特性进行分析,构建了非线性状态空间模型,并实现了姿态与位置的动态模拟。研究涵盖了飞行器运动方程的建立、控制系统设计及数值仿真验证等环节,突出非线性系统的精确建模与仿真优势,有助于深入理解飞行器在复杂工况下的行为特征。此外,文中还提到了多种配套技术如PID控制、状态估计与路径规划等,展示了Matlab在航空航天仿真中的综合应用能力。; 适合人群:具备一定自动控制理论基础和Matlab编程能力的高校学生、科研人员及从事无人机系统开发的工程技术人员,尤其适合研究生及以上层次的研究者。; 使用场景及目标:①用于四轴飞行器控制系统的设计与验证,支持算法快速原型开发;②作为教学工具帮助理解非线性动力学系统建模与仿真过程;③支撑科研项目中对飞行器姿态控制、轨迹跟踪等问题的深入研究; 阅读建议:建议读者结合文中提供的Matlab代码进行实践操作,重点关注动力学建模与控制模块的实现细节,同时可延伸学习文档中提及的PID控制、状态估计等相关技术内容,以全面提升系统仿真与分析能力。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值