Beispiel #1
0
def test_append_input_task():
    """test_append_input_task."""
    task1 = Task("task1")
    task2 = Task("task2")
    task2.append_input_task(task1)
    assert task2.input_task_list == [[task1, BaseTaskDependency.FS]]
    assert task1.output_task_list == [[task2, BaseTaskDependency.FS]]
Beispiel #2
0
def test_get_networkx_graph():
    """test_get_networkx_graph."""
    task1 = Task("task1")
    task2 = Task("task2")
    task2.append_input_task(task1)
    w = Workflow([task1, task2])
    w.get_networkx_graph()
Beispiel #3
0
def test_extend_targeted_task_list():
    team = Team("team")
    task1 = Task("task1")
    task2 = Task("task2")
    team.extend_targeted_task_list([task1, task2])
    assert team.targeted_task_list == [task1, task2]
    assert task1.allocated_team_list == [team]
    assert task2.allocated_team_list == [team]
Beispiel #4
0
def test_init():
    """test_init."""
    task1 = Task("task1")
    task2 = Task("task2")
    task2.append_input_task(task1)
    w = Workflow([task1, task2])
    assert w.task_list == [task1, task2]
    assert w.critical_path_length == 0.0
Beispiel #5
0
def test_append_targeted_task():
    team = Team("team")
    task1 = Task("task1")
    task2 = Task("task2")
    team.append_targeted_task(task1)
    team.append_targeted_task(task2)
    assert team.targeted_task_list == [task1, task2]
    assert task1.allocated_team_list == [team]
    assert task2.allocated_team_list == [team]
Beispiel #6
0
def test_create_data_for_gantt_plotly():
    """test_create_data_for_gantt_plotly."""
    task1 = Task("task1")
    task1.state_record_list = [
        BaseTaskState.READY,
        BaseTaskState.READY,
        BaseTaskState.WORKING,
        BaseTaskState.FINISHED,
        BaseTaskState.FINISHED,
    ]
    init_datetime = datetime.datetime(2020, 4, 1, 8, 0, 0)
    timedelta = datetime.timedelta(days=1)
    task1.create_data_for_gantt_plotly(init_datetime, timedelta, view_ready=True)
Beispiel #7
0
def test_create_gantt_plotly(tmpdir):
    """test_create_gantt_plotly."""
    task1 = Task("task1")
    task1.state_record_list = [
        BaseTaskState.READY,
        BaseTaskState.READY,
        BaseTaskState.WORKING,
        BaseTaskState.FINISHED,
        BaseTaskState.FINISHED,
    ]
    task2 = Task("task2")
    task2.state_record_list = [
        BaseTaskState.READY,
        BaseTaskState.READY,
        BaseTaskState.WORKING,
        BaseTaskState.FINISHED,
        BaseTaskState.FINISHED,
    ]
    task2.append_input_task(task1)
    w = Workflow([task1, task2])
    init_datetime = datetime.datetime(2020, 4, 1, 8, 0, 0)
    timedelta = datetime.timedelta(days=1)
    w.create_gantt_plotly(init_datetime,
                          timedelta,
                          save_fig_path=os.path.join(str(tmpdir), "test.png"))
Beispiel #8
0
def test_init():
    """test_init."""
    team = Team("team")
    assert team.name == "team"
    assert len(team.ID) > 0
    assert team.worker_list == []
    assert team.targeted_task_list == []
    assert team.parent_team is None
    assert team.cost_list == []
    team.cost_list.append(1)
    assert team.cost_list == [1.0]

    w1 = Worker("w1")
    t1 = Task("task1")
    team1 = Team(
        "team1",
        parent_team=team,
        targeted_task_list=[t1],
        worker_list=[w1],
        cost_list=[10],
    )
    assert team1.worker_list == [w1]
    assert team1.targeted_task_list == [t1]
    assert team1.parent_team == team
    assert team1.cost_list == [10]
Beispiel #9
0
def test_perform():
    task = Task("task")
    task.state = BaseTaskState.WORKING
    w1 = Worker("w1")
    w2 = Worker("w2")
    w1.workamount_skill_mean_map = {"task": 1.0}
    task.allocated_worker_list = [w1, w2]
    w1.assigned_task_list = [task]
    w2.assigned_task_list = [task]
    c = Component("a")
    c.append_targeted_task(task)
    w = Workflow([task])
    w.perform(10)
    assert task.remaining_work_amount == task.default_work_amount - 1.0
    assert task.target_component == c
    assert c.error == 0.0
