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 org.dllearner.algorithms.BruteForceLearner;
023    import org.dllearner.core.ComponentManager;
024    import org.dllearner.core.AbstractLearningProblem;
025    import org.dllearner.core.LearningProblemUnsupportedException;
026    import org.dllearner.core.AbstractReasonerComponent;
027    
028    /**
029    * automatically generated, do not edit manually.
030    * run org.dllearner.scripts.ConfigJavaGenerator to update
031    **/
032    public  class BruteForceLearnerConfigurator  implements Configurator {
033    
034    private boolean reinitNecessary = false;
035    private BruteForceLearner bruteForceLearner;
036    
037    /**
038    * @param bruteForceLearner see BruteForceLearner
039    **/
040    public BruteForceLearnerConfigurator(BruteForceLearner bruteForceLearner){
041    this.bruteForceLearner = bruteForceLearner;
042    }
043    
044    /**
045    * @param reasoningService see reasoningService
046    * @param learningProblem see learningProblem
047    * @throws LearningProblemUnsupportedException see 
048    * @return BruteForceLearner
049    **/
050    public static BruteForceLearner getBruteForceLearner(AbstractLearningProblem learningProblem, AbstractReasonerComponent reasoningService) throws LearningProblemUnsupportedException{
051    BruteForceLearner component = ComponentManager.getInstance().learningAlgorithm(BruteForceLearner.class, learningProblem, reasoningService);
052    return component;
053    }
054    
055    /**
056    * maxLength maximum length of generated concepts.
057    * mandatory: false| reinit necessary: true
058    * default value: 7
059    * @return int 
060    **/
061    public int getMaxLength() {
062    return (Integer) ComponentManager.getInstance().getConfigOptionValue(bruteForceLearner,  "maxLength") ;
063    }
064    /**
065    * returnType Specifies the type which the solution has to belong to (if already) known. This means we inform the learning algorithm that the solution is a subclass of this type..
066    * mandatory: false| reinit necessary: true
067    * default value: null
068    * @return String 
069    **/
070    public String getReturnType() {
071    return (String) ComponentManager.getInstance().getConfigOptionValue(bruteForceLearner,  "returnType") ;
072    }
073    
074    /**
075    * @param maxLength maximum length of generated concepts.
076    * mandatory: false| reinit necessary: true
077    * default value: 7
078    **/
079    public void setMaxLength(int maxLength) {
080    ComponentManager.getInstance().applyConfigEntry(bruteForceLearner, "maxLength", maxLength);
081    reinitNecessary = true;
082    }
083    /**
084    * @param returnType Specifies the type which the solution has to belong to (if already) known. This means we inform the learning algorithm that the solution is a subclass of this type..
085    * mandatory: false| reinit necessary: true
086    * default value: null
087    **/
088    public void setReturnType(String returnType) {
089    ComponentManager.getInstance().applyConfigEntry(bruteForceLearner, "returnType", returnType);
090    reinitNecessary = true;
091    }
092    
093    /**
094    * true, if this component needs reinitializsation.
095    * @return boolean
096    **/
097    public boolean isReinitNecessary(){
098    return reinitNecessary;
099    }
100    
101    
102    }