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.net.URL;
023 import org.dllearner.core.ComponentManager;
024 import org.dllearner.core.AbstractReasonerComponent;
025 import org.dllearner.learningproblems.ClassLearningProblem;
026
027 /**
028 * automatically generated, do not edit manually.
029 * run org.dllearner.scripts.ConfigJavaGenerator to update
030 **/
031 public class ClassLearningProblemConfigurator implements Configurator {
032
033 private boolean reinitNecessary = false;
034 private ClassLearningProblem classLearningProblem;
035
036 /**
037 * @param classLearningProblem see ClassLearningProblem
038 **/
039 public ClassLearningProblemConfigurator(ClassLearningProblem classLearningProblem){
040 this.classLearningProblem = classLearningProblem;
041 }
042
043 /**
044 * @param reasoningService see reasoningService
045 * @param classToDescribe class of which a description should be learned
046 * @return ClassLearningProblem
047 **/
048 public static ClassLearningProblem getClassLearningProblem(AbstractReasonerComponent reasoningService, URL classToDescribe) {
049 ClassLearningProblem component = ComponentManager.getInstance().learningProblem(ClassLearningProblem.class, reasoningService);
050 ComponentManager.getInstance().applyConfigEntry(component, "classToDescribe", classToDescribe);
051 return component;
052 }
053
054 /**
055 * classToDescribe class of which a description should be learned.
056 * mandatory: true| reinit necessary: false
057 * default value: null
058 * @return URL
059 **/
060 public URL getClassToDescribe() {
061 return (URL) ComponentManager.getInstance().getConfigOptionValue(classLearningProblem, "classToDescribe") ;
062 }
063 /**
064 * type whether to learn an equivalence class or super class axiom.
065 * mandatory: false| reinit necessary: true
066 * default value: equivalence
067 * @return String
068 **/
069 public String getType() {
070 return (String) ComponentManager.getInstance().getConfigOptionValue(classLearningProblem, "type") ;
071 }
072 /**
073 * useApproximations whether to use stochastic approximations for computing accuracy.
074 * mandatory: false| reinit necessary: true
075 * default value: true
076 * @return boolean
077 **/
078 public boolean getUseApproximations() {
079 return (Boolean) ComponentManager.getInstance().getConfigOptionValue(classLearningProblem, "useApproximations") ;
080 }
081 /**
082 * approxAccuracy accuracy of the approximation (only for expert use).
083 * mandatory: false| reinit necessary: true
084 * default value: 0.05
085 * @return double
086 **/
087 public double getApproxAccuracy() {
088 return (Double) ComponentManager.getInstance().getConfigOptionValue(classLearningProblem, "approxAccuracy") ;
089 }
090 /**
091 * accuracyMethod Specifies, which method/function to use for computing accuracy..
092 * mandatory: false| reinit necessary: true
093 * default value: standard
094 * @return String
095 **/
096 public String getAccuracyMethod() {
097 return (String) ComponentManager.getInstance().getConfigOptionValue(classLearningProblem, "accuracyMethod") ;
098 }
099 /**
100 * checkConsistency Specify whether to check consistency for solution candidates. This is convenient for user interfaces, but can be performance intensive..
101 * mandatory: false| reinit necessary: true
102 * default value: true
103 * @return boolean
104 **/
105 public boolean getCheckConsistency() {
106 return (Boolean) ComponentManager.getInstance().getConfigOptionValue(classLearningProblem, "checkConsistency") ;
107 }
108 /**
109 * maxExecutionTimeInSeconds algorithm will stop after specified seconds.
110 * mandatory: false| reinit necessary: true
111 * default value: 10
112 * @return int
113 **/
114 public int getMaxExecutionTimeInSeconds() {
115 return (Integer) ComponentManager.getInstance().getConfigOptionValue(classLearningProblem, "maxExecutionTimeInSeconds") ;
116 }
117 /**
118 * betaSC Higher values of beta rate recall higher than precision or in other words, covering the instances of the class to describe is more important even at the cost of covering additional instances. The actual implementation depends on the selected heuristic. This values is used only for super class learning..
119 * mandatory: false| reinit necessary: true
120 * default value: 3.0
121 * @return double
122 **/
123 public double getBetaSC() {
124 return (Double) ComponentManager.getInstance().getConfigOptionValue(classLearningProblem, "betaSC") ;
125 }
126 /**
127 * betaEq Higher values of beta rate recall higher than precision or in other words, covering the instances of the class to describe is more important even at the cost of covering additional instances. The actual implementation depends on the selected heuristic. This values is used only for equivalence class learning..
128 * mandatory: false| reinit necessary: true
129 * default value: 1.0
130 * @return double
131 **/
132 public double getBetaEq() {
133 return (Double) ComponentManager.getInstance().getConfigOptionValue(classLearningProblem, "betaEq") ;
134 }
135
136 /**
137 * @param classToDescribe class of which a description should be learned.
138 * mandatory: true| reinit necessary: false
139 * default value: null
140 **/
141 public void setClassToDescribe(URL classToDescribe) {
142 ComponentManager.getInstance().applyConfigEntry(classLearningProblem, "classToDescribe", classToDescribe);
143 }
144 /**
145 * @param type whether to learn an equivalence class or super class axiom.
146 * mandatory: false| reinit necessary: true
147 * default value: equivalence
148 **/
149 public void setType(String type) {
150 ComponentManager.getInstance().applyConfigEntry(classLearningProblem, "type", type);
151 reinitNecessary = true;
152 }
153 /**
154 * @param useApproximations whether to use stochastic approximations for computing accuracy.
155 * mandatory: false| reinit necessary: true
156 * default value: true
157 **/
158 public void setUseApproximations(boolean useApproximations) {
159 ComponentManager.getInstance().applyConfigEntry(classLearningProblem, "useApproximations", useApproximations);
160 reinitNecessary = true;
161 }
162 /**
163 * @param approxAccuracy accuracy of the approximation (only for expert use).
164 * mandatory: false| reinit necessary: true
165 * default value: 0.05
166 **/
167 public void setApproxAccuracy(double approxAccuracy) {
168 ComponentManager.getInstance().applyConfigEntry(classLearningProblem, "approxAccuracy", approxAccuracy);
169 reinitNecessary = true;
170 }
171 /**
172 * @param accuracyMethod Specifies, which method/function to use for computing accuracy..
173 * mandatory: false| reinit necessary: true
174 * default value: standard
175 **/
176 public void setAccuracyMethod(String accuracyMethod) {
177 ComponentManager.getInstance().applyConfigEntry(classLearningProblem, "accuracyMethod", accuracyMethod);
178 reinitNecessary = true;
179 }
180 /**
181 * @param checkConsistency Specify whether to check consistency for solution candidates. This is convenient for user interfaces, but can be performance intensive..
182 * mandatory: false| reinit necessary: true
183 * default value: true
184 **/
185 public void setCheckConsistency(boolean checkConsistency) {
186 ComponentManager.getInstance().applyConfigEntry(classLearningProblem, "checkConsistency", checkConsistency);
187 reinitNecessary = true;
188 }
189 /**
190 * @param maxExecutionTimeInSeconds algorithm will stop after specified seconds.
191 * mandatory: false| reinit necessary: true
192 * default value: 10
193 **/
194 public void setMaxExecutionTimeInSeconds(int maxExecutionTimeInSeconds) {
195 ComponentManager.getInstance().applyConfigEntry(classLearningProblem, "maxExecutionTimeInSeconds", maxExecutionTimeInSeconds);
196 reinitNecessary = true;
197 }
198 /**
199 * @param betaSC Higher values of beta rate recall higher than precision or in other words, covering the instances of the class to describe is more important even at the cost of covering additional instances. The actual implementation depends on the selected heuristic. This values is used only for super class learning..
200 * mandatory: false| reinit necessary: true
201 * default value: 3.0
202 **/
203 public void setBetaSC(double betaSC) {
204 ComponentManager.getInstance().applyConfigEntry(classLearningProblem, "betaSC", betaSC);
205 reinitNecessary = true;
206 }
207 /**
208 * @param betaEq Higher values of beta rate recall higher than precision or in other words, covering the instances of the class to describe is more important even at the cost of covering additional instances. The actual implementation depends on the selected heuristic. This values is used only for equivalence class learning..
209 * mandatory: false| reinit necessary: true
210 * default value: 1.0
211 **/
212 public void setBetaEq(double betaEq) {
213 ComponentManager.getInstance().applyConfigEntry(classLearningProblem, "betaEq", betaEq);
214 reinitNecessary = true;
215 }
216
217 /**
218 * true, if this component needs reinitializsation.
219 * @return boolean
220 **/
221 public boolean isReinitNecessary(){
222 return reinitNecessary;
223 }
224
225
226 }