Objets/Documentation
arbre26.py
Deux suites pour forcer une perte de deux · arbre26.py
Télécharger ↓"""Minimal fork of indistinguishable FIFO requests at deadline one."""
from itertools import product,combinations
import json
from glouton23 import compare
from horizon25 import game
def study():
streams=[s for n in range(2,6) for s in product((1,2,6),repeat=n)]
rows=[]
for s in streams:
opt=compare(s,1)['opt']
def rest(j):return compare(s[j:],1)['opt'] if j<len(s) else 0
rows.append(dict(seq=s,opt=opt,regret=[max(s[:j])+rest(j)-opt for j in (1,2)]))
def first(same):
for a,b in combinations(rows,2):
if a['seq'][:2]!=b['seq'][:2] or (same and len(a['seq'])!=len(b['seq'])):continue