function [Total_Cost_VEC_gamma_a10, Total_Cost_VEC_gamma_a20, Total_Cost_VEC_gamma_a30, Total_Cost_VEC_gamma_b20, Total_Cost_VEC_gamma_b40, Total_Cost_VEC_gamma_b60] = VEC_comp_Specific (alpha, beta,alpha_10,alpha_20,alpha_30, beta_20,beta_40, beta_60, B_n,D_n, V_n_size, t_max, t_V2I_stay, R_V2I_final,rsu_capacity,V_n_location, V_i_location, fV_i,Available_resources, RT_VEC)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%This file is for specific gama according to the values of alpha and beta i.e. alph=0.1, 0.2, 0.3 and beta=0.2, 0.4, 0.6
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%


Cost_VEC=0
Time_VEC=0
P_VEC=10 %The price for VEC computation is 10 Units/s
C_VEC= 1 % The cost of transmission for source to RSU
%RT_VEC=randi([5 10],1,5) % so far just created latter this is a queue which is kept increasing as the no. of vehicles grow. 
RT_VEC_Comp=RT_VEC;
Total_Cost_VEC= zeros(1, V_n_size);
    for(i=1:V_n_size)
        if (t_V2I_stay(i)>=0)
            rsu=abs(ceil(V_n_location(i)/400))
            gamma_a10(i)=D_n(i)-(alpha_10(i)+beta(i))
            if (gamma_a10(i)>0)
                t_VEC_up(i)=D_n(i)/ R_V2I_final(i)    %Transmission time from source to RSU/VEC server in its range
                %t_VEC_exe(i)=B_n(i)/rsu_capacity(rsu)             %execution time of VEC server 
                t_VEC_exe(i)=B_n(i)/(8*10^8);                  % the upper statement gives error sometimes. so to get rid off we use this.
                Time_VEC(i)= gamma_a10(i)*t_VEC_up(i) + RT_VEC_Comp(rsu)+ gamma_a10(i)*t_VEC_exe(i) 
                Cost_VEC_gamma_a10(i)= (C_VEC*gamma_a10(i)*t_VEC_up(i))+ (P_VEC*((RT_VEC_Comp(rsu)+ (gamma_a10(i)* t_VEC_exe(i))))) % Cost of indivisual vehicle at VEC server
%                 RT_VEC_Comp(rsu)= RT_VEC_Comp(rsu)-1;
                              
                
            else
                Cost_VEC_gamma_a10(i)=0;
            end
            %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
            gamma_a20(i)=D_n(i)-(alpha_20(i)+beta(i))
            if (gamma_a20(i)>0)
                t_VEC_up(i)=D_n(i)/ R_V2I_final(i)    %Transmission time from source to RSU/VEC server in its range
                %t_VEC_exe(i)=B_n(i)/rsu_capacity(rsu)             %execution time of VEC server 
                t_VEC_exe(i)=B_n(i)/(8*10^8);                  % the upper statement gives error sometimes. so to get rid off we use this.
                Time_VEC(i)= gamma_a20(i)*t_VEC_up(i) + RT_VEC_Comp(rsu)+ gamma_a20(i)*t_VEC_exe(i) 
                Cost_VEC_gamma_a20(i)= (C_VEC*gamma_a20(i)*t_VEC_up(i))+ (P_VEC*((RT_VEC_Comp(rsu)+ (gamma_a20(i)* t_VEC_exe(i))))) % Cost of indivisual vehicle at VEC server
%                 RT_VEC_Comp(rsu)= RT_VEC_Comp(rsu)-1;
                              
            else
                Cost_VEC_gamma_a20(i)=0;
            end
            %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
            gamma_a30(i)=D_n(i)-(alpha_30(i)+beta(i))
            if (gamma_a30(i)>0)
                t_VEC_up(i)=D_n(i)/ R_V2I_final(i)    %Transmission time from source to RSU/VEC server in its range
                %t_VEC_exe(i)=B_n(i)/rsu_capacity(rsu)             %execution time of VEC server 
                t_VEC_exe(i)=B_n(i)/(8*10^8);                  % the upper statement gives error sometimes. so to get rid off we use this.
                Time_VEC(i)= gamma_a30(i)*t_VEC_up(i) + RT_VEC_Comp(rsu)+ gamma_a30(i)*t_VEC_exe(i) 
                Cost_VEC_gamma_a30(i)= (C_VEC*gamma_a30(i)*t_VEC_up(i))+ (P_VEC*((RT_VEC_Comp(rsu)+ (gamma_a30(i)* t_VEC_exe(i))))) % Cost of indivisual vehicle at VEC server
