//Parameters:
P1 = [0,1]
P2 = [0,1]

//Policy:
if P[location(0)] == 1 && P[worth_sampling(1)] >= P1 && P[have_sample(0)] == 0 --> goto(5)
elif P[location(0)] == 1 && P[worth_sampling(1)] >= P2 && P[have_sample(0)] == 0 --> goto(5)
elif P[location(0)] == 1 && P[worth_sampling(2)] >= P1 && P[have_sample(1)] == 0 --> goto(5)
elif P[location(0)] == 1 && P[worth_sampling(2)] >= P2 && P[have_sample(1)] == 0 --> goto(5)
elif P[location(0)] == 1 && P[worth_sampling(3)] >= P1 && P[have_sample(0)] == 0 --> goto(3)
elif P[location(0)] == 1 && P[worth_sampling(3)] >= P2 && P[have_sample(0)] == 0 --> goto(3)
elif P[location(0)] == 1 && P[worth_sampling(4)] >= P1 && P[have_sample(1)] == 0 --> goto(6)
elif P[location(0)] == 1 && P[worth_sampling(4)] >= P2 && P[have_sample(1)] == 0 --> goto(6)
elif P[location(0)] == 1 --> goto(6)
elif P[location(1)] == 1 && P[worth_sampling(1)] >= P1 && P[have_sample(0)] == 0 --> sample()
elif P[location(1)] == 1 && P[worth_sampling(1)] >= P2 && P[have_sample(0)] == 0 --> scan(1)
elif P[location(1)] == 1 && P[worth_sampling(2)] >= P1 && P[have_sample(1)] == 0 --> goto(2)
elif P[location(1)] == 1 && P[worth_sampling(2)] >= P2 && P[have_sample(1)] == 0 --> goto(2)
elif P[location(1)] == 1 && P[worth_sampling(3)] >= P1 && P[have_sample(0)] == 0 --> goto(5)
elif P[location(1)] == 1 && P[worth_sampling(3)] >= P2 && P[have_sample(0)] == 0 --> goto(5)
elif P[location(1)] == 1 && P[worth_sampling(4)] >= P1 && P[have_sample(1)] == 0 --> goto(5)
elif P[location(1)] == 1 && P[worth_sampling(4)] >= P2 && P[have_sample(1)] == 0 --> goto(5)
elif P[location(1)] == 1 --> goto(2)
elif P[location(2)] == 1 && P[worth_sampling(1)] >= P1 && P[have_sample(0)] == 0 --> goto(1)
elif P[location(2)] == 1 && P[worth_sampling(1)] >= P2 && P[have_sample(0)] == 0 --> goto(1)
elif P[location(2)] == 1 && P[worth_sampling(2)] >= P1 && P[have_sample(1)] == 0 --> sample()
elif P[location(2)] == 1 && P[worth_sampling(2)] >= P2 && P[have_sample(1)] == 0 --> scan(2)
elif P[location(2)] == 1 && P[worth_sampling(3)] >= P1 && P[have_sample(0)] == 0 --> goto(5)
elif P[location(2)] == 1 && P[worth_sampling(3)] >= P2 && P[have_sample(0)] == 0 --> goto(5)
elif P[location(2)] == 1 && P[worth_sampling(4)] >= P1 && P[have_sample(1)] == 0 --> goto(5)
elif P[location(2)] == 1 && P[worth_sampling(4)] >= P2 && P[have_sample(1)] == 0 --> goto(5)
elif P[location(2)] == 1 --> goto(7)
elif P[location(3)] == 1 && P[worth_sampling(1)] >= P1 && P[have_sample(0)] == 0 --> goto(5)
elif P[location(3)] == 1 && P[worth_sampling(1)] >= P2 && P[have_sample(0)] == 0 --> goto(5)
elif P[location(3)] == 1 && P[worth_sampling(2)] >= P1 && P[have_sample(1)] == 0 --> goto(5)
elif P[location(3)] == 1 && P[worth_sampling(2)] >= P2 && P[have_sample(1)] == 0 --> goto(5)
elif P[location(3)] == 1 && P[worth_sampling(3)] >= P1 && P[have_sample(0)] == 0 --> sample()
elif P[location(3)] == 1 && P[worth_sampling(3)] >= P2 && P[have_sample(0)] == 0 --> scan(3)
elif P[location(3)] == 1 && P[worth_sampling(4)] >= P1 && P[have_sample(1)] == 0 --> goto(6)
elif P[location(3)] == 1 && P[worth_sampling(4)] >= P2 && P[have_sample(1)] == 0 --> goto(6)
elif P[location(3)] == 1 --> goto(7)
elif P[location(4)] == 1 && P[worth_sampling(1)] >= P1 && P[have_sample(0)] == 0 --> goto(6)
elif P[location(4)] == 1 && P[worth_sampling(1)] >= P2 && P[have_sample(0)] == 0 --> goto(6)
elif P[location(4)] == 1 && P[worth_sampling(2)] >= P1 && P[have_sample(1)] == 0 --> goto(6)
elif P[location(4)] == 1 && P[worth_sampling(2)] >= P2 && P[have_sample(1)] == 0 --> goto(6)
elif P[location(4)] == 1 && P[worth_sampling(3)] >= P1 && P[have_sample(0)] == 0 --> goto(6)
elif P[location(4)] == 1 && P[worth_sampling(3)] >= P2 && P[have_sample(0)] == 0 --> goto(6)
elif P[location(4)] == 1 && P[worth_sampling(4)] >= P1 && P[have_sample(1)] == 0 --> sample()
elif P[location(4)] == 1 && P[worth_sampling(4)] >= P2 && P[have_sample(1)] == 0 --> scan(4)
elif P[location(4)] == 1 --> goto(6)
elif P[location(5)] == 1 && P[worth_sampling(1)] >= P1 && P[have_sample(0)] == 0 --> goto(1)
elif P[location(5)] == 1 && P[worth_sampling(1)] >= P2 && P[have_sample(0)] == 0 --> goto(1)
elif P[location(5)] == 1 && P[worth_sampling(2)] >= P1 && P[have_sample(1)] == 0 --> goto(2)
elif P[location(5)] == 1 && P[worth_sampling(2)] >= P2 && P[have_sample(1)] == 0 --> goto(2)
elif P[location(5)] == 1 && P[worth_sampling(3)] >= P1 && P[have_sample(0)] == 0 --> goto(3)
elif P[location(5)] == 1 && P[worth_sampling(3)] >= P2 && P[have_sample(0)] == 0 --> goto(3)
elif P[location(5)] == 1 && P[worth_sampling(4)] >= P1 && P[have_sample(1)] == 0 --> goto(6)
elif P[location(5)] == 1 && P[worth_sampling(4)] >= P2 && P[have_sample(1)] == 0 --> goto(6)
elif P[location(5)] == 1 --> goto(6)
elif P[location(6)] == 1 && P[worth_sampling(1)] >= P1 && P[have_sample(0)] == 0 --> goto(5)
elif P[location(6)] == 1 && P[worth_sampling(1)] >= P2 && P[have_sample(0)] == 0 --> goto(5)
elif P[location(6)] == 1 && P[worth_sampling(2)] >= P1 && P[have_sample(1)] == 0 --> goto(5)
elif P[location(6)] == 1 && P[worth_sampling(2)] >= P2 && P[have_sample(1)] == 0 --> goto(5)
elif P[location(6)] == 1 && P[worth_sampling(3)] >= P1 && P[have_sample(0)] == 0 --> goto(3)
elif P[location(6)] == 1 && P[worth_sampling(3)] >= P2 && P[have_sample(0)] == 0 --> goto(3)
elif P[location(6)] == 1 && P[worth_sampling(4)] >= P1 && P[have_sample(1)] == 0 --> goto(4)
elif P[location(6)] == 1 && P[worth_sampling(4)] >= P2 && P[have_sample(1)] == 0 --> goto(4)
else goto(7)