private readonly Series _serReproduction;   // Series of the basic reproduction number (R₀)

        /// <summary>
        /// Creates and initializes a new view object
        /// </summary>
        /// <param name="seir">SEIR-object</param>
        /// <param name="bSusceptible">If true, susceptible-series is shown.</param>
        /// <param name="bExposed">>If true, exposed-series is shown.</param>
        /// <param name="bInfectious">If true, infectious-series is shown.</param>
        /// <param name="bRemoved">If true, removed-series is shown.</param>
        /// <param name="bCases">If true, total cases-series is shown.</param>
        /// <param name="bDaily">If true, daily cases-series is shown.</param>
        /// <param name="b7Days">If true, 7 day average of daily cases per 100.000-series is shown.</param>
        /// <param name="bReproduction">If true, R₀-series is shown for the second axis</param>
        public SEIRSeriesView(ISEIR seir, bool bSusceptible = true, bool bExposed = true, bool bInfectious = true, bool bRemoved = true, bool bCases = true, bool bDaily = true, bool b7Days = true, bool bReproduction = true)
        {
            _seir = seir;

            if (bSusceptible)
            {
                _serSusceptible = new Series("Susceptible")
                {
                    ChartType   = SeriesChartType.Spline,
                    Color       = Color.LightSkyBlue,
                    BorderWidth = 5
                }
            }
            ;

            if (bExposed)
            {
                _serExposed = new Series("Exposed")
                {
                    ChartType   = SeriesChartType.Spline,
                    Color       = Color.Orange,
                    BorderWidth = 5
                }
            }
            ;

            if (bInfectious)
            {
                _serInfectious = new Series("Infectious")
                {
                    ChartType   = SeriesChartType.Spline,
                    Color       = Color.Red,
                    BorderWidth = 5
                }
            }
            ;

            if (bRemoved)
            {
                _serRemoved = new Series("Removed")
                {
                    ChartType   = SeriesChartType.Spline,
                    Color       = Color.LimeGreen,
                    BorderWidth = 5
                }
            }
            ;

            if (bCases)
            {
                _serCases = new Series("Cases")
                {
                    ChartType   = SeriesChartType.Spline,
                    Color       = Color.Yellow,
                    BorderWidth = 5
                }
            }
            ;

            if (bDaily)
            {
                _serDaily = new Series("Daily Cases")
                {
                    ChartType   = SeriesChartType.Column,
                    Color       = Color.Yellow,
                    BorderWidth = 5
                }
            }
            ;

            if (b7Days)
            {
                _ser7Days = new Series("7 Days Incidence")
                {
                    ChartType   = SeriesChartType.Column,
                    Color       = Color.Goldenrod,
                    BorderWidth = 5
                }
            }
            ;

            if (bReproduction)
            {
                _serReproduction = new Series("Reproduction")
                {
                    ChartType   = SeriesChartType.Spline,
                    YAxisType   = AxisType.Secondary,
                    Color       = Color.Black,
                    BorderWidth = 5
                }
            }
            ;
        }
        protected readonly bool _bDoubledMarker;                            // If true, double value diamond markers are added to cases-, daily- and 7days-series

        /// <summary>
        /// Creates and initializes a new view object
        /// </summary>
        /// <param name="seir">SEIR-object</param>
        /// <param name="dicReproduction">Dictionary of basic reproduction numbers (R₀). For missing dates the initial R₀ of the SEIR object is used.</param>
        /// <param name="bSusceptible">If true, susceptible-series is shown.</param>
        /// <param name="bExposed">>If true, exposed-series is shown.</param>
        /// <param name="bInfectious">If true, infectious-series is shown.</param>
        /// <param name="bRemoved">If true, removed-series is shown.</param>
        /// <param name="bCases">If true, total cases-series is shown.</param>
        /// <param name="bDaily">If true, daily cases-series is shown.</param>
        /// <param name="b7Days">If true, 7 day average of daily cases per 100.000-series is shown.</param>
        /// <param name="bReproduction">If true, R₀-series is shown for the second axis</param>
        /// <param name="bDoubledMarker">If true, double value diamond markers are added to cases-, daily- and 7days-series</param>
        public SEIRR0DateSeriesView(ISEIR seir, Dictionary <DateTime, double> dicReproduction, bool bSusceptible = true, bool bExposed = true, bool bInfectious = true, bool bRemoved = true, bool bCases = true, bool bDaily = true, bool b7Days = true, bool bReproduction = true, bool bDoubledMarker = true)
        {
            _seir            = seir;
            _dicReproduction = dicReproduction;

            if (bSusceptible)
            {
                _serSusceptible = new Series("Susceptible")
                {
                    ChartType   = SeriesChartType.Spline,
                    XValueType  = ChartValueType.Date,
                    Color       = Color.LightSkyBlue,
                    BorderWidth = 5
                }
            }
            ;

            if (bExposed)
            {
                _serExposed = new Series("Exposed")
                {
                    ChartType   = SeriesChartType.Spline,
                    XValueType  = ChartValueType.Date,
                    Color       = Color.Orange,
                    BorderWidth = 5
                }
            }
            ;

            if (bInfectious)
            {
                _serInfectious = new Series("Infectious")
                {
                    ChartType   = SeriesChartType.Spline,
                    XValueType  = ChartValueType.Date,
                    Color       = Color.Red,
                    BorderWidth = 5
                }
            }
            ;

            if (bRemoved)
            {
                _serRemoved = new Series("Removed")
                {
                    ChartType   = SeriesChartType.Spline,
                    XValueType  = ChartValueType.Date,
                    Color       = Color.LimeGreen,
                    BorderWidth = 5
                }
            }
            ;

            if (bCases)
            {
                _serCases = new Series("Cases")
                {
                    ChartType   = SeriesChartType.Spline,
                    XValueType  = ChartValueType.Date,
                    Color       = Color.Yellow,
                    BorderWidth = 5
                }
            }
            ;

            if (bDaily)
            {
                _serDaily = new Series("Daily Cases")
                {
                    ChartType   = SeriesChartType.Column,
                    XValueType  = ChartValueType.Date,
                    Color       = Color.Yellow,
                    BorderWidth = 5
                }
            }
            ;
            if (b7Days)
            {
                _ser7Days = new Series("7 Days Incidence")
                {
                    ChartType   = SeriesChartType.Column,
                    XValueType  = ChartValueType.Date,
                    Color       = Color.Goldenrod,
                    BorderWidth = 5
                }
            }
            ;

            if (bReproduction)
            {
                _serReproduction = new Series("Reproduction R₀")
                {
                    ChartType   = SeriesChartType.Line,
                    YAxisType   = AxisType.Secondary,
                    XValueType  = ChartValueType.Date,
                    Color       = Color.FromArgb(128, 128, 128),
                    BorderWidth = 5
                }
            }
            ;

            _bDoubledMarker = bDoubledMarker;
        }
Пример #3
0
 /// <summary>
 /// Creates a new SEIR object from another ISEIR object
 /// </summary>
 /// <param name="seir">Another ISEIR objext</param>
 public SEIR(ISEIR seir) : this(seir.Susceptible, seir.Exposed, seir.Infectious, seir.Removed, seir.IncubationPeriod, seir.InfectiousPeriod, seir.Reproduction)
 {
 }