How Are Train Numbers Assigned

How Are Train Numbers Assigned