input
stringlengths
10
828
output
stringlengths
5
107
public void set shuffle boolean shuffle this shuffle shuffle if shuffle random new random random seed else random null
controls whether the node ends are permuted when putting them
public void randomize random seed system current time millis set shuffle true randomized true
changes this simulators random number generator to one
public void set trace output print stream ps this trace out ps this trace true
sets the stream on which trace output appears
public void populate activities iplan model manager iplan mm copy world state world state put all iplan mm get world state map copy activities for iterator i iplan mm get nodes iterator i has next agenda item node agenda item i next activity act activity node get about add activity act
call this function to populate the list of activities and copy the
protected void set range direction int range dir this range direction range dir
sets the direction of this plan evaluation criterion range e
public int get range direction return this range direction
returns the direction of this plan evaluation criterion range e
public double get theoretic min return this range theoretic min
returns the theoretic lower bound of this plan evaluation criterion
public double get effective min return this range effective min
returns the effective lower bound of this plan evaluation criterion
public double get theoretic max return this range theoretic max
returns the theoretic upper bound of this plan evaluation criterion
public double get effective max return this range effective max
returns the effective upper bound of this plan evaluation criterion
protected void set range min max double min double max this range theoretic min min this range effective min max this range theoretic max max this range effective max min
sets the lower bound of this plan evaluation criterion range
protected void add handlers controller add activity handler new thatcher activity handler this
install any built in issue and activity handlers
public void load domain clear added edited removed remove and remember all in draft domain clear draft draft domain new domain needed so that the parser knows it is empty insert domain load from domain draft domain string name draft domain get name string name draft domain get name debug noteln uid loaded name to tidy name if name null name starts with name name substring 1 draft domain set name name set name name
clears the draft domain noting all of original domain as removed
protected void next exec fringe set ready set waiting set complete once the simulation is under way it should be only successors of the just executed node end that might move from waiting to ready so we could make this more efficient if we wanted to for iterator wi waiting iterator wi has next pnode end ne pnode end wi next if complete contains all ne get predecessors the waiting node end is now ready wi remove ready add ne
moves node ends from waiting to ready
public void startup super startup iplan mm iplan model manager model manager
completes setup and initialization
public void reset super reset alternatives clear node end status map clear completely is waiting clear completely unwait table clear completely history clear completely reset exec path stats new slip stats this
called to restore the initial state
public void step if trigger is triggered trigger instant trigger single step break loop
called before each planning step when single stepping is on
protected void transcript final string line util swing and wait new runnable public void run do transcript line
adds a line to the agents transcript window after switching
protected void send report report type type string text send report lookup activity type text
sends a report about this handlers
protected report make report report type type string text return make report lookup activity type text
constructs a report about this handlers
protected report make report activity about report type type string text name our name name value of query agent get agent ipcname report r new report text r set report type type r set ref about get ref r set sender id our name return r
constructs a report about the specified activity
protected void send reply object contents send about lookup activity contents
sends to the agent that send this handlers
protected void send about activity about object contents send to about get sender id contents
sends to the agent that should receive reports about the
protected void send to final object destination final object contents not clear we really need to go to the event thread to do this apart from the transcript part util swing and wait new runnable public void run do transcript sending reporting description contents string to name destination to string canonical ipc send object to name contents
sends the contents object to the agent represented by the
protected void add handlers we have none and do things a different way
install any built in issue and activity handlers
protected void startup util swing and wait new runnable public void run setup gui
agent setup and initialization
protected void setup gui this is optional we could just let the first incoming message cause the text frame to be created but this way we can make it appear right away and can add an exit button text frame new text area frame messages for ipc name new string exit text frame set fold long lines 0 text frame add tool manager text frame add listener new text area frame tlistener public void button pressed string action if action equals exit if util dialog confirms text frame are you sure you want to exit exit
creates a transcript frame for this agent including
public void do transcript string line text frame append line line if text frame get frame is showing text frame set visible true
a utility that adds a line to this agents transcript text area
public void handle new activity activity activity handle received report activity do transcript reporting activity description activity if is lookup activity activity handle lookup activity activity
handles new activities from external sources
protected void handle lookup activity activity activity new lookup thread activity start
handles the activity be creating and starting a new
protected void delete time constraint time constraint c c get pre point remove post constraint c c get post point remove pre constraint c
removes the constraint from its pre and post points
protected object request object applet message m string reply text no reply try reply text send text encode for send m catch ioexception e includes malformed urlexception debug note exception e throw new ipc ipcexception e if reply text starts with object reply decode reply reply text if reply instanceof string string text string reply if text starts with server exception throw interpret server exception text return reply else if reply text starts with exception throw interpret relay exception reply text else throw new ipc ipcexception request failed because reply text
sends a request to the message server and returns the servers reply
protected jmenu bar make menu bar save as refinement item make menu item save as refinement save as refinement item set enabled false file menu add save as refinement item file menu add separator return super make menu bar
constructs the menu bar
public void reset view table reset property viewer reset
sets the viewer back to something approximating its initial state
public void restore table the rows list has the top level nodes in the same order in which they should appear in the table but for subrows subitem rows which could have been added at any time we have to go via the items debug noteln restoring item viewing table for iterator ri rows iterator ri has next row row row ri next if row item get level 0 row simply add to table if row open restore subtree row item
undoes a code clear table code taking into acount any
protected void restore subtree agenda item item for iterator ci item get children iterator ci has next agenda item child agenda item ci next row child row row item to row map get child child row simply add to table if child row open restore subtree child
the part of the implementation of code restore table code
public list eval filters list of constraint conds map state match env env return new filter matcher state eval filters conds env
returns a list of match envs one for each way in which all
protected match env notice forced bindings super method returns a value only for use here if notice forced false return null match env forced super notice forced bindings if forced is empty model manager forced bindings forced temporary return forced
called within the variable manager when it notices that some
public boolean wants actions from item handler handler return true
gives this item its say in whether an item handler should
public void add action handler action act debug noteln this adding act debug expect has action act action added twice act handler action exists find action act get action description if exists null debug noteln action description not unique util quote act get action description actions add act act compute status fire new handler action act
add an action to this item
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 content pane remove logo panel logo panel ip2 make logo panel content pane add logo panel border layout south validate
handles a change in the panels symbol name
public void reset view table reset
sets the viewer back to something approximating its initial state
public void add handler item handler handler if handler instanceof issue handler add issue handler handler else if handler instanceof activity handler add activity handler handler else add item handler handler
install the handler as a handler for issues activities
public void check action validity item handler handler object reason since we always check all items and more than one handler can ask us to check for the same reason we ought to skip repeated checks if reason null reason validity check reason debug noteln skipping check for handler return else validity check reason reason debug noteln controller asked to check action validity by handler debug noteln for reason reason if issues handlers contains handler issues check action validity handler reason if activities handlers contains handler activities check action validity handler reason
called by a handler when it discovers that some actions may
public string get full menu text string text get menu text if text null text default menu text return strings replace to get to name text
returns the value of get menu text with any occurrences of
public void add to menu panel frame frame frame add test submenu menu text test items
tells the panel to add a submenu to the test menu
public void add to menu panel frame frame frame add test separator
tells the panel to add a separator to the test menu
private string file name frame f replace each space by a return strings replace f get title
the file name without directory or type that corresponds
protected jmenu bar make menu bar jmenu bar bar new jmenu bar file menu add make menu item close bar add file menu view menu add make menu item as xml view menu add make menu item as tree view menu add make menu item status information bar add view menu return bar
constructs the menu bar
public list get syntax list return null
returns a list of patterns representing the item pattern
public boolean applies to agenda item item this method allows the handler to reject some items this is especially useful if the handler is added as a universal handler return true
gives this handler a say in whether it should add
public boolean is automatic return false
indicates whether this handler has the authority to
public void add handler actions agenda item item it s assumed the controller has already determined that this is an appropriate handler for the item item add action new handler action automatic this
called to add any
public void revise handler actions agenda item item object reason throw new unsupported operation exception this cannot revise handler actions
called after something has happened that may require new
public void handle agenda item item debug noteln this handling item
called to perform the action implemented by this handler
public string to string return item handler get action description
returns a textual representation of this handler
public string get action description return short description
returns a brief description of how this action would handle
public void handle agenda item item debug noteln handler action short description handling item item item set status status complete
handle the item in the manner appropriate to this handler action
public boolean can always be taken now return false
indicates whether this action can be taken now regardless
public boolean is still valid return true
called when something has happened that might mean this action
public void compute status
called when something has happened that might have changed
public action unready reason get unready reason return null
returns an object that explains why this handler is
public boolean is ready return variable is fully bound item get pattern
returns true iff all variables in the pattern have values
public action unready reason get unready reason return new unbound variables unready reason this item
returns a reason giving the unbound variables
public void bind variables map bindings begin undoable transaction bind variables try do bind variables bindings finally end undoable transaction bind variables
assigns values to
public void symbol name changed agent name event e set title agent get agent display name
handles a change in the panels symbol name
public void add test string menu text action listener listener debug noteln adding test menu text jmenu item item new jmenu item menu text item add action listener catching action listener listener listener test menu set enabled true test menu add item
adds a test by adding a menu item to the test menu
public void add test separator test menu add separator
adds a separator to this panels test menu
protected process model manager make model manager return new ip2 model manager this
called to create this agents model manager
public handler action get action return action
returns the handler action given when this reason was created
protected panel controller make controller return new panel controller this
called to create this agents controller
protected void complete startup frame become visible it s not clear where it s best to do this install agent extensions init options 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 load initial plan
called in the awt event thread to make the main gui frame
public void reset things should register for reset instead of being known here model manager reset controller reset reset viewers util run hooks reset reset hooks
called to restore the initial state
public void undoable transaction string note runnable r note that the begin call must be immediately before the try begin undoable transaction note try r run finally end undoable transaction note
packages an undoable transaction as one method call
public void clear model model manager clear controller clear model
remove everything in the model in the current context
public void reconsider handler item handler handler object reason see comments in panel controller reconsider handler h for iterator i items iterator i has next agenda item item agenda item i next if item get handled by null not already handled if handler applies to item shouldn t we call item wants actions from handler compare add item handler item handler handler handler revise handler actions item reason
called by the controller when a handler has discovered that
public void check action validity item handler handler object reason check action validity
called by the controller when a handler has discovered that
public void add reset hook runnable hook reset hooks add hook
records an object that will be run when this panel is asked
protected void check action validity for iterator i items iterator i has next agenda item item agenda item i next if item get handled by null not already handled check action validity item
checks the validity of all handler actions
public void exit call super method system exit 0 should let some things know
called when the agent should cease execution
protected ip2 frame make ip2 frame return classic new ip2 frame this new new ip2 frame this
called to make the main user interface frame
public void add about info list about
called to add about information
protected agenda viewer make activity viewer if classic return new activity view table this return agenda viewer make viewer activity viewer class activity table viewer class
called to create the activity viewer
protected agenda viewer make issue viewer if classic return new issue view table this return agenda viewer make viewer issue viewer class issue table viewer class
called to create the issue viewer
protected state viewer make state viewer return state viewer make viewer state viewer class state view table class
called to create the state viewer
protected annotation viewer make annotation viewer return annotation viewer make viewer annotation viewer class annotation view table class
called to create the annotation viewer
public llist get tail return at
returns the tail of the list that corresponds to the iterators
protected object make viewer string parameter name class default class class viewer class parameters get class parameter name default class class sig ip2 class try constructor cons viewer class get constructor sig return cons new instance new object this catch exception e debug note exception e throw new rethrown exception e cannot instantiate parameter name class viewer class get name because debug describe exception e
utility use to construct viewers
public iterator iterator return new llist iterator this
returns an interator over the elements of the list
public string elements to string object a if a instanceof list return print to string a string buffer buf new string buffer for iterator i list a iterator i has next buf append print to string i next if i has next buf append return buf to string
returns a string containing the speficied object s converted
public llist put object propname object value for llist at this at lisp nil at at cdr cdr if at car propname cons at cdr set car value return this return new cons propname new cons value this
returns a plist that maps propname to value
public cons alist entry object key for llist at this at lisp nil at at cdr object elt at car if elt instanceof cons cons c cons elt if c car equals key return c return null
treats this llist as an association list alist of key value
protected cons new instance object car llist cdr return new cons car cdr
creates a new instance of this class
public void undoable transaction string note runnable r if undo is enabled ip2 get option manager undoable transaction note r else r run
packages an undoable transaction as one method call
public map alist to map map map for llist at this at lisp nil at at cdr object elt at car if elt instanceof cons cons c cons elt if c cdr instanceof cons object key c car object value c cdr car if an alist has more than one entry for a key the first should win if map get key null map put key value return map
treats this llist as an association list alist and
protected void read domain domain domain list domains parameters get list domain for iterator i domains iterator i has next string domain name string i next try read domain domain domain name catch exception e debug display exception problem with domain domain name e if parameters is interactive throw new rethrown exception e
read in any initial domain descriptions
public llist without object e if is null return this else if car e return cdr without e else llist now cdr llist then now without e if now then return this else return new cons car then
returns an llist that does not contain any element to e
public llist without all collection c if is null return this else if c contains car return cdr without all c else llist now cdr llist then now without all c if now then return this else return new cons car then
returns an llist that does not contain any element of a
public boolean is true object obj return obj equals boolean false
determines whether this interpreter regards the object
public llist without first object e if is null return this else if car e return cdr else llist now cdr llist then now without first e if now then return this else return new cons car then
returns an llist that does not contain the first element if any