def METHOD_NAME(self):
    """
    Update the next scheduled time of each agent and terminate those who have finished their schedule, in case of any miss.
    """
    now = datetime.now()
    session = Session()
    scheduled_agents = session.query(AgentSchedule).filter(
        AgentSchedule.start_time <= now, AgentSchedule.next_scheduled_time <= now,
        AgentSchedule.status == "SCHEDULED").all()
    for agent in scheduled_agents:
        if (now - agent.next_scheduled_time).total_seconds() < AgentScheduleHelper.AGENT_SCHEDULE_TIME_INTERVAL:
            continue
        if agent.recurrence_interval is not None:
            interval_in_seconds = parse_interval_to_seconds(agent.recurrence_interval)
            time_diff = now - agent.start_time
            num_intervals_passed = time_diff.total_seconds() // interval_in_seconds
            updated_next_scheduled_time = agent.start_time + timedelta(
                seconds=(interval_in_seconds * (num_intervals_passed + 1)))
            agent.next_scheduled_time = updated_next_scheduled_time
        else:
            agent.status = "TERMINATED"
        session.commit()
    session.close()