def test_ContextSet3_isNotifiedAboutEmergencyGoal(mpers):
    fullContext = [mpers.contexts.c4, mpers.contexts.c8, mpers.contexts.c11]

    plan = PragmaticPlanning().isAchievablePlan(
        mpers.goals.isNotifiedAboutEmergencyGoal, fullContext, None)

    assert assertPlan(plan, [mpers.tasks.centralCallTask])
Exemple #2
0
def test_LocationIsIdentifiedGoal(mpers):
    fullcontext = []
    plan = PragmaticPlanning().isAchievable(
        mpers.goals.locationIsIdentifiedGoal, fullcontext, None)

    assert True is assertPlan(plan,
                              [mpers.tasks.considerLastKnownLocationTask])
def test_C2():
    fullContext = [c3, c4]

    plan = Planning().isAchievable(goal, fullContext, goal.interp)

    assert plan is not None

    assert True is assertPlan(plan, [task1])
Exemple #4
0
def test_IsNotifiedAboutEmergency(mpers):
    fullcontext = [
        mpers.contexts.c1, mpers.contexts.c2, mpers.contexts.c3,
        mpers.contexts.c4, mpers.contexts.c8
    ]
    plan = PragmaticPlanning().isAchievablePlan(
        mpers.goals.isNotifiedAboutEmergencyGoal, fullcontext, None)

    assert True is assertPlan(plan, [mpers.tasks.notifyByMobileVibrationTask])
def test_ContextSet4_medicalCareReachesGoal(mpers):
    fullContext = [
        mpers.contexts.c1, mpers.contexts.c2, mpers.contexts.c3,
        mpers.contexts.c6, mpers.contexts.c7
    ]

    plan = PragmaticPlanning().isAchievablePlan(
        mpers.goals.medicalCareReachesGoal, fullContext, None)

    assert assertPlan(plan, [mpers.tasks.ambulanceDispatchDelegationTask])
def test_ContextSet4_isNotifiedAboutEmergencyGoal(mpers):
    fullContext = [
        mpers.contexts.c1, mpers.contexts.c2, mpers.contexts.c3,
        mpers.contexts.c6, mpers.contexts.c7
    ]

    plan = PragmaticPlanning().isAchievablePlan(
        mpers.goals.isNotifiedAboutEmergencyGoal, fullContext, None)

    assert assertPlan(plan, [mpers.tasks.notifyByLightAlertTask])
def test_ContextSet3_emergencyIsDetectedGoal(mpers):
    fullContext = [mpers.contexts.c4, mpers.contexts.c8, mpers.contexts.c11]

    plan = PragmaticPlanning().isAchievablePlan(
        mpers.goals.emergencyIsDetectedGoal, fullContext, None)

    assert assertPlan(plan, [
        mpers.tasks.notifyCentralByInternetTask,
        mpers.tasks.acceptEmergencyTask
    ])
def test_ContextSet3_centralReceivesInfoGoal(mpers):
    fullContext = [mpers.contexts.c4, mpers.contexts.c8, mpers.contexts.c11]

    plan = PragmaticPlanning().isAchievablePlan(
        mpers.goals.centralReceivesInfoGoal, fullContext, None)

    assert assertPlan(plan, [
        mpers.tasks.considerLastKnownLocationTask,
        mpers.tasks.accessDataFromDatabaseTask,
        mpers.tasks.sendInfoByInternetTask
    ])
Exemple #9
0
def test_EmergencyIsDetected(mpers):
    fullcontext = [
        mpers.contexts.c1, mpers.contexts.c2, mpers.contexts.c3,
        mpers.contexts.c4, mpers.contexts.c8
    ]
    plan = PragmaticPlanning().isAchievablePlan(
        mpers.goals.emergencyIsDetectedGoal, fullcontext, None)

    assert True is assertPlan(plan, [
        mpers.tasks.notifyCentralBySMSTask,
        mpers.tasks.confirmEmergencyByCallTask
    ])
