Please see the attached file for an example. Although it looks easy, the fact that each shingle is a randomised width makes it quite challenging. The answer is to use an expression that can work out how much space is left along the spline, and if it falls below a certain threshold then it scales the final tile to fit.
To find available space remaining along the spline you can use the following expression
return XSplineLength-(XSplineLength*XSplinePosition);
You'll then need to take into consideration any padding you are using between tiles and the size and padding of any segments wired to the End input of the Generator. In my attached style I've used a simple arithmetic node to subtract those values from the results of the expression shown above.
After that, you'll need a test to see if the size of the remaining space falls below a certain threshold (I've used 1.5 times the size of a standard tile). You can use the following expression where Input1 is the remaining size on the spline minus the ends segments, and Input 2 is the size of a standard tile.
return if(Input1<Input2*1.5,Input1,0);
I hope that helps. This is an interesting question so I might tackle it in tomorrow's AskiToo livestream.
Cheers,
Paul