Skip to main content
FRAMES NO FRAMES

Class IloOplConflictIterator

Definition file: ilopl/ilooplmodel.h
Map of IloOplConflictIteratorIloOplConflictIteratorIloOplConflictIterator
Utility for finding conflicts in constraints.

Use this class with an infeasible model. It can be used to report a conflict for a infeasible problem.

Method Summary
public voidattach(IloConstraint ct, IloNum pref)
public voidattach(IloConstraintMap cts, IloNumMap prefs)
public voidclearAttachements()
public voidend()
public voidexcludeConflict()
public voidfirst()
public IloExtractablegetExtractable() const
public IloIntgetStatus()
public IloBoolhasNext() const
public IloOplConflictIterator(IloOplModel model)
public voidnext()
public IloIntprintConflict(std::ostream & os)
Method Detail

IloOplConflictIterator

public IloOplConflictIterator(IloOplModel model)

Creates the default conflict iterator.

IloCp#refineConflict()

See Also:

Parameters:

model
The OPL model you want to determine conflicts for.

attach

public void attach(IloConstraint ct, IloNum pref)

Attach a constraint ct to a value pref (for preference). After some attachments have been done only the constraints with attached preferences are taken into account for conflict refinement.

Parameters:

ct
An IloConstraint object for the constraint to attach a preference to.
pref
The preference value.

attach

public void attach(IloConstraintMap cts, IloNumMap prefs)

Attach a constraint map cts to a value map prefs of preferences. After some attachments have been done, only the constraints with attached preferences are taken into account for conflict refinement.

Parameters:

cts
An IloConstraintMap object holding the constraints to attach preferences to.
prefs
An IloNumMap object holding the preferences.

clearAttachements

public void clearAttachements()

Clear all previously attached constraints.


end

public void end()

Clears the memory used by this object


excludeConflict

public void excludeConflict()

Excludes the current conflict and find next.

This allows to iterate more conflicts. The currently conflicting constraints will be excluded from next conflict refinement.


first

public void first()

Goes to the first in conflict.


getExtractable

public IloExtractable getExtractable() const

Returns the extractable in conflict.

Returns:

The IloExtractable in conflict.

getStatus

public IloInt getStatus()

Returns the CPLEX status of the conflict.

Returns:

An integer to indicate the status of conflict.

hasNext

public IloBool hasNext() const

Returns true, if there another conflict.

Returns:

true if there is another relaxation.

next

public void next()

Goes to the next conflict.


printConflict

public IloInt printConflict(std::ostream & os)

Reports conflicting constraints and returns the number of conflicts found.

Returns:

An integer representing the number of conflicts.