input
stringlengths
10
828
output
stringlengths
5
107
public boolean has next return actual pos number of children
returns tt true tt if the iteration has more elements
public void write int b throws ioexception byte buffer bb byte buffer allocate 1 bb put byte b bb flip char buffer cb charset decode bb if cb length 0 sbs get sb append cb char at 0
writes the specified byte to this output stream
public node next return children item actual pos
returns the next element in the interation
public int read throws ioexception if read position sbs get sb length return 1 return sbs get sb char at read position
reads the next byte of data from the input stream
public element write fragment object object document doc throws no such fragment handler exception ioexception for extension plugin fragment plugins fragment handler handler fragment handler plugin get singleton if handler can write object return handler write object doc throw new no such fragment handler exception no fragment handler found for object
this method is used to create an xml element
public object read fragment element child knowledge base kb throws no such fragment handler exception ioexception for extension plugin fragment plugins fragment handler handler fragment handler plugin get singleton if handler can read child return handler read kb child throw new no such fragment handler exception no fragment handler found for child
reads the specified xml
public string get verbalization return verbalization
creation date 03
public resource get fav icon return fav icon
returns the fav icon of this knowledge base
private persistence manager update plugins
private constructor for public access get instance should be used
private void trace nodes and edges session session collection node traced nodes for node node traced nodes trace nodes node for edge edge node get outgoing edges if flux solver eval edge session edge trace edges edge
traces the nodes and active outgoing edges if trace mode is enabled
public value get value node node return traced values get node
returns the value the associated terminology object of the node had at
private void check flow for node node nodes node set flow this
checks the consistency of nodes and edges and sets backreference to flow
public void snapshot done snapshot node node session session long time session get propagation manager get propagation time this latest snapshot time put node new long time
records that a snapshot has been executed for this session in this
public date get latest snaphot time collection long values this latest snapshot time values if values is empty return null long max time long min value for long time values max time math max max time time long value return new date max time
returns the latest most recent time a snapshot has been taken
public boolean is active node node return nodes contains node start nodes contains node
returns if the node is active within this flow run
public boolean is activated node node return nodes contains node
returns if the node has been activated by propagation within this flow
private boolean not needed zip entry entry string name entry get name return name equals ignore case kb inf index xml name equals ignore case crs inf index xml name equals meta inf manifest mf
returns the the specified entry is an unrequired file from a previous
private void flow inode node session session logger get logger flux solver class get name finer start flowing from node node if node can fire edges session return list iedge edges select inactive true edges node session if edges is empty no edge to take logger get logger flux solver class get name finer staying in node node else for iedge edge edges inode next node follow edge session edge if next node null flow next node session
continues to flow from the current end node of this path
public knowledge base load file file throws ioexception return load file new dummy progress listener
loads a knowledge base from the specified zip file
public void save knowledge base knowledge base file file throws ioexception save knowledge base file new dummy progress listener
saves the specified
public string verbalize object o rendering format target format map string object parameter if target format rendering format html return render object to html o if target format rendering format plain text return render object to plain text o if target format rendering format xml return render object to xml o as this is the default verbalizer that should render everything this shall never happen return null
returns a standard verbalization of any object
public void register verbalizer verbalizer register verbalizer priority medium
registers a verbalizer in the manager with medium priority
public void register verbalizer verbalizer int priority registered verbalizers add verbalizer priority hash put verbalizer priority collections sort registered verbalizers new verbalizer comparator
registers a verbalizer in the manager with given priority
public void deregister verbalizer verbalizer registered verbalizers remove verbalizer priority hash remove verbalizer
removes a verbalizer from the manager
public int get priority verbalizer v if priority hash contains key v return 1 return priority hash get v
returns the priority of v in the verbalization manager 1 if not
public string verbalize object o rendering format rendering target format return verbalize o rendering target format null
returns a verbalization string representation of the given object in
public session get root session return this root session
returns the original root session that is decorated by this
public string verbalize object o rendering format target format map string object parameter if o instanceof condition this shouldnt happen cause verbalization manager should not delegate here in this case logger get logger verbalizer warning object o couldnt be rendered by condition verbalizer return null condition cond condition o this parameter parameter this target format target format return render condition cond
verbalizes an object that is supported to be rendered by the
private void make covered terminology object terminology object boolean is new covered objects add terminology object if is new thrill seekers only we only add the merged fact instead of all fact existing fact decorated get merged fact terminology object if existing fact null this covering add existing fact collection fact all facts this decorated get all facts terminology object for fact fact all facts this covering add fact
ensures that the specified
public value get decorated value value object object fact fact decorated fact storage get value storage get decorated merged fact object return fact null null fact get value
returns the decorated value of a specified
public value get changed value value object object value value get decorated value object if value null session root decorated session get session get root session value original root get blackboard get value object if original equals value return null return value
returns the decorated value of a specified
public string verbalize object o rendering format target format map string object parameter if o instanceof abstract condition this shouldnt happen cause verbalization manager should not delegate here in this case logger get logger verbalizer warning object o couldnt be rendered by rule verbalizer return null abstract condition cond abstract condition o return render condition to cond parameter target format
verbalizes an object that is supported to be rendered by the
public boolean is reached path path boolean reached new boolean this get qcontainers size for qcontainer qcon path get path if this get qcontainers contains qcon reached this get qcontainers index of qcon true for boolean checker reached if checker return false return true
checks if this target is reached by the specified path
public double get benefit return benefit
returns the benefit calculated for this target
public void set benefit double benefit this benefit benefit
sets the benefit if this target
public path get min path return min path
returns the minimal path calculated for this target
public void reset path current sequence null for fact fact indicated facts session get blackboard remove interview fact fact indicated facts new linked list fact this current path index 1
resets the path
public void set min path path min path this min path min path
sets the minimal path towards that target
public void add node node session session stack push node double node costs node get costs session costs node costs if node costs 0 negative costs node costs coststack push node costs
adds a new node to the idspath and updates the costs
public void pop stack pop double cost coststack pop costs cost if cost 0 negative costs costs
removes the last node added to the path and updates the costs
public double get costs return costs
returns the static costs of all
public idspath copy idspath copy new idspath for int i 0 i stack size i copy add stack get i coststack get i return copy
returns a copy of this path
public double get cost benefit double the benefit get benefit path the min path get min path if the min path null the benefit 0f return float max value return the min path get costs the benefit
returns the cost per benefit of that target
public boolean is applicable session session if st null return true condition activation condition st get activation condition if activation condition null return true return conditions is true activation condition session
checks if the node is applicable in session
public fact get decorated merged fact value object object if is covered object return covering get merged fact object if decorated instanceof decorated fact storage return decorated fact storage decorated get decorated merged fact object return null
returns the merged fact of this
public boolean contains node node return stack contains node
checks if the node is contained in the path
public node get last node return stack peek
returns the last node added to the path
public boolean is applicable session session if st null return false condition activation condition st get activation condition if activation condition null return true try return activation condition eval session catch no answer exception e catch unknown answer exception e if there is no answer or the answer is unknown the qcontainer is not applicable return false
checks if the node is applicable in session
private target get existing target target blueprint if targets contains blueprint for target target targets if target equals blueprint return target return null
return the existing target that equals to the specified one
public void maximize benefit target t double benefit if t get benefit benefit targets remove t t set benefit benefit targets add t check target t
maximizes the benefit of a target
public void search session session abort if there are no targets in the model if model has targets return long time1 system current time millis abort strategy init model session testcase util create search copy session try search testcase 1 catch abort exception e we have stopped at the search due to time restrictions use the best found path till now model set abort true long time2 system current time millis log info ids calculation model is aborted aborted done steps steps time time2 time1 ms init init time ms
starts the search with depth 1
public astar path get longest sub path reached qcontainer path astar path sub path new astar path null null 0 collection node nodes new linked list node astar get closed nodes nodes add all astar get open nodes for node n nodes list qcontainer actual path n get path get path if actual path size sub path get path size actual path size path length int i 0 boolean is sub path true for qcontainer qcon actual path if qcon path i is sub path false break if is sub path sub path n get path return sub path
returns the longest subpath of the specified path reached during the
public double get best benefit if best benefit target null return 0f return best benefit target get benefit
returns the benefit of the best benefit target the best benefit not
public double get best cost benefit if best cost benefit target null return float max value return best cost benefit target get cost benefit
returns the cost benefit of the best cost benefit target
public double get best unreached benefit double benefit 0 for target t targets if t get min path null benefit math max benefit t get benefit return benefit
returns the best unreached benefit
public double get predicted path costs on calculation start for node n astar get closed nodes if n get path get path is empty return n getf value return double na n
returns the f value of the start state of the calculation
public cost function get cost function return cost function
returns the cost function
public analysis result get best path at calculation end node peek astar get open nodes peek return new analysis result peek get path peek getf value false
returns the path which would have been expanded next if the calculation
public boolean is any target reached return best cost benefit target null
checks if at least one target is reached
private string get indents int indent boolean is single line if is single line return string s for int i 0 i 3 indent i s space return s
convenience method to create line indents
public void set abort boolean abort this aborted abort
tells the search algorithm whether to abort the search or not
private void minimize path idspath path node node path get last node list target the targets this referencing targets get node for target t the targets if t is reached path if t get min path null count min paths if t get min path null t get min path get costs path get costs t set min path path copy model check target t
minimizes if necessary the path in all targets which are reached
public boolean all targets reached return count min paths model get targets size
checks if all targets are reached
public boolean has value question question value value value stored value session get blackboard get value question return equals value stored value
checks if the specified state
public astar explanation component get explanation component return new astar explanation component last search
returns an explanation component of the last search started
public double get direct costs return this costs
returns the costs of the final qcontainer of this path
private void step completed node node try steps algorithm get abort strategy next step node get path session catch abort exception e record that abort is requested but do noting special model set abort true
notifies that a search step has been completed
public qcontainer get qcontainer return this q container
returns the final
private void add qcontainers to path array list qcontainer path if predecessor null path add all predecessor get path if q container null path add q container
this method is used to add qcontainers to the actual path reference
public float get increasing factor return increasing factor
returns the factor the maximum number of steps can be exceeded if
public void abort session session default abort strategy session object session object session get session object this session object abort true
if this method is called the calculation will abort after the next step
public long get steps session session return session get session object this steps
returns the steps of the actual calculation in the specified session
public boolean is any target reached session session default abort strategy session object session object session get session object this if session object model null return session object model is any target reached else return false
checks if at least one target is reached in the current calculation
public void select target target target throws abort exception psmethod cost benefit psm get psmethod cost benefit cost benefit case object pso get cost benefit case object psm propagation manager propagation manager session get propagation manager try propagation manager open propagation session get protocol add entry new manual target selection entry propagation manager get propagation time target get qcontainers to array new qcontainer target get qcontainers size psm calculate new path to pso target psm activate next qcontainer pso finally propagation manager commit propagation
selects a new target for the interview strategy
public void select target qcontainer target questionnaire throws abort exception target target new target target questionnaire select target target
selects a new target for the interview strategy
public target get current target psmethod cost benefit psm get psmethod cost benefit cost benefit case object pso get cost benefit case object psm search model search model pso get search model if search model null return null return search model get best cost benefit target
returns the current target
public void select best sequence psmethod cost benefit psm get psmethod cost benefit cost benefit case object pso get cost benefit case object psm propagation manager propagation manager session get propagation manager try propagation manager open propagation psm calculate new path pso psm activate next qcontainer pso finally propagation manager commit propagation
makes the cost benefit strategic solver to recalculate the possible
public file scan directory file sub string s for int i 0 i sub length i this is not perfect but works quite well for the tests if sub i get path ends with s return sub i if sub i is directory sub i get name ends with cvs file t scan directory sub i list files s if t null return t return null
scans a directory for a given filename attention file with same name are
public void test file existing string original folder string reloaded folder file o f new file original folder file r f new file reloaded folder file r fs sort directory r f file o fs sort directory o f for file f o fs file found root folder scan directory r fs f get name if found root folder null errors add new string f get name f get path continue scan subfolders this diff folders f found root folder
diffs two folders and writes out missing files and file pairs
public date get date rated test case rtc date time stamp rtc get time stamp if time stamp null create the timestamp based on the position in the list time stamp new date get start date get time index of rtc 1 return time stamp
gets the date of the rated test case to be evaluated at
public void set question de d3web core knowledge terminology question new question if question null question remove knowledge get problemsolver context this method kind question new question if new question null question add knowledge get problemsolver context this method kind
sets the question and adds this object as knowledge slice to the question
public boolean has fired return fired
creation date 04
public qcontainer create qcontainer string name return create qcontainer name knowledge base get root qaset
creates a new questionnaire with the specified name as a child of the
public void add fact fact fact first make sure that the source remains unique remove facts by source fact get source this facts add fact invalidate
adds a new fact to the aggregator
public void remove fact fact fact this facts remove fact invalidate
removes the specified fact from this aggregator
public void clear this facts clear invalidate
removes all facts from this aggregator
public void remove facts by source object source iterator fact iterator facts iterator while iterator has next fact fact iterator next if source equals fact get source iterator remove invalidate source can only be found once because source is unique break
removes the fact for the specified source from this aggregator
public fact get merged fact if this merged fact null merge facts return this merged fact
returns the merged fact of all currently added facts of this aggregator
private fact merge facts by priority list fact merged facts fact best fact null double best psmpriority double max value for fact fact merged facts psmethod ps method fact get psmethod double priority ps method get priority if priority best psmpriority best fact fact best psmpriority priority return best fact
merges the facts by the priority of the psmethods derived that facts
private fact merge solution facts list fact facts return facts merge solution facts facts
merges the facts of solution ratings by the priority of the ratings
private fact merge indication facts list fact facts return facts merge indication facts facts
merges the facts of indications by the priority of the ratings
public boolean is empty return this facts is empty
returns whether the aggregator is empty due to having no facts
public boolean is empty psmethod ps method for fact f facts if f get psmethod equals ps method return false return true
returns whether the aggregator is empty for a specific problem or
public fact get merged fact psmethod ps method list fact psmfacts new linked list fact for fact f facts if f get psmethod equals ps method psmfacts add f if psmfacts size 1 return psmfacts get 0 else if psmfacts size 1 return ps method merge facts psmfacts to array new fact psmfacts size else return null
merges and returns all facts of one psmethod
public string get terminology object name return terminology object name
returns the name of the terminology object
public string get solving method class name return solving method class name
returns the fully qualified class name of the psmethod having derived
public void sort qcontainers list qcontainer unsorted hash map terminology object integer qcontainer index new hash map terminology object integer reindex knowledge base get root qaset qcontainer index integer value of 0 collections sort unsorted new dfstree sorting comparator qcontainer index
sorts a given list of qcontainer according to dfs
private void reindex terminology object qaset map terminology object integer qcontainer index integer max ordering number qcontainer index put qaset max ordering number integer max ord num max ordering number for terminology object child qaset get children max ord num if qcontainer index contains key child reindex child qcontainer index max ord num else continue terminate recursion in case of cyclic hierarchies
traverses the qaset hierarchy using a depth first search and attaches an
public boolean contains all multiple choice value other return this choice ids contains all other choice ids
checks if all choices are included in the other
public boolean contains value value if value instanceof choice value return contains choice value value get choice id else if value instanceof multiple choice value return contains all multiple choice value value else return false
checks if the choice s of the specified