input
stringlengths
10
828
output
stringlengths
5
107
public void change gpsstate recieve from gps recieve from gps system out println transfer to server is set to transfer to server
changes the state of recieving from gps unit
public void set follow int follow if follow action 3 else action 1 this follow follow if follow 3 update repaint
if selected will follow coordinates under realtime plotting
public boolean get gpsstate return recieve from gps
gets the state of recieving from gps unit
public double get ratio double limits double ratio double x width limits 2 limits 0 double y width limits 3 limits 1 if x width get width y width get height ratio get width x width else ratio get height y width system out println ratio ratio width x width y width size get width get height return ratio
sets the ratio between route bounds and actual window size
public void close gpsport gps close port
closes the gps port
public boolean curr coord set return gps curr coord set
gets the current coordinates
public double get y return ypos 100000000 utmpoint y ll to utm 22 ypos xpos return y get northing
returns the latitude position of the coordinate
public string to string int decimals return deg min utils round sec decimals
returns a sexagesimal formatted string representation of a coordinate
public void start recieve from gps gps start recieve system out println starting recieve from gps
starts recieving from the gps unit
public void set visible boolean visibility this visible visibility
set the visibility of the route to other clients
public double get x utmpoint x ll to utm 22 ypos xpos return x get easting return xpos 100000000
returns the longitude position of the coordinate
public void stop recieve from gps throws illegal argument exception port in use exception too many listeners exception unsupported comm operation exception ioexception xxx tried to add close open port here to fix problem with disconnecting the port if the plug is pulled out while the app runs would not normally occour if you have an normal serial port not an usb serial adapter as we use for testing gps close port gps open get port gps stop recieve
stops recieving from the gps unit
public void add coordinate coordinate coord double x calc x coord get x double y calc y coord get y double prev x calc x last coord get x double prev y calc y last coord get y coord list add coord system out println added coordinate coord list size switch follow case 1 repaint break case 2 check limits int x int y repaint break case 3 set center x y break
for adding coordinate while route is beeing plotted realtime
public boolean is connected to gps return gps is connected
checks if connected to the gps unit
public string get date string if date null return else return utils date to string date
returns the time and date associated with the coordinate
public boolean get auto transfer state return auto transfer
checks if autotransfer is set
public void check limits int x int y int factor 10 int w get width factor int h get height factor if x 0 w x get width w y 0 h y get height h set center x y
checking if coordinate is outside of window
public double calc x double x return ratio x limits 0
calculates x coordinate for plotting
public boolean has active route return active route get route id 1
checks if active route is set locally
public double calc y double y return ratio y limits 3
calculates y coordinate for plotting
public string get string lat string builder str new string builder latitude str append sexagesimal to string ypos if ypos 0 str append s else str append n return str to string
returns a string representation of the latitude
public void zoom in limits zoom in matrix limits map lim zoom in matrix map lim update repaint
magnifies route with specified zoom ratio
public string get string lon string builder str new string builder longitude str append sexagesimal to string xpos if xpos 0 str append w else str append e return str to string
returns a string representation of the longitude
public void zoom out limits zoom out matrix limits map lim zoom out matrix map lim update repaint
zooms out route with specified zoom ratio
public double haversine dist final coordinate coord return haversine dist this coord
returns the haversine distance from this to another coordinate
public void mouse click double x double y int button switch action case 1 if coord list is empty set center x y else view set state no route is set break case 2 if coord list is empty button 3 set center x y zoom in else if coord list is empty set center x y zoom out else view set state no route is set break
handles action for mouseclick
public void set center double x double y throws null pointer exception center x get width 2 center y get height 2 double move x x center x double move y y center y go move x move y
sets position x y to center of view
public int get coord id return coord id
returns id of coordinate
public void go double mv x double mv y double move xfactor move yfactor move xfactor mv x get width 2 move yfactor mv y get height 2 mv x map lim 2 map lim 0 2 move xfactor mv y map lim 3 map lim 1 2 move yfactor map lim move matrix map lim mv x mv y limits move matrix limits mv x mv y update repaint
moves window specified pixel length from center
private void make sure item is safe to delete file directory file focus directory boolean found tests false boolean path ok false while focus null string file name focus get name assert false file name equals if file name equals tests found tests true if file name equals build if found tests path ok true focus focus get parent file assert true path ok
build tests should be somewhere in the path
public test suite build string package names throws class not found exception test suite suite new test suite name for package names for string package name package names file my dir directory for package package name add child dirs suite my dir package name add tests in dir suite my dir package name return suite
creates a test suite for all named packages and contained packages
public void skip package string package name package filters add new reject packaged name filter package name
skip the given package and any subpackages
public void skip annotation class extends annotation a class validate annotation a class add filter new exclude annotation filter a class
skip all classes marked with this annotation
public void skip everything lacking annotation class extends annotation a class validate annotation a class add filter new require annotation filter a class
include only classes marked with this annotation
private void spread truth string trel config rel true atoms db drop table trel string sql create temporary table trel as select atom id from config rel atoms where truth true db update sql
copy atom id of relevant atoms to
public knowledge base build kb multi entity bayesian network mebn imebnmediator mediator throws instantiation exception return owl2 knowledge base get instance mebn mediator
it builds an
public void set owlmodel manager owlmodel manager owl model manager this owl model manager owl model manager
main access point to proteges api
protected jcomponent create default error panel jtext area text area new jtext area could not create owl2 knowledge base text area set editable false return text area
sets up default panel which displays error messages
protected iri extract irifrom property object property if property is unknown if property instanceof owlproperty return owlproperty property get iri this is unknown try return iri create property to string catch exception e e print stack trace return null
it extracts the iri from a property
protected string get name of property object property if property null return null if property instanceof owlproperty string name owlproperty property to string id use only what resides after try name name substring name last index of 1 catch exception e e print stack trace it is ok use the available name though return name return property to string
extract a name from a property which is in object format
public jpanel get owlapireasoner option panel return owl apireasoner option panel
it holds the last panel generated by
protected inode get selected node if this get mediator null return this get mediator get resident node active return null
obtains the currently selected resident node in the mebn editor
public void set owlapireasoner option panel jpanel o wlapireasoner option panel owl apireasoner option panel o wlapireasoner option panel
it holds the last panel generated by
public void reset components this remove all this init components this init listeners system gc
reset this component
public void reset components this set visible false rebuild only the contents this initialize content panel this initialize content panel listener force content to update again this get content panel update ui this get content panel repaint force dialog to update this pack this repaint system gc this set visible true
removes and re generates
protected jpanel get protege41 reasoner option panel return protege41 reasoner option panel
it holds the last panel generated by
public framework get framework return framework
the osgi framework to be used in
public void set framework framework framework this framework framework
the osgi framework to be used in
protected void init listeners notify components this add property change listener imebnedition panel builder mebn edition panel change property new property change listener public void property change property change event evt try if get owl model holder null get owl model holder get adaptee null get owl model holder get adaptee notify all if get widget null get widget notify all catch exception e e print stack trace
initialize components listeners
public void reset components this remove all this get widget dispose this set widget null this init components this init listeners
removes all components and calls
public mebnstorage implementor decorator get owl model holder try return mebnstorage implementor decorator this get mebn get storage implementor catch exception e probably a nullpointerexception or classcastexception e print stack trace return null
this is a wrapper for
protected property selection dialog super try this resource resource controller new instance get bundle unbbayes gui mebn ontology protege resources resources class get name locale get default this get class get class loader catch throwable t t print stack trace
constructor is not made public
public owlontology change listener get owlontology change listener return owl ontology change listener
a listener specifying what happens to this panel when the ontology is changed
public owlproperty get selected value try return owlproperty this get property list panel get property list get selected value catch class cast exception e debug println this get class e get message e return null
this method will return the selected owl property
public boolean supports string extension boolean is load only if is load only return super supports extension is load only return false
this class only supports loading
public string get supported files description boolean is load only if is load only return super get supported files description is load only return
this class only supports loading
public boolean supports file file boolean is load only if is load only return super supports file is load only return false
this class only supports loading
protected owlreasoner generate reasoner owlontology ontology owlreasoner configuration configuration try if ontology null owlreasoner factory factory new reasoner reasoner factory if configuration null return factory create reasoner ontology configuration else return factory create reasoner ontology catch exception e e print stack trace return null
generates a new owl reasoner hermit using the ontology and configuration
public void reset components remove old listeners of global objects to avoid memory leak if this get owl model holder null this get owl model holder get adaptee null this get model listener null this get owl model holder get adaptee remove model listener this get model listener this set model listener null this remove all this init components this init listeners
removes all components and calls
public mebnstorage implementor decorator get owl model holder try return mebnstorage implementor decorator this get mebn get storage implementor catch exception e probably a nullpointerexception or classcastexception debug println this get class if this is just a nullpointerexception or classcastexception there is no problem e return null
this is a wrapper for
protected object extract protege manager bundle bundle multi entity bayesian network mebn imebnmediator mediator try if bundle null debug println this get class extracting protege manager using osgi class loader bundle bundle get symbolic name protege manager protege manager protege manager get instance return bundle load class protege manager class get name get method get instance invoke null else debug println this get class extracting protege manager as a singleton using application class loader return protege manager get instance catch throwable e e print stack trace return null
this method extracts a protege manager from bundle
protected void show argument mapping dialog inode selected node get selected node if selected node null selected node instanceof resident node argument mapping dialog dialog argument mapping dialog new instance this get mebn this get mediator selected node dialog set default close operation jdialog dispose on close dialog pack dialog set visible true
show a popup and force user to map arguments
protected uri extract urifrom mebn multi entity bayesian network mebn uri ret null try ret iowlapistorage implementor decorator mebn get storage implementor get adaptee get owlontology manager get ontology document iri iowlapistorage implementor decorator mebn get storage implementor get adaptee to uri catch exception e try debug println this get class impossible to extract uri from mebn e catch throwable t t print stack trace return ret
extract the ontologys uri from mebn
public properties get launch properties return launch properties
this is the properties that initializes some important values e
public int get default random range on multiple property selection return default random range on multiple property selection
this is the noise to be considered to the positions of nodes
public void set launch properties properties launch properties this launch properties launch properties
this is the properties that initializes some important values e
public string get prowl ontology namespace uri return prowl ontology namespace uri
this is the string representing a uri of the pr owl definition ontology
public void set prowl ontology namespace uri string prowl ontology namespace uri this prowl ontology namespace uri prowl ontology namespace uri
this is the string representing a uri of the pr owl definition ontology
public imapping argument extractor get mapping argument extractor return mapping argument extractor
this object will extract the relationships between arguments of nodes and owl properties
public ibundle launcher get protege bundle launcher if protege bundle launcher null protege bundle launcher protege bundle launcher get instance return protege bundle launcher
this is a bundle laucher which launches protege using osgi
public void set protege bundle launcher ibundle launcher protege bundle launcher this protege bundle launcher protege bundle launcher
this is a bundle laucher which launches protege using osgi
public long get sleep time waiting reasoner initialization system gc just because methods calling this method are expensive return sleep time waiting reasoner initialization
this is the argument that will be passed to
protected string extract name owlontology ontology owlentity owl entity todo remove redundant calls to this method some methods are calling this method more than once despite only 1 call was really necessary return this extract name owl entity
extract a simple name from an owl entity
public long get sleep time waiting reasoner initialization return sleep time waiting reasoner initialization
this is the argument that will be passed to
protected void set content of combo box object content of combo box this content of combo box content of combo box
this is the default content of combo boxes in this panel
protected double read version stream tokenizer st throws ioexception while st next token st tt eof if st ttype st tt word this get token version declarator equals st sval if st next token st tt number return st nval else break throw new ioexception resource get string invalid syntax
this method reads the version number from a ubf file
public void set owl property label map map argument jlabel owl property label map this owl property label map owl property label map
this label can be used to obtain what jlabel is related
protected string read owl file stream tokenizer st throws ioexception while st next token st tt eof if st ttype st tt word this get token pr owl file declarator equals st sval if st next token st tt eol return st sval else break throw new ioexception resource get string invalid syntax
reads the line specifying the name of the associated owl file
public void make file list node sampled node order make first line sampled node order node node for int i 0 i matrix length i for int j 0 j sampled node order size j node sampled node order get j ps print node get state at matrix i j if j sampled node order size 1 ps print t else ps println
creates a txt file with the sampled states from the simulation
public void set pn probabilistic network pn this pn pn
sets the value of probabilistic network
public void startup parameters if get pn null throw new illegal state exception resource get string select file param pane new mcparameters pane add listeners
opens the parameter panel
public boolean supports string extension boolean is load only return supported extensions 0 equals ignore case extension
checks if file extension is compatible to what this i o expects
protected void build formula trees map string context node map top level context nodes multi entity bayesian network mebn for context node context map top level context nodes values context set formula tree build formula tree context
builds formula trees for all context nodes in map top level context nodes
private object get value from map with collection as key map map collection key for object obj map key set if key equals obj object val map get obj return a null object if key was found but value is null return val null null object get instance val return null key not found
this is the
protected void make linkage tree throws exception link list clear jt new junction tree clique root clique n1 get junction tree get cliques get 0 make clique list root remove1st pass remove2nd pass root clique jt get cliques get 0 assert root get parent null assign v1 debug for int i link list size 1 i 0 i system out println system out println link list get i system out println system out println debug init tables
must be called after the junction tree creation
protected void remove redundancy potential table new red tab potential table old red tab new link table op tab new red tab potential table division operator original link table op tab old red tab potential table division operator
second pass to absorb
public void shift attention sub network net throws exception list caminho active net make path net for int i 1 i caminho size i sub network net aux sub network caminho get i update belief net aux active net active net net aux assert active net net
shifts attention from the active sub network to the specified sub network
protected void absorb out boolean na ordem clique c1 na ordem v0 v1 new link table direct op tab original link table potential table division operator c1 get probability function op tab new link table potential table product operator
third pass to absorb
public void set host0 clique v0 this v0 v0
sets the host clique on the first
public void set host1 clique v1 this v1 v1
sets the host clique on the second
public int get adjacents size return adjacents size
returns the number of adjacents
public clique get clique return clique
returns the clique of this link
public clique get host0 return v0
returns the host clique on the first
public clique get host1 return v1
returns the host clique on the second
public sub network get adjacent at int index return sub network adjacents get index
returns the adjacent subnetwork in the specified index
public void add adjacent sub network net adjacents add net
adds the specified subnetwork in the adjacents list
private clique make clique list clique c clique clique clone new clique clique clone get nodes add all set toolkit intersection c get nodes nodes link l new link clique clone l set host0 c link list add l jt get cliques add clique clone for int i c get children size 1 i 0 i clique c2 make clique list c get child at i c2 set parent clique clone clique clone add child c2 return clique clone
makes the tree with dfs
public sub network get net1 return n1
returns the parent subnetwork of this linkage
protected void local moralize super moralize
local version of the moralize method
public sub network get net2 return n2
returns the child subnetwork of this linkage