def setUp(self): example_dir = get_script_dir() self.lock_example_1 = example_dir + "/lock_example_1" self.lock_example_2 = example_dir + "/lock_example_2" results = lock_example([self.lock_example_1, self.lock_example_2]) self.distilled = [] for (name, clusts) in results: if clusts is None: self.distilled.append((name, None)) else: new_distilled = [] for clust in clusts: new_distilled += [task.response_time - task.deadline for task in clust] self.distilled.append((name, new_distilled))
#Necessary includes and stuff from example.driver import nolock_example, lock_example, \ generate_random_nolock_sets, \ generate_random_lock_sets, print_bounds if __name__ == '__main__': #Actually run examples when this script is executed print "Running non-lock example" print_bounds(nolock_example(generate_random_nolock_sets())) print "Running lock example" print_bounds(lock_example(generate_random_lock_sets()))
#Necessary includes and stuff from example.driver import nolock_example, lock_example, \ generate_random_nolock_sets, \ generate_random_lock_sets, print_bounds if __name__ == '__main__': #Actually run examples when this script is executed print("Running non-lock example") print_bounds(nolock_example(generate_random_nolock_sets())) print("Running lock example") print_bounds(lock_example(generate_random_lock_sets()))