Options
All
  • Public
  • Public/Protected
  • All
Menu

Class ScheduleStore

the schedule module provides methods to manipulate schedules

author

Hanzhi Zhou

Hierarchy

Implements

Index

Constructors

constructor

Properties

cpIndex

cpIndex: number

The index of the proposed schedule corresponding to the generated schedules contained in window.scheduleEvaluator

currentSchedule

currentSchedule: Schedule

currently rendered schedule

currentScheduleIndex

currentScheduleIndex: number

the index of the current schedule in the scheduleEvaluator.schedules array, only applicable when generated=true

generated

generated: boolean

indicates whether the currently showing schedule is the generated schedule

numGenerated

numGenerated: number

total number of generated schedules, has the same value as window.scheduleEvaluator.size()

proposedScheduleIndex

proposedScheduleIndex: number

the index of the active proposed

proposedSchedules

proposedSchedules: ProposedSchedule[]

Accessors

proposedSchedule

Methods

cancelComputeAll

  • cancelComputeAll(): void

clear

  • clear(): void
  • clear the currently active schedules and its corresponding generated schedules, if applicable

    Returns void

copyCurrent

  • copyCurrent(): void
  • copy the current schedule and append to the proposedSchedules array. Immediately switch to the newly copied schedule.

    Returns void

deleteProposed

  • deleteProposed(): void
  • delete the current proposed schedule, switch to the schedule after the deleted schedule. do nothing if this is the last proposed schedule

    Returns void

fromJSON

  • note

    the schedules parsed from JSON are not computed (i.e. the computeSchedule method is not called)

    note

    the currentSchedule is not assigned.

    Parameters

    Returns void

getDefault

newProposed

  • newProposed(): void
  • create a new empty schedule at the end of the proposedSchedules array and immediately switch to it

    Returns void

recomputeAll

  • recomputeAll(sync: boolean, time?: number): void

switchPage

  • switchPage(idx: number): void
  • Switch to idx page assign currentSchedule with the generated schedule at index idx

    Parameters

    • idx: number

    Returns void

switchProposed

  • switchProposed(index: number): void
  • switch to next or previous proposed schedule. has bound checking.

    Parameters

    • index: number

    Returns void

switchSchedule

  • switchSchedule(generated: boolean): void
  • Parameters

    • generated: boolean

      if true, try to switch to generated schedules if the following conditions are met,

      • generated schedules exist (ScheduleEvaluator is not empty), and
      • generated schedules correspond to the current schedule

      switch to current proposed schedule if false

    Returns void

toJSON

Static compressJSON

Static decompressJSON

Generated using TypeDoc