// Suppress IDE0022:Use block body for methods -- OK for short extension methods
#pragma warning disable IDE0022

using System;

namespace Volpe.Cafe.DfsSrModels
{
    /// <summary>
    /// Specifies the aggregation mode to use by the Dynamic Fleet Share and Sales Response (DFS/SR) models when
    /// aggregating vehicle fleet data and rescaling vehicle sales.
    /// </summary>
    [Serializable]
    public enum AggregationMode
    {
        /// <summary>
        /// Specifies that an aggregation mode is to be determined by a specific DFS/SR model.
        /// </summary>
        Auto = 0,

        /// <summary>
        /// Specifies an aggregation mode that is based on a vehicle's baseline <see cref="RegulatoryClass"/>
        /// assignment.
        /// </summary>
        ByBaselineRegClass,

        /// <summary>
        /// Specifies an aggregation mode that is based on a vehicle's <see cref="RegulatoryClass"/> assignment.
        /// </summary>
        ByRegulatoryClass,

        /// <summary>
        /// Specifies an aggregation mode that is based on a vehicle's <see cref="VehicleClass"/> assignment.
        /// </summary>
        ByVehicleClass
    }

    /// <summary>
    /// Specifies the sales estimation methodology to use by the Dynamic Fleet Share and Sales Response (DFS/SR) model
    /// for projecting the total light-duty and HDPUV vehicle sales in each future model year.
    /// </summary>
    [Serializable]
    public enum SalesEstimator
    {
        /// <summary>
        /// Specifies a sales estimator that projects a constant light-duty and HDPUV sales forecast into each future
        /// model year, based on the initial sales volumes obtained from the product plan industry data.
        /// </summary>
        FixedForecast = 0,

        /// <summary>
        /// Specifies a sales estimator that relies on a user supplied annual sales forecast for estimating the total
        /// light-duty and HDPUV vehicle sales in each future model year.
        /// </summary>
        UserDefinedForecast,

        /// <summary>
        /// Specifies a sales estimator that uses a macroeconomic model for dynamically estimating the total light-duty
        /// and HDPUV vehicle sales in each future model year.
        /// </summary>
        NominalForecast,

        /// <summary>
        /// Specifies a sales estimator that forecasts the total light-duty and HDPUV vehicle sales in each future
        /// model year in the action alternatives, based on the price elasticity effect with regard to the incremental
        /// differences of regulatory costs, tax credits, and fuel savings occurring between the baseline and the
        /// action alternative scenarios.
        /// <br/><br/>
        /// Note that for the baseline scenario, a separate user-supplied sales estimator shall be used as a reference
        /// to forecast the light-duty and HDPUV vehicle sales.
        /// </summary>
        PriceElasticity
    }

    /// <summary>
    /// Specifies the fleet share model to use by the Dynamic Fleet Share and Sales Response (DFS/SR) model for
    /// estimating the light-duty and HDPUV fleet shares in each future model year.
    /// </summary>
    [Serializable]
    public enum DfsModel
    {
        /// <summary>
        /// Specifies a DFS model that projects constant light-duty and HDPUV fleet shares into each future model year,
        /// based on the initial fleet shares obtained from the product plan industry data.
        /// </summary>
        FixedFleetShares = 0,

        /// <summary>
        /// Specifies a DFS model that relies on a user supplied annual light-duty car shares for estimating the
        /// light-duty and HDPUV fleet shares in each future model year.
        /// </summary>
        UserDefinedShares,

        /// <summary>
        /// Specifies a new macroeconomic DFS model that forecasts the light-duty and HDPUV fleet shares in each future
        /// model year in response to the differences in fuel economy, vehicle power, and curb weight occurring between
        /// the light-duty car and light-duty truck fleets.
        /// </summary>
        Experimental,

        /// <summary>
        /// Specifies a DFS model that forecasts the light-duty and HDPUV fleet shares in each future model year in the
        /// action alternatives, based on the price elasticity effect with regard to the incremental differences of
        /// regulatory costs, tax credits, and fuel savings occurring between the baseline and the action alternative
        /// scenarios, additionally taken as the differences between the light-duty car and light-duty truck fleets.
        /// <br/><br/>
        /// Note that for the baseline scenario, a separate user-supplied DFS model will be used as a reference to
        /// forecast the light-duty and HDPUV fleet shares.
        /// </summary>
        PriceElasticity
    }

    /// <summary>
    /// Provides extension methods for various enumerations.
    /// </summary>
    [Serializable]
    public static class EnumExtensions
    {
        #region < AggregationMode >

        /// <summary>
        /// Determines whether the specified value is <see cref="AggregationMode.ByBaselineRegClass"/>.
        /// </summary>
        public static bool IsByBaselineRegClass(this AggregationMode src) => src == AggregationMode.ByBaselineRegClass;

        /// <summary>
        /// Determines whether the specified value is <see cref="AggregationMode.ByRegulatoryClass"/>.
        /// </summary>
        public static bool IsByRegulatoryClass(this AggregationMode src) => src == AggregationMode.ByRegulatoryClass;

        /// <summary>
        /// Determines whether the specified value is <see cref="AggregationMode.ByVehicleClass"/>.
        /// </summary>
        public static bool IsByVehicleClass(this AggregationMode src) => src == AggregationMode.ByVehicleClass;

        #endregion

        #region < SalesEstimator >

        /// <summary>
        /// Determines whether the specified value is <see cref="SalesEstimator.FixedForecast"/>.
        /// </summary>
        public static bool IsFixedForecast(this SalesEstimator src) => src == SalesEstimator.FixedForecast;

        /// <summary>
        /// Determines whether the specified value is <see cref="SalesEstimator.UserDefinedForecast"/>.
        /// </summary>
        public static bool IsUserDefinedForecast(this SalesEstimator src) => src == SalesEstimator.UserDefinedForecast;

        /// <summary>
        /// Determines whether the specified value is <see cref="SalesEstimator.NominalForecast"/>.
        /// </summary>
        public static bool IsNominalForecast(this SalesEstimator src) => src == SalesEstimator.NominalForecast;

        /// <summary>
        /// Determines whether the specified value is <see cref="SalesEstimator.PriceElasticity"/>.
        /// </summary>
        public static bool IsPriceElasticity(this SalesEstimator src) => src == SalesEstimator.PriceElasticity;

        #endregion

        #region < DfsModel >

        /// <summary>
        /// Determines whether the specified value is <see cref="DfsModel.FixedFleetShares"/>.
        /// </summary>
        public static bool IsFixedFleetShares(this DfsModel src) => src == DfsModel.FixedFleetShares;

        /// <summary>
        /// Determines whether the specified value is <see cref="DfsModel.UserDefinedShares"/>.
        /// </summary>
        public static bool IsUserDefinedShares(this DfsModel src) => src == DfsModel.UserDefinedShares;

        /// <summary>
        /// Determines whether the specified value is <see cref="DfsModel.Experimental"/>.
        /// </summary>
        public static bool IsExperimental(this DfsModel src) => src == DfsModel.Experimental;

        /// <summary>
        /// Determines whether the specified value is <see cref="DfsModel.PriceElasticity"/>.
        /// </summary>
        public static bool IsPriceElasticity(this DfsModel src) => src == DfsModel.PriceElasticity;

        #endregion
    }
}
