001    /**
002     * Copyright (C) 2007-2011, Jens Lehmann
003     *
004     * This file is part of DL-Learner.
005     *
006     * DL-Learner is free software; you can redistribute it and/or modify
007     * it under the terms of the GNU General Public License as published by
008     * the Free Software Foundation; either version 3 of the License, or
009     * (at your option) any later version.
010     *
011     * DL-Learner is distributed in the hope that it will be useful,
012     * but WITHOUT ANY WARRANTY; without even the implied warranty of
013     * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
014     * GNU General Public License for more details.
015     *
016     * You should have received a copy of the GNU General Public License
017     * along with this program.  If not, see <http://www.gnu.org/licenses/>.
018     */
019    
020    package org.dllearner.core.configurators;
021    
022    import java.util.Set;
023    import org.dllearner.algorithms.refinement.ROLearner;
024    import org.dllearner.core.ComponentManager;
025    import org.dllearner.core.AbstractLearningProblem;
026    import org.dllearner.core.LearningProblemUnsupportedException;
027    import org.dllearner.core.AbstractReasonerComponent;
028    import org.dllearner.core.configurators.RefinementOperatorConfigurator;
029    
030    /**
031    * automatically generated, do not edit manually.
032    * run org.dllearner.scripts.ConfigJavaGenerator to update
033    **/
034    @SuppressWarnings("all")
035    public  class ROLearnerConfigurator  extends RefinementOperatorConfigurator implements Configurator {
036    
037    private boolean reinitNecessary = false;
038    private ROLearner rOLearner;
039    
040    /**
041    * @param rOLearner see ROLearner
042    **/
043    public ROLearnerConfigurator(ROLearner rOLearner){
044    this.rOLearner = rOLearner;
045    }
046    
047    /**
048    * @param reasoningService see reasoningService
049    * @param learningProblem see learningProblem
050    * @throws LearningProblemUnsupportedException see 
051    * @return ROLearner
052    **/
053    public static ROLearner getROLearner(AbstractLearningProblem learningProblem, AbstractReasonerComponent reasoningService) throws LearningProblemUnsupportedException{
054    ROLearner component = ComponentManager.getInstance().learningAlgorithm(ROLearner.class, learningProblem, reasoningService);
055    return component;
056    }
057    
058    /**
059    * writeSearchTree specifies whether to write a search tree.
060    * mandatory: false| reinit necessary: true
061    * default value: false
062    * @return boolean 
063    **/
064    public boolean getWriteSearchTree() {
065    return (Boolean) ComponentManager.getInstance().getConfigOptionValue(rOLearner,  "writeSearchTree") ;
066    }
067    /**
068    * searchTreeFile file to use for the search tree.
069    * mandatory: false| reinit necessary: true
070    * default value: log/searchTree.txt
071    * @return String 
072    **/
073    public String getSearchTreeFile() {
074    return (String) ComponentManager.getInstance().getConfigOptionValue(rOLearner,  "searchTreeFile") ;
075    }
076    /**
077    * replaceSearchTree specifies whether to replace the search tree in the log file after each run or append the new search tree.
078    * mandatory: false| reinit necessary: true
079    * default value: false
080    * @return boolean 
081    **/
082    public boolean getReplaceSearchTree() {
083    return (Boolean) ComponentManager.getInstance().getConfigOptionValue(rOLearner,  "replaceSearchTree") ;
084    }
085    /**
086    * heuristic specifiy the heuristic to use.
087    * mandatory: false| reinit necessary: true
088    * default value: lexicographic
089    * @return String 
090    **/
091    public String getHeuristic() {
092    return (String) ComponentManager.getInstance().getConfigOptionValue(rOLearner,  "heuristic") ;
093    }
094    /**
095    * applyAllFilter usage of equivalence ALL R.C AND ALL R.D = ALL R.(C AND D).
096    * mandatory: false| reinit necessary: true
097    * default value: true
098    * @return boolean 
099    **/
100    public boolean getApplyAllFilter() {
101    return (Boolean) ComponentManager.getInstance().getConfigOptionValue(rOLearner,  "applyAllFilter") ;
102    }
103    /**
104    * applyExistsFilter usage of equivalence EXISTS R.C OR EXISTS R.D = EXISTS R.(C OR D).
105    * mandatory: false| reinit necessary: true
106    * default value: true
107    * @return boolean 
108    **/
109    public boolean getApplyExistsFilter() {
110    return (Boolean) ComponentManager.getInstance().getConfigOptionValue(rOLearner,  "applyExistsFilter") ;
111    }
112    /**
113    * useTooWeakList try to filter out too weak concepts without sending them to the reasoner.
114    * mandatory: false| reinit necessary: true
115    * default value: true
116    * @return boolean 
117    **/
118    public boolean getUseTooWeakList() {
119    return (Boolean) ComponentManager.getInstance().getConfigOptionValue(rOLearner,  "useTooWeakList") ;
120    }
121    /**
122    * useOverlyGeneralList try to find overly general concept without sending them to the reasoner.
123    * mandatory: false| reinit necessary: true
124    * default value: true
125    * @return boolean 
126    **/
127    public boolean getUseOverlyGeneralList() {
128    return (Boolean) ComponentManager.getInstance().getConfigOptionValue(rOLearner,  "useOverlyGeneralList") ;
129    }
130    /**
131    * useShortConceptConstruction shorten concept to see whether they already exist.
132    * mandatory: false| reinit necessary: true
133    * default value: true
134    * @return boolean 
135    **/
136    public boolean getUseShortConceptConstruction() {
137    return (Boolean) ComponentManager.getInstance().getConfigOptionValue(rOLearner,  "useShortConceptConstruction") ;
138    }
139    /**
140    * horizontalExpansionFactor horizontal expansion factor (see publication for description).
141    * mandatory: false| reinit necessary: true
142    * default value: 0.6
143    * @return double 
144    **/
145    public double getHorizontalExpansionFactor() {
146    return (Double) ComponentManager.getInstance().getConfigOptionValue(rOLearner,  "horizontalExpansionFactor") ;
147    }
148    /**
149    * improveSubsumptionHierarchy simplify subsumption hierarchy to reduce search space (see publication for description).
150    * mandatory: false| reinit necessary: true
151    * default value: true
152    * @return boolean 
153    **/
154    public boolean getImproveSubsumptionHierarchy() {
155    return (Boolean) ComponentManager.getInstance().getConfigOptionValue(rOLearner,  "improveSubsumptionHierarchy") ;
156    }
157    /**
158    * quiet may be deprecated soon.
159    * mandatory: false| reinit necessary: true
160    * default value: false
161    * @return boolean 
162    **/
163    public boolean getQuiet() {
164    return (Boolean) ComponentManager.getInstance().getConfigOptionValue(rOLearner,  "quiet") ;
165    }
166    /**
167    * allowedConcepts concepts the algorithm is allowed to use.
168    * mandatory: false| reinit necessary: true
169    * default value: null
170    * @return Set(String) 
171    **/
172    @SuppressWarnings("unchecked")
173    public Set<String> getAllowedConcepts() {
174    return (Set<String>) ComponentManager.getInstance().getConfigOptionValue(rOLearner,  "allowedConcepts") ;
175    }
176    /**
177    * ignoredConcepts concepts the algorithm must ignore.
178    * mandatory: false| reinit necessary: true
179    * default value: null
180    * @return Set(String) 
181    **/
182    @SuppressWarnings("unchecked")
183    public Set<String> getIgnoredConcepts() {
184    return (Set<String>) ComponentManager.getInstance().getConfigOptionValue(rOLearner,  "ignoredConcepts") ;
185    }
186    /**
187    * allowedRoles roles the algorithm is allowed to use.
188    * mandatory: false| reinit necessary: true
189    * default value: null
190    * @return Set(String) 
191    **/
192    @SuppressWarnings("unchecked")
193    public Set<String> getAllowedRoles() {
194    return (Set<String>) ComponentManager.getInstance().getConfigOptionValue(rOLearner,  "allowedRoles") ;
195    }
196    /**
197    * ignoredRoles roles the algorithm must ignore.
198    * mandatory: false| reinit necessary: true
199    * default value: null
200    * @return Set(String) 
201    **/
202    @SuppressWarnings("unchecked")
203    public Set<String> getIgnoredRoles() {
204    return (Set<String>) ComponentManager.getInstance().getConfigOptionValue(rOLearner,  "ignoredRoles") ;
205    }
206    /**
207    * useAllConstructor specifies whether the universal concept constructor is used in the learning algorithm.
208    * mandatory: false| reinit necessary: true
209    * default value: true
210    * @return boolean 
211    **/
212    public boolean getUseAllConstructor() {
213    return (Boolean) ComponentManager.getInstance().getConfigOptionValue(rOLearner,  "useAllConstructor") ;
214    }
215    /**
216    * useExistsConstructor specifies whether the existential concept constructor is used in the learning algorithm.
217    * mandatory: false| reinit necessary: true
218    * default value: true
219    * @return boolean 
220    **/
221    public boolean getUseExistsConstructor() {
222    return (Boolean) ComponentManager.getInstance().getConfigOptionValue(rOLearner,  "useExistsConstructor") ;
223    }
224    /**
225    * useNegation specifies whether negation is used in the learning algorothm.
226    * mandatory: false| reinit necessary: true
227    * default value: true
228    * @return boolean 
229    **/
230    public boolean getUseNegation() {
231    return (Boolean) ComponentManager.getInstance().getConfigOptionValue(rOLearner,  "useNegation") ;
232    }
233    /**
234    * useCardinalityRestrictions specifies whether CardinalityRestrictions is used in the learning algorithm.
235    * mandatory: false| reinit necessary: true
236    * default value: true
237    * @return boolean 
238    **/
239    public boolean getUseCardinalityRestrictions() {
240    return (Boolean) ComponentManager.getInstance().getConfigOptionValue(rOLearner,  "useCardinalityRestrictions") ;
241    }
242    /**
243    * useBooleanDatatypes specifies whether boolean datatypes are used in the learning algorothm.
244    * mandatory: false| reinit necessary: true
245    * default value: true
246    * @return boolean 
247    **/
248    public boolean getUseBooleanDatatypes() {
249    return (Boolean) ComponentManager.getInstance().getConfigOptionValue(rOLearner,  "useBooleanDatatypes") ;
250    }
251    /**
252    * maxExecutionTimeInSeconds algorithm will stop after specified seconds.
253    * mandatory: false| reinit necessary: true
254    * default value: 0
255    * @return int 
256    **/
257    public int getMaxExecutionTimeInSeconds() {
258    return (Integer) ComponentManager.getInstance().getConfigOptionValue(rOLearner,  "maxExecutionTimeInSeconds") ;
259    }
260    /**
261    * minExecutionTimeInSeconds algorithm will run at least specified seconds.
262    * mandatory: false| reinit necessary: true
263    * default value: 0
264    * @return int 
265    **/
266    public int getMinExecutionTimeInSeconds() {
267    return (Integer) ComponentManager.getInstance().getConfigOptionValue(rOLearner,  "minExecutionTimeInSeconds") ;
268    }
269    /**
270    * guaranteeXgoodDescriptions algorithm will run until X good (100%) concept descritpions are found.
271    * mandatory: false| reinit necessary: true
272    * default value: 1
273    * @return int 
274    **/
275    public int getGuaranteeXgoodDescriptions() {
276    return (Integer) ComponentManager.getInstance().getConfigOptionValue(rOLearner,  "guaranteeXgoodDescriptions") ;
277    }
278    /**
279    * logLevel determines the logLevel for this component, can be {TRACE, DEBUG, INFO}.
280    * mandatory: false| reinit necessary: true
281    * default value: DEBUG
282    * @return String 
283    **/
284    public String getLogLevel() {
285    return (String) ComponentManager.getInstance().getConfigOptionValue(rOLearner,  "logLevel") ;
286    }
287    /**
288    * instanceBasedDisjoints Specifies whether to use real disjointness checks or instance based ones (no common instances) in the refinement operator..
289    * mandatory: false| reinit necessary: true
290    * default value: true
291    * @return boolean 
292    **/
293    public boolean getInstanceBasedDisjoints() {
294    return (Boolean) ComponentManager.getInstance().getConfigOptionValue(rOLearner,  "instanceBasedDisjoints") ;
295    }
296    
297    /**
298    * @param writeSearchTree specifies whether to write a search tree.
299    * mandatory: false| reinit necessary: true
300    * default value: false
301    **/
302    public void setWriteSearchTree(boolean writeSearchTree) {
303    ComponentManager.getInstance().applyConfigEntry(rOLearner, "writeSearchTree", writeSearchTree);
304    reinitNecessary = true;
305    }
306    /**
307    * @param searchTreeFile file to use for the search tree.
308    * mandatory: false| reinit necessary: true
309    * default value: log/searchTree.txt
310    **/
311    public void setSearchTreeFile(String searchTreeFile) {
312    ComponentManager.getInstance().applyConfigEntry(rOLearner, "searchTreeFile", searchTreeFile);
313    reinitNecessary = true;
314    }
315    /**
316    * @param replaceSearchTree specifies whether to replace the search tree in the log file after each run or append the new search tree.
317    * mandatory: false| reinit necessary: true
318    * default value: false
319    **/
320    public void setReplaceSearchTree(boolean replaceSearchTree) {
321    ComponentManager.getInstance().applyConfigEntry(rOLearner, "replaceSearchTree", replaceSearchTree);
322    reinitNecessary = true;
323    }
324    /**
325    * @param heuristic specifiy the heuristic to use.
326    * mandatory: false| reinit necessary: true
327    * default value: lexicographic
328    **/
329    public void setHeuristic(String heuristic) {
330    ComponentManager.getInstance().applyConfigEntry(rOLearner, "heuristic", heuristic);
331    reinitNecessary = true;
332    }
333    /**
334    * @param applyAllFilter usage of equivalence ALL R.C AND ALL R.D = ALL R.(C AND D).
335    * mandatory: false| reinit necessary: true
336    * default value: true
337    **/
338    public void setApplyAllFilter(boolean applyAllFilter) {
339    ComponentManager.getInstance().applyConfigEntry(rOLearner, "applyAllFilter", applyAllFilter);
340    reinitNecessary = true;
341    }
342    /**
343    * @param applyExistsFilter usage of equivalence EXISTS R.C OR EXISTS R.D = EXISTS R.(C OR D).
344    * mandatory: false| reinit necessary: true
345    * default value: true
346    **/
347    public void setApplyExistsFilter(boolean applyExistsFilter) {
348    ComponentManager.getInstance().applyConfigEntry(rOLearner, "applyExistsFilter", applyExistsFilter);
349    reinitNecessary = true;
350    }
351    /**
352    * @param useTooWeakList try to filter out too weak concepts without sending them to the reasoner.
353    * mandatory: false| reinit necessary: true
354    * default value: true
355    **/
356    public void setUseTooWeakList(boolean useTooWeakList) {
357    ComponentManager.getInstance().applyConfigEntry(rOLearner, "useTooWeakList", useTooWeakList);
358    reinitNecessary = true;
359    }
360    /**
361    * @param useOverlyGeneralList try to find overly general concept without sending them to the reasoner.
362    * mandatory: false| reinit necessary: true
363    * default value: true
364    **/
365    public void setUseOverlyGeneralList(boolean useOverlyGeneralList) {
366    ComponentManager.getInstance().applyConfigEntry(rOLearner, "useOverlyGeneralList", useOverlyGeneralList);
367    reinitNecessary = true;
368    }
369    /**
370    * @param useShortConceptConstruction shorten concept to see whether they already exist.
371    * mandatory: false| reinit necessary: true
372    * default value: true
373    **/
374    public void setUseShortConceptConstruction(boolean useShortConceptConstruction) {
375    ComponentManager.getInstance().applyConfigEntry(rOLearner, "useShortConceptConstruction", useShortConceptConstruction);
376    reinitNecessary = true;
377    }
378    /**
379    * @param horizontalExpansionFactor horizontal expansion factor (see publication for description).
380    * mandatory: false| reinit necessary: true
381    * default value: 0.6
382    **/
383    public void setHorizontalExpansionFactor(double horizontalExpansionFactor) {
384    ComponentManager.getInstance().applyConfigEntry(rOLearner, "horizontalExpansionFactor", horizontalExpansionFactor);
385    reinitNecessary = true;
386    }
387    /**
388    * @param improveSubsumptionHierarchy simplify subsumption hierarchy to reduce search space (see publication for description).
389    * mandatory: false| reinit necessary: true
390    * default value: true
391    **/
392    public void setImproveSubsumptionHierarchy(boolean improveSubsumptionHierarchy) {
393    ComponentManager.getInstance().applyConfigEntry(rOLearner, "improveSubsumptionHierarchy", improveSubsumptionHierarchy);
394    reinitNecessary = true;
395    }
396    /**
397    * @param quiet may be deprecated soon.
398    * mandatory: false| reinit necessary: true
399    * default value: false
400    **/
401    public void setQuiet(boolean quiet) {
402    ComponentManager.getInstance().applyConfigEntry(rOLearner, "quiet", quiet);
403    reinitNecessary = true;
404    }
405    /**
406    * @param allowedConcepts concepts the algorithm is allowed to use.
407    * mandatory: false| reinit necessary: true
408    * default value: null
409    **/
410    public void setAllowedConcepts(Set<String> allowedConcepts) {
411    ComponentManager.getInstance().applyConfigEntry(rOLearner, "allowedConcepts", allowedConcepts);
412    reinitNecessary = true;
413    }
414    /**
415    * @param ignoredConcepts concepts the algorithm must ignore.
416    * mandatory: false| reinit necessary: true
417    * default value: null
418    **/
419    public void setIgnoredConcepts(Set<String> ignoredConcepts) {
420    ComponentManager.getInstance().applyConfigEntry(rOLearner, "ignoredConcepts", ignoredConcepts);
421    reinitNecessary = true;
422    }
423    /**
424    * @param allowedRoles roles the algorithm is allowed to use.
425    * mandatory: false| reinit necessary: true
426    * default value: null
427    **/
428    public void setAllowedRoles(Set<String> allowedRoles) {
429    ComponentManager.getInstance().applyConfigEntry(rOLearner, "allowedRoles", allowedRoles);
430    reinitNecessary = true;
431    }
432    /**
433    * @param ignoredRoles roles the algorithm must ignore.
434    * mandatory: false| reinit necessary: true
435    * default value: null
436    **/
437    public void setIgnoredRoles(Set<String> ignoredRoles) {
438    ComponentManager.getInstance().applyConfigEntry(rOLearner, "ignoredRoles", ignoredRoles);
439    reinitNecessary = true;
440    }
441    /**
442    * @param useAllConstructor specifies whether the universal concept constructor is used in the learning algorithm.
443    * mandatory: false| reinit necessary: true
444    * default value: true
445    **/
446    public void setUseAllConstructor(boolean useAllConstructor) {
447    ComponentManager.getInstance().applyConfigEntry(rOLearner, "useAllConstructor", useAllConstructor);
448    reinitNecessary = true;
449    }
450    /**
451    * @param useExistsConstructor specifies whether the existential concept constructor is used in the learning algorithm.
452    * mandatory: false| reinit necessary: true
453    * default value: true
454    **/
455    public void setUseExistsConstructor(boolean useExistsConstructor) {
456    ComponentManager.getInstance().applyConfigEntry(rOLearner, "useExistsConstructor", useExistsConstructor);
457    reinitNecessary = true;
458    }
459    /**
460    * @param useNegation specifies whether negation is used in the learning algorothm.
461    * mandatory: false| reinit necessary: true
462    * default value: true
463    **/
464    public void setUseNegation(boolean useNegation) {
465    ComponentManager.getInstance().applyConfigEntry(rOLearner, "useNegation", useNegation);
466    reinitNecessary = true;
467    }
468    /**
469    * @param useCardinalityRestrictions specifies whether CardinalityRestrictions is used in the learning algorithm.
470    * mandatory: false| reinit necessary: true
471    * default value: true
472    **/
473    public void setUseCardinalityRestrictions(boolean useCardinalityRestrictions) {
474    ComponentManager.getInstance().applyConfigEntry(rOLearner, "useCardinalityRestrictions", useCardinalityRestrictions);
475    reinitNecessary = true;
476    }
477    /**
478    * @param useBooleanDatatypes specifies whether boolean datatypes are used in the learning algorothm.
479    * mandatory: false| reinit necessary: true
480    * default value: true
481    **/
482    public void setUseBooleanDatatypes(boolean useBooleanDatatypes) {
483    ComponentManager.getInstance().applyConfigEntry(rOLearner, "useBooleanDatatypes", useBooleanDatatypes);
484    reinitNecessary = true;
485    }
486    /**
487    * @param maxExecutionTimeInSeconds algorithm will stop after specified seconds.
488    * mandatory: false| reinit necessary: true
489    * default value: 0
490    **/
491    public void setMaxExecutionTimeInSeconds(int maxExecutionTimeInSeconds) {
492    ComponentManager.getInstance().applyConfigEntry(rOLearner, "maxExecutionTimeInSeconds", maxExecutionTimeInSeconds);
493    reinitNecessary = true;
494    }
495    /**
496    * @param minExecutionTimeInSeconds algorithm will run at least specified seconds.
497    * mandatory: false| reinit necessary: true
498    * default value: 0
499    **/
500    public void setMinExecutionTimeInSeconds(int minExecutionTimeInSeconds) {
501    ComponentManager.getInstance().applyConfigEntry(rOLearner, "minExecutionTimeInSeconds", minExecutionTimeInSeconds);
502    reinitNecessary = true;
503    }
504    /**
505    * @param guaranteeXgoodDescriptions algorithm will run until X good (100%) concept descritpions are found.
506    * mandatory: false| reinit necessary: true
507    * default value: 1
508    **/
509    public void setGuaranteeXgoodDescriptions(int guaranteeXgoodDescriptions) {
510    ComponentManager.getInstance().applyConfigEntry(rOLearner, "guaranteeXgoodDescriptions", guaranteeXgoodDescriptions);
511    reinitNecessary = true;
512    }
513    /**
514    * @param logLevel determines the logLevel for this component, can be {TRACE, DEBUG, INFO}.
515    * mandatory: false| reinit necessary: true
516    * default value: DEBUG
517    **/
518    public void setLogLevel(String logLevel) {
519    ComponentManager.getInstance().applyConfigEntry(rOLearner, "logLevel", logLevel);
520    reinitNecessary = true;
521    }
522    /**
523    * @param instanceBasedDisjoints Specifies whether to use real disjointness checks or instance based ones (no common instances) in the refinement operator..
524    * mandatory: false| reinit necessary: true
525    * default value: true
526    **/
527    public void setInstanceBasedDisjoints(boolean instanceBasedDisjoints) {
528    ComponentManager.getInstance().applyConfigEntry(rOLearner, "instanceBasedDisjoints", instanceBasedDisjoints);
529    reinitNecessary = true;
530    }
531    
532    /**
533    * true, if this component needs reinitializsation.
534    * @return boolean
535    **/
536    public boolean isReinitNecessary(){
537    return reinitNecessary;
538    }
539    
540    
541    }