Skip to content

Commit

Permalink
[plugin-parsing] changed adversarial plugin parameter name 'state' to…
Browse files Browse the repository at this point in the history
… more appropriate 'transition'
  • Loading branch information
LucaKro committed Sep 9, 2024
1 parent 7e63947 commit 8c906f0
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions src/fpm/transformations/objects.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,9 +168,9 @@ def get_joint_state_value(state):
# print(f"Subject: {subj}, Predicate: {pred}, Object: {obj}")
########################################################
plugin_type = str(g.value(plugin, PL["plugin-type"]))
state = g.value(plugin, ST["state"])

if plugin_type == "initial":
state = g.value(plugin, ST["state"])
start_value = get_joint_state_value(state)

if not start_value:
Expand All @@ -192,17 +192,17 @@ def get_joint_state_value(state):
})

elif plugin_type == "adversarial":
if ST["Transition"] in g.value(state, RDF.type):
start_value = get_joint_state_value(g.value(state, ST["start-state"]))
end_value = get_joint_state_value(g.value(state, ST["end-state"]))
distance = float(g.value(plugin, PL["distance"]))
plugins.append({
"plugin_type": plugin_type,
"joint": joint_name,
"position_before": start_value,
"distance_to_trigger": distance,
"position_after": end_value
})
transition = g.value(plugin, ST["transition"])
start_value = get_joint_state_value(g.value(transition, ST["start-state"]))
end_value = get_joint_state_value(g.value(transition, ST["end-state"]))
distance = float(g.value(plugin, PL["distance"]))
plugins.append({
"plugin_type": plugin_type,
"joint": joint_name,
"position_before": start_value,
"distance_to_trigger": distance,
"position_after": end_value
})

# Build a dictionary for the instance for the jinja template
return {
Expand Down

0 comments on commit 8c906f0

Please sign in to comment.