27 std::vector<Time> time = { 2.1, 3.1, 4.1, 5.1, 6.1, 7.1, 8.1 };
28 std::vector<Time> release = { 1, 2, 3, 4, 5, 6, 7 };
29 std::vector<Time> due_date = { -1, 0, -2, -3, -4, -5, -6 };
33 std::vector<std::pair<decltype(jobs)::iterator, Time>> jobs_to_start_dates;
37 jobs.begin(), jobs.end(), [&](
int i) {
return time[i]; },
38 [&](
int i) {
return release[i]; },
39 [&](
int i) {
return due_date[i]; },
40 back_inserter(jobs_to_start_dates));
41 for (
auto job_start_time : jobs_to_start_dates) {
42 std::cout <<
"Job " << (*job_start_time.first)
43 <<
" Start time: " << job_start_time.second << std::endl;
46 std::cout <<
"Solution: " << delay << std::endl;
int main()
[Scheduling Jobs On Single Machine Example]
auto irange(T begin, T end)
irange
auto scheduling_jobs_with_deadlines_on_a_single_machine(const InputIterator first, const InputIterator last, GetTime get_time, GetReleaseDate get_release_date, GetDueDate get_due_date, OutputIterator result)
solve scheduling jobs on identical parallel machines problem and fill start time of all jobs example:...
double Time
[Scheduling Jobs Example]