Simple Algorithm to Generate Roster for your team
https://plnkr.co/edit/kk7tcf?p=preview
- Generates Roster for any number of weeks(can be specified).
- Any number of shifts can be provided.
- Define frequency of shift rotation.
- Define shuffle intensity.
- Define probability of different shifts for members.
Create a object with members name in below structure
{
"members": [{
"id": 1,
"name": "John"
},
{
"id": 2,
"name": "Paul"
},
{
"id": 3,
"name": "Simon"
}]
}
Now, its time to configure!
{
// Number of Weeks you want to generate Roster
noWeeks : 52,
// Number of Working days per week.
noOfDaysPerWeek : 5,
// List of Shifts
shifts : ['morning','noon','night'],
// Required Probability of shifts ( rate out of 10 )
// For Below ,
// Morning - 2
// Noon - 5
// Night - 3
weights : ['2','5','3'],
// Intensity of shuffle.
shuffleIntensity : 1,
// How frequent you want to rotate shifts
changeFrequency: 2
}
To start with, using the below snippet.
roster = new Roster(config,data);
roster.getRosterPlan();
- Send me an email at [email protected]