Skip to content

High-Level Architecture

Below shows a High-Level architecture for the Scheduler process. This exact proces is done in both the GraphQL server

flowchart LR
  SP[Scheduler Parameters]
  subgraph Engine["Engine"]
    direction LR
    Builder[Builder]
    subgraph CorePipeline["Scheduler Core Pipeline"]
      direction TB
      Collector[Collector]
      Selector[Selector]
      Optimizer[Optimizer]
    end
    EventQueue[EventQueue]
    EventCycle[EventCycle]
  end
  Timelines[Timelines]
  RunSummary[Run Summary]

  SP -- new() --> Builder
  Builder --> CorePipeline
  CorePipeline --> EventCycle
  EventQueue --> EventCycle
  EventCycle -- run() --> Timelines
  EventCycle -- run() --> RunSummary

Scheduler Parameters

scheduler.engine.SchedulerParameters(start, end=None, sites=ALL_SITES, mode=SchedulerModes.OPERATION, ranker_parameters=RankerParameters(), semester_visibility=True, num_nights_to_schedule=None, programs_list=None, use_local_visibility=None)

Initial parameters to start the scheduler engine. The start parameter represents both the initial local night that is going to be schedule and the initial date for the visibility calculation.

ATTRIBUTE DESCRIPTION
start

start UT date.

TYPE: Time

end

end UT date. Represents the end of the calculated visibility period.

TYPE: Time

mode

The mode the Scheduler can be executed in. VALIDATION, SIMULATION or OPERATION.

TYPE: SchedulerModes

ranker_parameters

Parameters that can be toggled in the Ranker to modify score.

TYPE: RankerParameters

semester_visibility

Overrides the end parameters and extends the visibility period to the end of the selected semester in start.

TYPE: bool

num_nights_to_schedule

Number of nights to schedule. Can't be bigger then the amount of nights in the visibility period. Defaults to None.

TYPE: int

programs_list

A list of ProgramID that allows a specific selection of programs to run. Defaults to None. If None, the default programs list in scheduler/data would be used.

TYPE: List[str]

use_local_visibility

bool: Allow using local calculations instead of parameters

TYPE: Optional[bool]

Examples:

   from scheduler.engine import SchedulerParameters, Engine
   params = SchedulerParameters(start=datetime.fromisoformat("2018-10-01 08:00:00"),
                                 end=datetime.fromisoformat("2018-10-03 08:00:00"),
                                 sites=ALL_SITES,
                                 mode=SchedulerModes.VALIDATION,
                                 ranker_parameters=RankerParameters(),
                                 semester_visibility=False,
                                 num_nights_to_schedule=1,
                                 programs_list=programs_list)

Engine

scheduler.engine.Engine(params, night_start_time=None, night_end_time=None)

build()

Creates a Scheduler Core Pipeline based on the parameters. Also initialize both the Event Queue , both needed for the scheduling process.