Atelier des rouesLab FR
Objects/Documentation

hasard27.py

Randomizing the first delivery · hasard27.py

Download ↓
"""Exact randomized regret for two fixed streams, checked over complete decision trees."""
from fractions import Fraction as F
from itertools import product
from glouton23 import compare
from arbre26 import study as parent
import json

def schedules(seq):
    if not seq:return [((),0)]
    return [((j,*cuts),max(seq[:j])+cost) for j in range(1,min(2,len(seq))+1) for cuts,cost in schedules(seq[j:])]

def decisions(seq,schedule):
    i=0;d={}
    for k in schedule:
        d[(i,tuple(seq[:i+2]))]=k;i+=k
    return d

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.