Objets/Documentation
charges12.py
Je fournis cette pièce pour examiner ou reproduire le contrôle AT.T5.
Télécharger ↓"""End-to-end periodic scheduling comparison with a materialised cycle."""
from bisect import bisect_left
from math import lcm
from random import Random
from statistics import median
from time import perf_counter_ns
import argparse,json,tracemalloc
from experience import Calendar
class Material:
def __init__(self,m,a,n,b):
self.period=lcm(m,n);self.ticks=[x for x in range(self.period) if x%m in a and x%n in b]
self.total=len(self.ticks)
def prefix(self,x):
k,r=divmod(x,self.period)
return k*self.total+bisect_left(self.ticks,r)