Mathematical Models for On-Line Train Calendars Generation