Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix SAYNT double free issues #45

Merged
merged 3 commits into from
Sep 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions paynt/quotient/storm_pomdp_control.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,12 +178,14 @@ def interactive_storm_start(self, storm_timeout):

control_thread.join()

self.belief_explorer = belmc.get_interactive_belief_explorer()

# resume interactive belief model checker, should be called only after belief model checker was previously started
def interactive_storm_resume(self, storm_timeout):
control_thread = Thread(target=self.interactive_control, args=(belmc, False, storm_timeout,))

if self.storm_terminated:
logger.info("Storm already terminated")
return

logger.info("Interactive Storm resumed")
control_thread.start()

Expand Down Expand Up @@ -234,7 +236,7 @@ def interactive_control(self, belmc, start, storm_timeout):
# Update cut-off FSC values provided by PAYNT
if not start:
logger.info("Updating FSC values in Storm")
self.belief_explorer.set_fsc_values(self.paynt_export)
belmc.set_fsc_values(self.paynt_export)
belmc.continue_unfolding()

# wait for Storm to start exploring
Expand All @@ -245,6 +247,7 @@ def interactive_control(self, belmc, start, storm_timeout):

sleep(storm_timeout)
if self.storm_terminated:
logger.info("Storm terminated")
return
logger.info("Pausing Storm")
belmc.pause_unfolding()
Expand Down
1 change: 1 addition & 0 deletions paynt/synthesizer/synthesizer_pomdp.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@ def strategy_iterative_storm(self, unfold_imperfect_only, unfold_storm=True):
self.storm_control.paynt_export = self.quotient.extract_policy(assignment)
self.storm_control.paynt_bounds = self.quotient.specification.optimality.optimum
self.storm_control.paynt_fsc_size = self.quotient.policy_size(self.storm_control.latest_paynt_result)
self.storm_control.latest_paynt_result_fsc = self.quotient.assignment_to_fsc(self.storm_control.latest_paynt_result)

self.storm_control.update_data()

Expand Down