using Volpe.Cafe.Generic;
using Volpe.Cafe.Logging;
using Volpe.Cafe.MarketData.Design;
using Volpe.Cafe.ModelSettings;

namespace Volpe.Cafe.DfsSrModels.DfsModels
{
    /// <summary>
    /// Defines methods for estimating new light-duty car, light-duty truck, and HDPUV fleet shares from the aggregate
    /// forecast fleet data.
    /// </summary>
    public interface IDfsModel
    {
        /// <summary>
        /// Gets the product plan industry data used for analysis.
        /// </summary>
        IIndustry Data { get; }

        /// <summary>
        /// Gets the modeling settings used for analysis.
        /// </summary>
        ModelingSettings Settings { get; }

        /// <summary>
        /// Gets the object used for writing log files generated during compliance modeling.
        /// </summary>
        ILogger LogWriter { get; }

        /// <summary>
        /// Gets the aggregation mode that is preferred by this <see cref="IDfsModel"/> instance.
        /// </summary>
        AggregationMode PreferredAggregationMode { get; }

        /// <summary>
        /// Gets the number of prior (or lagged) years required by this <see cref="IDfsModel"/> instance when
        /// forecasting the fleet shares during the analysis year.
        /// </summary>
        /// <remarks>
        /// During aggregation of the forecast fleet data, the caller shall use the number of lagged years in order to
        /// initialize additional historic years, beyond the first model year selected for analysis.
        /// </remarks>
        int NumberOfLaggedYears { get; }

        /// <summary>
        /// Estimates the light-duty car, light-duty truck, and HDPUV fleet shares for the given scenario, iteration,
        /// and model year.
        /// </summary>
        /// <param name="scen">The compliance scenario being analyzed.</param>
        /// <param name="iteration">The iteration trial being analyzed.</param>
        /// <param name="year">The model year being analyzed.</param>
        /// <param name="baseFleet">
        ///     The aggregate forecast fleet from the baseline scenario, for all model years.
        /// </param>
        /// <param name="scenFleet">
        ///     The aggregate forecast fleet from the action alternative scenario, for all model years.
        /// </param>
        /// <returns>
        /// The estimated light-duty car, light-duty truck, and HDPUV fleet shares for the given scenario, iteration,
        /// and model year.
        /// </returns>
        FleetTypeValue CalcNewFleetShares(Scenario scen, int iteration, int year,
            AnnualValue<ForecastFleet> baseFleet, AnnualValue<ForecastFleet> scenFleet);

    }
}
