Options
All
  • Public
  • Public/Protected
  • All
Menu

Module src/algorithm

Index

Type aliases

MeetingDate

MeetingDate: [number, number]

Start and end date in millisecond (obtained via Date.getTime)

RawAlgoCourse

RawAlgoCourse: [string, number[]]

The data structure used in the algorithm to represent a Course that possibly has multiple sections combined (occurring at the same time)

0: key of this course 1: an array of section indices

Example:

["span20205", [0, 1, 2]]

SortFunctionNames

SortFunctionNames: "variance" | "compactness" | "lunchTime" | "noEarly" | "distance" | "similarity" | "IamFeelingLucky"

TimeArray

TimeArray: [number[], number[], number[], number[], number[], number[], number[]]

TODO: add description

Functions

allocateStr

  • allocateStr(Module: EMModule, str: string): number

checkTimeConflict

  • checkTimeConflict(timeArray1: TimeArray, timeArray2: TimeArray, step1?: number, step2?: number): boolean
  • return true if two TimeArray objects have overlapping time blocks, false otherwise

    note

    use step=2 for time only array, use step=3 for time-room combined array

    Parameters

    • timeArray1: TimeArray
    • timeArray2: TimeArray
    • Default value step1: number = 2

      the increment step for array 1

    • Default value step2: number = 2

      the increment step for array 2

    Returns boolean

computeBlockPositions

computeConflict

  • computeConflict(timeArrayList: TimeArray[], dateList: MeetingDate[], conflictCache: Uint8Array): void

prepareQuery

  • prepareQuery(Module: EMModule, query: string, gramLen: number): number
  • sanitize a query string, copy it to the WebAssembly heap and returns a pointer to it returns -1 if query is shorter than gramLen

    Parameters

    • Module: EMModule
    • query: string
    • gramLen: number

    Returns number

timeArrayToCompact

  • returns an array with all time arrays in timeArrayList concatenated together. The offsets of time array of section i at day k is at i * 8 + k position of the resulting array.

    Parameters

    Returns number

Object literals

Const options

options: object

ISMethod

ISMethod: number = 1

LPIters

LPIters: number = 50

LPModel

LPModel: number = 1

MILP

MILP: boolean = false

applyDFS

applyDFS: boolean = false

isTolerance

isTolerance: number = 0

showFixed

showFixed: boolean = false

tFactor

tFactor: number = 0.1

tolerance

tolerance: number = 0

Generated using TypeDoc