import tempfile


def create_tmp_dir(tmp_dir, ref_suite_id, exp_suite_id, area):
    """
    Create directory tree for temporary data according to the following scheme.

        `tmp_dir`/`exp_suite_id`_vs_`ref_suite_id`_random/`area`_random

    :param str tmp_dir: Base temporary directory.
    :param str suite_id1: Suite ID of reference model run.
    :param str suite_id2: Suite ID of test model run.
    :param str area: Name of asssessment area.
    :returns: Path to area temporary directory.
    :rtype: str.
    """
    assessment_name = exp_suite_id + '_vs_' + ref_suite_id
    # create unique temporary folder in tmp dir
    _tmp_dir = tempfile.mkdtemp(prefix=assessment_name + '_', dir=tmp_dir)

    # create temporary folder for area
    area_tmp_dir = tempfile.mkdtemp(prefix=area + '_', dir=_tmp_dir)
    return area_tmp_dir