Vous êtes sur la page 1sur 11

BLG521E - Lecture 7

Outline
Time,schedulesandresources

BLG521E AdvancedArtificialIntelligence
Lecture7:PlanningandActing intherealworld

HierarchicalTaskNetwork planning Nondeterministicdomains


Conditionalplanning Executionmonitoringandreplanning Continuousplanning

Multiagentplanning

AdvancedArtificialIntelligence(BLG521E)@ITU ::ComputerEngineeringDepartment,Dr.SanemSarelTalay

Time,schedulesandresources
Untilknow:
whatactionstodo

Time,schedulesandresources
Jobshopscheduling:
jobsconsistsofasequenceofactions Actionduration required resources Determineaschedulethatminimizesthetotaltime requiredtocompletealljobs(respectingresource constraints).

IntheReal World:
actions occur at certain moments in time. actionsoccuratcertainmomentsintime. actionshaveabeginningandanend. actionstakeacertainamountoftime.

AdvancedArtificialIntelligence(BLG521E)@ITU ::ComputerEngineeringDepartment,Dr.SanemSarelTalay

AdvancedArtificialIntelligence(BLG521E)@ITU ::ComputerEngineeringDepartment,Dr.SanemSarelTalay

AutomobileAssemblyProblem
Init(Chassis(C1) Chassis(C2) Engine(E1,C1,30) Engine(E1,C2,60) Wheels(W1,C1,30) Wheels(W2,C2,15)) Goal(Done(C1) Done(C2)) Action(AddEngine(e,c,m) PRECOND:Engine(e,c,d) Chassis(c) EngineIn(c) g ( ) ( ) g ( ) EFFECT:EngineIn(c) Duration(d)) Action(AddWheels(w,c) PRECOND:Wheels(w,c,d) Chassis(c) EFFECT:WheelsOn(c) Duration(d)) Action(Inspect(c) PRECOND:EngineIn(c) WheelsOn(c) Chassis(c) EFFECT:Done(c) Duration(10))
AdvancedArtificialIntelligence(BLG521E)@ITU ::ComputerEngineeringDepartment,Dr.SanemSarelTalay

SolutionfoundbyPOP
Slack of 15

critical path iti l th

AdvancedArtificialIntelligence(BLG521E)@ITU ::ComputerEngineeringDepartment,Dr.SanemSarelTalay

BLG521E - Lecture 7

Planningvs.scheduling
Howdoestheproblemdifferfromastandardplanning problem? Whendoesanactionstartandwhendoesitend? Soplanningdurationisalsoconsidered
Duration(d)

ESandLS
Earliestpossible(ES)andlatestpossible(LS)start times. LSES=slackofanaction forallactionsdeterminestheschedulefortheentire p problem.
ES(Start)=0 ES(B)=maxA<B ES(A)+Duration(A) LS(Finish)=ES(Finish) LS(A)=minA<B LS(B)Duration(A)

Criticalpathmethod isusedtodeterminestartandendtimes: Path=linearsequencefromstarttoend Criticalpath=pathwithlongesttotalduration


Determinesthedurationoftheentireplan Criticalpathshouldbeexecutedwithoutdelay

Complexity ofCriticalPathAlgorithm isO(Nb) (given aPO)


AdvancedArtificialIntelligence(BLG521E)@ITU ::ComputerEngineeringDepartment,Dr.SanemSarelTalay

AdvancedArtificialIntelligence(BLG521E)@ITU ::ComputerEngineeringDepartment,Dr.SanemSarelTalay

Schedulingwithresources
Resourceconstraints=requiredmaterialorobjects toperformtask
Reusableresources Aresourcethatisoccupiedduringanactionbutbecomesavailable whentheactionisfinished. Requireextensionofactionsyntax: Resource: R(k)
kunitsofresourcearerequiredbytheaction. Isaprerequisitebeforetheactioncanbeperformed. Resourcecannotbeusedforktimeunitsbyother.

