using System;
using System.Collections.Generic;

using Volpe.Cafe.Model;
using Volpe.Cafe.ModelSettings;

namespace Volpe.Cafe.EffectsModels
{
    /// <summary>
    /// Defines an Effects Model to use for calculating modeling effects and costs.
    /// </summary>
    public interface IEffectsModel<T>
    {
        /// <summary>
        /// Gets the compliance model associated with this <see cref="IEffectsModel{T}"/> instance.
        /// </summary>
        ICompliance ComplianceModel { get; }

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

        /// <summary>
        /// Calculates modeling effects for all available vehicles (historic and/or analysis), for a specific scenario
        /// and all applicable model years.
        /// </summary>
        /// <param name="scen">The scenario for which to calculate modeling effects.</param>
        /// <returns>
        /// An array of effects data, aggregated from individual vehicle models, for all applicable model years.
        /// </returns>
        /// <exception cref="ArgumentNullException">scen is null.</exception>
        T[] CalculateEffects(Scenario scen);

        /// <summary>
        /// Calculates modeling effects for the specified list of vehicles, for a specific scenario and model year.
        /// </summary>
        /// <param name="scen">The scenario for which to calculate modeling effects.</param>
        /// <param name="year">The model year for which to calculate modeling effects.</param>
        /// <param name="vehs">A list of one or more vehicles for which to calculate modeling effects.</param>
        /// <param name="vmtModel">
        ///     The VMT model to use for estimating vehicle miles traveled (VMT) at each vehicle age.
        ///     Specify null if not applicable or to use a static VMT model.
        /// </param>
        /// <param name="scrappageModel">
        ///     The scrappage model to use for obtaining the vehicle survival rates at each vehicle age.
        ///     Specify null if not applicable or to use a static scrappage model.
        /// </param>
        /// <returns>The effects data aggregated from individual vehicle models.</returns>
        /// <exception cref="ArgumentNullException">scen is null -or- vehs is null.</exception>
        /// <exception cref="ArgumentException">vehs is empty.</exception>
        /// <exception cref="ArgumentOutOfRangeException">
        ///     year is less than minimum historic year or greater than maximum analysis year.
        /// </exception>
        T CalculateEffects(Scenario scen,
                           int year,
                           IReadOnlyList<IEffectsVehicle> vehs,
                           VMTModel vmtModel,
                           ScrappageModel scrappageModel);

    }
}
