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.celoe.CELOE;
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 CELOEConfigurator extends RefinementOperatorConfigurator implements Configurator {
036
037 private boolean reinitNecessary = false;
038 private CELOE cELOE;
039
040 /**
041 * @param cELOE see CELOE
042 **/
043 public CELOEConfigurator(CELOE cELOE){
044 this.cELOE = cELOE;
045 }
046
047 /**
048 * @param reasoningService see reasoningService
049 * @param learningProblem see learningProblem
050 * @throws LearningProblemUnsupportedException see
051 * @return CELOE
052 **/
053 public static CELOE getCELOE(AbstractLearningProblem learningProblem, AbstractReasonerComponent reasoningService) throws LearningProblemUnsupportedException{
054 CELOE component = ComponentManager.getInstance().learningAlgorithm(CELOE.class, learningProblem, reasoningService);
055 return component;
056 }
057
058 /**
059 * useAllConstructor specifies whether the universal concept constructor is used in the learning algorithm.
060 * mandatory: false| reinit necessary: true
061 * default value: true
062 * @return boolean
063 **/
064 public boolean getUseAllConstructor() {
065 return (Boolean) ComponentManager.getInstance().getConfigOptionValue(cELOE, "useAllConstructor") ;
066 }
067 /**
068 * useExistsConstructor specifies whether the existential concept constructor is used in the learning algorithm.
069 * mandatory: false| reinit necessary: true
070 * default value: true
071 * @return boolean
072 **/
073 public boolean getUseExistsConstructor() {
074 return (Boolean) ComponentManager.getInstance().getConfigOptionValue(cELOE, "useExistsConstructor") ;
075 }
076 /**
077 * useHasValueConstructor specifies whether the hasValue constructor is used in the learning algorithm.
078 * mandatory: false| reinit necessary: true
079 * default value: false
080 * @return boolean
081 **/
082 public boolean getUseHasValueConstructor() {
083 return (Boolean) ComponentManager.getInstance().getConfigOptionValue(cELOE, "useHasValueConstructor") ;
084 }
085 /**
086 * useDataHasValueConstructor specifies whether the hasValue constructor is used in the learning algorithm in combination with data properties.
087 * mandatory: false| reinit necessary: true
088 * default value: false
089 * @return boolean
090 **/
091 public boolean getUseDataHasValueConstructor() {
092 return (Boolean) ComponentManager.getInstance().getConfigOptionValue(cELOE, "useDataHasValueConstructor") ;
093 }
094 /**
095 * valueFrequencyThreshold specifies how often an object must occur as value in order to be considered for hasValue restrictions.
096 * mandatory: false| reinit necessary: true
097 * default value: 3
098 * @return int
099 **/
100 public int getValueFrequencyThreshold() {
101 return (Integer) ComponentManager.getInstance().getConfigOptionValue(cELOE, "valueFrequencyThreshold") ;
102 }
103 /**
104 * useCardinalityRestrictions specifies whether CardinalityRestrictions is used in the learning algorithm.
105 * mandatory: false| reinit necessary: true
106 * default value: true
107 * @return boolean
108 **/
109 public boolean getUseCardinalityRestrictions() {
110 return (Boolean) ComponentManager.getInstance().getConfigOptionValue(cELOE, "useCardinalityRestrictions") ;
111 }
112 /**
113 * cardinalityLimit Gives the maximum number used in cardinality restrictions..
114 * mandatory: false| reinit necessary: true
115 * default value: 5
116 * @return int
117 **/
118 public int getCardinalityLimit() {
119 return (Integer) ComponentManager.getInstance().getConfigOptionValue(cELOE, "cardinalityLimit") ;
120 }
121 /**
122 * useNegation specifies whether negation is used in the learning algorothm.
123 * mandatory: false| reinit necessary: true
124 * default value: false
125 * @return boolean
126 **/
127 public boolean getUseNegation() {
128 return (Boolean) ComponentManager.getInstance().getConfigOptionValue(cELOE, "useNegation") ;
129 }
130 /**
131 * useBooleanDatatypes specifies whether boolean datatypes are used in the learning algorothm.
132 * mandatory: false| reinit necessary: true
133 * default value: true
134 * @return boolean
135 **/
136 public boolean getUseBooleanDatatypes() {
137 return (Boolean) ComponentManager.getInstance().getConfigOptionValue(cELOE, "useBooleanDatatypes") ;
138 }
139 /**
140 * useDoubleDatatypes specifies whether double datatypes are used in the learning algorothm.
141 * mandatory: false| reinit necessary: true
142 * default value: true
143 * @return boolean
144 **/
145 public boolean getUseDoubleDatatypes() {
146 return (Boolean) ComponentManager.getInstance().getConfigOptionValue(cELOE, "useDoubleDatatypes") ;
147 }
148 /**
149 * maxExecutionTimeInSeconds algorithm will stop after specified seconds.
150 * mandatory: false| reinit necessary: true
151 * default value: 10
152 * @return int
153 **/
154 public int getMaxExecutionTimeInSeconds() {
155 return (Integer) ComponentManager.getInstance().getConfigOptionValue(cELOE, "maxExecutionTimeInSeconds") ;
156 }
157 /**
158 * noisePercentage the (approximated) percentage of noise within the examples.
159 * mandatory: false| reinit necessary: true
160 * default value: 0.0
161 * @return double
162 **/
163 public double getNoisePercentage() {
164 return (Double) ComponentManager.getInstance().getConfigOptionValue(cELOE, "noisePercentage") ;
165 }
166 /**
167 * terminateOnNoiseReached specifies whether to terminate when noise criterion is met.
168 * mandatory: false| reinit necessary: true
169 * default value: false
170 * @return boolean
171 **/
172 public boolean getTerminateOnNoiseReached() {
173 return (Boolean) ComponentManager.getInstance().getConfigOptionValue(cELOE, "terminateOnNoiseReached") ;
174 }
175 /**
176 * maxDepth maximum depth of description.
177 * mandatory: false| reinit necessary: true
178 * default value: 7
179 * @return int
180 **/
181 public int getMaxDepth() {
182 return (Integer) ComponentManager.getInstance().getConfigOptionValue(cELOE, "maxDepth") ;
183 }
184 /**
185 * maxNrOfResults Sets the maximum number of results one is interested in. (Setting this to a lower value may increase performance as the learning algorithm has to store/evaluate/beautify less descriptions)..
186 * mandatory: false| reinit necessary: true
187 * default value: 10
188 * @return int
189 **/
190 public int getMaxNrOfResults() {
191 return (Integer) ComponentManager.getInstance().getConfigOptionValue(cELOE, "maxNrOfResults") ;
192 }
193 /**
194 * maxClassDescriptionTests The maximum number of candidate hypothesis the algorithm is allowed to test (0 = no limit). The algorithm will stop afterwards. (The real number of tests can be slightly higher, because this criterion usually won't be checked after each single test.).
195 * mandatory: false| reinit necessary: true
196 * default value: 0
197 * @return int
198 **/
199 public int getMaxClassDescriptionTests() {
200 return (Integer) ComponentManager.getInstance().getConfigOptionValue(cELOE, "maxClassDescriptionTests") ;
201 }
202 /**
203 * singleSuggestionMode Use this if you are interested in only one suggestion and your learning problem has many (more than 1000) examples..
204 * mandatory: false| reinit necessary: true
205 * default value: false
206 * @return boolean
207 **/
208 public boolean getSingleSuggestionMode() {
209 return (Boolean) ComponentManager.getInstance().getConfigOptionValue(cELOE, "singleSuggestionMode") ;
210 }
211 /**
212 * instanceBasedDisjoints Specifies whether to use real disjointness checks or instance based ones (no common instances) in the refinement operator..
213 * mandatory: false| reinit necessary: true
214 * default value: true
215 * @return boolean
216 **/
217 public boolean getInstanceBasedDisjoints() {
218 return (Boolean) ComponentManager.getInstance().getConfigOptionValue(cELOE, "instanceBasedDisjoints") ;
219 }
220 /**
221 * filterDescriptionsFollowingFromKB If true, then the results will not contain suggestions, which already follow logically from the knowledge base. Be careful, since this requires a potentially expensive consistency check for candidate solutions..
222 * mandatory: false| reinit necessary: true
223 * default value: false
224 * @return boolean
225 **/
226 public boolean getFilterDescriptionsFollowingFromKB() {
227 return (Boolean) ComponentManager.getInstance().getConfigOptionValue(cELOE, "filterDescriptionsFollowingFromKB") ;
228 }
229 /**
230 * reuseExistingDescription If true, the algorithm tries to find a good starting point close to an existing definition/super class of the given class in the knowledge base..
231 * mandatory: false| reinit necessary: true
232 * default value: false
233 * @return boolean
234 **/
235 public boolean getReuseExistingDescription() {
236 return (Boolean) ComponentManager.getInstance().getConfigOptionValue(cELOE, "reuseExistingDescription") ;
237 }
238 /**
239 * writeSearchTree specifies whether to write a search tree.
240 * mandatory: false| reinit necessary: true
241 * default value: false
242 * @return boolean
243 **/
244 public boolean getWriteSearchTree() {
245 return (Boolean) ComponentManager.getInstance().getConfigOptionValue(cELOE, "writeSearchTree") ;
246 }
247 /**
248 * searchTreeFile file to use for the search tree.
249 * mandatory: false| reinit necessary: true
250 * default value: log/searchTree.txt
251 * @return String
252 **/
253 public String getSearchTreeFile() {
254 return (String) ComponentManager.getInstance().getConfigOptionValue(cELOE, "searchTreeFile") ;
255 }
256 /**
257 * replaceSearchTree specifies whether to replace the search tree in the log file after each run or append the new search tree.
258 * mandatory: false| reinit necessary: true
259 * default value: false
260 * @return boolean
261 **/
262 public boolean getReplaceSearchTree() {
263 return (Boolean) ComponentManager.getInstance().getConfigOptionValue(cELOE, "replaceSearchTree") ;
264 }
265 /**
266 * expansionPenaltyFactor heuristic penalty per syntactic construct used (lower = finds more complex expression, but might miss simple ones).
267 * mandatory: false| reinit necessary: true
268 * default value: 0.1
269 * @return double
270 **/
271 public double getExpansionPenaltyFactor() {
272 return (Double) ComponentManager.getInstance().getConfigOptionValue(cELOE, "expansionPenaltyFactor") ;
273 }
274 /**
275 * allowedConcepts concepts the algorithm is allowed to use.
276 * mandatory: false| reinit necessary: true
277 * default value: null
278 * @return Set(String)
279 **/
280 @SuppressWarnings("unchecked")
281 public Set<String> getAllowedConcepts() {
282 return (Set<String>) ComponentManager.getInstance().getConfigOptionValue(cELOE, "allowedConcepts") ;
283 }
284 /**
285 * ignoredConcepts concepts the algorithm must ignore.
286 * mandatory: false| reinit necessary: true
287 * default value: null
288 * @return Set(String)
289 **/
290 @SuppressWarnings("unchecked")
291 public Set<String> getIgnoredConcepts() {
292 return (Set<String>) ComponentManager.getInstance().getConfigOptionValue(cELOE, "ignoredConcepts") ;
293 }
294
295 /**
296 * @param useAllConstructor specifies whether the universal concept constructor is used in the learning algorithm.
297 * mandatory: false| reinit necessary: true
298 * default value: true
299 **/
300 public void setUseAllConstructor(boolean useAllConstructor) {
301 ComponentManager.getInstance().applyConfigEntry(cELOE, "useAllConstructor", useAllConstructor);
302 reinitNecessary = true;
303 }
304 /**
305 * @param useExistsConstructor specifies whether the existential concept constructor is used in the learning algorithm.
306 * mandatory: false| reinit necessary: true
307 * default value: true
308 **/
309 public void setUseExistsConstructor(boolean useExistsConstructor) {
310 ComponentManager.getInstance().applyConfigEntry(cELOE, "useExistsConstructor", useExistsConstructor);
311 reinitNecessary = true;
312 }
313 /**
314 * @param useHasValueConstructor specifies whether the hasValue constructor is used in the learning algorithm.
315 * mandatory: false| reinit necessary: true
316 * default value: false
317 **/
318 public void setUseHasValueConstructor(boolean useHasValueConstructor) {
319 ComponentManager.getInstance().applyConfigEntry(cELOE, "useHasValueConstructor", useHasValueConstructor);
320 reinitNecessary = true;
321 }
322 /**
323 * @param useDataHasValueConstructor specifies whether the hasValue constructor is used in the learning algorithm in combination with data properties.
324 * mandatory: false| reinit necessary: true
325 * default value: false
326 **/
327 public void setUseDataHasValueConstructor(boolean useDataHasValueConstructor) {
328 ComponentManager.getInstance().applyConfigEntry(cELOE, "useDataHasValueConstructor", useDataHasValueConstructor);
329 reinitNecessary = true;
330 }
331 /**
332 * @param valueFrequencyThreshold specifies how often an object must occur as value in order to be considered for hasValue restrictions.
333 * mandatory: false| reinit necessary: true
334 * default value: 3
335 **/
336 public void setValueFrequencyThreshold(int valueFrequencyThreshold) {
337 ComponentManager.getInstance().applyConfigEntry(cELOE, "valueFrequencyThreshold", valueFrequencyThreshold);
338 reinitNecessary = true;
339 }
340 /**
341 * @param useCardinalityRestrictions specifies whether CardinalityRestrictions is used in the learning algorithm.
342 * mandatory: false| reinit necessary: true
343 * default value: true
344 **/
345 public void setUseCardinalityRestrictions(boolean useCardinalityRestrictions) {
346 ComponentManager.getInstance().applyConfigEntry(cELOE, "useCardinalityRestrictions", useCardinalityRestrictions);
347 reinitNecessary = true;
348 }
349 /**
350 * @param cardinalityLimit Gives the maximum number used in cardinality restrictions..
351 * mandatory: false| reinit necessary: true
352 * default value: 5
353 **/
354 public void setCardinalityLimit(int cardinalityLimit) {
355 ComponentManager.getInstance().applyConfigEntry(cELOE, "cardinalityLimit", cardinalityLimit);
356 reinitNecessary = true;
357 }
358 /**
359 * @param useNegation specifies whether negation is used in the learning algorothm.
360 * mandatory: false| reinit necessary: true
361 * default value: false
362 **/
363 public void setUseNegation(boolean useNegation) {
364 ComponentManager.getInstance().applyConfigEntry(cELOE, "useNegation", useNegation);
365 reinitNecessary = true;
366 }
367 /**
368 * @param useBooleanDatatypes specifies whether boolean datatypes are used in the learning algorothm.
369 * mandatory: false| reinit necessary: true
370 * default value: true
371 **/
372 public void setUseBooleanDatatypes(boolean useBooleanDatatypes) {
373 ComponentManager.getInstance().applyConfigEntry(cELOE, "useBooleanDatatypes", useBooleanDatatypes);
374 reinitNecessary = true;
375 }
376 /**
377 * @param useDoubleDatatypes specifies whether double datatypes are used in the learning algorothm.
378 * mandatory: false| reinit necessary: true
379 * default value: true
380 **/
381 public void setUseDoubleDatatypes(boolean useDoubleDatatypes) {
382 ComponentManager.getInstance().applyConfigEntry(cELOE, "useDoubleDatatypes", useDoubleDatatypes);
383 reinitNecessary = true;
384 }
385 /**
386 * @param maxExecutionTimeInSeconds algorithm will stop after specified seconds.
387 * mandatory: false| reinit necessary: true
388 * default value: 10
389 **/
390 public void setMaxExecutionTimeInSeconds(int maxExecutionTimeInSeconds) {
391 ComponentManager.getInstance().applyConfigEntry(cELOE, "maxExecutionTimeInSeconds", maxExecutionTimeInSeconds);
392 reinitNecessary = true;
393 }
394 /**
395 * @param noisePercentage the (approximated) percentage of noise within the examples.
396 * mandatory: false| reinit necessary: true
397 * default value: 0.0
398 **/
399 public void setNoisePercentage(double noisePercentage) {
400 ComponentManager.getInstance().applyConfigEntry(cELOE, "noisePercentage", noisePercentage);
401 reinitNecessary = true;
402 }
403 /**
404 * @param terminateOnNoiseReached specifies whether to terminate when noise criterion is met.
405 * mandatory: false| reinit necessary: true
406 * default value: false
407 **/
408 public void setTerminateOnNoiseReached(boolean terminateOnNoiseReached) {
409 ComponentManager.getInstance().applyConfigEntry(cELOE, "terminateOnNoiseReached", terminateOnNoiseReached);
410 reinitNecessary = true;
411 }
412 /**
413 * @param maxDepth maximum depth of description.
414 * mandatory: false| reinit necessary: true
415 * default value: 7
416 **/
417 public void setMaxDepth(int maxDepth) {
418 ComponentManager.getInstance().applyConfigEntry(cELOE, "maxDepth", maxDepth);
419 reinitNecessary = true;
420 }
421 /**
422 * @param maxNrOfResults Sets the maximum number of results one is interested in. (Setting this to a lower value may increase performance as the learning algorithm has to store/evaluate/beautify less descriptions)..
423 * mandatory: false| reinit necessary: true
424 * default value: 10
425 **/
426 public void setMaxNrOfResults(int maxNrOfResults) {
427 ComponentManager.getInstance().applyConfigEntry(cELOE, "maxNrOfResults", maxNrOfResults);
428 reinitNecessary = true;
429 }
430 /**
431 * @param maxClassDescriptionTests The maximum number of candidate hypothesis the algorithm is allowed to test (0 = no limit). The algorithm will stop afterwards. (The real number of tests can be slightly higher, because this criterion usually won't be checked after each single test.).
432 * mandatory: false| reinit necessary: true
433 * default value: 0
434 **/
435 public void setMaxClassDescriptionTests(int maxClassDescriptionTests) {
436 ComponentManager.getInstance().applyConfigEntry(cELOE, "maxClassDescriptionTests", maxClassDescriptionTests);
437 reinitNecessary = true;
438 }
439 /**
440 * @param singleSuggestionMode Use this if you are interested in only one suggestion and your learning problem has many (more than 1000) examples..
441 * mandatory: false| reinit necessary: true
442 * default value: false
443 **/
444 public void setSingleSuggestionMode(boolean singleSuggestionMode) {
445 ComponentManager.getInstance().applyConfigEntry(cELOE, "singleSuggestionMode", singleSuggestionMode);
446 reinitNecessary = true;
447 }
448 /**
449 * @param instanceBasedDisjoints Specifies whether to use real disjointness checks or instance based ones (no common instances) in the refinement operator..
450 * mandatory: false| reinit necessary: true
451 * default value: true
452 **/
453 public void setInstanceBasedDisjoints(boolean instanceBasedDisjoints) {
454 ComponentManager.getInstance().applyConfigEntry(cELOE, "instanceBasedDisjoints", instanceBasedDisjoints);
455 reinitNecessary = true;
456 }
457 /**
458 * @param filterDescriptionsFollowingFromKB If true, then the results will not contain suggestions, which already follow logically from the knowledge base. Be careful, since this requires a potentially expensive consistency check for candidate solutions..
459 * mandatory: false| reinit necessary: true
460 * default value: false
461 **/
462 public void setFilterDescriptionsFollowingFromKB(boolean filterDescriptionsFollowingFromKB) {
463 ComponentManager.getInstance().applyConfigEntry(cELOE, "filterDescriptionsFollowingFromKB", filterDescriptionsFollowingFromKB);
464 reinitNecessary = true;
465 }
466 /**
467 * @param reuseExistingDescription If true, the algorithm tries to find a good starting point close to an existing definition/super class of the given class in the knowledge base..
468 * mandatory: false| reinit necessary: true
469 * default value: false
470 **/
471 public void setReuseExistingDescription(boolean reuseExistingDescription) {
472 ComponentManager.getInstance().applyConfigEntry(cELOE, "reuseExistingDescription", reuseExistingDescription);
473 reinitNecessary = true;
474 }
475 /**
476 * @param writeSearchTree specifies whether to write a search tree.
477 * mandatory: false| reinit necessary: true
478 * default value: false
479 **/
480 public void setWriteSearchTree(boolean writeSearchTree) {
481 ComponentManager.getInstance().applyConfigEntry(cELOE, "writeSearchTree", writeSearchTree);
482 reinitNecessary = true;
483 }
484 /**
485 * @param searchTreeFile file to use for the search tree.
486 * mandatory: false| reinit necessary: true
487 * default value: log/searchTree.txt
488 **/
489 public void setSearchTreeFile(String searchTreeFile) {
490 ComponentManager.getInstance().applyConfigEntry(cELOE, "searchTreeFile", searchTreeFile);
491 reinitNecessary = true;
492 }
493 /**
494 * @param replaceSearchTree specifies whether to replace the search tree in the log file after each run or append the new search tree.
495 * mandatory: false| reinit necessary: true
496 * default value: false
497 **/
498 public void setReplaceSearchTree(boolean replaceSearchTree) {
499 ComponentManager.getInstance().applyConfigEntry(cELOE, "replaceSearchTree", replaceSearchTree);
500 reinitNecessary = true;
501 }
502 /**
503 * @param expansionPenaltyFactor heuristic penalty per syntactic construct used (lower = finds more complex expression, but might miss simple ones).
504 * mandatory: false| reinit necessary: true
505 * default value: 0.1
506 **/
507 public void setExpansionPenaltyFactor(double expansionPenaltyFactor) {
508 ComponentManager.getInstance().applyConfigEntry(cELOE, "expansionPenaltyFactor", expansionPenaltyFactor);
509 reinitNecessary = true;
510 }
511 /**
512 * @param allowedConcepts concepts the algorithm is allowed to use.
513 * mandatory: false| reinit necessary: true
514 * default value: null
515 **/
516 public void setAllowedConcepts(Set<String> allowedConcepts) {
517 ComponentManager.getInstance().applyConfigEntry(cELOE, "allowedConcepts", allowedConcepts);
518 reinitNecessary = true;
519 }
520 /**
521 * @param ignoredConcepts concepts the algorithm must ignore.
522 * mandatory: false| reinit necessary: true
523 * default value: null
524 **/
525 public void setIgnoredConcepts(Set<String> ignoredConcepts) {
526 ComponentManager.getInstance().applyConfigEntry(cELOE, "ignoredConcepts", ignoredConcepts);
527 reinitNecessary = true;
528 }
529
530 /**
531 * true, if this component needs reinitializsation.
532 * @return boolean
533 **/
534 public boolean isReinitNecessary(){
535 return reinitNecessary;
536 }
537
538
539 }