O      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNSaferAn SCalendar is the product of a set of identifiers, which point to a set of available resources, and a Calendar.dSet of resources which can be reserved for the TimePeriod covered by the root node of the Calendar.aCalendar which covers the complete period of time over which a set of resources can be reserved.A Calendar is a recursive tree-structure whose nodes are TimePeriods representing the interval of time covered by them. TimeUnits are only encountered in the leaves since they represent specific days, or time units, of the Calendar. The unit of time of this Calendar library is a nominal day (or 86400 seconds). Each node of a Calendar also carries additional data according to the "top-nodes" algorithm: a Q set and a QNC set. For more information about the meaning of these sets visit: 1https://en.wikipedia.org/wiki/Top-nodes_algorithmIA Report represents a summary of important facts related to an SCalendar. 'The TimePeriod which the report covers. PThe set of total identifiers reservable in the SCalendar this Report belongs to. oThe set of total identifiers which have been reserved in a TimePeriod in the SCalendar related to this Report. qThe set of total identifiers which are still available in a Time<Period in the SCalendar related to this Report. A Cancellation is the product of a set of identifiers which point to resources previously reserved in a Calendar and a TimePeriod over which those resources were reserved.<Set of identifiers which point to resources to be cancelled.6TimePeriod over which the resources will be cancelled.A Reservation is the product of a set of identifiers and a TimePeriod over which the resources identified by the set will be reserved.7Set of identifiers which point to reservable resources.5TimePeriod over which the resources will be reserved.pThis data type is either a TimeInterval of the form (start-date, end-date) or a TimeUnit which, in this case, is a nominal day. The time unit of this calendar library is a nominal day, that is, 86400 seconds. TimeIntervals as well as TimeUnits are stored as UTCTime so that it is easy to transform results to local time or store results in databases as timestamps.qTimeIntervals represent the number of days that a node in a calendar covers from a start-date up to an end-date.iTimeUnits are only encountered in the leaves of a calendar and represent a specific day of the calendar.Check if a time-period t1 is included in a time-period t2. Note that neither a TimeUnit can be included in another TimeUnit nor a TimeInterval can be included in a TimeUnit. If two TimeIntervals are equal they are said to be included in one another.{Getter function to get the UTCTime start-date from a TimePeriod. For a TimeUnit the start-sate and the end-date are equal.Getter function to fet the UTCTime end-date from a TimePeriod. Again, for a TimeUnit the start-sate and the end-date are equal.This function transforms a TimeInterval into a TimeUnit in case that the start-date and end-date of that TimeInterval are equal.oGiven a year, a month and a day this function creates a time period which covers the specified number of days.PGiven a TimePeriod and a set of identifiers this function creates a reservation.QGiven a TimePeriod and a set of identifiers this function creates a cancellation.PGiven a year, a month, and a day this function creates a Calendar which covers the specified number of days. The TimePeriod in the root node of a Calendar does not exactly span the number of days specified in the function, but a number of days which is a power of 2 and which is greater than or equal to the number of days specified. 0This constructor additionally attaches a set of identifiers, which point to the available resources of the calendar. Thus, this function creates an SCalendar which is basically a Calendar with a set of resources which can be reserved over the period of time determined by the root node of the Calendar.$ Year.Month.Day.%Number of days covered by TimePeriod.-TimePeriod which the rerservation will cover.QSet of identifiers which point to the resources to be reserved from an SCalendar.-TimePeriod which the cancellation will cover.RSet of identifiers which point to the resources to be cancelled from an SCalendar.Year.Month.Day.'Number of days covered by the Calendar. Year.Month.Day.'Number of days covered by the Calendar.dSet of resources which can be reserved for the TimePeriod covered by the root node of the Calendar.O!"#  !"#   "!  O!"Safe /PQRS012345/01234/20134 /PQRS012345Safe789:TU;<=>?@ABCD789:;<=>?@ABCD97A@8CDB?<=>:;789:TU;<=>?@ABCDSafe EGiven an SCalendar of size 2^n, this function increases its size k times, that is, 2^(n+k). The new SCalendar is properly updated up to its root so that it will render the same results as the previous one. For example, given an SCalendar cZ of size 2^5=32, 'augmentCalendar c 3' would produce a new SCalendar of size 2^(5+3)=256.F#Given a quantity, this function determines if it is available in a TimePeriod for a specific SCalendar. Thus, it does not take into account the particular resources whose availability wants to be determined: it is only concerned with the availabilty of a quantity in a specific SCalendar.GaGiven a Reservation, this function determines if it is available in a SCalendar. A Reservation is the product of a set of identifiers which point to reservable resources and a TimePeriod over which those resources are to be reserved. Thus, this function checks if that particular set of resources is available for a TimePeriod in the given SCalendar.HThis function introduces a new Reservation in a Calendar. Note that since no availability check is performed before introducing the Reservation, here we use a plain Calendar. Thus this function is useful to introduce Reservations without any constraint, but that's why it must be used carefully since information can be lost due to the usage of the union set-operation to update the Q and QN sets in the Calendar.IcThis function is like reservePeriod' but adds a list of Reservations without any availabilty check.J}This function introduces a new Reservation in a SCalendar applying an availability check. This means that if the reservation conflicts with others already made in the SCalendar, it will no be introduced. Thus this function takes into account the set of reservable identifiers for the SCalendar to calculate the subset of available ones and introduce the Reservation if possible.KThis function is like reservePeriod but introduces several Reservations at once. It is important to note that if a Reservation in the list conflicts with others already made in the SCalendar, it will be excluded. Thus the order of the Reservations in the list matters, since if one Reservation passes the availability check but the next one does not, then latter will be excluded.LThis function removes reserved identifiers in a Calendar according to the Set of identifiers and TimePeriod specified in the Cancellation. Thus a Cancellation only affects the nodes whose upper or lower bounds are included in the TimePeriod of the Cancellation.METhis is like cancelPeriod but performs several Cancellations at once.NGiven a TimePeriod and a SCalendar, this function returns a Report which summarizes important data about the reserved and available identifiers in that SCalendar. ESCalendar to be augmented.9Number of times by which the SCalendar will be augmented.FQuantity of resources.MTimePeriod over which we want to determine the availability of the quantity.bSCalendar over which we want to determine the availability of the quantity in a Given TimePeriod.GHIJKLMN EFGHIJKLMN EFGHJKILMN EFGHIJKLMNV       !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVW&SCalendar-1.0.0-94jehDagnb9GaOQH6rCPFdTime.SCalendar.TypesTime.SCalendar.ZippersTime.SCalendar.InternalTime.SCalendar.Operations SCalendarcalUnitscalendarCalendarUnitNodeReport reportPeriod totalUnits reservedUnitsremainingUnits Cancellation cancUnits cancPeriod Reservation reservUnits reservPeriod TimePeriod TimeIntervalTimeUnit isIncludedgetFromgetTo toTimeUnitmakeTimePeriodmakeReservationmakeCancellationcreateCalendarcreateSCalendar powerOfTwooneDay$fEqTimePeriod$fShowTimePeriod$fEqReservation$fShowReservation$fEqCancellation$fShowCancellation $fEqReport $fShowReport $fEqCalendar$fShowCalendar $fEqSCalendar$fShowSCalendarCalendarZippergoLeftgoRightgoUpupToRoottoZipper $fShowCrumb $fEqCrumb daysBetweenintervalFitsCalendar getIntervalgetZipIntervalgetQMaxleftMostTopNoderightMostTopNode commonParent topMostNodesupdateQgoToNodeupdateCalendarcheckQuantAvailabilitycheckReservAvailabilityaugmentCalendarisQuantityAvailableisReservAvailablereservePeriod'reserveManyPeriods' reservePeriodreserveManyPeriods cancelPeriodcancelManyPeriods periodReportisValidInterval BreadcrumbsCrumb LeftCrumb RightCrumbgetQgetQN