/// <summary> /// Initializes a new instance of the <see cref="RunPeriod" /> class. /// </summary> /// <param name="startDate">A list of two integers for [month, day], representing the date for the start of the run period. Must be before the end date..</param> /// <param name="endDate">A list of two integers for [month, day], representing the date for the end of the run period. Must be after the start date..</param> /// <param name="startDayOfWeek">Text for the day of the week on which the simulation starts..</param> /// <param name="holidays">A list of lists where each sub-list consists of two integers for [month, day], representing a date which is a holiday within the simulation. If None, no holidays are applied..</param> /// <param name="daylightSavingTime">A DaylightSavingTime to dictate the start and end dates of daylight saving time. If None, no daylight saving time is applied to the simulation..</param> /// <param name="leapYear">Boolean noting whether the simulation will be run for a leap year. (default to false).</param> public RunPeriod ( // Required parameters List <int> startDate = default, List <int> endDate = default, DaysOfWeek startDayOfWeek = DaysOfWeek.Sunday, List <List <int> > holidays = default, DaylightSavingTime daylightSavingTime = default, bool leapYear = false // Optional parameters ) : base() // BaseClass { this.StartDate = startDate; this.EndDate = endDate; this.StartDayOfWeek = startDayOfWeek; this.Holidays = holidays; this.DaylightSavingTime = daylightSavingTime; this.LeapYear = leapYear; // Set non-required readonly properties with defaultValue this.Type = "RunPeriod"; // check if object is valid, only check for inherited class if (this.GetType() == typeof(RunPeriod)) { this.IsValid(throwException: true); } }
/// <summary> /// Initializes a new instance of the <see cref="RunPeriod" /> class. /// </summary> /// <param name="type">type (default to "RunPeriod").</param> /// <param name="startDate">A list of two integers for [month, day], representing the date for the start of the run period. Must be before the end date..</param> /// <param name="endDate">A list of two integers for [month, day], representing the date for the end of the run period. Must be after the start date..</param> /// <param name="startDayOfWeek">Text for the day of the week on which the simulation starts. (default to StartDayOfWeekEnum.Sunday).</param> /// <param name="holidays">A list of lists where each sub-list consists of two integers for [month, day], representing a date which is a holiday within the simulation. If None, no holidays are applied..</param> /// <param name="daylightSavingTime">A DaylightSavingTime to dictate the start and end dates of daylight saving time. If None, no daylight saving time is applied to the simulation..</param> /// <param name="leapYear">Boolean noting whether the simulation will be run for a leap year. (default to false).</param> public RunPeriod(string type = "RunPeriod", List <int> startDate = default, List <int> endDate = default, StartDayOfWeekEnum?startDayOfWeek = StartDayOfWeekEnum.Sunday, List <List <int> > holidays = default, DaylightSavingTime daylightSavingTime = default, bool leapYear = false) { // use default value if no "type" provided if (type == null) { this.Type = "RunPeriod"; } else { this.Type = type; } this.StartDate = startDate; this.EndDate = endDate; // use default value if no "startDayOfWeek" provided if (startDayOfWeek == null) { this.StartDayOfWeek = StartDayOfWeekEnum.Sunday; } else { this.StartDayOfWeek = startDayOfWeek; } this.Holidays = holidays; this.DaylightSavingTime = daylightSavingTime; // use default value if no "leapYear" provided if (leapYear == null) { this.LeapYear = false; } else { this.LeapYear = leapYear; } }
/// <summary> /// Initializes a new instance of the <see cref="RunPeriod" /> class. /// </summary> /// <param name="startDate">A list of two integers for [month, day], representing the date for the start of the run period. Must be before the end date..</param> /// <param name="endDate">A list of two integers for [month, day], representing the date for the end of the run period. Must be after the start date..</param> /// <param name="startDayOfWeek">Text for the day of the week on which the simulation starts..</param> /// <param name="holidays">A list of lists where each sub-list consists of two integers for [month, day], representing a date which is a holiday within the simulation. If None, no holidays are applied..</param> /// <param name="daylightSavingTime">A DaylightSavingTime to dictate the start and end dates of daylight saving time. If None, no daylight saving time is applied to the simulation..</param> /// <param name="leapYear">Boolean noting whether the simulation will be run for a leap year. (default to false).</param> public RunPeriod ( // Required parameters List <int> startDate = default, List <int> endDate = default, DaysOfWeek startDayOfWeek = DaysOfWeek.Sunday, List <List <int> > holidays = default, DaylightSavingTime daylightSavingTime = default, bool leapYear = false // Optional parameters ) : base() // BaseClass { this.StartDate = startDate; this.EndDate = endDate; this.StartDayOfWeek = startDayOfWeek; this.Holidays = holidays; this.DaylightSavingTime = daylightSavingTime; this.LeapYear = leapYear; // Set non-required readonly properties with defaultValue this.Type = "RunPeriod"; }