Computing the average height in tracemonoids