def initialize(self, goal, us_has_initiative=False):
        """
        Initialize the Agenda at the beginning of each dialogue

        :param goal: the new goal for the current dialogue
        :param us_has_initiative: if the simulator has the initiative at the
                                  first turn
        :return: nothing
        """

        self.goal = goal

        self.clear()

        # Generate candidate actions
        dacts = []

        # If there are sub-goals
        # Iterate from last to first because the acts will be popped in
        # reverse order.
        for i in range(len(self.goal.subgoals)-1, -1, -1):
            sg = self.goal.subgoals[i]

            # Acknowledge completion of subgoal
            dacts.append(DialogueAct('ack_subgoal', []))

            for constr in sg.constraints.values():
                dacts.append(DialogueAct('inform', [constr]))

        for req in goal.requests.values():
            dacts.append((DialogueAct('request', [req])))

        for constr in goal.constraints.values():
            dacts.append(DialogueAct('inform', [constr]))

        # Push actions into the agenda
        self.push(DialogueAct('bye', []))

        for da in dacts:
            self.push(da, force=True)

        if us_has_initiative:
            self.push(DialogueAct('hello', []))

        Initialize the Agenda at the beginning of each dialogue

        :param goal: the new goal for the current dialogue
        :param us_has_initiative: if the simulator has the initiative at the
                                  first turn
        :return: nothing
        
plato/agent/component/user_simulator/agenda_based_user_simulator/agenda.py