Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

incorrect range of variable 'step' in escape.mzn #1

Open
JenkinsY94 opened this issue Oct 1, 2016 · 2 comments
Open

incorrect range of variable 'step' in escape.mzn #1

JenkinsY94 opened this issue Oct 1, 2016 · 2 comments

Comments

@JenkinsY94
Copy link

In line 13 of file escape.mzn , the variable is declared as: var int: step;. The scale is not precise enough. When I fixed the edge with uedge, as shown in the debugging tutorial, the model output a wrong answer and printed step = 11 rather than step = 9 as expected.

I think we should either change this line of code to var STEP: step; or add another constraint: constraint path[maxstep] = dest; in order to get the right answer.

Hope this helps. :)

@pstuckey
Copy link
Collaborator

pstuckey commented Oct 3, 2016

On 1 Oct 2016, at 2:31 pm, JenkinsY94 [email protected] wrote:

In line 13 of file escape.mzn , the variable is declared as: var int: step;. The scale is not precise enough. When I fixed the edge with uedge, as shown in the debugging tutorial, the model output a wrong answer and printed step = 11 rather than step = 9 as expected.

I think we should either change this line of code to var STEP: step; or add another constraint: constraint path[maxstep] = dest; in order to get the right answer.

Hope this helps. :)


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or mute the thread.

I agree. But arguably this is just another bug in the initial model.

The code form escape-fixed uses the declaration

var STEP: step;

But I agree its not the point of the lecture, so I have modified the example code

@vitorsr
Copy link

vitorsr commented May 5, 2019

Related: somehow escape.dzn has an invalid character (invisible space) which is forbidden under certain circumstances in certain operating systems.

Edit: in the filename.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants