Skip to main content

Interface: CompilationResult

Properties

canSolve

canSolve: boolean;

request

request: {
  constraints: (
     | {
     op: "<=" | ">=" | "==";
     rhs: number;
     terms: {
        coeff: number;
        var: string;
     }[];
     type: "linear";
   }
     | {
     id?: string;
     op: "<=" | ">=";
     penalty: number;
     rhs: number;
     terms: {
        coeff: number;
        var: string;
     }[];
     type: "soft_linear";
   }
     | {
     type: "exactly_one";
     vars: string[];
   }
     | {
     type: "at_most_one";
     vars: string[];
   }
     | {
     if: string;
     then: string;
     type: "implication";
   }
     | {
     type: "bool_or";
     vars: string[];
   }
     | {
     type: "bool_and";
     vars: string[];
   }
     | {
     intervals: string[];
     type: "no_overlap";
  })[];
  objective?: {
     sense: "minimize" | "maximize";
     terms: {
        coeff: number;
        var: string;
     }[];
  };
  options?: {
     solutionLimit?: number;
     timeLimitSeconds?: number;
  };
  variables: (
     | {
     name: string;
     type: "bool";
   }
     | {
     max: number;
     min: number;
     name: string;
     type: "int";
   }
     | {
     end: number;
     name: string;
     presenceVar?: string;
     size: number;
     start: number;
     type: "interval";
  })[];
};

constraints

constraints: (
  | {
  op: "<=" | ">=" | "==";
  rhs: number;
  terms: {
     coeff: number;
     var: string;
  }[];
  type: "linear";
}
  | {
  id?: string;
  op: "<=" | ">=";
  penalty: number;
  rhs: number;
  terms: {
     coeff: number;
     var: string;
  }[];
  type: "soft_linear";
}
  | {
  type: "exactly_one";
  vars: string[];
}
  | {
  type: "at_most_one";
  vars: string[];
}
  | {
  if: string;
  then: string;
  type: "implication";
}
  | {
  type: "bool_or";
  vars: string[];
}
  | {
  type: "bool_and";
  vars: string[];
}
  | {
  intervals: string[];
  type: "no_overlap";
})[];

objective?

optional objective: {
  sense: "minimize" | "maximize";
  terms: {
     coeff: number;
     var: string;
  }[];
};
objective.sense
sense: "minimize" | "maximize";
objective.terms
terms: {
  coeff: number;
  var: string;
}[];

options?

optional options: {
  solutionLimit?: number;
  timeLimitSeconds?: number;
};
options.solutionLimit?
optional solutionLimit: number;
options.timeLimitSeconds?
optional timeLimitSeconds: number;

variables

variables: (
  | {
  name: string;
  type: "bool";
}
  | {
  max: number;
  min: number;
  name: string;
  type: "int";
}
  | {
  end: number;
  name: string;
  presenceVar?: string;
  size: number;
  start: number;
  type: "interval";
})[];

validation

validation: ScheduleValidation;