input
stringlengths
10
828
output
stringlengths
5
107
public long first key throws java util no such element exception if root null throw new java util no such element exception return first entry key
p this function returns the first lowest key currently in this sorted
public boolean contains element at object object long priority throw new java lang unsupported operation exception
p this function throws an code unsupported operation exception code as
public sorted set get variables used we don t have a way to just look at all the item vars but instantiation does it along the way even though we discard the instantiated objects we can t just use object walker collect if because it would include the var declarations in the walk final sorted set vars new tree set instantiate matcher empty env new function1 public object funcall object arg item var var item var arg vars add var return arg have to return something return vars
returns a set containing the
public long last key throws java util no such element exception if root null throw new java util no such element exception return last entry key
p this function returns the last highest key currently in this sorted
public object get lowest front throws no such element exception if size 0 throw new no such element exception priority queue is empty return linked list p tree get p tree first key get first
p this function returns the element in this priority queue that has the
public node spec find node list node list llist pattern for iterator i node list 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 in the given list whose pattern matches the
public object get lowest end throws no such element exception if size 0 throw new no such element exception priority queue is empty return linked list p tree get p tree first key get last
p this function returns the element in this priority queue that has the
public object put long key object value entry t root if t null increment size root new entry key value null return null while true if key t key return t set value value else if key t key if t left null t t left else increment size t left new entry key value t fix after insertion t left return null else key t key if t right null t t right else increment size t right new entry key value t fix after insertion t right return null
p this function associates the specified value with the specified key in
public sorted set get declared variables return sorted set collect map new tree set collect ensure list variable declarations fn accessor variable declaration class get name
returns a set containing the
public object get highest front throws no such element exception if size 0 throw new no such element exception priority queue is empty return linked list p tree get p tree last key get first
p this function returns the element in this priority queue that has the
public void note possible new contact ipc input message message object contents message get contents if contents instanceof sendable name sender id sendable contents get sender id if sender id null contact manager should work with names not strings contact manager note agent sender id to string
tells this agents contact manager about the sender id of the
protected boolean is declared item var v if variable declarations null return false for iterator i variable declarations iterator i has next variable declaration dcl variable declaration i next if dcl get name v return true return false
returns true iff this specified variable is declared in
public object get highest end throws no such element exception if size 0 throw new no such element exception priority queue is empty return linked list p tree get p tree last key get last
p this function returns the element in this priority queue that has the
protected void check node refs set defined new hash set set undefined new tree set for iterator i collect iterator get nodes i has next defined add node spec i next get id collect undefined node refs get orderings defined undefined collect undefined node refs get constraints defined undefined if undefined is empty throw new syntax exception there are references to undefined nodes in refinement name strings conjunction undefined
checks that every node mentioned in a constraint is defined
public void handle input ipc input message message object contents message get contents if contents instanceof issue handle new issue issue contents else if contents instanceof activity handle new activity activity contents else if contents instanceof constraint handle new constraint constraint contents else if contents instanceof report handle new report report contents else if contents instanceof chat message handle new chat message chat message contents else display message unexpected message contents contents
handles external input in the form of an ipc
public void set domain domain domain if get domain equals domain return else clear this domain then set the new domain then fire set current domain domain fire domain set domain
clears this domain then sets it to the new one
synchronized public object remove lowest front throws no such element exception if size 0 throw new no such element exception priority queue is empty size return remove lowest tree list remove first
p this function removes and returns the element in this priority queue
public void handle new issue issue issue display message reporting issue description issue
handles new issues from external sources
synchronized public object remove lowest end throws no such element exception if size 0 throw new no such element exception priority queue is empty size return remove lowest tree list remove last
p this function removes and returns the element in this priority queue
private void increment size mod count size
p this function increments the size counter for this map and notes the
public void handle new activity activity activity display message reporting activity description activity
handles new activities from external sources
synchronized public object remove highest front throws no such element exception if size 0 throw new no such element exception priority queue is empty size return remove highest tree list remove first
p this function removes and returns the element in this priority queue
public refinement instantiate match env env final set unbound new tree set refinement r instantiate env new function1 public object funcall object name item var v item var name unbound add v return v if unbound is empty return r else throw new missing values exception unbound
returns a copy of this refinement in which each
public boolean simulation started return last sim time change in reality 0 l
returns whether the start function has been called
public long get sim time in millis if simulation active long real elapsed time system current time millis last sim time change in reality long sim elapsed time long real elapsed time acceleration factor return last sim time change in sim time sim elapsed time else return last sim time change in sim time
this function returns the current time in the simulation
public double get acceleration factor return acceleration factor
returns the currently used time acceleration factor
private void decrement size mod count size
p this function decrements the size counter for this map and notes the
public void start long sim time double factor throws isim timer exception if simulation started throw new isim timer exception isim timer already started cannot start again initialize the timer this simulation active true this acceleration factor factor this last sim time change in reality system current time millis this last sim time change in sim time sim time start the thread that updates the display t updater start show the frame displaying the time sim time display set running if this owner instanceof ix isim isim sim time display set visible true
this function starts the simulation clock
public long pause must get this first for correct computation of sim time this last sim time change in sim time get sim time in millis this last sim time change in reality system current time millis this simulation active false sim time display set paused t updater update now return last sim time change in sim time
this function pauses this simulation timer be it a server or client
public void handle new constraint constraint constraint display message reporting constraint description constraint
handles new constraints from external sources
synchronized public object remove highest end throws no such element exception if size 0 throw new no such element exception priority queue is empty size return remove highest tree list remove last
p this function removes and returns the element in this priority queue
public long resume this simulation active true this last sim time change in reality system current time millis sim time display set running t updater update now return last sim time change in sim time
this function re starts the simulation timer after it had been paused
public long change acceleration factor double acceleration this acceleration factor acceleration this last sim time change in reality system current time millis this last sim time change in sim time get sim time in millis t updater update now return last sim time change in sim time
this function changes the time acceleration factor to the given value
private entry get entry long key entry p root while p null if key p key return p p key p key p left p right return null
p this function returns this maps entry for the given key or
public void terminate timer t updater terminate
this function should be called terminate this timer
public boolean remove element at object obj long p throw new java lang unsupported operation exception
p this function throws an code unsupported operation exception code as
public void handle new report report report display message reporting report description report
handles new reports from external sources
static public isim timer get isim timer ixagent agent debug noteln creating isim timer if agent instanceof ix isim isim return new isim timer server agent else return new isim timer client agent
factory for getting the right kind of timer for this agent
public iterator elements return new tree of lists long priority queue iterator
p this function returns an iterator for this priority queue
protected void handle received report task item item if parameters get boolean send received reports true return if item get report back yes no yes name our name name value of get agent ipcname report rep new report rep set report type report type progress rep set text received by our name reporting date string rep set ref item get ref rep set sender id our name ipc send object item get sender id whoever sent this item to us to string cause it s a name rep
utility for sending a received report about an issue
public string to string string result iterator pqe elements if pqe has next result pqe next to string while pqe has next result pqe next to string return result
p this function creates the printable string representation of this
public long get sim start time return sim start time
this function returns the the simulated time at which the simulation was
public boolean equals object obj throws unsupported operation exception throw new unsupported operation exception
p this class does not support equality testing and an exception will be
public void load timed events file event files thread loader new timed events loader event files loader start thread current thread yield
this function loads the timed events from the given files
public void handle new chat message chat message message display message reporting chat message description message
handles new chat messages from external sources
protected void display message string message if text frame null text frame new text area frame messages to get agent ipcname text frame append line message text frame set visible true
adds the specified string to the default message display
public void clear quiet clear this if ref set editor null ref set editor clear if class set editor null class set editor clear graphs clear draft domain clear domain file null save to domain draft domain
this gets rid of everything including lists that keep track of changes
public boolean has next if list elts null return false return list elts has next
p this function tests whether there are more elements to be
public object next throws no such element exception if list elts null throw new no such element exception object result list elts next if list elts has next return result if tree elts has next list elts linked list tree elts next iterator return result
p this function retrieves the next element in this iterator
static private entry successor entry t if t null return null else if t right null entry p t right while p left null p p left return p else entry p t parent entry ch t while p null ch p right ch p p p parent return p
p this function returns the successor of the specified entry or
public void clear draft clear quiet ref set editor remember clear class set editor remember clear fire domain cleared
clear all constructs in the draft domain
public void insert jmenu item mi string text mi get text int count get item count for int i 0 i count i jmenu item item get item i if text compare to item get text 0 insert before the first item with text lexicographically greater than the new item s insert mi i return if no greater item was found add at the end add mi
insert before the first item with lexicographically greater text
public void append string text simple attribute set at new simple attribute set style constants set foreground at color black styled document doc get styled document try doc insert string doc get length text at catch bad location exception e debug display exception e
adds the text at the end of the pane
public void append color c string text simple attribute set at new simple attribute set style constants set foreground at c styled document doc get styled document try doc insert string doc get length text at catch bad location exception e debug display exception e
adds the text at the end of the pane using the specified
public void append line string text if fold long lines double width get effective width double char width width get column width char width 3 estimated scrollbar width int max len int char width excess length allowed int max len 40 debug noteln max len max len if text length max len this line might secretly contain newlines but that s handled by strings fold long lines append strings fold long line text max len newline return append text newline
appends the text followed by a newline
public void append indented lines int indent string text collection lines strings break into lines text for iterator i lines iterator i has next string line string i next append line strings repeat indent line
breaks the text into lines then appends the lines each
public void append indented lines int indent color color string text collection lines strings break into lines text for iterator i lines iterator i has next string line string i next append line color strings repeat indent line
breaks the text into lines then appends the lines using
public void set selection string text for enumeration e group get elements e has more elements jradio button button jradio button e next element if button get text equals text n b set selected true does not cause an action event so we use do click instead button do click return throw new runtime exception no button with text strings quote text
selects the corresponding button
protected void add impl component comp object constraints int index if comp instanceof jradio button jradio button button jradio button comp group add button button add action listener listener if button is selected selection button get action command super add impl comp constraints index
called whenever a component is added to this radio button box
protected void edited element element elt
called after an element is edited if
public object ensure tool if tool null set tool return tool
returns the tool after calling
public void set key sort comparator comparator c key sort comparator c collections sort key list key sort comparator model fire table data changed
sets the comparator used to sort keys
public object ensure tool visible ensure tool set tool visible true return tool
returns the tool after calling
public void set tool visible boolean t object args new object boolean value of t method m fn get method tool set visible args if m null fn apply tool m args else throw new unsupported operation exception can t make tool strings quote tool name visible
causes the tool to be visible or not
public void reset viewed map clear key list clear key timestamps clear tell the jtable that all row data has changed model fire table changed new table model event model table invalidate
empties the table
protected void load selection table load table
tells the panel to add rows corresponding to entries in
public action listener get inner listener return inner listener
returns the inner action listener that is wrapped in this
public void set inner listener action listener inner listener this inner listener inner listener
sets the inner action listener that is wrapped in this
protected void reload selection table reload table
removes everything from the table and then calls
public string get ordering type if nodes null nodes size 2 return o none else if orderings null orderings is empty return o parallel else if orderings are sequential return o sequence else return o other
gets the refinements ordering type none parallel sequence other
protected void add table entry string name object value new row name value insert in table selection table
inserts a row containing the specified name and value
public void handle exception action event event throwable except string command event get action command joption pane show message dialog debug probable main frame new object problem during command strings quote command debug fold exception except error during command joption pane error message
called if the inner action performed method throws an exception
public void append string text super append text setting caret position to end should scoll to the end set caret position get text length
appends the text then moves the caret position to the end
public file save domain return save domain domain file
save the uidomain to a local file does not publish
public void append indented lines int indent string text list lines strings break into lines text for iterator i lines iterator i has next string line string i next append line strings repeat indent line
breaks the text into lines then appends the lines each
protected jmenu item make menu item final tool controller tc jmenu item item new jmenu item tc get tool name item add action listener new catching action listener protected void inner action performed action event event debug expect event get action command equals tc get tool name activate tool tc return item
makes a jmenu item that has an action listener that calls
protected void activate tool tool controller tc tc ensure tool visible
creates the tool if it does not already exist and then
public void set style sheet font family string family style s ix style sheet get style body style constants set font family s family
sets the font family for the body element
public file save domain as return save domain null
save the uidomain to a local file does not publish
public domain read domain throws ioexception while parse refinement domain dom new domain dom set name name from url url if refinements is empty dom set refinements refinements return dom
constructs a domain by parsing the contents of the url
public void set ordering type string type debug noteln uir setting orderings to type string current get ordering type if o other equals current cannot change other like this if current equals type debug warn i de cannot change complex orderings in the minimal view return else if o none equals type o parallel equals type clear orderings else if o sequence equals type set orderings make sequence else debug noteln uir cannot recognise simple ordering type
sets the refinements ordering type none parallel sequence other
public boolean orderings are sequential hash set sequence new hash set make sequence return new hash set orderings equals sequence
checks whether the orderings are a sequence of the nodes
protected void add example tool add tool new example tool controller example tool
adds a simple tool
protected void add test menu items super add test menu items
called to add items to the main frame menu bars test menu
protected void add handlers super add handlers get controller add activity handler new change symbol name handler this
called to add issue and activity handlers
public void set trace output print stream ps this trace out ps
sets the stream on which trace output appears
protected void add launch tool add tool new tool controller start agent public object create tool return new launch tool
adds a simple tool
protected string saved plan name the task may be a multi element pattern and hence contain spaces so we replace each space with return name part domain file strings replace task description plan plan number output file type
constructs a file name for a plan based on the domain name
protected string name part file file return strings before last file get name
returns the name from a file leaving out the directory and
protected string task description if task null return task else string domain part name part domain file string init plan name part plan file if init plan starts with domain part return starting from strings after first domain part init plan else return init plan
returns a short textual description of the task or problem
protected map run simulation plan checking simulator sim map result super run simulation sim simulate sim get execution order return result
runs the usual simulation using the plan checking simulator
public void startup make the controller and model manager model manager make model manager controller make controller controller connect to model manager make the option manager the model manager and the controller s agendas must exist before it can be connected option manager new iplan option manager this option manager connect yourself add issue and activity handlers add handlers add handlers parameters get list additional handlers install any agent extensions install agent extensions read any domain that should be present from the start read domain get domain init options load a plan if desired load initial plan
completes setup and initialization
public plan evaluator get evaluator return evaluator
returns the plan evaluator used to produce this partial plan evaluation
public double get evaluation return evaluation value
returns the evaluation value of a partial plan
public void startup make controller and model manager model manager make model manager controller make controller controller connect to model manager add handlers omit gui if we re being used inside another agent if is stand alone return read domain get domain load a plan if desired we have to do this at the end because viewers may not be able to deal with any pre existing information string file name parameters get parameter plan if file name null load plan file name
completes setup and initialization
protected void add handlers handler that lets the user do nothing or make items complete controller add item handler new iplan completion handler this expansion controller add activity handler new iplan expand handler this condition satisfaction controller add activity handler new iplan condition handler this
install any built in issue and activity handlers
public string test description return domain get domain task task description
returns a short textual description of this test
public string task description if get task null return get task else string init plan strings before last get initial plan string domain name get domain if init plan starts with domain name return strings after first domain name init plan else return init plan
returns a short textual description of the task or problem
public string to string string class name strings after last this get class get name return class name test description
returns class name
public ip2 model manager get model manager being checked return model manager
returns the model manager that contains the model that