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.PosOnlyLP;
026
027 /**
028 * automatically generated, do not edit manually.
029 * run org.dllearner.scripts.ConfigJavaGenerator to update
030 **/
031 public class PosOnlyLPConfigurator implements Configurator {
032
033 private boolean reinitNecessary = false;
034 private PosOnlyLP posOnlyLP;
035
036 /**
037 * @param posOnlyLP see PosOnlyLP
038 **/
039 public PosOnlyLPConfigurator(PosOnlyLP posOnlyLP){
040 this.posOnlyLP = posOnlyLP;
041 }
042
043 /**
044 * @param reasoningService see reasoningService
045 * @param positiveExamples positive examples
046 * @return PosOnlyLP
047 **/
048 public static PosOnlyLP getPosOnlyLP(AbstractReasonerComponent reasoningService, Set<String> positiveExamples) {
049 PosOnlyLP component = ComponentManager.getInstance().learningProblem(PosOnlyLP.class, reasoningService);
050 ComponentManager.getInstance().applyConfigEntry(component, "positiveExamples", positiveExamples);
051 return component;
052 }
053
054 /**
055 * positiveExamples positive examples.
056 * mandatory: true| reinit necessary: false
057 * default value: null
058 * @return Set(String)
059 **/
060 @SuppressWarnings("unchecked")
061 public Set<String> getPositiveExamples() {
062 return (Set<String>) ComponentManager.getInstance().getConfigOptionValue(posOnlyLP, "positiveExamples") ;
063 }
064
065 /**
066 * @param positiveExamples positive examples.
067 * mandatory: true| reinit necessary: false
068 * default value: null
069 **/
070 public void setPositiveExamples(Set<String> positiveExamples) {
071 ComponentManager.getInstance().applyConfigEntry(posOnlyLP, "positiveExamples", positiveExamples);
072 }
073
074 /**
075 * true, if this component needs reinitializsation.
076 * @return boolean
077 **/
078 public boolean isReinitNecessary(){
079 return reinitNecessary;
080 }
081
082
083 }