Topic
  • 3 replies
  • Latest Post - ‏2013-12-03T18:27:02Z by ChrisBr
HowardGe
HowardGe
9 Posts

Pinned topic Is the funtion (searchPhase ) available for multi dimensions sequence variables?

‏2013-11-29T03:04:41Z |

Hi ,everyone

I define a three dimensions sequence variables like seq[ i in 1..3][ j in 1..4][ k in 1..10];And i want to set search phase  something like searching seq[1] more superior than seq[2]. How can i express this in OPL?

FYI:cp.setSearchPhases( f.searchPhase(seq[1]),f.searchPhase(seq[2]));  doesn;t work.

  • Philippe_Refalo
    Philippe_Refalo
    10 Posts

    Re: Is the funtion (searchPhase ) available for multi dimensions sequence variables?

    ‏2013-11-29T10:16:44Z  

    The array of variables given to a search phase must be a one-dimensional array. This means that you have to flatten your multi-dimensional array before using a search phase.

    Philippe

  • HowardGe
    HowardGe
    9 Posts

    Re: Is the funtion (searchPhase ) available for multi dimensions sequence variables?

    ‏2013-11-30T01:29:15Z  

    The array of variables given to a search phase must be a one-dimensional array. This means that you have to flatten your multi-dimensional array before using a search phase.

    Philippe

    hi Philippe, 

           when you say a search phase must be  a  one-dimensioal array, you mean just  the sequence variables  ,right?

           here is something strange:

           i alos  define a three dimensions interval variables like a[i in 1...3][j in 1..4][k in 1..5], and i just write the same way like cp.setSearchPhases( f.searchPhase(a[1]),f.searchPhase(a[2])); it seems to work, no erro popup at least.

  • ChrisBr
    ChrisBr
    41 Posts

    Re: Is the funtion (searchPhase ) available for multi dimensions sequence variables?

    ‏2013-12-03T18:27:02Z  
    • HowardGe
    • ‏2013-11-30T01:29:15Z

    hi Philippe, 

           when you say a search phase must be  a  one-dimensioal array, you mean just  the sequence variables  ,right?

           here is something strange:

           i alos  define a three dimensions interval variables like a[i in 1...3][j in 1..4][k in 1..5], and i just write the same way like cp.setSearchPhases( f.searchPhase(a[1]),f.searchPhase(a[2])); it seems to work, no erro popup at least.

    Hello,

     Actually, it is possible to define searchPhases like you tried, i.e.:
          cp.setSearchPhases( f.searchPhase(seq[1]),f.searchPhase(seq[2]));

    The problem could come from the fact that there is one or more sequence-variable in seq[1] or seq[2] which are not really used in the model.

    Chris.