规划提出能达到一定目标的行动序列的任务.ppt_第1页
规划提出能达到一定目标的行动序列的任务.ppt_第2页
规划提出能达到一定目标的行动序列的任务.ppt_第3页
规划提出能达到一定目标的行动序列的任务.ppt_第4页
规划提出能达到一定目标的行动序列的任务.ppt_第5页
已阅读5页,还剩41页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

1、规划,规划:提出能达到一定目标的行动序列的任务 基于搜索的问题智能体 逻辑规划智能体 规划环境 经典的:完全可观察、确定性的、有限的、静态的以及离散的。 非经典:部分可观察或随机,致谢:本讲义部分内容来自Tom Lenaert http:/iridia.ulb.ac.be/tlenaert/teach/slides/AIMA/,主要内容,规划问题 规划问题语言:语法和语义 状态空间搜索规划 前向、后向 利用问题的表示的规划算法 偏序规划 命题逻辑规划 规划方法分析,现实世界问题的困难,假设一个问题智能使用标准的搜索算法 什么样的行动是相关的? 例子:购买“人工智能教材”,假设对于每一个10位数

2、字的ISBN号码都有一个购买行动 遍历搜索vs.后项搜索 如何寻找一个好的启发函数? 例如在线购买4本不同的书,4个步骤共有1040规划 状态耗散的估计:所要买书的剩余数目应是一个好的估计。 Problem-dependent vs. independent:启发函数取未满足的合取式的数目 如何将问题分解? 假设大部分现实世界问题是近似可分解的:需要做些附加工作来合并子规划,Planning language,What is a good language? Expressive enough to describe a wide variety of problems. Restrictiv

3、e enough to allow efficient algorithms to operate on it. Planning algorithm should be able to take advantage of the logical structure of the problem. STRIPS and ADL,General language features,Representation of states Decompose the world in logical conditions and represent a state as a conjunction of

4、positive literals (atomic sentences) Propositional literals: Poor Unknown FO-literals (grounded and function-free): At(Plane1, Melbourne) At(Plane2, Sydney) Closed world assumption: conditions not mentioned are assumed false Representation of goals Partially specified state and represented as a conj

