Merge branch '620-add-new-shift-to-rider-optimization' into 'master-fix'
Resolve "Add new shift to rider optimization" See merge request jankstudio/resq!733
This commit is contained in:
commit
4ea21f7004
4 changed files with 53 additions and 2 deletions
|
|
@ -271,7 +271,7 @@ class AnalyticsController extends Controller
|
|||
// add shift
|
||||
$args[] = $shift;
|
||||
|
||||
//error_log(print_r($args, true));
|
||||
// error_log(print_r($args, true));
|
||||
|
||||
error_log('running...' . $sched_script);
|
||||
|
||||
|
|
@ -798,6 +798,45 @@ class AnalyticsController extends Controller
|
|||
];
|
||||
}
|
||||
|
||||
if ($shift == '6AM_7PM') {
|
||||
$hour_shift = [
|
||||
['06:00 - 15:00', 6, 7, 8, 9, 10, 11, 12, 13, 14],
|
||||
['07:00 - 16:00', 7, 8, 9, 10, 11, 12, 13, 14, 15],
|
||||
['08:00 - 17:00', 8, 9, 10, 11, 12, 13, 14, 15, 16],
|
||||
['09:00 - 18:00', 9, 10, 11, 12, 13, 14, 15, 16, 17],
|
||||
['10:00 - 19:00', 10, 11, 12, 13, 14, 15, 16, 17, 18]
|
||||
];
|
||||
}
|
||||
|
||||
if ($shift == '6AM_10PM') {
|
||||
$hour_shift = [
|
||||
['06:00 - 15:00', 6, 7, 8, 9, 10, 11, 12, 13, 14],
|
||||
['07:00 - 16:00', 7, 8, 9, 10, 11, 12, 13, 14, 15],
|
||||
['08:00 - 17:00', 8, 9, 10, 11, 12, 13, 14, 15, 16],
|
||||
['09:00 - 18:00', 9, 10, 11, 12, 13, 14, 15, 16, 17],
|
||||
['10:00 - 19:00', 10, 11, 12, 13, 14, 15, 16, 17, 18],
|
||||
['11:00 - 20:00', 11, 12, 13, 14, 15, 16, 17, 18, 19],
|
||||
['12:00 - 21:00', 12, 13, 14, 15, 16, 17, 18, 19, 20],
|
||||
['13:00 - 22:00', 13, 14, 15, 16, 17, 18, 19, 20, 21]
|
||||
];
|
||||
}
|
||||
|
||||
if ($shift == '6AM-12AM') {
|
||||
$hour_shift = [
|
||||
['06:00 - 15:00', 6, 7, 8, 9, 10, 11, 12, 13, 14],
|
||||
['07:00 - 16:00', 7, 8, 9, 10, 11, 12, 13, 14, 15],
|
||||
['08:00 - 17:00', 8, 9, 10, 11, 12, 13, 14, 15, 16],
|
||||
['09:00 - 18:00', 9, 10, 11, 12, 13, 14, 15, 16, 17],
|
||||
['10:00 - 19:00', 10, 11, 12, 13, 14, 15, 16, 17, 18],
|
||||
['11:00 - 20:00', 11, 12, 13, 14, 15, 16, 17, 18, 19],
|
||||
['12:00 - 21:00', 12, 13, 14, 15, 16, 17, 18, 19, 20],
|
||||
['13:00 - 22:00', 13, 14, 15, 16, 17, 18, 19, 20, 21],
|
||||
['14:00 - 23:00', 14, 15, 16, 17, 18, 19, 20, 21, 22],
|
||||
['15:00 - 00:00', 15, 16, 17, 18, 19, 20, 21, 22, 23],
|
||||
['16:00 - 01:00', 16, 17, 18, 19, 20, 21, 22, 23, 0]
|
||||
];
|
||||
}
|
||||
|
||||
return $hour_shift;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,10 +7,16 @@ class ShiftSchedule extends NameValue
|
|||
const SCHED_24_7 = '24_7';
|
||||
const SCHED_8_5 = '8AM_5PM';
|
||||
const SCHED_7_10 = '7AM_10PM';
|
||||
const SCHED_6_7 = '6AM_7PM';
|
||||
const SCHED_6_10 = '6AM_10PM';
|
||||
const SCHED_6_12 = '6AM-12AM';
|
||||
|
||||
const COLLECTION = [
|
||||
'24_7' => '24/7 Schedule',
|
||||
'8AM_5PM' => '8AM-5PM Schedule',
|
||||
'7AM_10PM' => '7AM-10PM Schedule',
|
||||
'6AM_7PM' => '6AM-7PM Schedule',
|
||||
'6AM_10PM' => '6AM-10PM Schedule',
|
||||
'6AM-12AM' => '6AM-12AM Schedule',
|
||||
];
|
||||
}
|
||||
|
|
|
|||
Binary file not shown.
|
|
@ -89,6 +89,13 @@ def main():
|
|||
['11 - 20', 11, 12, 13, 14, 15, 16, 17, 18, 19],
|
||||
['12 - 21', 12, 13, 14, 15, 16, 17, 18, 19, 20],
|
||||
['13 - 22', 13, 14, 15, 16, 17, 18, 19, 20, 21]]
|
||||
if shift == "6AM_7PM":
|
||||
hour_shifts = [
|
||||
['06 - 15', 6, 7, 8, 9, 10, 11, 12, 13, 14],
|
||||
['07 - 16', 7, 8, 9, 10, 11, 12, 13, 14, 15],
|
||||
['08 - 17', 8, 9, 10, 11, 12, 13, 14, 15, 16],
|
||||
['09 - 18', 9, 10, 11, 12, 13, 14, 15, 16, 17],
|
||||
['10 - 19', 10, 11, 12, 13, 14, 15, 16, 17, 18]]
|
||||
|
||||
# all possible days riders come in
|
||||
day_shifts = [
|
||||
|
|
@ -102,7 +109,6 @@ def main():
|
|||
|
||||
# build shift lookup index
|
||||
|
||||
|
||||
# instantiate glop solver
|
||||
solver = pywraplp.Solver('SolveSchedule', pywraplp.Solver.CBC_MIXED_INTEGER_PROGRAMMING)
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue