Solved! Go to Solution.
## Attributes attr Lanes_Left = 2 attr Lanes_Right = 2 attr Lane_Width = 3.5 attr Shoulder_Width = 3 attr Median_Width = 1.5
attr doMedian = true
case doMedian : .. else : ..
attr Lanes_Left = 2 attr Lanes_Right = 2
and note :
the 'Model' is created based on the 'Shape'.
So a street graph defined the width of the total street shape. So since the total width is already give plus using the fact that 1 lane is about 3 meters wide, n lanes can actually be created.
e.g. a 9 meter wide shape can produce 3 lanes.
so that can be 1 left lane and 2 right lanes. But since the total width of the street is given and thus drives the total number of lanes, it makes 'no sense' to defineattr Lanes_Left = 2 attr Lanes_Right = 2
makes sense ?
the laneOffset I have in my code then defines the offset :
e.g. if 5 lanes can be produced, 2 left and 3 right can be produced. an offset of 1 makes 1 left and 4 right lanes.
makes sense too ?
m.
attr width_1 = 5 Street1 --> split(v,unitSpace,0){width_1 : Red | ~1 : Green} attr myLaneWidth = 3 Street2 --> split(v,unitSpace,0){width_1 : Red | ~1 : RestShape} RestShape --> split(v,unitSpace,0){~myLaneWidth : Green }* attr medianWidth = 1 Street3 --> split(v,unitSpace,0){~1 : MultiLane | medianWidth : Green | ~1 : MultiLane} MultiLane --> split(v,unitSpace,0){~myLaneWidth : Red }* Red --> color(1,0,0) Green --> color(0,1,