|
@@ -192,21 +192,35 @@ Element function get_possible_bindings(host_model : Element, schedule_model : El
|
|
|
attributes = set_copy(attributes_copy)
|
|
|
log(" opt: " + option)
|
|
|
|
|
|
+ result = True
|
|
|
while (read_nr_out(attributes) > 0):
|
|
|
attribute = set_pop(attributes)
|
|
|
- log("Check attribute: " + attribute)
|
|
|
+ if (bool_not(string_startswith(attribute, "constraint_"))):
|
|
|
+ continue!
|
|
|
|
|
|
+ log("Check attribute: " + attribute)
|
|
|
value = read_attribute(schedule_model, current_element, attribute)
|
|
|
- func = get_func_AL_model(value)
|
|
|
- log("EXEC")
|
|
|
- result = func(host_model, option, attribute)
|
|
|
- log("Got result of constraint eval: " + cast_v2s(result))
|
|
|
-
|
|
|
- if (result):
|
|
|
- log("Adding")
|
|
|
- set_add(filtered_options, option)
|
|
|
+ // Attribute might be undefined, so skip if it is
|
|
|
+ if (element_neq(value, read_root())):
|
|
|
+ log("Read value: " + cast_e2s(value))
|
|
|
+ func = get_func_AL_model(value)
|
|
|
+ log("Func: " + cast_e2s(func))
|
|
|
+ log("EXEC")
|
|
|
+ result = func(host_model, option, attribute)
|
|
|
+ log("Got result of constraint eval: " + cast_v2s(result))
|
|
|
else:
|
|
|
- log("Dropping")
|
|
|
+ log("Attribute unconstrained, so add always")
|
|
|
+ result = True
|
|
|
+
|
|
|
+ if (bool_not(result)):
|
|
|
+ break!
|
|
|
+
|
|
|
+ // Check value of last result, which will be True if all passed, or False otherwise
|
|
|
+ if (result):
|
|
|
+ log("Adding")
|
|
|
+ set_add(filtered_options, option)
|
|
|
+ else:
|
|
|
+ log("Dropping")
|
|
|
|
|
|
options = filtered_options
|
|
|
return options!
|