Class ConstraintAssegnazioneTurnoTurno

java.lang.Object
org.cswteams.ms3.entity.constraint.Constraint
org.cswteams.ms3.entity.constraint.ConstraintAssegnazioneTurnoTurno
Direct Known Subclasses:
ConstraintMaxOrePeriodo, ConstraintMaxPeriodoConsecutivo, ConstraintTurniContigui, ConstraintUbiquita

@Entity public abstract class ConstraintAssegnazioneTurnoTurno extends Constraint
A condition imposed when generating associations between shifts.
  • Constructor Details

    • ConstraintAssegnazioneTurnoTurno

      public ConstraintAssegnazioneTurnoTurno()
  • Method Details

    • verificaContiguitàAssegnazioneTurni

      protected boolean verificaContiguitàAssegnazioneTurni(ConcreteShift cShift1, ConcreteShift cShift2)
      This method checks if cShift2 starts at the same hour which cShift1 finishes at.
      Parameters:
      cShift1 - First concrete shift in temporal order
      cShift2 - Second concrete shift in temporal order
      Returns:
      Boolean that represents if the check succeeded
    • verificaContiguitàAssegnazioneTurni

      protected boolean verificaContiguitàAssegnazioneTurni(ConcreteShift cShift1, ConcreteShift cShift2, TemporalUnit tu, long delta)
      This method checks if cShift2 starts at the same hour which cShift1 finishes at plus a delay equal to delta. The concrete shifts shall not overlap.
      Parameters:
      cShift1 - First concrete shift in temporal order
      cShift2 - Second concrete shift in temporal order
      tu - Measure unit for param delta (e.g. minutes, hours)
      delta - max number of tolerable temporal units in order to consider cShift1 and cShift2 contiguous
      Returns:
      Boolean that represents if the check succeeded
    • getAssegnazioneTurnoPrecedenteIdx

      protected int getAssegnazioneTurnoPrecedenteIdx(List<ConcreteShift> concreteShifts, ConcreteShift concreteShiftToBeAssigned)
      This method returns the concrete shift that is before a new concrete shift passed as parameter.
      Parameters:
      concreteShifts - List of all the existent concrete shifts
      concreteShiftToBeAssigned - The new concrete shift to be assigned
      Returns:
      The existent concrete shift that is before concreteShiftToBeAssigned