Exemple #10
0
def test_IsNotifiedAboutEmergencyGoal(mpers):
    fullcontext = [
        mpers.contexts.c1, mpers.contexts.c2, mpers.contexts.c3,
        mpers.contexts.c4, mpers.contexts.c5, mpers.contexts.c6,
        mpers.contexts.c7, mpers.contexts.c8, mpers.contexts.c9,
        mpers.contexts.c10
    ]

    plan = KnapsackPlanning().isAchievablePlan(
        mpers.goals.isNotifiedAboutEmergencyGoal, fullcontext, None)

    assert assertPlan(plan, [mpers.tasks.notifyByLightAlertTask])
Exemple #11
0
def test_C1(mpers):
    fullContext = [
        mpers.contexts.c1, mpers.contexts.c2, mpers.contexts.c4,
        mpers.contexts.c5, mpers.contexts.c7, mpers.contexts.c8,
        mpers.contexts.c10, mpers.contexts.c12
    ]
    plan = PragmaticPlanning().isAchievable(mpers.rootGoal, fullContext, None)
    assert plan is not None

    assert False is assertPlan(
        plan,
        [mpers.tasks.accessLocationFromGPSTask, mpers.tasks.centralCallTask])
Exemple #12
0
def test_EmergencyIsDetectedGoal(mpers):
    fullcontext = [
        mpers.contexts.c1, mpers.contexts.c2, mpers.contexts.c3,
        mpers.contexts.c4, mpers.contexts.c8
    ]
    plan = KnapsackPlanning().isAchievablePlan(
        mpers.goals.emergencyIsDetectedGoal, fullcontext, None)

    assert assertPlan(plan, [
        mpers.tasks.notifyCentralByInternetTask,
        mpers.tasks.confirmEmergencyByCallTask
    ])
Exemple #13
0
def test_centralReceivesInfo(mpers):
    fullcontext = [
        mpers.contexts.c1, mpers.contexts.c2, mpers.contexts.c3,
        mpers.contexts.c4, mpers.contexts.c8
    ]
    plan = PragmaticPlanning().isAchievablePlan(
        mpers.goals.centralReceivesInfoGoal, fullcontext, None)

    assert True is assertPlan(plan, [
        mpers.tasks.sendInfoByInternetTask,
        mpers.tasks.accessLocationFromTriangulationTask,
        mpers.tasks.accessDataFromDatabaseTask
    ])
Exemple #14
0
def test_ContextSet3(mpers):
    fullContext = [mpers.contexts.c4, mpers.contexts.c8, mpers.contexts.c11]

    plan = mpers.rootGoal.isAchievable(fullContext, None)

    assert assertPlan(plan, [
        mpers.tasks.ambulanceDispatchDelegationTask,
        mpers.tasks.acceptEmergencyTask, mpers.tasks.centralCallTask,
        mpers.tasks.considerLastKnownLocationTask,
        mpers.tasks.accessDataFromDatabaseTask,
        mpers.tasks.sendInfoByInternetTask,
        mpers.tasks.notifyCentralByInternetTask
    ])
Exemple #15
0
def test_infoIsPreparedGoal(mpers):
    fullcontext = [
        mpers.contexts.c1, mpers.contexts.c2, mpers.contexts.c3,
        mpers.contexts.c4, mpers.contexts.c8
    ]

    plan = KnapsackPlanning().isAchievablePlan(mpers.goals.infoIsPreparedGoal,
                                               fullcontext, None)

    assert assertPlan(plan, [
        mpers.tasks.accessLocationFromGPSTask,
        mpers.tasks.accessDataFromDatabaseTask
    ])
Exemple #16
0
def test_centralReceivesInfoGoal(mpers):
    fullcontext = [
        mpers.contexts.c1, mpers.contexts.c2, mpers.contexts.c3,
        mpers.contexts.c4, mpers.contexts.c8
    ]

    plan = KnapsackPlanning().isAchievablePlan(
        mpers.goals.centralReceivesInfoGoal, fullcontext, None)

    assert assertPlan(plan, [
        mpers.tasks.sendInfoByInternetTask,
        mpers.tasks.accessLocationFromGPSTask,
        mpers.tasks.accessDataFromDatabaseTask
    ])
