Atelier des rouesLab FR
Objects/Documentation

arbre26.py

Two streams forcing a loss of two · arbre26.py

Download ↓
"""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

Read in context

Comments

Comments from both language editions appear here.

The discussion is open for reading. I’ll enable submissions once spam protection is configured.