0

Я решил следующую задачу обработки ограничений. Не могли бы вы проверить, правильно ли это?Нужна помощь при решении проблемы ограничения (2-й)

One of the prisoners of a high-level security prison sees a way to escape. Almost 
free, he reaches a corridor of 20 meters long, guarded by 5 cameras, behind 
which is the exit. In Figure 3, we provide a schematic overview of the corridor. 

enter image description here

The prisoner has only 10 seconds to reach the end of the corridor and may 
not be noticed by the cameras in doing so. After 10 seconds, or when seen by a 
camera, the prison is put under total lock-down, which will prevent his escape. 
We will consider the following constraints: 

• A camera can only see 3 meters and cannot see its own position. E.g., the 
camera at position 9 is able to see the positions 6, 7 and 8, or 10, 11 and 
12, depending on the orientation of the camera. 

• At time point 0, all cameras are oriented towards the end of the corridor. 
Thus, the camera at position 9 sees positions 10, 11 and 12. 

• Every two seconds the cameras change their orientation. Thus, at time 
point 2 the camera at position 9 will see the positions 6, 7 and 8. 

• Every second, the prisoner can move 0, 1, 2 or 3 meters forward. He 
cannot move backward. Thus, if the prisoner is standing at position 2 at 
time point 2, then, at time point 3, he can be on position 2, 3, 4 or 5. 

Formulate the problem above as a constraint problem. Come up with a useful 
representation of the problem in terms of the constraint processing tool. Provide 
an explanation of indices, variables and domains. Furthermore, provide for every 
introduced constraint, the meaning of the constraint in natural language. 

Это мое решение, и хочу, чтобы вы, ребята, чтобы проверить меня, где я делаю неправильно:

***MY VARIABLES*** 

Name: T, domain: 0..10     // T = the time from 0 to 10 seconds 

Name: P, domain: 0..3     // P = Prisoner can move 0, 1, 2, 3 meters 

Name: C1, domain: 2      // C1 = camera 1 

Name: C2, domain: 4      // C2 = camera 2 

Name: C3, domain: 9      // C3 = camera 3 

Name: C4, domain: 12      // C4 = camera 14 

Name: C5, domain: 17      // C5 = camera 5 

Name: View1, domain: -1..5    // camera1 view 

Name: View2, domain: 1..7     // camera2 view 

Name: View3, domain: 6..12     // camera3 view 

Name: View4, domain: 9..15     // camera4 view 

Name: View5, domain: 14..20    // camera5 view 

МОИ ТРУДНОСТИ
Я объявил ограничений таким образом, чтобы при каждом время просмотра камер меняется альтернативно, когда время четное число, но когда время один, только пленник может двигаться.

Constraint: (T=0/\View1=(C1+3)/\View2=(C2+3)/\View3=(C3+3)/\View4=(C4+3)/\View5=(C5+3)/\P(i)), range: i>-1 
    Constraint: (T=1/\P(i)), range: i>0 
    Constraint: (T=2/\View1=(C1-3)/\View2=(C2-3)/\View3=(C3-3)/\View4=(C4-3)/\View5=(C5-3)/\P(i)), range: i>-1 
    Constraint: (T=3/\P(i)), range: i>0 
    Constraint: (T=4/\View1=(C1+3)/\View2=(C2+3)/\View3=(C3+3)/\View4=(C4+3)/\View5=(C5+3)/\P(i)), range: i>-1 
    Constraint: (T=5/\P(i)), range: i>0 
    Constraint: (T=6/\View1=(C1-3)/\View2=(C2-3)/\View3=(C3-3)/\View4=(C4-3)/\View5=(C5-3)/\P(i)), range: i>-1 
    Constraint: (T=7/\P(i)), range: i>0 
    Constraint: (T=8/\View1=(C1+3)/\View2=(C2+3)/\View3=(C3+3)/\View4=(C4+3)/\View5=(C5+3)/\P(i)), range: i>-1 
    Constraint: (T=9/\P(i)), range: i>0 
    Constraint: (T=10/\View1=(C1-3)/\View2=(C2-3)/\View3=(C3-3)/\View4=(C4-3)/\View5=(C5-3)/\P(i)), range: i>-1 

Ребята, я знаю, что делаю что-то неправильно, поэтому помогите мне исправить ситуацию.

Благодарим за помощь. вчера я отправил подобный вопрос, так что если вы хотите знать синтаксис переменных и ограничений, то это ссылка: Variable and Constraint syntax in this post

Спасибо за вашу помощь

ответ

1

Вы забыли, что камера не может видеть сам: «Камера может видеть только 3 метра и не может видеть свою собственную позицию». Таким образом, View1, View2 ... View5 следует изменить.

Als, вам нужно одна переменные для положения заключенного (у вас есть только один для движения заключенного)

Я ищу другие ошибки.

+0

Спасибо за ваш ответ и надеюсь, что вы найдете другие ошибки. – Kap

 Смежные вопросы

  • Нет связанных вопросов^_^