import { Activity, AssignmentCode, Competition, Person } from '@wca/helpers'; export interface ConstraintProps { /** * The wcif that is being modified. * Should be noted that the wcif is modified after each person assignment */ wcif: Competition; /** * A list of activities that are being assigned to */ activities: Activity[]; /** * The list of people that are being assigned to the activities */ cluster: Person[]; /** * The assignment code that the person is being assigned */ assignmentCode: string; /** * The person for which the assignmentCode and activity are being scored */ person: Person; /** * The activity that is being scored */ activity: Activity; /** * Any options that are passed to the step */ options?: Record; } export interface Constraint { /** Unique Identifying name of constraint */ name: string; /** * * @param props * @returns * - null if the person should not be assigned to the activity + assignmentCode * - a number to indicate how good of a fit the person is for the activity + assignmentCode. Higher scores are better * * examples: * - the person already has a competitor assignment for the round, return null * - the person needs a competitor aassignment but there are 2 people with the same firstname in the activity, return a low score */ score: (props: ConstraintProps) => number | null; } export interface ConstraintAndWeight { constraint: Constraint; weight: number; options?: any; } export interface Generator { name: string; description: string; /** * Executes the generator and returns a new wcif */ execute: (props: GeneratorProps) => Competition; /** * Validates the wcif given the generator props */ validate: (props: GeneratorProps) => boolean; optionsDef: any; defaultOptions: any; } export interface GeneratorProps { wcif: Competition; cluster: Person[]; activities: Activity[]; assignmentCode: AssignmentCode; constraints: ConstraintAndWeight[]; options?: any; roundId: string; } //# sourceMappingURL=types.d.ts.map