예제 #1
0
def calFirstIntentionConsistAfterNoise(trajectory, noisePoints, target1, target2, goalList):
    trajectory = list(map(tuple, trajectory))
    afterNoiseGrid = trajectory[noisePoints]
    if isGridsALine(afterNoiseGrid, target1, target2):
        afterNoiseIntentionConsis = 1 if goalList[noisePoints] == calculateFirstIntention(goalList) else 0
    else:
        afterNoiseIntentionConsis = 1 if goalList[noisePoints + 1] == calculateFirstIntention(goalList) else 0
    return afterNoiseIntentionConsis
예제 #2
0
    def __call__(self, trajectory, target1, target2, noisePoints, goalList):

        playerGrid = trajectory[noisePoints]
        targets = list([target1, target2])
        originGoal = targets[calculateFirstIntention(goalList)]
        noGoal = [target for target in targets if target != originGoal][0]

        likelihoodGoal = self.goalPolicy(playerGrid, originGoal).get(action)
        likelihoodNoGoal = self.goalPolicy(playerGrid, noGoal).get(action)

        return [likelihoodGoal, likelihoodNoGoal]
예제 #3
0
def calFirstIntentionInConsistAfterNoise(noisePoints, goalList):
    afterNoiseGoalList = goalList[noisePoints:]
    afterNoiseIntentionInConsis = 1 if calculateFirstIntention(afterNoiseGoalList) != calculateFirstIntention(goalList) else 0
    return afterNoiseIntentionInConsis