You may find the correct version of the train-gate example that follows with the 4.1.19 version here.
The following contains an erroneous version of the train-gate example. Here is the appropriate query-file.
· Use UPPAAL (simulation, verification) to pin-point and explain the error(s).
· Having corrected the errors what is the minimum time one can guarantee between a train requesting access to the crossing and actually getting there?
· Now we assume that trains will have a priority according to their id. You can find a version of the train-gate example with the new scheduling-policy of the Gate here. What can be said about the correctness of the system. Investigate performance properties of the system (e.g. try identify the amount of time the various trains may be consecutively stopped within the first 1000 minutes). In which train would you prefer to be a passenger?
· Change the model so that a train can only make a new approach after some time MIN after having left the crossing. What is the minimum value of MIN that will ensure that no train is starved even under fixed priorities? For each train what is the minimum time one can guarantee between a train id is attempting to approach the crossing and actually leaving it?
We consider leader election in a ring topology.
We assume that each node of the ring has a unique identifier and a unique priority. The object of the algorithm is to have
all nodes identifying the (node with the) maximum priority (above this is node
2 which has priority 5). We consider the
LCR algorithm (Lann, Chang and Roberts), where each process sends its priority
around the ring. When a process receives
an incoming priority, it compares that priority to its own, it keeps passing
the priority; if it is less than its own, it discards the incoming priority; if
it is equal to its own, the process declares itself the leader.
We model the behavior of a process as a timed automaton
(template) in UPPAAL as illustrated left. The model and an associated query may
be found here (simpleleader3.xml, simpleleader3.q).
Q1. Simulate
your model to ensure that it corresponds to the informally given explanation
above.
Q2. Verify that
a leader eventually be elected (what does that mean)? What is the
maximum amount of time before the leader is elected?
Q3. What is the maximum number of priorities sent in
the network before the leader is elected?
Q4. What is the expected time before a leader is
elected? What is the probability that the leader is elected before 10
time-units.
Q5. What is the expected number of priorities sent before the leader is elected?
Q6. Modify the model so that priorities are only sent
(before MaxD time-units) with a certain probability (say 70%). Investigate the effect of this on the
properties (e.g. those above) of the protocol.
Q7. Investigate what happens if a node completely fails
(e.g. by the transmission probability being 0%).
Sport |
Economy |
Local News |
Comic Stip |
|
Kim |
2. 5 min |
4. 1 min |
3. 3 min |
1. 10 min |
Jüri |
1. 10 min |
2. 20 min |
3. 1 min |
4. 1 min |
Jan |
4. 1 min |
1. 13 min |
3. 11 min |
2. 11 min |
Wang |
1. 1 min |
2. 1 min |
3. 1 min |
4. 1 min |
Sport |
Economy |
Local News |
Comic Stip |
|
Kim |
2. 3-6 min |
4. 1-5 min |
3. 3-6 min |
1. 10-11 min |
Jüri |
1. 8-10 min |
2. 20-23 min |
3. 1-6 min |
4. 1-12 min |
Jan |
4. 1-3 min |
1. 13-20 min |
3. 11-23 min |
2. 11-13 min |
Wang |
1. 1-3 min |
2. 1-5 min |
3. 1-3 min |
4. 1-4 min |
In this exercise you are asked to design the control of a Machine (the control program) which will serve
a coffee craving Person (the
environment). As you can see above the person repeatedly (tries to) insert a
coin, (tries to) extract coffee after which (s)he will make a publication.
Between each action the person requires a suitable time-delay before being
ready to participate in the next one.
The machine takes some time for brewing the coffee and will time-out if
coffee has not been taken before a certain upper time-limit.
As a requirement we want the overall behaviour to ensure that the
indicated Observer experiences a
constant flow of publications from the system. In particular we want the
Observer to complain if at any time more than 8 time-units elapses between two
consecutive publications. Model the Machine and Observer in UPPAAL and analyse
the behaviour of the system. Try to determine the maximum brewing time
allowed by the Machine in order that the above requirement is met.
An initial sketch of a UPPAAL can be found here.
Model and analyze the following gossiping girls problem in UPPAAL. A number
of girls initially know one distinct secret each. Each girl has access to a
phone which can be used to call another girl to share their secrets. Each time
two girls talk to each other they always exchange all secrets with each other
(thus after the phone call they both know all secrets they knew together before
the phone call). The girls can communicate only in pairs (no conference calls)
but it is possible that different pairs of girls talk concurrently. For all of
the tasks below you should consider the following three scenarios:
· Scenario
1: all girls may directly call any other girl, thus telephone network is a
total graph.
· Scenario
2: only a single call in the entire network can take place at a time
· Scenario
3: the girls are organized in a linear chain
(with a first and last girl) restricting calls to be made between
neighboring persons.
Your tasks are as follows:
Hint: