When you attach the trailers to AGV they not coming under the subnodes of AGV. Then AGV.subnodes.length wil not work.
When AGV is having trailers attached and items are loaded in AGV trailers, then if we don't get it as subnodes it will be very difficult to track what AGV is carrying.
How to Track what trailers are attached in AGV ?