Beispiel #10
0
def test_init(dummy_worker):
    """test_init."""
    # team = Team("team")
    assert dummy_worker.name == "wsss"
    assert dummy_worker.team_id == "---"
    assert dummy_worker.cost_per_time == 0.0
    assert dummy_worker.workamount_skill_mean_map == {}
    assert dummy_worker.workamount_skill_sd_map == {}
    assert dummy_worker.quality_skill_mean_map == {}
    assert dummy_worker.state == BaseWorkerState.FREE
    assert dummy_worker.cost_list == []
    assert dummy_worker.assigned_task_list == []
    w = Worker(
        "w1",
        state=BaseWorkerState.WORKING,
        cost_list=[10, 10],
        assigned_task_list=[Task("task")],
        assigned_task_id_record=[[], ["ss"]],
    )
    assert w.name == "w1"
    assert w.team_id is None
    assert w.cost_per_time == 0.0
    assert w.workamount_skill_mean_map == {}
    assert w.workamount_skill_sd_map == {}
    assert w.quality_skill_mean_map == {}
    assert w.state == BaseWorkerState.WORKING
    assert w.cost_list == [10, 10]
    assert w.assigned_task_list[0].name == "task"
    assert w.assigned_task_id_record == [[], ["ss"]]
Beispiel #11
0
def test_init():
    task = Task("task")
    assert task.name == "task"
    assert len(task.ID) > 0
    assert task.default_work_amount == 10.0
    assert task.input_task_list == []
    assert task.output_task_list == []
    assert task.due_time == -1
    assert task.allocated_team_list == []
    assert task.target_component is None
    assert task.default_progress == 0.0
    assert task.additional_work_amount == 0.0
    assert task.est == 0.0
    assert task.eft == 0.0
    assert task.lst == -1.0
    assert task.lft == -1.0
    assert task.remaining_work_amount == task.default_work_amount * (
        1.0 - task.default_progress)
    # assert task.actual_work_amount == task.default_work_amount * (
    #     1.0 - task.default_progress
    # )
    assert task.state == BaseTaskState.NONE
    assert task.ready_time_list == []
    assert task.start_time_list == []
    assert task.finish_time_list == []
    assert task.additional_task_flag is False
    assert task.allocated_worker_list == []

    tb = Task(
        "task_b1",
        remaining_work_amount=0.0,
        state=BaseTaskState.FINISHED,
        ready_time_list=[1],
        start_time_list=[2],
        finish_time_list=[5],
        allocated_worker_list=[Worker("a")],
        allocated_worker_id_record=[["idid"]],
        additional_task_flag=True,
    )
    assert tb.remaining_work_amount == 0.0
    assert tb.state == BaseTaskState.FINISHED
    assert tb.ready_time_list == [1]
    assert tb.start_time_list == [2]
    assert tb.finish_time_list == [5]
    assert tb.allocated_worker_list[0].name == "a"
    assert tb.allocated_worker_id_record == [["idid"]]
    assert tb.additional_task_flag is True
Beispiel #12
0
def test_get_node_and_edge_trace_for_plotly_network():
    """test_get_node_and_edge_trace_for_plotly_network."""
    task1 = Task("task1")
    task2 = Task("task2")
    task2.append_input_task(task1)
    w = Workflow([task1, task2])
    (
        task_node_trace,
        auto_task_node_trace,
        edge_trace,
    ) = w.get_node_and_edge_trace_for_plotly_network()
    # TODO
    # assert...
    (
        task_node_trace,
        auto_task_node_trace,
        edge_trace,
    ) = w.get_node_and_edge_trace_for_plotly_network()
Beispiel #13
0
def test_initialize():
    """test_initialize."""
    team = Team("team")
    w = Worker("w1", team_id=team.ID)
    w.state = BaseWorkerState.WORKING
    w.cost_list = [9.0, 7.2]
    w.assigned_task_list = [Task("task")]
    w.initialize()
    assert w.state == BaseWorkerState.FREE
    assert w.cost_list == []
    assert w.assigned_task_list == []
Beispiel #14
0
def test_draw_plotly_network(tmpdir):
    """test_draw_plotly_network."""
    task0 = Task("auto", auto_task=True)
    task1 = Task("task1")
    task2 = Task("task2")
    task2.append_input_task(task1)
    w = Workflow([task1, task2, task0])
    w.draw_plotly_network(save_fig_path=os.path.join(str(tmpdir), "test.png"))
