How can we calculate how long an elevator ride takes?
Well let's draw a picture.
the elevator can be as places of a Petri net.
it is actually a Petri net that we have here.
We have the places for the positions.
That means there's a place for floor zero, floor one, floor two, and floor three.
If the elevator has the doors closed, then that's one place.
And if the elevator has the doors open, that's another place.
Then we can draw the elevators as tokens.
there's an elevator with the doors open on floor two.
of course an elevator can do an action going up or going down.
So now we have a picture.
floor two with the doors open to floor zero with the doors closed.
It's hard to tell, right?
It completely depends on your further interpretation of this picture.
For example, how long does it take to close a door?
How long does it take to go up or down with the elevator?
if you've got a really fast elevator, or it could be minutes or hours.
is by just writing some timing information next to the actors.
Here we've got an example.
the close actions as well.
Well, doesn't take that long to open and close a door.
depending a bit on between which floors you are.
doors already closed, to floor three, doors open?
Right, that's still hard to tell because what does the 29 mean exactly.
Does it take exactly 29 seconds to go up with an elevator?
I guess it will take different amount of time every time the elevator is loaded.
it could mean at most, it could mean approximately 29 seconds.
in this course we're going to take the worst case time.
near an action to execute that action.
from floor zero, open doors, to floor three, closed doors?
then the 30 seconds for going up.
And then 29 for going up.
And then the 23 for going up.
Well, that is one possibility.
follows to go from floor zero to floor three, right?
why not close the doors, open them again, close them.
Open them. Pick up somebody else.
Bring them to floor one.
Go up all the way to floor three.
Open the doors and then finally get out.
on what schedule the elevator is following.
let's just write some schedule that we're interested in for today.
elevator, the elevator that is now on floor one.
down, down, open it, close it, up, up, and open it.
We represent that as a data flow graph.
So it's a Petri net without all the places in between, as you can see.
of course, close down open close, etc.
we know the worst case time the actions take.
How long does it now take to follow that first schedule?
I totally forgot about her.
So what's the problem with the cleaning lady?
go to the position where the doors are closed.
The cleaning lady gets in the way a lot there.
And that makes it very hard to give a real schedule for this elevator.
tokens, as soon as tokens are available.
the actor will consume immediately all those tokens.
it means that this close time.
people to enter the elevator.
So let's put it to 20 seconds instead of four or instead of three, for this one.
then the schedule that we've drawn comes down to these times roughly, right?
So now we can calculate how long it takes to go along this schedule.
the lower schedule using eager scheduling.
So, consuming tokens as quickly as we can.
choices for the scheduling, but picking a data flow graph that has the schedule.
actors, we can calculate how long a schedule takes exactly.
this linear schedule, it was very easy, you can just add up all the times.
that have cycles in it, becomes much more difficult.
That's the topic for week three of this course.
far in our interpretation of dataflow graphs is enough to calculate performance.
that is a bit different from the consume as quickly as possible.
we can also say we are going to consume on fixed times.
For an elevator, that would mean that you get something like this.
It's a very old type of elevator.
I think it stems from around 1920s.
And that's an elevator in which you can get on and get off at very specific times.
image processing pipelines it is still very useful.
that means that the images also come out in a nicely regular manner.
that's very convenient, that's what you want to design the system for.
sometimes we will use eager scheduling of vectors.
The relationship between those two, that's a topic for the coming weeks.
this week is make the b refute assignment.