Carexamplewithresources
Init(Chassis(C1) Chassis(C2) Engine(E1,C1,30) Engine(E1,C2,60) Wheels(W1,C1,30) Wheels(W2,C2,15) EngineHoists(1) WheelStations(1) Inspectors(2)) Goal(Done(C1) Done(C2)) Action(AddEngine(e,c,m) PRECOND:Engine(e,c,d) Chassis(c) EngineIn(c) EFFECT:EngineIn(c) Duration(d), RESOURCE:EngineHoists(1)) Action(AddWheels(w,c) Action(AddWheels(w c) PRECOND:Wheels(w,c,d) Chassis(c) EFFECT:WheelsOn(c) Duration(d) RESOURCE:WheelStations(1)) Action(Inspect(c) PRECOND:EngineIn(c) WheelsOn(c) Chassis(c) EFFECT:Done(c) Duration(10) RESOURCE:Inspectors(1)) aggregation

AdvancedArtificialIntelligence(BLG521E)@ITU ::ComputerEngineeringDepartment,Dr.SanemSarelTalay

AdvancedArtificialIntelligence(BLG521E)@ITU ::ComputerEngineeringDepartment,Dr.SanemSarelTalay

Carexamplewithresources

Schedulingwithresources
Aggregation=groupindividualobjectsinto quantitieswhentheobjectsareundistinguishable withrespecttotheirpurpose.
Reducescomplexity

Resourceconstraintsmakeschedulingproblems morecomplicated. more complicated.


Additionalinteractionsamongactions

Heuristic:minimumslackalgorithm
Selectanactionwithallpredecessors scheduledandwiththeleast slackfortheearliestpossiblestart.

AdvancedArtificialIntelligence(BLG521E)@ITU ::ComputerEngineeringDepartment,Dr.SanemSarelTalay

AdvancedArtificialIntelligence(BLG521E)@ITU ::ComputerEngineeringDepartment,Dr.SanemSarelTalay

BLG521E - Lecture 7

Hierarchicaltasknetworkplanning
Reducecomplexity hierarchicaldecomposition Ateachlevelofthehierarchyacomputationaltaskisreducedtoa small numberofactivitiesatthenextlowerlevel Thecomputationalcostofarrangingtheseactivitiesislow Hierarchicaltasknetwork(HTN)planningusesarefinement ofactions throughdecomposition through decomposition e.g.buildingahouse=gettingapermit+hiringacontractor+doing theconstruction+payingthecontractor Refineduntilonlyprimitiveactionsremain PureandhybridHTNplanning ActiondecompositionsareusedasplanrefinementsinPOP

Representationdecomposition
Generaldescriptionsarestoredin a planlibrary
Eachmethod=Decompose(a,d); a=actionandd=POplan.

Startactionsuppliesallpreconditionsofactions, not suppliedbyotheractions.


=externalpreconditions =external preconditions

Finishactionhasalleffectsofactionsnotnegated by otheractions
=externaleffects Primaryeffects(usedtoachievegoal)vs.secondaryeffects

AdvancedArtificialIntelligence(BLG521E)@ITU ::ComputerEngineeringDepartment,Dr.SanemSarelTalay

AdvancedArtificialIntelligence(BLG521E)@ITU ::ComputerEngineeringDepartment,Dr.SanemSarelTalay

Buildhouseexample

Buildhouseexample
Action(Buyland,PRECOND:Money,EFFECT:Land Money) Action(GetLoan,PRECOND:Goodcredit,EFFECT:Money Mortgage) Action(BuildHouse,PRECOND:Land,EFFECT:House) Action(GetPermit,PRECOND:LAnd,EFFECT:Permit) Action(HireBuilder,EFFECT:Contract) Action(Construction,PRECOND:Permit Contract,EFFECT:HouseBuilt Permit), Action(PayBuilder,PRECOND:Money HouseBuilt,EFFECT:Money House Contract), Decompose(BuildHouse, ecompose( uildHouse, Plan::STEPS{S1:GetPermit,S2:HireBuilder,S3:Construction,S4PayBuilder} ORDERINGS:{Start<S1<S3<S4<Finish,Start<S2<S3}, LINKS

External precond

External effects

Start Land S1,Start Money S4,S1 Permit S3,S2 Contract S3, HouseBuilt house Money S3 S4,S4 Finish,S4 Finish

AdvancedArtificialIntelligence(BLG521E)@ITU ::ComputerEngineeringDepartment,Dr.SanemSarelTalay

AdvancedArtificialIntelligence(BLG521E)@ITU ::ComputerEngineeringDepartment,Dr.SanemSarelTalay

Propertiesofdecomposition
Shouldbecorrectimplementationofactiona CorrectifplandiscompleteandconsistentPOplanforthe problemofachievingtheeffectsofa giventhe preconditionsofa Adecompositionisnotnecessarilyunique Performs information hiding: Performsinformationhiding: STRIPSactiondescriptionofhigherlevelactionhidessome preconditionsandeffects Ignoreallinternaleffectsofdecomposition Doesnotspecifytheintervalsinsidetheactivityduring whichpreconditionsandeffectsmusthold InformationhidingisessentialtoHTNplanning.
AdvancedArtificialIntelligence(BLG521E)@ITU ::ComputerEngineeringDepartment,Dr.SanemSarelTalay

RecapitulationofPOP (1) Assumepropositionalplanningproblems:


TheinitialplancontainsStart andFinish,theordering constraintStart<Finish,nocausallinks,allthe preconditionsinFinish areopen. Successorfunction:
picksoneopenpreconditionp onanactionB and generatesasuccessorplanforeverypossibleconsistentwayof choosingactionA thatachievesp.

Testgoal
AdvancedArtificialIntelligence(BLG521E)@ITU ::ComputerEngineeringDepartment,Dr.SanemSarelTalay

BLG521E - Lecture 7

RecapitulationofPOP (2) Whengeneratingsuccessorplan:


ThecausallinkAp>BandtheorderingconstraingA <Bisaddedtotheplan.
IfAisnewalsoaddstart<AandA<Btotheplan

AdaptingPOP toHTNplanning
RememberPOP?
Modifythesuccessorfunction:applydecompositionto currentplan

NEWSuccessorfunction:
SelectnonprimitiveactionainP Se ect o p t e act o a ForanyDecompose(a,d) methodinlibrarywherea anda unifywithsubstitution
Replacea withd=subst(,d)

Resolveconflictsbetweennewcausallinkandall existingactions ResolveconflictsbetweenactionA(ifnew)andall existingcausallinks.

AdvancedArtificialIntelligence(BLG521E)@ITU ::ComputerEngineeringDepartment,Dr.SanemSarelTalay

AdvancedArtificialIntelligence(BLG521E)@ITU ::ComputerEngineeringDepartment,Dr.SanemSarelTalay

POP+HTNexample
a

POP+HTNexample
a

AdvancedArtificialIntelligence(BLG521E)@ITU ::ComputerEngineeringDepartment,Dr.SanemSarelTalay

AdvancedArtificialIntelligence(BLG521E)@ITU ::ComputerEngineeringDepartment,Dr.SanemSarelTalay

Howtohookupd ina ?
Removeactiona fromPandreplacewith d
Foreachstepsind selectanactionthatwillplaytheroleofs (eithernews orexistings fromP) Possibilityofsubtasksharing

WhataboutHTN?
AdditionalmodificationtoPOP arenecessary BADnews:pureHTNplanningisundecidable dueto recursivedecompositionactions.
Walk=makeonestepandwalk

Connectorderingstepsfora tothestepsind
Putallconstraintssothatconstraintsoftheform B<a aremaintained. B < a are maintained Watchoutfortoostrictorderings!

Connectthecausallinks
IfBp>aisacausallinkinP,replaceitbyasetofcausallinksfromBtoallstepsind withpreconditionspthatweresuppliedbythestartstep Dothesameforap>C

Resolveproblemsby
Ruleoutrecursion Boundthelengthofrelevantsolutions HybridizeHTNwithPOP

YetHTNcanbeefficient
AdvancedArtificialIntelligence(BLG521E)@ITU ::ComputerEngineeringDepartment,Dr.SanemSarelTalay AdvancedArtificialIntelligence(BLG521E)@ITU ::ComputerEngineeringDepartment,Dr.SanemSarelTalay

BLG521E - Lecture 7

PlanningandActinginNondeterministicdomains
Sofar:fullyobservable,staticanddeterministicdomains.
Agentcanplanfirstandthenexecuteplanwitheyesclosed

Handlingindeterminacy
Sensorlessplanning(conformantplanning)
Findplanthatachievesgoalinallpossiblecircumstances(regardlessof initialstateandactioneffects).

Uncertainenvironment:incomplete(partiallyobservableand/or nondeterministic)andincorrect(differencesbetweenworldand model)information


Usepercepts Adapt plan when necessary Adaptplanwhennecessary

Conditionalplanning(Contingencyplanning)
Constructconditionalplanwithdifferentbranchesforpossible contingencies.

E Executionmonitoringandreplanning i i i d l i
Whileconstructingplanjudgewhetherplanrequiresrevision.

Degreeofuncertaintydefinedbyindeterminacy
Bounded:actionscanhaveunpredictableeffects,yetcanbelistedinactiondescription axioms.
Whenflippingacoin,outcomeiseitherheadortail

Continuousplanning
Planningactiveforalifetime:adapttochangedcircumstancesand reformulategoalsifnecessary.

Unbounded:preconditionsandeffectsunknownortoo largetoenumerate.
Taxidrivingagent

AdvancedArtificialIntelligence(BLG521E)@ITU ::ComputerEngineeringDepartment,Dr.SanemSarelTalay

AdvancedArtificialIntelligence(BLG521E)@ITU ::ComputerEngineeringDepartment,Dr.SanemSarelTalay

Sensorlessplanning

Anabstractexample
Initialstate=< chair, table,cansofpaint,unknowncolors > goalstate = < color(table)=color(chair) > Classicalplanningagentcouldnothandlethisproblem Sensorless planning(Conformant planning)
Openanycanofpaintandapplyittobothchairandtable. O f i t d l it t b th h i d t bl

Conditionalplanning(Contingencyplanning)
Sensecoloroftableandchair,iftheyarethesamethenfinish; elsesenselabelspaintifcolor(label)= color(Furniture)thenapplycolortotheotherpiece; elseapplycolortoboth

Executionmonitoringandreplanning
Sameasconditionalandcanfixerrors(missedspots)

Continuousplanning
Canrevisegoalwhenwewanttofirsteatbeforepaintingthetableandthechair.

AdvancedArtificialIntelligence(BLG521E)@ITU ::ComputerEngineeringDepartment,Dr.SanemSarelTalay

AdvancedArtificialIntelligence(BLG521E)@ITU ::ComputerEngineeringDepartment,Dr.SanemSarelTalay

Conditionalplanning
Dealwithuncertaintybycheckingthe environmenttoseewhatisreallyhappening. Assume infullyobservableand nondeterministicenvironments: nondeterministic environments:
Theoutcomeofanactionisunknown. Conditionalstepswillcheckthestateoftheenvironment. Howtoconstructaconditionalplan?

Example,thevacuumworld

AdvancedArtificialIntelligence(BLG521E)@ITU ::ComputerEngineeringDepartment,Dr.SanemSarelTalay

AdvancedArtificialIntelligence(BLG521E)@ITU ::ComputerEngineeringDepartment,Dr.SanemSarelTalay

BLG521E - Lecture 7

Conditionalplanning
Actions:left,right,suck Propositionstodefinestates:AtL,AtR,CleanL, CleanR Howtoincludeindeterminism?
Actionscanhavemorethanoneeffect E.g.movingleftsometimesfails Action(Left,PRECOND:AtR,EFFECT:AtL) Becomes:Action(Left,PRECOND:AtR,EFFECT:AtLAtR) Actionscanhaveconditionaleffects Action(Left,PRECOND:AtR,EFFECT:AtL(AtLwhen cleanL: cleanL) Bothdisjunctiveandconditional
AdvancedArtificialIntelligence(BLG521E)@ITU ::ComputerEngineeringDepartment,Dr.SanemSarelTalay

Conditionalplanning
Conditionalplansrequireconditionalsteps:
If<test> thenplan_A elseplan_B if AtLCleanL then Right else Suck Plansbecometrees

G Gamesagainstnature: i
Findconditionalplansthatworkregardlessofwhichactionoutcomes actuallyoccur. Assumevacuumworld Initialstate=AtR CleanL CleanR DoubleMurphy:possibilityofdepositdirtwhenmovingtoother squareandpossibilityofdepositingdirtwhenactionisSuck.

AdvancedArtificialIntelligence(BLG521E)@ITU ::ComputerEngineeringDepartment,Dr.SanemSarelTalay

Gametree
State node

SolutionofGamesagainstNature
Solutionisasubtreethat Hasagoalnodeateveryleaf Specifiesoneactionateachofitsstatenodes Includeseveryoutcomebranchateachofthechance nodes. Inpreviousexample:
[Left,if AtL CleanL CleanR then [ ]else Suck]

chance node

Forexactsolutions:useMinimaxalgorithmwithtwo modifications: MAX andMIN nodesbecomeORandAND nodes Algorithmreturnsconditionalplaninsteadofasingle move


AdvancedArtificialIntelligence(BLG521E)@ITU ::ComputerEngineeringDepartment,Dr.SanemSarelTalay AdvancedArtificialIntelligence(BLG521E)@ITU ::ComputerEngineeringDepartment,Dr.SanemSarelTalay

AndOrSearchalgorithm
function AND-OR-GRAPH-SEARCH(problem) returns a conditional plan or failure return OR-SEARCH(INITIAL-STATE[problem], problem, []) function OR-SEARCH(state, problem, path) returns a conditional plan or failure if GOAL-TEST[problem](state) then return the empty plan if state is on path then return failure for action,state_set in SUCCESSORS[problem](state) do plan AND SEARCH( t t l AND-SEARCH(state_set, problem, [ t t | plan] ) t bl [state l ] if plan failure then return [action | plan] return failure function AND-SEARCH(state_set, problem, path) returns a conditional plan or failure for each si in state_set do plani OR-SEARCH(si, problem,path ) if plan = failure then return failure return [ if s1 then plan1 else if s2 then plan2 else if sn-1 then plann-1 else plann]

AndOrSearch algorithm
Howdoesitdealwithcycles? Whenastatethatalreadyisonthepathappears,return failure
Nononcyclicsolution

Ensuresalgorithmtermination
Thealgorithmdoesnotcheckwhethersomestateisalreadyonsomeotherpathfromtheroot.

AdvancedArtificialIntelligence(BLG521E)@ITU ::ComputerEngineeringDepartment,Dr.SanemSarelTalay

AdvancedArtificialIntelligence(BLG521E)@ITU ::ComputerEngineeringDepartment,Dr.SanemSarelTalay

BLG521E - Lecture 7

AndOrSearch algorithm
Sometimesonlyacyclicsolutionexists e.g.tripplemurphy:sometimesthemoveisnotperformed
[Left,if CleanL then []else Suck]isnotasolution

CPin PartiallyObservableEnvironments
Fullyobservable:conditionaltestscanaskany questionandgetananswer Partiallyobservable
Theagenthaslimitedinformationabouttheenvironment. Modeled by a state set = belief states Modeledbyastateset=beliefstates E.g.assumevacuumagentwhichcannotsensepresenceorabsence ofdirtinothersquaresthantheoneitison. alternativemurphy:dirtcanbeleftbehindwhenmovingtoother square. Solutioninfullyobservableworld:keepmovingleftandright, suckingdirtwheneveritappearsuntilbothsquaresarecleanand Iminsquareleft.

Uselabeltorepeatpartsofplan(butinfiniteloops)
[L1:Left,if AtR then L1 else if CleanL then []else Suck]

AdvancedArtificialIntelligence(BLG521E)@ITU ::ComputerEngineeringDepartment,Dr.SanemSarelTalay

AdvancedArtificialIntelligence(BLG521E)@ITU ::ComputerEngineeringDepartment,Dr.SanemSarelTalay

PO:alternatedoublemurphy

Beliefstates Representation
Setsoffullstatedescriptions
{(AtRCleanRCleanL) (AtRCleanRCleanL)} Exponential

Logicalsentencesthatcapturethesetofpossible worldsinthebeliefstate(OWA)
AtR CleanR

Knowledgepropositionsdescribingtheagents knowledge(CWA)
K(AtR) K(CleanR)

AdvancedArtificialIntelligence(BLG521E)@ITU ::ComputerEngineeringDepartment,Dr.SanemSarelTalay

AdvancedArtificialIntelligence(BLG521E)@ITU ::ComputerEngineeringDepartment,Dr.SanemSarelTalay

Beliefstates
Choice2and3areequivalent(letscontinuewith3) Symbolscanappearinthreeways:positive,negativeor unknown:3n possiblebeliefstatesforn propositionsymbols. YET,setofbeliefsetsisapowersetofthephysicalstates whichismuchlargerthan3n Hence3isrestrictedasrepresentation
AnyschemecapableofrepresentingeverypossiblebeliefstatewillrequireO(2n) bittorepresent eachoneintheworstcase. ThecurrentschemeonlyrequiresO(n)

SensinginConditional Planning
Howdoesitwork?
Automaticsensing
Ateverytimesteptheagentgetsallavailablepercepts

Activesensing
Perceptsareobtainedthroughtheexecutionofspecificsensoryactions. checkDirt andcheckLocation

Giventherepresentationandthesensing, actiondescriptionsare formulated.

AdvancedArtificialIntelligence(BLG521E)@ITU ::ComputerEngineeringDepartment,Dr.SanemSarelTalay

AdvancedArtificialIntelligence(BLG521E)@ITU ::ComputerEngineeringDepartment,Dr.SanemSarelTalay

BLG521E - Lecture 7

Monitoringandreplanning
Executionmonitoring:checkwhether everythingisgoingasplanned.
Unboundedindeterminancy:someunanticipated circumstanceswillarise. Anecessityinrealisticenvironments.

Monitoringandreplanning
Whensomethingunexpectedhappens:replan
Toavoidtoomuchtimeonplanningtrytorepairtheoldplan.

Types ofmonitoring:
Actionmonitoring:verifywhetherthenextactionwill work. Planmonitoring:verifytheentireremainingplan.

Canbeappliedinbothfullyandpartially , y observableenvironments,andtoavarietyof planningrepresentations.

AdvancedArtificialIntelligence(BLG521E)@ITU ::ComputerEngineeringDepartment,Dr.SanemSarelTalay

AdvancedArtificialIntelligence(BLG521E)@ITU ::ComputerEngineeringDepartment,Dr.SanemSarelTalay

Replanningagent
functionREPLANNINGAGENT(percept) returnsanaction static: KB,aknowledgebase(+actiondescriptions) plan,aplaninitially[] whole_plan,aplaninitially[] goal,agoal TELL(KB,MAKEPERCEPTSENTENCE(percept,t)) current STATEDESCRIPTION(KB,t) ifplan =[] whole_plan plan PLANNER(current, goal,KB) ifPRECONDITIONS(FIRST(plan))notcurrentlytrueinKBthen candidates SORT(whole_plan,orderedbydistancetocurrent) findstate s incandidates suchthat failure repair PLANNER(current,s,KB) continuation thetailofwhole_plan startingat s whole_plan plan APPEND(repair,continuation) returnPOP(plan)

Repairexample

AdvancedArtificialIntelligence(BLG521E)@ITU ::ComputerEngineeringDepartment,Dr.SanemSarelTalay

AdvancedArtificialIntelligence(BLG521E)@ITU ::ComputerEngineeringDepartment,Dr.SanemSarelTalay

Repairexample:painting
Init(Color(Chair,Blue)Color(Table,Green) ContainsColor(BC,Blue) PaintCan(BC) ContainsColor(RC,Red) PaintCan(RC)) Goal(Color(Chair,x) Color(Table,x)) Action(Paint(object,color) PRECOND:HavePaint(color) EFFECT:Color(object,color)) Action(Open(can) PRECOND:PaintCan(can) ContainsColor(can,color) EFFECT:HavePaint(color)) [Start;Open(BC);Paint(Table,Blue),Finish]
AdvancedArtificialIntelligence(BLG521E)@ITU ::ComputerEngineeringDepartment,Dr.SanemSarelTalay

Repairexample:painting
Supposethattheagentnowperceivesthatthecolorsoftable andchairaredifferent Figureoutpointinwhole_plan toaimfor
CurrentstateisidenticalasthepreconditionbeforePaint

Repairactionsequencetogetthere.
Repair=[]andplan=[Paint,Finish]

Continue performing this new plan Continueperformingthisnewplan


Willloopuntiltableandchairareperceivedasthesame.

Actionmonitoringcanleadtolessintelligentbehavior Assumetheredisselectedandthereisnotenoughpaint toapplytobothchairandtable. Improvedbydoingplanmonitoring

AdvancedArtificialIntelligence(BLG521E)@ITU ::ComputerEngineeringDepartment,Dr.SanemSarelTalay

BLG521E - Lecture 7

Planmonitoring
Checkthepreconditionsforsuccessoftheentire plan. Exceptthosewhichareachievedbyanotherstepinthe plan. Executionofdoomedplaniscutofearlier. Tradeoff between detection of failure and expensive Tradeoffbetweendetectionoffailureandexpensive monitoring Limitationofreplanningagent: Itcannotformulatenewgoalsoracceptnewgoalsin additiontothecurrentone

Continuousplanning
Agentpersistsindefinitelyinanenvironment
Phasesofgoalformulation,planningandacting

Executionmonitoring+plannerasone continuousprocess ti Example: Blocksworld


Assumeafullyobservableenvironment Assumepartiallyorderedplan

AdvancedArtificialIntelligence(BLG521E)@ITU ::ComputerEngineeringDepartment,Dr.SanemSarelTalay

AdvancedArtificialIntelligence(BLG521E)@ITU ::ComputerEngineeringDepartment,Dr.SanemSarelTalay

Blocks worldexample
Initialstate: (a)
Action(Move(x,y), PRECOND:Clear(x) Clear(y) On(x,z) EFFECT:On(x,y) Clear(z) On(x,z) Clear(y)

Blocks worldexample
Assumethatperceptsdontchangeandthisplanisconstructed OrderingconstraintbetweenMove(D,B) andMove(C,D) Startislabelofcurrentstateduringplanning. Beforetheagentcanexecutetheplan,natureintervenes:
DismovedontoB

Theagentfirstneedtoformulateagoal:On(C,D) On(D,B) On(D B) Planiscreatedincrementally,returnNoOp andcheck percepts

AdvancedArtificialIntelligence(BLG521E)@ITU ::ComputerEngineeringDepartment,Dr.SanemSarelTalay

AdvancedArtificialIntelligence(BLG521E)@ITU ::ComputerEngineeringDepartment,Dr.SanemSarelTalay

Blocks worldexample
StartcontainsnowOn(D,B) Agentperceives:Clear(B) andOn(D,G)arenolongertrue
Updatemodelofcurrentstate(start)

Blocks worldexample
Extending:wheneveracausallinkcanbesuppliedbyaprevious step Allredundantsteps(Move(D,B)andits causallinks)areremoved fromtheplan Executenewplan,performactionMove(C,D)
Thisremovesthestepfromtheplan

CausallinksfromStart toMove(D,B) (Clear(B) andOn(D,G))nolongervalid.


RemovecausalrelationsandtwoPRECONDofMove(D,B) areopen ReplaceactionandcausallinkstoFinish byconnectingStart toFinish.

AdvancedArtificialIntelligence(BLG521E)@ITU ::ComputerEngineeringDepartment,Dr.SanemSarelTalay

AdvancedArtificialIntelligence(BLG521E)@ITU ::ComputerEngineeringDepartment,Dr.SanemSarelTalay

BLG521E - Lecture 7

Blocks worldexample
Executenewplan,performactionMove(C,D)
AssumeagentisclumsyanddropsConA

Blocks worldexample
SimilartoPOP Oneachiterationfindplanflawandfixit Possibleflaws:Missinggoal,Openprecondition,Causalconflict, Unsupportedlink,Redundantaction,Unexecutedaction, unnecessaryhistoricalgoal

NoplanbutstillanopenPRECOND Determinenewplanforopencondition Again Move(C,D)

AdvancedArtificialIntelligence(BLG521E)@ITU ::ComputerEngineeringDepartment,Dr.SanemSarelTalay

AdvancedArtificialIntelligence(BLG521E)@ITU ::ComputerEngineeringDepartment,Dr.SanemSarelTalay

Multiagent planning
Sofarweonlydiscussedsingleagentenvironments. Otheragentscansimplybeaddedtothemodelof theworld:
Poorperformancesinceagentsarenotindifferentof otheragents intentions

Cooperation:Jointgoalsandplans
Multiplanningproblem:assumedoubletennis examplewhereagentswanttoreturnball.
Agents(A,B) Init(At(A,[Left,Baseline]) At(B,[Right,Net]) Approaching(Ball,[Right, Baseline]) Partner(A,B) Partner(B,A)) Goal(Returned(Ball) At(agent,[x,Net])) Goal(Returned(Ball) At(agent [x Net])) Action(Hit(agent,Ball) PRECOND:Approaching(Ball,[x,y]) At(agent,[x,y]) Partner(agent, partner) At(partner,[x,y]) EFFECT:Returned(Ball)) Action(Go(agent,[x,y]) PRECOND:At(agent,[a,b]) EFFECT:At(agent,[x,y]) At(agent,[a,b]))
AdvancedArtificialIntelligence(BLG521E)@ITU ::ComputerEngineeringDepartment,Dr.SanemSarelTalay

Ingeneraltwotypesofmultiagentenvironments:
Cooperative Competitive

AdvancedArtificialIntelligence(BLG521E)@ITU ::ComputerEngineeringDepartment,Dr.SanemSarelTalay

Cooperation:Jointgoalsandplans
Jointgoal:winningthematch Asolutionisajointplan consistingofactionsforbothagents. Plan1:
A:[Go(A,[Right,Baseline]),Hit(A,Ball)] B:[NoOp(B),NoOp(B)]

Multibodyplanning
Planningproblemfacedbyasinglecentralizedagentthatcan dictateactions toeachofseveralphysicalentities.
Hencenottrulymultiagent

Plan2:
A:[Go(A,[Left,net),NoOp(A)] B:[Go(B,[Right,Baseline]),Hit(B,Ball)]

Important:synchronizationofactions Assumeeach actiontakesonetimestepandateachpoint inthejointplantheactionsaresimultaneous Jointactions:


[<Go(A,[Left,Net]),Go(B,[Right,Baseline]>; <NoOp(A),Hit(B,Ball)>]

Coordination isrequiredtoreachsamejointplan PlanningcanbeperformedusingPOP appliedtothesetof allpossiblejointactions.


Sizeofthisset:nactionsmagents> nm
AdvancedArtificialIntelligence(BLG521E)@ITU ::ComputerEngineeringDepartment,Dr.SanemSarelTalay AdvancedArtificialIntelligence(BLG521E)@ITU ::ComputerEngineeringDepartment,Dr.SanemSarelTalay

10

BLG521E - Lecture 7

Multibodyplanning
Alternativetosetofalljointactions:addextra concurrencylinestoactiondescription Concurrentaction
Action(Hit(A,Ball) CONCURRENT:Hit(B,Ball) PRECOND:Approaching(Ball,[x,y]) At(A,[x,y]) EFFECT:Returned(Ball)) EFFECT R t d(B ll))

Multibodyplanning
PlannersimilartoPOP withsomesmallchangesin possibleorderingrelations
Temporalorderingrelations
A<B(before) A=B(concurrent) A B ( before or concurrent) A B(beforeorconcurrent)

Requiredactions(carryingobjectbytwoagents)
Action(Carry(A,cooler,here,there) CONCURRENT:Carry(B,cooler,herethere) PRECOND:)

Concurrentactionsareinstantiated(neworexisting) Prohibitiedconcurrentactions:constraintstoberesolved

AdvancedArtificialIntelligence(BLG521E)@ITU ::ComputerEngineeringDepartment,Dr.SanemSarelTalay

AdvancedArtificialIntelligence(BLG521E)@ITU ::ComputerEngineeringDepartment,Dr.SanemSarelTalay

Coordinationmechanisms
Toensureagreementonjointplan:useconvention. Convention=aconstraintontheselectionofjointplans
sticktoyourcourtoroneplayerstaysatthenet oneplayeralwaysstaysatthenet

Flockingexample
Threerules:
Separation: Steerawayfromneighborswhenyougettooclose Cohesion Steertowards theaveragepositionofneighbors Alignment Steertowards theaverageorientationofneighbors Steer towards the average orientation of neighbors

Conventions which are widely adopted=sociallaws Conventionswhicharewidelyadopted social laws


driveonthepropersideoftheroad

Canbedomainspecificorindependent Couldarisethroughevolutionaryprocess(flockingbehavior).

Flockexhibits emergentbehavior of flyingasapseudorigid body.


http://www.red3d.com/cwr/boids/
AdvancedArtificialIntelligence(BLG521E)@ITU ::ComputerEngineeringDepartment,Dr.SanemSarelTalay

AdvancedArtificialIntelligence(BLG521E)@ITU ::ComputerEngineeringDepartment,Dr.SanemSarelTalay

Coordinationmechanisms
Intheabsenceofconventions:
Communication
e.g. Shout Mine!OrYours!intennisexample

Competitiveenvironments
Agentscanhaveconflictingutilities
e.g.zerosumgameslikechess

Planrecognition

Theagentmust:
Recognizethatthereareotheragents Computesomeoftheotheragentsplans Computehowtheotheragentsinteractwithitsownplan Compute how the other agents interact with its own plan Decideonthebestactioninviewoftheseinteractions.

Th b d Theburdenofarrivingatasuccessfulljointplancan f i i t f ll j i t l beplacedon
Agentdesigner(agentsarereactive,noexplicitmodelsofother agents) Agent(agentsaredeliberative,modelofotheragentsrequired)

Modeloftheotheragents isrequired Nocommitmenttojointactionplan.

AdvancedArtificialIntelligence(BLG521E)@ITU ::ComputerEngineeringDepartment,Dr.SanemSarelTalay

AdvancedArtificialIntelligence(BLG521E)@ITU ::ComputerEngineeringDepartment,Dr.SanemSarelTalay

11

Vous aimerez peut-être aussi