コード例 #1
0
ファイル: ccu.py プロジェクト: anenriquez/mrta
    parser.add_argument('--file',
                        type=str,
                        action='store',
                        help='Path to the config file')
    parser.add_argument('--experiment',
                        type=str,
                        action='store',
                        help='Experiment_name')
    parser.add_argument('--approach',
                        type=str,
                        action='store',
                        help='Approach name')
    args = parser.parse_args()

    config_params = get_config_params(args.file,
                                      experiment=args.experiment,
                                      approach=args.approach)
    config = Configurator(config_params, component_modules=_component_modules)
    components_ = config.config_ccu()

    kwargs = {
        "planner": Planner(**config_params.get("planner")),
        "performance_tracker": components_.get("performance_tracker")
    }

    for name, c in components_.items():
        if hasattr(c, 'configure'):
            c.configure(**kwargs)

    ccu = CCU(components_)
コード例 #2
0
ファイル: generator.py プロジェクト: anenriquez/mrta
if __name__ == '__main__':
    parser = argparse.ArgumentParser()
    parser.add_argument('experiment_name',
                        type=str,
                        action='store',
                        help='Experiment_name')
    group = parser.add_mutually_exclusive_group()
    group.add_argument('--approach',
                       type=str,
                       action='store',
                       default='tessi-corrective-preempt',
                       help='Approach name')
    group.add_argument('--all', action='store_true')
    args = parser.parse_args()

    config_params = get_config_params(experiment=args.experiment_name)
    experiment_config = config_params.get("experiment")

    robot_ids = config_params.get("fleet")
    dataset_module = config_params.get("dataset_module")
    datasets = config_params.get("datasets")
    bidding_rule = config_params.get("bidder").get("bidding_rule")
    experiments = list()

    logging.basicConfig(level=logging.DEBUG)

    logging.info("Getting results for experiment: %s", args.experiment_name)

    if args.all:
        approaches = config_params.get("approaches")
        for approach in approaches:
コード例 #3
0
ファイル: run.py プロジェクト: ropod-project/mrta
import subprocess

from mrs.config.params import approach_number
from mrs.config.params import get_config_params


def run(robot_ids, docker_compose_file):

    subprocess.call(["docker-compose", "-f", docker_compose_file, "build", "mrta"])

    for robot_id in robot_ids:
        subprocess.call(["docker-compose", "-f", docker_compose_file, "up", "-d", "robot_proxy_"+ str(robot_id.split("_")[1])])
        subprocess.call(["docker-compose", "-f", docker_compose_file, "up", "-d", str(robot_id)])

    subprocess.call(["docker-compose", "-f", docker_compose_file, "up", "-d", "ccu"])
    subprocess.call(["docker-compose", "-f", docker_compose_file, "up", "mrta"])


if __name__ == '__main__':
    parser = argparse.ArgumentParser()
    parser.add_argument('--file', type=str, action='store', help='Path to the config file')
    parser.add_argument('approach', type=str, action='store', help='Approach name')
    args = parser.parse_args()

    docker_compose_file_ = "docker_files/approach-" + approach_number.get(args.approach) + ".yaml"

    config_params = get_config_params(args.file, approach=args.approach)
    robot_ids_ = config_params.get("fleet")

    run(robot_ids_, docker_compose_file_)