from datetime import datetime


def make_sim_exp_names(config, n_exp):
    """Helper to create simulator directory names using datetime and config"""

    # Pull out some metadata
    date = datetime.now().strftime('%Y%m%d_%H%M%S')
    n_nonmot = config['exp_params']['n_non_motile']
    n_mot = config['exp_params']['n_motile']
    has_drift = config['exp_params'].get('drift') is not None

    exp_dirnames = []

    # Generate experiment names. One per repeat
    for ei in range(n_exp):
        flow_str = 'flow' if has_drift else 'static'
        exp_dirnames.append(f'{date}_dhm_{flow_str}_max{n_mot}_motile_max{n_nonmot}_nonmotile_grayscale_sim_{ei:02}')

    return exp_dirnames