÷ƒ’À;è TeX output 1998.01.28:1946‹ÿÿÿÿ “ºâ ýxºâïcolor push Blackïhtml:ï html:ŸüfdŽŽŽ’Ôï color popŽŽ ^ºâ ýÆïhtml:ï html:ŸIyóÓߌ˜¼j ptmb7t½ActiÊìvity‘/LibraryŽŸ©^ïhtml:ï html:ŸÇÉ‘0„¤ŽŽŸ ïhtml:ï html:¤ ïhtml:ï html:Ÿ‘0óÓߌ˜ ptmb7t¿Documentation–and“Implementation“StatusŽŸ ¤Sïhtml:ï html:ŸŽà‘0„¤ŽŽ©G®ïhtml:ï html:Ÿd”óÓߌ˜G® ptmb7tÀOv•ÓÅer“viewŽŸ_ó3{Ù ptmr7t¼The–x‚actiÀvity“library“is“responsible“for“scheduling“actions“to“occur“within“a“simulated“wægorld,‘¶¡and“for“making“theseŽ¡actions–WÄactually“happen“at“the“right“time“in“the“right“order‘ÿs8.‘ åIt“proÙ vides“the“foundation“of“dynamic,‘µobject-orientedŽ¡simulation–€within“Swægarm.ŽŸ |éïhtml:ï html:Ÿ ‰v‘0óßêï html:Ÿ‘0„¤ŽŽ¦ïhtml:ï html:Ÿd”ÀDocumentationޤ_¼The–€actišÀvity“library“follo˜ws“the“Swægarm“ïhtml:ï html:¾library–?ýinterface“conventionsïhtml:ï html:Ž¡(defobj/library.html)ޤ ¨*¼and–€has“the“folloÀwing“standard“sections“of“documentation:ŽŸ*8ïhtml:ï html:Ÿ ïhtml:ï html:©ïhtml:ï html:Ÿ }ò‘0ïcolor push Blackó\ùð pzdrÁlï color popŽŽ‘:ïhtml:ï html:¾Usage‘?ýGuideïhtml:ï html:Ž¡‘0(activity/guide.html)ŽŸ8äïhtml:ï html:Ÿ oF‘0ïcolor push BlackÁlï color popŽŽ‘:ïhtml:ï html:¾Advanced–?ýUsage“Guideïhtml:ï html:Ž¡‘0(activity/adv.html)ŽŸ 8äïhtml:ï html:¦ïhtml:ï html:© oF‘0ïcolor push BlackÁlï color popŽŽ‘:ïhtml:ï html:¾Interface‘?ýReferenceïhtml:ï html:Ž¡‘0(activity/ref.html)ŽŸ8äïhtml:ï html:¦‘0ïcolor push BlackÁlï color popŽŽ‘:ïhtml:ï html:¾Subclassing‘?ýReferenceïhtml:ï html:Ž¡‘0(activity/subclass.html)ŽŸ 8äïhtml:ï html:Ÿïhtml:ï html:¦‘0ïcolor push BlackÁlï color popŽŽ‘:ïhtml:ï html:¾Interface–?ýDesign“Notesïhtml:ï html:ŽŽŸ*ºâïcolor push Black’Ôï color popŽŽŒ‹* “ºâ ýxºâïcolor push Blackïhtml:ï html:ŸüfdŽŽŽ’Ôï color popŽŽ ^ ýБ/ºâ¾(activity/design.html)Žºâ©8äïhtml:ï html:Ÿ Ç‘0ïcolor push BlackÁlï color popŽŽ‘:ïhtml:ï html:¾Implementation‘?ýNotesïhtml:ï html:ޤ ‘0(activity/impl.html)ŽŸ‘0„¤ŽŽŸ ïhtml:ï html:¡‘0óßêï html:‘¼rïhtml:ï html:Ž¡‘0(mailto:mgd@santafe.edu)ަïhtml:ï html:Ÿ Ç‘0¾Last‘?ýmodified:‘ ú1998-01-08ŽŽŸ*ºâïcolor push Black’Ôï color popŽŽŒ‹ W “ºâ ýxºâïcolor push Blackïhtml:ï html:ŸüfdŽŽŽ’Ôï color popŽŽ ^ºâ ýÆïhtml:ï html:Ÿ çåÀActiÓÅvity–QëLibrary:‘[UDocumentation“and“Implementation“StatusŽŸ^5‘0„¤ŽŽŸ ïhtml:ï html:¤ ‘0¾The–?ýactivity“library“is“in“process“of“being“converted“to“draw“even“more“of“its“supportŽ¡‘0from–?ýunderlying“types“and“classes“in“the“defobj“and“collections“libraries.‘ úThe“basicŽ¡‘0interface–?ýhas“already“been“changed“to“reflect“this“consolidation,“so“the“programmingŽ¡‘0interface–?ýfor“currently“available“function“is“expected“to“remain“stable.Ž©8äïhtml:ï html:Ÿ Ç‘0The–?ýactivity“library“follows“the“documentation“structure“of“the“Swarm“ïhtml:ï html:library“interfaceŽ¡‘0conventionsïhtml:ï html:Ž¡‘0(../defobj/library.html)Ž¡‘0.‘ úThere–?ýare“placeholders“for“each“section“of“documentation“so“that“all“links“shouldŽ¡‘0at–?ýleast“link“up“with“something,“whether“or“not“there's“anything“there.‘ úThe“InterfaceŽ¡‘0Reference–?ýsection“is“already“fairly“complete,“and“there“is“a“start“toward“a“more“completeŽ¡‘0Usage–?ýGuide“section.‘ úThe“Advanced“Usage“Guide“and“other“sections“will“come“at“a“laterŽ¡‘0time.ŽŸïhtml:ï html:¡‘0Throughout–?ýthe“documentation,“a“parenthesized“comment“that“starts“with“(..‘ úindicatesŽ¡‘0an–?ýeditorial“comment“on“the“current“status“of“implementation“or“documentation.‘ úInŽ¡‘0this–?ýversion,“however,“an“attempt“has“been“made“to“remove“all“discussion“of“futureŽ¡‘0capabilities–?ýand“to“document“instead“only“the“capability“that“is“already“there.ަïhtml:ï html:Ÿ Ç‘0Source–?ýfor“code“examples“in“the“Usage“Guide“is“included“in“the“text“where“it“occurs.Ž¡‘0Source–?ýconsists“of“fragments“taken“from“example“programs.‘ úThe“example“programs“themselvesŽ¡‘0may–?ýbe“downloaded“from“the“web“pages“and“compiled“on“your“own“system,“using“linksŽ¡‘0provided–?ýfor“that“purpose.– ú(..“currently–?ýthere“are“no“code“examples“in“the“UsageŽ¡‘0Guide,–?ýwhich“so“far“is“only“a“general“overview“of“the“activity“library“..)ަïhtml:ï html:Ÿ Ç‘0There–?ýis“also“a“directory“of“test“programs“(ïhtml:ï html:GridTurtle“test“programsïhtml:ï html:Ž¡‘0(../grid.html)Ž¡‘0,–?ýcontained“within“the“documentation“release“directory)“that“provides“additional“codeŽ¡‘0examples–?ýof“many“basic“features“of“the“defobj,“collections,“and“activity“libraries.Ž¡‘0These–?ýcode“examples“are“very“rough“and“subject“to“change,“however,“since“their“mainŽ¡‘0use–?ýis“with“each“new“release“of“the“libraries“to“test“various“new“or“existing“features.Ž¡‘0They–?ýare“sometimes“the“only“source,“however,“for“examples“of“some“library“featuresŽ¡‘0that–?ýhave“not“yet“been“used“anywhere“else.ަïhtml:ï html:ŸÇ‘0„¤ŽŽŸ ïhtml:ï html:¡‘0ÂMarcus–?ýG.“Daniels“ïhtml:ï html:‘¼rïhtml:ï html:Ž¡‘0(mailto:mgd@santafe.edu)ަïhtml:ï html:Ÿ Ç‘0¾Last‘?ýmodified:‘ ú1998-01-08ŽŽŸ*ºâïcolor push Black’Ôï color popŽŽŒ‹1 “ºâ ýxºâïcolor push Blackïhtml:ï html:ŸüfdŽŽŽ’Ôï color popŽŽ ^ºâ ýÆïhtml:ï html:ŸIy½ActiÊìvity–/Library:‘m™Usage“GuideŽŸ©^ïhtml:ï html:Ÿ‡‘0¾(..› úThis–?ýis“an“overview“of“activity“library“function.˜Code“examples“needed“by“aޤ ‘0full–?ýusage“guide“will“follow“later.)Ž©8äïhtml:ï html:ŸÇ‘0„¤ŽŽŸffïhtml:ï html:ŸdóÓߌ˜ff ptmb7tÃRole–™™of“the“actiÛ$vity“library“in“SwarmŽŸc¾The–?ýactivity“library“provides“a“foundation“for“dynamic,“object-oriented“simulation“in“Swarm.Ž¡Swarm–?ýassumes“that“a“user“defines“an“object-oriented“representation“for“the“structure“of“aŽ¡world–?ýto“be“simulated.‘ úOnce“such“a“representation“is“established,“activity“library“componentsŽ¡are–?ýresponsible“for“generating“all“state“changes“and“flow“of“information“within“it.‘ úTheseŽ¡state–?ýchanges“must“be“carefully“controlled“to“ensure“that“they“occur“only“at“appropriate“timesŽ¡and–?ýplaces“in“the“model.‘ úThe“activity“library“provides“mechanisms“to“establish“this“control.ŽŸ Ü»ïhtml:ï html:Ÿ †Ò‘0Once–?ýthe“simulation“of“a“dynamic“model“begins,“everything“that“happens“to“the“modelŽ¡‘0occurs–?ýas“a“direct“result“of“messages“sent“to“world“objects“by“activity“library“components.Ž¡‘0These–?ýcomponents“are“also“represented“by“objects,“since“this“is“the“most“effectiveŽ¡‘0means–?ýfor“their“representation“as“well,“but“their“purpose“is“not“to“represent“theŽ¡‘0current–?ýstate“of“the“simulated“world,“but“rather“to“generate“changes“in“world“objectsŽ¡‘0by–?ýsending“messages“in“a“valid“order.‘ úThe“activity“library“has“two“basic“categoriesŽ¡‘0of–?ýcomponents:‘ úthose“that“represent“messages“to“be“sent,“including“constraints“onŽ¡‘0permissible–?ýorder“for“sending“them,“and“those“that“execute“the“message“sends“theseŽ¡‘0representations–?ýspecify,“making“sure“they“conform“with“all“constraints.ަïhtml:ï html:Ÿ †Ò‘0All–?ýchanges“to“a“model“occur“as“a“result“of“messages“sent“to“objects“within“it.‘ úTheseŽ¡‘0messages–?ýinvoke“compiled“methods“of“receiving“objects,“which“may“change“local“stateŽ¡‘0or–?ýsend“messages“to“other“objects“to“propagate“effects“as“widely“as“needed.‘ úOnlyŽ¡‘0top-level–?ýfunction“calls“or“message“sends“that“initiate“model“processing“are“the“concernŽ¡‘0of–?ýthe“activity“library.‘ úBecause“the“activity“library“finally“interacts“with“theŽ¡‘0world–?ýmodel“just“by“invoking“its“defined“methods,“the“model“can“prepackage“as“muchŽ¡‘0behavior–?ýas“it“can“in“the“form“of“fast“compiled“methods.‘ úThe“activity“library“justŽ¡‘0triggers–?ýthe“prepackaged“behavior“at“proper“times“under“its“own“explicit,“dynamicallyŽ¡‘0interpreted‘?ýrepresentation.ަïhtml:ï html:Ÿ †Ò‘0As–?ýconditions“shift“during“execution“of“a“model,“the“model“can“also“examine“and“alterŽ¡‘0the–?ýrepresentation“of“its“future“behavior“contained“in“the“activity“structures“thatŽ¡‘0drive–?ýit.‘ úAny“changes“to“this“future“behavior,“however,“still“occur“only“as“a“resultŽ¡‘0of–?ýsome“currently“executing“action“initiated“by“the“activity“library.ަïhtml:ï html:ŸÇ‘0„¤ŽŽŸffïhtml:ï html:ŸdÃActiÛ$vity–™™library“componentsŽŸc¾The–?ýactivity“library“defines“one“set“of“basic“object“types“to“provide“a“very“rich“representationŽ¡of–?ýthe“kinds“of“message“sending“patterns“it“could“generate.‘ úIts“other“major“category“of“objectŽŽŸ*ºâïcolor push Black’Ôï color popŽŽŒ‹! “ºâ ýxºâïcolor push Blackïhtml:ï html:ŸüfdŽŽŽ’Ôï color popŽŽ ^ ýкâ¾types–?ýcontrols“and“tracks“a“current“state“of“processing“within“these“representations.ŽºâŸ Ü»ïhtml:ï html:© Å‘0Both–?ýthese“representations“are“more“abstract“than“typical“object“representations,ޤ ‘0since–?ýthey“deal“not“with“any“constant“state“which“can“be“statically“analyzed,“butŽ¡‘0with–?ýshifting“patterns“of“messages“to“be“fired“to“generate“such“state.‘ úWhile“theŽ¡‘0basic–?ýstructure“of“a“Swarm“simulation“is“that“of“a“discrete“event“simulation,“itsŽ¡‘0activity–?ýrepresentation“is“also“more“complicated“than“most“such“systems.ŽŸ8äïhtml:ï html:¦‘0There–?ýare“two“basic“reasons“for“the“potential“complexity“of“a“Swarm“activity“representation.Ž¡‘0One–?ýis“that“Swarm“supports“a“decentralized“representation“of“activity“to“be“generated,Ž¡‘0both–?ýto“reflect“the“nature“of“much“of“the“behavior“that“it“simulates,“and“so“thatŽ¡‘0execution–?ýmay“be“distributed“across“multiple“parallel“processors.‘ úTo“avoid“any“needŽ¡‘0for–?ýsynchronizing“its“decoupled“activities“more“often“than“necessary,“Swarm“enablesŽ¡‘0a–?ýmodel“designer“to“avoid“overspecifying“constraints“on“the“patterns“of“message“sendsŽ¡‘0which–?ýmight“potentially“be“valid.‘ úThe“partial“order“representation“it“adopts“forŽ¡‘0a–?ýdistributed“and“decoupled“plan“of“activity“is“inherently“more“complicated“than“theŽ¡‘0single–?ýcentralized“event“list“adopted“by“many“discrete“event“simulation“systems.ŽŸ8äïhtml:ï html:¦‘0The–?ýother“reason“for“potential“added“complexity“is“that“Swarm's“representation“ofŽ¡‘0intended–?ýactivity“may“be“broken“into“many“separate,“modular“components,“which“canŽ¡‘0be–?ýbound“together“in“various“ways“to“create“larger“components.‘ úThe“Swarm“compositionŽ¡‘0structure,–?ýwhen“fully“implemented,“will“be“fundamentally“as“powerful“as“the“modularŽ¡‘0abstractions–?ýfound“in“most“programming“languages,“with“the“added“complexity“of“controllingŽ¡‘0the–?ýtime“at“which“various“events“occur.Ž©ïhtml:ï html:Ÿ ýô‘0In–?ýspite“of“this“high“potential“complexity,“none“of“these“features“is“needed“for“manyŽ¡‘0simple–?ýmodels,“such“as“those“that“contain“only“a“small“variety“of“basic“behaviors,Ž¡‘0or–?ýwhich“define“all“their“behavior“to“occur“at“regular,“repeating“timesteps.‘ úTheŽ¡‘0Swarm–?ýrepresentation“is“extremely“rich“to“enable“it“to“scale“to“large,“multi-levelŽ¡‘0models–?ýwith“a“variety“of“dependent“behaviors“built“into“the“model,“and“also“to“facilitateŽ¡‘0running–?ýmodels“on“massively“parallel“machines.‘ úMany“of“the“features“which“seem“complex,Ž¡‘0moreover,–?ýare“also“especially“well-suited“to“building“modular“and“reusable“libraryŽ¡‘0components.‘ úIt–?ýis“anticipated“that“many“of“the“more“advanced“features“will“find“theirŽ¡‘0heaviest–?ýusage“in“pre-built“libraries“that“hide“internal“complexity“from“applicationsŽ¡‘0that–?ýuse“them.ަïhtml:ï html:Ÿ ýô‘0No–?ýmatter“how“complex“the“structures“built“from“them,“all“the“activity“library“componentsŽ¡‘0finally–?ýresult“in“the“direct“execution“of“messages“sends“to“objects“in“a“model.‘ úBecauseŽ¡‘0of–?ýthis“direct“execution,“very“precise“meaning“can“be“defined“for“each“of“them,“inŽ¡‘0terms–?ýof“message“sends“that“can“or“must“occur.‘ úEvery“component“of“a“structure“toŽ¡‘0be–?ýexecuted,“and“every“event“of“its“execution,“can“also“be“accessed“using“the“interfacesŽ¡‘0of–?ýan“object-oriented“representation.‘ úThis“means“that“tools“can“be“built“to“understandŽ¡‘0and–?ýinteract“with“any“components“to“be“executed,“and“also“to“trace“and“debug“activityŽ¡‘0as–?ýit“occurs.‘ úNone“of“these“tools“have“been“built“yet“as“part“of“Swarm,“but“manyŽ¡‘0of–?ýthe“activity“library“interfaces“are“present“to“support“them,“not“because“normalŽ¡‘0use–?ýof“the“library“requires“the“added“components.ŽŸ8äïhtml:ï html:ŸÇ‘0„¤ŽŽŸffïhtml:ï html:ŽŸ*ºâïcolor push Black’Ôï color popŽŽŒ‹)h “ºâ ýxºâïcolor push Blackïhtml:ï html:ŸüfdŽŽŽ’Ôï color popŽŽ ^ ýкâÃAction–™™plan“componentsŽŸ‘yºâ¾The–?ýfirst“set“of“activity“library“components“represent“messages“to“be“sent“to“objects“in“aޤ ºâmodel,–?ýtogether“with“constraints“in“the“order“in“which“they“may“be“sent.‘ úAll“these“componentsŽ¡ºâare–?ýdefined“as“subtypes“of“the“one“generic“type“called“ActionPlan.ŽºâŸ Ü»ïhtml:ï html:© ´¾‘0The–?ýtwo“basic“kinds“of“action“plans“are“a“simple“group“of“actions“to“be“performedŽ¡‘0in–?ýsome“order,“called“an“ActionGroup,“and“a“series“of“actions“to“be“performed“at“discreteŽ¡‘0points–?ýin“time,“called“a“Schedule.‘ úThe“basic“element“of“an“action“plan“is“a“simpleŽ¡‘0object–?ýcalled“an“Action.‘ úAn“action“defines“a“particular“message“to“be“sent“to“anŽ¡‘0object–?ýor“objects.ŽŸ8äïhtml:ï html:¦‘0In–?ýits“representation“of“action“plans,“Swarm“relies“heavily“on“the“dynamic“messageŽ¡‘0sending–?ýcapabilities“of“the“Objective“C“language.‘ úThe“support“of“Objective“C“forŽ¡‘0dynamic–?ýmessage“sends“is“absolutely“crucial“to“Swarm's“implementation“of“generic“activityŽ¡‘0structures.‘ úObjective–?ýC“defines“a“special“kind“of“data“value“called“a“selector,“whichŽ¡‘0identifies–?ýa“message“according“to“its“name.‘ úOne“of“these“selector“values“is“storedŽ¡‘0in–?ýeach“action“of“an“action“plan.‘ úDuring“execution“of“the“plan,“Objective“C“machineryŽ¡‘0performs–?ýthe“actual“message“send“using“its“selector.ŽŸ8äïhtml:ï html:¦‘0Action–?ýplans“are“free-standing“objects“that“may“be“created“directly“by“a“user“program,Ž¡‘0using–?ýa“variety“of“selectable“create-time“options.‘ úOnce“created,“action“plans“mayŽ¡‘0also–?ýrefer“to“each“other,“by“containing“special“kinds“of“actions“to“start“anotherŽ¡‘0action–?ýplan“or“to“perform“all“the“actions“within“it.ŽŸ8äïhtml:ï html:¦‘0Individual–?ýactions“can“be“created“only“as“completely“controlled“components“of“someŽ¡‘0action–?ýplan.‘ úThey“are“created“not“by“a“standard“create“message,“but“by“special“messagesŽ¡‘0(each–?ýcontaining“the“phrase“createAction“in“its“name)“sent“to“an“action“plan“thatŽ¡‘0creates–?ýthe“action“as“part“of“the“action“plan.‘ úIf“the“same“action“is“needed“in“moreŽ¡‘0than–?ýone“plan,“it“has“to“be“created“in“each“plan“where“it“is“needed.‘ úIf“the“entireŽ¡‘0action–?ýplan“is“dropped,“all“its“actions“are“also“automatically“dropped.‘ úSo“the“onlyŽ¡‘0action–?ýplan“components“which“need“to“be“directly“managed“by“an“application“are“theŽ¡‘0action–?ýplans“themselves.ŽŸ8äïhtml:ï html:¦‘0Action–?ýplans“are“relatively“straightforward“components,“because“they“are“entirelyŽ¡‘0passive.‘ úThe–?ýonly“actions“they“ever“contain“are“those“which“an“application“has“createdŽ¡‘0in–?ýthem.‘ úThese“actions“stay“in“them“indefinitely“unless“a“special“option“is“requestedŽ¡‘0to–?ýclean“them“out“as“each“one“is“executed.‘ úBecause“these“plans“are“passive,“read-onlyŽ¡‘0components–?ýto“all“execution“machinery,“if“the“same“pattern“of“actions“needs“to“beŽ¡‘0triggered–?ýat“multiple“points“in“a“model,“it's“perfectly“valid“to“create“one“copy“ofŽ¡‘0the–?ýactions“in“an“action“plan,“and“then“refer“to“the“plan“anywhere“the“actions“mayŽ¡‘0be‘?ýneeded.ŽŸïhtml:ï html:Ÿ í¢‘0Even–?ýthough“action“plans“are“passive,“containing“only“what“has“been“placed“in“them,Ž¡‘0there–?ýis“no“requirement“that“their“contents“remain“fixed.‘ úBoth“of“the“action“groupsŽ¡‘0and–?ýschedules“are“implemented“directly“as“collections“of“their“actions.‘ úNew“actionsŽ¡‘0may–?ýbe“added“at“any“time,“and“existing“ones“may“be“dropped“or“moved“from“positionŽ¡‘0to–?ýanother.‘ úThe“contents“of“action“plans“may“be“as“dynamic“as“they“need“to“be“toŽ¡‘0represent–?ýthe“future“actions“needed“in“a“model.‘ úNone“of“these“shifting“contents“hasŽ¡‘0any–?ýeffect“on“the“model“until“actually“processed“during“model“execution.ŽŸ8äïhtml:ï html:ŽŸ*ºâïcolor push Black’Ôï color popŽŽŒ‹9È “ºâ ýxºâïcolor push Blackïhtml:ï html:ŸüfdŽŽŽ’Ôï color popŽŽ ^ ýБ/ºâ„¤ŽŽºâŸG®ïhtml:ï html:ŸêÀModel–Qëexecution“componentsŽŸ‹Ù¾The–?ýmain“responsibility“of“model“execution“is“just“to“perform“the“actions“specified“by“an“actionޤ plan,–?ýin“an“order“of“execution“consistent“with“any“requirements“of“the“plan.‘ úEach“action“planŽ¡may–?ýspecify“as“few“or“as“many“constraints“as“it“likes“over“the“possible“order“in“which“itsŽ¡actions–?ýcould“be“performed.‘ úGiven“these“specifications,“the“execution“objects“are“entirelyŽ¡responsible–?ýfor“selecting“each“action“to“be“performed“and“then“performing“them.ŽŸ —ïhtml:ï html:© ôÀ‘0There–?ýare“two“simple“cases“of“ordering“that“account“for“most“all“usage,“includingŽ¡‘0that–?ýof“the“current“Swarm“demo“programs.‘ úOne“is“to“permit“the“actions“to“be“performedŽ¡‘0in–?ýany“order,“including“concurrent“execution“if“hardware“and“software“support“wereŽ¡‘0available–?ýto“do“this.‘ úThe“other“is“to“require“them“to“be“performed“in“some“specificŽ¡‘0sequence,–?ýone“after“another,“so“that“the“effects“of“one“action“could“depend“on“actionsŽ¡‘0which–?ýpreceded“it.‘ úThis“sequence“could“be“either“fixed“and“predetermined,“or“dynamicallyŽ¡‘0established–?ýeach“time“the“action“plan“is“performed.‘ úIf“a“dynamically“determined“sequenceŽ¡‘0is–?ýneeded,“perhaps“even“selecting“which“actions“are“to“be“performed“at“all,“usersŽ¡‘0can–?ýprovide“custom“subclasses“for“an“action“plan“and“an“execution“object“that“performsŽ¡‘0it.‘ úA–?ýbuiltin“option“is“to“generate“an“entirely“random“sequence“each“time“a“planŽ¡‘0is‘?ýexecuted.ŽŸïhtml:ï html:Ÿ -¤‘0Each–?ýtime“an“action“plan“is“being“processed,“a“special“kind“of“object“called“an“activityŽ¡‘0is–?ýcreated“entirely“automatically“by“the“runtime“processing“machinery.‘ úThese“activityŽ¡‘0objects–?ýimplement“the“internal“machinery“of“a“virtual“processor“which“has“the“abilityŽ¡‘0to–?ýexecute“action“plans.‘ úTo“get“any“activity“started“on“a“model,“a“processor“is“firstŽ¡‘0initialized–?ýto“run“a“single“top-level“plan.‘ úAll“other“activity“during“the“lifetimeŽ¡‘0of–?ýa“model“must“occur“as“a“result“of“actions“initiated“by“this“plan“(which“may“includeŽ¡‘0the–?ýstartup“of“other“plans).ŽŸ8äïhtml:ï html:¦‘0Because–?ýthe“activity“objects“are“internal“to“the“processing“machinery,“an“applicationŽ¡‘0can–?ýusually“just“ignore“their“existence.‘ úThey“come“and“go“dynamically“as“variousŽ¡‘0action–?ýplans“are“started“and“completed,“all“arranged“in“a“stack“or“tree“of“currentŽ¡‘0activities–?ýcontrolled“by“a“single“top-level“processor.‘ úThe“activity“objects“are“potentiallyŽ¡‘0useful,–?ýhowever,“to“obtain“information“about“the“context“in“which“an“action“is“currentlyŽ¡‘0running,–?ýor“to“build“debugging“or“tracing“tools“to“understand“actions“being“performed.ŽŸ8äïhtml:ï html:¦‘0One–?ýof“the“kinds“of“context“information“available“from“an“activity“object“is“the“currentŽ¡‘0time–?ýof“a“clock“value“incremented“as“a“schedule“is“processed.‘ úA“schedule“is“a“kindŽ¡‘0of–?ýaction“plan“in“which“all“actions“occur“at“specific“points“in“time“explicitly“establishedŽ¡‘0within–?ýthe“schedule.‘ úAs“a“schedule“is“executed,“the“activity“object“keeps“a“currentŽ¡‘0time–?ýclock,“which“holds“a“global“time“from“the“start“of“all“model“execution,“regardlessŽ¡‘0of–?ýthe“time“when“the“schedule“itself“was“started.‘ úAn“activity“object“that“processesŽ¡‘0a–?ýschedule“is“called“a“timeline“activity,“because“its“time“continually“increases“fromŽ¡‘0a–?ýglobal“base“time“regardless“of“times“contained“in“the“schedule.ŽŸ8äïhtml:ï html:¦‘0New–?ýactivities“are“created“whenever“an“action“plan“being“processed“contains“an“actionŽ¡‘0to–?ýperform“another“action“plan,“or“to“start“another“action“plan“for“autonomous“execution.Ž¡‘0If–?ýone“action“plan“performs“another,“its“own“processing“is“stopped“until“a“new“activityŽŽŸ*ºâïcolor push Black’Ôï color popŽŽŒ‹J “ºâ ýxºâïcolor push Blackïhtml:ï html:ŸüfdŽŽŽ’Ôï color popŽŽ ^ ýБ/ºâ¾processing–?ýthe“other“action“plan“completes.‘ úIf“one“action“plan“starts“another,“theޤ ‘/ºânew–?ýaction“plan“is“started“as“an“autonomous“activity“controlled“only“by“a“higher-level,Ž¡‘/ºâcontaining‘?ýactivity.Žºâ©8äïhtml:ï html:Ÿ Ç‘0A–?ýSwarm“is“an“activity“that“exists“only“to“control“and“coordinate“other“started“subactivities.Ž¡‘0Unless–?ýthe“subactivities“have“some“special“form“of“explicit“synchronization,“noneŽ¡‘0of–?ýtheir“internal“actions“has“any“required“ordering“relative“to“those“of“other“plansŽ¡‘0except–?ýas“explicitly“established“during“activity“execution.‘ úThe“swarm“can“serve“asŽ¡‘0a–?ýsimple“container“of“started“subactivities“which“only“occasionally“synchronize“forŽ¡‘0messages–?ýthey“send“to“each“other.‘ úThe“swarm“can“be“used“to“hold“collections“of“objectsŽ¡‘0as–?ýwell“as“its“subactivities“as“needed“to“help“them“coordinate“with“one“another.ަïhtml:ï html:Ÿ Ç‘0One–?ýspecial“form“of“synchronization“within“a“swarm“is“built“into“the“virtual“processingŽ¡‘0machinery.‘ úThis–?ýsynchronization“interleaves“the“actions“that“occur“for“every“successiveŽ¡‘0time–?ývalue“during“processing“of“timeline“subactivities.‘ úThis“merging“of“actions“isŽ¡‘0often–?ýrelied“on“to“interleave“display“and“analysis“processing“with“the“scheduled“actionsŽ¡‘0of–?ýa“base“model.‘ úSince“no“other“mechanisms“for“subactivity“coordination“are“implementedŽ¡‘0in–?ýthe“current“version“of“Swarm,“synchronizing“subschedule“activities“is“the“majorŽ¡‘0current–?ýrole“of“the“Swarm“activity“type.‘ úIn“later“versions“of“Swarm,“a“swarm“willŽ¡‘0also–?ýserve“as“an“important“means“for“organizing“a“large“models“into“clusters“of“moreŽ¡‘0densely–?ýinteracting“components,“and“will“also“provide“a“basis“of“decomposition“forŽ¡‘0parallel‘?ýexecution.ަïhtml:ï html:ŸÇ‘0„¤ŽŽŸ ïhtml:ï html:¡‘0ÂMarcus–?ýG.“Daniels“ïhtml:ï html:‘¼rïhtml:ï html:Ž¡‘0(mailto:mgd@santafe.edu)ަïhtml:ï html:Ÿ Ç‘0¾Last‘?ýmodified:‘ ú1998-01-08ŽŽŸ*ºâïcolor push Black’Ôï color popŽŽŒ‹ Zt “ºâ ýxºâïcolor push Blackïhtml:ï html:ŸüfdŽŽŽ’Ôï color popŽŽ ^ºâ ýÆïhtml:ï html:ŸIy½Acti•Êìvity›/Library:‘m™Adv“anced˜Usage˜GuideŽŸq'‘0„¤ŽŽ¤ ïhtml:ï html:© ‘0¾(This–?ýsection“of“documentation“is“not“yet“available.)ŽŸ8äïhtml:ï html:ŸÇ‘0„¤ŽŽ¡ïhtml:ï html:¦‘0ÂMarcus–?ýG.“Daniels“ïhtml:ï html:‘¼rïhtml:ï html:ަ‘0(mailto:mgd@santafe.edu)ŽŸ8äïhtml:ï html:Ÿ Ç‘0¾Last‘?ýmodified:‘ ú1998-01-08ŽŽŸ*ºâïcolor push Black’Ôï color popŽŽŒ‹ c° “ºâ ýxºâïcolor push Blackïhtml:ï html:ŸüfdŽŽŽ’Ôï color popŽŽ ^ºâ ýÆïhtml:ï html:ŸIy½ActiÊìvity–/Library:‘m™Interface“Refer |enceŽŸq'‘0„¤ŽŽŸG®ïhtml:ï html:Ÿö•ÀDependenciesŽŸ˜`¾Following–?ýare“the“other“header“files“imported“by“:ŽŸ —ïhtml:ï html:Ÿïhtml:ï html:Ÿ G‘0ó0ˆÛ pcrr7tÅ#import‘ffޤ :+¾The–?ýactivity“library“follows“the“Swarm“ïhtml:ï html:library“interface“conventionsïhtml:ï html:Ž¡(../defobj/library.html)Ž¡of–?ýthe“ïhtml:ï html:defobj“libraryïhtml:ï html:Ž¡(../defobj.html)Ž¡.‘ úThe–?ýactivity“library“relies“heavily“on“the“basic“collection“types“defined“in“the“ïhtml:ï html:collectionsŽ© libraryïhtml:ï html:Ž¡(../collections.html)Ž¡,–?ýand“the“collection“interfaces“are“an“integral“part“of“the“interfaces“defined“within“thisަlibrary.‘ úInitialization–?ýof“the“activity“library“is“done“automatically“by“the“containing“Swarmަlibraries,–?ýand“automatically“initializes“the“collections“and“defobj“libraries“as“well.Ž©8äïhtml:ï html:ŸÇ‘0„¤ŽŽŸG®ïhtml:ï html:Ÿö•ÀList–Qëof“Refer°gence“PÓÅagesŽŸ âcïhtml:ï html:Ÿïhtml:ï html:Ÿµý‘0ïcolor push BlackÁlï color popŽŽ‘:ïhtml:ï html:¾ProcessTypeïhtml:ï html:Ž¡‘0(ProcessType.html)ަïhtml:ï html:Ÿ G‘0ïcolor push BlackÁlï color popŽŽ‘:ïhtml:ï html:¾ActionTypeïhtml:ï html:Ž¡‘0(ActionType.html)ަïhtml:ï html:Ÿ G‘0ïcolor push BlackÁlï color popŽŽ‘:ïhtml:ï html:¾CompoundActionïhtml:ï html:Ž¡‘0(CompoundAction.html)ަïhtml:ï html:Ÿ G‘0ïcolor push BlackÁlï color popŽŽ‘:ïhtml:ï html:¾ActionGroupïhtml:ï html:Ž¡‘0(ActionGroup.html)ަïhtml:ï html:Ÿ G‘0ïcolor push BlackÁlï color popŽŽ‘:ïhtml:ï html:¾Scheduleïhtml:ï html:Ž¡‘0(Schedule.html)ŽŸÕSïhtml:ï html:© dØ‘0ïcolor push BlackÁlï color popŽŽ‘:ïhtml:ï html:¾SwarmProcessïhtml:ï html:Ž¡‘0(SwarmProcess.html)ŽŸ ÕSïhtml:ï html:Ÿïhtml:ï html:¦‘0ïcolor push BlackÁlï color popŽŽ‘:ïhtml:ï html:¾Action‘?ýTypesïhtml:ï html:Ž¡‘0(Action.html)ŽŸÕSïhtml:ï html:¦‘0ïcolor push BlackÁlï color popŽŽ‘:ïhtml:ï html:¾Activity‘?ýTypesïhtml:ï html:Ž¡‘0(Activity.html)ŽŽŸ*ºâïcolor push Black’Ôï color popŽŽŒ‹ f} “ºâ ýxºâïcolor push Blackïhtml:ï html:ŸüfdŽŽŽ’Ôï color popŽŽ ^ ýБ/ºâ„¤ŽŽºâŸ ïhtml:ï html:¤ ‘0ÂMarcus–?ýG.“Daniels“ïhtml:ï html:‘¼rïhtml:ï html:Ž¡‘0(mailto:mgd@santafe.edu)ŽŸ8äïhtml:ï html:Ÿ Ç‘0¾Last‘?ýmodified:‘ ú1998-01-08ŽŽŸ*ºâïcolor push Black’Ôï color popŽŽŒ‹ r& “ºâ ýxºâïcolor push Blackïhtml:ï html:ŸüfdŽŽŽ’Ôï color popŽŽ ^ºâ ýÆïhtml:ï html:Ÿ žâÀNameŽŸªóïhtml:ï html:Ÿ!ÃPrš½«ocessT‘þï5ype–™™{“speci cation“of“a“pr˜ocessŽ©‘0„¤ŽŽŸG®ïhtml:ï html:Ÿ¼jÀSynopsisŽŸ âcïhtml:ï html:Ÿ{Ò‘0Å//ޤ ‘0//–ffProcessType“--“specification“of“a“processŽ¡‘0//Ž¡‘0@deftype‘ffProcessTypeŽ¡‘0@endަ‘0„¤ŽŽŸG®ïhtml:ï html:Ÿ¼jÀDescriptionŽŸ^5¾(..› úFor–?ýnow,“ProcessType“is“just“a“placeholder“for“future“capability.˜..)ŽŸ —ïhtml:ï html:Ÿ Ç‘0ProcessType–?ýwill“eventually“define“support“for“parameterization“of“all“processes.Ž¡‘0A–?ýprocess“is“a“uniquely“identified“course“of“events“that“conforms“to“a“specificationŽ¡‘0of–?ýexternal“and“internal“behavior.ŽŸïhtml:ï html:¡‘0Processes–?ýinclude“both“objects“and“executable“actions.‘ úObjects“change“their“stateŽ¡‘0and–?ýbehavior“based“on“a“sequence“of“externally“initiated“actions.‘ úAn“action,“in“contrast,Ž¡‘0typically–?ýhas“no“external“behavior“other“than“to“be“executed“in“its“entirety“as“aŽ¡‘0unit–?ý(yielding“either“an“observable“result“or“some“change“of“state“in“a“surroundingŽ¡‘0environment).ŽŸÕSïhtml:ï html:Ÿ *­‘0Parameterization–?ýwill“be“based“a“uniform“framework“that“defines“all“input“parameters,Ž¡‘0internal–?ýstate“variables,“and/or“final“results,“and“that“provides“for“binding“of“theseŽ¡‘0data–?ýin“a“context“of“execution.‘ úThis“parameterization“framework“is“still“being“established,Ž¡‘0but–?ýProcessType“objects“will“eventually“record“the“specification“of“any“process,“toŽ¡‘0the–?ýextent“that“this“specification“is“defined.Ž©8äïhtml:ï html:ŸÇ‘0„¤ŽŽŸ ïhtml:ï html:¡‘0ÂMarcus–?ýG.“Daniels“ïhtml:ï html:‘¼rïhtml:ï html:Ž¡‘0(mailto:mgd@santafe.edu)ަïhtml:ï html:Ÿ Ç‘0¾Last‘?ýmodified:‘ ú1998-01-08ŽŽŸ*ºâïcolor push Black’Ôï color popŽŽŒ‹ t “ºâ ýxºâïcolor push Blackïhtml:ï html:ŸüfdŽŽŽ’Ôï color popŽŽ ^ºâ ýÆïhtml:ï html:Ÿ žâÀNameŽŸªóïhtml:ï html:Ÿ·ÃActionT‘þï5ype–™™{“speci cation“of“an“executable“pr½«ocessŽ©‘0„¤ŽŽŸG®ïhtml:ï html:ŸphÀSynopsisŽŸ âcïhtml:ï html:Ÿ /Б0Å//ޤ ³þ‘0//–ffActionType“--“specification“of“an“executable“processŽ¡‘0//Ž¡‘0@deftype–ffActionType“-“activateIn:“swarmContext;Ž¡‘0@endަ‘0„¤ŽŽŸG®ïhtml:ï html:ŸphÀDescriptionŽŸ3¾An–?ýaction“type“is“a“type“of“process“that“may“be“initiated“as“a“unit“of“execution“by“an“externalޤ request.‘ úA–?ýtypical“action“has“a“well-defined“duration“determined“by“a“fixed“set“of“actionsŽ¡that–?ýexecute“within“it.‘ úExternally“initiated“interaction“typically“occurs“only“at“the“startŽ¡or–?ýend“of“the“overall“process.‘ úA“typical“action“is“executed“in“its“entirety“once“an“externalŽ¡request–?ýthat“initiates“it“has“occurred.‘ úSome“actions“may“also“have“internal“events“that“cannotŽ¡begin–?ýor“complete“until“other“actions“from“a“containing“environment“have“also“begun“or“completedŽ¡their–?ýexecution.‘ úSuch“ordering“constraints“can“be“defined“either“within“an“action“type“orŽ¡as–?ýpart“of“a“dynamic“context“of“execution.ŽŸ —ïhtml:ï html:© {‘0Executable–?ýactions“include“both“actions“compiled“in“a“host“language“(such“as“C“functionsŽ¡‘0or–?ýObjective“C“messages)“and“compound“actions“built“at“runtime“for“interpretationŽ¡‘0by–?ýthe“Swarm“abstract“machine.ŽŸ8äïhtml:ï html:¦‘0(..› úFor–?ýnow,“the“only“subtype“of“ActionType“is“CompoundAction.˜Types“for“compiledŽ¡‘0actions–?ýsuch“as“functions“and“messages“have“not“been“defined“yet.‘ ú..)Ž©8äïhtml:ï html:ŸÇ‘0„¤ŽŽŸffïhtml:ï html:Ÿû¬ÃInherited‘™™beha£×viorŽŸÜ÷ïhtml:ï html:Ÿ zÞ‘0Å@deftype–ffActionType“ŽŸ ³þ¾ActionType–?ýinherits“standard“parameterization“support“from“ProcessType.– ú(..“Currently,‘?ýnoŽ¡such–?ýsupport“is“defined.‘ ú..)ަïhtml:ï html:ŸÇ‘0„¤ŽŽŸffïhtml:ï html:ŽŸ*ºâïcolor push Black’Ôï color popŽŽŒ‹|¨ “ºâ ýxºâïcolor push Blackïhtml:ï html:ŸüfdŽŽŽ’Ôï color popŽŽ ^ ýкâÃActionT‘þï5ype‘™™beha£×viorŽºâŸ ‘ýïhtml:ï html:Ÿ Ú‘0Å-–ffactivateIn:“swarmContext;ޤ ¾The–?ýactivateIn:‘ úmessage“is“used“to“initialize“a“process“for“executing“the“actions“of“an“ActionType.Ž¡This–?ýprocess“is“controlled“by“an“object“called“an“Activity.‘ úThe“activateIn“message“initializesŽ¡an–?ýactivity“to“run“under“the“execution“context“passed“as“the“swarmContext“argument,“and“returnŽ¡the–?ýactivity“object“just“created.‘ úIf“the“execution“context“is“nil,“an“activity“is“returnedŽ¡that–?ýallows“complete“execution“control“by“the“caller.‘ úOtherwise,“the“execution“context“mustŽ¡be–?ýeither“an“instance“of“SwarmProcess“or“SwarmActivity.‘ ú(These“objects“are“always“maintainedŽ¡in–?ýone-to-one“association“with“each“other,“either“one“of“the“pair“is“equivalent“to“the“otherŽ¡as–?ýa“swarmContext“argument.)Ž©8äïhtml:ï html:Ÿ Ç‘0If–?ýa“top-level“activity“is“created“(swarmContext“is“nil),“the“created“activity“mayŽ¡‘0be–?ýprocessed“using“activity“processing“commands“such“as“run,“step,“etc.‘ úIf“an“activityŽ¡‘0is–?ýcreated“to“run“under“a“swarm“context,“the“swarm“itself“has“responsibility“for“advancingŽ¡‘0the–?ýsubactivity“according“to“its“requirements“for“synchronization“and“control“amongŽ¡‘0all–?ýits“activities.‘ úActivating“a“plan“for“execution“under“a“swarm“turns“over“controlŽ¡‘0to–?ýthe“swarm“to“execute“the“subactivity“as“a“more-or-less“autonomous“activity.ަïhtml:ï html:ŸÇ‘0„¤ŽŽŸ ïhtml:ï html:¡‘0ÂMarcus–?ýG.“Daniels“ïhtml:ï html:‘¼rïhtml:ï html:Ž¡‘0(mailto:mgd@santafe.edu)ަïhtml:ï html:Ÿ Ç‘0¾Last‘?ýmodified:‘ ú1998-01-08ŽŽŸ*ºâïcolor push Black’Ôï color popŽŽŒ‹…ä “ºâ ýxºâïcolor push Blackïhtml:ï html:ŸüfdŽŽŽ’Ôï color popŽŽ ^ºâ ýÆïhtml:ï html:Ÿ žâÀNameŽŸªóïhtml:ï html:ŸJ]ÃCompoundAction–™™{“collection“of“actions“to“be“perf£×ormed“in“some“orderŽ©‘0„¤ŽŽŸG®ïhtml:ï html:Ÿ¦ÀSynopsisŽŸ âcïhtml:ï html:Ÿ Ñ0Å//ޤ G<‘0//–ffCompoundAction“--Ž¡‘0//‘32a–ffcollection“of“actions“to“be“performed“in“any“order“consistent“with“aŽ¡‘0//‘32set–ffof“ordering“constraintsŽ¡‘0//Ž¡‘0@deftype–ffCompoundAction“<;ActionType,“Collection>CREATINGŽ¡‘0-–ff(void)“setDefaultOrder:“aSymbol;Ž¡‘0-–ff(void)“setAutoDrop:“(BOOL)autoDrop;Ž¡‘0USINGŽ¡‘0-‘ffgetDefaultOrder;Ž¡‘0-–ff(BOOL)“getAutoDrop;Ž¡‘0@endަ‘0„¤ŽŽŸG®ïhtml:ï html:Ÿ¦ÀDescriptionŽŸ¥q¾An–?ýcompound“action“is“the“supertype“of“ActionGroup“and“Schedule.‘ úA“compound“action“definesޤ an–?ýexecutable“process“that“is“composed“from“the“execution“of“a“set“of“actions“in“some“definedŽ¡order.ŽŸ ^5ïhtml:ï html:Ÿïhtml:ï html:¦‘0„¤ŽŽŸffïhtml:ï html:ŸŽêÃInherited‘™™beha£×viorŽŸÜ÷ïhtml:ï html:Ÿ ‘0Å@deftype–ffCompoundAction“Ž© G<¾CompoundAction–?ýis“not“directly“creatable.› úOne“of“its“subtypes“must“be“created“instead.˜ActionPlanŽ¡inherits–?ýthe“basic“ability“to“be“activated“for“execution“from“ïhtml:ï html:ActionTypeïhtml:ï html:ަ(ActionType.html)ަ.ŽŸïhtml:ï html:Ÿ‘0„¤ŽŽŸffïhtml:ï html:ŽŸ*ºâïcolor push Black’Ôï color popŽŽŒ‹› “ºâ ýxºâïcolor push Blackïhtml:ï html:ŸüfdŽŽŽ’Ôï color popŽŽ ^ ýкâÃCr½«eate-time‘™™optionsŽºâŸ ‘ýïhtml:ï html:Ÿ ™´‘0ÅCREATINGޤ ‡Ú‘0-–ff(void)“setDefaultOrder:“aSymbol;Ž¡‘0-–ff(void)“setAutoDrop:“(BOOL)autoDrop;Ž¡‘0USINGŽ¡‘0-‘ffgetDefaultOrder;Ž¡‘0-–ff(BOOL)“getAutoDrop;ŽŸ bÌïhtml:ï html:Ÿ ‹t‘0¿DefaultOrderŽŸ» ¾The–?ýDefaultOrder“option“indicates“the“ordering“to“be“assumed“among“actions“of“the“plan“whenޤ no–?ýother“explicit“ordering“has“been“assigned.‘ úBeyond“this“initial“ordering,“additional“orderingŽ¡constraints–?ýcan“be“added“selectively“using“partial“order“specifications“on“individual“actions.Ž¡(..‘ úPartial–?ýorder“order“constraints“are“not“yet“implemented.)ŽŸ lïhtml:ï html:¤ Nö‘0The–?ývalue“for“DefaultOrder“is“a“symbol“that“may“have“one“of“the“following“values:Ž©8äïhtml:ï html:Ÿïhtml:ï html:¡‘0Åextern–ffid“‘ ÌÌConcurrent,“Sequential,“Randomized;ŽŸ ‡Ú¾The–?ýConcurrent“value“of“the“DefaultOrder“option“indicates“that“can“actions“be“run“in“any“orderޤ (including–?ýat“the“same“time,“if“hardware“and“software“to“do“this“is“available)“without“no“impactŽ¡on–?ýthe“net“outcome“of“the“actions.‘ úThe“claim“that“action“results“are“independent“of“theirŽ¡execution–?ýorder“gives“the“processing“machinery“explicit“leeway“to“execute“them“in“any“orderŽ¡it–?ýchooses.‘ úIn“the“current“implementation“on“a“single,“serial“processor,“actions“are“alwaysŽ¡processed–?ýsequentially“even“if“marked“concurrent,“because“that“is“the“only“way“they“can“be.Ž¡In–?ýfuture“versions,“however,“special“runtime“processing“modes“may“be“defined“even“for“a“serialŽ¡processor,–?ýwhich“would“mix“up“execution“order“just“to“confirm“the“independence“of“model“results.ަïhtml:ï html:Ÿ Nö‘0The–?ýSequential“value“for“the“DefaultOrder“option“is“the“default.‘ úIt“specifies“thatŽ¡‘0the–?ýactions“must“always“be“executed“in“the“same“order“as“they“occur“in“the“plan.‘ úThisŽ¡‘0order–?ýis“ordinarily“the“same“order“in“which“actions“are“first“created“in“the“plan,Ž¡‘0unless–?ýactions“are“explicitly“added“elsewhere“the“collection“that“underlies“a“plan.Ž¡‘0This–?ýoption“is“always“the“safest“to“assure“predictability“of“results,“but“it“excludesŽ¡‘0the–?ýability“to“run“the“actions“in“parallel.‘ úTo“better“understand“and“document“a“modelŽ¡‘0design,–?ýit“is“worth“annotating“action“plans“with“an“explicit“indication“as“to“whetherŽ¡‘0they–?ýdo“or“do“not“depend“on“a“Sequential“order.ަïhtml:ï html:Ÿ Nö‘0The–?ýRandomized“value“for“the“DefaultOrder“option“specifies“that“the“model“resultsŽ¡‘0do–?ýdepend“on“execution“order,“but“that“the“order“in“which“the“actions“were“createdŽ¡‘0or–?ýadded“has“no“special“significance.‘ úInstead,“the“method“of“dealing“with“order“dependenceŽ¡‘0is–?ýto“generate“a“random“order“each“time“a“collection“of“same-time“actions“is“processed.Ž¡‘0The–?ýrandom“order“will“be“generated“from“an“random“number“generator“internal“to“theŽ¡‘0processing‘?ýmachinery.ަïhtml:ï html:¡ïhtml:ï html:Ÿ µ\‘0¿A‘ÿffutoDrȹopŽŸ» ¾The–?ýAutoDrop“option“specifies“that“as“soon“as“any“action“been“processed“by“a“running“activity,Ž¡the–?ýaction“is“removed“from“the“plan“and“dropped“so“that“it“will“never“appear“again.‘ úThis“optionŽ¡is–?ýuseful“for“plans“that“are“created“for“a“one-time“use,“never“to“be“used“again.‘ úThis“optionŽŽŸ*ºâïcolor push Black’Ôï color popŽŽŒ‹” “ºâ ýxºâïcolor push Blackïhtml:ï html:ŸüfdŽŽŽ’Ôï color popŽŽ ^ ýкâ¾is–?ýespecially“useful“for“a“dynamic“schedule“that“continually“receives“new“actions“to“be“executedޤ ºâat–?ýfuture“times,“but“will“never“repeat“actions“that“were“previously“scheduled.‘ úDepending“onŽ¡ºâthe–?ýunderlying“implementation“of“the“schedule,“making“sure“the“old“actions“get“dropped“usingŽ¡ºâAutoDrop–?ýcan“considerably“improve“the“performance“of“the“schedule.ŽºâŸ lïhtml:ï html:Ÿ Ç‘0When–?ýan“option“like“AutoDrop“is“used,“or“whenever“the“contents“of“an“action“plan“undergoŽ¡‘0a–?ýsignificant“amount“of“dynamic“update,“the“action“plan“would“ordinarily“be“intendedŽ¡‘0only–?ýfor“a“single“point“of“use.‘ úIf“AutoDrop“is“specified,“a“restriction“against“multipleŽ¡‘0active–?ýreferences“is“enforced.‘ úAn“error“will“be“raised“if“two“activities“ever“attemptŽ¡‘0to–?ýprocess“a“plan“with“AutoDrop“enabled“at“the“same“time.Ž©8äïhtml:ï html:ŸÇ‘0„¤ŽŽŸ ïhtml:ï html:¡‘0ÂMarcus–?ýG.“Daniels“ïhtml:ï html:‘¼rïhtml:ï html:Ž¡‘0(mailto:mgd@santafe.edu)ަïhtml:ï html:Ÿ Ç‘0¾Last‘?ýmodified:‘ ú1998-01-08ŽŽŸ*ºâïcolor push Black’Ôï color popŽŽŒ‹¢Ø “ºâ ýxºâïcolor push Blackïhtml:ï html:ŸüfdŽŽŽ’Ôï color popŽŽ ^ºâ ýÆïhtml:ï html:Ÿ žâÀNameŽŸªóïhtml:ï html:ŸÃActionGr½«oup–™™{“collection“of“actions“under“partial“order“constraintsŽ©‘0„¤ŽŽŸG®ïhtml:ï html:ŸÌ]ÀSynopsisŽŸ âcïhtml:ï html:Ÿ‹Å‘0Å//ޤ ó‘0//–ffActionCreating“--“protocol“shared“by“ActionGroup“and“ScheduleŽ¡‘0//Ž¡‘0@deftype‘ffActionCreatingŽ¡‘0-–ffcreateAction:“anActionType;Ž¡¡‘0-–ffcreateActionCall:“(func_t)fptr;Ž¡‘0-–ffcreateActionCall:“(func_t)fptr“:“arg1;Ž¡‘0-–ffcreateActionCall:“(func_t)fptr“:“arg1“:“arg2;Ž¡‘0-–ffcreateActionCall:“(func_t)fptr“:“arg1“:“arg2“:“arg3;Ž¡¡‘0-–ffcreateActionTo:“target“message:“(SEL)aSel;Ž¡‘0-–ffcreateActionTo:“target“message:“(SEL)aSel“:“arg1;Ž¡‘0-–ffcreateActionTo:“target“message:“(SEL)aSel“:“arg1“:“arg2;Ž¡‘0-–ffcreateActionTo:“target“message:“(SEL)aSel“:“arg1“:“arg2“:“arg3;Ž¡¡‘0-–ffcreateActionForEach:“target“message:“(SEL)aSel;Ž¡‘0-–ffcreateActionForEach:“target“message:“(SEL)aSel“:“arg1;Ž¡‘0-–ffcreateActionForEach:“target“message:“(SEL)aSel“:“arg1“:“arg2;Ž¡‘0-–ffcreateActionForEach:“target“message:“(SEL)aSel“:“arg1“:“arg2“:“arg3;Ž¡‘0@endŽ¡¡‘0//Ž¡‘0//–ffActionGroup“--Ž¡‘0//‘32a–ffcollection“of“actions“under“total“or“partial“order“constraintsŽ¡‘0//Ž¡‘0@deftype–ffActionGroup“@endަ‘0„¤ŽŽŸG®ïhtml:ï html:ŸÌ]ÀDescriptionŽŸn(¾An–?ýaction“group“is“an“action“plan“whose“basic“representation“is“a“sequence“of“actions“thatŽ¡have–?ýbeen“created“within“it.‘ úEven“though“a“sequence“is“used“to“represent“the“actions“of“theŽ¡collection,–?ýthis“does“not“necessarily“mean“that“the“execution“machinery“will“process“them“inŽ¡this–?ýorder,“since“the“permissible“order“of“execution“is“still“controlled“by“the“DefaultOrderŽŽŸ*ºâïcolor push Black’Ôï color popŽŽŒ‹¨L “ºâ ýxºâïcolor push Blackïhtml:ï html:ŸüfdŽŽŽ’Ôï color popŽŽ ^ ýкâ¾option–?ýinherited“from“ActionPlan.‘ úThis“initial“order“may“also“be“further“constrained“by“partialޤ ºâorder–?ýconstraints“among“the“actions.– ú(..“Partial–?ýorder“constraints“are“currently“unimplemented.)ŽºâŸ —ïhtml:ï html:Ÿffïhtml:ï html:ŸADÃInherited‘™™beha£×viorŽŸÜ÷ïhtml:ï html:Ÿ ùZ‘0Å@deftype–ffActionGroup“Ž© 2z¾ActionCreating–?ýdefines“the“createAction“messages“for“ActionGroup“just“so“that“this“protocolŽ¡may–?ýbe“shared“with“Schedule,“where“they“provide“a“convenience“interface“for“the“creation“ofŽ¡actions–?ýin“the“schedule“at“time“zero.‘ úThese“messages“will“be“documented“here“in“ActionGroupŽ¡as–?ýif“they“had“been“defined“on“ActionGroup“itself.ŽŸ8äïhtml:ï html:Ÿ ù–‘0An–?ýaction“group“inherits“its“underlying“representation“from“the“ïhtml:ï html:OrderedSetïhtml:ï html:ަ‘0(../collections/OrderedSet.html)ަ‘0type–?ýof“the“ïhtml:ï html:collectionsïhtml:ï html:ަ‘0(../collections.html)ަ‘0library.‘ úAll–?ýthe“members“of“the“ordered“set“must“consist“only“of“actions“that“areŽ¡‘0created–?ýby“one“of“the“createAction“messages“defined“on“ActionGroup“itself.‘ úOnce“theŽ¡‘0actions–?ýare“created,“they“may“be“accessed“or“traversed“using“standard“messages“ofŽ¡‘0the–?ýOrderedSet“type.‘ úPartial“orders“on“these“actions“are“also“established“by“inheritedŽ¡‘0messages.– ú(..“Currently,–?ýpartial“orders“are“not“implemented“on“either“collectionsŽ¡‘0or–?ýaction“plans,“but“the“messages“inherited“from“OrderedSet“will“be“the“basic“methodŽ¡‘0for–?ýmaintaining“them“once“implemented.)Ž©8äïhtml:ï html:Ÿffïhtml:ï html:ŸADÃActionGr½«oup‘™™beha£×viorŽŸÖQ¾Actions–?ýare“created“within“the“ActionGroup“using“one“of“the“createAction“messages.‘ úA“createActionTo:Ž¡message–?ýspecifies“that“the“action“to“be“performed“is“defined“by“an“Objective“C“message“selectorŽ¡to–?ýbe“performed“on“a“receiving“object“plus“any“required“arguments.‘ úThe“message“selector“isŽ¡specified–?ýby“the“message:‘ úargument“and“the“receiving“object“is“specified“as“the“first“argument,Ž¡target.ŽŸ Ü»ïhtml:ï html:Ÿ ù–‘0Given–?ýa“variable“aTurtle“already“initialized“to“a“valid“object,“following“is“an“exampleŽ¡‘0of–?ýa“createActionTo“message:ަïhtml:ï html:Ÿïhtml:ï html:Ÿ ù–‘0Å[createActionTo:–ffaTurtle“message:“M(print)];ŽŸ 2z¾M()–?ýis“a“macro“defined“in“defobj.h“which“is“just“a“convenient“shorthand“for“the“Objective“CŽ¡expression–?ý@selector(message-name).‘ úAs“in“any“selector,“the“message“name“must“include“allŽ¡parts–?ýof“the“message“including“colons“and“subsequent“argument“portions.‘ úAn“example“of“a“messageŽ¡with–?ýone“additional“argument“is“the“following:ަïhtml:ï html:Ÿ ù–‘0Å[createActionTo:–ffaTurtle“message:“$m(move:)“:“(id)10];Ž© 2z¾The–?ýcreateAction“messages“declare“all“arguments“of“the“message“to“be“of“object“id“type,“butŽ¡you–?ýare“free“to“cast“other“pointers“and“values“up“to“the“limits“defined“by“the“ïhtml:ï html:global“portabilityŽ¡assumptionsïhtml:ï html:ަ(../defobj/globalport.html)ަ.‘ úThese–?ýis“not“portable“across“all“machine“architectures,“but“is“expected“to“be“portable“acrossŽ¡the–?ý32-bit“and“64-bit“architectures“on“which“Swarm“will“be“supported.‘ úThe“message“you“sendŽŽŸ*ºâïcolor push Black’Ôï color popŽŽŒ‹°y “ºâ ýxºâïcolor push Blackïhtml:ï html:ŸüfdŽŽŽ’Ôï color popŽŽ ^ ýкâ¾must–?ýstill“be“declared“to“receive“the“type“of“argument“you“actually“pass,“before“you“cast“itޤ ºâto–?ýthe“id“type.Žºâ©8äïhtml:ï html:Ÿ à¶‘0(..‘ úAlternative–?ýapproaches“to“argument“typing“are“currently“in“development,“but“theseŽ¡‘0will–?ýsupplement“rather“than“replace“the“current“forms“of“createAction“messages.)ަïhtml:ï html:Ÿ à¶‘0The–?ýcreateAction:‘ úmessage“specifoes“that“processing“of“another“action“type“is“toŽ¡‘0be–?ýperformed“by“the“action.‘ úThe“referenced“action“type“is“performed“in“its“entirety,Ž¡‘0from–?ýstart“to“finish,“as“the“effect“of“the“single“created“action.ަïhtml:ï html:Ÿ à¶‘0The–?ýcreateActionCall:‘ úmessages“are“similar“to“the“createActionTo“messages,“exceptŽ¡‘0they–?ýspecify“the“action“to“be“performed“as“a“binding“of“a“C“function“to“a“list“ofŽ¡‘0argument–?ývalues.‘ úThe“correct“number“of“arguments“for“the“function“pointer“passedŽ¡‘0as–?ýthe“initial“argument“must“be“supplied.ަïhtml:ï html:Ÿ à¶‘0The–?ýcreateActionForEach:‘ úmessages“define“a“message“to“be“sent“in“the“same“way“asŽ¡‘0the–?ýcreateActionTo“messages,“but“they“assume“that“the“object“passed“as“the“targetŽ¡‘0argument–?ýis“a“collection“object.‘ úThey“specify“that“each“object“available“from“thatŽ¡‘0collection,–?ýusing“the“standard“messages“of“the“ïhtml:ï html:Collectionïhtml:ï html:ޤ š‘0(../collections/Collection.html)Ž¡‘0type–?ýin“the“collections“library,“is“to“receive“the“specified“message.ަïhtml:ï html:Ÿ à¶‘0The–?ýcreateAction:‘ úmessages“specify“that“processing“of“another“action“plan“is“to“beޤ ‘0performed–?ýby“the“action.‘ úThe“referenced“action“plan“is“performed“in“its“entirety,Ž¡‘0from–?ýstart“to“finish,“as“the“effect“of“the“single“created“action.‘ úIf“parameters“areŽ¡‘0defined–?ýon“the“action“plan,“arguments“for“the“action“can“also“be“given.– ú(..“CurrentlyŽ¡‘0this–?ýis“not“supported,“so“only“the“single“argument“form“of“createAction:‘ úshould“beŽ¡‘0used.)ŽŸÕSïhtml:ï html:Ÿ DG‘0Each–?ýof“the“createAction“messages“returns“the“action“object“which“it“creates.‘ úEachŽ¡‘0different–?ýkind“of“createAction“message“returns“a“different“type“of“Action“object“withŽ¡‘0a–?ýmatching“name.‘ úThese“Action“objects“provide“access“to“all“the“information“withŽ¡‘0which–?ýthe“Action“was“initialized.‘ úThe“complete“set“of“Action“object“types“is“definedŽ¡‘0below–?ýtogether“with“the“messages“that“may“be“used“to“access“their“contents.– ú(..“TheŽ¡‘0implementation–?ýof“the“Action“objects“is“currently“undergoing“change“as“the“responsibilityŽ¡‘0for–?ýparameter“and“return“value“typing“gets“taken“over“by“ActionType“in“defobj.)ަïhtml:ï html:Ÿ à¶‘0The–?ýaction“objects“are“an“integral,“controlled“component“of“the“action“plan“in“whichŽ¡‘0they–?ýare“created.‘ úIf“they“are“removed“from“the“action“plan“collection“using“a“removeŽ¡‘0message,–?ýthe“only“collection“in“which“they“may“be“reinserted“is“the“same“collectionŽ¡‘0from–?ýwhich“they“came.‘ úIt“is“permissible,“however,“to“modify“the“base“representationŽ¡‘0sequence–?ýby“removing“from“one“position“and“reinserting“at“another.ަïhtml:ï html:Ÿ à¶‘0The–?ýcontents“of“the“action“objects“would“ordinarily“be“referenced“only“by“general-purposeŽ¡‘0tools–?ýto“display“or“analyze“an“action“plan“structure.‘ úThe“action“object“id,“however,Ž¡‘0can–?ýalso“be“used“to“establish“additional“ordering“constraints“on“any“of“the“actionsŽ¡‘0in–?ýa“plan.‘ úThese“constraints“supplement“any“initial“order“constraints“establishedŽ¡‘0by–?ýthe“DefaultOrder“option.‘ úConstraints“may“be“established“not“only“within“the“sameŽ¡‘0plan,–?ýbut“between“actions“in“different“plans.– ú(..“Partial–?ýorder“constraints“areŽ¡‘0not–?ýyet“implemented.)ަïhtml:ï html:ŸÇ‘0„¤ŽŽŽŸ*ºâïcolor push Black’Ôï color popŽŽŒ‹¿1 “ºâ ýxºâïcolor push Blackïhtml:ï html:ŸüfdŽŽŽ’Ôï color popŽŽ ^ºâ ýÆïhtml:ï html:Ÿ ‘0ÂMarcus–?ýG.“Daniels“ïhtml:ï html:‘¼rïhtml:ï html:ŽŸ ‘0(mailto:mgd@santafe.edu)ŽŸ8äïhtml:ï html:Ÿ Ç‘0¾Last‘?ýmodified:‘ ú1998-01-08ŽŽŸ*ºâïcolor push Black’Ôï color popŽŽŒ‹Ï› “ºâ ýxºâïcolor push Blackïhtml:ï html:ŸüfdŽŽŽ’Ôï color popŽŽ ^ºâ ýÆïhtml:ï html:Ÿ žâÀNameŽŸªóïhtml:ï html:ŸAÃSchedule–™™{“collection“of“actions“order½«ed“by“time“vÛ$aluesŽŸ‘0„¤ŽŽŸG®ïhtml:ï html:Ÿ¾ŠÀSynopsisŽŸ âcïhtml:ï html:Ÿ}ò‘0Å//ޤ  ‘0//–ffSchedule“--“collection“of“actions“ordered“by“time“valuesŽ¡‘0//Ž¡‘0@deftype–ffSchedule“CREATINGŽ¡‘0-–ffcreate:“aZone“setRelativeTime:“(BOOL)relativeTime;Ž¡‘0-–ffcreate:“aZone“setRepeatInterval:“(timeval_t)repeatInterval;Ž¡‘0SETTINGŽ¡‘0-–ff(void)“setConcurrentGroupType:“groupType;Ž¡‘0-–ff(void)“setSingletonGroups:“(BOOL)singletonGroups;Ž¡¡‘0-–ff(void)“setRelativeTime:“(BOOL)relativeTime;Ž¡‘0-–ff(void)“setRepeatInterval:“(timeval_t)repeatInterval;Ž¡‘0USINGŽ¡‘0-‘ffgetConcurrentGroupType;Ž¡‘0-–ff(BOOL)“getSingletonGroups;Ž¡¡‘0-–ff(BOOL)“getRelativeTime;Ž¡‘0-–ff(timeval_t)“getRepeatInterval;Ž¡¡‘0-–ffat:“(timeval_t)tVal“createAction:“anActionType;Ž¡¡‘0-–ffat:“(timeval_t)tVal“createActionCall:“(func_t)fptr;Ž¡‘0-–ffat:“(timeval_t)tVal“createActionCall:“(func_t)fptr:arg1;Ž¡‘0-–ffat:“(timeval_t)tVal“createActionCall:“(func_t)fptr:arg1:arg2;Ž¡‘0-–ffat:“(timeval_t)tVal“createActionCall:“(func_t)fptr:arg1:arg2:arg3;Ž¡¡‘0-–ffat:“(timeval_t)tVal“createActionTo:“target“message:“(SEL)aSel;Ž¡‘0-–ffat:“(timeval_t)tVal“createActionTo:“target“message:“(SEL)aSel:arg1;Ž¡‘0-–ffat:“(timeval_t)tVal“createActionTo:“target“message:“(SEL)aSel:arg1:arg2;Ž¡‘0-Ž© ‘0at:–ff(timeval_t)tVal“createActionTo:“target“message:“(SEL)aSel:arg1:arg2:arg3;Ž¡¡‘0-–ffat:“(timeval_t)tVal“createActionForEach:“target“message:“(SEL)aSel;Ž¡‘0-–ffat:“(timeval_t)tVal“createActionForEach:“target“message:“(SEL)aSel:arg1;Ž¡‘0-ަ‘0at:–ff(timeval_t)tVal“createActionForEach:“target“message:“(SEL)aSel:arg1:arg2;Ž¡‘0-–ffat:“(timeval_t)tVal“createActionForEach:“target“message:“(SEL)aSel:Ž¡’‰™€arg1:arg2:arg3;ŽŽŸ*ºâïcolor push Black’Ôï color popŽŽŒ‹Ñi “ºâ ýxºâïcolor push Blackïhtml:ï html:ŸüfdŽŽŽ’Ôï color popŽŽ ^ ýБ/ºâÅ@endŽŸ‘/ºâ„¤ŽŽºâŸG®ïhtml:ï html:ŸéüÀDescriptionŽ©‹Ç¾A–?ýschedule“is“compound“action“whose“basic“representation“is“a“sorted“Map“of“actions“that“haveޤ been–?ýcreated“within“it.‘ úThe“key“value“associated“with“each“of“these“actions“is“an“unsignedŽ¡integer–?ývalue“for“which“the“typedef“ïhtml:ï html:timeval_tïhtml:ï html:ަis‘?ýsupplied.Ž©8äïhtml:ï html:ŸÇ‘0„¤ŽŽŸffïhtml:ï html:Ÿu@ÃInherited‘™™beha£×viorŽŸÜ÷ïhtml:ï html:Ÿ ôr‘0Å@deftype–ffSchedule“ޤ -’¾A–?ýschedule“inherits“its“underlying“representation“from“the“ïhtml:ï html:Mapïhtml:ï html:Ž¡(../collections/Map.html)Ž¡type–?ýof“the“ïhtml:ï html:collectionsïhtml:ï html:Ž¡(../collections.html)Ž¡library.‘ úAll–?ýthe“members“of“the“ordered“set“must“consist“only“of“actions“that“are“createdޤ by–?ýone“of“the“createAction“messages“defined“on“Schedule“itself.‘ úOnce“the“actions“are“created,Ž¡they–?ýmay“be“accessed“or“traversed“using“standard“messages“of“the“Map“type.‘ úThe“key“valuesŽ¡of–?ýthis“collection,“however,“must“be“cast“to“and“from“the“id“type“defined“for“key“values“byŽ¡the–?ýMap“type.‘ úPartial“orders“on“these“actions“can“also“established“by“messages“inherited“fromŽ¡Map.– ú(..“Currently,–?ýpartial“orders“are“not“implemented“on“either“collections“or“action“plans,Ž¡but–?ýthe“inherited“messages“will“be“the“basic“method“for“maintaining“them“once“implemented.)ަïhtml:ï html:ŸÇ‘0„¤ŽŽŸffïhtml:ï html:Ÿu@ÃCr½«eate-time‘™™optionsŽŸî&ïhtml:ï html:Ÿ ¥Ò‘0¿Relati•áIv“eTȹimeŽ©`žThe–?ýRelativeTime“option“specifies“that“all“the“times“in“the“schedule“are“relative“to“the“timeŽ¡when–?ýprocessing“of“the“entire“schedule“begins.‘ úOtherwise,“the“times“are“assumed“to“be“absoluteŽ¡times,–?ýwith“their“base“in“the“starting“time“of“the“entire“model.ŽŸ lïhtml:ï html:Ÿ ô®‘0(..‘ úThis–?ýoption“is“currently“supported“only“on“schedules,“not“swarms.)ŽŸ8äïhtml:ï html:Ÿ [‘0¿RepeatInter•áIv“alަ¾The–?ýRepeatInterval“option“specifies“that“as“soon“as“all“actions“in“the“schedule“have“completed,Ž¡it–?ýis“to“be“rescheduled“at“a“time“computed“as“the“time“at“which“the“schedule“was“last“started,Ž¡plus–?ýthe“value“specified“as“the“RepeatInterval“argument.‘ úThis“option“overrides“the“normalŽŽŸ*ºâïcolor push Black’Ôï color popŽŽŒ‹Ú “ºâ ýxºâïcolor push Blackïhtml:ï html:ŸüfdŽŽŽ’Ôï color popŽŽ ^ ýкâ¾default–?ýthat“times“are“considered“absolute,“as“if“the“RelativeTime“option“had“also“been“specifiedޤ ºâat–?ýthe“same“time.‘ úAll“scheduled“times“must“be“less“than“the“specified“repeat“interval,“orŽ¡ºâan–?ýerror“will“be“raised.‘ úThe“RepeatInterval“option“can“continue“to“be“reassigned“to“differentŽ¡ºâvalues–?ýafter“a“schedule“has“been“created,“but“the“interval“value“must“always“be“greater“thanŽ¡ºâthe–?ýscheduled“times“of“any“actions“which“it“contains.Žºâ© lïhtml:ï html:Ÿ ‘0(..› úThis–?ýoption“is“currently“supported“only“on“schedule,“not“swarms.)˜ïhtml:ï html:ïhtml:ï html:ŽŸ8äïhtml:ï html:Ÿ ‚v‘0¿Concurr•ȹentGr“oupT‘ÿ¬ypeŽŸˆ'¾The–?ýConcurrentGroupType“option“is“used“to“control“handling“of“multiple“actions“which“end“upŽ¡being–?ýscheduled“at“the“same“time“value.‘ úAs“far“the“schedule“representation“is“concerned,“theseŽ¡actions–?ýare“assumed“by“default“to“be“concurrently“executable,“and“the“processing“machineryŽ¡is–?ýfree“to“process“them“as“such“if“no“ConcurrentGroupType“option“is“specified.ަïhtml:ï html:© ‘0If–?ýa“different“interpretation“of“actions“at“the“same“time“step“is“needed,“the“ConcurrentGroupTypeŽ¡‘0option–?ýmay“be“specified.‘ úThe“argument“of“this“option“must“be“an“object“that“whenŽ¡‘0given–?ýa“standard“create:‘ úmessage“will“return“an“object“having“all“the“structure“ofŽ¡‘0a–?ýstandard“ActionGroup“object.‘ úFor“example,“if“you“want“to“specify“that“actions“atŽ¡‘0the–?ýsame“time“step“are“to“be“processed“in“random“order,“you“could“use“the“followingŽ¡‘0procedure:ŽŸ8äïhtml:ï html:Ÿïhtml:ï html:¦‘0ÅconcurrentGroupType–ff=“[ActionGroup“customizeBegin:“aZone];ޤ Tô‘:ÌÌ[concurrentGroupType–ffsetDefaultOrder:“Random];Ž¡‘:ÌÌconcurrentGroupType–ff=“[concurrentGroupType“customizeEnd];Ž¡¡‘:ÌÌaSchedule–ff=“[Schedule“createBegin:“aZone];Ž¡‘:ÌÌ[aSchedule–ffsetConcurrentGroupType:“concurrentGroupType];Ž¡‘:ÌÌaSchedule–ff=“[aSchedule“createEnd];Ž¡¾Note–?ýthat“instead“of“using“the“normal“createBegin/End“sequence“to“create“an“instance,“the“concurrentGroupTypeޤ is–?ýinitialized“using“the“customizeBegin/End“sequence“to“customize“a“type“without“creating“anŽ¡instance.‘ úFor–?ýmore“information,“see“the“defobj“library“documentation.ŽŸ8äïhtml:ï html:¦‘0In–?ýaddition“to“overriding“the“standard“ActionGroup“type,“the“concurrent“group“typeŽ¡‘0may–?ýbe“implemented“by“a“custom“subclass“of“the“ActionGroup“implementation“which“youŽ¡‘0supply–?ýyourself.‘ úA“custom“subclass“is“free“to“implement“custom“rules“for“how“to“combineŽ¡‘0all–?ýthe“actions“which“happen“to“arrive“at“the“same“time“value.‘ úFor“example,“it“couldŽ¡‘0decide–?ýthat“some“actions“are“not“to“be“executed“at“all,“or“it“could“create“entirelyŽ¡‘0new–?ýactions“to“be“executed“instead“of“or“in“addition“to“those“which“were“originallyŽ¡‘0scheduled.– ú(..“Specific–?ýrules“for“writing“a“custom“ActionGroup“subclass“will“beŽ¡‘0documented–?ýat“a“future“time,“but“all“the“apparatus“to“do“so“is“present“today.‘ úA“concurrentŽ¡‘0action–?ýgroup“is“currently“used“to“maintain“the“proper“order“of“execution“among“subswarmsŽ¡‘0of–?ýan“owner“swarm.)ŽŸÕSïhtml:ï html:¡ïhtml:ï html:Ÿ æ‘0¿SingletonGrȹoupsŽŸˆ'¾The–?ýSingletonGroups“option“indicates“that“an“action“group“should“be“created“for“every“timeŽ¡value–?ýwhich“is“present,“even“when“only“a“single“action“is“present“at“the“time“value.ŽŸ lïhtml:ï html:ŽŸ*ºâïcolor push Black’Ôï color popŽŽŒ‹ä󠓺â ýxºâïcolor push Blackïhtml:ï html:ŸüfdŽŽŽ’Ôï color popŽŽ ^ ýБ/ºâ¾Ordinarily,–?ýa“concurrent“action“group“is“created“to“process“actions“at“the“same“timestepޤ ‘/ºâonly–?ýif“more“than“one“action“is“scheduled“at“that“timestep.‘ úThe“overhead“of“theseŽ¡‘/ºâaction–?ýgroups“is“relatively“low,“because“it“just“creates“a“single“new“object“to“whichŽ¡‘/ºâactions–?ýare“directly“linked,“but“it“is“still“faster“to“avoid“creating“them“if“onlyŽ¡‘/ºâone–?ýaction“is“present“at“a“timestep.‘ úIf“a“custom“subclass“is“being“provided“however,Ž¡‘/ºâit–?ýmay“need“to“examine“the“actions“at“a“timestep“even“if“there“is“only“one.Žºâ©8äïhtml:ï html:ŸÇ‘0„¤ŽŽŸ ïhtml:ï html:ïhtml:ï html:Ÿffïhtml:ï html:Ÿ\óÃtimeȽvšÛ$al_t–™™{“type“f£×or“clock“v˜aluesŽŸ¹¾The–?ýfollowing“typedef“is“provided“for“convenience“in“declaring“time“values:ŽŸ Ü»ïhtml:ï html:Ÿïhtml:ï html:Ÿ Üa‘0Åtypedef–ffunsigned‘32timeval_t;‘+30//“type“for“time“valuesŽŸ E¾Values–?ýof“this“type“are“used“as“keys“when“inserting“actions“into“a“schedule“at“a“particularŽ¡time,–?ýor“for“querying“the“current“time“value“of“a“swarm“or“schedule“during“its“execution.‘ ú(TheŽ¡shorter–?ýname“time_t“has“already“been“taken“by“one“the“standard“C“libraries.)ަïhtml:ï html:Ÿ Üa‘0For–?ývery“long“running“models“using“finely“divided“units“of“time,“it“is“quite“possibleŽ¡‘0that–?ýa“32-bit“unsigned“time“value“could“overflow.‘ úSpecial“messages“are“provided“inŽ¡‘0the–?ýexecution“machinery“to“reset“all“times“to“a“different“base“value“if“a“danger“ofŽ¡‘0overflow–?ýexists.‘ úIf“this“machinery“is“exercised,“all“times“of“all“referenced“actionŽ¡‘0plans–?ýare“reset“to“a“different“base“value“in“unison,“which“makes“the“shift“as“transparentŽ¡‘0as–?ýpossible.‘ úSeparate“support“is“also“available“to“declare“time“values“that“are“subunitsŽ¡‘0of–?ýthe“discrete“clock“values“in“a“containing“schedule“or“swarm.– ú(..“Currently,‘?ýallŽ¡‘0this–?ýextended“time“unit“support“is“unsupported,“though“there“is“an“example“of“schedulingŽ¡‘0at–?ýsubunit“times“in“a“ïhtml:ï html:GridTurtleïhtml:ï html:ޤ E‘0(../grid.html)Ž¡‘0test‘?ýprogram.)ަïhtml:ï html:ŸÇ‘0„¤ŽŽŸffïhtml:ï html:Ÿ\óÃSchedule‘™™beha£×viorޤ¹¾The–?ýmessages“to“create“actions“within“a“schedule“are“essentially“the“same“as“those“for“ïhtml:ï html:ActionGroupïhtml:ï html:Ž¡(ActionGroup.html)ŽŸ E,–?ýexcept“for“the“presence“of“an“initial“at:‘ úargument“indicating“the“time“at“which“an“actionޤ is–?ýto“be“performed.‘ úExcept“for“the“time“associated“with“each“action,“meaning“of“the“createActionŽ¡messages–?ýis“the“same“as“for“ActionGroup.ަïhtml:ï html:Ÿ Üa‘0When–?ýmultiple“actions“are“all“scheduled“at“the“same“time,“they“are“all“inserted“intoŽ¡‘0a–?ýconcurrent“action“group“created“for“that“time“value.‘ úThe“ïhtml:ï html:ConcurrentGroupTypeïhtml:ï html:ŽŸ E‘0option–?ýmay“be“used“to“override“the“default“action“group“for“these“concurrent“actionsŽ¡‘0by–?ýa“custom“user-defined“subclass.– ú(..“Details–?ýof“doing“this“are“not“yet“documented,Ž¡‘0but–?ýthere“are“examples.)ŽŽŸ*ºâïcolor push Black’Ôï color popŽŽŒ‹óæ “ºâ ýxºâïcolor push Blackïhtml:ï html:ŸüfdŽŽŽ’Ôï color popŽŽ ^ºâ ýÆïhtml:ï html:¤ ‘0„¤ŽŽ¡ïhtml:ï html:¤ ‘0ÂMarcus–?ýG.“Daniels“ïhtml:ï html:‘¼rïhtml:ï html:Ž¡‘0(mailto:mgd@santafe.edu)ŽŸ8äïhtml:ï html:Ÿ Ç‘0¾Last‘?ýmodified:‘ ú1998-01-08ŽŽŸ*ºâïcolor push Black’Ôï color popŽŽŒ‹² “ºâ ýxºâïcolor push Blackïhtml:ï html:ŸüfdŽŽŽ’Ôï color popŽŽ ^ºâ ýÆïhtml:ï html:Ÿ žâÀNameŽŸªóïhtml:ï html:Ÿ'žÃSwarmPrš½«ocess–™™{“object“that“encapsulates“a“collection“of“pr˜ocessesŽ©‘0„¤ŽŽŸG®ïhtml:ï html:ŸàçÀSynopsisŽŸ âcïhtml:ï html:Ÿ O‘0Å//ޤ $}‘0//–ffSwarmProcess“--ŽŸ ‘0an–ffobject“that“holds“a“collection“of“concurrent“subprocessesŽ¡‘0//Ž¡‘0@deftype–ffSwarmProcess“CREATINGŽ¡‘0-–ffsetInternalZoneType:“aZoneType;Ž¡‘0-–ff(void)“setSynchronizationType:“aScheduleType;Ž¡¡‘0-–ff(void)“setInternalTimeMultiplier:“(timeval_t)multiplier;Ž¡‘0USINGŽ¡‘0-‘ffgetSynchronizationType;Ž¡‘0-–ff(timeval_t)“getInternalTimeMultiplier;Ž¡¡‘0-‘ffgetInternalZone;Ž¡‘0-‘ffgetActivity;Ž¡‘0@endŽ¡¡‘0//Ž¡‘0//–ffActivationOrder“--“default“concurrent“group“type“for“swarmŽ¡‘0//Ž¡‘0@deftype–ffActivationOrder“@endަ‘0„¤ŽŽŸG®ïhtml:ï html:ŸàçÀDescriptionŽŸ‚²¾A–?ýswarm“is“an“object“created“to“coordinate“the“processing“performed“on“other“action“types.ޤ Just–?ýlike“any“other“action“type,“a“swarm“may“be“activated“for“running“as“a“subactivity“of“anotherŽ¡swarm.‘ úA–?ýswarm“contains“no“actions“of“its“own,“since“its“only“purpose“is“to“coordinate“theŽ¡processing–?ýof“other“activities.ŽŸ —ïhtml:ï html:Ÿ 뙑0SwarmProcess–?ýis“the“type“of“an“object“that“can“be“activated“to“run“in“some“context,Ž¡‘0and–?ýwhich“itself“then“defines“a“context“in“which“other“action“plans“can“be“activated.Ž¡‘0Subtypes–?ýof“this“generic“type“can“each“define“a“custom“interface“to“activities“runningŽ¡‘0within–?ýthe“swarm.‘ úThe“generic“swarm“type“defines“only“access“to“an“underlying“activityŽ¡‘0that–?ýkeeps“track“of“the“activated“or“running“subactivities,“along“with“an“option“thatŽ¡‘0may–?ýbe“set“to“a“collection“of“objects“currently“being“processed“by“the“swarm.ŽŽŸ*ºâïcolor push Black’Ôï color popŽŽŒ‹² “ºâ ýxºâïcolor push Blackïhtml:ï html:ŸüfdŽŽŽ’Ôï color popŽŽ ^ºâ ýÆïhtml:ï html:Ÿ ‘0¾If–?ýsubactivities“running“within“a“swarm“are“indexed“by“time“(running“either“schedulesޤ ‘0or–?ýother“swarms),“the“default“coordination“performed“by“the“swarm“is“to“merge“allŽ¡‘0the–?ýdifferent“scheduled“actions“so“that“the“actions“of“one“time“value“are“all“performedŽ¡‘0before–?ýthe“actions“of“any“later“time“value.‘ úIf“the“actions“are“not“indexed“by“time,Ž¡‘0or–?ýif“an“subactivity“has“been“released“from“strict“time“synchronization“with“otherŽ¡‘0subactivities–?ýin“the“swarm,“the“default“coordination“is“limited“to“partial“order“constraintsŽ¡‘0among–?ýthe“action“plans“being“run.– ú(..“Currently–?ýonly“the“merging“of“schedules“andŽ¡‘0subswarms–?ýby“time“values“is“supported.)ŽŸ8äïhtml:ï html:Ÿ ð‘0A–?ýpublic“superclass“called“Swarm“is“supplied“in“the“ïhtml:ï html:objectbase“libraryïhtml:ï html:ޤ HÔ‘0(../objectbase.html)Ž¡‘0for–?ýuse“in“implementing“custom“swarm“classes.‘ úSuch“a“class“can“override“the“methodŽ© ‘0for–?ýthe“activateIn:‘ úmessage“of“ïhtml:ï html:ActionTypeïhtml:ï html:Ž¡‘0(ActionType.html)Ž¡‘0to–?ýautomatically“start“subactivities“to“run“within“a“swarm“when“the“swarm“is“firstަ‘0activated.ŽŸïhtml:ï html:Ÿ‘0„¤ŽŽŸffïhtml:ï html:Ÿ‚ÃInherited‘™™beha£×viorŽŸÜ÷ïhtml:ï html:Ÿ ´‘0Å@deftype–ffSwarmProcess“Ž¡¾SwarmProcess–?ýinherits“the“messages“of“both“ïhtml:ï html:ActionTypeïhtml:ï html:Ž¡(ActionType.html)Ž¡and‘?ýïhtml:ï html:Zoneïhtml:ï html:Ž¡(../defobj/Zone.html)Ž¡.‘ úInheritance–?ýof“zone“behavior“means“that“a“swarm“can“be“used“as“the“argument“of“a“create:ަor–?ýcreateBegin:‘ úmessage,“for“creation“of“an“object“within“the“internal“zone“of“a“swarm.ޤ8äïhtml:ï html:Ÿ ð‘0The–?ýdefault“value“for“the“SynchronizationType“option“is“not“a“generic“action“group,ަ‘0but–?ýa“special“predefined“subtype“of“ActionGroup“called“ActivationOrder.‘ úThis“concurrentަ‘0group–?ýtype“guarantees“that“actions“scheduled“to“occur“at“the“same“time“from“differentަ‘0action–?ýplans“running“in“the“same“swarm“are“executed“in“the“same“order“in“which“theަ‘0action–?ýplans“were“first“activated.Ž¡ïhtml:ï html:ŸÇ‘0„¤ŽŽŸffïhtml:ï html:Ÿ‚ÃCr½«eate-time‘™™optionsŽŸ ‘ýïhtml:ï html:Ÿ Z®‘0ÅCREATINGޤ HÔ‘0-–ffsetInternalZoneType:“aZoneType;Ž¡‘0-–ff(void)“setSynchronizationType:“aScheduleType;Ž¡‘0-–ff(void)“setInternalTimeMultiplier:“(timeval_t)multiplier;Ž¡‘0USINGŽ¡‘0-‘ffgetSynchronizationType;Ž¡‘0-–ff(timeval_t)“getInternalTimeMultiplier;ŽŸ bÌïhtml:ï html:ŽŸ*ºâïcolor push Black’Ôï color popŽŽŒ‹  “ºâ ýxºâïcolor push Blackïhtml:ï html:ŸüfdŽŽŽ’Ôï color popŽŽ ^ ýБ/ºâ¿InterÑónalZoneT‘ÿ¬ypeŽ©33ºâ¾The–?ýInternalZoneType“option“sets“the“type“of“zone“which“is“created“by“the“swarm“to“hold“objectsޤ ºâcreated–?ýwithin“the“swarm.‘ úIf“set“to“nil,“no“internal“zone“is“created“within“the“swarm,“andŽ¡ºâall–?ýuse“of“the“swarm“as“if“it“were“a“zone“raises“an“error.‘ úThe“default“of“this“option“is“standardŽ¡ºâZone›?ýtype.– ú(..“Since˜there˜is˜no˜other˜Zone˜type˜yet,˜there's˜no˜reason˜to˜set˜this˜optionŽ¡ºâyet–?ýexcept“to“turn“off“the“internal“zone.‘ ú..)ŽºâŸ lïhtml:ï html:¡ïhtml:ï html:Ÿ -‚‘0¿SynchrȹonizationT‘ÿ¬ypeަ¾Synchronization–?ýtype“sets“the“type“of“schedule“which“is“used“internally“by“the“swarm“to“synchronizeŽ¡subschedules.‘ úIts–?ýdefault“is“a“schedule“with“a“concurrent“group“of“ActivationOrder.ŽŸ lïhtml:ï html:¡ïhtml:ï html:Ÿ -‚‘0¿InterÑónalTȹimeMultiplierަ¾(..‘ úThis–?ýoption“will“be“used“in“the“future“to“support“an“internal“time“unit“within“the“swarmŽ¡that–?ýcan“be“more“fine-grained“than“the“context“in“which“the“swarm“is“included.‘ ú..)ŽŸ lïhtml:ï html:ŸÇ‘0„¤ŽŽŸffïhtml:ï html:ŸG®ÃSwarmPr½«ocess‘™™beha£×viorŽŸÜ÷ïhtml:ï html:Ÿ Æà‘0Å-‘ffgetInternalZone;Ž¡‘0-‘ffgetActivity;Ž¡¾getInternalZone–?ýreturns“a“Zone“object“that“is“used“by“the“swarm“to“hold“its“internal“objects.Ž¡Even–?ýthough“the“swarm“itself“inherits“from“Zone“and“can“be“used“as“a“Zone“for“nearly“all“purposes,Ž¡this–?ýmessage“is“also“provided“so“that“the“zone“itself“can“be“obtained“independent“of“all“zoneŽ¡behavior.ŽŸïhtml:ï html:¡‘0getActivity–?ýreturns“the“activity“which“is“currently“running“of“subactivities“withinŽ¡‘0the–?ýswarm.› úThis“activity“is“the“same“as“the“value“returned“by“activateIn:˜when“theŽ¡‘0swarm–?ýwas“first“activated.‘ úIt“returns“nil“if“the“swarm“has“not“yet“been“activated.Ž©8äïhtml:ï html:Ÿ Ç‘0Unlike–?ýother“action“types,“swarms“and“swarm“activities“always“exist“in“a“one-to-oneŽ¡‘0relationship,–?ýprovided“that“the“swarm“has“been“activated.‘ úThis“restriction“to“a“singleŽ¡‘0activity–?ýenables“the“swarm“to“do“double-duty“as“a“custom“object“that“provides“itsŽ¡‘0own–?ýinterface“to“the“activities“running“within“the“swarm.ަïhtml:ï html:ŸÇ‘0„¤ŽŽŸ ïhtml:ï html:¡‘0ÂMarcus–?ýG.“Daniels“ïhtml:ï html:‘¼rïhtml:ï html:Ž¡‘0(mailto:mgd@santafe.edu)ަïhtml:ï html:Ÿ Ç‘0¾Last‘?ýmodified:‘ ú1998-01-08ŽŽŸ*ºâïcolor push Black’Ôï color popŽŽŒ‹L “ºâ ýxºâïcolor push Blackïhtml:ï html:ŸüfdŽŽŽ’Ôï color popŽŽ ^ºâ ýÆïhtml:ï html:Ÿ žâÀNameŽŸªóïhtml:ï html:Ÿ¡ƒÃAction–™™{“element“of“a“compound“actionŽ©‘0„¤ŽŽŸG®ïhtml:ï html:ŸZÌÀSynopsisŽŸ âcïhtml:ï html:Ÿ 4‘0Å//ޤ žb‘0//–ffAction“--“messages“shared“by“ActionCall,“ActionTo,“and“ActionForEachŽ¡‘0//Ž¡‘0@deftype–ffAction“-“(int)“getNArgs;Ž¡‘0-–ff(void)“setArg1:“arg1;Ž¡‘0-‘ffgetArg1;Ž¡‘0-–ff(void)“setArg2:“arg2;Ž¡‘0-‘ffgetArg2;Ž¡‘0-–ff(void)“setArg3:“arg3;Ž¡‘0-‘ffgetArg3;Ž¡‘0@endŽ¡¡‘0//Ž¡‘0//–ffActionCall“--“an“action“defined“by“calling“a“C“functionŽ¡‘0//Ž¡‘0@deftype–ffActionCall“-“(void)“setFunctionPointer:“(func_t)fptr;Ž¡‘0-–ff(func_t)“getFunctionPointer;Ž¡‘0@endŽ¡¡‘0//Ž¡‘0//–ffActionTo“--“an“action“defined“by“sending“an“Objective“C“messageŽ¡‘0//Ž¡‘0@deftype–ffActionTo“-“(void)“setTarget:“target;Ž¡‘0-‘ffgetTarget;Ž¡‘0-–ff(void)“setMessageSelector:“(SEL)aSel;Ž¡‘0-–ff(SEL)“getMessageSelector;Ž¡‘0@endŽ¡¡‘0//Ž¡‘0//–ffActionForEach“--ŽŸ ‘0an–ffaction“defined“by“sending“to“every“member“of“a“collectionŽ¡‘0//Ž¡‘0@deftype–ffActionForEach“@endަ‘0„¤ŽŽŸG®ïhtml:ï html:ŽŸ*ºâïcolor push Black’Ôï color popŽŽŒ‹#z “ºâ ýxºâïcolor push Blackïhtml:ï html:ŸüfdŽŽŽ’Ôï color popŽŽ ^ ýÑçåºâÀDescriptionŽŸ^5ºâ¾Action–?ýis“a“common“supertype“of“all“action“types“which“may“be“created“within“an“action“plan.ޤ ºâEach–?ýaction“is“always“controlled“by“a“single“action“plan“to“which“it“belongs.‘ úThis“actionŽ¡ºâplan–?ýis“referred“to“as“its“owner.‘ úGiven“the“action“object,“its“owner“plan“may“be“obtainedŽ¡ºâusing–?ýthe“inherited“getOwner“message.ŽºâŸ —ïhtml:ï html:© Ç‘0Actions–?ýare“allocated“in“the“same“zone“as“their“owner“plan,“and“may“be“created“onlyŽ¡‘0using–?ýone“of“the“createAction“messages“on“an“ActionGroup“or“Schedule.‘ úEach“of“theseŽ¡‘0messages–?ýreturns“the“action“that“was“created“as“its“return“value.‘ úActions“in“an“actionŽ¡‘0plan–?ýmay“also“be“obtained“by“processing“the“plan“using“any“of“its“messages“inheritedŽ¡‘0from–?ýits“underlying“collection.‘ úActions“may“also“be“removed“from“an“action“plan“usingŽ¡‘0a–?ýremove“message“on“the“underlying“collection.ŽŸ8äïhtml:ï html:¦‘0(..– úNote:“currently,–?ýan“action“cannot“be“removed“while“it“is“currently“being“executed.Ž¡‘0This–?ýmeans“that“the“function“or“message“called“by“an“action“cannot“itself“remove“thatŽ¡‘0same–?ýaction“from“its“action“plan.‘ úThis“restriction“will“be“removed“in“the“future.)Ž¡‘0No–?ýmatter“what“the“type“of“action,“the“default“ordering“constraints“established“byŽ¡‘0its–?ýmembership“in“an“owning“plan“may“be“supplemented“by“explicit“specification.‘ úTheseŽ¡‘0specifications–?ýare“made“directly“between“actions“in“the“same“plan,“or“between“actionsŽ¡‘0in–?ýdifferent“plans“if“they“are“suitably“qualified.‘ úGiven“any“action“belonging“toŽ¡‘0any–?ýplan,“the“set“of“specific“explicit“ordering“constraints“in“which“it“participatesŽ¡‘0may–?ýbe“obtained“by“one“of“the“messages“getSuccessors,“getPredecessors,“getCostarts,Ž¡‘0and–?ýCoends“inherited“from“the“ïhtml:ï html:KeyedCollectionïhtml:ï html:Ž¡‘0(../collections/KeyedCltn.html)Ž¡‘0type.ŽŸ8äïhtml:ï html:¦‘0Separate–?ýsubtypes“of“Action“are“defined“for“each“of“the“various“forms“of“createActionŽ¡‘0messages–?ýthat“create“them.‘ úThe“current“representation“of“these“actions“will“be“undergoingŽ¡‘0change–?ýas“support“for“their“parameter“and“return“types“is“migrated“into“more“basicŽ¡‘0support–?ýfrom“the“ïhtml:ï html:defobjïhtml:ï html:Ž¡‘0(../defobj.html)Ž¡‘0library.‘ úEach–?ýaction“type“provides“messages“to“retrieve“and“set“the“values“of“allŽ¡‘0argument–?ývalues“bound“into“the“action.‘ úThese“capabilities“will“remain,“but“differentŽ¡‘0messages–?ýwill“eventually“be“supported.‘ úThis“documentation“will“be“completed“onceŽ¡‘0the–?ýmessages“supported“on“Action“types“are“finalized.Ž©8äïhtml:ï html:ŸÇ‘0„¤ŽŽŸ ïhtml:ï html:¡‘0ÂRoger–?ýBurkhart“ïhtml:ï html:‘¼rïhtml:ï html:Ž¡‘0(mailto:rmb@santafe.edu)ަïhtml:ï html:Ÿ Ç‘0¾Last–?ýmodified:‘ ú1997-12-19“(mgd)ŽŽŸ*ºâïcolor push Black’Ôï color popŽŽŒ‹ )> “ºâ ýxºâïcolor push Blackïhtml:ï html:ŸüfdŽŽŽ’Ôï color popŽŽ ^ºâ ýÆïhtml:ï html:ŸIy½ActiÊìvity‘/T‘þw.ypesŽŸq'‘0„¤ŽŽŸG®ïhtml:ï html:ŸÊÀContentsŽŸkÚ¾The–?ýfollowing“object“types“are“documented“below:ŽŸ —ïhtml:ï html:Ÿ ïhtml:ï html:Ÿïhtml:ï html:¤ ÔÁ‘0ïcolor push BlackÁlï color popŽŽ‘:ïhtml:ï html:¾Activityïhtml:ï html:Ž©8äïhtml:ï html:¡‘0ïcolor push BlackÁlï color popŽŽ‘:ïhtml:ï html:¾GroupActivityïhtml:ï html:ަïhtml:ï html:¡‘0ïcolor push BlackÁlï color popŽŽ‘:ïhtml:ï html:¾ForEachActivityïhtml:ï html:ަïhtml:ï html:¡‘0ïcolor push BlackÁlï color popŽŽ‘:ïhtml:ï html:¾ScheduleActivityïhtml:ï html:ަïhtml:ï html:¡‘0ïcolor push BlackÁlï color popŽŽ‘:ïhtml:ï html:¾SwarmActivityïhtml:ï html:ŽŸ‘0„¤ŽŽŸ ïhtml:ï html:ïhtml:ï html:ŸG®ïhtml:ï html:ŸÊÀNameŽŸªóïhtml:ï html:ŸÆÃActiÛ$vity–™™{“state“of“pr½«ocessing“within“an“action“planŽŸ5Ôïhtml:ï html:ŸÛéÀSynopsisŽŸ âcïhtml:ï html:Ÿ‰w‘0Å//ޤ ¥‘0//–ffActivity“--“state“of“processing“within“an“action“planŽ¡‘0//Ž¡‘0@deftype–ffActivity“-“run;Ž¡‘0-‘Pÿústop;Ž¡‘0-–ff(void)“terminate;Ž¡¡‘0-‘ffnext;Ž¡‘0-‘ffstep;Ž¡‘0-‘ffstepEntry;Ž¡‘0-‘ffstepExit;Ž¡¡‘0-‘ffgetStatus;Ž¡‘0-‘ffgetHoldType;Ž¡¡‘0-‘ffgetAction;Ž¡‘0-‘ffgetActionType;ŽŽŸ*ºâïcolor push Black’Ôï color popŽŽŒ‹!6* “ºâ ýxºâïcolor push Blackïhtml:ï html:ŸüfdŽŽŽ’Ôï color popŽŽ ^ ýФ dŒ‘/ºâÅ-–ff(void)“setOwnerActivity:“ownerActivity;Ž¡‘/ºâ-‘ffgetOwnerActivity;Ž¡¡‘/ºâ-‘ffgetSubactivities;Ž¡¡‘/ºâ-‘ffgetControllingActivity;Ž¡‘/ºâ-‘ffgetTopLevelActivity;Ž¡‘/ºâ-‘ffgetSwarmActivity;Ž¡‘/ºâ-‘ffgetScheduleActivity;Ž¡¡‘/ºâ-–ffsetSerialMode:“(BOOL)serialMode;Ž¡‘/ºâ-–ff(BOOL)“getSerialMode;Ž¡¡‘/ºâ-–ffgetCurrentSubactivity;‘ ÌÌ//“serial“mode“onlyŽ¡‘/ºâ@endŽŸ‘/ºâ„¤ŽŽºâŸG®ïhtml:ï html:Ÿ öÀDescriptionŽŸÂÁ¾A–?ýobject“of“type“Activity“implements“the“processing“of“actions“within“an“action“plan.‘ úEachޤ subtype–?ýof“action“plan“has“a“corresponding“subtype“of“Activity“that“implements“processing“ofŽ¡its–?ýrespective“type“of“plan.ŽŸ —ïhtml:ï html:© +¨‘0The–?ýActivity“types“are“part“of“the“virtual“processing“machinery“of“an“action“planŽ¡‘0interpreter.‘ úAll–?ýthe“important“elements“of“this“machinery,“including“their“currentŽ¡‘0state–?ýof“processing,“are“exposed“to“aid“in“development“of“general-purpose“tools“suchŽ¡‘0as–?ýdebuggers.‘ úExcept“for“applications“that“need“to“create“and“run“their“own“reflectiveŽ¡‘0activities,–?ýdirect“use“of“activity“types“by“a“modeling“application“should“be“rare.ŽŸ8äïhtml:ï html:¦‘0An–?ýnew“activity“object“is“created“by“each“activateIn:‘ úmessage“sent“to“an“action“type.Ž¡‘0activateIn:‘ úinitializes–?ýa“new“activity“object“and“prepares“it“for“processing,“butŽ¡‘0does–?ýnot“itself“execute“any“actions.‘ úSubsequent“messages,“such“as“run,“must“be“usedŽ¡‘0to–?ýinitiate“processing“within“an“activity.‘ úIf“an“activity“is“activated“to“run“underŽ¡‘0a–?ýswarm“context,“the“owning“swarm“itself“controls“all“processing“within“the“subactivity.ŽŸ8äïhtml:ï html:¦‘0An–?ýActivity“type“holds“a“tree“of“currently“running,“or“a“potentially“runnable,“subactivities.Ž¡‘0Each–?ýactivity“object“represents“a“state“of“processing“within“a“single“action“plan.Ž¡‘0The–?ýstructure“is“a“tree“because“multiple“activities“could“be“running“or“eligible“toŽ¡‘0run–?ýat“the“same“time.‘ úThis“occurs“whenever“two“activities“are“specified“as“concurrent,Ž¡‘0either–?ýbecause“are“being“performed“by“concurrent“actions“in“some“other“plan,“or“becauseŽ¡‘0they–?ýwere“started“for“autonomous“execution“under“the“same“swarm.‘ úWhen“parallel“processingŽ¡‘0machinery–?ýis“present,“each“activity“could“also“be“advancing“its“own“state“independentŽ¡‘0of–?ýthose“of“any“other“activity.ŽŸ8äïhtml:ï html:¦‘0The–?ýcurrent“implementation“supports“only“a“single“serial“processor.‘ úUnder“serialŽ¡‘0execution,–?ýonly“one“activity“may“be“active“at“one“time.‘ úThis“means“that“the“currentŽŽŸ*ºâïcolor push Black’Ôï color popŽŽŒ‹"=¶ “ºâ ýxºâïcolor push Blackïhtml:ï html:ŸüfdŽŽŽ’Ôï color popŽŽ ^ ýБ/ºâ¾state–?ýof“processing“may“be“represented“by“a“single“stack“of“current“activities“thatޤ ‘/ºâtraces–?ýa“path“to“a“single“leaf“of“the“runnable“activity“tree.‘ úWhen“running“in“serialŽ¡‘/ºâmode,–?ýmessages“are“available“to“obtain“the“currently“running“leaf“activity“or“usefulŽ¡‘/ºâcontext–?ýinformation“such“as“the“current“time“available“from“it.ŽºâŸïhtml:ï html:Ÿ‘0„¤ŽŽŸffïhtml:ï html:Ÿ\ÃActiÛ$vity‘™™beha£×viorŽ©ë…¾(..‘ úSpecific–?ýmessages“for“activity“objects“are“still“subject“to“change“as“some“of“their“underlyingŽ¡support–?ýmigrates“to“the“ïhtml:ï html:defobjïhtml:ï html:ަ(../defobj.html)Ž© G®library.‘ úFor–?ýnow,“this“section“will“document“just“the“basic“messages“to“start“and“controlŽ¡processing–?ýwithin“an“activity.)ŽŸ8äïhtml:ï html:Ÿ Ê‘0Å-‘ffrun;ަ‘0-‘Pÿústop;ަ‘0-–ff(void)“terminate;ަ¾The–?ýrun“message“continue“processing“of“an“activity“from“any“state“in“which“its“execution“hasŽ¡been–?ýsuspended.› úAn“error“is“raised“if“the“activity“is“already“running.˜run“returns“eitherŽ¡a–?ýStopped“or“Completed“status“that“the“activity“has“when“it“is“no“longer“eligible“to“be“runŽ¡further.ŽŸïhtml:ï html:¦‘0The–?ýstop“message“causes“the“a“currently“running“tree“of“activities“to“stop“furtherŽ¡‘0processing–?ýand“return“a“Stopped“status.‘ úterminate“also“stops“a“running“tree“of“activities,Ž¡‘0but–?ýsets“all“activities“within“the“tree“to“a“status“of“Completed“whenever“the“treeŽ¡‘0is–?ýnext“run.‘ úterminate“may“be“used“on“either“a“running“or“stopped“tree“of“activities.Ž¡‘0It–?ýis“the“standard“way“to“terminate“schedule“that“is“endlessly“repeating“under“theŽ¡‘0RepeatInterval‘?ýoption.ŽŸ8äïhtml:ï html:Ÿïhtml:ï html:Ÿ Ê‘0Å-‘ffnext;ަ‘0-‘ffstep;ަ‘0-‘ffstepEntry;ަ‘0-‘ffstepExit;ަ¾The–?ýnext“executes“actions“within“a“single“compound“action“while“skipping“over“all“processingŽ¡of–?ýany“complete“action“plans“executed“by“those“actions.‘ úThe“step“message“executes“a“singleŽ¡action–?ýwithin“a“tree“of“activities.‘ úThe“stepEntry“message“executes“multiple“actions“withinŽ¡a–?ýsingle“currently“runnable“activity,“but“stops“the“activity“when“a“new“level“of“action“planŽ¡has–?ýjust“been“started“within“the“tree“of“activities.‘ ústepExit“executes“multiple“actions“inŽ¡the–?ýsame“action“plan“until“the“activity“for“that“action“plan“has“completed,“or“cannot“otherwiseŽ¡be–?ýrun“further.– ú(..“Currently,–?ýstepEntry“and“stepExit“are“unimplemented.)ŽŸ8äïhtml:ï html:Ÿïhtml:ï html:Ÿ Ê‘0Å-‘ffgetStatus;ަ‘0-‘ffgetHoldType;ަ¾The–?ýgetStatus“message“returns“one“of“the“following“codes“for“the“current“run“status“of“a“particularŽ¡activity:ŽŸ8äïhtml:ï html:Ÿ Ê‘0Åextern–ffid“‘ ÌÌInitialized,“Running,“Stopped,“Holding,ŽŽŸ*ºâïcolor push Black’Ôï color popŽŽŒ‹#I “ºâ ýxºâïcolor push Blackïhtml:ï html:ŸüfdŽŽŽ’Ôï color popŽŽ ^ ýБETzÅReleased,–ffTerminated,“Completed;ŽŸ )iºâ¾The–?ýgetHoldType“returns“a“code“for“the“particular“hold“constraint“under“which“an“activity“isޤ ºâcurrently–?ýholding.› úIt“returns“nil“if“the“basic“status“of“the“activity“is“not“Holding.˜(..Ž¡ºâCurrently–?ýno“hold“constraints“other“than“merging“within“a“swarm“are“supported,“and“this“messageŽ¡ºâalways–?ýreturns“nil.)ŽºâŸ8äïhtml:ï html:Ÿïhtml:ï html:© ð…‘0Åextern–ffid“‘ ÌÌHoldStart,“HoldEnd;ŽŸ‘0„¤ŽŽŸffïhtml:ï html:ŸqÃActiÛ$vity–™™context“macr½«osŽŸÍ@¾The–?ýcurrent“running“activity“is“always“available“for“reference“within“any“action“running“withinŽ¡the›?ýactivity.– ú(..“Currently,˜the˜getCurrentActivity()˜macro˜raises˜an˜error,˜but˜the˜otherŽ¡macros–?ýwork“as“long“as“there“is“a“currently“running“activity.– ú..)“The–?ýfollowing“macros“provideŽ¡access–?ýto“various“information“available“from“the“current“running“activity“and“its“owner“activities:ŽŸ Ü»ïhtml:ï html:¦‘0Å#define‘ ÌÌgetCurrentActivity()ޤ )i‘0#define‘ ÌÌgetCurrentAction()Ž¡‘0#define‘ ÌÌgetCurrentTime()Ž¡‘0#define‘ ÌÌgetCurrentScheduleActivity()Ž¡‘0#define‘ ÌÌgetCurrentSchedule()Ž¡‘0#define‘ ÌÌgetCurrentSwarmActivity()Ž¡‘0#define‘ ÌÌgetCurrentSwarm()Ž¡‘0#define‘ ÌÌgetCurrentSwarmActivity()Ž¡‘0#define‘ ÌÌgetTopLevelActivity()ŽŸ‘0„¤ŽŽŸG®ïhtml:ï html:©åÓÀActiÓÅvity‘QësubtypesŽŸ âcïhtml:ï html:Ÿ ¥;‘0¾(..› úOnly–?ýa“synopsis“of“Activity“subtypes“is“provided“here“for“now.˜Note,“howeverޤ ‘0that–?ýaccess“to“a“current“time“is“available“from“a“schedule“or“swarm“activity,“alongŽ¡‘0with–?ýthe“ability“to“run“a“schedule“until“a“particular“time“value“is“first“reached.)ŽŸ8äïhtml:ï html:ŸÇ‘0„¤ŽŽŸ ïhtml:ï html:ïhtml:ï html:ŸG®ïhtml:ï html:¦ÀNameŽŸªóïhtml:ï html:Ÿ,ŠÃGrš½«oupActiÛ$vity–™™{“state“of“pr˜ocessing“within“an“ActionGr˜oupŽŸ5Ôïhtml:ï html:ŽŸ*ºâïcolor push Black’Ôï color popŽŽŒ‹$Uˆ “ºâ ýxºâïcolor push Blackïhtml:ï html:ŸüfdŽŽŽ’Ôï color popŽŽ ^ ýÑçåºâÀSynopsisŽºâ© âcïhtml:ï html:Ÿ÷2‘0Å//ޤ {`‘0//–ffGroupActivity“--“state“of“processing“within“an“ActionGroupŽ¡‘0//Ž¡‘0@deftype–ffGroupActivity“@endŽŸ‘0„¤ŽŽŸ ïhtml:ï html:ïhtml:ï html:ŸG®ïhtml:ï html:Ÿ7ÊÀNameŽŸªóïhtml:ï html:Ÿ~ÃFš£×orEachActiÛ$vity–™™{“state“of“pr½«ocessing“within“an“F˜orEach“actionŽŸ5Ôïhtml:ï html:ŸI¤ÀSynopsisަïhtml:ï html:Ÿ÷2‘0Å//Ž¡‘0//–ffForEachActivity“--“state“of“execution“within“a“ForEach“actionŽ¡‘0//Ž¡‘0@deftype–ffForEachActivity“Ž¡‘0-‘ffgetCurrentMember;Ž¡‘0@endŽŸ‘0„¤ŽŽŸ ïhtml:ï html:ïhtml:ï html:ŸG®ïhtml:ï html:Ÿ7ÊÀNameŽŸªóïhtml:ï html:Ÿ~ÃScheduleActiÛ$vity–™™{“state“of“execution“within“a“ScheduleŽŸ5Ôïhtml:ï html:ŸI¤ÀSynopsisަïhtml:ï html:Ÿ÷2‘0Å//Ž¡‘0//–ffScheduleActivity“--“state“of“execution“within“a“ScheduleŽ¡‘0//Ž¡‘0@deftype–ffScheduleActivity“Ž¡‘0-‘ff(timeval_t)‘32getCurrentTime;Ž¡¡‘0-–ffstepUntil:“(timeval_t)tVal;‘ ÌÌ//“unimplementedŽ¡‘0@endŽŽŸ*ºâïcolor push Black’Ôï color popŽŽŒ‹%^¤ “ºâ ýxºâïcolor push Blackïhtml:ï html:ŸüfdŽŽŽ’Ôï color popŽŽ ^ ýБ/ºâ„¤ŽŽºâ© ïhtml:ï html:ïhtml:ï html:ŸG®ïhtml:ï html:Ÿ¼jÀNameŽŸªóïhtml:ï html:Ÿ!ÃSwarmActišÛ$vity–™™{“a“collection“of“started“subacti˜vitiesŽŸ5Ôïhtml:ï html:ŸÎDÀSynopsisŽŸ âcïhtml:ï html:Ÿ{Ò‘0Å//ޤ ‘0//–ffSwarmActivity“--“a“collection“of“started“subactivitiesŽ¡‘0//Ž¡‘0@deftype–ffSwarmActivity“Ž¡‘0@endŽŸ‘0„¤ŽŽ¦ïhtml:ï html:¡‘0ÂMarcus–?ýG.“Daniels“ïhtml:ï html:‘¼rïhtml:ï html:Ž¡‘0(mailto:mgd@santafe.edu)ŽŸ8äïhtml:ï html:Ÿ Ç‘0¾Last‘?ýmodified:‘ ú1998-01-08ŽŽŸ*ºâïcolor push Black’Ôï color popŽŽŒ‹&dj “ºâ ýxºâïcolor push Blackïhtml:ï html:ŸüfdŽŽŽ’Ôï color popŽŽ ^ºâ ýÆïhtml:ï html:ŸIy½ActiÊìvity–/Library:‘m™Subclassing“Refer |enceŽŸq'‘0„¤ŽŽ© ïhtml:ï html:¤ ‘0¾Subclassing–?ýis“supported“by“the“activity“library“as“an“integral“technique“for“extendingŽ¡‘0the–?ýframework“it“implements.‘ úThere“are“two“specific“places“where“subclassing“is“expectedŽ¡‘0as–?ýthe“normal“technique“of“extension:‘ údefinition“of“concurrent“action“groups,“andŽ¡‘0definition–?ýof“customized“swarm“objects.‘ úConcurrent“action“groups“are“not“yet“fullyŽ¡‘0documented–?ýbecause“their“full“interface“is“still“being“finalized.‘ úSwarm“subclassesŽ¡‘0should–?ýinherit“from“the“Swarm“superclass“defined“in“the“ïhtml:ï html:objectbaseïhtml:ï html:Ž¡‘0(../objectbase.html)Ž¡‘0library;–?ýthe“activity“library“provides“the“underlying“support“packaged“by“this“superclass.ŽŸ8äïhtml:ï html:ŸÇ‘0„¤ŽŽ¦ïhtml:ï html:¡‘0ÂMarcus–?ýG.“Daniels“ïhtml:ï html:‘¼rïhtml:ï html:Ž¡‘0(mailto:mgd@santafe.edu)ŽŸ8äïhtml:ï html:Ÿ Ç‘0¾Last‘?ýmodified:‘ ú1998-01-08ŽŽŸ*ºâïcolor push Black’Ôï color popŽŽŒ‹'h “ºâ ýxºâïcolor push Blackïhtml:ï html:ŸüfdŽŽŽ’Ôï color popŽŽ ^ºâ ýÆïhtml:ï html:ŸIy½ActiÊìvity–/Library:‘m™Interface“Design“NotesŽŸq'‘0„¤ŽŽ¤ ïhtml:ï html:© ‘0¾(This–?ýsection“of“documentation“is“not“yet“available.)ŽŸ8äïhtml:ï html:ŸÇ‘0„¤ŽŽ¡ïhtml:ï html:¦‘0ÂMarcus–?ýG.“Daniels“ïhtml:ï html:‘¼rïhtml:ï html:ަ‘0(mailto:mgd@santafe.edu)ŽŸ8äïhtml:ï html:Ÿ Ç‘0¾Last‘?ýmodified:‘ ú1998-01-08ŽŽŸ*ºâïcolor push Black’Ôï color popŽŽŒ‹(mš “ºâ ýxºâïcolor push Blackïhtml:ï html:ŸüfdŽŽŽ’Ôï color popŽŽ ^ ýк⟼jïhtml:ï html:Ÿâ ½ActiÊìvity–/Library:‘m™Implementation“NotesŽŸq'‘0„¤ŽŽ¤ ïhtml:ï html:© ‘0¾(This–?ýsection“of“documentation“is“not“yet“available.)ŽŸ8äïhtml:ï html:ŸÇ‘0„¤ŽŽ¡ïhtml:ï html:¦‘0ÂMarcus–?ýG.“Daniels“ïhtml:ï html:‘¼rïhtml:ï html:ަ‘0(mailto:mgd@santafe.edu)ŽŸ8äïhtml:ï html:Ÿ Ç‘0¾Last–?ýmodified:‘ ú1998-01-08“(mgd)ŽŽŸ*ºâïcolor push Black’Ôï color popŽŽŒøpiƒ’À;è—T~Óºâ (ó0ˆÛ pcrr7tóÓߌ˜ff ptmb7tóßê