This is a followup question from this one.
I have to implement a rather complicated road network and there can be many ways a vehicle can change lanes. I have added a screenshot for a sample:
Road segments have been labeled for simplicity. I want to have my vehicles "Sourced" at road1, then take decision whether it needs to "MoveTo" road2 or road3. If it chooses road2, it must make further decision on whether it will take road4 or road5.
Please note that how it chooses to decide is not important here it could just be something simple as (as discussed in associated question):
uniform() < 0.5 ? road2 : road3
I can very easily design logic for just one intersection i.e. when the car moves from road1 to either road2 or road3 (as discussed in associated question).
So I thought I would add another "MoveTo" and put some code there like so (carMoveTo39):
But this is gives me compilation errors.
So, my question is: How to design the logic for such a case?