def calc_fitness(fit_form, sum_energy, coef_energy, sum_rmsd, coef_rmsd):
    """Calculate the fitness of a pmem.

    Parameters
    ----------
    fit_form : int
        Represents the fitness formula to use.
        The only value currently available is 0,
        where fitness = CE*SE + Crmsd*Srmsd.
    sum_energy : float
        The summation of all of the individual
        energy calculations for each of the geometries.
    coef_energy : float
        The energy coefficient in the fitness formula.
    sum_rmsd : float
        The summation of all rmsd when comparing
        pairs of geometries.
    coef_rmsd : float
        The rmsd coefficient in the fitness formula.

    Raises
    ------
    ValueError
        The fit_form value is not available.

    Returns
    -------
    fitness : float

    """
    if fit_form == 0:
        return sum_energy*coef_energy + sum_rmsd*coef_rmsd
    raise ValueError("Unsupported fitness formula.")