def test_ContextSet1_centralReceivesInfoGoal(mpers):
    fullContext = [
        mpers.contexts.c1, mpers.contexts.c2, mpers.contexts.c3,
        mpers.contexts.c4, mpers.contexts.c5, mpers.contexts.c6,
        mpers.contexts.c7, mpers.contexts.c8, mpers.contexts.c9,
        mpers.contexts.c10
    ]

    plan = PragmaticPlanning().isAchievablePlan(
        mpers.goals.centralReceivesInfoGoal, fullContext, None)

    assert assertPlan(plan, [
        mpers.tasks.getInfoFromResponsibleTask,
        mpers.tasks.sendInfoByInternetTask
    ])
def test_ContextSet1_emergencyIsDetected(mpers):
    fullContext = [
        mpers.contexts.c1, mpers.contexts.c2, mpers.contexts.c3,
        mpers.contexts.c4, mpers.contexts.c5, mpers.contexts.c6,
        mpers.contexts.c7, mpers.contexts.c8, mpers.contexts.c9,
        mpers.contexts.c10
    ]

    plan = PragmaticPlanning().isAchievablePlan(
        mpers.goals.emergencyIsDetectedGoal, fullContext, None)

    assert assertPlan(plan, [
        mpers.tasks.notifyCentralByInternetTask,
        mpers.tasks.confirmEmergencyByCallTask
    ])
Exemple #19
0
def test_ContextSet4(mpers):
    fullContext = [
        mpers.contexts.c1, mpers.contexts.c2, mpers.contexts.c3,
        mpers.contexts.c6, mpers.contexts.c7
    ]

    plan = mpers.rootGoal.isAchievable(fullContext, None)

    assert assertPlan(plan, [
        mpers.tasks.accessLocationFromTriangulationTask,
        mpers.tasks.notifyByLightAlertTask,
        mpers.tasks.confirmEmergencyByCallTask,
        mpers.tasks.notifyCentralBySMSTask, mpers.tasks.sendInfoByInternetTask,
        mpers.tasks.accessDataFromDatabaseTask,
        mpers.tasks.ambulanceDispatchDelegationTask
    ])
Exemple #20
0
def test_ContextSet1(mpers):
    fullContext = [
        mpers.contexts.c1, mpers.contexts.c2, mpers.contexts.c3,
        mpers.contexts.c4, mpers.contexts.c5, mpers.contexts.c6,
        mpers.contexts.c7, mpers.contexts.c8, mpers.contexts.c9,
        mpers.contexts.c10
    ]

    plan = mpers.rootGoal.isAchievable(fullContext, None)

    assert assertPlan(plan, [
        mpers.tasks.ambulanceDispatchDelegationTask,
        mpers.tasks.notifyCentralByInternetTask,
        mpers.tasks.confirmEmergencyByCallTask,
        mpers.tasks.getInfoFromResponsibleTask,
        mpers.tasks.notifyByLightAlertTask, mpers.tasks.sendInfoByInternetTask
    ])
Exemple #21
0
def test_MPERS_model(mpers):
    fullcontext = [
        mpers.contexts.c1, mpers.contexts.c2, mpers.contexts.c3,
        mpers.contexts.c4, mpers.contexts.c8
    ]
    plan = KnapsackPlanning().isAchievablePlan(mpers.rootGoal, fullcontext,
                                               None)

    assert True is assertPlan(plan, [
        mpers.tasks.notifyCentralByInternetTask,
        mpers.tasks.confirmEmergencyByCallTask,
        mpers.tasks.notifyByMobileVibrationTask,
        mpers.tasks.sendInfoByInternetTask,
        mpers.tasks.accessLocationFromGPSTask,
        mpers.tasks.accessDataFromDatabaseTask,
        mpers.tasks.ambulanceDispatchDelegationTask,
    ])
Exemple #22
0
def test_ContextSet2(mpers):
    fullContext = [mpers.contexts.c9, mpers.contexts.c10, mpers.contexts.c11]

    plan = mpers.rootGoal.isAchievable(fullContext, None)

    assert assertPlan(plan, None)
Exemple #23
0
def test_LocationIsIdentifiedGoal(mpers):
    fullcontext = []
    plan = KnapsackPlanningGoal().isAchievable(
        mpers.goals.locationIsIdentifiedGoal, fullcontext, None)

    assert True is assertPlan(plan, [mpers.tasks.accessLocationFromGPSTask])