Atelier des rouesLab FR
Objects/Documentation

rotations30.py

When rotating a schedule changes its count · rotations30.py

Download ↓
"""Rotate a six-residue footprint. Compare order alone with the two-slot dwell rule."""
from itertools import combinations,product
from functools import lru_cache
from strate29 import accepts
from longueurs28 import transfer
import json

@lru_cache(None)
def local(n,d,visits,k):
    shifts={(d+j+5)%6:j for j in (-1,0,1)}
    prescribed=sorted((t,shifts[t%6]) for t in visits)
    changes=sum(a[1]!=b[1] for a,b in zip(prescribed,prescribed[1:]))
    return changes<=k,accepts(prescribed,6*n,k)

def study():
    base=(2,0,2)*2;cache={};out=[]

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.