Beispiel #15
0
def test_initialize():
    """test_initialize."""
    team = Team("team")
    team.cost_list = [9.0, 7.2]
    w = Worker("w1")
    team.worker_list = [w]
    w.state = BaseWorkerState.WORKING
    w.cost_list = [9.0, 7.2]
    w.assigned_task_list = [Task("task")]
    team.initialize()
    assert team.cost_list == []
    assert w.state == BaseWorkerState.FREE
    assert w.cost_list == []
    assert w.assigned_task_list == []
Beispiel #16
0
def test_initialize():
    team = Team("team")
    w = Worker("w1", team_id=team.ID)
    w.state = BaseResourceState.WORKING
    w.cost_list = [9.0, 7.2]
    w.start_time_list = [0]
    w.finish_time_list = [1]
    w.assigned_task_list = [Task("task")]
    w.initialize()
    assert w.state == BaseResourceState.FREE
    assert w.cost_list == []
    assert w.start_time_list == []
    assert w.finish_time_list == []
    assert w.assigned_task_list == []
Beispiel #17
0
def test_extend_input_task_list():
    task11 = Task("task11")
    task12 = Task("task12")
    task2 = Task("task2")
    task2.extend_input_task_list([task11, task12])
    assert task2.input_task_list == [
        [task11, BaseTaskDependency.FS],
        [task12, BaseTaskDependency.FS],
    ]
    assert task11.output_task_list == [[task2, BaseTaskDependency.FS]]
    assert task12.output_task_list == [[task2, BaseTaskDependency.FS]]
Beispiel #18
0
def test_get_state_from_record():
    """test_get_state_from_record."""
    task1 = Task("task1")
    task1.state_record_list = [
        BaseTaskState.NONE,
        BaseTaskState.READY,
        BaseTaskState.WORKING,
        BaseTaskState.FINISHED,
        BaseTaskState.FINISHED,
    ]
    assert task1.get_state_from_record(0) == BaseTaskState.NONE
    assert task1.get_state_from_record(1) == BaseTaskState.READY
    assert task1.get_state_from_record(2) == BaseTaskState.WORKING
    assert task1.get_state_from_record(3) == BaseTaskState.FINISHED
    assert task1.get_state_from_record(4) == BaseTaskState.FINISHED
Beispiel #19
0
def test_create_data_for_gantt_plotly():
    """test_create_data_for_gantt_plotly."""
    task1 = Task("task1")
    task1.state_record_list = [
        BaseTaskState.READY,
        BaseTaskState.READY,
        BaseTaskState.WORKING,
        BaseTaskState.FINISHED,
        BaseTaskState.FINISHED,
    ]
    task2 = Task("task2")
    task2.state_record_list = [
        BaseTaskState.READY,
        BaseTaskState.READY,
        BaseTaskState.WORKING,
        BaseTaskState.FINISHED,
        BaseTaskState.FINISHED,
    ]
    task2.append_input_task(task1)
    w = Workflow([task1, task2])
    init_datetime = datetime.datetime(2020, 4, 1, 8, 0, 0)
    timedelta = datetime.timedelta(days=1)
    w.create_data_for_gantt_plotly(init_datetime, timedelta, view_ready=True)
Beispiel #20
0
def test_create_data_for_gantt_plotly():
    task1 = Task("task1")
    task1.start_time_list = [1, 4]
    task1.ready_time_list = [0, 2]
    task1.finish_time_list = [3, 5]
    init_datetime = datetime.datetime(2020, 4, 1, 8, 0, 0)
    timedelta = datetime.timedelta(days=1)
    df = task1.create_data_for_gantt_plotly(init_datetime,
                                            timedelta,
                                            view_ready=True)
    assert df[0]["Start"] == (
        init_datetime +
        task1.ready_time_list[0] * timedelta).strftime("%Y-%m-%d %H:%M:%S")
    assert df[0]["Finish"] == (
        init_datetime +
        (task1.start_time_list[0]) * timedelta).strftime("%Y-%m-%d %H:%M:%S")
    assert df[0]["Type"] == "Task"
    assert df[1]["Start"] == (
        init_datetime +
        task1.start_time_list[0] * timedelta).strftime("%Y-%m-%d %H:%M:%S")
    assert df[1]["Finish"] == (init_datetime +
                               (task1.finish_time_list[0] + 1.0) *
                               timedelta).strftime("%Y-%m-%d %H:%M:%S")
    assert df[1]["Type"] == "Task"
