// Path: src/fdt/fuzzy/FuzzySet.java
// public interface FuzzySet {
// 
//     /**
//      *
//      * @param x
//      * @return
//      */
//     double getMembership(double x);
// }


import fdt.fuzzy.FuzzySet;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.stream.Collectors;



package fdt.data;


/**
 *
 * To create a fuzzy variable, e.g. Age.
 * 
 * @author Mohammed Jabreel
 */
public class Attribute {

    /**
     * The name of the attribute.
     */
    private final String name;
    
    /**
     * The index of the attribute in the dataset.
     */
    int index;

    /**
     * The dictionary of the terms.
     */
    private final HashMap<String, Term> nameToTerm = new LinkedHashMap<>();
    
    /**
     * The list of the crisp values.
     */
    private final List<Double> crispValues = new ArrayList<>();
    
    /**
     * The list of the terms of the attribute.
     */
    private final List<Term> terms = new ArrayList<>();
    
    /**
     *
     * @param name
     */
    public Attribute(String name) {
        this.name = name;
    }

    /**
     *
     * @return
     */
    public String getName() {
        return name;
    }

    /**
     *
     * @param termName
     * @param fuzzySet
     */
// Path: src/fdt/fuzzy/FuzzySet.java
// public interface FuzzySet {
// 
//     /**
//      *
//      * @param x
//      * @return
//      */
//     double getMembership(double x);
// }


// Path: src/fdt/data/Attribute.java
import fdt.fuzzy.FuzzySet;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.stream.Collectors;




package fdt.data;


/**
 *
 * To create a fuzzy variable, e.g. Age.
 * 
 * @author Mohammed Jabreel
 */
public class Attribute {

    /**
     * The name of the attribute.
     */
    private final String name;
    
    /**
     * The index of the attribute in the dataset.
     */
    int index;

    /**
     * The dictionary of the terms.
     */
    private final HashMap<String, Term> nameToTerm = new LinkedHashMap<>();
    
    /**
     * The list of the crisp values.
     */
    private final List<Double> crispValues = new ArrayList<>();
    
    /**
     * The list of the terms of the attribute.
     */
    private final List<Term> terms = new ArrayList<>();
    
    /**
     *
     * @param name
     */
    public Attribute(String name) {
        this.name = name;
    }

    /**
     *
     * @return
     */
    public String getName() {
        return name;
    }

    /**
     *
     * @param termName
     * @param fuzzySet
     */
    public void addTerm(String termName, FuzzySet fuzzySet) {