def deploy_chess_application(cls): gui = Task("GUI", Util.generate_random_cpu_cycles(), 1, Util.generate_random_input_data(), Util.generate_random_output_data(), False) update_chess = Task("UPDATE_CHESS", Util.generate_random_cpu_cycles(), 1, Util.generate_random_input_data(), Util.generate_random_output_data(), True) compute_move = Task("COMPUTE_MOVE", Util.generate_ci_cpu_cycles(), 2, Util.generate_ci_input_data(), Util.generate_ci_output_data(), True) output = Task("OUTPUT", Util.generate_random_cpu_cycles(), 1, Util.generate_random_input_data(), Util.generate_random_output_data(), False) chess_delay_dict = { gui: [(update_chess, num.randint(2, 10))], update_chess: [(compute_move, num.randint(2, 10))], compute_move: [(output, num.randint(2, 10))], output: [] } cls._mobile_app = MobileApplication(CHESS, chess_delay_dict)
def deploy_gps_navigator_application(cls): conf_panel = Task("CONF_PANEL", Util.generate_random_cpu_cycles(), 1, Util.generate_random_input_data(), Util.generate_random_output_data(), False) gps = Task("GPS", Util.generate_random_cpu_cycles(), 3, Util.generate_random_input_data(), Util.generate_random_output_data(), False) control = Task("CONTROL", Util.generate_ci_cpu_cycles(), 5, Util.generate_ci_input_data(), Util.generate_ci_output_data(), True) maps = Task("MAPS", Util.generate_di_cpu_cycles(), 5, Util.generate_di_input_data(), Util.generate_di_output_data(), True) path_calc = Task("PATH_CALC", Util.generate_di_cpu_cycles(), 2, Util.generate_di_input_data(), Util.generate_di_output_data(), True) traffic = Task("TRAFFIC", Util.generate_di_cpu_cycles(), 1, Util.generate_di_input_data(), Util.generate_di_output_data(), True) voice_synth = Task("VOICE_SYNTH", Util.generate_random_cpu_cycles(), 1, Util.generate_random_input_data(), Util.generate_random_output_data(), False) gui = Task("GUI", Util.generate_random_cpu_cycles(), 1, Util.generate_random_input_data(), Util.generate_random_output_data(), False) speed_trap = Task("SPEED_TRAP", Util.generate_random_cpu_cycles(), 1, Util.generate_random_input_data(), Util.generate_random_output_data(), False) gps_navigator_delay_dict = { conf_panel: [(control, num.randint(2, 10))], gps: [(control, num.randint(2, 10))], control: [(maps, num.randint(2, 10)), (path_calc, num.randint(2, 10)), (traffic, num.randint(2, 10))], maps: [(path_calc, num.randint(2, 10))], traffic: [(path_calc, num.randint(2, 10))], path_calc: [(voice_synth, num.randint(2, 10)), (gui, num.randint(2, 10)), (speed_trap, num.randint(2, 10))], voice_synth: [], gui: [], speed_trap: [] } cls._mobile_app = MobileApplication(GPS_NAVIGATOR, gps_navigator_delay_dict)