|
@@ -17,12 +17,14 @@ Element function make_matching_schedule(schedule_model : Element, LHS : String,
|
|
|
String next
|
|
|
Element tmp
|
|
|
String elem_id
|
|
|
+ Element scheduled
|
|
|
|
|
|
Element reverse
|
|
|
reverse = make_reverse_dictionary(schedule_model["model"])
|
|
|
|
|
|
// Initialize
|
|
|
schedule = list_create()
|
|
|
+ scheduled = set_create()
|
|
|
workset = set_create()
|
|
|
all_elements = allAssociationDestinations(schedule_model, LHS, "LHS_contains")
|
|
|
full_all_elements = set_copy(all_elements)
|
|
@@ -34,7 +36,7 @@ Element function make_matching_schedule(schedule_model : Element, LHS : String,
|
|
|
// workset is empty, but we still need to add to the list
|
|
|
// Therefore, we pick a random, unbound node, and add it to the workset
|
|
|
new_element = set_pop(all_elements)
|
|
|
- while (bool_or(list_in(schedule, new_element), is_edge(schedule_model["model"][new_element]))):
|
|
|
+ while (bool_or(set_in(scheduled, new_element), is_edge(schedule_model["model"][new_element]))):
|
|
|
// Element is not usable, so pick another one
|
|
|
new_element = set_pop(all_elements)
|
|
|
set_add(workset, new_element)
|
|
@@ -45,10 +47,11 @@ Element function make_matching_schedule(schedule_model : Element, LHS : String,
|
|
|
next = set_pop(workset)
|
|
|
|
|
|
// Check if element might not be already used somewhere
|
|
|
- if (bool_not(list_in(schedule, next))):
|
|
|
+ if (bool_not(set_in(scheduled, next))):
|
|
|
if (set_in(full_all_elements, next)):
|
|
|
if (bool_not(set_in(ignore, read_attribute(schedule_model, next, "label")))):
|
|
|
list_insert(schedule, next, 0)
|
|
|
+ set_add(scheduled, next)
|
|
|
else:
|
|
|
required_size = required_size - 1
|
|
|
continue!
|