@@ -0,0 +1,1686 @@
+%0Apackage com.uwetrottmann.shopr.algorithm.model;%0A%0Aimport com.uwetrottmann.shopr.algorithm.model.Attributes.AttributeValue;%0A%0Aimport java.util.Arrays;%0A%0Apublic class Sex extends GenericAttribute %7B%0A%0A    public static final String ID = %22sex%22;%0A%0A    public enum Value implements AttributeValue %7B%0A        FEMALE(%22Female%22),%0A        MALE(%22Male%22),%0A        UNISEX(%22Unisex%22);%0A%0A        String mDescriptor;%0A%0A        Value(String name) %7B%0A            mDescriptor = name;%0A        %7D%0A%0A        @Override%0A        public String descriptor() %7B%0A            return mDescriptor;%0A        %7D%0A%0A        @Override%0A        public int index() %7B%0A            return ordinal();%0A        %7D%0A    %7D%0A%0A    public Sex() %7B%0A        int numValues = Value.values().length;%0A        mValueWeights = new double%5BnumValues%5D;%0A        Arrays.fill(mValueWeights, 1.0 / numValues);%0A    %7D%0A%0A    public Sex(Value value) %7B%0A        setWeights(value);%0A    %7D%0A%0A    /**%0A     * Tries to match the given string with a %7B@link Sex.Value%7D.%0A     */%0A    public Sex(String value) %7B%0A        if (%22Weiblich%22.equals(value)) %7B%0A            setWeights(Sex.Value.FEMALE);%0A        %7D%0A        else if (%22M%C3%A4nnlich%22.equals(value)) %7B%0A            setWeights(Sex.Value.MALE);%0A        %7D%0A        else if (%22Beide%22.equals(value)) %7B%0A            setWeights(Sex.Value.UNISEX);%0A        %7D%0A    %7D%0A%0A    private void setWeights(Value value) %7B%0A        mValueWeights = new double%5BValue.values().length%5D;%0A        Arrays.fill(mValueWeights, 0.0);%0A        mValueWeights%5Bvalue.ordinal()%5D = 1.0;%0A        currentValue(value);%0A    %7D%0A%0A    @Override%0A    public String id() %7B%0A        return ID;%0A    %7D%0A%0A    @Override%0A    public AttributeValue%5B%5D getValueSymbols() %7B%0A        return Value.values();%0A    %7D%0A%0A%7D%0A

Add Sex attribute.