예제 #1
0
    def deploy_facerecognizer_application(cls):
        gui = Task("GUI", Util.generate_di_cpu_cycles(), 1,
                   Util.generate_di_input_data(),
                   Util.generate_di_output_data(), False)
        find_match = Task("FIND_MATCH", Util.generate_di_cpu_cycles(), 1,
                          Util.generate_di_input_data(),
                          Util.generate_di_output_data(), True)
        init = Task("INIT", Util.generate_di_cpu_cycles(), 2,
                    Util.generate_di_input_data(),
                    Util.generate_di_output_data(), True)
        detect_face = Task("DETECT_FACE", Util.generate_di_cpu_cycles(), 1,
                           Util.generate_di_input_data(),
                           Util.generate_di_output_data(), True)
        output = Task("OUTPUT", Util.generate_di_cpu_cycles(), 1,
                      Util.generate_di_input_data(),
                      Util.generate_di_output_data(), False)

        facerecognizer_delay_dict = {
            gui: [(find_match, num.randint(2, 10))],
            find_match: [(init, num.randint(2, 10)),
                         (detect_face, num.randint(2, 10))],
            init: [(detect_face, num.randint(2, 10))],
            detect_face: [(output, num.randint(2, 10))],
            output: []
        }

        cls._mobile_app = MobileApplication(FACERECOGNIZER,
                                            facerecognizer_delay_dict)
예제 #2
0
    def deploy_facebook_application(cls):
        # parameters are (name, millions of instructions, memory (Gb), input data (kb), output data (kb), offloadability)
        facebook_gui = Task("FACEBOOK_GUI", Util.generate_random_cpu_cycles(),
                            1, Util.generate_random_input_data(),
                            Util.generate_random_output_data(), False)
        get_token = Task("GET_TOKEN", Util.generate_random_cpu_cycles(), 1,
                         Util.generate_random_input_data(),
                         Util.generate_random_output_data(), True)
        post_request = Task("POST_REQUEST", Util.generate_random_cpu_cycles(),
                            2, Util.generate_random_input_data(),
                            Util.generate_random_output_data(), True)
        process_response = Task("PROCES_RESPONSE",
                                Util.generate_random_cpu_cycles(), 2,
                                Util.generate_random_input_data(),
                                Util.generate_random_output_data(), True)
        file_upload = Task("FILE_UPLOAD", Util.generate_di_cpu_cycles(), 2,
                           Util.generate_di_input_data(),
                           Util.generate_di_output_data(), False)
        apply_filter = Task("APPLY_FILTER", Util.generate_di_cpu_cycles(), 2,
                            Util.generate_di_input_data(),
                            Util.generate_di_output_data(), True)
        facebook_post = Task("FACEBOOK_POST", Util.generate_di_cpu_cycles(), 2,
                             Util.generate_di_input_data(),
                             Util.generate_di_output_data(), False)
        output = Task("OUTPUT", Util.generate_random_cpu_cycles(), 1,
                      Util.generate_random_input_data(),
                      Util.generate_random_output_data(), False)
        # Logger.write_log("############################# APPLICATION DEPLOYMENT #########################")
        # facebook_gui = Task("FACEBOOK_GUI", num.exponential(400), 1, 5, 1, False)
        # get_token = Task("GET_TOKEN", num.exponential(400), 1, 1, 1, True)
        # post_request = Task("POST_REQUEST", num.exponential(550), 2, 1, 5, True)
        # process_response = Task("PROCES_RESPONSE", num.exponential(550), 2, 1, 1, True)
        # file_upload = Task("FILE_UPLOAD", num.exponential(550), 2, num.exponential(500), num.exponential(500), False)
        # apply_filter = Task("APPLY_FILTER", num.exponential(800), 2, num.exponential(500), num.exponential(500), True)
        # facebook_post = Task("FACEBOOK_POST", num.exponential(600), 2, num.exponential(500), 5, False)
        # output = Task("OUTPUT", num.exponential(600), 1, 5, 5, False)

        facebook_delay_dict = {
            facebook_gui: [(get_token, num.randint(2, 10)),
                           (post_request, num.randint(2, 10))],
            get_token: [(post_request, num.randint(2, 10))],
            post_request: [(process_response, num.randint(2, 10))],
            process_response: [(file_upload, num.randint(2, 10))],
            file_upload: [(apply_filter, num.randint(2, 10))],
            apply_filter: [(facebook_post, num.randint(2, 10))],
            facebook_post: [(output, num.randint(2, 10))],
            output: []
        }

        cls._mobile_app = MobileApplication(FACEBOOK, facebook_delay_dict)
예제 #3
0
	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)
예제 #4
0
	def deploy_antivirus_application(cls):
		gui = Task("GUI", Util.generate_random_cpu_cycles(), 1, Util.generate_random_input_data(), Util.generate_random_output_data(), False)
		load_library = Task("LOAD_LIBRARY", Util.generate_di_cpu_cycles(), 1, Util.generate_di_input_data(), Util.generate_di_output_data(), True)
		scan_file = Task("SCAN_FILE", Util.generate_di_cpu_cycles(), 2, Util.generate_di_input_data(), Util.generate_di_output_data(), True)
		compare = Task("COMPARE", Util.generate_di_cpu_cycles(), 1, Util.generate_di_input_data(), Util.generate_di_output_data(), True)
		output = Task("OUTPUT", Util.generate_random_cpu_cycles(), 1, Util.generate_random_input_data(), Util.generate_random_output_data(), False)

		antivirus_delay_dict = {
			gui: [(load_library, num.randint(2, 10)), (scan_file, num.randint(2, 10))],
			load_library: [(compare, num.randint(2, 10))],
			scan_file: [(compare, num.randint(2, 10))],
			compare: [(output, num.randint(2, 10))],
			output: []
		}

		cls._mobile_app = MobileApplication(ANTIVIRUS, antivirus_delay_dict)