intelligent behaviors for simulated entities

69
Intelligent Behaviors for Simulated Entities Presented by: Ryan Houlette Stottler Henke Associates, Inc. [email protected] 617-616-1293 Jeremy Ludwig Stottler Henke Associates, Inc. [email protected] 541-302-0929 I/ITSEC 2006 Tutorial

Upload: kuniko

Post on 09-Feb-2016

30 views

Category:

Documents


4 download

DESCRIPTION

Intelligent Behaviors for Simulated Entities. I/ITSEC 2006 Tutorial. Presented by:Ryan Houlette Stottler Henke Associates, Inc. [email protected] 617-616-1293 Jeremy Ludwig Stottler Henke Associates, Inc. [email protected] 541-302-0929. Outline. - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Intelligent Behaviors for Simulated Entities

Intelligent Behaviors for Simulated Entities

Presented by: Ryan HouletteStottler Henke Associates, [email protected]

Jeremy LudwigStottler Henke Associates, [email protected]

I/ITSEC 2006 Tutorial

Page 2: Intelligent Behaviors for Simulated Entities

2

OutlineDefining “intelligent behavior”Authoring methodologyTechnologies:

• Cognitive architectures• Behavioral approaches• Hybrid approaches

ConclusionQuestions

Page 3: Intelligent Behaviors for Simulated Entities

3

The GoalIntelligent behavior

• a.k.a. entities acting autonomously• generally replacements for humans

– when humans are not available• scheduling issues• location• shortage of necessary expertise• simply not enough people

– when humans are too costly Defining Intelligent

Behavior Authoring Methodology Technologies: Cognitive Architectures Behavioral Approaches Hybrid Approaches Conclusion

Page 4: Intelligent Behaviors for Simulated Entities

4

“Intelligent Behavior”• Pretty vague!• General human-level AI not yet possible

– computationally expensive– knowledge authoring bottleneck

• Must pick your battles– what is most important for your application– what resources are available

Page 5: Intelligent Behaviors for Simulated Entities

5

Decision Factors1

Entity “skill set”FidelityAutonomyScalabilityAuthoring

Page 6: Intelligent Behaviors for Simulated Entities

6

Factor: Entity Skill SetWhat does the entity need to be able to do?

– follow a path– work with a team– perceive its environment– communicate with humans– exhibit emotion/social skills– etc.

Depends on purpose of simulation, type of scenario, echelon of entity

Page 7: Intelligent Behaviors for Simulated Entities

7

Factor: FidelityHow accurate does the entity’s behavior need to

be?– correct execution of a task– correct selection of tasks– correct timing– variability/predictability

Again, depends on purpose of simulation and echelon• training => believability• analysis => correctness

Page 8: Intelligent Behaviors for Simulated Entities

8

Factor: AutonomyHow much direction does the entity need?

– explicitly scripted– tactical objectives– strategic objectives

Behavior reusable across scenariosDynamic behavior => less brittle

Page 9: Intelligent Behaviors for Simulated Entities

9

Factor: ScalabilityHow many entities are needed?

– computational overhead– knowledge/behavior authoring costs

Can be mitigated• aggregating entities• distributing entities

Page 10: Intelligent Behaviors for Simulated Entities

10

Factor: AuthoringWho is authoring the behaviors?

– programmers– knowledge engineers– subject matter experts– end users / soldiers

Training/skills required for authoringQuality of authoring toolsEase of modifying/extending behaviors

Page 11: Intelligent Behaviors for Simulated Entities

11

Choosing an Approach

Also ease of integration with simulation....

Skill SetFidelity

Autonomy

ScalabilityEase of Authoring

Page 12: Intelligent Behaviors for Simulated Entities

12

Agent TechnologiesWide range of possible approachesWill discuss the two extremes

CognitiveArchitectures

BehavioralApproaches

deliberative reactive

EPIC, ACT-R, Soar scriptingFSMs

Page 13: Intelligent Behaviors for Simulated Entities

13

Authoring Methodologies

Simulation

AgentArchitecture

BehaviorModel

Defining Intelligent Behavior

