/**
 * Created with IntelliJ IDEA.
 * Autor: julienderay
 * Company : SERLI
 * Date: 13/10/14
 * Time: 09:00
 */
package fr.emn.fil;

public class Algorythm {

    /**
     *
     * @param rj Region du rectangle déjà placé, tous les attributs sont connus
     * @param ri Region du rectangle à placer, on ne connait que les width et height
     * @return Forbidden region
     */
    public static PlacementRegion computeForbiddenRegion(PlacementRegion rj, PlacementRegion ri) {
        int xMin = rj.getxMax() - ri.getWidth() + 1;
        int xMax = rj.getxMin() + rj.getWidth() - 1;
        int yMin = rj.getyMax() - ri.getHeight() + 1;
        int yMax = rj.getyMin() + rj.getHeight() - 1;

        return new PlacementRegion(xMin, xMax, yMin, yMax, rj.getWidth(), rj.getHeight());
    }
}

@@ -472,16 +472,273 @@
 n ri) %7B%0A
+        if (rj.getxMax() - ri.getWidth() + 1 %3E rj.getxMin() + rj.getWidth() -1%0A                %7C%7C rj.getyMax() - ri.getHeight() + 1 %3E rj.getyMin() + rj.getHeight() - 1) %7B%0A            throw new RuntimeException(%22Violated constraint (see p.384)%22);%0A        %7D%0A%0A
         

add constraint