def create_new_experiment(link_id): session = Session() logging.info("Unexpected error:", sys.exc_info()[0]) logging.debug("Failed to read data_sum from DB, reloading from file") if link_id == "dummy": print("powerlaw graph selecteds") rs, su = clean_and_create_experiment(("powerlaw", (50, 2, 0.3, 1, 500000000, 20, 200,)), seed=5) else: print("links %s graph selected" % link_id) rs, su = clean_and_create_experiment(("links", (link_id,)), 5) tenant = Tenant(name=link_id) session.add(tenant) session.add(su) session.flush() return tenant, su, rs
parser.add_argument('--vcdnratio', help="the share of source traffic toward vcdn (default 0.35)", default=0.35, type=float) parser.add_argument('--sourcebw', help="cumulated source bw from every source (default 100 bits) ", default=100000000, type=int) parser.add_argument('--topo', help="specify topo to use", default=('grid', ["5", "5", "100000000", "10", "200"]), type=valid_topo) parser.add_argument('--disable-heuristic', dest="disable_heuristic", action="store_true") parser.add_argument('--dest_folder', help="destination folder for restults", default=RESULTS_FOLDER) args = parser.parse_args() # create the topology rs, su = clean_and_create_experiment(args.topo, args.seed) session = Session() tenant = Tenant() session.add(tenant) slas = generate_random_slas(rs, su, count=args.sla_count, user_count=1000, max_start_count=args.max_start, max_end_count=args.max_cdn, tenant=tenant,min_start_count=args.min_start, min_end_count=args.min_cdn) for sla in slas: try: logging.debug("full") service_no_heuristic, count_embedding_no_heuristic = optimize_sla(sla, automatic=True, use_heuristic=False) service_no_heuristic_mapping_objective_function = service_no_heuristic.mapping.objective_function except ValueError as e: service_no_heuristic_mapping_objective_function = float("nan") try: logging.debug("heuristic") service_yes_heuristic, count_embedding_yes_heuristic = optimize_sla(sla, automatic=True, use_heuristic=True)
default=('grid', ["5", "5", "100000000", "10", "200"]), type=valid_topo) parser.add_argument('--disable-heuristic', dest="disable_heuristic", action="store_true") parser.add_argument('--dest_folder', help="destination folder for restults", default=RESULTS_FOLDER) args = parser.parse_args() # create the topology rs, su = clean_and_create_experiment(args.topo, args.seed) session = Session() tenant = Tenant() session.add(tenant) slas = generate_random_slas(rs, su, count=args.sla_count, user_count=1000, max_start_count=args.max_start, max_end_count=args.max_cdn, tenant=tenant, min_start_count=args.min_start, min_end_count=args.min_cdn) for sla in slas: try: logging.debug("full") service_no_heuristic, count_embedding_no_heuristic = optimize_sla( sla, automatic=True, use_heuristic=False)