Authoring Methodology Technologies: Cognitive Architectures Behavioral Approaches Hybrid Approaches Conclusion

Page 14: Intelligent Behaviors for Simulated Entities

14

Basic Authoring Procedure

Determinedesired

behavior

Buildbehavior

model

DONEDONE!

Runsimulation

Evaluateentity

behavior

Refine behavior model

Page 15: Intelligent Behaviors for Simulated Entities

15

Iterative AuthoringOften useful to start with limited set of behaviors

• particularly when learning new architecture• depth-first vs. breadth-first

Test early and oftenBuild initial model with revision in mind

• good software design principles apply: modularity, encapsulation, loose coupling

Determining why model behaved incorrectly can be difficult• some tools can help provide insight

Page 16: Intelligent Behaviors for Simulated Entities

16

The Knowledge BottleneckModel builder is not subject matter expertTransferring knowledge is labor-intensive

• For TacAir-Soar, 70-90% of model dev. time

To reduce the bottleneck:• Repurpose existing models• Use SME-friendly modeling tools• Train SMEs in modeling skills

=> Still an unsolved problem

Page 17: Intelligent Behaviors for Simulated Entities

17

The Simulation InterfaceSimulation sets bounds of behavior

• the primitive actions entities can perform• the information about the world that is available to entities

Can be useful to “move interface up”• if simulation interface is too low-level• abstract away simulation details

– in wrapper around agent architecture– in “library” within the behavior model itself

• enables behavior model to be in terms of meaningful units of behavior

Page 18: Intelligent Behaviors for Simulated Entities

18

Cognitive ArchitecturesOverviewEPIC, ACT-R, & SoarExamples of Cognitive ModelsStrengths / Weakness of Cognitive

Architectures

Defining Intelligent Behavior

Authoring Methodology Technologies: Cognitive Architectures Behavioral Approaches Hybrid Approaches Conclusion

Page 19: Intelligent Behaviors for Simulated Entities

19

IntroductionWhat is a cognitive architecture?

• “a broad theory of human cognition based on a wide selection of human experimental data and implemented as a running computer simulation” (Byrne, 2003)

Why cognitive architectures?• Advance psychological theories of cognition• Create accurate simulations of human behavior

Page 20: Intelligent Behaviors for Simulated Entities

20

IntroductionWhat is cognition?Where does psychology fit in?

Page 21: Intelligent Behaviors for Simulated Entities

21

Cognitive Architecture Components

Page 22: Intelligent Behaviors for Simulated Entities

22

A Theory – The Model Human ProcessorSome principles of operation

• Recognize-act cycle• Fitt’s law• Power law of practice• Rationality principle• Problem space principle

(from Card, Moran, & Newell, 1983)

Page 23: Intelligent Behaviors for Simulated Entities

23

ArchitectureDefinition

• “a broad theory of human cognition based on a wide selection of human experimental data and implemented as a running computer simulation” (Byrne, 2003)

Two main components in modeling• Cognitive model programming language• Runtime Interpreter

Page 24: Intelligent Behaviors for Simulated Entities

24

EPIC ArchitectureProcessors

• Cognitive• Perceptual• Motor

Operators• Cognitive• Perceptual• Motor• Knowledge

Representation

