#
# bike.py: Example code for integrating a GUI with PyGame
#     Requires:
#		ca2d.py for 2D CA simulation engine
# 		cadisplay.py for 2D CA display engine (mostly PyGame functions)
#		gui.py for graphical interface (mostly TkInter functions)
#
"""
	Cellular Automata simulation of bicycle traffic
	with a Tkinter GUI to input number of North-South bikes,
	East-West bikes, and number of time steps to run.
"""

CellSize = 6  # Pixels in a cell
N = 100       # Number of cells, CA is NxN cells
V = 1000	  # Number of vertical bikes
H = 1000	  # Number of horizontal bikes
numSteps = 50 # Number of iterations

# Create a CA object
from ca2d import ca2d
ca = ca2d(N,V,H)

# Initialize CA display engine
from cadisplay import SpDisplayState,InitCADisplay
InitCADisplay(ca,CellSize)
SpDisplayState(ca)

# Initialize TkInter and then build GUI
from gui import InitGUI
root = InitGUI(ca,numSteps)
# Add GUI "root" process to the main execution loop
root.mainloop()
