def candidates
stelliferous@0.0.2.0 · kernel_planning.bend:209
import stelliferous@0.0.2.0/kernel_planning.bend as KernelPlanning
import Base
import stelliferous@0.0.2.0/kernel_cost.bend as Cost
209def candidates(remaining: Nat,allowed: Bool,+depth: U32,+tasks: U32,+ceiling: U32,+workers: U32,+span: U32,+work: Work,+config: Cost.Configuration,
210 +budget: Maybe<&2,Nat>,best: Plan) -> Plan:
211 match remaining allowed:
212 case 0n allowed: best
213 case 1n+rest False{}: best
214 case 1n+rest True{}:
215 +next_tasks = (tasks * 2 : U32)
216 candidates(rest,U32.is_le(tasks,(ceiling / 2 : U32)) && U32.is_le(1,(span / 8 / next_tasks : U32)),
217 (depth + 1 : U32),next_tasks,ceiling,workers,span,work,config,budget,
218 candidate(depth,work,config,budget,workers,movement(U32.to_nat(depth),0,span,root_rows(work),work,config),best))