Home > other >  Programming for help! Working days weekend holiday need to consider rota arranged separately
Programming for help! Working days weekend holiday need to consider rota arranged separately

Time:10-07

Bosses for help all of you! Now need to write a scheduling program automatically,
Basic situation is this: if it is working days without considering scheduling directly, if it is a weekend to consider if it is the last time is this person on duty to weekend can't postpone, until not row again this weekend; In the same way if it is a holiday to consider are the person on one row of the holiday, if it is need to postpone, until this person is not a holiday to row,
That is working days without considering direct line, but not attached to both value weekend cannot be attached to two holidays,
How to do?

CodePudding user response:

A total of a few people? Saturday and Sunday need to a few people go to work? Working days to a few people go to work?

CodePudding user response:

references on 1st floor day I reply:
a few people in total? Saturday and Sunday need to a few people go to work? Working days to a few people go to work?

Working day boys, only one night, but it must be all holidays and weekends will be three people value of middle-late early, late shift must also are boys, some Numbers are a total of more than 100 people, so turn could at least twice a year,

CodePudding user response:

Actual condition is very complex
Tell me about thinking
365 days a year, there are 365 night, 52 weeks, namely 104 on Saturday, 104 on Sunday, 408 early middle shift, plus the vacation in the early evening, all listed, each class give a number, a conservative estimate of 780 classes,
The dictionary on duty {serial number: *, date: * *, divisions: late or early or middle shift, working day: weekdays or holidays}
Only 100 people, a little less,
Personnel dictionary {name: * *, gender: * *, for the first time on duty: * *, the second duty: * *,,,,,,}
Start:
Iterate through all night, (also can be set up to arrange a month on duty)
Judgment is night shift working days or rest day
If it is working day
Randomly selected a male (screening on duty at least), the blank that the value is set to on duty on duty number
If it is not working day
Randomly on duty at least men, judgment on duty last workday type, if it is a working day, will be the divisions of the blank is set to on duty number
End of the night shift scheduling
Traverse the other divisions
Distinguish the working day
Is working day
On arrangement of screening on duty at least,
Is not a working day
Screening on duty at least, who was on duty last working day, arrange on
The end of the
  • Related