Skip to content

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

Open

Description

@JenkinsY94

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. :)

Activity

  1. pstuckey commented on Oct 3, 2016

    @pstuckey
    Collaborator

    On 1 Oct 2016, at 2:31 pm, JenkinsY94 notifications@github.com 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

  2. vitorsr commented on May 5, 2019

    @vitorsr

    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions