chocoteam / choco-solver

An open-source Java library for Constraint Programming
http://choco-solver.org/
BSD 4-Clause "Original" or "Old" License
683 stars 137 forks source link

Create of `IntAffineView` #1065

Closed cprudhom closed 9 months ago

cprudhom commented 9 months ago

Related to #564

This PR aims at merging the 3 views on IntVar, namely IntOffsetView, IntScaleView and IntMinusView, into a single one, namely IntAffineView. Benefits are:

In addition, it seems that the recognition of views were incorrect, on some problems, it reduces the number of views (mostly when Task are in the game). For instance, MSPSP-easy_01.xml.lzma (xcsp) previously created 370 including 149 views where now 241 variables are created including 20 views. Inevitably, it pertubs black-box strategies and some deterioration can be observed.

Note: most of the modifications in this PR are related to code adaptation. The main classes to double check are IntAffineView (+ tests) and IViewFactory.

Note: I also define default behavior in IntVar for some advanced methods (like removeInterval, for example). This is related to this PR since the affine view only defines the 4 main methods.

cprudhom commented 9 months ago

Are there still remarks? Or can one of you approuve the PR?