Beispiel #21
0
def dummy_project(scope="function"):
    """dummy_project."""
    # Components in Product
    c3 = Component("c3")
    c1 = Component("c1")
    c2 = Component("c2")
    c3.extend_child_component_list([c1, c2])

    # Tasks in Workflow
    task1_1 = Task("task1_1", need_facility=True)
    task1_2 = Task("task1_2")
    task2_1 = Task("task2_1")
    task3 = Task("task3")
    task3.extend_input_task_list([task1_2, task2_1])
    task1_2.append_input_task(task1_1)

    c1.extend_targeted_task_list([task1_1, task1_2])
    c2.append_targeted_task(task2_1)
    c3.append_targeted_task(task3)

    # Facilities in workplace
    f1 = BaseFacility("f1")
    f1.workamount_skill_mean_map = {
        task1_1.name: 1.0,
    }
    # workplace.facility_list.append(f1)

    # Workplace in BaseOrganization
    workplace = BaseWorkplace("workplace", facility_list=[f1])
    workplace.extend_targeted_task_list([task1_1, task1_2, task2_1, task3])

    # Teams in Organization
    team = Team("team")
    team.extend_targeted_task_list([task1_1, task1_2, task2_1, task3])

    # Workers in each Team
    w1 = Worker("w1", team_id=team.ID, cost_per_time=10.0)
    w1.workamount_skill_mean_map = {
        task1_1.name: 1.0,
        task1_2.name: 1.0,
        task2_1.name: 0.0,
        task3.name: 1.0,
    }
    w1.facility_skill_map = {f1.name: 1.0}
    team.worker_list.append(w1)

    w2 = Worker("w2", team_id=team.ID, cost_per_time=6.0)
    w2.workamount_skill_mean_map = {
        task1_1.name: 1.0,
        task1_2.name: 0.0,
        task2_1.name: 1.0,
        task3.name: 1.0,
    }
    w2.facility_skill_map = {f1.name: 1.0}
    team.worker_list.append(w2)

    # Project including Product, Workflow and Organization
    project = Project(
        init_datetime=datetime.datetime(2020, 4, 1, 8, 0, 0),
        unit_timedelta=datetime.timedelta(days=1),
    )
    project.product = Product([c3, c1, c2])
    project.workflow = Workflow([task1_1, task1_2, task2_1, task3])
    project.organization = Organization(team_list=[team],
                                        workplace_list=[workplace])
    return project
Beispiel #22
0
def test_create_gantt_plotly():
    c1 = Component("c1")
    task11 = Task("task11")
    task12 = Task("task12")
    c1.extend_targeted_task_list([task11, task12])
    c2 = Component("c2")
    task2 = Task("task2")
    c2.append_targeted_task(task2)
    product = Product([c1, c2])

    # Set test case
    task11.start_time_list = [0, 2]
    task11.ready_time_list = [0, 2]
    task11.finish_time_list = [3, 5]
    task12.start_time_list = [1]
    task12.ready_time_list = [2]
    task12.finish_time_list = [5]
    task2.start_time_list = [1]
    task2.ready_time_list = [2]
    task2.finish_time_list = [5]

    init_datetime = datetime.datetime(2020, 4, 1, 8, 0, 0)
    timedelta = datetime.timedelta(days=1)
    product.create_gantt_plotly(init_datetime, timedelta, save_fig_path="test.png")
    if os.path.exists("test.png"):
        os.remove("test.png")
Beispiel #23
0
def test_create_data_for_gantt_plotly():
    c1 = Component("c1")
    task11 = Task("task11")
    task12 = Task("task12")
    c1.extend_targeted_task_list([task11, task12])
    c2 = Component("c2")
    task2 = Task("task2")
    c2.append_targeted_task(task2)
    product = Product([c1, c2])

    # Set test case
    task11.start_time_list = [0, 2]
    task11.ready_time_list = [0, 2]
    task11.finish_time_list = [3, 5]
    task12.start_time_list = [1]
    task12.ready_time_list = [2]
    task12.finish_time_list = [5]
    task2.start_time_list = [1]
    task2.ready_time_list = [2]
    task2.finish_time_list = [5]

    init_datetime = datetime.datetime(2020, 4, 1, 8, 0, 0)
    timedelta = datetime.timedelta(days=1)
    df = product.create_data_for_gantt_plotly(init_datetime, timedelta)
    assert df[0]["Start"] == (init_datetime + 0 * timedelta).strftime(
        "%Y-%m-%d %H:%M:%S"
    )
    assert df[0]["Finish"] == (init_datetime + (5 + 1.0) * timedelta).strftime(
        "%Y-%m-%d %H:%M:%S"
    )
    assert df[0]["Type"] == "Component"
    assert df[1]["Start"] == (init_datetime + 1 * timedelta).strftime(
        "%Y-%m-%d %H:%M:%S"
    )
    assert df[1]["Finish"] == (init_datetime + (5 + 1.0) * timedelta).strftime(
        "%Y-%m-%d %H:%M:%S"
    )
    assert df[1]["Type"] == "Component"
