Lectures TDDD10 AI Programming

advertisement
Lectures
AIProgramming:Introduction
IntroductiontoRoboRescue
3
AgentsandAgentsArchitecture
4
Multi-AgentandCommunication
5
Multi-AgentDecisionMaking
6
CooperationAndCoordination1
7
CooperationAndCoordination2
8
MachineLearning
9
AutomatedPlanning
10
PuttingItAllTogether
1
2
TDDD10AIProgramming
AutomatedPlanning
CyrilleBerger
Slidesborrowed
fromDanaNau:
2/34
http://www.cs.umd.edu/~nau/planning/slides/
Lecturecontent
Whatisplanning?
Typeofplanners
Domain-dependentplanners
Configurableplanners
Summary
Whatisplanning?
3/34
DictionaryDefinitionsof“Plan”
Ascheme,program,ormethodworkedout
beforehandfortheaccomplishmentofan
objective:aplanofattack.
2
Aproposedortentativeprojectorcourseofaction:
hadnoplansfortheevening.
3
Asystematicarrangementofelementsor
importantparts;aconfigurationoroutline:a
seatingplan;theplanofastory.
4
Adrawingordiagrammadetoscaleshowing
thestructureorarrangementofsomething.
5
Aprogramorpolicystipulatingaserviceor
benefit:apensionplan.
1
AIDefinitionofPlan
[arepresentation]offuturebehavior(...)
usuallyasetofactions,withtemporaland
otherconstraintsonthem,forexecution
bysomeagentoragents.
–AustinTate,MITEncyclopediaofthe
CognitiveSciences,1999
5/34
Statetransitionsystem
Realworldisabsurdlycomplex,needto
approximate
6/34
Example
statesS={s₀,…,s₅}
A={move1,move2,
put,take,load,
unload}
E=∅
ɣ:S×A→S:defined
ontherightside
Onlyrepresentwhattheplannerneedstoreason
about
StatetransitionsystemΣ=(S,A,E,ɣ)
S={abstractstates}
e.g.,statesmightincludearobot’slocation,butnotits
positionandorientation
A={abstractactions}
e.g.,“moverobotfromloc2toloc1”mayneed
complexlower-levelimplementation
E={abstractexogenousevents}
Notundertheagent’scontrol
ɣ=statetransitionfunction
Givesthenextstate,orpossiblenextstates,afteran
actionorevent
ɣ:S×(A∪E)→Sorɣ:S×(A∪E)→{S₁,...Sₙ}
7/34
8/34
Fromplantoexecution
Planningproblem
DescriptionofΣ
=(S,A,E,ɣ)
Initialstateorset
ofstates
Objective
Goalstate,setofgoalstates,
setoftasks,“trajectory”of
states,objectivefunction,…
Example:
Initialstate=s₀
Goalstate=s₅
9/34
10/34
PlanningandScheduling
Plan
Classicalplan:a
sequenceofactions:
Scheduling
Decidewhenandhowto
performagivensetofactions
⟨take,move1,load,move2⟩
TimeandResourceconstraintsandpriorities
i.e.theschedulerofyourkernel
Policy:partialfunction
fromSintoA
NP-Complete
Planning
{(s₀,take),(s₁,move1),(s₃,load),
(s₄,move2)}
{(s₀,move1),(s₂,take),(s₃,load),
(s₄,move2)}
Decidewhatactionstouseto
achievesomesetofobjectives
CanbemuchworsethanNPcomplete;worstcaseis
undecidable
Both,ifexecuted
startingats,produces₅
11/34
12/34
Applications
Robotics
Sequenceofactions
Pathandmotionplanning
Industrialapplications
Printer
Typeofplanners
Productionmachines:sheet-metalbending
Forestfirefighting
Packagesdelivery
Games:playingbridge,chess...
...
13/34
Domain‐SpecificPlanners
Typeofplanners
Domain-specific
Madeortunedforaspecificplanningdomain
Won’tworkwell(ifatall)inotherplanningdomains
Domain-independent
Mostsuccessfulreal-worldplanningsystems
workthisway:
Marsexploration,sheet-metalbending,playingbridge,etc.
Inprinciple,worksinanyplanningdomain
Inpractice,needrestrictionsonwhatkindofplanning
domain
3.Configurable
Domain-independentplanningengine
Inputincludesinfoabouthowtosolveproblemsinsome
domain
15/34
Oftenuseproblem-specifictechniquesthatare
difficulttogeneralizetootherplanningdomains
16/34
Domain-IndependentPlanners
Inprinciple,worksinanyplanning
Nodomain-specificknowledgeexceptthedescriptionof
thesystemΣ
In
Notfeasibletomakedomain-independentplanners
workwellinallpossibleplanningdomains
Makesimplifyingassumptionstorestrict
thesetofdomains
Classicalplanning
Historicalfocusofmostresearchonautomatedplanning
RestrictiveAssumptions
A0:Finitesystem:finitelymanystates,actions,events
A1:Fullyobservable:thecontrolleralwaysΣ’scurrentstate
A2:Deterministic:eachactionhasonlyoneoutcome
A3:Static(noexogenousevents):nochangesbutthe
controller’sactions
A4:Attainmentgoals:asetofgoalstatesSg
A5:Sequentialplans:aplanisalinearlyorderedsequence
ofactions(a1,a2,...an)
A6:Implicittime:notimedurations;linearsequenceof
instantaneousstates
A7:Off-lineplanning:plannerdoesn’tknowtheexecution
status
17/34
18/34
ClassicalPlanning
Classicalplanningrequiresalleightrestrictive
assumptions
Domain-dependentplanners
Offlinegenerationofactionsequencesforadeterministic,
static,finitesystem,withcompleteknowledge,attainment
goals,andimplicittime
Reducestothefollowingproblem:
GivenaplanningproblemP=(Σ,s0,
Findasequenceofactions(a1,a2,...an)thatproducesa
sequenceofstatetransitions(s1,s2,...,sn)suchthatsnisinSg.
Thisisjustpath-searchinginagraph
Nodes=
Edges=
Isthistrivial?
20/34
ClassingPlanning
Plan‐SpacePlanning
Decomposesetsofgoalsinto
theindividualgoals
Planforthem
Generalizetheearlier
5locations,
3robotvehicles,
100containers,
3palletstostackcontainerson
Thisisprobablyjustasingleboat...
Bookkeepinginfotodetectandresolve
interactions
Produceapartiallyorderedplan
thatretainsasmuchflexibility
aspossible
TheMarsroversuseda
temporal-planningextensionof
Thenthereare10²⁷⁷states
Numberofparticlesintheuniverseisonlyabout10⁸⁷
Theexampleismorethan10¹⁹⁰timesaslarge
Automated-planningresearchhasbeen
heavilydominatedbyclassicalplanning
Dozens(hundreds?)ofdifferentalgorithms
21/34
PlanningGraphs
22/34
HeuristicSearch
HeuristicfunctionlikethoseinA*
Createdusingtechniquessimilartoplanning
Problem:A*quicklyrunsoutofmemory
Sodoagreedysearch
Greedysearchcangettrappedinlocal
minima
Roughidea:
Greedysearchpluslocalsearchatlocal
First,solvearelaxedproblem
Each“level”containsalleffectsofallapplicable
Eventhoughtheeffectsmaycontradicteach
HSP[Bonet&Geffner]
FastForward[Hoffmann]
Next,doastate-spacesearchwithintheplanninggraph
Graphplan,IPP,CGP,DGP,LGP,PGP,SGP,TGP,
23/34
24/34
Configurableplanners
Inanyfixedplanningdomain,adomain-independentplanner
usuallywillnotworkaswellasadomain-specificplannermade
specificallyforthatdomain
Configurableplanners
Adomain-specificplannermaybeabletogodirectlytowardasolutionin
situationswhereadomain-independentplannerwouldexploremayalternative
paths
Butwedon’twanttowriteawholenewplannerforevery
domain
Configurableplanners
Domain-independentplanningengine
Inputincludesinfoabouthowtosolveproblemsinthedomain
Generallythismeansonecanwriteaplanningenginewithfewer
restrictionsthandomain-independentplanners
HierarchicalTaskNetwork(HTN)planning
Planningwithcontrolformulas
26/34
PlanningwithControlFormulas
HTNPlanning(1/2)
Problem
Tasks(activities)ratherthangoals
Methodstodecomposetasksintosubtasks
Ateachstates,wehaveacontrolformulawrittenintemporal
e.g.,“neverpickupxunlessxneedstogoontopofsomethingelse”
Foreachsuccessorofs,deriveacontrolformulausing
logicalprogression
Pruneanysuccessorstateinwhichtheprogressedformulais
TLPlan,TALplanner,
27/34
Enforceconstraints,backtrackifnecessary
E.g.,taxinotgoodforlongdistances
Real-world
Noah,Nonlin,O-Plan,SIPE,SIPE-2,SHOP,
28/34
HTNPlanning(2/2)
ForwardandBackwardSearch
Instate-spaceplanning,mustchoose
whethertosearchforwardorbackward
InHTNplanning,therearetwochoicesto
makeaboutdirection:
forwardorbackward
upordown
29/34
LimitationofOrdered-TaskPlanning
30/34
Planninginanuncertainworld
Untilnow,wehaveassumedthat
eachactionhasonlyonepossible
outcome
Problemoftotalorder
Butoftenthat’sunrealistic
Inmanysituations,actionsmayhave
morethanonepossibleoutcome
Actionfailures
e.g.,gripperdropsitsload
Exogenousevents
e.g.,roadclosed
Thiscouldbenicer
Wouldliketobeabletoplaninsuch
situations
Oneapproach:MarkovDecision
Processes
Solvedwithpartialordermethod
31/34
32/34
Summary
Summary
Domain-specificplanner
Writeanentirecomputerprogram-lotsof
Lotsofdomain-specificperformance
Domain-independentplanner
Justgiveitthebasicactions-notmuch
Notvery
34/34
Download