%                 RT_VEC_Comp(rsu)= RT_VEC_Comp(rsu)-1;
                              
            else
                Cost_VEC_gamma_a30(i)=0;
            end
            %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
            gamma_b20(i)=D_n(i)-(alpha(i)+beta_20(i))
            if (gamma_b20(i)>0)
                t_VEC_up(i)=D_n(i)/ R_V2I_final(i)    %Transmission time from source to RSU/VEC server in its range
                %t_VEC_exe(i)=B_n(i)/rsu_capacity(rsu)             %execution time of VEC server 
                t_VEC_exe(i)=B_n(i)/(8*10^8);                  % the upper statement gives error sometimes. so to get rid off we use this.
                Time_VEC(i)= gamma_b20(i)*t_VEC_up(i) + RT_VEC_Comp(rsu)+ gamma_b20(i)*t_VEC_exe(i) 
                Cost_VEC_gamma_b20(i)= (C_VEC*gamma_b20(i)*t_VEC_up(i))+ (P_VEC*((RT_VEC_Comp(rsu)+ (gamma_b20(i)* t_VEC_exe(i))))) % Cost of indivisual vehicle at VEC server
%                 RT_VEC_Comp(rsu)= RT_VEC_Comp(rsu)-1;
                              
            else
                Cost_VEC_gamma_b20(i)=0;
            end
            %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
            gamma_b40(i)=D_n(i)-(alpha(i)+beta_40(i))
            if (gamma_b40(i)>0)
                t_VEC_up(i)=D_n(i)/ R_V2I_final(i)    %Transmission time from source to RSU/VEC server in its range
                %t_VEC_exe(i)=B_n(i)/rsu_capacity(rsu)             %execution time of VEC server 
                t_VEC_exe(i)=B_n(i)/(8*10^8);                  % the upper statement gives error sometimes. so to get rid off we use this.
                Time_VEC(i)= gamma_b40(i)*t_VEC_up(i) + RT_VEC_Comp(rsu)+ gamma_b40(i)*t_VEC_exe(i) 
                Cost_VEC_gamma_b40(i)= (C_VEC*gamma_b40(i)*t_VEC_up(i))+ (P_VEC*((RT_VEC_Comp(rsu)+ (gamma_b40(i)* t_VEC_exe(i))))) % Cost of indivisual vehicle at VEC server
%                 RT_VEC_Comp(rsu)= RT_VEC_Comp(rsu)-1;
                              
            else
                Cost_VEC_gamma_b40(i)=0;
            end
            %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
            gamma_b60(i)=D_n(i)-(alpha(i)+beta_60(i))
            if (gamma_b60(i)>0)
                t_VEC_up(i)=D_n(i)/ R_V2I_final(i)    %Transmission time from source to RSU/VEC server in its range
                %t_VEC_exe(i)=B_n(i)/rsu_capacity(rsu)             %execution time of VEC server 
                t_VEC_exe(i)=B_n(i)/(8*10^8);                  % the upper statement gives error sometimes. so to get rid off we use this.
                Time_VEC(i)= gamma_b60(i)*t_VEC_up(i) + RT_VEC_Comp(rsu)+ gamma_b60(i)*t_VEC_exe(i) 
                Cost_VEC_gamma_b60(i)= (C_VEC*gamma_b60(i)*t_VEC_up(i))+ (P_VEC*((RT_VEC_Comp(rsu)+ (gamma_b60(i)* t_VEC_exe(i))))) % Cost of indivisual vehicle at VEC server
%                 RT_VEC_Comp(rsu)= RT_VEC_Comp(rsu)-1;
                              
            else
                Cost_VEC_gamma_b60(i)=0;
            end
            %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
            
            
            
            %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
            RT_VEC_Comp(rsu)= RT_VEC_Comp(rsu)-1;
            if (RT_VEC_Comp(rsu)==-1)    
                    RT_VEC_Comp(rsu)=0;
            end
        end
        
    end
    Total_Cost_VEC_gamma_a10= Cost_VEC_gamma_a10          %For taking the Total cost of all VEC server for all vehicles 
    Total_Cost_VEC_gamma_a20= Cost_VEC_gamma_a20
    Total_Cost_VEC_gamma_a30= Cost_VEC_gamma_a30
    Total_Cost_VEC_gamma_b20= Cost_VEC_gamma_b20
    Total_Cost_VEC_gamma_b40= Cost_VEC_gamma_b40
    Total_Cost_VEC_gamma_b60= Cost_VEC_gamma_b60
    for i=2:length(Cost_VEC_gamma_a10);
        Total_Cost_VEC_gamma_a10(i)=Total_Cost_VEC_gamma_a10(i-1)+Cost_VEC_gamma_a10(i);
        Total_Cost_VEC_gamma_a20(i)=Total_Cost_VEC_gamma_a20(i-1)+Cost_VEC_gamma_a20(i);
        Total_Cost_VEC_gamma_a30(i)=Total_Cost_VEC_gamma_a30(i-1)+Cost_VEC_gamma_a30(i);
        Total_Cost_VEC_gamma_b20(i)=Total_Cost_VEC_gamma_b20(i-1)+Cost_VEC_gamma_b20(i);
        Total_Cost_VEC_gamma_b40(i)=Total_Cost_VEC_gamma_b40(i-1)+Cost_VEC_gamma_b40(i);
        Total_Cost_VEC_gamma_b60(i)=Total_Cost_VEC_gamma_b60(i-1)+Cost_VEC_gamma_b60(i);
    end
end

