÷ƒ’À;è TeX output 1998.01.28:1947‹ÿÿÿÿ “ºâ ýxºâïcolor push Blackïhtml:ï html:ŸüfdŽŽŽ’Ôï color popŽŽ ^ºâ ýÆïhtml:ï html:ŸIyóÓߌ˜¼j ptmb7t½Objectbase‘/LibraryŽŸq'‘0„¤ŽŽŸ ïhtml:ï html:ŸœU‘0óÓߌ˜ ptmb7t¿Documentation–and“Implementation“StatusŽŸ‘0„¤ŽŽŸG®ïhtml:ï html:Ÿ)Â’Úqï>PSfile="eps/bomb.eps" llx=290 lly=365 urx=321 ury=396 rwi=310 ŽŽŸòYóÓߌ˜G® ptmb7tÀCompatibilityŽŸ âcïhtml:ï html:¤ïhtml:ï html:Ÿ±Á‘0ïcolor push Blackó\ùð pzdrÁlï color popŽŽ‘:óßê“1.0.5ލ¬ïhtml:ï html:Ÿ C‘:No‘?ýchanges.ŽŸ8äïhtml:ï html:¡ïhtml:ï html:Ÿ ý ‘0ïcolor push BlackÁlï color popŽŽ‘:¾1.0.3–?ý=>“1.0.4ަïhtml:ï html:Ÿ C‘:The–?ýname“of“this“library“is“now“ïhtml:ï html:ïhtml:ï html:ó0ˆÛ pcrb7tÂobjectbase¾,“it“is“has“been“renamed“from“ïhtml:ï html:ïhtml:ï html:Âswarmob-ޤ ‘Hject–?ý¾largely“to“reflect“the“more“generic“nature“of“the“library“and“also“motivatedŽ¡‘Hby–?ýthe“impending“port“of“Swarm“to“Windows“NT“(to“avoid“filename“conflicts“withŽ¡‘Hthe–?ýïhtml:ï html:ó0ˆÛ pcrr7tÃSwarmObject“¾class).‘ úThere“should“be“little,“or“no“effect“on“the“user,“theŽ¡‘Honly–?ývisible“change“is“the“fact“that“the“actual“library“(.a)“or“(.so)“file“willŽ¡‘Hnow–?ýhave“a“different“name“and“the“header“file“name“has“changed.‘ úA“symbolic“linkŽ¡‘Hfrom–?ýïhtml:ï html:Ãobjectbase.h“¾to“ïhtml:ï html:Ãswarmobject.h“¾has“been“provided“in“the“distribution,“toŽ¡‘Hensure–?ýbackwards“compatibility,“however,“users“should“ïhtml:ï html:not“continue“to“rely“onŽ¡‘Hthis–?ýbeing“so.‘ úUsers“should“port“references“to“ïhtml:ï html:Ãswarmobject.h“¾in“their“code“toŽ¡‘Hïhtml:ï html:Ãobjectbase.h¾,–?ýbecause“this“symlink“will“be“removed“in“a“future“release.ŽŸ8äïhtml:ï html:ïhtml:ï html:ïhtml:ï html:© ý ‘:Note:‘ úthis–?ýis“no“way“affects“the“ïhtml:ï html:ÃSwarmObject“¾class“which“remains“the“same“as“inŽ¡‘Hall–?ýprevious“releases.ŽŸ8äïhtml:ï html:¦‘0ïcolor push BlackÁlï color popŽŽ‘:¾1.0.0–?ý=>“1.0.1Žž¬ïhtml:ï html:Ÿ C‘:The–?ýinterface“has“changed“again!‘ úïhtml:ï html:óßêï html:ÄCustomProbeMap‘¼r¾,Ž¡‘Hwhich–?ýis“subclassed“from“ïhtml:ï html:ÄProbeMap‘¼r¾.› úAnd“a“shortcut“ïhtml:ï html:Ãcreate:˜¾method“was“addedŽ¡‘Hto–?ýthat“branch.Žïhtml:ï html:Ÿ 5ï‘:Also,–?ýa“new“method“was“added“to“ïhtml:ï html:ÄProbeLibrary‘üo¾called“ïhtml:ï html:ÃisProbeMapDefinedFor“¾that“servesŽ¡‘Hto–?ýnon-invasively“test“for“the“existence“of“a“ïhtml:ï html:ÄProbeMap‘üo¾for“a“given“class.ŽŸ8äïhtml:ï html:¦‘0ïcolor push BlackÁlï color popŽŽ‘:ïhtml:ï html:ÄBeta‘üo¾=>‘?ý1.0.0Žž¬ïhtml:ï html:Ÿ C‘:The–?ýnew“interface“for“the“ïhtml:ï html:Äswarmobject‘üo¾library“might“cause“some“problems“for“appsŽ¡‘Hthat–?ýworked“under“the“Beta“release“of“Swarm.‘ úTo“get“the“whole“scoop,“read“theŽ¡‘Hïhtml:ï html:Library–?ýInterface“Conventionsïhtml:ï html:ޤ 5ï‘:(defobj/library.html)Ž¡‘:.› úTo–?ýget“a“few“hints“at“explicit“changes“you“might“need“to“make,“check“out:˜ïhtml:ï html:PortingŽŸ ‘Happs–?ýto“use“the“new“ïhtml:ï html:Äswarmobject‘üo¾interfaceïhtml:ï html:Ž¡‘:(objectbase/PortingAppsToNewInterface.html)Ž¡‘:.ŽŽŸ*ºâïcolor push Black’Ôï color popŽŽŒ‹* “ºâ ýxºâïcolor push Blackïhtml:ï html:ŸüfdŽŽŽ’Ôï color popŽŽ ^ ýБ/ºâ„¤ŽŽºâŸG®ïhtml:ï html:Ÿa”ÀOv•ÓÅer“viewŽ©_ó3{Ù ptmr7t¼The– ïhtml:ï html:Äobjectbase‘Ǽlibrary“encapsulates“vÀarious“fundamental“aspects“of“the“ïhtml:ï html:¾Swarm“¼object“model“and“de nes“the“probingޤ machinery–Û•used“to“takæge“data“from“ïhtml:ï html:¾Swarm“¼objects.‘,XMost“of“the“underlying“functionality“of“the“classes“de ned“here“isŽ¡contained–€in“the“ïhtml:ï html:ïhtml:ï html:Ädefobj‘¼rïhtml:ï html:ަ(defobj.html)ޤ ¥*¼and‘€ïhtml:ï html:ïhtml:ï html:Äactivity‘¼rïhtml:ï html:Ž¡(activity.html)Ž¡¼libraries.ŽŸ´ïhtml:ï html:Ÿ †v‘0¾The–?ýmain“classes“defined“here“that“are“intended“to“be“subclassed“by“users“are“Swarmޤ ‘0and–?ýSwarmObject.‘ úThe“probing“functionality“provided“here“is“mainly“for“use“withinŽ¡‘0the–?ýïhtml:ï html:Swarm“kernel.‘ úHowever,“this“probe“machinery“should“be“used“when“designing“anyŽ¡‘0interface–?ýbetween“ïhtml:ï html:Swarm“and“any“other“agent“or“device.ŽŸŸJïhtml:ï html:Ÿ³ôóÓߌ˜ff ptmb7tÆSwarmObjectŽŸ ‘ýïhtml:ï html:Ÿþ²ÄSwarmObject‘¾—¼is–%the“base“class“for“all“interactiÀvÙ e“agents“in“ïhtml:ï html:¾Swarm¼.‘ It“de nes“the“standard“behaÌÐvior“for“SwægarmstyleޤG®agents,–€which“includes“hooks“for“creation,“probing,“zoned“memory“allocation,“and“destruction.Ž©žïhtml:ï html:Ÿ ÆSwarmŽŸ¯¼The–¬ïhtml:ï html:ÄSwarm›hˆ¼class“encapsulates“all“of“the“abstract“e•Ù x“ecution–¬machinery“in“the“ïhtml:ï html:Äactivity˜¼library‘ÿY ,‘·as“well“as“the“notionŽ¡of–h¦a“group“of“related“objects.‘ÐMetaphorically‘ÿY ,‘mRa“"Swægarm"“is“a“combination“of“a“collection“of“objects“and“a“schedule“ofŽ¡actiÀvity›áýo•Ù v“er˜those˜objects.‘?Hence,‘ú}the˜ïhtml:ï html:ÄSwarm‘žo¼class˜pro“vides˜the˜behaÌÐvior˜necessary˜for˜creating˜such˜an˜object˜andŽ¡starting–€up“the“schedule.ަïhtml:ï html:Ÿ ÆPr½«obesŽ©I¼Probes–·Úare“idealized“entities“that“are“intended“to“alloÀw“the“user“to“monitor“and“modify“the“innards“of“objects“withoutޤ e•Ù xplicitly›o½pro“viding˜the˜functionality˜to˜do˜so˜at˜compile˜time.‘,Hence,‘rýthe“y˜alloÀw˜dynamic˜interaction˜with˜an˜objectsŽ¡instance–QüvÀariables“and“methods.‘ŒMost“of“the“functionality“of“probes“is“implemented“here;‘ºúbÌÐut,›†{at“present,˜theÙ y“areŽ¡intimately–€linkæged“to“the“ïhtml:ï html:ïhtml:ï html:Äsimtools‘¼rïhtml:ï html:ަ(simtools.html)Ž© ¥*¼library›ÿY ,‘SŸwhich–öcontains“all“the“widgetry“needed“to“use“probes“from“a“GUI.“Despite“this“intimacÙ y˜,‘SŸprobes“are“in-Ž¡tended–·to“be“a“general“purpose“mechanism“for“ïhtml:ï html:¾any“¼agent“or“deÀvice“to“interact“dynamically“with“ïhtml:ï html:¾Swarm“¼objects.‘ÀoThisŽ¡ïhtml:ï html:ïhtml:ï html:¾Introduction–?ýto“Probesïhtml:ï html:ަ(probing.html)ަ¼will–€eÙ xplain“more“about“the“reasoning“and“purpose“behind“probes.ŽŽŸ*ºâïcolor push Black’Ôï color popŽŽŒ‹j “ºâ ýxºâïcolor push Blackïhtml:ï html:ŸüfdŽŽŽ’Ôï color popŽŽ ^ ýБ/ºâ„¤ŽŽºâŸG®ïhtml:ï html:Ÿ¼jÀDocumentationޤ^5¼The–MZïhtml:ï html:Äobjectbase‘ ̼library“is“de ned“and“documented“folloÀwing“the“basic“structure“of“the“ïhtml:ï html:¾Library‘?ýInterfaceŽ© Conventionsïhtml:ï html:Ž¡(defobj/library.html)ަ¼.‘˜The–€follošÀwing“standard“sections“of“documentation“are“aÌÐv˜ailable:ŽŸ *8ïhtml:ï html:Ÿïhtml:ï html:Ÿ ÕÈ‘0ïcolor push BlackÁlï color popŽŽ‘:ïhtml:ï html:¾Interface‘?ýReferenceïhtml:ï html:ަ‘0(objectbase/Interface.html)ޤ8äïhtml:ï html:Ÿ Ç‘0ïcolor push BlackÁlï color popŽŽ‘:ïhtml:ï html:¾Usage‘?ýGuideïhtml:ï html:ަ‘0(objectbase/UsageGuide.html)Ž¡ïhtml:ï html:¤ Ç‘0ïcolor push BlackÁlï color popŽŽ‘:ïhtml:ï html:¾Advanced–?ýUsage“Notesïhtml:ï html:ަ‘0(objectbase/AdvancedUsage.html)ŽŸ 8äïhtml:ï html:Ÿïhtml:ï html:¡‘0ïcolor push BlackÁlï color popŽŽ‘:ïhtml:ï html:¾Interface–?ýDesign“Notesïhtml:ï html:ަ‘0(objectbase/InterfaceDesign.html)ŽŸ8äïhtml:ï html:¡‘0ïcolor push BlackÁlï color popŽŽ‘:ïhtml:ï html:¾Implementation‘?ýNotesïhtml:ï html:ަ‘0(objectbase/Implementation.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-10ŽŽŸ*ºâïcolor push Black’Ôï color popŽŽŒ‹: “ºâ ýxºâïcolor push Blackïhtml:ï html:ŸüfdŽŽŽ’Ôï color popŽŽ ^ºâ ýÆïhtml:ï html:ŸIy½Objectbase–/Library:‘m™Documentation“andŽŸâ Implementation‘/StatusŽŸq'‘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:ŸIy½Swarmobject–/Library:‘m™P•Üorting“A‘ÿ{Jpps“to“the“NewŽŸâ InterfaceŽŸq'‘0„¤ŽŽŸ ïhtml:ï html:Ÿ Ñ ‘0¾The–?ýproblems“that“might“arise“because“of“this“new“interface“should“have“to“do“withޤ ‘0the–?ýplacement“or“existence“of“C“preprocessor“ïhtml:ï html:Ã#import¾s.‘ úIn“the“beta“release,“theŽ¡‘0ïhtml:ï html:Ãobjectbase.h–?ý¾file“simply“included“all“the“header“files“for“each“class“defined“inŽ¡‘0the–?ýïhtml:ï html:objectbase“library.‘ úThese“files“contain“the“ïhtml:ï html:Ã@interface“¾declarations“for“eachŽ¡‘0respective–?ýclass.‘ úHence,“before,“if“an“application“file“included“ïhtml:ï html:Ãobjectbase.h¾,“itŽ¡‘0was–?ýincluding“the“interface“for“every“class“in“the“library.ŽŸ8äïhtml:ï html:© ˜'‘0The–?ýSwarm“standard“module“interface“uses“Objective-C“protocols“to“establish“whichŽ¡‘0messages–?ýmay“be“sent“to“objects“of“a“class.‘ úDoing“this“isolates“the“classes“in“theŽ¡‘0library–?ýmore“completely“from“the“rest“of“the“code.‘ úSo,“the“problems“that“are“likelyŽ¡‘0to–?ýarise“from“this“new“interface“are“ones“of“access“to“objects“that“reside“in“theŽ¡‘0ïhtml:ï html:objectbase–?ýlibrary.‘ úAnd“they“are“of“two“types:ŽŸ 8äïhtml:ï html:Ÿïhtml:ï html:¦‘0ïcolor push Black1.ï color popŽŽ‘<Messages–?ýthat“are“no“longer“available“on“one“or“more“classes“where“they“were“availableŽ¡‘<before.– úI.e.“you–?ýsee“warnings“like“the“following“when“you“compile“your“app:ŽŸ8äïhtml:ï html:¦‘$Ãwarning:–ff`ClassName'“does“not“respond“to“`messageName'ŽŸbÌïhtml:ï html:Ÿ n?‘<¾What–?ýthis“means“is“that“since“ïhtml:ï html:Ãobjectbase.h“¾simply“imported“all“the“class“headerŽ¡‘Hfiles,–?ýsomewhere“in“that“chaotic“mess“of“an“import“tree,“the“header“for“the“ïhtml:ï html:ÃClass-Ž¡‘HName–?ý¾was“imported.‘ úNow,“since“ïhtml:ï html:Ãobjectbase.h“¾only“defines“protocols“for“the“classesŽ¡‘Hit–?ýcontains,“it“no“longer“imported“that“header“file.ŽŸ8äïhtml:ï html:ïhtml:ï html:¦‘<Solution–?ý#1:‘ úIf“ïhtml:ï html:ÃClassName“¾is“a“member“of“the“ïhtml:ï html:objectbase“library,“then“all“youŽ¡‘Hneed–?ýto“do“is“import“ïhtml:ï html:Ãobjectbase.h“¾in“the“file“where“that“class“(or“an“instanceŽ¡‘Hof–?ýit)“is“used.‘ úIf,“however,“the“class“in“question“is“a“member“of“some“otherŽ¡‘Hlibrary,–?ýthen“you“should“find“out“which“library“it“is“a“member“of“and“includeŽ¡‘Hthe–?ýappropriate“header“file.‘ ú(This“latter“case“is“actually“part“of“the“justificationŽ¡‘Hfor–?ýmaking“these“libraries“into“"modules"“like“this....‘ úto“avoid“incestuousŽ¡‘Hinclude‘?ýtrees.)ŽŸÕSïhtml:ï html:Ÿ û¸‘<Another–?ýcase“where“this“occurs“is“when“using“objects“that“have“been“staticallyŽ¡‘Htyped–?ýwith“a“class“name.‘ úIn“using“the“protocols“instead“of“direct“class“interfaces,Ž¡‘Hwe–?ýare“depriving“the“compiler“of“the“ability“to“analyze“the“type“of“an“objectŽ¡‘Hand–?ýdecide“if“that“object“can“accept“a“given“message.‘ úThis“is“a“bit“counterŽ¡‘Hintuitive–?ýfor“those“of“us“reared“with“strongly“typed“languages“and“styles.‘ úBut,Ž¡‘HSwarm–?ýtakes“advantage“of“the“freedom“this“allows“and“it“is“part“of“ïhtml:ï html:Swarm-styleŽ¡‘Hprogrammingïhtml:ï html:ޤ Ñ ‘<(../defobj/style.html)Ž¡‘<.Žïhtml:ï html:ïhtml:ï html:¡‘<Solution–?ý#2:‘ úIf“this“is“what's“happening“to“generate“the“above“warning,“thereޤ ‘Hare–?ýtwo“further“degradations“of“typing“available.‘ úThe“next“step“down“is“to“takeŽ¡‘Haway–?ýthe“specific“class“type“and“replace“it“with“a“protocol“qualification“onŽ¡‘Ha–?ýpure“ïhtml:ï html:Ãid“¾type.‘ úFor“example:ŽŸ8äïhtml:ï html:ŽŸ*ºâïcolor push Black’Ôï color popŽŽŒ‹(F “ºâ ýxºâïcolor push Blackïhtml:ï html:ŸüfdŽŽŽ’Ôï color popŽŽ ^ ýБ#ºâÃProbeMap–ff*“myProbeMap;ޤ ‘/ºâ¾can–?ýbe“changed“toŽºâ©8äïhtml:ï html:Ÿ Ç‘$Ãid–ff“myProbeMap;Ž¡‘0¾This–?ýboth“allows“the“freedom“from“the“static“typing“ïhtml:ï html:and“adds“to“the“readibility“ofŽ¡‘<the–?ýcode.‘ úHowever,“this“still“results“in“compile“time“checking“for“messages“sentŽ¡‘<to–?ýthat“object“with“the“protocol“designated.‘ úSo,“any“message“you“intend“to“sendŽ¡‘<to–?ýthat“object“must“be“defined“or“inherited“by“the“given“protocol.‘ úSo,“in“someŽ¡‘<cases,–?ýone“may“want“to“go“with“the“ultimate“freedom“inަïhtml:ï html:© Ç‘$Ãid‘ffmyProbeMap;Ž¡‘0¾which,–?ýobviously,“means“the“compiler“will“not“second“guess“the“programmer“in“whatŽ¡‘<messages–?ýcan“be“sent“to“that“object.‘ úAnd“if“your“variables“are“named“appropriately,Ž¡‘<this–?ýdoesn't“really“detract“from“the“readibility“of“the“code.ŽŸ8äïhtml:ï html:Ÿïhtml:ï html:¦‘0ïcolor push Black2.ï color popŽŽ‘<When–?ýsubclassing“from“a“class“defined“in“the“Swarm“Kernel,“it“is“necessary“to“importŽ¡‘<the–?ýïhtml:ï html:Ã@interface“¾of“that“class.‘ úBefore,“when“ïhtml:ï html:Ãobjectbase.h“¾included“all“those“interfaces,Ž¡‘<it–?ýwas“the“only“file“needed“if“you“wanted“to“subclass“from“a“class“in“ïhtml:ï html:objectbase.Ž¡‘<Now,–?ýhowever,“simply“importing“ïhtml:ï html:Ãobjectbase.h“¾doesn't“help“at“all.‘ úSo,“in“orderŽ¡‘<to–?ýsubclass“from“a“class“that's“a“member“of“ïhtml:ï html:objectbase,“you“need“to“import“theŽ¡‘<specific–?ýinterface“file“to“that“class.ŽŸ8äïhtml:ï html:ïhtml:ï html:¦‘<The–?ýsolution:‘ úIf“you“had“an“app“that“worked“before“when“you“subclassed“from“somethingŽ¡‘H(say,–?ýïhtml:ï html:Swarm)“in“ïhtml:ï html:objectbase“but“doesn't“work“now,“simply“replace“theŽŸ8äïhtml:ï html:¦‘$Ã#import‘ffŽ¡‘0¾in–?ýthe“header“file“for“the“subclass“withŽŸïhtml:ï html:¡‘$Ã#import‘ffŽŸbÌïhtml:ï html:ïhtml:ï html:Ÿ 4‘<¾Note:‘ úIn–?ýorder“to“reduce“the“number“of“broken“apps“due“to“this,“we've“explicitlyŽ¡‘Himported–?ýïhtml:ï html:Ãobjectbase/SwarmObject.h“¾and“ïhtml:ï html:Ãobjectbase/Swarm.h¾at“the“end“of“the“ïhtml:ï html:Ãob-Ž¡‘Hjectbase.h–?ý¾file.‘ úThis“allows“the“subclassing“of“ïhtml:ï html:SwarmObject“or“ïhtml:ï html:Swarm“by“an“importŽ¡‘Hof–?ýïhtml:ï html:Ãobjectbase.h“¾without“the“explicit“import“of“the“interface“files.‘ úBut,“thisŽ¡‘Hwas–?ýdone“for“backward“compatibility“and“may“go“away“in“the“future.‘ úSo“pleaseŽ¡‘Hsubclass–?ýby“explicit“importation“of“the“interface“file“of“the“class.ŽŸ‘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ŽŽŒ‹9 “ºâ ýxºâïcolor push Blackïhtml:ï html:ŸüfdŽŽŽ’Ôï color popŽŽ ^ºâ ýÆïhtml:ï html:ŸIy½Objectbase–/Library:‘m™Interface“Refer |enceŽŸq'‘0„¤ŽŽŸ ïhtml:ï html:¤ ‘0¾The–?ýïhtml:ï html:Äobjectbase‘üo¾library“uses“the“ïhtml:ï html:module“definition“conventionsïhtml:ï html:Ž¡‘0(../defobj/module.html)Ž¡‘0established–?ýby“the“ïhtml:ï html:ïhtml:ï html:Ädefobj‘üo¾libraryïhtml:ï html:Ž¡‘0(../defobj.html)Ž¡‘0.‘ úIt–?ýalso“depends“on“standard“supertypes“and“classes“defined“by“this“library.ŽŸ€’ïhtml:ï html:Ÿœ›ÀDependenciesŽŸwJ¾Following–?ýare“the“other“header“files“imported“by“:ŽŸ —ïhtml:ï html:Ÿïhtml:ï html:Ÿ à1‘0Ã#import‘ffŽ¡‘0#import‘ff;Ž¡¾The–?ýïhtml:ï html:Ädefobj‘üo¾library“interface“is“included“to“provide“the“basic“object“support.‘ úThe“ïhtml:ï html:ÄSwarmObjectޤ ¾class–?ýheader“file“was“provided“for“backward“compatibility“since“the“ïhtml:ï html:Äobjectbase‘üo¾library“hasŽ¡been–?ýbrought“into“agreement“with“the“library“standards.ŽŸ‘0„¤ŽŽŸG®ïhtml:ï html:ŸÕÀObject–QëT‘þ¸¦ypes“(with“links“to“r•°gefer“ence‘Qëpages)ŽŸ âcïhtml:ï html:ïhtml:ï html:Ÿ”ç‘0ÃSwarmObjectïhtml:ï html:ޤ ‘5ff(SwarmObject.html)Ž¡’–™’/–ÿþ|“\Ž¡’‘3,/– fd|“\‘f™’ïhtml:ï html:ProbeLibraryïhtml:ï html:Ž¡‘5ff(ProbeLibrary.html)Ž¡’‹ÌÆ/–%ÌÊ|“\Ž¡‘:ÌÌïhtml:ï html:ActivityControlïhtml:ï html:Ž¡‘5ff(ActivityControl.html)Ž¡‘Pfdïhtml:ï html:Probeïhtml:ï html:Ž¡‘5ff(Probe.html)Ž¡‘Pfdïhtml:ï html:ProbeMapïhtml:ï html:Ž¡‘5ff(ProbeMap.html)Ž¡’¦ÌÄ/–32|‘+30|‘ ÌÌ\“\Ž¡’›ÿø/‘ÿþ|‘+30|‘32\‘™˜\Ž¡’‘3,/‘%ÌÊ|‘+30|‘™˜\‘ÿþ\Ž¡’†f`/‘0™–|‘+30|‘ÿþ\‘ fd\Ž¡‘[30ïhtml:ï html:VarProbeïhtml:ï html:Ž¡‘5ff(VarProbe.html)Ž¡‘UÌÊïhtml:ï html:Messageïhtml:ï html:Ž¡‘5ff(MessageProbe.html)Ž¡‘@32ïhtml:ï html:Customïhtml:ï html:ŽŽŸ*ºâïcolor push Black’Ôï color popŽŽŒ‹F  “ºâ ýxºâïcolor push Blackïhtml:ï html:ŸüfdŽŽŽ’Ôï color popŽŽ ^ ýБ5!HÃ(CustomProbeMap.html)ޤ 4²‘ETz\‘ fdïhtml:ï html:Completeïhtml:ï html:Ž¡‘5!H(CompleteVarMap.html)Ž¡’±Trïhtml:ï html:Probeïhtml:ï html:Ž¡‘5!H(MessageProbe.html)Ž¡‘ETzïhtml:ï html:Probeïhtml:ï html:Ž¡‘5!H(CustomProbeMap.html)Ž¡‘Jºà\‘%ÌÊïhtml:ï html:Varïhtml:ï html:Ž¡‘5!H(CompleteVarMap.html)Ž¡’çTnïhtml:ï html:Mapïhtml:ï html:Ž¡‘5!H(CustomProbeMap.html)Ž¡‘U‡¬\‘%ÌÊïhtml:ï html:Mapïhtml:ï html:Ž¡‘5!H(CompleteVarMap.html)Ž¡’‡žïhtml:ï html:Completeïhtml:ï html:Ž¡‘5!H(CompleteProbeMap.html)Ž¡’îïhtml:ï html:Probeïhtml:ï html:Ž¡‘5!H(CompleteProbeMap.html)Ž¡’Tjïhtml:ï html:Mapïhtml:ï html:Ž¡‘5!H(CompleteProbeMap.html)Ž¡ºâ¾(don't–?ýwant“a“graphic“with“image“map“to“avoid“excessive“download“times!)Žºâ©8äïhtml:ï html:ŸÇ‘0„¤ŽŽŸG®ïhtml:ï html:ŸñÀContents:ŽŸ ¢Âïhtml:ï html:Ÿïhtml:ï html:Ÿ ð%‘0ïcolor push BlackÁlï color popŽŽ‘:ïhtml:ï html:¾SwarmObjectïhtml:ï html:Ž¡‘0(SwarmObject.html)ަïhtml:ï html:Ÿ ûΑ0ïcolor push BlackÁlï color popŽŽ‘:ïhtml:ï html:¾ProbeLibraryïhtml:ï html:Ž¡‘0(ProbeLibrary.html)ަïhtml:ï html:Ÿ ûΑ0ïcolor push BlackÁlï color popŽŽ‘:ïhtml:ï html:¾ActivityControlïhtml:ï html:Ž¡‘0(ActivityControl.html)ަïhtml:ï html:Ÿ ûΑ0ïcolor push BlackÁlï color popŽŽ‘:ïhtml:ï html:¾Probeïhtml:ï html:Ž¡‘0(Probe.html)ŽŸÕSïhtml:ï html:Ÿ __‘0ïcolor push BlackÁlï color popŽŽ‘:ïhtml:ï html:¾ProbeMapïhtml:ï html:Ž¡‘0(ProbeMap.html)ަïhtml:ï html:Ÿ ûΑ0ïcolor push BlackÁlï color popŽŽ‘:ïhtml:ï html:¾VarProbeïhtml:ï html:Ž¡‘0(VarProbe.html)ŽŸÕSïhtml:ï html:Ÿ __‘0ïcolor push BlackÁlï color popŽŽ‘:ïhtml:ï html:¾MessageProbeïhtml:ï html:Ž¡‘0(MessageProbe.html)ަïhtml:ï html:Ÿ ûΑ0ïcolor push BlackÁlï color popŽŽ‘:ïhtml:ï html:¾CustomProbeMapïhtml:ï html:Ž¡‘0(CustomProbeMap.html)ަïhtml:ï html:Ÿ ûΑ0ïcolor push BlackÁlï color popŽŽ‘:ïhtml:ï html:¾CompleteProbeMapïhtml:ï html:ŽŽŸ*ºâïcolor push Black’Ôï color popŽŽŒ‹ P™ “ºâ ýxºâïcolor push Blackïhtml:ï html:ŸüfdŽŽŽ’Ôï color popŽŽ ^ ýБ/ºâ¾(CompleteProbeMap.html)Ž©‘/ºâ„¤ŽŽºâ¤ ïhtml:ï html:Ÿ\’áøRï>PSfile="eps/prev.eps" llx=298 lly=373 urx=314 ury=389 rwi=160 ŽŽ¡ïhtml:ï html:¦(../objectbase.html)ŽŸ8äïhtml:ï html:Ÿ\’áøRïï html:¦(../objectbase.html)ŽŸ8äïhtml:ï html:Ÿ\’áøRï>PSfile="eps/next.eps" llx=298 lly=373 urx=314 ury=389 rwi=160 ŽŽ¡ïhtml:ï html:¦(UsageGuide.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-10ŽŽŸ*ºâïcolor push Black’Ôï color popŽŽŒ‹ \\ “ºâ ýxºâïcolor push Blackïhtml:ï html:ŸüfdŽŽŽ’Ôï color popŽŽ ^ºâ ýÆïhtml:ï html:ŸIy½SwarmObject‘/ClassŽŸq'‘0„¤ŽŽ© ïhtml:ï html:¤ Fy‘0Ã//Ž¡‘0//–ffSwarmObject“--Ž¡‘0//‘32Superclass–ffof“most“objects“in“a“Swarm“simulation.Ž¡‘0//‘32Provides–ffsupport“for“probing.Ž¡‘0//Ž¡‘0@protocol–ffSwarmObject“Ž¡‘0USINGŽ¡‘0-–ff(const“char*)getInstanceName;Ž¡‘0-‘ffgetProbeMap;Ž¡‘0-‘ffgetCompleteProbeMap;Ž¡‘0-–ffgetProbeForVariable:“(const“char“*)aVariable;Ž¡‘0-–ffgetProbeForMessage:“(const“char“*)aMessage;Ž¡‘0@endŽŸ‘0„¤ŽŽ¦ïhtml:ï html:¡‘0¾A–?ýïhtml:ï html:SwarmObject“is“an“object“that“is“intended“to“be“a“member“of“a“ïhtml:ï html:Swarm.‘ úThat“is,“itsޤ ‘0behavior–?ýwill“be“perpetuated“by“messages“sent“from“the“schedule“of“events“definedŽ¡‘0in–?ýthe“context“of“a“ïhtml:ï html:Swarm“object.ŽŸ8äïhtml:ï html:© •‘0The–?ýïhtml:ï html:SwarmObject“is“where“the“models“of“all“the“agents“of“a“simulation“will“reside.Ž¡‘0Hence,–?ýmost“of“the“burden“on“defining“the“messages“that“can“be“sent“to“any“agent“liesŽ¡‘0with–?ýthe“user.‘ úïhtml:ï html:SwarmObject“inherits“its“basic“functionality“from“the“ïhtml:ï html:Create“and“ïhtml:ï html:DropŽ¡‘0object–?ýtypes“defined“in“the“ïhtml:ï html:defobj“library.‘ úIt“is“useful“to“mention“these“messagesŽ¡‘0here–?ýto“show“the“complete“span“of“messages“that“can“dictate“the“behavior“of“an“instanceŽ¡‘0of–?ýa“ïhtml:ï html:SwarmObject;“but“it“is“not“useful“to“explain“their“function“in“detail.‘ úThe“messagesŽ¡‘0ïhtml:ï html:SwarmObject–?ýinherits“from“ïhtml:ï html:defobj“are:ŽŸ 8äïhtml:ï html:¤ïhtml:ï html:¦‘0ïcolor push BlackÁlï color popŽŽ‘:¾DefinedObjectŽŸ8äïhtml:ï html:¡ïhtml:ï html:¦‘:ïcolor push Blackó\ùðff pzdrÈlï color popŽŽ‘D¾-‘?ýgetType;ޤ8äïhtml:ï html:¦‘:ïcolor push BlackÈlï color popŽŽ‘D¾-‘?ýgetClass;Ž¡ïhtml:ï html:¦‘:ïcolor push BlackÈlï color popŽŽ‘D¾-‘?ý(BOOL)respondsTo:‘ ú(SEL)aSel;Ž¡ïhtml:ï html:¦‘:ïcolor push BlackÈlï color popŽŽ‘D¾-‘?ýdescribe:‘ úanOutputStream;Ž¡ïhtml:ï html:¦‘:ïcolor push BlackÈlï color popŽŽ‘D¾-–?ý(BOOL)setDisplayNameTo:‘ ú(const“char“*)aName;Ž¡ïhtml:ï html:¦‘:ïcolor push BlackÈlï color popŽŽ‘D¾-–?ý(const“char“*)getDisplayName;Ž¡ïhtml:ï html:¦‘:ïcolor push BlackÈlï color popŽŽ‘D¾-‘?ýcreateIDString:‘ úaZone;ŽŸ 8äïhtml:ï html:¦‘0ïcolor push BlackÁlï color popŽŽ‘:¾CreateŽŸ¬ïhtml:ï html:Ÿïhtml:ï html:Ÿ )Í‘:ïcolor push BlackÈlï color popŽŽ‘D¾+‘?ýcreate:‘ úaZone;ŽŸcïhtml:ï html:ŽŸ*ºâïcolor push Black’Ôï color popŽŽŒ‹ `\ “ºâ ýxºâïcolor push Blackïhtml:ï html:ŸüfdŽŽŽ’Ôï color popŽŽ ^ ýБ9ºâïcolor push BlackÈlï color popŽŽ‘Cºâ¾+‘?ýcreateBegin:‘ úaZone;Žºâ¤8äïhtml:ï html:© £W‘:ïcolor push BlackÈlï color popŽŽ‘D¾-‘?ýcreateEnd;ŽŸcïhtml:ï html:Ÿ x®‘:ïcolor push BlackÈlï color popŽŽ‘D¾+‘?ýcustomizeBegin:‘ úaZone;Ž¡ïhtml:ï html:¦‘:ïcolor push BlackÈlï color popŽŽ‘D¾-‘?ýcustomizeEnd;ŽŸcïhtml:ï html:Ÿ x®‘:ïcolor push BlackÈlï color popŽŽ‘D¾-‘?ýcustomizeCopy:‘ úaZone;ŽŸ 8äïhtml:ï html:¦‘0ïcolor push BlackÁlï color popŽŽ‘:¾DropŽ¡ïhtml:ï html:Ÿïhtml:ï html:¦‘:ïcolor push BlackÈlï color popŽŽ‘D¾-‘?ýgetZone;Ž¡ïhtml:ï html:¦‘:ïcolor push BlackÈlï color popŽŽ‘D¾-‘?ý(void)drop;ŽŸ8äïhtml:ï html:¦‘0In–?ýaddition“to“these,“ïhtml:ï html:SwarmObject“is“augmented“by“the“messages“that“provide“the“probeŽŸ ‘0support.Ž¡ïhtml:ï html:ïhtml:ï html:¦‘0getInstanceName–?ýis“a“message“used“by“the“probe“machinery“to“get“a“meaningful“wordޤ ‘0or–?ýphrase“to“indicate“the“object“being“probed“(and,“in“the“case“of“a“probe“display,Ž¡‘0place–?ýit“in“a“widget“on“the“screen).‘ úSupport“for“this“has“recently“been“added“toŽ¡‘0the–?ýïhtml:ï html:DefinedObject“object“type,“thereby“making“it“more“generally“available.‘ úSo,“thisŽ¡‘0message–?ýwill“likely“become“obsolete“soon.ŽŸ8äïhtml:ï html:ïhtml:ï html:¦‘0getProbeMap–?ýreturns“a“pointer“to“the“ïhtml:ï html:ProbeMap“for“the“object“if“there“has“been“oneŽ¡‘0created–?ýfor“that“object's“class.‘ úIf“it“hasn't,“then“it“create's“a“default“one.ޤ8äïhtml:ï html:ïhtml:ï html:¦‘0getCompleteProbeMap–?ýreturns“a“newly“created“ïhtml:ï html:CompleteProbeMap“for“the“object.Ž¡ïhtml:ï html:ïhtml:ï html:¦‘0getProbeForVariable:‘ ú(const–?ýchar“*)aVariable“returns“the“ïhtml:ï html:VarProbe“indexed“in“theŽŸ ‘0ïhtml:ï html:ProbeMap–?ýby“the“string“ïhtml:ï html:aVariable.Ž¡ïhtml:ï html:ïhtml:ï html:¦‘0getProbeForMessage:‘ ú(const–?ýchar“*)aMessage“returns“the“ïhtml:ï html:MessageProbe“indexed“in“theŽŸ ‘0ïhtml:ï html:ProbeMap–?ýby“the“string“ïhtml:ï html:aMessage.ŽŸ‘0„¤ŽŽ¤ ïhtml:ï html:©\’áøRï>PSfile="eps/prev.eps" llx=298 lly=373 urx=314 ury=389 rwi=160 ŽŽ¡ïhtml:ï html:ŸÜ;(Interface.html)ŽŸÕSïhtml:ï html:¦’áøRïï html:ŸÜ;(../objectbase.html)ŽŸ8äïhtml:ï html:¦’áøRï>PSfile="eps/next.eps" llx=298 lly=373 urx=314 ury=389 rwi=160 ŽŽ¡ïhtml:ï html:ŸÜ;(ProbeLibrary.html)ŽŽŸ*ºâïcolor push Black’Ôï color popŽŽŒ‹ m" “ºâ ý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-10ŽŽŸ*ºâïcolor push Black’Ôï color popŽŽŒ‹ yþ “ºâ ýxºâïcolor push Blackïhtml:ï html:ŸüfdŽŽŽ’Ôï color popŽŽ ^ºâ ýÆïhtml:ï html:ŸIy½Pr |obeLibrary‘/ClassŽŸq'‘0„¤ŽŽ© ïhtml:ï html:¤ a‰‘0Ã//Ž¡‘0//–ffProbeLibrary“--Ž¡‘0//–ffA“(singleton)“Class,“whose“instance“is“used“as“a“container“for“aglobalŽ¡‘0//–ffmapping“between“classnames“and“their“'default'“ProbeMaps.“These“defaultsŽ¡‘0//–ffcan“be“changed“by“the“user,“thus“allowing“him/her“to“customize“the“defaultŽ¡‘0//–ffcontents“of“the“ProbeDisplays“generated“when“probing“objects.Ž¡‘0//Ž¡‘0@protocol–ffProbeLibrary“Ž¡‘0USINGŽ¡‘0-–ffsetDisplayPrecision:“(int)“nSigDisplay;Ž¡‘0-‘ff(int)getDisplayPrecision;Ž¡‘0-–ffsetSavedPrecision:“(int)“nSigSaved;Ž¡‘0-‘ff(int)getSavedPrecision;Ž¡‘0-–ff(BOOL)isProbeMapDefinedFor:“(Class)aClass;Ž¡‘0-–ffgetProbeMapFor:“(Class)aClass;Ž¡‘0-–ffgetCompleteProbeMapFor:“(Class)aClass;Ž¡‘0-–ffgetCompleteVarMapFor:“(Class)aClass;Ž¡‘0-–ffgetProbeForVariable:“(const“char“*)aVar“inClass:“(Class)aClass;Ž¡‘0-–ffgetProbeForMessage:“(const“char“*)aMessage“inClass:“(Class)aClass;Ž¡‘0-–ffsetProbeMap:“aMap“For:“(Class)aClass;Ž¡‘0@endŽ¡¡‘0extern–ffid““probeLibrary;ŽŸ‘0„¤ŽŽ¦ïhtml:ï html:¡‘0¾The–?ýnormal“Swarm“simulation“will“probably“only“ever“contain“one“instance“of“this“class,ޤ ‘0namely–?ýthe“ïhtml:ï html:ÄprobeLibrary‘üo¾object.‘ úThis“object“is“used“for“Library“Generation“of“ïhtml:ï html:ÄProbe‘¼r¾sŽ¡‘0and–?ýïhtml:ï html:ÄProbeMaps‘¼r¾:‘ úits“role“is“to“cache“one“unique“"official"“ïhtml:ï html:ÄProbeMap‘üo¾for“every“ClassŽ¡‘0ever–?ýprobed“during“a“run“of“Swarm.‘ úThese“ïhtml:ï html:ÄProbeMap‘¼r¾s“are“generated“lazily“as“theyŽ¡‘0are‘?ýrequested.ޤ8äïhtml:ï html:¦ïhtml:ï html:Ÿïhtml:ï html:ïhtml:ï html:© (¥‘:-‘?ýsetDisplayPrecision:‘ ú(int)nSigDisplayŽ¡ïhtml:ï html:¦‘XSets–?ýthe“number“of“significant“digits“for“floating“point“and“double“floatingޤ ‘Xpoint–?ýnumbers“displayed“on“GUI“widgets.‘ úCurrently“only“implemented“for“ïhtml:ï html:ÃVarProbesŽ¡‘X¾not–?ýïhtml:ï html:ÃMessageProbes“¾as“yet.‘ úThis“allows“ïhtml:ï html:Äall‘üo¾probes“checked“out“the“globalŽ¡‘XProbeLibrary–?ýinstance“to“access“this“displayed“precision.‘ úHowever,“individualŽ¡‘Xprobes–?ýcan“vary“from“this“global“default,“by“using“the“ïhtml:ï html:ÃsetFloatFormat“¾methodŽ¡‘Xon–?ýa“exisiting“probe.‘ úSee“ïhtml:ï html:probing“precisionïhtml:ï html:ޤ a‰‘X(../probing.html#precision)Ž¡‘Xfor–?ýmore“details“on“how“to“do“this.ŽŸïhtml:ï html:ïhtml:ï html:¡‘:-‘?ý(int)getDisplayPrecisionŽŸ8äïhtml:ï html:ŽŸ*ºâïcolor push Black’Ôï color popŽŽŒ‹{Þ “ºâ ýxºâïcolor push Blackïhtml:ï html:ŸüfdŽŽŽ’Ôï color popŽŽ ^ ýБWºâ¾Gets–?ýthe“current“display“precision“set“in“the“ProbeLibrary“instance.‘ úMostlyŽ© ‘Wºâused‘?ýinternally.ŽºâŸ8äïhtml:ï html:ïhtml:ï html:¤ ´´‘:-‘?ýsetSavedPrecision:‘ ú(int)nSigSavedŽŸ8äïhtml:ï html:¡‘XSets–?ýthe“number“of“significant“digits“saved“for“floating-point“and“doubleަ‘Xfloating-point–?ýnumbers“through“ObjectSaver.‘ úThis“function“sets“the“globalަ‘Xdefault–?ýprecision“for“all“floating“(and“double“floating)“point“numbers.‘ úThisަ‘Xfloating–?ýpoint“precision“affects“all“numbers“saved“via“the“ObjectSaver“class.ަ‘XThere–?ýis“currently“no“way“to“override“this“global“default“for“an“individualަ‘Xprobe.ŽŸ8äïhtml:ï html:ïhtml:ï html:¡‘:-(int)‘?ýgetSavedPrecisionŽŸ8äïhtml:ï html:¡‘XGets–?ýthe“current“saved“precision“set“in“the“ProbeLibrary“instance.‘ úMostlyަ‘Xused‘?ýinternally.ŽŸ8äïhtml:ï html:ïhtml:ï html:ïhtml:ï html:¡‘0Note:‘ úif–?ýïhtml:ï html:ïhtml:ï html:neither“of“these“methods“are“used“to“set“the“defaults,“the“precision“inަ‘0ïhtml:ï html:ïhtml:ï html:both–?ýcases“defaults“to“ïhtml:ï html:six“(6)“significant“figures,“which“should“simulate“the“defaultަ‘0precision–?ýbefore“the“introduction“on“this“feature“ïhtml:ï html:Äon“most“platforms‘¼r¾.‘ úPreviously,ަ‘0the–?ýsprintf“"%g"“default“format“was“used“to“print“out“floats“and“doubles,“which“isަ‘0not–?ýconsidered“to“have“entirely“portable“behavoir.ŽŸ8äïhtml:ï html:ïhtml:ï html:¡‘:-–?ý(BOOL)“isProbeMapDefinedFor:‘ ú(Class)“aClass“returns“ïhtml:ï html:ÃTrueŽŸ8äïhtml:ï html:¡‘X¾If–?ýthere“is“a“non-nil“value“in“the“ïhtml:ï html:ÄProbeLibrary‘üo¾for“that“class“and“ïhtml:ï html:ÃFalseަ‘X¾otherwise.ŽŸïhtml:ï html:ïhtml:ï html:Ÿ 협:-‘?ýgetProbeMapFor:‘ ú(Class)aClassŽŸ8äïhtml:ï html:¡‘Xreturns–?ýa“ïhtml:ï html:ÄProbeMap›üo¾for“the“ïhtml:ï html:ÄaClass˜¾class.‘ úIf“a“specific“ïhtml:ï html:ÄProbeMap˜¾has“beenަ‘Xdesigned–?ýand“installed“in“the“ïhtml:ï html:ÄProbeLibrary‘üo¾for“that“class,“then“that“ïhtml:ï html:ÄProbeMapަ‘X¾is–?ýreturned.‘ úIf“not,“then“a“ïhtml:ï html:ÄCompleteProbeMap‘üo¾is“created“and“returned.ŽŸ8äïhtml:ï html:ïhtml:ï html:¡‘:-‘?ýgetCompleteProbeMapFor:‘ ú(Class)aClassŽŸ8äïhtml:ï html:¡‘XThis–?ýmethod“returns“a“ïhtml:ï html:ÄProbeMap‘üo¾containing“ïhtml:ï html:ÄProbe‘¼r¾s“for“all“the“instance“variablesަ‘Xand–?ýmessages“of“the“given“Class“(including“inherited“variables“and“messages).ަ‘XSince–?ýwe“are“assuming“that“normal,“single-level“ïhtml:ï html:ÄProbeMap‘¼r¾s“will“be“more“widelyަ‘Xused,–?ýthe“current“implementation“of“ïhtml:ï html:ÄProbeLibrary‘üo¾does“not“cache“ïhtml:ï html:ÄCompleteProbeMap‘¼r¾s.ަ‘XHowever,–?ýif“we“find“that“there“is“a“demand“for“ïhtml:ï html:ÄCompleteProbeMap‘¼r¾s,“we“willަ‘Xcache–?ýthem“as“well.ŽŸïhtml:ï html:ïhtml:ï html:Ÿ 협:-‘?ýgetCompleteVarMapFor:‘ ú(Class)aClassŽŸ8äïhtml:ï html:¡‘XThis–?ýmethod“returns“a“ïhtml:ï html:ÄProbeMap‘üo¾containing“Probes“for“all“the“instance“variablesަ‘Xof–?ýthe“given“Class“(including“inherited“variables)“but“does“ïhtml:ï html:not“include“anyަ‘Xïhtml:ï html:ÄMessageProbe‘¼r¾s.Ž©8äïhtml:ï html:ïhtml:ï html:¡‘:-–?ýgetProbeForVariable:› ú(const“char“*)aVariable“inClass:˜(Class)aClassަïhtml:ï html:ïhtml:ï html:¡‘:-–?ýgetProbeForMessage:› ú(const“char“*)aMessage“inClass:˜(Class)aClassŽŸ8äïhtml:ï html:¡‘XThese–?ýmethods“are“used“to“"check“out"“the“appropriate“Probes“from“the“probeޤ ‘Xlibrary.‘ úNote–?ýthat“the“returned“probes“will“be“cached,“so“you“must“make“sureŽ¡‘Xto–?ýclone“them“if“you“want“to“make“modifications“to“the“probes“ïhtml:ï html:without“affectingŽ¡‘Xthe–?ýresult“of“future“requests“for“those“same“probes.ަïhtml:ï html:ïhtml:ï html:Ÿ ´´‘:-–?ýsetProbeMap:› úaMap“For:˜(Class)aClassŽŸ8äïhtml:ï html:ŽŸ*ºâïcolor push Black’Ôï color popŽŽŒ‹ˆE “ºâ ýxºâïcolor push Blackïhtml:ï html:ŸüfdŽŽŽ’Ôï color popŽŽ ^ ýБWºâ¾In–?ýthose“cases“where“the“user“wants“to“set“the“standard“probe“map“directly,ޤ ‘Wºâshe–?ýcan“provide“the“probe“map“using“this“method,“and“it“will“be“cached“asŽ¡‘Wºâthough–?ýit“were“produced“by“the“library“itself.Ž©‘/ºâ„¤ŽŽºâ¤ ïhtml:ï html:Ÿ\’áøRï>PSfile="eps/prev.eps" llx=298 lly=373 urx=314 ury=389 rwi=160 ŽŽ¡ïhtml:ï html:¦(SwarmObject.html)ŽŸ8äïhtml:ï html:Ÿ\’áøRïï html:¦(Interface.html)ŽŸÕSïhtml:ï html:Ÿ\’áøRï>PSfile="eps/next.eps" llx=298 lly=373 urx=314 ury=389 rwi=160 ŽŽ¡ïhtml:ï html:¦(Probe.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-10ŽŽŸ*ºâïcolor push Black’Ôï color popŽŽŒ‹›Ë “ºâ ýxºâïcolor push Blackïhtml:ï html:ŸüfdŽŽŽ’Ôï color popŽŽ ^ºâ ýÆïhtml:ï html:ŸIy½ActiÊìvityContr |ol‘/ClassŽŸq'‘0„¤ŽŽ© ïhtml:ï html:¤ µ1‘0Ã//Ž¡‘0//–ffActivityControl“--“This“class“provides“an“object“interface“toŽ¡‘0//‘kÿøan–ffactivity.‘ ÌÌIt“contains“a“subset“of“the“messagesŽ¡‘0//‘kÿøthat–ffany“activity“responds“to“and“provides“explicitŽ¡‘0//‘kÿøcontrol–ffover“that“activity.Ž¡‘0//Ž¡‘0@protocol–ffActivityControl“Ž¡‘0CREATINGŽ¡‘0-–ffattachToActivity:“anActivity;Ž¡‘0USINGŽ¡‘0-‘ffrun;Ž¡‘0-‘ffstop;Ž¡‘0-‘ffnext;Ž¡‘0-‘ffstep;Ž¡‘0-–ffstepUntil:“(timeval_t)stopTime;Ž¡‘0-‘ff(void)terminate;Ž¡‘0-‘ffupdateStateVar;Ž¡‘0-‘ffgetStatus;Ž¡‘0-–ff(const“char“*)getInstanceName;Ž¡‘0@endŽŸ‘0„¤ŽŽ¦ïhtml:ï html:¡‘0¾The–?ýïhtml:ï html:ActivityControl“class“specifies“an“object“that“can“be“attached“to“an“activityޤ ‘0(regardless–?ýof“how“or“where“that“activity“is“created)“for“the“purpose“of“explicitlyŽ¡‘0controlling–?ýthe“execution“of“actions“on“that“activity's“action“plan.‘ úThere“is“nothingŽ¡‘0that–?ýavailable“through“this“class“that“is“not“already“available“through“the“variablesŽ¡‘0or–?ýmessages“available“via“the“activity“itself.‘ úHowever,“it“packages“up“the“main“controlŽ¡‘0messages–?ýand“makes“them“available“to“other“objects“that“may“need“control“over“an“activity,Ž¡‘0thereby–?ýshielding“the“activity“from“directly“receiving“messages“from“outside“objectsŽ¡‘0and–?ýsaving“the“user“from“having“to“parse“the“more“complex“interface“to“the“activity.Ž©€’ïhtml:ï html:Ÿ8·ÀCrš°geate–QëPhase“Pr˜otocolsŽŸ ¢Âïhtml:ï html:ïhtml:ï html:Ÿ p¤‘0¾attachToActivity:‘ úanActivity–?ýsets“an“instance“variable“inside“the“ïhtml:ï html:ActivityControlŽ¡‘0object–?ýthat“points“to“the“ïhtml:ï html:Activity“to“be“controlled.‘ úIt“then“creates“a“ïhtml:ï html:Schedule“uponŽ¡‘0which–?ýit“places“a“message“to“itself“to“update“its“own“variables.ަïhtml:ï html:Ÿ8·ÀUsage–QëPhase“Pr°gotocolsŽŸ âcïhtml:ï html:ïhtml:ï html:ŽŸ*ºâïcolor push Black’Ôï color popŽŽŒ‹ † “ºâ ýxºâïcolor push Blackïhtml:ï html:ŸüfdŽŽŽ’Ôï color popŽŽ ^ ýБ/ºâ¾run–?ýsends“a“ïhtml:ï html:run“message“to“the“activity“if“the“conditions“are“appropriate.‘ úThis“messageޤ ‘/ºâcauses–?ýthe“activity“to“continue“executing“the“actions“on“it's“schedule“until“eitherŽ¡‘/ºâno–?ýother“actions“are“waiting,“at“which“point“it“returns“ïhtml:ï html:Completed,“or“until“it“isŽ¡‘/ºâïhtml:ï html:stopped–?ýby“a“subactivity“or“a“ïhtml:ï html:stop“message“to“the“activity.Žºâ©8äïhtml:ï html:ïhtml:ï html:Ÿ ¢£‘0stop–?ýsends“a“ïhtml:ï html:stop“message“to“the“activity“if“the“conditions“are“appropriate.‘ úThisŽ¡‘0message–?ýcauses“the“control“to“move“back“up“the“run-stack“and“resume“at“the“place“inŽ¡‘0the–?ýcode“where“the“ïhtml:ï html:run“was“first“executed,“which“doesn't“mean“much“in“a“parallel“executionŽ¡‘0context;–?ýbut,“in“a“serial“context,“it“means“that“the“next“action“on“the“super-activityŽ¡‘0will–?ýbegin“without“finishing“the“rest“of“the“current“activity's“actions.ަïhtml:ï html:ïhtml:ï html:Ÿ ¢£‘0next–?ýsends“a“ïhtml:ï html:next“message“to“the“activity“if“the“conditions“are“appropriate.‘ úIt“ïhtml:ï html:runsŽ¡‘0an–?ýactivity“forward“through“as“many“actions“as“necessary“until“it“hits“a“ïhtml:ï html:breakFunction,Ž¡‘0at–?ýwhich“point“it“walks“back“up“the“tree“of“activities“and“returns“ïhtml:ï html:Stopped.‘ úIn“mostŽ¡‘0cases,–?ýthis“means“that“an“entire“action“or“action“group“on“the“activity“under“controlŽ¡‘0will–?ýbe“executed,“including“completion“of“all“subactivities.ަïhtml:ï html:ïhtml:ï html:Ÿ ¢£‘0step–?ýsends“a“ïhtml:ï html:step“message“to“the“activity“if“the“conditions“are“appropriate.‘ úIt“causesŽ¡‘0the–?ýexecution“of“a“single“action.ަïhtml:ï html:ïhtml:ï html:Ÿ ¢£‘0stepUntil:› ú(timeval_t)stopTime–?ýsends“a“ïhtml:ï html:stepUntil:˜message“to“the“activity“if“conditionsŽ¡‘0are–?ýappropriate.‘ úThis“causes“all“actions“on“the“activity's“schedule,“including“anyŽ¡‘0actions–?ýon“subactivities'“schedules,“to“be“executed“until“the“activity's“relativeŽ¡‘0time–?ýis“equal“to“ïhtml:ï html:ÃstopTime–ff-“1¾.ަïhtml:ï html:ïhtml:ï html:Ÿ ¢£‘0(void)terminate–?ýsends“the“ïhtml:ï html:terminate“message“to“the“activity,“which“causes“all“actionsŽ¡‘0and–?ýaction“groups“to“be“removed“from“its“schedule.‘ úThis“can“cause“some“problems.Ž¡‘0If–?ýïhtml:ï html:terminate“is“sent“to“an“activity“and,“subsequently,“a“ïhtml:ï html:run“is“attempted“on“thatŽ¡‘0activity,–?ýthe“program“will“exit“with“an“error.‘ úA“way“to“avoid“this“might“be“to“eliminateŽ¡‘0the–?ýïhtml:ï html:ActivityControl“attached“to“the“terminated“activity;“but,“that“would“precludeŽ¡‘0the–?ýreuse“of“ïhtml:ï html:ActivityControllers“on“other“activities.‘ úIdeally,“a“controller“couldŽ¡‘0be–?ýadjusted“to“monitor“any“of“several“activities“and“it“could“leap“from“one“activityŽ¡‘0to–?ýanother.‘ úSo,“this“behaviour“is“advertised“as“a“ïhtml:ï html:feature.ŽŸcïhtml:ï html:ïhtml:ï html:Ÿ wú‘0updateStateVar–?ýupdates“the“ïhtml:ï html:ActivityControl“instance“variables“and“tests“for“the“continuedŽ¡‘0existence–?ýof“the“activity“that's“being“controlled.‘ úThis“message“is“sent“on“each“cycleŽ¡‘0of–?ýthe“schedule“for“the“activity“being“controlled.ަïhtml:ï html:ïhtml:ï html:¤ ¢£‘0getStatus–?ýreturns“the“status“of“the“activity.ަïhtml:ï html:ïhtml:ï html:¡‘0(const–?ýchar“*)getInstanceName“This“method“is“provided“for“backwards“compatibilityޤ ‘0to–?ýthe“probe“machinery.‘ úIt“echos“the“ïhtml:ï html:displayName“resident“in“the“object“name“database.Ž¡‘0When–?ýthe“probe“machinery“is“upgraded“to“use“this“database,“this“method“will“becomeŽ¡‘0obsolete.ŽŸ‘0„¤ŽŽ¤ ïhtml:ï html:Ÿ\’áøRï>PSfile="eps/prev.eps" llx=298 lly=373 urx=314 ury=389 rwi=160 ŽŽ¡ïhtml:ï html:ŸÛ‡(CompleteVarMap.html)ŽŸ8äïhtml:ï html:ŽŸ*ºâïcolor push Black’Ôï color popŽŽŒ‹ª “ºâ ýxºâïcolor push Blackïhtml:ï html:ŸüfdŽŽŽ’Ôï color popŽŽ ^ ýÖ\’á³4ïï html:©¾(Interface.html)ŽŸÕSïhtml:ï html:Ÿ\’áøRï>PSfile="eps/next.eps" llx=298 lly=373 urx=314 ury=389 rwi=160 ŽŽ¡ïhtml:ï html:¦(UsageGuide.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-10ŽŽŸ*ºâïcolor push Black’Ôï color popŽŽŒ‹¼p “ºâ ýxºâïcolor push Blackïhtml:ï html:ŸüfdŽŽŽ’Ôï color popŽŽ ^ºâ ýÆïhtml:ï html:ŸIy½Pr |obe‘/ClassŽŸq'‘0„¤ŽŽ© ïhtml:ï html:¤ "·‘0Ã//Ž¡‘0//–ffProbe“--Ž¡‘0//‘32Abstract–ffsuperclass“of“both“VarProbe“and“MessageProbe.Ž¡‘0//Ž¡‘0@protocol–ffProbe“Ž¡‘0CREATINGŽ¡‘0-‘ffsetProbedClass;Ž¡‘0SETTINGŽ¡‘0-–ffsetSafety;‘ÿþ//“There“should“be“a“setSafety:“BOOLŽ¡‘0-–ffunsetSafety;‘32//“and“getSafety“methods“instead...Ž¡‘0USINGŽ¡‘0-–ffclone:“aZone;Ž¡‘0-‘ff(Class)getProbedClass;Ž¡‘0-–ff(const“char“*)getProbedType;Ž¡‘0@endŽŸ‘0„¤ŽŽ¦ïhtml:ï html:¡‘0¾A–?ýïhtml:ï html:Probe“is“simply“an“object“that“contains“pointers“to“an“element“(instance“variableޤ ‘0or–?ýmessage“description)“of“another“object.‘ úThe“ïhtml:ï html:Probe“contains“instance“variablesŽ¡‘0that–?ýdescribe“the“referent's“class“and“type.‘ úIt's“actually“an“abstract“class“thatŽ¡‘0is–?ýfurther“subdivided“into“ïhtml:ï html:VarProbe“and“ïhtml:ï html:MessageProbe,“which“represent“the“two“basicŽ¡‘0types–?ýof“elements“of“any“object.‘ úThe“ïhtml:ï html:Probes“are“collected“into“a“ïhtml:ï html:ProbeMap“and“subsequentlyŽ¡‘0installed–?ýin“the“ïhtml:ï html:ProbeLibrary.Ž©€’ïhtml:ï html:Ÿ¦=ÀCrš°geate–QëPhase“Pr˜otocolŽŸ ¢Âïhtml:ï html:ïhtml:ï html:Ÿ Þ*‘0¾setProbedClass:‘ ú(Class)aClass–?ýsets“the“class“of“the“referent“and“ïhtml:ï html:must“be“called“atŽ¡‘0create‘?ýtime.ŽŸG®ïhtml:ï html:Ÿß!ÀSetting–QëPhase“Pr°gotocolŽŸ âcïhtml:ï html:ïhtml:ï html:Ÿž‰‘0¾setSafety–?ýturns“on“the“option“of“checking“the“compatibility“of“the“class“of“the“objectŽ¡‘0before–?ýany“actions“are“performed“on“the“referent.‘ úThis“is“only“used“in“the“ïhtml:ï html:VarProbesŽ¡‘0and–?ýshould“probably“be“moved.ŽŸ8äïhtml:ï html:ïhtml:ï html:Ÿ éÓ‘0unsetSafety–?ýturns“the“safety“option“off.ަïhtml:ï html:Ÿ¦=ÀRegular‘QëPr°gotocolŽŸ âcïhtml:ï html:ïhtml:ï html:Ÿž‰‘0¾(Class)getProbedClass–?ýreturns“the“class“of“the“referent“as“a“ïhtml:ï html:Class“pointer.ŽŽŸ*ºâïcolor push Black’Ôï color popŽŽŒ‹¿s “ºâ ýxºâïcolor push Blackïhtml:ï html:ŸüfdŽŽŽ’Ôï color popŽŽ ^ºâ ýÆïhtml:ï html:ïhtml:ï html:© ‘0¾(const–?ýchar“*)getProbedType“returns“the“typing“of“the“probed“variable/message.‘ úTheޤ ‘0typing–?ýis“represented“using“the“string-format“provided“by“the“Objective-C“runtimeŽ¡‘0system–?ý('c'“for“char,“'@'“for“id,“and“so“on).‘ úIn“general“the“programmer“will“knowŽ¡‘0the–?ýtyping“of“the“variable“so“this“method“will“probably“only“be“used“internally“byŽ¡‘0Swarm–?ýkernel“code.ŽŸïhtml:ï html:ïhtml:ï html:¡‘0clone:› úaZone–?ýreturns“a“clone“of“the“probe.˜It“is“useful“in“case“you“got“the“probeŽ¡‘0by–?ýLibrary“Generation“or“by“the“default“version“of“Object“Generation.‘ úIn“both“casesŽ¡‘0you–?ýwill“have“been“given“a“unique“shared“instance“of“the“probe“-“so“if“you“wantedŽ¡‘0to–?ýmake“changes“to“the“safety“status“of“the“probe“etc.‘ úwithout“affecting“the“otherŽ¡‘0potential–?ýusers“of“the“probe,“you“would“first“clone“it“and“then“make“the“requiredŽ¡‘0changes.ޤ‘0„¤ŽŽ¦ïhtml:ï html:Ÿ\’áøRï>PSfile="eps/prev.eps" llx=298 lly=373 urx=314 ury=389 rwi=160 ŽŽ¦ïhtml:ï html:¡(ProbeLibrary.html)ŽŸ8äïhtml:ï html:Ÿ\’áøRïï html:¡(SwarmObject.html)ŽŸ8äïhtml:ï html:Ÿ\’áøRï>PSfile="eps/next.eps" llx=298 lly=373 urx=314 ury=389 rwi=160 ŽŽ¦ïhtml:ï html:¡(VarProbe.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-10ŽŽŸ*ºâïcolor push Black’Ôï color popŽŽŒ‹É© “ºâ ýxºâïcolor push Blackïhtml:ï html:ŸüfdŽŽŽ’Ôï color popŽŽ ^ºâ ýÆïhtml:ï html:ŸIy½V‘þªarPr |obe‘/ClassŽŸq'‘0„¤ŽŽŸ ïhtml:ï html:¤ R‘0Ã//Ž¡‘0//–ffVarProbe“--Ž¡‘0//–ffAllows“the“user“to“inspect“a“given“variable“in“any“candidateŽ¡‘0//–ffwhich“is“an“instance“of,“or“inherits“from,“a“given“classŽ¡‘0//Ž¡‘0@protocol–ffVarProbe“Ž¡‘0CREATINGŽ¡‘0-–ffsetProbedVariable:“(const“char“*)aVariable;Ž¡‘0SETTINGŽ¡‘0-–ffsetStringReturnType:“returnType;Ž¡‘0USINGŽ¡‘0-–ff(const“char“*)getProbedVariable;Ž¡‘0-–ffsetFloatFormat:“(const“char“*)format;Ž¡‘0//–ffCurrently,“setNonInteractive“must“be“used“*after*“create“phaseŽ¡‘0//–ffIn“any“case“these“should“also“become“setInteractive:“BOOL“etc.Ž¡¡‘0-‘ffsetNonInteractive;Ž¡‘0-‘ff(int)isInteractive;Ž¡¡‘0-–ff(void“*)probeRaw:“anObject;Ž¡‘0-–ff(void“*)probeAsPointer:“anObject;Ž¡‘0-–ff(int)probeAsInt:“anObject;Ž¡‘0-–ff(double)probeAsDouble:“anObject;Ž¡‘0-–ff(const“char“*)probeAsString:“anObject“Buffer:“(char“*)buffer;Ž¡‘0-–ff(const“char“*)probeAsString:“(id)“anObject“Buffer:“(char“*)buf“withFullPre-ŽŸ ‘0cision:‘ff(int)precision;Ž¡‘0-–ffsetData:“anObject“To:“(void“*)“newValue;“//“pass“by“reference.Ž¡‘0-–ff(int)setData:“anObject“ToString:“(const“char“*)s;Ž¡‘0@endŽŸ‘0„¤ŽŽŸ†¾This–?ýis“a“specialized“subclass“of“the“abstract“class“ïhtml:ï html:ÄProbe‘¼r¾.‘ úIt“completes“the“specificationޤ¼jof–?ýa“probe“whose“referent“is“an“instance“variable“element“of“an“object.ŽŸ€’ïhtml:ï html:ŸÕ¢ÀCrš°geate–QëPhase“Pr˜otocolŽŸ ¢Âïhtml:ï html:ŸÉù¾-–?ýsetProbedVariable:‘ ú(const“char“*)aVariable“sets“the“variable“being“probed“(elsewhere“calledŽ¡the–?ýreferent).‘ úThe“ïhtml:ï html:ÄaVariable‘üo¾identifier“is“simply“a“character“string“consisting“of“the“identifierŽŽŸ*ºâïcolor push Black’Ôï color popŽŽŒ‹Ñ} “ºâ ýxºâïcolor push Blackïhtml:ï html:ŸüfdŽŽŽ’Ôï color popŽŽ ^ ýкâ¾of–?ýthe“variable“referent.‘ úFor“example,“if“we“were“probing“a“variable“called“ïhtml:ï html:Äunhappiness‘¼r¾,ŽŸ¼jºâthen–?ýthe“string“would“be“"unhappiness".‘ úThis“method“ïhtml:ï html:must“be“called“during“the“create“phase.Žºâ¤€’ïhtml:ï html:©­ÀSet–QëPhase“Pr°gotocolŽŸ ¢Âïhtml:ï html:Ÿ¡m¾-–?ýsetStringReturnType:‘ úreturnType“sets“the“format“that“will“be“used“to“print“the“variable.Ž¡ïhtml:ï html:¦ÀUsage‘QëPr°gotocolŽŸ âcïhtml:ï html:Ÿïhtml:ï html:ïhtml:ï html:Ÿ¥b‘:¾-–?ýsetFloatFormat:‘ ú(const“char“*)ŽŸÕSïhtml:ï html:Ÿ T=‘XGiven–?ýan“sprintf“style“formatting“string“(eg.‘ ú"ïhtml:ï html:Ã%.3f"¾)“to“a“floating-pointޤ ‘X(or–?ýdouble-floating-point)“probe“will“use“this“formatting“ïhtml:ï html:Äonly‘üo¾when“probingŽ¡‘Xon–?ýa“GUI“display“widget.‘ úSee“section“on“ïhtml:ï html:probing“precisionïhtml:ï html:ޤ )‘X(../probing.html#precision)Ž¡‘Xwhen–?ýprobing“floating“point“number“in“the“documentation“on“probes.ޤ8äïhtml:ï html:ïhtml:ï html:© ð¬‘:-‘?ýsetSafetyŽ¡ïhtml:ï html:ïhtml:ï html:¦‘:-‘?ýunsetSafetyŽŸ8äïhtml:ï html:¦‘XIn–?ýorder“to“ensure“efficiency,“the“default“behaviour“of“the“ïhtml:ï html:ÄVarProbe‘üo¾is“toޤ ‘X"trust"–?ýthat“the“object“it“is“being“presented“with“is“of“an“appropriate“classŽ¡‘X(the–?ýone“specified“in“ïhtml:ï html:ÄsetProbedClass‘¼r¾,“or“a“subclass“of“it).‘ úHowever,“by“callingŽ¡‘Xïhtml:ï html:ÄsetSafety‘¼r¾,–?ýwe“force“the“probe“to“inspect“the“class“of“the“target“object“beforeŽ¡‘Xprobing‘?ýit.ŽŸ8äïhtml:ï html:ïhtml:ï html:¦‘:-‘?ýsetNonInteractiveŽŸïhtml:ï html:ïhtml:ï html:Ÿ )‘:-‘?ý(int)isInteractiveŽŸÕSïhtml:ï html:Ÿ T=‘XBy–?ýsetting“a“ïhtml:ï html:ÄVarProbe‘üo¾to“be“non-interactive“we“ensure“that“the“user“will“notŽ¡‘Xbe–?ýable“to“ïhtml:ï html:change“the“value“of“the“probe,“but“only“observe“it.‘ úThe“defaultŽ¡‘Xis–?ýfor“variables“of“type“ïhtml:ï html:Ã(char–ff*),“char,“unsigned“char,“int,“unsigned“int,Ž¡‘Xfloat¾and–?ýïhtml:ï html:Ãdouble“¾to“be“interactive“and“for“all“the“others“to“be“non-interactiveŽ¡‘X(with–?ýthe“exception“of“the“ïhtml:ï html:Ãid“¾type“this“follows“because“there“is“no“simpleŽ¡‘Xway–?ýto“set“such“things“as“structs“or“arrays“by“typing“values“into“an“entryŽ¡‘Xfield).‘ úFor–?ýthe“time“being,“setting“the“VarProbe“to“be“non-interactive“willŽ¡‘Xnot–?ýinterfere“with“the“drag&drop“capability“of“objects“into“the“ïhtml:ï html:ÄVarProbe‘üo¾entry-field...Ž¡‘XThis–?ýis“considered“an“omission“and“will“be“corrected“by“the“next“release.Ž¡‘XAlso,–?ýfor“the“time“being“there“is“no“way“to“disable“a“ïhtml:ï html:ÄVarProbe‘üo¾once“it“hasŽ¡‘Xbeen–?ýdisplayed“(i.e.‘ úafter“a“ïhtml:ï html:ÄProbeDisplay›üo¾containing“the“ïhtml:ï html:ÄVarProbe˜¾has“beenŽ¡‘Xcreated).‘ úThe–?ýability“to“do“this“will“also“be“included“in“the“next“release.ޤ8äïhtml:ï html:ïhtml:ï html:¦‘:-–?ý(const“char“*)getProbedVariableŽŸ8äïhtml:ï html:¦‘Xreturns–?ýa“string“matching“the“identifier“of“the“referent.Ž¡ïhtml:ï html:ïhtml:ï html:¦‘:-‘?ý(int)getDataOffsetŽŸ8äïhtml:ï html:¦‘XThis–?ýis“another“example“of“a“method“used(?)‘ úexclusively“by“the“Swarm“kernel,ŽŸ ‘Xit–?ýreturns“the“offset“used“to“extract“the“variable“from“the“target“object.ŽŽŸ*ºâïcolor push Black’Ôï color popŽŽŒ‹Ù¨ “ºâ ýxºâïcolor push Blackïhtml:ï html:ŸüfdŽŽŽ’Ôï color popŽŽ ^ºâ ýÆïhtml:ï html:ïhtml:ï html:Ÿ ‘:¾-–?ý(void“*)probeRaw:‘ úanObjectޤ8äïhtml:ï html:ïhtml:ï html:© à¶‘:-–?ý(void“*)probeAsPointer:‘ úanObjectŽ¡ïhtml:ï html:ïhtml:ï html:¦‘:-‘?ý(int)probeAsInt:‘ úanObjectŽ¡ïhtml:ï html:ïhtml:ï html:¦‘:-‘?ý(double)probeAsDouble:‘ úanObjectŽ¡ïhtml:ï html:ïhtml:ï html:¦‘:-–?ý(const“char“*)probeAsString:› úanObject“Buffer:˜(char“*)“bufferŽ¡ïhtml:ï html:ïhtml:ï html:¦‘:-–?ý(const“char“*)probeAsString:› úanObject“Buffer:˜(char“*)“buffer“withPrecision:ޤ ‘D(int)‘?ýprecisionŽŸ8äïhtml:ï html:¦‘XThese–?ýare“the“methods“which“actually“use“the“probe.‘ úïhtml:ï html:ÄprobeRaw‘üo¾simply“returnsŽ¡‘Xa–?ýpointer“to“the“probed“variable,“whereas“the“other“methods“return“it“as“aŽ¡‘Xparticular–?ýtype.‘ úïhtml:ï html:ÄprobeAsString‘üo¾simply“prints“the“value“of“the“variable“intoŽ¡‘Xthe–?ýbuffer“(in“more“or“less“the“same“format“you“would“expect“from“a“ïhtml:ï html:Äsprintf()‘¼r¾).Ž¡‘XThe–?ýbuffer“should“be“pre-allocated.‘ úThe“second“form“of“ïhtml:ï html:ÄprobeAsString‘üo¾is“onlyŽ¡‘Xused–?ýinternally“by“ïhtml:ï html:ïhtml:ï html:ÃObjectSaverïhtml:ï html:ޤ š‘X(../simtools/ObjectSaver.html)Ž¡‘X¾to–?ýuse“the“"saved“as"“precision“form“which“can“be“different“from“the“"displayed"Ž© ‘Xprecision.‘ úSee–?ýthe“section“on“setting“the“ïhtml:ï html:probing“precisionïhtml:ï html:Ž¡‘X(../probing.html#precision)Ž¡‘Xfor–?ýfloating-point“numbers.– úïhtml:ï html:Note:“The–?ýïhtml:ï html:ÄVarProbe‘üo¾will“complain“if“you“tryަ‘Xto–?ýdo“weird“type“conversions:‘ úfor“example,“if“the“probed“variable“is“of“typeަ‘Xpointer–?ýand“you“try“to“use“the“ïhtml:ï html:ÄprobeAsDouble‘üo¾method“then“the“return“valueަ‘Xwill–?ýbe“undefined“(and“you“will“get“an“error“message“on“ïhtml:ï html:Ästderr‘¼r¾).ŽŸ8äïhtml:ï html:ïhtml:ï html:¤ à¶‘:-‘?ýsetStringReturnType:‘ úreturnTypeŽŸ8äïhtml:ï html:¡‘XWhen–?ýthe“ïhtml:ï html:ÄprobedVariable‘üo¾is“of“type“ïhtml:ï html:Ãunsigned‘ffchar“¾or“ïhtml:ï html:Ãchar¾,“the“method“ïhtml:ï html:ÄprobeAsStringަ‘X¾will,–?ýby“default,“return“a“string“of“the“format:› ú"'%c'“%d".˜This“is“meantަ‘Xto–?ýreflect“the“commonplace“use“of“an“ïhtml:ï html:Ãunsigned‘ffchar“¾as“a“small“ïhtml:ï html:Ãint¾.‘ úHowever,ަ‘Xthe–?ýuser“can“tailor“the“format“returned“by“the“probe“to“use“only“one“of“theަ‘Xtwo–?ýpossible“representations.Ž©8äïhtml:ï html:¡‘0The–?ýlegal“values“for“returnType“are:ަïhtml:ï html:Ÿïhtml:ï html:¡‘Xïcolor push BlackÁlï color popŽŽ‘bïhtml:ï html:¾DefaultString–?ý("'%c'“%i")ަïhtml:ï html:¡‘Xïcolor push BlackÁlï color popŽŽ‘bïhtml:ï html:¾CharString‘?ý("'%c'")ަïhtml:ï html:¡‘Xïcolor push BlackÁlï color popŽŽ‘bïhtml:ï html:¾IntString‘?ý("%i").ަïhtml:ï html:¡‘XNote:‘ úWhen–?ýsetting“the“value“of“an“unsigned“char“or“a“char“using“the“ïhtml:ï html:ÄsetData:ToString:ޤ ‘X¾(method–?ýdescribed“below),“the“expected“format“of“the“string“is“always“"%i"Ž¡‘Xunless–?ýïhtml:ï html:ÄCharString‘üo¾was“chosen“(in“which“case“the“format“should“be“"'%c'").ަïhtml:ï html:ïhtml:ï html:¤ à¶‘:-–?ýsetData:› úanObject“To:˜(void“*)newValueަïhtml:ï html:ïhtml:ï html:¡‘:-–?ýsetData:› úanObject“ToString:˜(const“char“*)sŽŸ8äïhtml:ï html:¡‘XThe–?ýprogrammer“can“set“the“ïhtml:ï html:ÄprobedVariable‘üo¾via“these“methods,“either“by“providingޤ ‘Xa–?ýpointer“to“the“new“value“or“a“string“which“the“probe“will“read“and“convertŽ¡‘Xappropriately.– úïhtml:ï html:Note:“For–?ýthe“time“being,“the“kernel“itself“is“the“only“softwareŽ¡‘Xwhich–?ýuses“probes“in“this“fashion,“so“we“can“get“away“with“expecting“eitherŽŽŸ*ºâïcolor push Black’Ôï color popŽŽŒ‹ê “ºâ ýxºâïcolor push Blackïhtml:ï html:ŸüfdŽŽŽ’Ôï color popŽŽ ^ ýБWºâ¾a–?ýstring“or“a“pointer.‘ úHowever,“if“any“user“should“require“more“types“(suchޤ ‘Wºâas–?ýthe“choice“provided“in“the“ïhtml:ï html:ÄprobeAs‘üo¾series),“please“ïhtml:ï html:emailïhtml:ï html:Ž¡‘Wºâ(mailto:swarm@santafe.edu)Ž¡‘Wºâus–?ýand“I“will“include“them“in“the“following“release!Ž©‘/ºâ„¤ŽŽºâ¤ ïhtml:ï html:Ÿ\’áøRï>PSfile="eps/prev.eps" llx=298 lly=373 urx=314 ury=389 rwi=160 ŽŽ¡ïhtml:ï html:¦(Probe.html)ŽŸÕSïhtml:ï html:Ÿ\’áøRïï html:¦(SwarmObject.html)ŽŸ8äïhtml:ï html:Ÿ\’áøRï>PSfile="eps/next.eps" llx=298 lly=373 urx=314 ury=389 rwi=160 ŽŽ¡ïhtml:ï html:¦(MessageProbe.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-10ŽŽŸ*ºâïcolor push Black’Ôï color popŽŽŒ‹üñ “ºâ ýxºâïcolor push Blackïhtml:ï html:ŸüfdŽŽŽ’Ôï color popŽŽ ^ºâ ýÆïhtml:ï html:ŸIy½MessagePr |obe‘/ClassŽŸq'‘0„¤ŽŽ© ïhtml:ï html:¤ Α0Ã//Ž¡‘0//–ffMessageProbe“--Ž¡‘0//‘32Allows–ffthe“user“to“call“a“given“message“on“any“candidateŽ¡‘0//‘32which–ffis“an“instance“of,“or“inherits“from,“a“given“classŽ¡‘0//Ž¡‘0@protocol–ffMessageProbe“Ž¡‘0CREATINGŽ¡‘0-–ffsetProbedSelector:“(SEL)“aSel;Ž¡‘0-–ffsetProbedMessage:“(const“char“*)aMessage;Ž¡‘0-–ffsetHideResult:“(int)“val;Ž¡‘0USINGŽ¡‘0-(int)isResultId;‘[ÌÆ//–ffI“doubt“that“a“user“willŽ¡‘0-(int)isArgumentId:–ff(int)which;‘32//“ever“need“these.Ž¡¡‘0-–ff(const“char“*)getProbedMessage;Ž¡‘0-‘ff(int)getArgNum;Ž¡‘0-–ff(const“char“*)getArg:“(int)which;Ž¡‘0-–ff(const“char“*)getArgName:“(int)which;Ž¡‘0-‘ff(int)getHideResult;Ž¡¡‘0-–ffsetArg:“(int)which“To:“(const“char“*)what;Ž¡¡‘0-–ffdynamicCallOn:“target“resultStorage:“(const“char“**)result;Ž¡‘0-–ffdynamicCallOn:“target;Ž¡¡‘0-–ffupdateMethodCache:“anObject;Ž¡‘0-–ff(int)intDynamicCallOn:“target;Ž¡‘0-–ff(float)floatDynamicCallOn:“target;Ž¡‘0-–ff(double)doubleDynamicCallOn:“target;Ž¡‘0@endŽŸ‘0„¤ŽŽ¦ïhtml:ï html:¡‘0¾This–?ýis“a“specialized“subclass“of“the“abstract“class“ïhtml:ï html:Probe.‘ úIt“completes“the“specificationŽŸ ‘0of–?ýa“probe“whose“referent“is“a“message“element“of“an“object.ŽŸ€’ïhtml:ï html:ŸžTÀCrš°geate–QëPhase“Pr˜otocolŽŸ ¢Âïhtml:ï html:Ÿïhtml:ï html:ïhtml:ï html:Ÿ ÖA‘:¾setProbedSelector:‘ ú(SEL)aSelectorŽŸÕSïhtml:ï html:ïhtml:ï html:Ÿ E{‘:setProbedMessage:‘ ú(const–?ýchar“*)aMessageŽŸ8äïhtml:ï html:Ÿ áê‘Xsets–?ýthe“message“to“be“probed.‘ úAt“least“one“of“these“methods“ïhtml:ï html:must“be“called.ŽŸ8äïhtml:ï html:ŽŸ*ºâïcolor push Black’Ôï color popŽŽŒ‹: “ºâ ýxºâïcolor push Blackïhtml:ï html:ŸüfdŽŽŽ’Ôï color popŽŽ ^ ýБ/ºâ¾Note–?ýthat“due“to“a“bug“in“gcc-2.7.2“it“is“unadvisable“(though“we“have“not“disallowedޤ ‘/ºâit)–?ýto“make“a“message“probe“using“ïhtml:ï html:setProbedMessage.‘ úThe“next“release“of“gcc“willŽ¡‘/ºâcontain–?ýa“patch“for“this“bug.‘ úIf“you“absolutely“require“the“ability“to“create“messageprobesŽ¡‘/ºâusing–?ýïhtml:ï html:setProbedMessage,“please“ïhtml:ï html:emailïhtml:ï html:ޤ AZ‘/ºâ(mailto:‘ úswarm@santafe.edu)Ž¡‘/ºâus.ŽºâŸG®ïhtml:ï html:ŸýÄÀUsage‘QëPr°gotocolŽŸ âcïhtml:ï html:Ÿïhtml:ï html:ïhtml:ï html:Ÿ½,‘:¾(const–?ýchar“*)getProbedMessageŽ©8äïhtml:ï html:¤ v‘Xreturns–?ýthe“string“matching“the“identifier“of“the“message“being“probed.ŽŸ8äïhtml:ï html:ïhtml:ï html:¡‘:(int)getHideResultަïhtml:ï html:ïhtml:ï html:¡‘XsetHideResult:‘ ú(int)val–?ýBy“setting“ïhtml:ï html:hideResult“to“1,“the“user“is“indicatingޤ ‘Xthat–?ýthe“result“field,“in“a“graphical“representation“of“the“message“probe,Ž¡‘Xshould–?ýnot“be“shown.‘ úIn“other“words,“if“a“probe“display“attempts“to“representŽ¡‘Xthe–?ýmessage“probe,“it“should“hide“the“result“window.‘ úThis“is“useful,“particularlyŽ¡‘Xwhen–?ýthe“return“value“is“defined“to“be“self.ŽŸïhtml:ï html:ïhtml:ï html:Ÿ AZ‘:(const–?ýchar“*)getArg:‘ ú(int)whichަïhtml:ï html:¤ v‘Xreturns–?ýa“string“representation“of“the“n'th“argument.ŽŸ8äïhtml:ï html:ïhtml:ï html:¡‘:(int)getArgNumަïhtml:ï html:¡‘Xreturns–?ýthe“number“of“arguments“the“message“takes.ŽŸ8äïhtml:ï html:ïhtml:ï html:¡‘:(const–?ýchar“*)getArgName:‘ ú(int)whichަïhtml:ï html:¡‘Xreturns–?ýa“string“representation“of“the“argument“with“the“given“name.ŽŸ8äïhtml:ï html:ïhtml:ï html:¡‘:setArg:– ú(int)which›?ýTo:“(const˜char˜*)whatަïhtml:ï html:¡‘Xsets–?ýthe“n'th“argument“of“the“message“-“the“argument“must“be“provided“in“stringޤ ‘Xform.ŽŸïhtml:ï html:ïhtml:ï html:Ÿ AZ‘:(int)isResultIdŽŸÕSïhtml:ï html:Ÿ l‘XThis–?ýmethod“is“used“by“the“Swarm“internals“to“find“out“whether“the“returnŽ¡‘Xvalue–?ýof“the“message“is“of“type“object.ŽŸ8äïhtml:ï html:ïhtml:ï html:¤ v‘:(int)isArgumentId:‘ ú(int)whichަïhtml:ï html:¡‘XThis–?ýmethod“is“used“by“the“Swarm“internals“to“find“out“whether“a“given“argumentŽŸ ‘Xof–?ýthe“message“is“of“type“object.ŽŸ8äïhtml:ï html:ïhtml:ï html:¡‘:updateMethodCache:‘ úanObjectަïhtml:ï html:¡‘XThe–?ýmessage“probe“will“always“attempt“to“optimise“the“way“in“which“it“dispatchesޤ ‘Xdynamic–?ýcalls“to“the“probed“objects.‘ úIn“practice,“this“means“that“when“theŽ¡‘Xprobed–?ýmessage“takes“no“arguments,“then“the“message“probe“will“cache“the“actualŽ¡‘Ximplementation–?ýof“the“method“and“generate“direct“C“function“calls“(as“opposedŽ¡‘Xto–?ýcalling“ïhtml:ï html:perform,“for“example)“ïhtml:ï html:if“the“user“promises“that“only“one“classŽ¡‘Xof–?ýobjects“is“being“probed.‘ úThe“user“does“this“by“calling“the“ïhtml:ï html:updateMethodCache:Ž¡‘Xwith–?ýan“example“object“of“the“appropriate“target“class.‘ úThis“method“can“beŽ¡‘Xcalled–?ýas“often“as“necessary“throughout“the“lifetime“of“the“message“probe.ŽŸ8äïhtml:ï html:ïhtml:ï html:Ÿ v‘:dynamicCallOn:‘ útargetŽŽŸ*ºâïcolor push Black’Ôï color popŽŽŒ‹ · “ºâ ýxºâïcolor push Blackïhtml:ï html:ŸüfdŽŽŽ’Ôï color popŽŽ ^ºâ ýÆïhtml:ï html:ïhtml:ï html:Ÿ ‘:¾dynamicCallOn:– útarget›?ýresultStorage:“(const˜char˜**)resultޤ8äïhtml:ï html:ïhtml:ï html:© Ç‘:(int)intDynamicCallOn:‘ útargetŽ¡ïhtml:ï html:ïhtml:ï html:¦‘:(double)doubleDynamicCallOn:‘ útargetŽŸ8äïhtml:ï html:¦‘XThese–?ýare“the“methods“used“to“actually“generate“a“dynamic“message“call“onޤ ‘Xthe–?ýtarget“object.‘ úThe“first“method“does“not“return“a“result,“the“secondŽ¡‘Xwill–?ýreturn“a“dynamically“ïhtml:ï html:malloc'ed“string“based“representation“of“the“result,Ž¡‘Xwhereas–?ýthe“third“and“fourth“methods“assume“the“user“knows“the“exact“typingŽ¡‘Xof–?ýthe“method“and“would“like“a“direct“translation“into“the“appropriate“datatype.Ž©‘0„¤ŽŽ¤ ïhtml:ï html:Ÿ\’áøRï>PSfile="eps/prev.eps" llx=298 lly=373 urx=314 ury=389 rwi=160 ŽŽ¡ïhtml:ï html:¦(VarProbe.html)ŽŸÕSïhtml:ï html:Ÿ\’áøRïï html:¦(SwarmObject.html)ŽŸ8äïhtml:ï html:Ÿ\’áøRï>PSfile="eps/next.eps" llx=298 lly=373 urx=314 ury=389 rwi=160 ŽŽ¡ïhtml:ï html:¦(ProbeMap.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-10ŽŽŸ*ºâïcolor push Black’Ôï color popŽŽŒ‹¨ “ºâ ýxºâïcolor push Blackïhtml:ï html:ŸüfdŽŽŽ’Ôï color popŽŽ ^ºâ ýÆïhtml:ï html:ŸIy½CustomPr |obeMap‘/ClassŽŸq'‘0„¤ŽŽ© ïhtml:ï html:¤ =V‘0Ã//Ž¡‘0//–ffCustomProbeMap“--Ž¡‘0//‘32A–ffsubclass“of“ProbeMap,“whose“initial“state“is“empty“unlike“the“defaultŽ¡‘0//‘32probeMap–ffinitial“state“which“contains“all“the“VarProbesŽ¡‘0//‘32of–ffthe“requested“target“class.Ž¡‘0//Ž¡‘0@protocol–ffCustomProbeMap“Ž¡‘0+–ffcreate:“aZone“forClass:“(Class)aClass“withIdenti-ŽŸ ‘0fiers:–ff(const“char“*)vars,“...;Ž¡‘0@endŽŸ‘0„¤ŽŽ¦ïhtml:ï html:¡‘0¾This–?ýsubclass“of“the“ïhtml:ï html:ProbeMap“is“used“to“create“probe“maps“which“are“initialised“inޤ ‘0an–?ýemtpy“state“or“with“the“ïhtml:ï html:VarProbes“and“ïhtml:ï html:MessageProbes“intended.‘ úIn“other“words,Ž¡‘0the–?ýprobed“class“is“set,“as“is“the“case“with“the“normal“ïhtml:ï html:ProbeMap“class“but“upon“ïhtml:ï html:createEndŽ¡‘0no–?ýïhtml:ï html:VarProbes“or“ïhtml:ï html:MessageProbes“will“be“present“within“it.‘ úThis“feature“is“useful“whenŽ¡‘0creating–?ýa“probe“map“from“scratch“(e.g.‘ úto“be“used“in“conjunction“with“the“ïhtml:ï html:setProbeMap:For:Ž¡‘0message–?ýof“the“ïhtml:ï html:ProbeLibrary).Ž©8äïhtml:ï html:Ÿ r‘0An–?ýadditional“convenience“method“was“added“to“help“compress“the“amount“of“code“neededŽ¡‘0to–?ýcreate“a“custom“probe.ަïhtml:ï html:ïhtml:ï html:Ÿ r‘0Â+–ffcreate:“aZone“forClass:“(Class)aClass“withIdenti-Ž¡‘0fiers:–ff(const“char“*)vars,“...;ŽŸõ]ïhtml:ï html:Ÿ Gù‘0¾This–?ýis“a“variable“argument“message“which“takes“a“Zone,“a“Class“name,“and“a“colon-delimitedŽ¡‘0list–?ýof“instance“variable“names“and“message“names“valid“for“that“class.‘ úThe“instanceŽ¡‘0variable–?ýidentifiers“are“listed“first“followed“by“a“string“consisting“solely“of“aŽ¡‘0":"–?ýfollowed“by“the“message“identifiers.‘ úThe“general“format“would“be:ަïhtml:ï html:Ÿ r‘0Ã[CustomProbeMap–ffcreate:“aZoneޤ =V‘{™”forClass:‘ffaClassŽ¡‘UÌÊwithIdentifiers:–ff"variable1",“"variable2",“...,Ž¡’±™":",Ž¡’±™"message1",–ff"message2",“...,Ž¡’±™NULL];Ž¡¾All–?ýstrings“up“to“the“":"“are“read“as“instance“variable“names“and“placed“in“the“probe“map“andޤ all–?ýstrings“after“the“":"“are“read“as“message“names“and“placed“in“the“probe“map.‘ úThe“NULLŽ¡string–?ýterminates“the“list.‘ úAn“example“of“this“message“being“used“is“given“in“the“ïhtml:ï html:AdvancedŽ¡Usage‘?ýGuideïhtml:ï html:ޤ =V(./AdvancedUsage.html)Ž¡.ŽŸ‘0„¤ŽŽŸ ïhtml:ï html:ŽŸ*ºâïcolor push Black’Ôï color popŽŽŒ‹!× “ºâ ýxºâïcolor push Blackïhtml:ï html:ŸüfdŽŽŽ’Ôï color popŽŽ ^ ýÖ\’á³4ï>PSfile="eps/prev.eps" llx=298 lly=373 urx=314 ury=389 rwi=160 ŽŽºâ¤ ïhtml:ï html:©¾(ProbeMap.html)ŽŸ8äïhtml:ï html:Ÿ\’áøRïï html:¦(Interface.html)ŽŸÕSïhtml:ï html:Ÿ\’áøRï>PSfile="eps/next.eps" llx=298 lly=373 urx=314 ury=389 rwi=160 ŽŽ¡ïhtml:ï html:¦(CompleteProbeMap.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-10ŽŽŸ*ºâïcolor push Black’Ôï color popŽŽŒ‹-Á “ºâ ýxºâïcolor push Blackïhtml:ï html:ŸüfdŽŽŽ’Ôï color popŽŽ ^ºâ ýÆïhtml:ï html:ŸIy½CompletePr |obeMap‘/ClassŽŸq'‘0„¤ŽŽ© ïhtml:ï html:¤ ‘0Ã//Ž¡‘0//–ffCompleteProbeMap“--Ž¡‘0//‘32A–ffsubclass“of“ProbeMap,“whose“initial“state“contains“the“VarProbes“andŽ¡‘0//‘32MessageProbes–ffof“the“requested“target“class“but“also“those“of“all“itsŽ¡‘0//‘32superclasses.Ž¡‘0//Ž¡‘0@protocol–ffCompleteProbeMap““@endŽŸ‘0„¤ŽŽ¦ïhtml:ï html:¡‘0¾Upon–?ýcreation,“this“subclass“of“the“ïhtml:ï html:ProbeMap“will“contain“all“the“variables“and“allŽ¡‘0the–?ýmessages“of“a“given“class“(including“the“inherited“ones).ޤ‘0„¤ŽŽ¦ïhtml:ï html:Ÿ\’áøRï>PSfile="eps/prev.eps" llx=298 lly=373 urx=314 ury=389 rwi=160 ŽŽ¦ïhtml:ï html:¡(EmptyProbeMap.html)ŽŸ8äïhtml:ï html:Ÿ\’áøRïï html:¡(Interface.html)ŽŸÕSïhtml:ï html:Ÿ\’áøRï>PSfile="eps/next.eps" llx=298 lly=373 urx=314 ury=389 rwi=160 ŽŽ¦ïhtml:ï html:¡(CompleteVarMap.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-10ŽŽŸ*ºâïcolor push Black’Ôï color popŽŽŒ‹1l “ºâ ýxºâïcolor push Blackïhtml:ï html:ŸüfdŽŽŽ’Ôï color popŽŽ ^ºâ ýÆïhtml:ï html:ŸIy½Objectbase–/Library:‘m™Usage“GuideŽŸq'‘0„¤ŽŽŸG®ïhtml:ï html:Ÿ5YÀOv•ÓÅer“viewŽŸ ¢Âïhtml:ï html:Ÿ 4b‘0¾The–?ýïhtml:ï html:objectbase“library“contains“the“most“basic“objects“users“need“to“design“theirޤ ‘0agents–?ýand“swarms.‘ úIt“also“serves,“at“present,“as“a“repository“for“the“probe“machinery,Ž¡‘0which–?ýis“provided“for“every“ïhtml:ï html:SwarmObject.‘ úThe“way“the“classes“in“this“library“areŽ¡‘0to–?ýbe“used“is“varied.‘ úBut,“basically,“it“is“provided“so“that“the“user“will“have“somethingŽ¡‘0to–?ýsubclass“from“for“her“own“objects“and“Swarms.ŽŸ€’ïhtml:ï html:ŸüuÀExample–QëUsage“of“ïhtml:ï html:SwarmObjectŽŸ âcïhtml:ï html:ŸôÁ‘0¾The–?ýbest“way“to“explain“how“the“library“should“be“used“is“to“walk“through“an“example.Ž¡‘0So,–?ýusing“Heatbugs,“we'll“walk“through“the“ways“ïhtml:ï html:objectbase“is“used“and“discuss“them.Ž¡‘0Since–?ýmore“documentation“is“usually“better“than“less,“I'm“going“to“explain“thingsŽ¡‘0at–?ýa“low“level“so“that“those“not“familiar“with“Objective“C“will“understand“the“discussion.Ž¡‘0If–?ýyou“already“are“familiar“with“Objective“C,“then“you“should“skip“this“part.Ž©8äïhtml:ï html:Ÿ @ ‘0First–?ýoff,“the“basic“elements“of“the“Heatbugs“simulation“are“the“heatbugs,“the“modelŽ¡‘0swarm–?ý(which“bundles“the“heatbugs),“and“the“observer“swarm“(which“bundles“the“displaysŽ¡‘0of–?ýthe“probes“poking“into“the“model“swarm“and“the“heatbugs).‘ úThe“interface“filesŽ¡‘0for–?ýeach“show“what“must“be“imported“and“the“declaration“syntax“needed“to“subclassŽ¡‘0from‘?ýïhtml:ï html:SwarmObject.ަïhtml:ï html:Ÿ @ ‘0We'll–?ýuse“ïhtml:ï html:ÃHeatbug.h“¾for“our“discussion“here.‘ úThe“first“part“of“the“file“shows“theŽ¡‘0C-preprocessor–?ýimports“needed:ަïhtml:ï html:Ÿ @ ‘0Ã#import‘ffޤ xï‘0#import‘ffŽ¡‘0#import‘ff"HeatSpace.h"Ž¡‘0#import‘ffŽŸbÌïhtml:ï html:Ÿ #‘0¾The–?ýïhtml:ï html:Ã#import‘ff;“¾is“included“in“order“to“subclass“from“ïhtml:ï html:SwarmObject.ޤ ‘0However,–?ýto“provide“backwards“compatibility,“we've“placed“this“import“in“the“libraryŽ¡‘0interface–?ýfile“ïhtml:ï html:Ãobjectbase.h“¾as“well,“which“means“one“could“subclass“from“ïhtml:ï html:SwarmObjectŽ¡‘0by–?ýsimply“importing“the“ïhtml:ï html:Ãobjectbase.h“¾file.‘ úThis“is“discouraged“in“order“to“makeŽ¡‘0the–?ýlibrary“interfaces“as“standard“as“possible.ަïhtml:ï html:¤ @ ‘0The–?ýnext“ïhtml:ï html:objectbase“relevant“piece“of“code“in“this“file“is:ަïhtml:ï html:¡‘0Ã@interface–ffHeatbug:“SwarmObjectޤ xï‘0ó©±Ê cmsy9ÊfŽ¡‘:ÌÌÃdouble‘ffunhappiness;Ž¡‘:ÌÌint–ffx,“y;Ž¡‘:ÌÌHeatValue‘ffidealTemperature;Ž¡‘:ÌÌHeatValue‘ffoutputHeat;ŽŽŸ*ºâïcolor push Black’Ôï color popŽŽŒ‹ 7ê “ºâ ýxºâïcolor push Blackïhtml:ï html:ŸüfdŽŽŽ’Ôï color popŽŽ ^ ýБ:‡®Ãfloat‘ffrandomMoveProbability;ޤ %¡‘:‡®Grid2d–ff*“world;Ž¡‘:‡®int–ffworldXSize,“worldYSize;Ž¡‘:‡®HeatSpace–ff*“heat;Ž¡‘:‡®Color‘ffbugColor;Ž¡‘/ºâÊgŽºâŸ@ïhtml:ï html:Ÿ å‘0¾The–?ýïhtml:ï html:Ã@interface“¾keyword“indicates“that“you“are“beginning“the“definition“of“the“partޤ ‘0of–?ýan“object“(a“ïhtml:ï html:Heatbug“in“this“case)“that“will“be“visible“to“other“objects.‘ úTheŽ¡‘0ïhtml:ï html:ÃHeatbug:‘ ÌÌSwarmObject–?ý¾indicates“that“you“are“calling“this“object“ïhtml:ï html:Heatbug“and“it“isŽ¡‘0a–?ýsubclass“of“ïhtml:ï html:SwarmObject.‘ úWhat“follows“between“the“curly“braces“(ó !",š cmsy10¸fg¾)“are“the“instanceŽ¡‘0variables–?ýdefined“for“the“ïhtml:ï html:Heatbug“class“ïhtml:ï html:above“and“beyond“those“inherited“from“theŽ¡‘0ïhtml:ï html:SwarmObject‘?ýclass.Ž©8äïhtml:ï html:Ÿ 쬑0Inside–?ýthis“"agent,"“we“have“defined“several“parameters“associated“with“either“theŽ¡‘0agent,–?ýitself,“or“the“space“in“which“it“sits.‘ úAny“data“that“will“need“to“be“presentŽ¡‘0throughout–?ýall“the“behavior“and“lifetime“of“the“agent“should“be“declared“here.‘ úAlso,Ž¡‘0anything–?ýdeclared“here“will“be“accessible“to“the“probe“machinery,“and“so“will“be“capableŽ¡‘0of–?ýbeing“manipulated“and“viewed“from“outside“the“agent.ަïhtml:ï html:Ÿ 쬑0Next–?ýcome“the“message“prototypes“to“which“this“agent“will“respond.‘ úAnd“it“is“worthŽ¡‘0noting–?ýagain“that“these“are“ïhtml:ï html:in“addition“to“those“declared“in“the“ïhtml:ï html:SwarmObject“superclass.Ž¡‘0So,–?ýnot“only“will“other“objects“be“able“to“send“messages“to“this“agent“that“are“declaredŽ¡‘0here,–?ýbut“other“objects“will“be“able“to“send“all“the“messages“declared“in“the“ïhtml:ï html:Ãob-Ž¡‘0jectbase/SwarmObject.h–?ý¾imported“previously.‘ úThe“messages“prototyped“here“will“dictateŽ¡‘0what–?ýthe“compiler“thinks“this“object“can“respond“to.‘ úHence,“if“any“part“of“any“ofŽ¡‘0these–?ýprototypes“differs“from“the“corresponding“function“definition“in“the“ïhtml:ï html:ÃHeat-Ž¡‘0bug.m–?ý¾file,“then“the“compiler“will“say“something“like“ïhtml:ï html:ÃObject:‘ ÌÌaHeatbug–ffdoes“notŽ¡‘0respond–ffto“xyz¾,–?ýwhere“"xyz"“is“the“name“of“the“message“that“is“being“sent“to“theŽ¡‘0ïhtml:ï html:ÃHeatbug¾.‘ úA–?ýscript“is“provided“with“the“Swarm“distribution“that“fixes“header“fileŽ¡‘0prototypes–?ýto“match“the“message“declarations“in“the“corresponding“".m"“file.‘ úThisŽ¡‘0script–?ýshould“be“in“the“ïhtml:ï html:Ã$SWARMHOME/bin“¾directory“and“is“called“ïhtml:ï html:Ãm2h¾.ަïhtml:ï html:Ÿ 쬑0One–?ýmore“thing“to“notice“about“these“prototypes“is“that“some“of“them“are“duplicatesŽ¡‘0of–?ýwhat“appears“in“the“ïhtml:ï html:Ãobjectbase/SwarmObject.h“¾file.‘ úThis“means“that“when“the“messageŽ¡‘0is–?ýcalled“on“a“ïhtml:ï html:Heatbug“object,“it“will“execute“the“method“defined“here“and“not“theŽ¡‘0one–?ýin“the“ïhtml:ï html:SwarmObject“class.‘ úIn“the“ïhtml:ï html:objectbase“library,“the“following“messages“areŽ¡‘0intended–?ýto“be“overridden,“as“necessry:‘ úïhtml:ï html:Ãcreate:,–ffcreateBegin:,“createEnd,“cus-Ž¡‘0tomizeBegin:,–ffcustomizeEnd,“customizeCopy:,“describe:,“and“getInstanceName.‘ ú¾EachŽ¡‘0of–?ýthese“messages“do“specific“things“that“may“change“from“subclass“to“subclass“ofŽ¡‘0ïhtml:ï html:SwarmObject.› úIn–?ýthis“case,“however,“we're“only“overriding“ïhtml:ï html:ÃcreateEnd¾.˜The“differencesŽ¡‘0between–?ýwe“implement“it“in“ïhtml:ï html:Heatbugs“and“the“default“is“not“that“significant.‘ úBut,Ž¡‘0it–?ýshould“be“pointed“out“that“when“overriding“certain“messages,“like“ïhtml:ï html:ÃcreateBegin:Ž¡‘0¾and–?ýïhtml:ï html:ÃcreateEnd¾,“the“new“method“should“call“the“superclass'“version“of“the“message,Ž¡‘0as–?ýwell.‘ úThis“is“done“using“the“default“pointer“to“the“superclass,“designated“ïhtml:ï html:super.Ž¡‘0The–?ýsyntax“in“the“ïhtml:ï html:Heatbugs“case“is:ަïhtml:ï html:Ÿ 쬑0Ã[super‘ffcreateEnd];ŽŸbÌïhtml:ï html:ŽŸ*ºâïcolor push Black’Ôï color popŽŽŒ‹!E' “ºâ ýxºâïcolor push Blackïhtml:ï html:ŸüfdŽŽŽ’Ôï color popŽŽ ^ ýБ/ºâ¾The–?ýreasons“for“doing“this“are“related“to“the“object“phase“protocols“used“by“ïhtml:ï html:defobj.Ž© ‘/ºâIf–?ýyou“would“like“more“info“on“that,“see“ïhtml:ï html:Objective“C“-“Swarm“Styleïhtml:ï html:ޤ ® ‘/ºâ(../../swarmObjC.html)Ž¡‘/ºâin–?ýthe“section“entitled“ïhtml:ï html:ÄThe“Create“Phase“In“Principle‘¼r¾.Žºâ¤8äïhtml:ï html:Ÿ u¼‘0Finally,–?ýthe“ïhtml:ï html:Ã@end“¾keyword“signifies“the“end“of“the“interface“definition.‘ úGNU“Objectiveަ‘0C–?ýallows“one“to“leave“this“off;“but,“it“is“not“good“practice.Ž¡ïhtml:ï html:Ÿ u¼‘0And–?ýthat's“it.‘ úOf“course,“there're“a“few“tricky“aspects“to“using“the“ïhtml:ï html:objectbase“libraryަ‘0that–?ýweren't“mentioned“here.‘ úSome“of“them“will“be“mentioned“in“the“ïhtml:ï html:Advanced“Usageަ‘0Notesïhtml:ï html:ޤ ® ‘0(AdvancedUsage.html)Ž¡‘0and–?ýthe“ïhtml:ï html:Implementation“Notesïhtml:ï html:Ž¡‘0(Implementation.html)Ž¡‘0;–?ýbut,“the“best“way“to“learn“is“to“examine“the“way“the“demo“applications“do“it“andަ‘0try–?ýto“make“some“changes“yourself.ޤ‘0„¤ŽŽ©G®ïhtml:ï html:Ÿk ÀSubclassing–Qëfr°gom“ïhtml:ï html:SwarmŽŸ âcïhtml:ï html:Ÿ *r‘0¾Subclassing–?ýfrom“the“ïhtml:ï html:Swarm“class“works“very“similar“to“subclassing“from“ïhtml:ï html:SwarmObject.Ž¡‘0„¤ŽŽ¦ïhtml:ï html:Ÿk ÀActiÓÅvityContr°golŽŸ âcïhtml:ï html:Ÿ *r‘0¾The–?ýïhtml:ï html:ActivityControl“object“provides“much“more“finely“grained“control“over“the“executionޤ ‘0of–?ýan“interactive“simulation.‘ úIt“addresses“both“the“problems“of“not“being“able“toŽ¡‘0stop–?ýthe“simulation“at“any“given“point“in“any“given“activity“and“provides“an“initialŽ¡‘0step–?ýtowards“a“Swarm“debugger.ŽŸ8äïhtml:ï html:Ÿ u¼‘0An–?ýactivity“controller“can“be“attached“to“ïhtml:ï html:any“activity“that“is“created“in“a“SwarmŽ¡‘0simulation,–?ýincluding“those“that“are“created“for“use“only“by“the“Swarm“kernel.‘ úTheŽ¡‘0controller–?ýthen“provides“the“basic“activity“manipulation“messages“on“that“activity,Ž¡‘0which›?ýare:‘ úïhtml:ï html:Ãrun,–ffstop,“next,“step,“stepUntil,˜¾and˜ïhtml:ï html:Ãterminate¾.ŽŸbÌïhtml:ï html:Ÿ KÔ‘0The–?ýpresence“of“the“ïhtml:ï html:ActivityControl“object“might“cause“some“confusion“about“what“roleŽ¡‘0the–?ýïhtml:ï html:ControlPanel“should“play“in“the“controlled“execution“of“the“various“schedules.Ž¡‘0The–?ýïhtml:ï html:ControlPanel“should“still“be“used“for“the“top-level“control“of“any“simulationŽ¡‘0that–?ýis“running“in“a“context“where“ïhtml:ï html:random“interference“is“expected“(like“under“a“GUISwarmŽ¡‘0where–?ýthe“user“may“click“a“button“at“any“time).‘ úThe“reason“this“is“true“is“becauseŽ¡‘0the–?ýïhtml:ï html:ControlPanel“sends“pseudo-interrupts“to“the“infinite“loop“we“use“to“perpetuateŽ¡‘0execution–?ýof“the“top“level“Swarm“(which“can“only“be“seen“in“the“form“of“the“ïhtml:ï html:Ãgo“¾messageŽ¡‘0on–?ýa“ïhtml:ï html:GUISwarm“at“present).› úïhtml:ï html:This“type“of“control“may“change“in“the“future!˜But,“forŽ¡‘0now,–?ýit“is“how“we“monitor“the“control“state“of“the“simulation.ŽŸcïhtml:ï html:Ÿ K‘0Now,–?ýhaving“said“that,“the“ïhtml:ï html:ControlPanel“should“no“longer“be“used“to“run“the“simulation.ŽŽŸ*ºâïcolor push Black’Ôï color popŽŽŒ‹"WÊ “ºâ ýxºâïcolor push Blackïhtml:ï html:ŸüfdŽŽŽ’Ôï color popŽŽ ^ ýБ/ºâ¾It–?ýshould“only“be“used“to“instantiate“the“control“context“and“quit“the“entire“simulation.ޤ ‘/ºâThat–?ýmeans“that“sometime“in“the“future,“the“ïhtml:ï html:ÃGo“¾and“the“ïhtml:ï html:ÃStop“¾buttons“will“be“removedŽ¡‘/ºâfrom–?ýthe“ïhtml:ï html:ControlPanel“display.‘ úThey“have“been“left“in“for“backwards“compatibilityŽ¡‘/ºâso–?ýthat“applications“that“do“not“use“the“new“ïhtml:ï html:ActivityControl“will“retain“their“(albeitŽ¡‘/ºâhandicapped)–?ýcontrollability.‘ úAlso,“the“current“ïhtml:ï html:ÃTime‘ffStep“¾button“will“be“renamedŽ¡‘/ºâto–?ýïhtml:ï html:ÃStart“¾to“be“consistent“with“it's“new“purpose.Žºâ©8äïhtml:ï html:Ÿ Ç‘0In–?ýorder“to“use“the“new“control“mechanism,“you“must“place“code“like“the“followingŽ¡‘0in–?ýthe“top-level“Swarm.‘ ú(This“code“was“taken“from“a“modified“mousetrap“demo“app.)ަïhtml:ï html:Ÿ Ç‘0ÃobserverActCont–ff=“[ActivityControl“createBegin:“[self“getZone]];Ž¡‘:ÌÌobserverActCont–ff=“[observerActCont“createEnd];Ž¡‘:ÌÌ[observerActCont–ffattachToActivity:“[self“getSwarmActivity]];Ž¡‘:ÌÌ[probeDisplayManager–ffcreateProbeDisplayFor:“observerActCont];ŽŸbÌïhtml:ï html:Ÿ 4‘0¾This–?ýcreates“an“ïhtml:ï html:ActivityControl“and“attaches“it“to“the“top-level“activity“(in“thisŽ¡‘0case–?ýan“ïhtml:ï html:ÃobserverSwarm¾).› úIt“also“creates“a“display“for“the“controller.˜(The“probeŽ¡‘0map–?ýfor“the“ïhtml:ï html:ActivityControl“class“is“designed“within“the“ïhtml:ï html:ActivityControl,“itself.Ž¡‘0This–?ýis“done“because“all“of“these“objects“are“expected“to“look“the“same“to“any“outsideŽ¡‘0object.)‘ úWith–?ýthis“activity“controller,“you“will“then“be“able“to“ïhtml:ï html:Ãrun,–ffstop,“next,Ž¡‘0step,‘ffstepUntil,–?ý¾and“ïhtml:ï html:Ãterminate“¾that“activity.ަïhtml:ï html:Ÿ Ç‘0There–?ýare“some“tricky“aspects“to“successfully“using“an“ïhtml:ï html:ActivityControl“object“thatŽ¡‘0the–?ýïhtml:ï html:Advanced“Usage“Notesïhtml:ï html:Ž¡‘0(AdvancedUsage.html)Ž¡‘0will‘?ýcover.ŽŸïhtml:ï html:©‘0„¤ŽŽ¤ ïhtml:ï html:Ÿ\’áøRï>PSfile="eps/prev.eps" llx=298 lly=373 urx=314 ury=389 rwi=160 ŽŽ¡ïhtml:ï html:¦(Interface.html)ŽŸÕSïhtml:ï html:Ÿ\’áøRïï html:¦(../objectbase.html)ŽŸ8äïhtml:ï html:Ÿ\’áøRï>PSfile="eps/next.eps" llx=298 lly=373 urx=314 ury=389 rwi=160 ŽŽ¡ïhtml:ï html:¦(AdvancedUsage.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-10ŽŽŸ*ºâïcolor push Black’Ôï color popŽŽŒ‹#gŽ “ºâ ýxºâïcolor push Blackïhtml:ï html:ŸüfdŽŽŽ’Ôï color popŽŽ ^ºâ ýÆïhtml:ï html:ŸIy½Objectbase–/Library:‘m™AdvÊìanced“Usage“NotesŽŸq'‘0„¤ŽŽŸ ïhtml:ï html:Ÿïhtml:ï html:© TÑ0ïcolor push Black¾1.ï color popŽŽ‘<ïhtml:ï html:ProbeMap–?ýdesign:‘ úWhen“designing“a“ïhtml:ï html:ProbeMap“for“a“given“(subclass“of)“ïhtml:ï html:SwarmObject,ޤ ‘<inclusion–?ýof“instance“variables“or“messages“defined“in“the“super“class“might“beŽ¡‘<desirable.‘ úThe–?ýnormal“ïhtml:ï html:ProbeMap“design“code“might“look“like“(this“code“was“takenŽ¡‘<from–?ýthe“tutorial“app“called“"hello-world"):ŽŸ8äïhtml:ï html:Ÿ ß‘$ÃprobeMap–ff=“[CustomProbeMap“createBegin:“[self“getZone]];ަ‘Dfd[probeMap–ffsetProbedClass:“[person“class]];ަ‘DfdprobeMap–ff=“[probeMap“createEnd];ަ‘Dfd[probeMap–ffaddProbe:“[probeLibrary“getProbeForVariable:“"room"ަ‘)ffinClass:–ff[person“class]]];ަ‘Dfd[probeMap–ffaddProbe:“[probeLibrary“getProbeForVariable:“"party"ަ‘)ffinClass:–ff[person“class]]];ަ‘Dfd[probeMap–ffaddProbe:“[probeLibrary“getProbeForVariable:“"name"ަ‘)ffinClass:–ff[person“class]]];ަ‘Dfd[probeMap–ffaddProbe:“[probeLibrary“getProbeForVariable:“"stillhere"ަ‘)ffinClass:–ff[person“class]]];ަ‘Dfd[probeMap–ffaddProbe:“[probeLibrary“getProbeForVariable:“"listOfFriends"ަ‘)ffinClass:–ff[person“class]]];ަ‘Dfd[probeMap–ffaddProbe:“[probeLibrary“getProbeForVariable:“"myColor"ަ‘)ffinClass:–ff[person“class]]];ަ‘Dfd[probeLibrary–ffsetProbeMap:“probeMap“For:“[person“class]];ަ‘Dfd[probeDisplayManager–ffcreateProbeDisplayFor:“person];ŽŸbÌïhtml:ï html:Ÿ ñ÷‘<¾where›?ýïhtml:ï html:Ãroom,–ffparty,“name,“stillhere,“listOfFriends,˜¾and˜ïhtml:ï html:ÃmyColor˜¾are˜instance˜variablesŽ¡‘Hdeclared–?ýin“the“interface“to“the“ïhtml:ï html:Person“subclass.‘ úAnd“ïhtml:ï html:Person“is“a“subclass“ofŽ¡‘Hïhtml:ï html:Agent2d,–?ýwhich“is“a“subclass“of“ïhtml:ï html:SwarmObject.ŽŸ8äïhtml:ï html:Ÿ ß‘<Now–?ýlet's“say“that“there“are“two“variables“declared“in“ïhtml:ï html:Agent2d“that“you“want“toŽ¡‘Hput–?ýinto“this“custom“probe“in“addition“to“the“ones“you've“picked“out“of“ïhtml:ï html:Person.Ž¡‘HCall–?ýthem“ïhtml:ï html:Ãx“¾and“ïhtml:ï html:Ãy¾.‘ úThe“way“to“add“them“to“the“ïhtml:ï html:ÃprobeMap“¾is“to“add“the“followingŽ¡‘Htwo–?ýlines“of“code“to“the“above.ŽŸïhtml:ï html:¦‘$Ã[probeMap–ffaddProbe:“[probeLibrary“getProbeForVariable:“"x"ަ‘)ffinClass:–ff[Agent2d“class]]];ަ‘Dfd[probeMap–ffaddProbe:“[probeLibrary“getProbeForVariable:“"y"ަ‘)ffinClass:–ff[Agent2d“class]]];ŽŸbÌïhtml:ï html:Ÿ ñ÷‘<¾And–?ýthat's“it!‘ úThe“two“superclass-declared“variables,“which“are,“in“fact,“instanceŽ¡‘Hvariables–?ýof“the“instance“of“the“subclass,“are“now“included“in“the“probe.ŽŸ8äïhtml:ï html:© ß‘<In–?ýaddition,“a“convenience“message“has“been“added“to“the“ïhtml:ï html:CustomProbeMap“interfaceŽ¡‘Hto–?ýcompress“the“above“rather“cluttered“mechanism“into“one“message.‘ úThis“convenienceŽ¡‘Hmessage–?ýcan“be“used“in“the“usual“case“where“a“ïhtml:ï html:ProbeMap“will“consist“of“variablesŽ¡‘Hand–?ýmessages“from“the“same“class.‘ úFor“example,“the“first“part“of“the“customŽ¡‘Hprobe–?ýcreation“above“can“be“shortened“to:ŽŸ8äïhtml:ï html:¦‘$Ã[probeLibrary–ffcreate:“[self“getZone]“forClass:“[person“class]ŽŸ TÑDfdwithIdentifiers:–ff"room",“"party",“"name",“"stillhere",ŽŽŸ*ºâïcolor push Black’Ôï color popŽŽŒ‹$tÀ “ºâ ýxºâïcolor push Blackïhtml:ï html:ŸüfdŽŽŽ’Ôï color popŽŽ ^ ýÐ’Ÿî Ã"listOfFriends",–ff"myColor",“NULL];ޤ C^‘/ºâ¾And–?ýif“the“user“wanted“messages“in“the“probe“as“well,“it“could“be“extended“to:ŽºâŸ8äïhtml:ï html:© z‘$ÃprobeMap–ff=“[CustomProbeMap“create:“[self“getZone]Ž¡’°f\forClass:–ff[person“class]Ž¡’Š™’withIdentifiers:–ff"room",“"party",“"name",Ž¡’ 3*"stillhere",–ff"listOfFriends",“"myColor",Ž¡’ 3*":",Ž¡’ 3*"setWorld:Room:Party:",Ž¡’ 3*"setPerson:Topic_array:ShowSpeech:",Ž¡’ 3*NULL];ŽŸýoïhtml:ï html:Ÿ Eï‘<¾At–?ýpresent,“this“message“doesn't“search“the“superclasses“for“the“message“namesޤ ‘Hlisted–?ýhere.‘ úBut,“that“will“soon“be“rectified.ŽŸcïhtml:ï html:Ÿïhtml:ï html:Ÿ ßÑ‘0ïcolor push Black2.ï color popŽŽ‘<ïhtml:ï html:ActivityControl–?ýIssues:‘ úIt“is“completely“reasonable“to“assume“that“explicit“controlŽ¡‘<can–?ýbe“had“over“all“the“activities“in“a“simulation.‘ úHowever,“at“present,“thisŽ¡‘<control–?ýis“limited“because“the“context“in“which“an“activity“runs“determines“howŽ¡‘<it–?ýbehaves.‘ úTo“understand“how“an“ïhtml:ï html:ActivityControl“is“to“be“used,“we“will“have“toŽ¡‘<explore–?ýthe“behavior“of“activities“in“context.‘ ú(For“a“more“complete“explanationŽ¡‘<of–?ýthe“behavior“of“activities,“see“the“ïhtml:ï html:ïhtml:ï html:activity“libraryïhtml:ï html:ޤ C^‘0(../activity.html)Ž¡‘0documentation.)ŽŸÕSïhtml:ï html:Ÿ n ‘<There–?ýare“two“ways“to“get“an“activity“started,“one“can“activate“the“activity“inޤ ‘Hïhtml:ï html:Ãnil–?ý¾or“in“some“other“activity.‘ úSo“called“"top-level"“activities“are“activatedŽ¡‘Hin–?ýïhtml:ï html:Ãnil“¾and“are“intended“to“be“independent“of“the“sophisticated“scheduling“activityŽ¡‘Hthat–?ýdictates“the“execution“of“actions“in“any“other“context“in“the“simulation.Ž¡‘HI.e.‘ úthe–?ýonly“activities“that“should“be“activated“in“ïhtml:ï html:Ãnil“¾are“those“sets“of“eventsŽ¡‘Hthat–?ýare“expected“to“preserve“the“same“behavior“no“matter“what“goes“on“in“anyŽ¡‘Hother–?ýpart“of“the“simulation.ŽŸ8äïhtml:ï html:¦‘<The–?ýother“type“of“activity,“those“activated“in“some“other“activity,“is“intendedŽ¡‘Hto–?ýbe“an“integral“part“of“its“owner“activity.‘ úHowever,“this“doesn't“mean“thatŽ¡‘Hit–?ýïhtml:ï html:must“depend“on“the“outcome“of“actions“happening“in“the“owner“activity.‘ úInŽ¡‘Hfact,–?ýan“ïhtml:ï html:ActionPlan“can“be“designated“as“containing“actions“that“are“capableŽ¡‘Hof–?ýbeing“processed“in“parallel,“via“code“like“the“following:ŽŸ8äïhtml:ï html:¦‘$Ã[anActionPlan–ffsetDefaultOrder:“Concurrent];ŽŸ C^‘0¾But–?ýthese“activities“are“ïhtml:ï html:still“intended“to“be“meshed“with“their“owner“activities.Ž¡‘<In–?ýother“words,“they“are“part“and“parcel“of“the“same“model“or“simulation.ŽŸ8äïhtml:ï html:¦‘<Now,–?ýthe“operational“effect“of“activating“an“activity“in“ïhtml:ï html:Ãnil“¾is“that“it“will“notŽ¡‘Hbe–?ýmeshed“with“the“rest“of“the“Swarm“activity“structure.‘ úThis“gives“the“userŽ¡‘H(or–?ýprocess)“complete“control“over“the“execution“of“that“activity.‘ úA“ïhtml:ï html:Ãrun“¾onŽ¡‘Hthat–?ýactivity“will“run“either“to“completion“or“until“a“stop“flag“is“set“by“aŽ¡‘Hsequence–?ýof“events“purely“internal“to“that“activity.‘ úOr,“one“can“stop“it“fromŽ¡‘Hthe–?ýoutside“with“a“message“from“something“like“an“ïhtml:ï html:ActivityControl.ŽŸ8äïhtml:ï html:¦‘<What–?ýall“this“means“is“that,“while“one“can“attach“an“ïhtml:ï html:ActivityControl“to“ïhtml:ï html:any“activity,Ž¡‘Honly–?ýthe“"top-level"“activities“(those“having“been“activated“in“ïhtml:ï html:Ãnil¾)“are“goingŽ¡‘Hto–?ýrespond“well“to“it.‘ úAny“sub-activity“will“respond“half-heartedly,“if“at“all.Ž¡‘HFor–?ýexample,“in“the“ïhtml:ï html:Mousetrap“demo“distributed“with“Swarm,“an“ïhtml:ï html:ActivityControlŽ¡‘Hhas–?ýbeen“placed“on“both“the“ïhtml:ï html:ObserverSwarm“and“the“ïhtml:ï html:ModelSwarm“activities.‘ úNow,ŽŽŸ*ºâïcolor push Black’Ôï color popŽŽŒ‹%„_ “ºâ ýxºâïcolor push Blackïhtml:ï html:ŸüfdŽŽŽ’Ôï color popŽŽ ^ ýБGºâ¾if–?ýone“sends“a“ïhtml:ï html:Ãrun“¾message“to“the“ïhtml:ï html:ActivityControl“that“is“attached“to“the“ïhtml:ï html:Ãob-ޤ ‘GºâserverSwarm¾'s–?ýactivity,“the“entire“model“continues“to“run“to“completion,“unlessŽ¡‘Gºâthe–?ýuser“sends“a“ïhtml:ï html:Ãstop“¾message.‘ úHowever,“if“the“sim“is“stopped“at“some“point,Ž¡‘Gºâa–?ýïhtml:ï html:Ãrun“¾message“to“the“ïhtml:ï html:ÃmodelSwarm¾'s“activity“will“have“no“effect“at“all.‘ ú(ïhtml:ï html:Note:Ž¡‘GºâIf–?ýyou“do“this“via“the“activity“controllers,“you“see“the“ïhtml:ï html:ÃcurrentTime“¾variableŽ¡‘Gºâget–?ýupdated;“but,“the“actual“ïhtml:ï html:Ãrun“¾message“to“the“activity,“itself,“has“no“effect.)ŽºâŸ8äïhtml:ï html:Ÿ Ç‘<So,–?ýthe“rule“of“thumb,“for“the“present,“is“to“attach“ïhtml:ï html:ActivityControl“objects“onlyŽ¡‘Hto–?ý"top-level"“activities,“like“the“ïhtml:ï html:ObserverSwarm.Ž©‘0„¤ŽŽ¤ ïhtml:ï html:Ÿ\’áøRï>PSfile="eps/prev.eps" llx=298 lly=373 urx=314 ury=389 rwi=160 ŽŽ¡ïhtml:ï html:¦(UsageGuide.html)ŽŸ8äïhtml:ï html:Ÿ\’áøRïï html:¦(../objectbase.html)ŽŸ8äïhtml:ï html:Ÿ\’áøRï>PSfile="eps/next.eps" llx=298 lly=373 urx=314 ury=389 rwi=160 ŽŽ¡ïhtml:ï html:¦(InterfaceDesign.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-10ŽŽŸ*ºâïcolor push Black’Ôï color popŽŽŒ‹&–\ “ºâ ýxºâïcolor push Blackïhtml:ï html:ŸüfdŽŽŽ’Ôï color popŽŽ ^ºâ ýÆïhtml:ï html:ŸIy½Swarmobject–/Library:‘m™Interface“Design“NotesŽŸq'‘0„¤ŽŽŸ ïhtml:ï html:¤ ‘0¾Unfortunately,–?ýthis“interface“has“not“undergone“a“rigorous“design“review.‘ úAs“suchŽ¡‘0it–?ýis“subject“to“change“in“the“future.‘ úHowever,“there“are“rumours“that“this“libraryŽ¡‘0will–?ýbe“integrated“into“the“ïhtml:ï html:ïhtml:ï html:defobj“libraryïhtml:ï html:Ž¡‘0(../defobj.html)Ž¡‘0anyway.‘ úSo,–?ýeven“though“little“thought“was“given“to“the“design“of“this“interfaceŽ¡‘0(and–?ýit“is“not“likely“to“be“worthwhile“designing“a“robust“interface“at“this“time),Ž¡‘0it–?ýwas“implemented“in“order“to“provide“a“first“step“towards“bringing“all“the“variousŽ¡‘0libraries–?ýin“line“with“the“standard“set“by“ïhtml:ï html:defobj.Ž©8äïhtml:ï html:¤ Ç‘0Along–?ýthese“lines,“a“few“notes“are“relevant.ŽŸ 8äïhtml:ï html:Ÿïhtml:ï html:¡‘0ïcolor push Black1.ï color popŽŽ‘<ïhtml:ï html:Probes–?ýmay“become“an“inherent“part“of“any“object.ަïhtml:ï html:¡‘0ïcolor push Black2.ï color popŽŽ‘<ïhtml:ï html:ActivityControls–?ýwill“become“a“part“of“a“larger“set“of“tools“used“for“debuggingޤ ‘<Swarm‘?ýmodels.ŽŸïhtml:ï html:¡‘0ïcolor push Black3.ï color popŽŽ‘<The–?ýexplicit“importation“of“the“ïhtml:ï html:SwarmObject“interface“should“be“removed.‘ úThisŽ¡‘<is–?ýonly“provided“for“backward“compatibility“and“when“all“the“libraries“follow“theŽ¡‘<interface–?ýconventions,“then“those“conventions“should“be“encouraged.Ž©‘0„¤ŽŽ¤ ïhtml:ï html:Ÿ\’áøRï>PSfile="eps/prev.eps" llx=298 lly=373 urx=314 ury=389 rwi=160 ŽŽ¡ïhtml:ï html:¦(AdvancedUsage.html)ŽŸ8äïhtml:ï html:Ÿ\’áøRïï html:¦(../objectbase.html)ŽŸ8äïhtml:ï html:Ÿ\’áøRï>PSfile="eps/next.eps" llx=298 lly=373 urx=314 ury=389 rwi=160 ŽŽ¡ïhtml:ï html:¦(Implementation.html)ަ‘0„¤ŽŽ¦‘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-10ŽŽŸ*ºâïcolor push Black’Ôï color popŽŽŒ‹'žy “ºâ ýxºâïcolor push Blackïhtml:ï html:ŸüfdŽŽŽ’Ôï color popŽŽ ^ºâ ýÆïhtml:ï html:ŸIy½Swarmobject–/Library:‘m™Implemenation“NotesŽŸq'‘0„¤ŽŽŸ ïhtml:ï html:©ïhtml:ï html:¤ ‘0ïcolor push Black¾1.ï color popŽŽ‘<Right–?ýnow,“ïhtml:ï html:Probe's“rely“on“a“special“method,“ïhtml:ï html:ÃgetInstanceName¾,“that“has“to“be“implementedŽ¡‘<in–?ýany“probe-able“object“in“order“to“get“anything“other“than“the“class“name“ofŽ¡‘<that–?ýobject“into“the“object“designation“widget.‘ úHowever,“a“more“general“capabilityŽ¡‘<has–?ýbeen“added“to“ïhtml:ï html:defobj“to“give“a“meaningful“name“to“any“object.‘ úïhtml:ï html:Probes“willŽ¡‘<be–?ýchanged“to“take“advantage“of“this“new“capability.ŽŸ8äïhtml:ï html:¦ïhtml:ï html:Ÿ Ç‘0ïcolor push Black2.ï color popŽŽ‘<In–?ýthe“ïhtml:ï html:ActivityControl“the“frequency“of“the“message“ïhtml:ï html:ÃupdateStateVar“¾is“very“high.Ž¡‘<It–?ýis“sent“at“least“once“every“cycle“and“ïhtml:ï html:every“time“a“message“is“sent“to“the“ïhtml:ï html:ActivityControl.Ž¡‘<This–?ýis“unsatisfactory.‘ úSome“of“these“messages“can“be“pruned“out“of“the“object.ŽŸ8äïhtml:ï html:¦ïhtml:ï html:Ÿ Ç‘0ïcolor push Black3.ï color popŽŽ‘<The–?ýïhtml:ï html:ÃprobeMap“¾designed“for“use“with“an“ïhtml:ï html:ActivityControl“was“chosen“fairly“arbitrarily.Ž¡‘<Right–?ýnow,“it“serves“as“a“default“for“the“class.‘ úA“user“can“override“it“by“designingŽ¡‘<a–?ýnew“one“and“inserting“it“into“the“ïhtml:ï html:ÃprobeLibrary¾.ŽŸ8äïhtml:ï html:¦ïhtml:ï html:Ÿ Ç‘0ïcolor push Black4.ï color popŽŽ‘<Errors–?ýspecific“to“objects“in“the“ïhtml:ï html:objectbase“library“need“to“be“gathered“and“initializedŽ¡‘<like–?ýthose“in“the“ïhtml:ï html:defobj“library.Ž©‘0„¤ŽŽ¤ ïhtml:ï html:Ÿ\’áøRï>PSfile="eps/prev.eps" llx=298 lly=373 urx=314 ury=389 rwi=160 ŽŽ¡ïhtml:ï html:¦(InterfaceDesign.html)ŽŸ8äïhtml:ï html:Ÿ\’áøRïï html:¦(../objectbase.html)ŽŸ8äïhtml:ï html:Ÿ\’áøRï>PSfile="eps/next.eps" llx=298 lly=373 urx=314 ury=389 rwi=160 ŽŽ¡ïhtml:ï html:¦(../objectbase.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-10ŽŽŸ*ºâïcolor push Black’Ôï color popŽŽŒø©Aƒ’À;è—T~Óºâ 'ó©±Ê cmsy9ó\ùðff pzdróÓߌ˜ff ptmb7tóßê