input
stringlengths
10
828
output
stringlengths
5
107
public void state change process status event event map delta for iterator i delta entry set iterator i has next map entry e map entry i next llist pattern llist e get key object value e get value record new value pattern value map tool change pattern value pattern value
updates the viewers according to the current state of the agent
public object get named refinement string name return ref set editor get named object name if name return null named found ref set editor get named object name if name equals found get name return found else return null
finds a refinement whose name matches the given string
public object get named object class string name return class set editor get named object name
finds an object class whose name matches the given string
protected object request object message wrapper m try return http send request message url m catch rethrown ioexception e includes malformed urlexception debug note exception e throw interpret request exception e
sends a request to the message server and returns the servers reply
public void refresh hashtable backup new hashtable world hashtable tmp reset enumeration enumer backup keys enumeration e object object id pat while enumer has more elements object id enumer next element tmp hashtable backup get object id e tmp keys while e has more elements pat e next element add pattern value return pattern pat object id tmp get pat change pattern value return pattern pat object id tmp get pat
resets the map and replace the objects
private enumeration sort hashtable hashtable h vector v llist new vector h key set vector v string new vector for enumeration e v llist elements e has more elements v string add lisp elements to string llist e next element collections sort v string v llist clear for enumeration e v string elements e has more elements v llist add lisp elements from string string e next element return v llist elements
sorts alphabetically the properties related to a object
public void set request content type string type this request content type type
set the content type used when sending requests
public void set request charset name string name this request charset name name
set the character set used when sending requests
private omgraphic find closest object image omgraphic list omgraphics mouse event e iterator it1 omgraphics iterator omgraphic aux1 while it1 has next aux1 omgraphic it1 next if aux1 get class get name equals ix ip2 map object image aux1 set visible false final omgraphic omgr omgraphics find closest e get x e get y 10 25 iterator it2 omgraphics iterator while it2 has next omgraphic it2 next set visible true return omgr
method auxiliar to find objects on the map
protected object decode received string contents return util decode received contents
turns response contents into an object
public void set response content type string type this response content type type
set the content type used when sending a response
public void set response charset name string name this response charset name name
set the character set used when sending a response
public set get matching refinements string pattern return ivutil find name matches pattern get all refinements
finds refinements whose names match the given string
protected void describe request http servlet request req debug noteln http request uri req get request uri debug noteln n request headers for enumeration e req get header names e has more elements string name string e next element debug noteln name req get header name
utility method that produces debugging output that describes
static public string add tilde object property llist prop llist property object aux prop get 0 prop prop delete aux prop lisp cons symbol intern prop prop lisp cons aux prop return lisp elements to string prop
method auxiliar to put a tilde in the place of the
private void initial setup debug noteln initial setup for i x http server server server new server port listener socket listener new org mortbay jetty bio socket connector new org mortbay jetty nio select channel connector set the port 0 means to ask the os for a free port socket listener set port listen port server set connectors new connector socket listener contexts contexts new context handler collection context for servlets context context new context contexts servlets context get servlet handler
setup thats done for the constructor when the server is created
private void final setup handler for static content if doc root null this works and it s not clear what else would context c new context contexts doc path c set resource base doc root c add servlet new servlet holder new default servlet request log handler if log dir null make the log handler request log handler log handler make request log handler set handlers with the log handler last handler collection handlers new handler collection handlers set handlers new handler contexts log handler server set handler handlers else server set handler contexts
setup thats done for the start method just before the
private request log handler make request log handler request log handler log handler new request log handler string slash system get property file separator string path log dir slash log prefix yyyy mm dd log ncsarequest log request log new ncsarequest log path request log set retain days 90 request log set append true request log set extended false request log set log time zone gmt log handler set request log request log return log handler
makes a request log handler that will write an ncsa format log
public string get host name try return util get host name catch unknown host exception e throw new rethrown exception e
returns the name of the host machine that is running the application
public boolean is matching refinement llist pattern object o if o instanceof uirefinement return uirefinement o matches pattern pattern else if o instanceof refinement refinement r refinement o debug noteln uid check pattern to string in r get pattern if pattern null r get pattern null pattern equal r get pattern pattern equals r get pattern return true else return null simple matcher match pattern r get pattern else return false
checks whether the given object is a refinement that matches the pattern
public void added object uiobject uio ixobject original if uio null return else if uio instanceof uirefinement ref set editor added object uio original else if uio instanceof uiobject class class set editor added object uio original
from uirefinement and uiobject class when they are created
private void collect properties domain domain collect properties domain get object classes
collect all the properties of the given domain
public void note change if is empty has original ui domain remove construct this empty with no original get rid of it else if has changed saving so update the base object save to domain debug noteln uir noting change ui domain update construct this
get the uidomain to note the change of this object
private void collect properties list object classes properties clear if object classes null return for iterator i object classes iterator i has next object o i next list props null if o instanceof object class props object class o get object properties else if o instanceof uiobject class props uiobject class o get object properties if props null return for iterator j props iterator j has next object property prop object property j next properties put prop get name prop debug noteln uid collected props uiutil show properties key set
collect all the properties of the list of object classes
public boolean is undefined if name null name equals name equals undefined name equals undefined nodes null nodes is empty orderings null orderings is empty issues null issues is empty variable declarations null variable declarations is empty graph null comments null comments equals get annotations null get annotations is empty debug noteln uirefinement is empty return true debug noteln refinement is not empty return false
a refinement is undefined if all its data fields are empty except
public boolean is empty if name null name equals name equals undefined name equals undefined pattern null pattern is empty nodes null nodes is empty orderings null orderings is empty issues null issues is empty variable declarations null variable declarations is empty graph null comments null comments equals get annotations null get annotations is empty debug noteln uirefinement is empty return true debug noteln refinement is not empty return false
a refinement is empty if all its data fields are empty
public collection find variable users item var var if var null return null full save to domain draft domain list refs draft domain get refinements collection users new array list for iterator i refs iterator i has next try object o i next sorted set vars refinement o get variables used if vars null vars contains var users add o catch exception e debug note exception e return users
finds all refinements that use the variable with the given name
public boolean is empty refinement refinement if refinement null return true if refinement get name null refinement get name equals refinement get pattern null refinement get pattern is empty refinement get nodes null refinement get nodes is empty refinement get orderings null refinement get orderings is empty refinement get variable declarations null refinement get variable declarations is empty refinement get issues null refinement get issues is empty refinement get comments null refinement get comments equals refinement get annotations null refinement get annotations equals debug noteln refinement is empty return true debug noteln refinement is not empty return false
a refinement is empty if all its data fields are empty
public collection find variable users string name string var name ivutil ensure var name name if var name symbol var symbol intern var name return find variable users item var var else return null
finds all refinements that use the variable with the given name
public boolean has changed return has changed refinement get base object return has changed no debug refinement get base object
finds out whether the refinement has changed from the base object
public string get stats throws ioexception int status 1 boolean cont true while cont try command run cont false catch illegal thread state exception e should only need this when reusing the run command obj cont true try thread sleep 50 catch exception ex if command exit value 0 throw new ioexception historic values add command stdout return command stdout
gets the network statistics from tt netstat s tt
public string indicates fault linked list net line lines print most recently added last line system out println lines get last return null
overload this function to do fault detection
public string to string string ret for int i 0 i field values size i ret field values get i ret n for int i 0 i historic values size i ret historic values get i return ret
returns a csv string representation of header and all values collected
public string get reason if reason stack size 1 return null return reason stack get 0
returns string representation of main first error null if no error
private void handle neighbor list array list inet address neighbors
polling thread calls this function
public set find variables used full save to domain draft domain list refs draft domain get refinements set all vars new hash set for iterator i refs iterator i has next try object o i next all vars add all refinement o get variables used catch exception e debug note exception e return all vars
finds all variables that are used within the domains refinements
public action error handle line string line socket socket if line null string tokenizer st new string tokenizer line delim if st has more tokens string action name st next token array list string parameters new array list string while st has more tokens parameters add st next token return handle action action name parameters return action error no error
returns error if one occurred else null
public void start while should run try thread sleep 1000 send data catch exception e e print stack trace
starts sending data every second to all nodes with service type
public void trigger query try comm server broadcast monitor trigger catch ioexception e e print stack trace
takes a residual reading from all analytic net monitor agents
public void trigger residual int expected bytes transferred try comm server broadcast monitor trigger thread sleep 1000 fault info fault analytic impl residual calc expected bytes transferred if fault null this propagate fault fault catch ioexception e e print stack trace catch interrupted exception ie ie print stack trace
takes a residual reading from all analytic net monitor agents and triggers
public list collect changes refinement original return collect changes original old
collects the differences between this object and the given one
public void handle multicast message string msg if msg trim equals analytic net monitor server monitor trigger send net monitor agent data try this send data catch exception e e print stack trace else system out println mutlicast msg not for me msg
called when we get a multicast msg
public void full save to domain if public domain null public domain domain make base object if draft domain null draft domain clone domain domain public domain draft domain full save to domain draft domain
save the object and all its components into its base object
public void handle input ipc input message message transcript append line sender color message get contents reporting message description message
handles external input in the form of an ipc
public void setup frame
gives the main i test frame its contents
protected jmenu bar make menu bar jmenu bar bar new jmenu bar jmenu file menu new jmenu file bar add file menu file menu add make menu item exit bar add tool manager get tools menu add itest tools jmenu help menu new jmenu help bar add help menu help menu add make menu item help help menu add make menu item about i test bar add box create horizontal glue let later items move right bar add test menu test menu set enabled false initially return bar
creates the menu bar
public void symbol name changed agent name event e super symbol name changed e sets frame title change the panel that identifies the system etc container content pane get content pane content pane remove logo panel logo panel itest make logo panel content pane add logo panel validate
handles a change in the panels symbol name
protected void take analytic baseline if monitor server instanceof analytic net monitor server analytic net monitor server analytic analytic net monitor server monitor server analytic trigger query
takes an analytic reading if were using an analytic net monitor server
public void startup super startup frame new itest frame this frame setup add tests frame pack frame set visible true
completes i test setup and initialization
public jpanel make logo panel return new logo panel symbol name i test i x test agent util resource image icon ip2 itest logo gif
creates a standard logo panel for i test
protected void add tests frame add test resources parameters get list test menu
adds any tests common to all versions of i test
public list collect changes return collect changes refinement get base object draft
collects the differences between this object and the base one
protected void analyze residual fd int expected bytes transferred if monitor server instanceof analytic net monitor server analytic net monitor server analytic analytic net monitor server monitor server analytic trigger residual expected bytes transferred
takes an analytic reading if were using an analytic net monitor server
private double speed string node if node contains 1 return 30 else if node contains 2 return 40 else if node contains 3 return 20 else if node contains 4 return 10 else if node contains 5 return 75 else if node contains 6 return 15 else return 0
returns the max speed that node can travel
public void revert to original ref set editor clear class set editor clear graphs clear clone domain public domain draft domain load from domain public domain fire domain edited
reverts the domain and all its construct to the last published domain
public list collect changes from original refinement original get domain get named refinement base reference return collect changes original published
collects the differences between this object and the base one
protected name gen id string base return name gen next name base
generates a short id for use within the plan
protected list get subitems object item return list item to subitems get item
returns the subissues of an issue or the subactivities
protected void fill in plan if plan issues is empty plan set plan issues plan issues if issue refinements is empty plan set plan issue refinements issue refinements if plan nodes is empty plan set plan nodes plan nodes if plan refinements is empty plan set plan refinements plan refinements if constraints is empty plan set constraints constraints if annotations is empty plan set annotations annotations
installs any non empty values in the relevant fields
protected void send to string destination sendable contents sendable object from controls send destination contents content text show sent
construct an object from the current state of the gui
public boolean has changed from original has no original so it is new changed if this has original return true has original so compare the two refinement original get domain get named refinement base reference return has changed no debug original
finds out whether the refinement has changed from the original
protected void sending string destination sendable contents do nothing
a hook to allow subclasses to see messages just before theyre sent
public void send copy string destination sendable contents n b must make a copy because it will change its status etc if sent to self me sendable copy sendable util clone contents send destination copy
used to send things as if by the messenger
public llist put variables in pattern llist pattern when a subnode is introduced by expansion with a refinement all vars in its pattern are replaced by values or by variables when the refinement is instantiated but when a level 0 node is introduced there is no refinement and this method is used to perform the replacement of vars by variables using a global one per model manager mapping return llist simple matcher empty env instantiate tree pattern new make var if unbound
returns a copy of the pattern in which
public list get shadowed ends it would be better to return a set since we usually want the result only so we can see whether various node ends are in it it would also be possible to mark the shadowed node ends perhaps by having a mark field in pnode end and not construct any object that contained all the shadowed ends topological sorter tsort new topological sorter protected collection get children object ne return pnode end ne get successors return tsort sort lisp list this
returns a list containing all the node ends that are forced
protected object object from controls string text content text get text trim if text equals throw new illegal argument exception contents are empty return send controls get selected object from controls
construct an object from the current state of the gui
public void main startup string argv try do main startup argv catch throwable t debug display exception t if this this agent parameters is interactive throw new rethrown exception t
method called by main string argv to perform the initialization
protected priority priority from controls string selected priority selector get selection this is a bit messy debug expect selected ends with priority string p strings before first selected return priority value of p to lower case
obtain a priority from the current state of the gui
protected void startup
method called by the
public void compute status we assume that the current status may not be correct but only certain transitions are handled if compute status return begin end compute status end end compute status if get status status executing if children is empty if all have status children status complete set status status complete
compute status is used to change the status of related nodes
public void install agent extensions install agent extensions parameters get list extension classes
installs any extensions specified by the extension classes
protected task item fill task item from controls task item item string text content text get text trim string ref ref choice get selected string boolean report back report check is selected item set pattern pattern parser parse text item set sender id name value of string agent get agent symbol name item set priority priority from controls if ref equals item set ref name value of ref if report back item set report back yes no yes return item
fills in the contents of an issue or activity
protected issue issue from controls return issue fill task item from controls new issue
construct an issue from the current state of the gui
public object get agent ipcname return ipc name
returns the object used to represent the agent as an ipc destination
public void fire domain edited debug noteln uid edited domain for listeners listeners uidomain event event new uidomain event this for iterator i listeners iterator i has next uidomain listener listener uidomain listener i next listener domain edited event
the domains own fields changed currently only name
public void startup make controller and model manager model manager make model manager controller make controller controller connect to model manager create the frame without filling in anything interesting this allows the viewers to add tools for example frame new postix frame this viewers activity viewer make activity viewer connect the viewers controller add activity listener agenda listener activity viewer add handlers read domain get domain complete the frame postix frame frame set up util swing and wait new runnable public void run we do some adjustment after making the frame visible so we switch threads here complete startup
completes basic setup and initialization
public string get agent symbol name explain symbol name why not abstract will symbol name and ipc name merge return symbol name
returns this agents symbol name
protected activity activity from controls activity act activity fill task item from controls new activity if from issue null name sender id from issue get sender id may be null debug noteln transform sender id sender id act set sender id sender id name ref from issue get ref debug noteln transform ref ref act set ref ref return act
construct an activity from the current state of the gui
public void set agent symbol name string name string old name symbol name ipc name name symbol name name display name parameters have parameter display name parameters get parameter display name symbol name initial display name fire symbol name changed old name symbol name
changes the agents symbol name
private void jb init throws exception this set title ixagent get agent get agent display name i sim time this set size new dimension 225 70 sim time label set font new java awt font dialog font plain 24 sim time label set foreground noruncolor sim time label set text not started time panel add sim time label this get content pane set layout clock layout this get content pane add time panel border layout center
initializes the gui components of this frame
public void set time long time sim time label set text df format new date time
this function updates the current simulated time in the display
public void set running sim time label set foreground runcolor
this function should be called when the simulated clock is running
protected constraint constraint from controls string text content text get text trim string parts strings break at first text string pat parts 0 trim string val parts 1 trim if val equals val true string source world state effect pat val llist spec llist lisp read from string source constraint c constraint parser parse constraint spec if c null throw new syntax exception invalid constraint strings quote text c set sender id name value of string agent get agent ipcname return c
construct a constraint from the current state of the gui
public void set paused sim time label set foreground noruncolor
this function should be called when the simulated clock is paused
protected report report from controls string text content text get text trim string ref ref text get text report type type report type report type choice get selected item report report new report text report set sender id name value of string agent get agent ipcname report set priority priority from controls if ref equals report set ref name value of ref if type equals report set report type type return report
construct a report from the current state of the gui
public void complete startup super complete startup simulator new isim engine this
this function creates the simulator that belongs to this isim agent
public isim engine get isim engine return simulator
returns the simulation engine used by this isim agent
public string get agent display name return display name
returns this agents display name
protected void setup isim timer i sim timer isim timer get isim timer this
this function creates an isim timer for this isim agent
protected chat message chat message from controls string text content text get text string sender string agent get agent ipcname return new chat message text sender
construct a chat message from the current state of the gui
public contact manager get contact manager return contact manager
returns this agents contact manager
public event logger get event logger return event logger
returns this agents event logger
public isim timer get isim timer return i sim timer
returns this agents isim timer
synchronized public void add element at front object object long priority add tree list priority add first object size
p this function adds the given object at the given priority to this
public node spec find node llist pattern for iterator i nodes iterator i has next node spec node node spec i next if pattern equals node get pattern return node return null
tries to find a node within this refinement whose pattern matches
public boolean contains key long key return get entry key null
p this function returns code true code if this map contains a mapping
synchronized public void add element at end object object long priority add tree list priority add last object size
p this function adds the given object at the given priority to this
public object ensure tool string tool name debug noteln attempt to ensure tool tool name throw new unsupported operation exception this agent does not support gui tools
returns the tool of the specified name causing it to be created
public void check consistency debug noteln checking consistency of this check that all variables have been declared check variable refs check that constraints don t refer to undefined nodes check node refs
checks the consistency of this refinement
public object get long key entry p get entry key return p null null p value
p this function returns the value to which this map maps the specified