shift-scheduling | Python Scripts that apply Operations Research | Job Scheduling library
kandi X-RAY | shift-scheduling Summary
kandi X-RAY | shift-scheduling Summary
Suppose we have a place that needs to work 24/7, and we have a minimum amount of workers needed to run it on each quarter of day in the week (Monday from 0 to 6, Monday from 6 to 12, ... Sunday from 12 to 18, Sunday from 18 to 24). We have to create a shift schedule that is subject to certain constraints.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Create a WorkerProblem for each worker .
shift-scheduling Key Features
shift-scheduling Examples and Code Snippets
Community Discussions
Trending Discussions on shift-scheduling
QUESTION
Im trying to create a report of workactivities. Where the following conditions are set.
If one is absent on a subsequent date-range, then mark as same absence-group, else mark as new absence-group.
So, if I am absent on monday, tuesday, wednesday, then that is one group, marked by a 1.
If I am then at work on thursday, but absent again friday, than friday is marked with group2.
If i am still absent on the following monday then that is still group 2.
The example data provided, is the type of data I get from the shift-scheduling tables I have, apart from identifiers if a particular activity is absence or non-absence. There are of course more than one set of initials, on any given day, along with different types of activities and absenceactivities.
I've tried to supply a minimal working example of the input data and the desired outcome. Hopefully I can get some pointers on this.
...ANSWER
Answered 2017-Jan-29 at 13:26Using with (common table expression)
and row_number()
we can generate row numbers for partitions (Initials, activitytype)
and (Initials)
.
By comparing those, we can group consecutive blocks by activity and number them using dense_rank()
.
To convert all 'Work' to 0
I just used a case
expression in the final query.
rextester: http://rextester.com/AYR27547
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install shift-scheduling
You can use shift-scheduling like any standard Python library. You will need to make sure that you have a development environment consisting of a Python distribution including header files, a compiler, pip, and git installed. Make sure that your pip, setuptools, and wheel are up to date. When using pip it is generally recommended to install packages in a virtual environment to avoid changes to the system.
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page