/// <summary>
        /// Initializes a new instance of the <see cref="ScheduleFixedInterval" /> class.
        /// </summary>
        /// <param name="values">A list of timeseries values occuring at each timestep over the course of the simulation. (required).</param>
        /// <param name="scheduleTypeLimit">ScheduleTypeLimit object that will be used to validate schedule values against upper/lower limits and assign units to the schedule values. If None, no validation will occur..</param>
        /// <param name="timestep">An integer for the number of steps per hour that the input values correspond to.  For example, if each value represents 30 minutes, the timestep is 2. For 15 minutes, it is 4. (default to 1).</param>
        /// <param name="startDate">A list of two integers for [month, day], representing the start date when the schedule values begin to take effect.A third integer may be added to denote whether the date should be re-serialized for a leap year (it should be a 1 in this case)..</param>
        /// <param name="placeholderValue"> A value that will be used for all times not covered by the input values. Typically, your simulation should not need to use this value if the input values completely cover the simulation period. (default to 0D).</param>
        /// <param name="interpolate">Boolean to note whether values in between intervals should be linearly interpolated or whether successive values should take effect immediately upon the beginning time corresponding to them. (default to false).</param>
        /// <param name="identifier">Text string for a unique object ID. This identifier remains constant as the object is mutated, copied, and serialized to different formats (eg. dict, idf, osm). This identifier is also used to reference the object across a Model. It must be &lt; 100 characters, use only ASCII characters and exclude (, ; ! \\n \\t). (required).</param>
        /// <param name="displayName">Display name of the object with no character restrictions..</param>
        public ScheduleFixedInterval
        (
            string identifier, List <double> values,                                                                                                                                              // Required parameters
            string displayName = default, ScheduleTypeLimit scheduleTypeLimit = default, int timestep = 1, List <int> startDate = default, double placeholderValue = 0D, bool interpolate = false // Optional parameters
        ) : base(identifier: identifier, displayName: displayName)                                                                                                                                // BaseClass
        {
            // to ensure "values" is required (not null)
            this.Values            = values ?? throw new ArgumentNullException("values is a required property for ScheduleFixedInterval and cannot be null");
            this.ScheduleTypeLimit = scheduleTypeLimit;
            this.Timestep          = timestep;
            this.StartDate         = startDate;
            this.PlaceholderValue  = placeholderValue;
            this.Interpolate       = interpolate;

            // Set non-required readonly properties with defaultValue
            this.Type = "ScheduleFixedInterval";
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="ScheduleFixedInterval" /> class.
        /// </summary>
        /// <param name="values">A list of timeseries values occuring at each timestep over the course of the simulation. (required).</param>
        /// <param name="scheduleTypeLimit">ScheduleTypeLimit object that will be used to validate schedule values against upper/lower limits and assign units to the schedule values. If None, no validation will occur..</param>
        /// <param name="timestep">An integer for the number of steps per hour that the input values correspond to.  For example, if each value represents 30 minutes, the timestep is 2. For 15 minutes, it is 4. (default to 1).</param>
        /// <param name="startDate">A list of two integers for [month, day], representing the start date when the schedule values begin to take effect.A third integer may be added to denote whether the date should be re-serialized for a leap year (it should be a 1 in this case)..</param>
        /// <param name="placeholderValue"> A value that will be used for all times not covered by the input values. Typically, your simulation should not need to use this value if the input values completely cover the simulation period. (default to 0D).</param>
        /// <param name="interpolate">Boolean to note whether values in between intervals should be linearly interpolated or whether successive values should take effect immediately upon the beginning time corresponding to them. (default to false).</param>
        /// <param name="identifier">Text string for a unique object ID. This identifier remains constant as the object is mutated, copied, and serialized to different formats (eg. dict, idf, osm). This identifier is also used to reference the object across a Model. It must be &lt; 100 characters, use only ASCII characters and exclude (, ; ! \\n \\t). (required).</param>
        /// <param name="displayName">Display name of the object with no character restrictions..</param>
        /// <param name="userData">Optional dictionary of user data associated with the object.All keys and values of this dictionary should be of a standard data type to ensure correct serialization of the object (eg. str, float, int, list)..</param>
        public ScheduleFixedInterval
        (
            string identifier, List <double> values,                                                                                                                                                                         // Required parameters
            string displayName = default, Object userData = default, ScheduleTypeLimit scheduleTypeLimit = default, int timestep = 1, List <int> startDate = default, double placeholderValue = 0D, bool interpolate = false // Optional parameters
        ) : base(identifier: identifier, displayName: displayName, userData: userData)                                                                                                                                       // BaseClass
        {
            // to ensure "values" is required (not null)
            this.Values            = values ?? throw new ArgumentNullException("values is a required property for ScheduleFixedInterval and cannot be null");
            this.ScheduleTypeLimit = scheduleTypeLimit;
            this.Timestep          = timestep;
            this.StartDate         = startDate;
            this.PlaceholderValue  = placeholderValue;
            this.Interpolate       = interpolate;

            // Set non-required readonly properties with defaultValue
            this.Type = "ScheduleFixedInterval";

            // check if object is valid, only check for inherited class
            if (this.GetType() == typeof(ScheduleFixedInterval))
            {
                this.IsValid(throwException: true);
            }
        }
        public static void AddScheduleTypeLimit(this ModelEnergyProperties modelEnergyCollection, ScheduleTypeLimit scheduleTypeLimit)
        {
            modelEnergyCollection.ScheduleTypeLimits = modelEnergyCollection.ScheduleTypeLimits ?? new List <ScheduleTypeLimit>();
            var exist = modelEnergyCollection.ScheduleTypeLimits.Any(_ => _.Identifier == scheduleTypeLimit.Identifier);

            if (exist)
            {
                return;
            }
            switch (scheduleTypeLimit)
            {
            case ScheduleTypeLimit em:
                modelEnergyCollection.ScheduleTypeLimits.Add(em);
                break;

            default:
                throw new ArgumentException($"{scheduleTypeLimit.GetType()}({scheduleTypeLimit.Identifier}) is not added to model");
            }
        }
Ejemplo n.º 4
0
        /// <summary>
        /// Initializes a new instance of the <see cref="ScheduleRuleset" /> class.
        /// </summary>
        /// <param name="daySchedules">A list of ScheduleDays that are referenced in the other keys of this ScheduleRulesetAbridged. (required).</param>
        /// <param name="defaultDaySchedule">An identifier for the ScheduleDay that will be used for all days when no ScheduleRule is applied. This ScheduleDay must be in the day_schedules. (required).</param>
        /// <param name="scheduleRules">A list of ScheduleRuleAbridged that note exceptions to the default_day_schedule. These rules should be ordered from highest to lowest priority..</param>
        /// <param name="holidaySchedule">An identifier for the ScheduleDay that will be used for holidays. This ScheduleDay must be in the day_schedules..</param>
        /// <param name="summerDesigndaySchedule">An identifier for the ScheduleDay that will be used for the summer design day. This ScheduleDay must be in the day_schedules..</param>
        /// <param name="winterDesigndaySchedule">An identifier for the ScheduleDay that will be used for the winter design day. This ScheduleDay must be in the day_schedules..</param>
        /// <param name="scheduleTypeLimit">ScheduleTypeLimit object that will be used to validate schedule values against upper/lower limits and assign units to the schedule values. If None, no validation will occur..</param>
        /// <param name="identifier">Text string for a unique object ID. This identifier remains constant as the object is mutated, copied, and serialized to different formats (eg. dict, idf, osm). This identifier is also used to reference the object across a Model. It must be &lt; 100 characters, use only ASCII characters and exclude (, ; ! \\n \\t). (required).</param>
        /// <param name="displayName">Display name of the object with no character restrictions..</param>
        /// <param name="userData">Optional dictionary of user data associated with the object.All keys and values of this dictionary should be of a standard data type to ensure correct serialization of the object (eg. str, float, int, list)..</param>
        public ScheduleRuleset
        (
            string identifier, List <ScheduleDay> daySchedules, string defaultDaySchedule,                                                                                                                                                                                                    // Required parameters
            string displayName = default, Object userData = default, List <ScheduleRuleAbridged> scheduleRules = default, string holidaySchedule = default, string summerDesigndaySchedule = default, string winterDesigndaySchedule = default, ScheduleTypeLimit scheduleTypeLimit = default // Optional parameters
        ) : base(identifier: identifier, displayName: displayName, userData: userData)                                                                                                                                                                                                        // BaseClass
        {
            // to ensure "daySchedules" is required (not null)
            this.DaySchedules = daySchedules ?? throw new ArgumentNullException("daySchedules is a required property for ScheduleRuleset and cannot be null");
            // to ensure "defaultDaySchedule" is required (not null)
            this.DefaultDaySchedule      = defaultDaySchedule ?? throw new ArgumentNullException("defaultDaySchedule is a required property for ScheduleRuleset and cannot be null");
            this.ScheduleRules           = scheduleRules;
            this.HolidaySchedule         = holidaySchedule;
            this.SummerDesigndaySchedule = summerDesigndaySchedule;
            this.WinterDesigndaySchedule = winterDesigndaySchedule;
            this.ScheduleTypeLimit       = scheduleTypeLimit;

            // Set non-required readonly properties with defaultValue
            this.Type = "ScheduleRuleset";

            // check if object is valid, only check for inherited class
            if (this.GetType() == typeof(ScheduleRuleset))
            {
                this.IsValid(throwException: true);
            }
        }
Ejemplo n.º 5
0
        /// <summary>
        /// Initializes a new instance of the <see cref="ScheduleRuleset" /> class.
        /// </summary>
        /// <param name="daySchedules">A list of ScheduleDays that are referenced in the other keys of this ScheduleRulesetAbridged. (required).</param>
        /// <param name="defaultDaySchedule">An identifier for the ScheduleDay that will be used for all days when no ScheduleRule is applied. This ScheduleDay must be in the day_schedules. (required).</param>
        /// <param name="scheduleRules">A list of ScheduleRuleAbridged that note exceptions to the default_day_schedule. These rules should be ordered from highest to lowest priority..</param>
        /// <param name="holidaySchedule">An identifier for the ScheduleDay that will be used for holidays. This ScheduleDay must be in the day_schedules..</param>
        /// <param name="summerDesigndaySchedule">An identifier for the ScheduleDay that will be used for the summer design day. This ScheduleDay must be in the day_schedules..</param>
        /// <param name="winterDesigndaySchedule">An identifier for the ScheduleDay that will be used for the winter design day. This ScheduleDay must be in the day_schedules..</param>
        /// <param name="scheduleTypeLimit">ScheduleTypeLimit object that will be used to validate schedule values against upper/lower limits and assign units to the schedule values. If None, no validation will occur..</param>
        /// <param name="identifier">Text string for a unique object ID. This identifier remains constant as the object is mutated, copied, and serialized to different formats (eg. dict, idf, osm). This identifier is also used to reference the object across a Model. It must be &lt; 100 characters, use only ASCII characters and exclude (, ; ! \\n \\t). (required).</param>
        /// <param name="displayName">Display name of the object with no character restrictions..</param>
        public ScheduleRuleset
        (
            string identifier, List <ScheduleDay> daySchedules, string defaultDaySchedule,                                                                                                                                                                         // Required parameters
            string displayName = default, List <ScheduleRuleAbridged> scheduleRules = default, string holidaySchedule = default, string summerDesigndaySchedule = default, string winterDesigndaySchedule = default, ScheduleTypeLimit scheduleTypeLimit = default // Optional parameters
        ) : base(identifier: identifier, displayName: displayName)                                                                                                                                                                                                 // BaseClass
        {
            // to ensure "daySchedules" is required (not null)
            this.DaySchedules = daySchedules ?? throw new ArgumentNullException("daySchedules is a required property for ScheduleRuleset and cannot be null");
            // to ensure "defaultDaySchedule" is required (not null)
            this.DefaultDaySchedule      = defaultDaySchedule ?? throw new ArgumentNullException("defaultDaySchedule is a required property for ScheduleRuleset and cannot be null");
            this.ScheduleRules           = scheduleRules;
            this.HolidaySchedule         = holidaySchedule;
            this.SummerDesigndaySchedule = summerDesigndaySchedule;
            this.WinterDesigndaySchedule = winterDesigndaySchedule;
            this.ScheduleTypeLimit       = scheduleTypeLimit;

            // Set non-required readonly properties with defaultValue
            this.Type = "ScheduleRuleset";
        }