@orca.step()
def mandatory_scheduling(set_random_seed,
                         mandatory_tours_merged,
                         tdd_alts,
                         tdd_school_spec,
                         tdd_work_spec):
    """
    This model predicts the departure time and duration of each activity for
    mandatory tours
    """

    tours = mandatory_tours_merged.to_frame()
    alts = tdd_alts.to_frame()

    school_spec = tdd_school_spec.to_frame()
    school_tours = tours[tours.tour_type == "school"]

    print "Running %d school tour scheduling choices" % len(school_tours)

    school_choices = vectorize_tour_scheduling(school_tours, alts, school_spec)

    work_spec = tdd_work_spec.to_frame()
    work_tours = tours[tours.tour_type == "work"]

    print "Running %d work tour scheduling choices" % len(work_tours)

    work_choices = vectorize_tour_scheduling(work_tours, alts, work_spec)

    choices = pd.concat([school_choices, work_choices])

    print "Choices:\n", choices.describe()

    orca.add_column(
        "mandatory_tours", "tour_departure_and_duration", choices)
dataset/ETHPy150Open UDST/activitysim/activitysim/defaults/models/mandatory_scheduling.py/mandatory_scheduling/original