Esempio n. 1
0
def dummy_organization(scope="function"):
    c1 = BaseTeam("c1")
    w11 = BaseWorker("w11", cost_per_time=10.0)
    w12 = BaseWorker("w12", cost_per_time=5.0)
    w11.start_time_list = [0, 5]
    w11.finish_time_list = [2, 8]
    w12.start_time_list = [9]
    w12.finish_time_list = [11]
    c1.worker_list = [w11, w12]

    c2 = BaseTeam("c2")
    w2 = BaseWorker("w2", cost_per_time=5.0)
    w2.start_time_list = [9]
    w2.finish_time_list = [11]
    c2.worker_list = [w2]
    c2.parent_team = c1

    f = BaseFacility("f", cost_per_time=20.0)
    f.start_time_list = [9]
    f.finish_time_list = [11]
    factory = BaseFactory("factory", facility_list=[f])

    dummy_factory = BaseFactory("dummy")
    factory.parent_factory = dummy_factory

    organization = BaseOrganization(team_list=[c1, c2],
                                    factory_list=[factory, dummy_factory])
    return organization
Esempio n. 2
0
def dummy_organization(scope="function"):
    """dummy_organization."""
    c1 = BaseTeam("c1")
    w11 = BaseWorker("w11", cost_per_time=10.0)
    w12 = BaseWorker("w12", cost_per_time=5.0)
    w11.state_record_list = [
        BaseWorkerState.WORKING,
        BaseWorkerState.WORKING,
        BaseWorkerState.FREE,
        BaseWorkerState.WORKING,
        BaseWorkerState.FREE,
        BaseWorkerState.FREE,
    ]
    w12.state_record_list = [
        BaseWorkerState.WORKING,
        BaseWorkerState.WORKING,
        BaseWorkerState.FREE,
        BaseWorkerState.WORKING,
        BaseWorkerState.FREE,
        BaseWorkerState.FREE,
    ]
    c1.worker_list = [w11, w12]

    c2 = BaseTeam("c2")
    w2 = BaseWorker("w2", cost_per_time=5.0)
    w2.state_record_list = [
        BaseWorkerState.WORKING,
        BaseWorkerState.WORKING,
        BaseWorkerState.FREE,
        BaseWorkerState.WORKING,
        BaseWorkerState.FREE,
        BaseWorkerState.FREE,
    ]
    c2.worker_list = [w2]
    c2.parent_team = c1

    f = BaseFacility("f", cost_per_time=20.0)
    f.state_record_list = [
        BaseFacilityState.WORKING,
        BaseFacilityState.WORKING,
        BaseFacilityState.FREE,
        BaseFacilityState.WORKING,
        BaseFacilityState.FREE,
        BaseFacilityState.FREE,
    ]
    workplace = BaseWorkplace("workplace", facility_list=[f])

    dummy_workplace = BaseWorkplace("dummy")
    workplace.parent_workplace = dummy_workplace

    organization = BaseOrganization(
        team_list=[c1, c2], workplace_list=[workplace, dummy_workplace])
    return organization