@staticmethod
def activity_2_freq(trace):
    """For a given trace, return a mapping from activity to frequency in trace.

        Parameters
        ----------
        trace: `tuple` of `str`
            a trace as a tuple of activities

        Returns
        -------
        `dict`
            mapping from activity to frequency in trace
        """
    d = {}
    for a in trace:
        if a not in d:
            d[a] = 0
        d[a] += 1
    return d
