def _build_executable_model(mediator, context):
    # set the name of the EMAModel
    name = mediator.name

    # set the dir path for the model
    model_dir_path = mediator.model['dir']

    # set the name of the model
    model_file = mediator.model['name']

    # set the dir path where NetLogo is located
    netlogo_home = mediator.netlogo['dir']

    # set the NetLogo version
    netlogo_version = mediator.netlogo['version']

    # create the NetLogoModel object
    ema_model = NetLogoModel(name=name,
                             wd=model_dir_path,
                             model_file=model_file,
                             netlogo_home=netlogo_home,
                             netlogo_version=netlogo_version,
                             gui=False)

    # set the max run length of this model
    ema_model.run_length = context.max_run_length

    # set the number of replications
    ema_model.replications = context.num_replications

    uncertainties, outcomes, constants = _determine_parameters(
        mediator, context)
    ema_model.uncertainties = uncertainties
    ema_model.outcomes = outcomes
    ema_model.constants = constants
    return ema_model