Answered step by step
Verified Expert Solution
Question
1 Approved Answer
A malfunctioning garage door opener is defined by the transition graph below. Unfortunately, 8 0 % of the time the system transitions from 'door opening'
A malfunctioning garage door opener is defined by the transition graph below.
Unfortunately, of the time the system transitions from
'door opening' to 'door closing'. Write a Python simulation of
the system and simulate for a predefined number of time
steps to see if the system models the specification. If not,
output the counterexample. Base your code on the example
given in class. Include your code and an example output.
Consider including the following in your code:
# the atoms of the system
# the events
# the states of the system
# the state transition relation
# OPENING has chance of jumping directly to CLOSING by defn.
# the labeling function
# Define the event function.
def geteventcurrentstate:
# Define the decision function based on LTL formulas.
def holdpropertiescurrentstate, nextstate:
# Perform probabilistic state transition, return next state
def transitioncurrentstate:
# Simulate state transitions
def simulate initialstate, numsteps:
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started