Skip to content

Commit

Permalink
fixed error checking with deaggregation
Browse files Browse the repository at this point in the history
  • Loading branch information
Stanley Bak committed May 15, 2018
1 parent 6dc6918 commit 1045c50
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
10 changes: 7 additions & 3 deletions hylaa/engine.py
Expand Up @@ -95,10 +95,14 @@ def check_guards(self, state):
successor_mode = transition.to_mode

if successor_mode.is_error:
self.reached_error = True
assert isinstance(state.parent, ContinuousPostParent)

if self.settings.stop_when_error_reachable:
raise FoundErrorTrajectory("Found error trajectory")
# check it it came from an aggregation (and deaggregation is enabled)
if not isinstance(state.parent.star.parent, AggregationParent) or not self.settings.deaggregation:
self.reached_error = True

if self.settings.stop_when_error_reachable:
raise FoundErrorTrajectory("Found error trajectory")

# copy the current star to be the frozen pre-state of the discrete post operation
discrete_prestate_star = state.clone()
Expand Down
2 changes: 1 addition & 1 deletion hylaa/star.py
Expand Up @@ -97,7 +97,7 @@ def __init__(self, settings, center, basis_matrix, constraint_list, parent, mode

self.start_basis_matrix = None

self.parent = parent # object of type StarParent
self.parent = parent

assert isinstance(mode, LinearAutomatonMode)
self.mode = mode # the LinearAutomatonMode
Expand Down

0 comments on commit 1045c50

Please sign in to comment.