def _getCurrTrips(t, stps, ASet):
    """Get the current trips that has travelled to an activity set location."""
    # get the locations in activity set
    valid_stps = stps.loc[stps["locid"].isin(ASet["locid"].unique())]

    # consider trip that ends in valid stps
    valid_t = t.loc[t["nstpid"].isin(valid_stps["id"])]
    valid_t = valid_t[["id", "length_m", "dur_s", "nstpid"]]

    # enrich with loc id
    valid_t = valid_t.merge(valid_stps[["id", "locid"]], left_on="nstpid", right_on="id")
    valid_t.drop(columns={"id_y", "nstpid"}, inplace=True)

    # enrich with activity set class
    valid_t = valid_t.merge(ASet[["locid", "class"]], on="locid", how="left")
    valid_t.rename(columns={"locid": "nloc", "id_x": "tripid"}, inplace=True)

    return valid_t