1 / 20

Reactive Approach

Reactive Approach. CIS 488/588 Bruce R. Maxim UM-Dearborn. Reactive. For reactive AI the output is always the same for a given input (deterministic) Its behavior is completely predictable for a specific situation

tyne
Télécharger la présentation

Reactive Approach

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Reactive Approach CIS 488/588 Bruce R. Maxim UM-Dearborn

  2. Reactive • For reactive AI the output is always the same for a given input (deterministic) • Its behavior is completely predictable for a specific situation • Nondeterministic reactive AI would require the addition of memory so that it current action could depend on its state and the current input (and even its last action in this state if you wish)

  3. Planning Basics • Planning is particularly desirable when a problem domain has a well-defined set of operators and easily determined states • Often times accomplishing a task is reduced to asking “which operators can be used?” • It is wise to pick operators that move you closest to your goal

  4. Basics • If there are obstacles the task is modified to become “how do we remove obstacles?” • Result of planning will be a plan in which the task accomplishing every goal has been reduced to a list of primitive operators • Often times planning and executive are interleaved

  5. Problem Reduction • Technique for achieving goals in a problem space by generating and achieving subgoals • When presented with a problem the problem reducer will need to find a plan to solve the problem • Finding a plan might be thought of as being a type of “heuristic search” in which the operators add detail by attaching plans for goals and coordinating steps

  6. Problem Reduction • Coordination involves • Choosing harmonious plans for simultaneous subgoals • Choosing the order of execution for subplans • Good for top-level • Limitation of problem reduction is that it does not always take subplan interactions into account

  7. Algorithm • Initialize graph to starting node • Loop until starting node is solved or until cost exceeds futility • Traverse graph using current best path and keep track of nodes on path not solved or not yet expanded • Pick an unexpanded node • if no successor then assign futility as node value • else add node successors to graph and estimate value of node f(x) = y(x) + h’(x) // h’ is underestimator note: nodes where h'(x) = 0 are solved • Update f'(x) of newly expanded node based on successor values

  8. Problem Reduction • Advantage • Trades the old problem of finding an operator sequence (e.g. a path through states) for the new problem of coordinating operator sequences • Disadvantage • Requires more domain knowledge than heuristic search

  9. Problem Reduction • May require a large number of plans and the plans themselves may be large • Particularly useful if problem space can be represented as an and/or graph • Recall that and/or graphs are useful in answering how and why questions

  10. And/Or Tree Goal: Acquire TV Steal TV Buy TV and Earn Money Get Job

  11. Problem Reduction • Important to make plan finding phase as efficient as possible • How are plans/operators found? • Preconditions • Post conditions • Good candidate for top level program since it combines general plan coordination techniques with library of specific plans

  12. Planning in Games • Plans can be built in a reactive manner • Pathfinding in uneven terrain is best done with planning techniques that search for the best available path • Pathfinding requires a world map and lots of storage • Reactive pathfinding would take longer, might not find the optimal path, but would use far less storage (only local terrain information is needed)

  13. Reactive Substitutes for Planning • There are very few cases in games where planning is necessary • Reactive strategies may appear very complex when used for high level tactical decisions • Obstacle avoidance could be viewed handled reactively as long as the agent avoids getting stuck

  14. Reactive DeterministicGame Techniques • Scripts (small programs used to compute a result given some input parameters • Rule-based systems (collections of if..then rules used to manipulate variables) • Finite-state machines (select next state action based on current input values)

  15. Reactive Advantages for Animats • Embodiment (reactive behaviors based on interpreting local information to select actions) • Learning (many learning techniques are based on acquiring reactive mappings between inputs and behavior)

  16. Architectures • Components are best viewed as black boxes with details of AI unknown to its users • Architectural Styles • Monolithic (single component architecture) • Flat (many components exist in parallel) • Hierarchical (components nested inside one another) • Reducing complexity is the deciding factor used to select an architectural style

  17. Game AI Decomposition • Structural • Splits solution according to the function (movement, weapon handling) of each component • Behavioral • Based on system activities or modes (hunting, fleeing, collecting ammo) different component for each behavior (very appropriate for computer games) • Goal • Create goal trees to assist in decision making

  18. Component Connection TypesAttribution • Independent sum (components connected to different outputs to avoid conflicts) • Combination (outputs from different components blended together to make final result) • Suppression (strong components get priority weak components ignored) • Sequential attribution (arbitration used to ensure output of different components over time – fair scheduling)

  19. Example - 1 • Subsumation • Horizontal, hierarchical layers • Higher layer outputs over ride lower layer outputs • Behavior-based decomposition • Uses flat organization • Output suppression

  20. Example - 2 • Voting system • Set of distributed components connected to a smaller vote counting component • Output with the most votes wins • Uses functional decomposition • Flat organization • Combination used to merge outputs

More Related