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.core.ComponentManager;
024 import org.dllearner.core.AbstractReasonerComponent;
025 import org.dllearner.learningproblems.PosNegLPStandard;
026
027 /**
028 * automatically generated, do not edit manually.
029 * run org.dllearner.scripts.ConfigJavaGenerator to update
030 **/
031 public class PosNegLPStandardConfigurator implements Configurator {
032
033 private boolean reinitNecessary = false;
034 private PosNegLPStandard posNegLPStandard;
035
036 /**
037 * @param posNegLPStandard see PosNegLPStandard
038 **/
039 public PosNegLPStandardConfigurator(PosNegLPStandard posNegLPStandard){
040 this.posNegLPStandard = posNegLPStandard;
041 }
042
043 /**
044 * @param reasoningService see reasoningService
045 * @param positiveExamples positive examples
046 * @param negativeExamples negative examples
047 * @return PosNegLPStandard
048 **/
049 public static PosNegLPStandard getPosNegLPStandard(AbstractReasonerComponent reasoningService, Set<String> positiveExamples, Set<String> negativeExamples) {
050 PosNegLPStandard component = ComponentManager.getInstance().learningProblem(PosNegLPStandard.class, reasoningService);
051 ComponentManager.getInstance().applyConfigEntry(component, "positiveExamples", positiveExamples);
052 ComponentManager.getInstance().applyConfigEntry(component, "negativeExamples", negativeExamples);
053 return component;
054 }
055
056 /**
057 * positiveExamples positive examples.
058 * mandatory: true| reinit necessary: false
059 * default value: null
060 * @return Set(String)
061 **/
062 @SuppressWarnings("unchecked")
063 public Set<String> getPositiveExamples() {
064 return (Set<String>) ComponentManager.getInstance().getConfigOptionValue(posNegLPStandard, "positiveExamples") ;
065 }
066 /**
067 * negativeExamples negative examples.
068 * mandatory: true| reinit necessary: false
069 * default value: null
070 * @return Set(String)
071 **/
072 @SuppressWarnings("unchecked")
073 public Set<String> getNegativeExamples() {
074 return (Set<String>) ComponentManager.getInstance().getConfigOptionValue(posNegLPStandard, "negativeExamples") ;
075 }
076 /**
077 * useRetrievalForClassficiation Specifies whether to use retrieval or instance checks for testing a concept. - NO LONGER FULLY SUPPORTED..
078 * mandatory: false| reinit necessary: true
079 * default value: false
080 * @return boolean
081 **/
082 public boolean getUseRetrievalForClassficiation() {
083 return (Boolean) ComponentManager.getInstance().getConfigOptionValue(posNegLPStandard, "useRetrievalForClassficiation") ;
084 }
085 /**
086 * percentPerLenghtUnit describes the reduction in classification accuracy in percent one is willing to accept for reducing the length of the concept by one.
087 * mandatory: false| reinit necessary: true
088 * default value: 0.05
089 * @return double
090 **/
091 public double getPercentPerLenghtUnit() {
092 return (Double) ComponentManager.getInstance().getConfigOptionValue(posNegLPStandard, "percentPerLenghtUnit") ;
093 }
094 /**
095 * useMultiInstanceChecks See UseMultiInstanceChecks enum. - NO LONGER FULLY SUPPORTED..
096 * mandatory: false| reinit necessary: true
097 * default value: twoChecks
098 * @return String
099 **/
100 public String getUseMultiInstanceChecks() {
101 return (String) ComponentManager.getInstance().getConfigOptionValue(posNegLPStandard, "useMultiInstanceChecks") ;
102 }
103 /**
104 * useApproximations whether to use stochastic approximations for computing accuracy.
105 * mandatory: false| reinit necessary: true
106 * default value: false
107 * @return boolean
108 **/
109 public boolean getUseApproximations() {
110 return (Boolean) ComponentManager.getInstance().getConfigOptionValue(posNegLPStandard, "useApproximations") ;
111 }
112 /**
113 * approxAccuracy accuracy of the approximation (only for expert use).
114 * mandatory: false| reinit necessary: true
115 * default value: 0.05
116 * @return double
117 **/
118 public double getApproxAccuracy() {
119 return (Double) ComponentManager.getInstance().getConfigOptionValue(posNegLPStandard, "approxAccuracy") ;
120 }
121 /**
122 * accuracyMethod Specifies, which method/function to use for computing accuracy..
123 * mandatory: false| reinit necessary: true
124 * default value: predacc
125 * @return String
126 **/
127 public String getAccuracyMethod() {
128 return (String) ComponentManager.getInstance().getConfigOptionValue(posNegLPStandard, "accuracyMethod") ;
129 }
130
131 /**
132 * @param positiveExamples positive examples.
133 * mandatory: true| reinit necessary: false
134 * default value: null
135 **/
136 public void setPositiveExamples(Set<String> positiveExamples) {
137 ComponentManager.getInstance().applyConfigEntry(posNegLPStandard, "positiveExamples", positiveExamples);
138 }
139 /**
140 * @param negativeExamples negative examples.
141 * mandatory: true| reinit necessary: false
142 * default value: null
143 **/
144 public void setNegativeExamples(Set<String> negativeExamples) {
145 ComponentManager.getInstance().applyConfigEntry(posNegLPStandard, "negativeExamples", negativeExamples);
146 }
147 /**
148 * @param useRetrievalForClassficiation Specifies whether to use retrieval or instance checks for testing a concept. - NO LONGER FULLY SUPPORTED..
149 * mandatory: false| reinit necessary: true
150 * default value: false
151 **/
152 public void setUseRetrievalForClassficiation(boolean useRetrievalForClassficiation) {
153 ComponentManager.getInstance().applyConfigEntry(posNegLPStandard, "useRetrievalForClassficiation", useRetrievalForClassficiation);
154 reinitNecessary = true;
155 }
156 /**
157 * @param percentPerLenghtUnit describes the reduction in classification accuracy in percent one is willing to accept for reducing the length of the concept by one.
158 * mandatory: false| reinit necessary: true
159 * default value: 0.05
160 **/
161 public void setPercentPerLenghtUnit(double percentPerLenghtUnit) {
162 ComponentManager.getInstance().applyConfigEntry(posNegLPStandard, "percentPerLenghtUnit", percentPerLenghtUnit);
163 reinitNecessary = true;
164 }
165 /**
166 * @param useMultiInstanceChecks See UseMultiInstanceChecks enum. - NO LONGER FULLY SUPPORTED..
167 * mandatory: false| reinit necessary: true
168 * default value: twoChecks
169 **/
170 public void setUseMultiInstanceChecks(String useMultiInstanceChecks) {
171 ComponentManager.getInstance().applyConfigEntry(posNegLPStandard, "useMultiInstanceChecks", useMultiInstanceChecks);
172 reinitNecessary = true;
173 }
174 /**
175 * @param useApproximations whether to use stochastic approximations for computing accuracy.
176 * mandatory: false| reinit necessary: true
177 * default value: false
178 **/
179 public void setUseApproximations(boolean useApproximations) {
180 ComponentManager.getInstance().applyConfigEntry(posNegLPStandard, "useApproximations", useApproximations);
181 reinitNecessary = true;
182 }
183 /**
184 * @param approxAccuracy accuracy of the approximation (only for expert use).
185 * mandatory: false| reinit necessary: true
186 * default value: 0.05
187 **/
188 public void setApproxAccuracy(double approxAccuracy) {
189 ComponentManager.getInstance().applyConfigEntry(posNegLPStandard, "approxAccuracy", approxAccuracy);
190 reinitNecessary = true;
191 }
192 /**
193 * @param accuracyMethod Specifies, which method/function to use for computing accuracy..
194 * mandatory: false| reinit necessary: true
195 * default value: predacc
196 **/
197 public void setAccuracyMethod(String accuracyMethod) {
198 ComponentManager.getInstance().applyConfigEntry(posNegLPStandard, "accuracyMethod", accuracyMethod);
199 reinitNecessary = true;
200 }
201
202 /**
203 * true, if this component needs reinitializsation.
204 * @return boolean
205 **/
206 public boolean isReinitNecessary(){
207 return reinitNecessary;
208 }
209
210
211 }