using System;
using Volpe.Cafe.ModelSettings;
using Volpe.Cafe.Reporting.Generators;

namespace Volpe.Cafe.Reporting.ModelingReports
{
    /// <summary>
    /// Provides support for generating a <b>societal effects</b> modeling report.
    /// </summary>
    [Serializable]
    public class SocietalEffectsReport : ModelingReport
    {
        /// <inheritdoc cref="ModelingReport(string, bool, Func{string[]})"/>
        public SocietalEffectsReport(string path, bool append = false)
            : base(path, append, GetHeaders) { }

        /// <inheritdoc/>
        public override ReportDataGenerator GetDataGenerator(
            Scenario scen, ReportingData data, ModelingSettings settings)
        {
            return new SocietalEffectsReportDataGenerator(scen, data, settings);
        }

        private static new string[] GetHeaders()
        {
            string[] headersPrefix = {
                //----- header columns -----
                "Scenario", "Scenario Name", "Model Year", "Reg-Class", "Fuel Type",

                //----- fuel economy metrics -----
                "Rated FE", "On-road FE", "Fuel Share",

                //----- general effects (veh attributes and sales) -----
                "Curb Weight", "Footprint", "Work Factor",
                "Sales"
            };

            return ReportUtils.GetSocietalEffectsReportHeaders(headersPrefix);
        }

    }

    /// <summary>
    /// Provides support for generating an <b>"incremental" societal effects</b> modeling report.
    /// </summary>
    [Serializable]
    public class SocietalEffectsIncrementalReport : SocietalEffectsReport
    {
        /// <inheritdoc/>
        public SocietalEffectsIncrementalReport(string path, bool append = false)
            : base(path, append) { }

        /// <inheritdoc/>
        public override ReportDataGenerator GetDataGenerator(
            Scenario scen, ReportingData data, ModelingSettings settings)
        {
            return base.GetDataGenerator(scen, data, settings).AsIncremental();
        }

    }
}
