From 85d4edf508fc9eed0e24a602feac9871f83b94ae Mon Sep 17 00:00:00 2001 From: grizzly Date: Fri, 19 Jul 2024 18:17:01 -0400 Subject: [PATCH] update --- scheduling/images/polyfit.svg | 436 +++++++++++++++++----------------- scheduling/scheduling.typ | 28 ++- 2 files changed, 244 insertions(+), 220 deletions(-) diff --git a/scheduling/images/polyfit.svg b/scheduling/images/polyfit.svg index 8035999..69880ae 100644 --- a/scheduling/images/polyfit.svg +++ b/scheduling/images/polyfit.svg @@ -6,7 +6,7 @@ - 2024-07-18T22:09:53.751451 + 2024-07-19T17:26:33.439337 image/svg+xml @@ -39,7 +39,7 @@ z - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + - - + - + - + - + - + - + @@ -213,12 +213,12 @@ z - + - + - + - + - + - + @@ -284,12 +284,12 @@ z - + - + @@ -300,12 +300,12 @@ z - + - + @@ -316,12 +316,12 @@ z - + - + @@ -425,12 +425,12 @@ z - - + @@ -453,7 +453,7 @@ z - + @@ -466,7 +466,7 @@ z - + @@ -479,7 +479,7 @@ z - + @@ -492,7 +492,7 @@ z - + @@ -540,7 +540,7 @@ z - + @@ -573,7 +573,7 @@ z - + @@ -672,174 +672,174 @@ z +L 162.370738 315.044245 +L 162.370738 255.752396 +L 215.08093 255.752396 +L 215.08093 196.460547 +L 267.791122 196.460547 +L 267.791122 137.168698 +L 320.501313 137.168698 +L 320.501313 315.044245 +L 373.211505 315.044245 +L 373.211505 315.044245 +L 425.921696 315.044245 +L 425.921696 255.752396 +L 478.631888 255.752396 +L 478.631888 196.460547 +L 531.34208 196.460547 +L 531.34208 315.044245 +L 584.052271 315.044245 +L 584.052271 255.752396 +L 636.762463 255.752396 +L 636.762463 196.460547 +L 689.472654 196.460547 +L 689.472654 137.168698 +L 742.182846 137.168698 +L 742.182846 315.044245 +L 794.893037 315.044245 +L 794.893037 137.168698 +L 847.603229 137.168698 +L 847.603229 315.044245 +L 900.313421 315.044245 +L 900.313421 196.460547 +L 953.023612 196.460547 +L 953.023612 137.168698 +L 1005.733804 137.168698 +L 1005.733804 196.460547 +L 1058.443995 196.460547 +L 1058.443995 315.044245 +L 1111.154187 315.044245 +L 1111.154187 255.752396 +" clip-path="url(#p6bfb98ea7b)" style="fill: none; stroke: #1f77b4; stroke-opacity: 0.5; stroke-width: 1.5; stroke-linecap: square"/> - + - + @@ -1290,7 +1290,7 @@ z - + diff --git a/scheduling/scheduling.typ b/scheduling/scheduling.typ index 52c8282..0e49ddd 100644 --- a/scheduling/scheduling.typ +++ b/scheduling/scheduling.typ @@ -26,7 +26,7 @@ This principle provide a mathematically proovable way for each task to determine = Polynomials Contrary to popular beliefs, polynomials are not boring. -Let us consider a problem with four tasks $(t_0,t_1,t_2,t_3)$ and a schedule array of 20 time period +Let us consider a problem with four tasks $(t_0,t_1,t_2,t_3)$ and a schedule array of 20 time periods $ A = [0,1,2,3,0,0,1,2,0,1,2,3,0,3,0,2,3,2,0,1] $ @@ -34,4 +34,28 @@ $ #figure( image("images/polyfit.svg", width:100%), caption: "Scheduling function defined as a polynomial fit of the scheduling array." -) +) + +== Clock Sensitivity +In order for every task to know when they can transmit, they all need to evaluate the scheduling function at the same times. +In the real world, that could be very difficult as the clock of each task can drift over time. +Some people suggested to use atomic clock chips as the RTC of clock so that, after a syncronisation phase, all timings across tasks would remain exact #footnote[Atomic clocks drift is estimated at one second per hunred million year (Wikipedia).]. +However, I suspect that the person proposing this solution have atomic clock in their office drawer and don't think of us, mere students, that do not have 6k to invest in a fancy clock. + +This raises the question; How sensitive is a scheduling function to clock imprecision? +After all, the function is exact on the start of the period but has no constraint during the period. +We define the clock sensitivity of a scheduling function $"cs"(s)$ as the maximum time delta around any period start without an incorrect task decision. +$ +"cs"(s) = max_(delta t)(s(tau_i plus.minus delta t) = A[tau_i]; forall tau_i) +$ + +Let us consider again the example displayed in @fig-polyfit. +As the degree of the polynomial grows to perfectly fit the schedul, extreme variations appear during the periods. +These extreme variations induce high derivative of the function at the sampling time that makes the clock sensitivity very small. + +== Problems with Polynomials +A single polynomial fitted to the schedul does not seem like a good approach as it require a very precise clock to obtain the correct values. +Moreover, storing the polynomial coefficient for the function requires at least as much memory as storing the schedule itself. +Finally, evaluating the function is more computation-intensive than looking up a value in a table. + += Regression, imprefect fit, and flatten scheduling array.