def send_load(randomize, interval): cfg = Config() if randomize: cfg.randomize_configuration() run_meeting(cfg, interval) time.sleep(interval) run_recording(cfg, interval)
def main(): env = gym.make('MineRLTreechopVectorObf-v0') config = Config() exe = Execute(env, config) for i in range(100000): exe.train_step() exe.itr += 1 exe.save_model()
from utility.config import Config status_config = Config(name='status', class_name='Status', inputs=None, outputs=None, is_active=True, is_threaded=False) barrelwriter_cfg = Config(name='barrelwriter', class_name='BarrelWriter', inputs=['throttle', 'angle', 'image_frame'], outputs=None, is_active=True, is_threaded=False, parameters=['status', 'logger']) barrelreader_cfg = Config(name='barrelreader', class_name='BarrelReader', inputs=None, outputs=None, is_active=True, is_threaded=False) utility_modules = { status_config.name: status_config, barrelwriter_cfg.name: barrelwriter_cfg, barrelreader_cfg.name: barrelreader_cfg } utility_config = Config(name='utility', modules=utility_modules)
def setUp(self): self.conf = Config() self.worker = Worker(self.conf) self.soup = self.worker.load()
from utility.version import VERSION from utility.configReader import cmd_parser from pathlib import Path from utility.config import Config __version__ = VERSION try: app_dir = Path(__file__).resolve().parent except NameError: app_dir = Path(".") cmd_args = cmd_parser.parse_args() config = Config(cmd_args, app_dir) def main(): import importlib codefile_package = "codefile" codefile_interface_name = "CodeFileInterface" codefile_dir = app_dir / codefile_package for codefile_file in codefile_dir.glob("*.py"): codefile_name = codefile_file.stem if codefile_name == "__init__": continue module = importlib.import_module("." + codefile_name,
""" Define a generic interface for each controller module Usage: Defines a constant configuration for any added controller with the following constrains: Threaded, Inputs, Outputs, is the module currently in use? (Active) """ from utility.config import Config # Motor Configuration motor_inputs = [ {'input_name': 'movement_dir', 'input_type': 'integer'} ] motor_outputs = None motor_config = Config(name='motor', class_name='Motor', inputs=motor_inputs, outputs=motor_outputs, is_active=True, is_threaded=False) # Servo Configuration servo_inputs = [ {'input_name': 'direction', 'input_type': 'integer'} ] servo_outputs = None servo_config = Config(name='servo', class_name='Servo', inputs=servo_inputs, outputs=servo_outputs, is_active=True, is_threaded=False) # Gamepad Configuration gamepad_inputs = None gamepad_outputs = [ {'output_name': 'movement_dir', 'output_type': 'integer'}, {'output_name': 'direction', 'output_type': 'integer'} ]
Define a generic interface for each pilot module Usage: Defines a constant configuration for any added pilot with the following constrains: Threaded, Inputs, Outputs, is the module currently in use? (Active) """ from utility.config import Config # Agent agent_inputs = [{'input_name': 'image_frame', 'input_type': 'sarray'}] agent_outputs = [{ 'output_name': 'movement_dir', 'output_type': 'integer' }, { 'output_name': 'direction', 'output_type': 'integer' }] agent_config = Config(name='driving_nn', class_name='DrivingNeuralNetwork', inputs=agent_inputs, outputs=agent_outputs, is_active=True, is_threaded=True, parameters=['car', 'logger']) # Package Configuration pilot_modules = {agent_config.name: agent_config} pilot_config = Config(name='Pilot', modules=pilot_modules)
Define a generic interface for each sensor module Usage: Defines a constant configuration for any added sensor with the following constrains: Threaded, Inputs, Outputs """ from utility.config import Config # Ultrasonic Configuration us_inputs = None us_outputs = [{'output_name': 'us_frame', 'output_type': 'FrameDict'}] us_config = Config(name='ultrasonic', class_name='UltrasonicFrame', inputs=us_inputs, outputs=us_outputs, is_active=True, is_threaded=True, parameters=['status']) # Picam Configuration picam_inputs = None picam_outputs = {'output_name': 'image_frame', 'output_type': 'sarray'} picam_config = Config(name='camera', class_name='PiCamera', inputs=picam_inputs, outputs=picam_outputs, is_active=True, is_threaded=True, parameters=['car', 'status', 'driving_nn'])