#import "algorithms.typ": * #import "utils.typ": draw-algo, compute-total #set document(title: "Disk scheduling algorithms") #set page(width: auto, height: auto, margin: 1cm) #set text(font: "Source Sans 3") #let places = (53, 98, 193, 37, 14, 124, 65, 67) #let min = 0 #let max = 199 #let names = ("FCFS", "SSTF", "SCAN", "C-SCAN", "C-LOOK") #let places-lst = ( schedule-fcfs(places), schedule-sstf(places), schedule-scan(places, left, min, max), schedule-cscan(places, min, max), schedule-clook(places) ) #let graphs = places-lst.map( draw-algo.with(min: min, max: max ,width: 10) ) #let wraps = (false,) * 3 + (true,) * 2 #let compute-total = compute-total.with(min: min, max: max) #align(center, text(size: 1.2em)[*Disk scheduling algorithms*]) #table( columns: 2, inset: 0.5em, align: center + horizon, ..names.zip(places-lst, wraps).map(((name, places, wrap)) => { rotate( -90deg, reflow: true )[*#name* (total: #compute-total(places, wrap: wrap))] }).zip(graphs).flatten() )