Class ConstraintAssegnazioneTurnoTurno
java.lang.Object
org.cswteams.ms3.entity.constraint.Constraint
org.cswteams.ms3.entity.constraint.ConstraintAssegnazioneTurnoTurno
- Direct Known Subclasses:
ConstraintMaxOrePeriodo,ConstraintMaxPeriodoConsecutivo,ConstraintTurniContigui,ConstraintUbiquita
A condition imposed when generating associations between shifts.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected intgetAssegnazioneTurnoPrecedenteIdx(List<ConcreteShift> concreteShifts, ConcreteShift concreteShiftToBeAssigned) This method returns the concrete shift that is before a new concrete shift passed as parameter.protected booleanverificaContiguitàAssegnazioneTurni(ConcreteShift cShift1, ConcreteShift cShift2) This method checks if cShift2 starts at the same hour which cShift1 finishes at.protected booleanverificaContiguità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.Methods inherited from class org.cswteams.ms3.entity.constraint.Constraint
verifyConstraint
-
Constructor Details
-
ConstraintAssegnazioneTurnoTurno
public ConstraintAssegnazioneTurnoTurno()
-
-
Method Details
-
verificaContiguitàAssegnazioneTurni
This method checks if cShift2 starts at the same hour which cShift1 finishes at.- Parameters:
cShift1- First concrete shift in temporal ordercShift2- 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 ordercShift2- Second concrete shift in temporal ordertu- 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 shiftsconcreteShiftToBeAssigned- The new concrete shift to be assigned- Returns:
- The existent concrete shift that is before concreteShiftToBeAssigned
-