Beispiel #1
0
from core.runner import Runner
from core.hookup import ApiConnector
from core.util import get_handler_instances
from core.admin import AdminHandler

if __name__ == '__main__':
    connector = ApiConnector()
    handlers = get_handler_instances()
    admin_bot = None
    runner = Runner(connector, AdminHandler(connector, handlers, admin_bot),
                    handlers)
    runner.join()
Beispiel #2
0
# -*- coding: UTF-8 -*-
from core import rpc_server
from core.runner import Runner
from app import service

HOST = 'localhost'
PORT = 4000
if __name__ == '__main__':
    # Runner.add(rpc_server)
    Runner.add(service)

    Runner.run()
Beispiel #3
0
                        help='controller type',
                        choices=['PID', 'CLA'],
                        default="PID")

    args = parser.parse_args()

    world = CopterWorld()
    predictor = CopterSpeedPredictor(predictor_config)

    if args.controller == "CLA":
        controller = CopterCLAController(None)
    else:
        controller = CopterPIDController(None)

    runner = Runner(runner_config,
                    world,
                    predictor,
                    controller,
                    learning_enabled=args.learn,
                    target_y=args.target_y)

    runner.addLogger(ConsoleLogger(logger_config))
    if args.log:
        runner.addLogger(CsvLogger(logger_config, args.log))

    world.state['y'] = args.init_y
    runner.setTarget(args.target_y)

    while True:
        runner.tick()
Beispiel #4
0
    elif args.controller == "DronePID":
        controller = DronePIDController(None)
    elif args.controller == "unsupervised":
        controller = CopterTestingController(None)

    if args.guard == "copter":
        guard = CopterGuard()
    elif args.guard == "drone":
        guard = DroneGuard()
    else:
        guard = None

    runner = Runner(runner_config,
                    world,
                    predictor,
                    controller,
                    guard=guard,
                    learning_enabled=args.learn,
                    target_y=args.target_y,
                    final_target_y=args.final_target_y)

    runner.addLogger(ConsoleLogger(logger_config))
    if args.log:
        runner.addLogger(CsvLogger(logger_config, args.log))

    world.setup()
    world.setInitY(args.init_y)

    runner.newRun()

    while True:
        try:
def runner(custom_args, logger):
    """Initialize execution and callback pipeline when the execution end."""
    logger.info("Custom arguments: %s" % custom_args)
    custom_args.update({"logger": logger})
    run = Runner(**custom_args)
    yield run
from core.runner import Runner
from core.hookup import ApiConnector
from core.util import get_handler_instances
from core.admin import AdminHandler

if __name__ == '__main__':
    connector = ApiConnector()
    handlers = get_handler_instances()
    admin_bot = None
    runner = Runner(connector, AdminHandler(connector, handlers, admin_bot), handlers)
    runner.join()
import sys
from core.runner import Runner

# print(sys.argv)
# not using argparse for simplicity
if len(sys.argv) < 3 or len(sys.argv) > 3:
    print('''Usage:
        -python main.py target (Full URl) template/template path
        E.g: python https://example.com cves
        ''')

elif len(sys.argv) == 3:
    hello = Runner(sys.argv[1], sys.argv[2])
    # print(hello)
    hello.runenum()
    "pkglist": args.pkglist,
    "repo_rpms_update": args.repo_rpms_update,
    "repo": args.repo,
    "arch": args.arch,
    "repo_server_ip": args.repo_server_ip,
    "repo_server_user": args.repo_server_user,
    "repo_server_port": args.repo_server_port,
    "repo_server_pwd": args.repo_server_pwd,
    "latest_info": args.latest_info,
    "check_codes": args.check_codes,
    "check_pkg_service": args.check_pkg_service,
    "access_token": args.access_token,
    "pr_id": args.pr_id,
    "cm_id": args.cm_id,
    "sync_code": args.sync_code,
    "all": args.ALL_,
    "sync_gitee_to_obs": args.sync_gitee_to_obs,
    "get_latest_date": args.get_latest_date,
    "from_addr": args.from_addr,
    "from_addr_pwd": args.from_addr_pwd,
    "cc_addr": args.cc_addr,
    "obs_mail_notice": args.obs_mail_notice,
    "pckg_mgmt": args.pckg_mgmt,
    "release_management_path": args.remt,
    "check_pckg_mgmt": args.check_pckg_mgmt,
    "compare": args.compare
}

run = Runner(**kw)
run.run()
Beispiel #9
0
                        help='enable learning')
    parser.add_argument('--controller',
                        help='controller type',
                        choices=['PID', 'CLA'],
                        default="PID")

    args = parser.parse_args()

    world = CopterWorld()
    predictor = CopterSpeedPredictor(predictor_config)

    if args.controller == "CLA":
        controller = CopterCLAController(None)
    else:
        controller = CopterPIDController(None)

    runner = Runner(runner_config,
                    world, predictor, controller,
                    learning_enabled=args.learn,
                    target_y=args.target_y)

    runner.addLogger(ConsoleLogger(logger_config))
    if args.log:
        runner.addLogger(CsvLogger(logger_config, args.log))

    world.state['y'] = args.init_y
    runner.setTarget(args.target_y)

    while True:
        runner.tick()
Beispiel #10
0
    predictor = SatellitePhiPredictor(predictor_config)

    if args.world == "satellite":
        world = SatelliteWorld(world_config)
    else:
        print "no such world"
        exit

    if args.guard == "satellite":
        guard = SatelliteGuard()
    else:
        guard = None

    runner = Runner(runner_config,
                    world, predictor,
                    guard=guard,
                    learning_enabled=args.learn)

    runner.addLogger(ConsoleLogger(logger_config))
    if args.log:
        runner.addLogger(CsvLogger(logger_config, args.log))

    world.setup()
    world.setInitPhi(args.init_phi)

    runner.newRun()

    while True:
        try:
            runner.tick()
Beispiel #11
0
 def client(serial, port, app_name):
     Runner(serial, port, app_name).run()