//==============================================================================
//	
//	Copyright (c) 2015-
//	Author:
//  * Andreas Fellner <andreas.fellner@ist.ac.at (Institute of Science and Technology Austria)
//	
//------------------------------------------------------------------------------
//
//  This file was created as part of the implementation for 
//  Counterexample Explanation by Learning
//  Small Strategies in Markov Decision Processes
//  Brázdil et al. 2015  
//
//	This file is part of PRISM.
//	
//	PRISM is free software; you can redistribute it and/or modify
//	it under the terms of the GNU General Public License as published by
//	the Free Software Foundation; either version 2 of the License, or
//	(at your option) any later version.
//	
//	PRISM is distributed in the hope that it will be useful,
//	but WITHOUT ANY WARRANTY; without even the implied warranty of
//	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//	GNU General Public License for more details.
//	
//	You should have received a copy of the GNU General Public License
//	along with PRISM; if not, write to the Free Software Foundation,
//	Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
//	
//==============================================================================

package heuristics.decisiontree;

import java.util.Collections;
import java.util.HashMap;
import java.util.Map;

import weka.classifiers.Classifier;
import weka.classifiers.trees.ADTree;
import weka.classifiers.trees.BFTree;
import weka.classifiers.trees.DecisionStump;
import weka.classifiers.trees.J48;
import weka.classifiers.trees.J48graft;
import weka.classifiers.trees.LADTree;
import weka.classifiers.trees.REPTree;
import weka.classifiers.trees.RandomForest;
import weka.classifiers.trees.SimpleCart;

public class WekaTree
{
	public static Map<Integer,String> treeTypes;
	
	static {
        Map<Integer, String> aMap = new HashMap<Integer,String>();
        aMap.put(1,"J48");
        aMap.put(2,"J48graft");
        aMap.put(3,"ADTree");
        aMap.put(4, "BFTree");
        aMap.put(5, "DecisionStump");
        aMap.put(6, "LADTree");
        aMap.put(7, "REPTree");
        aMap.put(8, "SimpleCart");
        aMap.put(9, "RandomForest");
        treeTypes = Collections.unmodifiableMap(aMap);
    }
	
	public static Classifier createTree(int type) {
		switch (type) {
			case 1: return new J48();
			case 2: return new J48graft();
			case 3: return new ADTree();
			case 4: return new BFTree();
			case 5: return new DecisionStump();
			case 6: return new LADTree();
			case 7: return new REPTree();
			case 8: return new SimpleCart();
			case 9: return new RandomForest();
			default: return new J48();
		}
	}
}