Beispiel #24
0
def test_create_simple_gantt():
    c1 = Component("c1")
    task11 = Task("task11")
    task12 = Task("task12")
    c1.extend_targeted_task_list([task11, task12])
    c2 = Component("c2")
    task2 = Task("task2")
    c2.append_targeted_task(task2)
    product = Product([c1, c2])

    # Set test case
    task11.start_time_list = [1, 5]
    task11.ready_time_list = [0, 4]
    task11.finish_time_list = [2, 6]
    task12.start_time_list = [2]
    task12.ready_time_list = [1]
    task12.finish_time_list = [5]
    task2.start_time_list = [2]
    task2.ready_time_list = [1]
    task2.finish_time_list = [5]

    product.create_simple_gantt(save_fig_path="test.png")
    if os.path.exists("test.png"):
        os.remove("test.png")
Beispiel #25
0
def test_perform():
    auto = Task("a", auto_task=True, state=BaseTaskState.WORKING)
    auto.perform(0, seed=1234)
    assert auto.remaining_work_amount == auto.default_work_amount - 1

    task = Task("task")
    task.state = BaseTaskState.READY
    w1 = Worker("w1")
    w2 = Worker("w2")
    w1.workamount_skill_mean_map = {"task": 1.0}
    task.allocated_worker_list = [w1, w2]
    w1.assigned_task_list = [task]
    w2.assigned_task_list = [task]
    c = Component("a")
    c.append_targeted_task(task)
    task.perform(10)
    assert task.remaining_work_amount == task.default_work_amount
    assert task.target_component == c
    assert c.error == 0.0

    task.state = BaseTaskState.WORKING
    task.perform(10)
    assert task.remaining_work_amount == task.default_work_amount - 1.0
    assert task.target_component == c
    assert c.error == 0.0

    # Next test case
    w1.workamount_skill_sd_map = {"task": 0.2}
    w1.quality_skill_mean_map = {"task": 0.9}
    w1.quality_skill_sd_map = {"task": 0.02}
    task.perform(11, seed=1234, increase_component_error=2.0)
    assert task.remaining_work_amount == 7.905712967253502
    assert c.error == 2.0
Beispiel #26
0
def test_get_quality_skill_point():
    """test_get_quality_skill_point."""
    w = Worker("w1", "----")
    # w.set_quality_skill_mean_map(
    #     {"task1": 1.0, "task2": 0.0}, update_other_skill_info=True
    # )
    w.quality_skill_mean_map = {"task1": 1.0, "task2": 0.0}
    assert w.get_quality_skill_point("task3") == 0.0
    assert w.get_quality_skill_point("task2") == 0.0
    assert w.get_quality_skill_point("task1") == 1.0

    task1 = Task("task1")
    task1.state = BaseTaskState.NONE
    w.assigned_task_list = [task1]
    assert w.get_quality_skill_point("task1") == 1.0
    task1.state = BaseTaskState.READY
    assert w.get_quality_skill_point("task1") == 1.0
    task1.state = BaseTaskState.WORKING_ADDITIONALLY
    assert w.get_quality_skill_point("task1") == 1.0
    task1.state = BaseTaskState.FINISHED
    assert w.get_quality_skill_point("task1") == 1.0
    task1.state = BaseTaskState.WORKING
    assert w.get_quality_skill_point("task1") == 1.0

    w.quality_skill_sd_map["task1"] = 0.1
    assert w.get_quality_skill_point("task1", seed=1234) == 1.0471435163732492

    task2 = Task("task2")
    task2.state = BaseTaskState.NONE
    w.assigned_task_list.append(task2)
    w.quality_skill_sd_map["task1"] = 0.0
    assert w.get_quality_skill_point("task1") == 1.0
    task2.state = BaseTaskState.WORKING
    assert w.get_quality_skill_point("task1") == 1.0
