class SingleRunner:
    """SingleRunner class for executing a single simulation run."""

    def __init__(self, world):
        """
        Initialize a SingleRunner.

        Args:
            world: The initialized world state from WorldBuilder
            schedule: Schedule instance for managing simulation events
        """
        self.world = world
        self.schedule = world.schedule
        self.is_running = False

    def run(self, stopping_condition):
        """
        Execute the simulation until the stopping condition is met.

        Args:
            stopping_condition: Function that returns True when simulation should stop
        """
        self.is_running = True
        while not stopping_condition(self.schedule) and self.is_running:
            event = self.schedule.execute_next_event()
            if event is None:
                break
            # Execute the event (assumed to be callable)
            event()

    def stop(self):
        """Stop the simulation."""
        self.is_running = False

    def get_results(self):
        """
        Get the results from the simulation.

        Returns:
            Simulation results (data, metrics, etc.)
        """
        # TODO: Implement results collection
        pass

    def __repr__(self):
        return f"SingleRunner(running={self.is_running})"