5、unction of positive ground literals A goal is satisfied if the state contains all literals in goal.,General language features (2),Representations of actions Action = PRECOND + EFFECT Action(Fly(p,from, to), PRECOND: At(p,from) Plane(p) Airport(from) Airport(to) EFFECT: AT(p,from) At(p,to) = action s

6、chema (模式) (p, from, to need to be instantiated) Action name and parameter list Precondition (conj. of function-free literals) Effect (conj of function-free literals and P is True and P is false) Add-list vs delete-list in Effect,Language semantics,How do actions affect states? An action is applicab

7、le in any state that satisfies the precondition. For FO action schema applicability involves a substitution for the variables in the PRECOND. Ex: At(P1,JFK) At(P2,SFO) Plane(P1) Plane(P2) Airport(JFK) Airport(SFO) Satisfies : At(p,from) Plane(p) Airport(from) Airport(to) With =p/P1,from/JFK,to/SFO T

8、hus the action is applicable.,Language semantics (2),The result of executing action a in state s is the state s s is same as s except Any positive literal P in the effect of a is added to s Any negative literal P is removed from s Example in previous page: At(P1,SFO) At(P2,SFO) Plane(P1) Plane(P2) A

9、irport(JFK) Airport(SFO) STRIPS assumption: avoids representational frame problem every literal NOT in the effect remains unchanged Solution is a sequence such that inigoal,Expressiveness and extensions,STRIPS is simplified Important limit: function-free literals Allows for propositional representat

10、ion Function symbols lead to infinitely many states and actions Recent extension:Action Description language (ADL) Action(Fly(p:Plane, from: Airport, to: Airport), PRECOND: At(p,from) (from to) EFFECT: At(p,from) At(p,to) Standardization : Planning domain definition language (PDDL),例子:积木世界,一组放在桌子上的立

11、方体积木,积木能够被叠放,但是只有一块积木能够直接放在另一块的上面。一个机器臂能够拿起一块积木并把它移到别的位置,无论是在桌子上还是在另一块积木上。机器臂每次只能拿起一块积木。,Examples of planning in Blocks World,Init(On(A, Table) On(B,Table) On(C,Table) Block(A) Block(B) Block(C) Clear(A) Clear(B) Clear(C) Goal(On(A,B) On(B,C) Clear(b) defined as “there is a clear space on b to hold

12、a block” Action(Move(b,x,y) PRECOND: On(b,x) Clear(b) Clear(y) Block(b) (b x) (b y) (x y) EFFECT: On(b,y) Clear(x) On(b,x) Clear(y) Action(MoveToTable(b,x) PRECOND: On(b,x) Clear(b) Block(b) (b x) EFFECT: On(b,Table) Clear(x) On(b,x) Note: we introduce x y to block spurious actions such as Move(B,C,

13、C),注意负文字,主要内容,规划问题 规划问题语言:语法和语义 状态空间搜索规划 前向、后向 利用问题的表示的规划算法 偏序规划 命题逻辑规划 规划方法分析,状态空间搜索规划,前向搜索 后向搜索 启发式函数,Planning with state-space search,Both forward and backward search possible Progression planners forward state-space search Consider the effect of all possible actions in a given state Regression p

14、lanners backward state-space search To achieve a goal, what must have been true in the previous state?,Progression and regression,Progression algorithm,Formulation as state-space search problem: Initial state = initial state of the planning problem Literals not appearing are false Actions = those wh

15、ose preconditions are satisfied Add positive effects, delete negative Goal test = does the state satisfy the goal? Step cost = each action costs 1 No functions any graph search that is complete is a complete planning algorithm. Inefficient: (1) irrelevant action problem (2) good heuristic required f

16、or efficient search,Regression algorithm,How to determine predecessors? What are the states from which applying a given action leads to the goal? Goal state = At(C1, B) At(C2, B) At(C20, B) Relevant action for first conjunct: Unload(C1,p,B) Works only if pre-conditions are satisfied. Previous state=

17、 In(C1, p) At(p, B) At(C2, B) At(C20, B) Subgoal At(C1,B) should not be present in this state. Actions must not undo desired literals (consistent) Main advantage: only relevant actions are considered. Often much lower branching factor than forward search.,Regression algorithm(2),General process for

18、predecessor construction Give a goal description G Let A be an action that is relevant and consistent The predecessors is as follows: Any positive effects of A that appear in G are deleted. Each precondition literal of A is added , unless it already appears. Any standard search algorithm can be adde

19、d to perform the search. Termination when predecessor satisfied by initial state. In FO case, satisfaction might require a substitution.,Heuristics for state-space search,Neither progression or regression are very efficient without a good heuristic. How many actions are needed to achieve the goal? E

20、xact solution is NP hard, find a good estimate Two approaches to find admissible heuristic: The optimal solution to the relaxed problem. Remove all preconditions from actions The subgoal independence assumption: The cost of solving a conjunction of subgoals is approximated by the sum of the costs of

21、 solving the subproblems independently.,主要内容,规划问题 规划问题语言:语法和语义 状态空间搜索规划 前向、后向 利用问题的表示的规划算法 偏序规划 命题逻辑规划 规划方法分析,Partial-order planning,Progression and regression planning are totally ordered plan search forms. They cannot take advantage of problem decomposition. Decisions must be made on how to sequen

22、ce actions on all the subproblems Least commitment strategy: Delay choice during search Start from “obvious” and “important” decisions,Shoe example,Goal(RightShoeOn LeftShoeOn) Init() Action(RightShoe,PRECOND: RightSockOn EFFECT: RightShoeOn) Action(RightSock,PRECOND: EFFECT: RightSockOn) Action(Lef

23、tShoe,PRECOND: LeftSockOn EFFECT: LeftShoeOn) Action(LeftSock,PRECOND: EFFECT: LeftSockOn) Planner: process two action sequences (1)leftsock, leftshoe (2)rightsock, rightshoe independently and combine them together,partial order planning,Partial-order planning,Any planning algorithm that can place t

24、wo actions into a plan without which comes first is a POL.,POL as a search problem,States are (mostly unfinished) plans. The empty plan contains only start and finish actions. Each plan has 4 components: A set of actions (steps of the plan) A set of ordering constraints: A B Cycles represent contrad

25、ictions. A set of causal links The plan may not be extended by adding a new action C that conflicts with the causal link. (if the effect of C is p and if C could come after A and before B) A set of open preconditions. If precondition is not achieved by action in the plan.,POL as a search problem (2)

26、,A plan is consistent iff there are no cycles in the ordering constraints and no conflicts with the causal links. A consistent plan with no open preconditions is a solution. A partial order plan is executed by repeatedly choosing any of the possible next actions. This flexibility is a benefit in non

27、-cooperative environments Also make it easy for merging small plannings into a large planning,Solving POL,Assume propositional planning problems: The initial plan contains Start and Finish, the ordering constraint Start Finish, no causal links, all the preconditions in Finish are open. Successor fun

28、ction : picks one open precondition p on an action B and generates a successor plan for every possible consistent way of choosing action A that achieves p. Test goal, also check if the set of open conditions is empty.,Enforcing consistency,When generating successor plan: The causal link A-p-B and th

29、e ordering constraing A B is added to the plan. If A is new also add start A and A B to the plan Resolve conflicts between new causal link and all existing actions Resolve conflicts between action A (if new) and all existing causal links.,Process summary,Operators on partial plans Add link from exis

30、ting plan to open precondition. Add a step to fulfill an open condition. Order one step w.r.t another to remove possible conflicts Gradually move from incomplete/vague plans to complete/correct plans Backtrack if an open condition is unachievable or if a conflict is unresolvable.,Example: Spare tire

31、 problem,Init(At(Flat, Axle) At(Spare,trunk) Goal(At(Spare,Axle) Action(Remove(Spare,Trunk) PRECOND: At(Spare,Trunk) EFFECT: At(Spare,Trunk) At(Spare,Ground) Action(Remove(Flat,Axle) PRECOND: At(Flat,Axle) EFFECT: At(Flat,Axle) At(Flat,Ground) Action(PutOn(Spare,Axle) PRECOND: At(Spare,Groundp) At(F

32、lat,Axle) EFFECT: At(Spare,Axle) Ar(Spare,Ground) Action(LeaveOvernight PRECOND: EFFECT: At(Spare,Ground) At(Spare,Axle) At(Spare,trunk) At(Flat,Ground) At(Flat,Axle) ),Solving the problem,Intial plan: Start with EFFECTS and Finish with PRECOND.,Solving the problem,Intial plan: Start with EFFECTS an

33、d Finish with PRECOND. Pick an open precondition: At(Spare, Axle) Only PutOn(Spare, Axle) is applicable Add causal link: Add constraint : PutOn(Spare, Axle) Finish,Solving the problem,Pick an open precondition: At(Spare, Ground) Only Remove(Spare, Trunk) is applicable Add causal link: Add constraint

34、 : Remove(Spare, Trunk) PutOn(Spare,Axle),Solving the problem,Pick an open precondition: At(Spare, Axle) LeaveOverNight is applicable conflict: To resolve, add constraint : LeaveOverNight Remove(Spare, Trunk) Add causal link:,Solving the problem,Pick an open precondition: At(Spare, Trunk) Only Start

35、 is applicable Add causal link: Conflict: of causal link with effect At(Spare,Trunk) in LeaveOverNight No re-ordering solution possible. backtrack,Solving the problem,Remove LeaveOverNight and its causal links Again choose an applicable action for At(Spare, Axle): RemoveFlatAxle is chosen Add casual

36、 link Add constraint StartRemoveFlatAxle Check consistency and Ok Choose Start to obtain the precondition of RemoveFlatAxle Finish,Some details ,What happens when a first-order representation that includes variables is used? Complicates the process of detecting and resolving conflicts. Can be resolv

37、ed by introducing inequality constrainst. CSPs most-constrained-variable constraint can be used for planning algorithms to select a PRECOND.,HW,11.4,Planning with propositional logic,Planning can be done by proving theorem in situation calculus. Here: test the satisfiability of a logical sentence: S

38、entence contains propositions for every action occurrence. A model will assign true to the actions that are part of the correct plan and false to the others An assignment that corresponds to an incorrect plan will not be a model because of inconsistency with the assertion that the goal is true. If t

39、he planning is unsolvable the sentence will be unsatisfiable.,SATPLAN algorithm,function SATPLAN(problem, Tmax) return solution or failure inputs: problem, a planning problem Tmax, an upper limit to the plan length for T= 0 to Tmax do cnf, mapping TRANSLATE-TO_SAT(problem, T) assignment SAT-SOLVER(c

40、nf) if assignment is not null then return EXTRACT-SOLUTION(assignment, mapping) return failure,cnf, mapping TRANSLATE-TO_SAT(problem, T),Distinct propositions for assertions about each time step. Superscripts denote the time step At(P1,SFO)0 At(P2,JFK)0 No CWA thus specify which propositions are not

41、 true At(P1,JFK)0 At(P2,SFO)0 Unknown propositions are left unspecified. The goal is associated with a particular time-step But which one?,cnf, mapping TRANSLATE-TO_SAT(problem, T),How to determine the time step where the goal will be reached? Start at T=0 Assert At(P1,SFO)0 At(P2,JFK)0 Failure . Tr

42、y T=1 Assert At(P1,SFO)1 At(P2,JFK)1 Repeat this until some minimal path length is reached. Termination is ensured by Tmax,cnf, mapping TRANSLATE-TO_SAT(problem, T),How to encode actions into PL? Propositional versions of successor-state axioms At(P1,JFK)1 (At(P1,JFK)0 (Fly(P1,JFK,SFO)0 At(P1,JFK)0) (Fly(P

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论