def automateSimulationArchive(self, filename, interval=None, walltime=None, step=None, deletefile=False):
        """
        This function automates taking snapshots during a simulationusing the Simulation Archive.
        Instead of using this function, one can also call simulationarchive_snapshot() manually
        to create snapshots.

        
        Arguments
        ---------
        filename : str
            Filename of the binary file.
        interval : float
            Interval between outputs in code units.
        walltime : float
            Interval between outputs in wall time (seconds). 
            Useful when using IAS15 with adaptive timesteps. 
        step : int
            Interval between outputs in number of timesteps. 
            Useful when outputs need to be spaced exactly.
        
        Examples
        --------
        The following example creates a simulation, then 
        initializes the Simulation Archive and integrates
        it forward in time. 

        >>> sim = rebound.Simulation()
        >>> sim.add(m=1.)
        >>> sim.add(m=1.e-3,x=1.,vy=1.)
        >>> sim.automateSimulationArchive("sa.bin",interval=1000.)
        >>> sim.integrate(1e8)

        The SimulationArchive can later be read in using the following syntax:

        >>> sa = rebound.SimulationArchive("sa.bin")
        >>> sim = sa[0]   # get the first snapshot in the SA file (initial conditions)
        >>> sim = sa[-1]  # get the last snapshot in the SA file

        """
        modes = sum(1 for i in [interval, walltime,step] if i != None)
        if modes != 1:
            raise AttributeError("Need to specify either interval, walltime, or step")
        if deletefile and os.path.isfile(filename):
            os.remove(filename)
        if interval:
            clibrebound.reb_simulationarchive_automate_interval(byref(self), c_char_p(filename.encode("ascii")), c_double(interval))
        if walltime:
            clibrebound.reb_simulationarchive_automate_walltime(byref(self), c_char_p(filename.encode("ascii")), c_double(walltime))
        if step:
            clibrebound.reb_simulationarchive_automate_step(byref(self), c_char_p(filename.encode("ascii")), c_ulonglong(step))
        self.process_messages()
This function automates taking snapshots during a simulationusing the Simulation Archive.
        Instead of using this function, one can also call simulationarchive_snapshot() manually
        to create snapshots.

        
        Arguments
        ---------
        filename : str
            Filename of the binary file.
        interval : float
            Interval between outputs in code units.
        walltime : float
            Interval between outputs in wall time (seconds). 
            Useful when using IAS15 with adaptive timesteps. 
        step : int
            Interval between outputs in number of timesteps. 
            Useful when outputs need to be spaced exactly.
        
        Examples
        --------
        The following example creates a simulation, then 
        initializes the Simulation Archive and integrates
        it forward in time. 

        >>> sim = rebound.Simulation()
        >>> sim.add(m=1.)
        >>> sim.add(m=1.e-3,x=1.,vy=1.)
        >>> sim.automateSimulationArchive("sa.bin",interval=1000.)
        >>> sim.integrate(1e8)

        The SimulationArchive can later be read in using the following syntax:

        >>> sa = rebound.SimulationArchive("sa.bin")
        >>> sim = sa[0]   # get the first snapshot in the SA file (initial conditions)
        >>> sim = sa[-1]  # get the last snapshot in the SA file