def AddTrip(self, schedule=None, headsign=None, service_period=None,
              trip_id=None):
    """Add a trip to this route.

    Args:
      schedule: a Schedule object which will hold the new trip or None to use
        the schedule of this route.
      headsign: headsign of the trip as a string
      service_period: a ServicePeriod object or None to use
        schedule.GetDefaultServicePeriod()
      trip_id: optional trip_id for the new trip

    Returns:
      a new Trip object
    """
    if schedule is None:
      assert self._schedule is not None
      schedule = self._schedule
    if trip_id is None:
      trip_id = util.FindUniqueId(schedule.trips)
    if service_period is None:
      service_period = schedule.GetDefaultServicePeriod()
    trip_class = self.GetGtfsFactory().Trip
    trip_obj = trip_class(route=self, headsign=headsign,
                service_period=service_period, trip_id=trip_id)
    schedule.AddTripObject(trip_obj)
    return trip_obj
Add a trip to this route.

    Args:
      schedule: a Schedule object which will hold the new trip or None to use
        the schedule of this route.
      headsign: headsign of the trip as a string
      service_period: a ServicePeriod object or None to use
        schedule.GetDefaultServicePeriod()
      trip_id: optional trip_id for the new trip

    Returns:
      a new Trip object