(from Kieras, http://www.eecs.umich.edu/ ~kieras/epic.html)

Page 25: Intelligent Behaviors for Simulated Entities

25

Model

ArchitectureRuntime

ArchitectureLanguage

Task Environment

Task Description

Task Strategy

Page 26: Intelligent Behaviors for Simulated Entities

26

Task DescriptionThere are two points on the screen:

A and B. The task is to point to A with the right hand, and

press the “Z” key with the left hand when it is reached.

Then point from A to B with the right hand and press the “Z” key with the left hand.

Finally point back to A again, and press the “Z” key again.

Page 27: Intelligent Behaviors for Simulated Entities

27

Task Environment

A B

Page 28: Intelligent Behaviors for Simulated Entities

28

Task Strategy –EPIC Production Rules

Page 29: Intelligent Behaviors for Simulated Entities

29

EPIC Production Rule(Top_point_AIF( (Step Point AtA)

(Motor Manual Modality Free)(Motor Ocular Modality Free)(Visual ?object Text My_Point_A)

)THEN(

(Send_to_motor Manual Perform Ply Cursor ?object Right)(Delete (Step Point AtA))(Add (Step Click AtA))

))

Page 30: Intelligent Behaviors for Simulated Entities

30

ACT-R and SoarMotivationsFeaturesModels

Page 31: Intelligent Behaviors for Simulated Entities

31

Initial MotivationsACT-R

• Memory • Problem solving

Soar• Learning• Problem solving

Page 32: Intelligent Behaviors for Simulated Entities

32

ACT-R Architecture

(from Bidiu, R., http://actr.psy.cmu.edu/about/)

Page 33: Intelligent Behaviors for Simulated Entities

33

Some ACT-R FeaturesDeclarative memory stored in chunks

• Memory activation• Buffer sizes between modules is one chunk

One rule per cycleLearning

• Memory retrieval, production utilities• New productions, new chunks

Page 34: Intelligent Behaviors for Simulated Entities

34

ACT-R 6.0 IDE

Page 35: Intelligent Behaviors for Simulated Entities

35

Task DescriptionSimple Addition

• 1 + 3 = 4• 2 + 2 = 4

Goal: mimic the performance of four year olds on simple addition tasks

• This is a memory retrieval task, where each number is retreived (e.g. 1 and 3) and then an addition fact is retrieved (1 + 3 = 4)

• The task demonstrates partial matching of declarative memory items, and requires tweaking a number of parameters.

From the ACT-R tutorial, Unit 6

Page 36: Intelligent Behaviors for Simulated Entities

36

ACT-R 6.0 Production Rules(p retrieve-first-number

=goal>isa problemarg1 =onestate nil

==>=goal>state encoding-one+retrieval>isa numbername =one

)

(p encode-first-number=goal>isa problemstate encoding-one=retrieval>isa number

==>=goal>state retrieve-twoarg1 =retrieval

)

Page 37: Intelligent Behaviors for Simulated Entities

37

Some Relevant ACT-R Models• Best, B., Lebiere, C., & Scarpinatto, C. (2002). A model of

synthetic opponents in MOUT training simulations using the ACT-R cognitive architecture. In Proceedings of the Eleventh Conference on Computer Generated Forces and Behavior Representation. Orlando, FL.

• Craig, K., Doyal, J., Brett, B., Lebiere, C., Biefeld, E., & Martin, E. (2002). Development of a hybrid model of tactical fighter pilot behavior using IMPRINT task network model and ACT-R. In Proceedings of the Eleventh Conference on Computer Generated Forces and Behavior Representation. Orlando, FL

Page 38: Intelligent Behaviors for Simulated Entities

38

Soar ArchitectureProblem Space Based

State1Attribute1: Value1

State2Attribute1:Value2

State3Attribute1:Value1

State4Attribute1:Value3

Attribute2: true

Page 39: Intelligent Behaviors for Simulated Entities

39

Some Soar FeaturesProblem space based

• Attribute/value hierarchy (WM) forms the current state• Productions (LTM) transform the current state to achieve

goals by applying operatorsCycle

• Input• Elaborations fired• All possible operators proposed• One selected• Operator applied• Output

Impasses & Learning

Page 40: Intelligent Behaviors for Simulated Entities

40

Soar 8.6.2 IDE

Page 41: Intelligent Behaviors for Simulated Entities

41

Task DescriptionControl the behavior of a Tank on the game board.

• Each tank has a number of sensors (e.g. radar) to find enemies, missiles to launch at enemies, and limited resources

From the Soar Tutorial

Page 42: Intelligent Behaviors for Simulated Entities

42

Propose Movessp {propose*move (state <s> ^name wander ^io.input-link.blocked.forward no)--> (<s> ^operator <o> +) (<o> ^name move ^actions.move.direction forward)}

sp {propose*turn (state <s> ^name wander ^io.input-link.blocked <b>) (<b> ^forward yes ^ { << left right >> <direction> } no)--> (<s> ^operator <o> + =) (<o> ^name turn ^actions <a>) (<a> ^rotate.direction <direction> ^radar.switch on ^radar-power.setting 13)}

sp {propose*turn*backward (state <s> ^name wander ^io.input-link.blocked <b>) (<b> ^forward yes ^left yes ^right yes)--> (<s> ^operator <o> +) (<o> ^name turn ^actions.rotate.direction left)}

Page 43: Intelligent Behaviors for Simulated Entities

43

Prefer Movessp {select*radar-off*move

(state <s> ^name wander^operator <o1> +^operator <o2> +)(<o1> ^name radar-off)(<o2> ^name << turn move >>)

-->(<s> ^operator <o1> > <o2>)

}

Page 44: Intelligent Behaviors for Simulated Entities

44

Apply Movesp {apply*move (state <s> ^operator <o> ^io.output-link <out>) (<o> ^direction <direction> ^name move)--> (<out> ^move.direction <direction>)}

Page 45: Intelligent Behaviors for Simulated Entities

45

Elaborationssp {elaborate*state*missiles*low (state <s> ^name tanksoar ^io.input-link.missiles 0)--> (<s> ^missiles-energy low)}

sp {elaborate*state*energy*low (state <s> ^name tanksoar ^io.input-link.energy <= 200)--> (<s> ^missiles-energy low)}

Page 46: Intelligent Behaviors for Simulated Entities

46

Some Relevant Soar Models• Wray, R.E., Laird, J.E., Nuxoll, A., Stokes, D., Kerfoot, A.

(2005). Synthetic adversaries for urban combat training. AI Magazine, 26(3):82-92.

• Jones, R. M., Laird, J. E., Nielsen, P. E., Coulter, K. J., Kenny, P., & Koss, F. V. (1999). Automated intelligent pilots for combat flight simulation. AI Magazine, 20(1), 27-41.

Page 47: Intelligent Behaviors for Simulated Entities

47

Strengths / Weaknesses of Cognitive Architectures

Strengths• Supports aspects of intelligent behavior, such as learning,

memory, and problem solving, not supported by other types of architectures

• Can be used to accurately model human behavior, especially human-computer interaction, at small grain sizes (measured in ms)

Weaknesses• Can be difficult to author, modify, and debug complicated

sets of production rules– High level modeling languages (e.g. CogTool, Herbal, High

Level Symbolic Representation language)– Automated model generation (e.g. Konik & Laird, 2006)

• Computational issues when scaling to large number of entities

Page 48: Intelligent Behaviors for Simulated Entities

48

Behavioral ApproachesFocus is on externally-observable behavior

• no explicit modeling of knowledge/cognition• instead, behavior is explicitly specified:

“Go to destination X, then attack enemy.”

Often a natural mapping from doctrine to behavior specifications

Defining Intelligent Behavior

Authoring Methodology Technologies: Cognitive Architectures Behavioral Approaches Hybrid Approaches Conclusion

Page 49: Intelligent Behaviors for Simulated Entities

49

Hard-coding BehaviorsSimplest approach is write behavior in C++/Java:

MoveTo(location_X);AcquireTarget(target);FireAt(target);

Don’t do this!• Can only be modified by programmers• Hard to update and extend• Behavior models not easily portable

Page 50: Intelligent Behaviors for Simulated Entities

50

Scripting BehaviorsWrite behaviors in scripting language

– UnrealScript

Avoids many problems of hard-coding• not tightly coupled to simulation code• more portable• often simplified to be easier to learn & use

Fine for linear sequences of actions, but do not scale well to complex behavior

Page 51: Intelligent Behaviors for Simulated Entities

51

Finite State Machine (FSM)Specifies a sequence of decisions and actionsBasic form is essentially a flowchart

X?

Z?

yes

no

yes

Page 52: Intelligent Behaviors for Simulated Entities

52

An FSM ExampleA basic Patrol behavior

• implemented for bots in Counter-Strike• built in SimBionic visual editor

Simulation interface• Primitive actions:

– FollowPath, TurnTo, Shoot, Reload

• Sensory inputs:– AtDestination, Hear, SeeEnemy, OutOfAmmo, IsDead

Page 53: Intelligent Behaviors for Simulated Entities

53

An FSM Example (2)

Page 54: Intelligent Behaviors for Simulated Entities

54

An FSM Example (3)

Page 55: Intelligent Behaviors for Simulated Entities

55

An FSM Example (4)

Page 56: Intelligent Behaviors for Simulated Entities

56

FSMs: AdvantagesVery commonly-used techniqueEasy to implementEfficientIntuitive visual representation

• Accessible to SMEs• Maintainable

Variety of tools available

Page 57: Intelligent Behaviors for Simulated Entities

57

FSMs: DisadvantagesHave difficulty accurately modeling:

• behavior at small grain sizes• human-entity interaction

Lack of planning and learning capabilities=> brittleness (can’t cope with situations unforeseen by the modeler)

Tend to scale ungracefully

Page 58: Intelligent Behaviors for Simulated Entities

58

Hierarchical FSMsAn FSM can delegate to another FSM

• SearchBuilding ClearRoom

Allows modularization of behaviorReduces complexityEncourages reuse of model components

Page 59: Intelligent Behaviors for Simulated Entities

59

Hierarchical FSMs (2)

Page 60: Intelligent Behaviors for Simulated Entities

60

Hierarchical FSMs (3)

Page 61: Intelligent Behaviors for Simulated Entities

61

Hybrid ArchitecturesCombine cognitive approaches

– EASE: Elements of ACT-R, EPIC, & Soar (Chong & Wray, 2005)

Combine behavioral and cognitive approaches– Imprint / ACT-R (Craig, et al., 2002)– SimBionic / Soar

Defining Intelligent Behavior

Authoring Methodology Technologies: Cognitive Architectures Behavioral Approaches Hybrid Approaches Conclusion

Page 62: Intelligent Behaviors for Simulated Entities

62

Hybrid ArchitecturesCombine cognitive & behavioral approaches

Pros:• More scalable• Easier to author• More flexible

Cons:• Architecture is more complex

Cognitive Layer

Behavioral Layer

Simulation

behaviors

goals

actions

Page 63: Intelligent Behaviors for Simulated Entities

63

Hybrid Example: HTN Planner + FSMsHierarchical Task Network (HTN) Planner• Inputs:

• goals• library of plan fragments (HTNs)

• Outputs: • High-level plan achieving those goals

– Each plan step is an FSM in the Behavior Layer

• Not really a cognitive architecture, but adds goal-driven capability to system• Plan fragments represent codified sequences of

behavior

Page 64: Intelligent Behaviors for Simulated Entities

64

ConclusionFactors affecting choice of architecture:

• Entity capabilities• Behavior fidelity• Level of autonomy• Number of entities• Authoring resources

Two main paradigms:• cognitive architectures• behavioral approaches

Page 65: Intelligent Behaviors for Simulated Entities

65

Conclusion (2)Recommend iterative model development

• Build• Test• Refine

Be aware of the knowledge bottleneck

Page 66: Intelligent Behaviors for Simulated Entities

66

ResourcesEPIC

http://www.eecs.umich.edu/~kieras/epic.htmlACT-R

http://act-r.psy.cmu.edu/SOAR

http://sitemaker.umich.edu/soarSimBionic

http://www.simbionic.com/

Page 67: Intelligent Behaviors for Simulated Entities

67

Questions?

Page 68: Intelligent Behaviors for Simulated Entities

68

ReferencesAnderson, J. R., Bothell, D., Byrne, M. D., Douglass,S., Lebiere, C., & Qin, Y. (2004). An integrated theory of

mind. Psychological Review, 111(4), 1036-1060.Card, S. K., Moran, T. P., & Newell, A. (1983). The psychology of human-computer interaction. Hillsdale,

N.J.: L. Erlbaum Associates.Chong, R. S., & Wray, R. E. 2005. Inheriting constraint in hybird cognitive architecutres: Applying the EASE

architecture to perforance and learning in a simplified air traffic control task. In K. A. Gluck & R. W. Pew (Eds.), Modeling Human Behavior with Integrated Cognitive Architectures: Comparison, Evaluation, and Validation (237-304): Lawrence Erlbaum Associates.

Craig, K., Doyal, J., Brett, B., Lebiere, C., Biefeld, E., & Martin, E. A. (2002). Development of a hybrid model of tactical fighter pilot behavior using IMPRINT task network modeling and the adaptive control of thought - rational (ACT-R). Paper presented at the 11th Conference on Computer Generate Forces and Behavior Representation.

Douglass. (2003). Modeling of Cognitive Agents. Retrieved May 22, 2005, from http://actr.psy.cmu.edu/~douglass/Douglass/Agents/15-396.html).

Fu, D., & Houlette, R. (2003). The ultimate guide to FSMs in games. In S. Rabin (Ed.), AI Game Programming Wisdom 2.

Fu, D., Houlette, R., Jensen, R., & Bascara, O. (2003). A Visual, Object-Oriented Approach to Simulation Behavior Authoring. Paper presented at the Industry/Interservice, Training, Simulation & Education Conference.

Gray, W. D., & Altmann, E. M. (1999). Cognitive modeling and human-computer interaction. In W. Karwowski (Ed.), International Encyclopedia of Ergonomics and Human Factors (pp. 387-391). New York: Taylor & Francis, Ltd.

Jones, R. M., Laird, J. E., Nielsen, P. E., Coulter, K. J., Kenny, P., & Koss, F. V. (1999). Automated intelligent pilots for combat flight simulation. AI Magazine, 20(1), 27-41.

Kieras, D. E. (2003). Model-based evaluation. In J. A. Jacko & A. Sears (Eds.), The Human-Computer Interaction Handbook: Fundamentals, Evolving Technologies and Emerging Applications (pp. 1139-1151). Mahway, NJ: Lawrence Erlbaum Associates.

Könik, T., and Laird, J. (2006). Learning Goal Hierarchies from  Structured Observations and Expert Annotations. Machine Learning. In Print

Page 69: Intelligent Behaviors for Simulated Entities

69

References (2)Laird, J. E. (2004). The Soar 8 Tutorial. Retrieved August 16, 2004, from

http://sitemaker.umich.edu/soar/soar_software_downloadsLaird, J. E., & Congden, C. B. (2004). The Soar User's Manual Version 8.5 Edition 1. Retrieved August 16, 2004,

from http://sitemaker.umich.edu/soar/soar_software_downloadsLehman, J. F., Laird, J. E., & Rosenbloom, P. S. (1998). A gentle introduction to SOAR: An architecture for human

cognition. In D. Scarborough & S. Sternberg (Eds.), (2 ed., Vol. 4, pp. 212-249). Cambridge, MA: MIT Press.Pearson, D., & Laird, J. E. (2004). Redux: Example-driven diagrammatic tools for rapid knowledge acquisition.

Paper presented at the Behavior Representation in Modeling and Simulation, Washington, D.C.Pew, R. W., & Mavor, A. S. (1998). Modeling human and organizational behavior : application to military

simulations. Washington, D.C.: National Academy Press. Unit 7: Production Rule Learning. Retrieved October 31, 2004, from http://actr.psy.cmu.edu/tutorials/unit7.htm

Ritter, F. E, Haynes, S. R., Cohen, M., Howes, A., John, B., Best, B., Lebiere, C., Lewis, R. L., St. Amant, R., McBraide, S. P. Urbas, L., Leuchter, S., Vera, A. (2006) High-level behavior representation languages revisited. In Proceedings of ICCM 2006, Seventh International Conference on Cognitive Modeling (Trieste, Italy, April 5-8, 2006)

Wallace, S. A., & Laird, J. E. (2003). Comparing agents and humans using behavioral bounding. Paper presented at the International Joint Conference on Artificial Intelligence.

Wray, R., van Lent, M., Beard, J., & Brobst, P. (2005) “The Design Space of Control Options for AIs in Computer Games.” Paper presented at the International Joint Conference on Artificial Intelligence.

Wray, R. E., van Lent, M., Beard, J., & Brobst, P. 2005. The Design Space of Control Options for AIs in Computer Games. In Proceedings of the International Joint Conference on Artificial Intelligence 2005.