public AnnotFloorPlan(FloorPlan fp, int ratio, int actualW, int actualH) {
    em = DatabaseService.getEntityManager();
    floorPlan = fp;
    deadPoints = new HashSet<DeadPoint>();
    this.ratio = ratio;
    this.actualW = actualW;
    this.actualH = actualH;

    // Width and height of each cell
    //        unitW = fp.getWidth() * ratio / 100;
    //        unitH = fp.getHeight() * ratio / 100;

    // Calc the number of rows and columns needed
    //        rowCount = fp.getHeight() / unitH + 1;
    //        colCount = fp.getWidth() / unitW + 1;

    rowCount = 50;
    colCount = 75;
    unitW = (int) Math.ceil(fp.getWidth() / colCount);
    unitH = (int) Math.ceil(fp.getHeight() / rowCount);
    cellContainer = new Cell[rowCount][colCount];

    // init the graph
    g = new SimpleWeightedGraph<Cell, WeightedEdge>(WeightedEdge.class);

    initGraph();
  }
  @SuppressWarnings({"unchecked", "unchecked"})
  public AnnotFloorPlan() {

    em = DatabaseService.getEntityManager();
    floorPlan = new FloorPlan();
    deadPoints = new HashSet<DeadPoint>();
    g = new SimpleWeightedGraph<Cell, WeightedEdge>(WeightedEdge.class);
  }