FRAMES NO FRAMES

Class IloBestSelector<,>

Definition file: ilsolver/iloselector.h
Include file: <ilsolver/iloselector.h>

The IloBestSelector template class is a subclass of selector that implements the selection of an object of type IloObject provided by a container of typeIloContainer based on:

The selector will select an instance of IloObject visited by the visitor that satisfies the predicate and that is the best according to the comparator.

In the case where no visitor is provided, the selector uses the default visitor provided for the template <IloObject,IloContainer> (see macro ILODEFAULTVISITOR). In the case where no predicate is provided, the default is a predicate that always returns IloTrue. In the case where no comparator is provided, the default is a comparator that considers all objects as being equal.

For more information, see Selectors.

See Also:

Constructor Summary
public IloBestSelector(IloMemoryManager manager)

Creates a selector returning an IloObject from an IloContainer.

public IloBestSelector(IloVisitor< IloObject, IloContainer > visitor, IloPredicate< IloObject > pred=0, IloComparator< IloObject > cmp=0)

Creates a selector returning an IloObject from an IloContainer.

public IloBestSelector(IloPredicate< IloObject > pred, IloComparator< IloObject > cmp=0)

Creates a selector returning an IloObject from an IloContainer.

public IloBestSelector(IloComparator< IloObject > cmp)

Creates a selector returning an IloObject from an IloContainer.

public IloBestSelector(IloVisitor< IloObject, IloContainer > visitor, IloComparator< IloObject > cmp)

Creates a selector returning an IloObject from an IloContainer.

Method Summary
public IloComparator< IloObject >getComparator() const

Returns the selector's comparator.

public IloPredicate< IloObject >getPredicate() const

Returns the selector's predicate.

public IloVisitor< IloObject, IloContainer >getVisitor() const

Returns the selector's visitor.

Inherited Methods from IloSelector
select
Constructor Detail

IloBestSelector

public IloBestSelector(IloMemoryManager manager)
Creates a selector returning an IloObject from an IloContainer.
internal

This constructor creates a selector that uses a default visitor allocated on the memory mananger manager.


IloBestSelector

public IloBestSelector(IloVisitor< IloObject, IloContainer > visitor, IloPredicate< IloObject > pred=0, IloComparator< IloObject > cmp=0)
Creates a selector returning an IloObject from an IloContainer.

This constructor creates a selector that uses the visitor visitor, the predicate pred, and the comparator cmp given as arguments.


IloBestSelector

public IloBestSelector(IloPredicate< IloObject > pred, IloComparator< IloObject > cmp=0)
Creates a selector returning an IloObject from an IloContainer.

This constructor creates a selector that uses the predicate pred and the comparator cmp given as arguments.


IloBestSelector

public IloBestSelector(IloComparator< IloObject > cmp)
Creates a selector returning an IloObject from an IloContainer.

This constructor creates a selector that uses the comparator cmp given as argument.


IloBestSelector

public IloBestSelector(IloVisitor< IloObject, IloContainer > visitor, IloComparator< IloObject > cmp)
Creates a selector returning an IloObject from an IloContainer.

This constructor creates a selector that uses the visitor visitor and the comparator cmp given as arguments.


Method Detail

getComparator

public IloComparator< IloObject > getComparator() const
Returns the selector's comparator.

This member function returns the comparator associated with the invoking selector.


getPredicate

public IloPredicate< IloObject > getPredicate() const
Returns the selector's predicate.

This member function returns the predicate associated with the invoking selector.


getVisitor

public IloVisitor< IloObject, IloContainer > getVisitor() const
Returns the selector's visitor.

This member function returns the visitor associated with the invoking selector.