title: Search strategy with optional variables
body: <p>I'm implementing a simple model in Minizinc to schedule tasks with different priority and duration in a series of time slots, but not all the tasks can be scheduled so some will be left out and I'm trying to maximize the sum of priorities of the scheduled tasks.</p>
  
  <p>I have a working version where the tasks is defined in a array of vars, and non-scheduled tasks have time 0. The constrains have several where clauses to take into account only the scheduled tasks (when[i]>0). The default search strategy is very slow so I changed it to another that worked much better, using Gecode as solver.</p>
  
  <p>Now I'm implementing a different version using optional variables, to get rid off the where clauses, to check if there is any improvement. However, it seems I cannot define a search strategy int_search() when using opt var.</p>
  
  <p>Is there any way to do it?</p>
  
  <p>The working model is as follows (the solve clause with the search strategy I want to try is commented out):</p>
  
  <pre><code>int: numtasks=100;
  int: numslots=100;
  
  set of int: TASK=1..numtasks;
  set of int: SLOT=1..numslots;
  array[TASK] of var opt 1..numslots: when;
  array[TASK] of int: duration = [(i mod 3)+1 | i in TASK];
  array[TASK] of int: prio = [(i mod 10)+1 | i in TASK]; 
  
  include "globals.mzn";
  constraint disjunctive(when, duration);
  
  var int: obj = sum(i in TASK where not absent(when[i]))(prio[i]);
  %solve ::int_search(when, input_order, indomain_random, complete) maximize obj;
  solve maximize obj;
  
  output [show(obj)," ",show(when)];
  </code></pre>