Пример #1
0
def run_tests(requests, optimal_length, name):
    print "Running test: " + name
    print "Requests: " + str(requests)
    requests_copy = requests

    start = time.time()
    schedule = create_schedule(requests)
    end = time.time()

    print "Schedule: " + str(schedule)
    print "Time to compute schedule : " + str(end - start) + " seconds"

    verify(requests_copy, schedule, optimal_length)
    print ""
Пример #2
0
def run_tests(requests, optimal_length, name):
  print "Running test: " + name
  print "Requests: " + str(requests)
  requests_copy = requests
  
  start = time.time()
  schedule = create_schedule(requests)
  end = time.time()
  
  print "Schedule: " + str(schedule)
  print "Time to compute schedule : " + str(end - start) + " seconds"
  
  verify(requests_copy, schedule, optimal_length)
  print ""
Пример #3
0
def run_tests_from_file(filename, name, should_print):
    print "Running test: " + name
    [optimal_length, requests] = pickle.load(open(filename, 'rb'))
    if should_print: print "Requests: " + str(requests)
    requests_copy = requests

    start = time.time()
    schedule = create_schedule(requests)
    end = time.time()

    if should_print: print "Schedule: " + str(schedule)
    print "Time to compute schedule : " + str(end - start) + " seconds"

    verify(requests_copy, schedule, optimal_length)
    print ""
Пример #4
0
def run_tests_from_file(filename, name, should_print):
  print "Running test: " + name
  [optimal_length, requests] = pickle.load(open(filename, 'rb'))
  if should_print: print "Requests: " + str(requests)
  requests_copy = requests
  
  start = time.time()
  schedule = create_schedule(requests)
  end = time.time()
  
  if should_print: print "Schedule: " + str(schedule)
  print "Time to compute schedule : " + str(end - start) + " seconds"
  
  verify(requests_copy, schedule, optimal_length)
  print ""