from OS_class import *

os = OS()

# MARK: name and delay
os.name = "Glider 2+3"
os.delay = 3

# MARK: bead types
os.categoryColors = { 
	"G": {"name": "red500"} ,
	"H": {"name": "lightBlue500"}, 
}

# MARK: rule
n = 8
G = ["G{}".format(i) for i in range(n)]
for i in range(n):
	os.add_attraction(G[i], G[(i+2)%n])

k = 2
m = 6*k
H = ["H{}".format(i) for i in range(m)]
for i in range(k):
	os.add_attraction_pairs(H, H, [(6*i, 6*i+5), (6*i+3, 6*i+8)])

os.add_attraction_pairs(G, H, [(n-2,0), (n-1,1), (n-1,2)])
os.add_attraction_pairs(H, G, [(m-2,0), (m-1,1)])

# MARK: seed conformation
os.seedConformation = [ G[0], NE, G[1], SE, G[2] ]

# MARK: transcript prefix and period
declarations = [	
	OS.declare("glider2", G),
	OS.declare("glider3", H),
	OS.declare("glider2+3", ["glider2", "glider3"]),
]
os.compactTranscriptPrefix = [
	declarations,
	OS.unfold(3, n, "glider2"),
]
os.compactTranscriptPeriod = [
	declarations,
	"glider2+3",
]
os.transcriptPeriodCount = 10

# MARK: save

os.save_as_json()
