Topic
IC4NOTICE: developerWorks Community will be offline May 29-30, 2015 while we upgrade to the latest version of IBM Connections. For more information, read our upgrade FAQ.
1 reply Latest Post - ‏2013-09-30T08:00:27Z by Philippe_Refalo
NicolasBarnier
NicolasBarnier
2 Posts
ACCEPTED ANSWER

Pinned topic Ilo{Var|Value}Selector vs IloInt{Var|Value}Chooser

‏2013-09-27T12:54:20Z |

Hi,

 

I was wondering what are the differences between a "selector" and a "chooser" for

variables or values, as the user's manual shows examples mainly with "selectors"

which are directly passed as arguments to IloSearchPhase, whereas the constructors

of IloSearchPhase in the reference manual expect objects of type IloIntVarChooser and

IloIntValueChooser.

 

Best regards,

 

-- Nicolas Barnier

 

  • Philippe_Refalo
    Philippe_Refalo
    48 Posts
    ACCEPTED ANSWER

    Re: Ilo{Var|Value}Selector vs IloInt{Var|Value}Chooser

    ‏2013-09-30T08:00:27Z  in response to NicolasBarnier
    A chooser chooses one among many, while a selector selects several among many. For instance the variable selector IloSelectSmallest(IloDomainSize(env)) selects the variables that have the smallest domain. There can be several variables as a result. For building a variable chooser you can use one or more variable selectors. Each one is applied to the result of the previous one and at the end only one variable will be choosen. This choice is abritrary if several candidates remains. 
     
    For instance, this code defines a chooser that seclect first the variabels having the smallest domains and, if several variables remains at this stage, it chooses one variable randomly.
     
         IloVarSelectorArray varSelArray(env);
         varSelArray.add(IloSelectSmallest(IloDomainSize(env)));
         varSelArray.add(IloSelectRandomVar(env));
         IloIntVarChooser varChooser(env, varSelArray);
     

    The same principles applies to value selection as well. 

    Regards,
     
    Philippe
    Updated on 2013-09-30T08:01:20Z at 2013-09-30T08:01:20Z by Philippe_Refalo