add time_constraints.py and test code into main.py