Esempio n. 1
0
    def test_special_property(self):
        frame = johnson_three_machines_generator(count_jobs=2)

        min_proc_time1 = min([frame.get_processing_time(idx_job, 0)
                              for idx_job in range(frame.count_jobs)])
        max_proc_time = max([frame.get_processing_time(idx_job, 1)
                             for idx_job in range(frame.count_jobs)])
        min_proc_time2 = min([frame.get_processing_time(idx_job, 2)
                              for idx_job in range(frame.count_jobs)])

        assert min_proc_time1 > max_proc_time
        assert min_proc_time2 > max_proc_time
Esempio n. 2
0
    def test_initial_seed(self, initial_seed):
        frame = johnson_three_machines_generator(count_jobs=5,
                                                 initial_seed=initial_seed)

        assert initial_seed == frame.initial_seed
Esempio n. 3
0
    def test_nan_initial_seed(self, count_jobs):
        frame1 = johnson_three_machines_generator(count_jobs)
        frame2 = johnson_three_machines_generator(count_jobs,
                                                  frame1.initial_seed)

        tm.assert_js_frame(frame1, frame2)
Esempio n. 4
0
    def test_count_jobs_and_machines(self, count_jobs):
        frame = johnson_three_machines_generator(count_jobs)

        assert count_jobs == frame.count_jobs
        assert 3 == frame.count_machines
Esempio n. 5
0
    def test_bad_count_jobs_machines(self):
        msg = 'count_jobs must be greater than zero'

        with pytest.raises(ValueError, match=msg):
            johnson_three_machines_generator(count_jobs=-1)
Esempio n. 6
0
    def test_bad_initial_seed(self, count_jobs, initial_seed):
        msg = 'initial_seed must be a integer'

        with pytest.raises(ValueError, match=msg):
            johnson_three_machines_generator(count_jobs, initial_seed)