classdef RewardsStatistics < handle
    properties
        
        % acceleration quality boundaries:
        % 0---kACC_L----------kACC_LC----------kACC_CH----------kACC_H
        %            light^     comfortable^           hard^

        kACC_L = 0;%.25;
        kACC_LC = 1.5;
        kACC_CH = 2;
        kACC_H = 3;

        
        kACC_BAD = 0;
        kACC_LIGHT = 1;
        kACC_COMFORTABLE = 2;
        kACC_HARD = 3;
        kDEACC_LIGHT = 4;
        kDEACC_COMFORTABLE = 5;
        kDEACC_HARD = 6;
        kMAINTAIN = 7
        
        % velocity quality boundaries:
        % 0----------kVEL_SP----------kVEL_PF----------kVEL_F
        %  slow^        preferred^           fast^
        kVEL_S = 0;
        kVEL_SP = 4.5;
        kVEL_PF = 5.5;
        kVEL_F = 7;

        kVEL_BAD = 0;
        kVEL_SLOW = 1;
        kVEL_PREFERRED = 2;
        kVEL_FAST = 3;
        kVEL_STOPPED = 4;
        
        % reward multipliers
%         kVERYHIGH_MULTIPLIER = 8;
%         kHIGH_MULTIPLIER = 4;
%         kMEDIUM_MULTIPLIER = 2;
%         kLOW_MULTIPLIER = 1;
        kVERYHIGH_MULTIPLIER = 2.0;
        kHIGH_MULTIPLIER = 1;
        kMEDIUM_MULTIPLIER = .5;
        kLOW_MULTIPLIER = .25;


        v_des;
    end
    
    methods
        function obj = RewardsStatistics(v_des)
            obj.v_des = v_des;
        end
          
        
        
        
        function acc_quality = accQuality(obj, a)
            if a == 0
                acc_quality = obj.kMAINTAIN;
            elseif -obj.kACC_H < a && a < -obj.kACC_CH
                acc_quality = obj.kDEACC_HARD;
            elseif -obj.kACC_CH < a && a < -obj.kACC_LC
                acc_quality = obj.kDEACC_COMFORTABLE;
            elseif -obj.kACC_LC < a && a < -obj.kACC_L
                acc_quality = obj.kDEACC_LIGHT;
            elseif obj.kACC_L < a && a < obj.kACC_LC
                acc_quality = obj.kACC_LIGHT;
            elseif obj.kACC_LC < a && a < obj.kACC_CH
                acc_quality = obj.kACC_COMFORTABLE;
            elseif obj.kACC_CH < a && a < obj.kACC_H
                acc_quality = obj.kACC_HARD;
            else
                acc_quality = obj.kACC_BAD;
            end
        end
        
        function vel_quality = velQuality(obj, v)
            if v == 0
                vel_quality = obj.kVEL_STOPPED;
            elseif obj.kVEL_S < v && v < obj.kVEL_SP
                vel_quality = obj.kVEL_SLOW;
            elseif obj.kVEL_SP < v && v < obj.kVEL_PF
                vel_quality = obj.kVEL_PREFERRED;
            elseif obj.kVEL_PF < v && v < obj.kVEL_F
                vel_quality = obj.kVEL_FAST;
            else
                vel_quality = obj.kVEL_BAD;
            end
        end
        
    end
    
end

