How would we migrate this very simple scenario?
Describe the problem
Trying to go forward with migration I want to introduce a small exampe from the OSC standard to ask questions about the intended behavior.
My specific question is about the default controller that is part of the OSC 1.x standard and if there is anything like this in OSC 2.0. Or at least. Is there any default behavior defined which help authors and simulator providers to have the same idea about what happens in a very small sceanrio.
Describe your research
Took an example from OSC 2.0 standard:
OSC 2.0 Writing reusable sceanrios, code 3:
scenario my_other_scenario:
do parallel:
init: car1.drive() with: # starts at t=0
speed(speed: 40kph, at: start)
a1: car1.drive() with: # further initial conditions for car1. This affects the same initial drive
lateral(speed: 2kph, at:start)
Ask your question
I've adapted the example above to the following. I hope it is still a valid OSC 2.0 scenario: My question is: How would we migrate this very simple scenario?
scenario my_other_scenario:
do parallel:
p1: car1.drive(duration: 40s) with: # car 1: starts at t=0 drive 48 seconds
speed(speed: 40kph, at: start)
p2: car1.drive(duration: 20s) with: # car 1: starts at t=0 drive 20 seconds
lateral(speed: 2kph, at:start)
p3: car2.drive(duration: 30s) with: # car 2: starts at t=0 drive 30 seconds
speed(speed: 20kph, at: start)
Here are my questions and I give you an interpretation how OSC 1.0 would control behavior
When does the scenario finish?
OSC 1.x: Never or when the stop trigger of the enclosing storyboard fires.
OSC 2.0: After 40 seconds?
What is the (longitudinal) speed of car2 after 30 seconds? OSC 1.x: After 30 seconds the longitudinal default controller takes over and keeps the speed until the end of the scenario. (20kph)
OSC 2.0: ?
What is the (lateral) behavior of car2?
OSC 1.x: The lateral speed of car2 has never been never addressed. The lateral default controller will keep the lane from the start.
OSC 2.0: ?
What is the (longitudinal) speed of car1 after 40 seconds?
OSC 1.x: After 40 seconds the longitudinal default controller takes over and keeps the speed until the end of the scenario. (40kph)
OSC 2.0: ?
What is the (lateral) behavior of car1 after 20 seconds?
OSC 1.x: After 20 seconds the lateral default controller takes over and keeps the current lane.
OSC 2.0: ?
In any way: Please give an idea of the behavior or confirm there is no default behavior and we have to make it explicit. We are moving forward, when we say that there is no default behavior.
In the case there is no default behavior, we have to make the default behavior explicit like:
scenario my_other_scenario:
do_serial:
do parallel:
p1: car1.drive(duration: 20s) with: # t=0 the first 20 second, after that the next serial block starts (at 20s)
speed(speed: 40kph, at: start)
p2: car1.drive(duration: 20s) with:
lateral(speed: 2kph, at:start)
p3: car2.drive(duration: 20s) with:
lateral(speed: 20kph, at:start)
p4: car2.drive(duration: 20s) with:
keep_lane()
do parallel:
p1: car1.drive(duration: 10s) with: # t=20s the next 10 seconds, after that the next serial block starts (at 30s)
speed(speed: 40kph)
p2: car1.drive(duration: 10s) with: # car1 now uses explicitly the lateral default behavior from OSC 1.x
keep_lane()
p3: car2.drive(duration: 10s) with:
lateral(speed: 20kph)
p4: car2.drive(duration: 20s) with:
keep_lane()
do parallel:
p1: car1.drive(duration: 10s) with: # t=30s the next 10 seconds, after that the next serial block starts (at 40s)
speed(speed: 40kph)
p2: car1.drive(duration: 10s) with: # car1 now uses explicitly the lateral default behavior from OSC 1.x
keep_lane()
p3: car2.drive(duration: 10s) with: # car2 now uses explicitly the longitudinal default behavior from OSC 1.x
keep_speed()
p4: car2.drive(duration: 10s) with:
keep_lane()
do parallel: # t=40s After 40 seconds the drive just should continue endlessly.
p1: car1.drive() with: # car1 now uses explicitly the longitudinal default behavior from OSC 1.x
keep_speed()
p2: car1.drive() with: # car1 now uses explicitly the lateral default behavior from OSC 1.x
keep_lane()
p3: car2.drive() with: # car2 now uses explicitly the longitudinal default behavior from OSC 1.x
keep_speed()
p4: car2.drive() with: # car2 now uses explicitly the lateral default behavior from OSC 1.x
keep_lane()
I am not such familiar with OSC 2.0 and I hope made not too much wrong in the example above. But my question is:
Is that the way we would migrate this very simple example? Surely it is not automatable and surely we do not look at side effects with events. We have to take the default behavior of OSC 1.x into account while reengineering. What's the behavior when parallel actions do not exactly have the same duration?
By the way: I took a systematic approach here (not an automated): Slice the parallel actions with different durations into serial blocks. Fill the holes with explicit default behavior from 1.x (Here comes the knowlegde of someone who does reengineering). Adapt the ending time from OSC 1.x (endless).
In any case, when we use parallel or serial combination of actions it must be defined when the actions are ending. In a serial execution an action only starts after the predecessor action has ended. Or never, when the predecessor does not end. When forking in a parallel execution the execution joins when every single parallel action has ended or never, when one of the actions never ends. That's what I assume on OSC 2.0 (Alternatively: a parallel excution could also end when the first fastest has ended. That's a race condition. But this depends on your definition)
Probably an OSC 2.0 expert give us a hint here.