Beispiel #27
0
def test_get_work_amount_skill_progress():
    """test_get_work_amount_skill_progress."""
    w = Worker("w1", "----")
    # w.set_workamount_skill_mean_map(
    #     {"task1": 1.0, "task2": 0.0}, update_other_skill_info=True
    # )
    w.workamount_skill_mean_map = {"task1": 1.0, "task2": 0.0}
    assert w.get_work_amount_skill_progress("task3") == 0.0
    assert w.get_work_amount_skill_progress("task2") == 0.0
    with pytest.raises(ZeroDivisionError):
        assert w.get_work_amount_skill_progress("task1") == 1.0

    task1 = Task("task1")
    task1.state = BaseTaskState.NONE
    w.assigned_task_list = [task1]
    with pytest.raises(ZeroDivisionError):
        assert w.get_work_amount_skill_progress("task1") == 1.0
    task1.state = BaseTaskState.READY
    with pytest.raises(ZeroDivisionError):
        assert w.get_work_amount_skill_progress("task1") == 1.0
    task1.state = BaseTaskState.WORKING_ADDITIONALLY
    assert w.get_work_amount_skill_progress("task1") == 1.0
    task1.state = BaseTaskState.FINISHED
    with pytest.raises(ZeroDivisionError):
        assert w.get_work_amount_skill_progress("task1") == 1.0
    task1.state = BaseTaskState.WORKING
    assert w.get_work_amount_skill_progress("task1") == 1.0

    w.workamount_skill_sd_map["task1"] = 0.1
    w.get_work_amount_skill_progress("task1", seed=1234)  # seed test

    task2 = Task("task2")
    task2.state = BaseTaskState.NONE
    w.assigned_task_list.append(task2)
    w.workamount_skill_sd_map["task1"] = 0.0
    assert w.get_work_amount_skill_progress("task1") == 1.0
    task2.state = BaseTaskState.WORKING
    assert w.get_work_amount_skill_progress("task1") == 0.5
Beispiel #28
0
def test_initialize():
    task = Task("task")
    task.est = 2.0
    task.eft = 10.0
    task.lst = 3.0
    task.lft = 11.0
    task.remaining_work_amount = 7
    task.actual_work_amount = 6
    task.state = BaseTaskState.READY
    task.ready_time_list = [1]
    task.start_time_list = [2]
    task.finish_time_list = [15]
    task.additional_task_flag = True
    task.allocated_worker_list = [Worker("w1")]
    task.initialize()
    assert task.est == 0.0
    assert task.eft == 0.0
    assert task.lst == -1.0
    assert task.lft == -1.0
    assert task.remaining_work_amount == task.default_work_amount * (
        1.0 - task.default_progress)
    assert task.actual_work_amount == task.default_work_amount * (
        1.0 - task.default_progress)
    assert task.state == BaseTaskState.NONE
    assert task.ready_time_list == []
    assert task.start_time_list == []
    assert task.finish_time_list == []
    assert task.additional_task_flag is False
    assert task.allocated_worker_list == []

    task = Task("task", default_progress=0.2)
    task.initialize()
    assert task.state == BaseTaskState.READY

    task = Task("task", default_progress=1.0)
    task.initialize()
    assert task.state == BaseTaskState.FINISHED
Beispiel #29
0
def test_str():
    print(Task("task"))
Beispiel #30
0
def test_get_state_from_record():
    task1 = Task("task1")
    task1.ready_time_list = [1, 5]
    task1.start_time_list = [2, 6]
    task1.finish_time_list = [3, 7]
    assert task1.get_state_from_record(0) == BaseTaskState.NONE
    assert task1.get_state_from_record(1) == BaseTaskState.READY
    assert task1.get_state_from_record(2) == BaseTaskState.WORKING
    assert task1.get_state_from_record(3) == BaseTaskState.FINISHED
    assert task1.get_state_from_record(4) == BaseTaskState.FINISHED
    assert task1.get_state_from_record(5) == BaseTaskState.READY
    assert task1.get_state_from_record(6) == BaseTaskState.WORKING
    assert task1.get_state_from_record(7) == BaseTaskState.FINISHED
    assert task1.get_state_from_record(8) == BaseTaskState.FINISHED

    task2 = Task("t2",
                 ready_time_list=[2],
                 start_time_list=[3],
                 finish_time_list=[4])
    assert task2.get_state_from_record(5) == BaseTaskState.FINISHED