Skip to content

Commit

Permalink
Merge pull request #1089 from nehaniua/Dev-2.0
Browse files Browse the repository at this point in the history
 Removed areaType in Far & Removed condition for General staircase of f…
  • Loading branch information
rahul01987 authored May 9, 2024
2 parents 763e34e + 85aece1 commit 94a7db0
Showing 2 changed files with 57 additions and 55 deletions.
Original file line number Diff line number Diff line change
@@ -930,7 +930,7 @@ private void processFarResidential(Plan pl, OccupancyTypeHelper occupancyType, B
LOG.info("Type of area: " + typeOfArea);
System.out.println("Type of area: " + typeOfArea);
// Start Rule updated by Bimal on 14 March 2024
if (typeOfArea.equalsIgnoreCase(OLD)) {

if (plotArea.compareTo(BigDecimal.ZERO) < 0) {
errors.put("Plot Area Error:", "Plot area cannot be less than 0.");
pl.addErrors(errors);
@@ -970,50 +970,50 @@ private void processFarResidential(Plan pl, OccupancyTypeHelper occupancyType, B
pl.getFarDetails().setPermissableFar(FAR_UP_TO_1_25.doubleValue());
expectedResult = "<= 1.25";
}
}

if (typeOfArea.equalsIgnoreCase(NEW)) {


if (plotArea.compareTo(BigDecimal.ZERO) < 0) {
errors.put("Plot Area Error:", "Plot area cannot be less than 0.");
pl.addErrors(errors);
} else if (plotArea.compareTo(PLOT_AREA_UP_TO_100_SQM) <= 0) {
isAccepted = far.compareTo(FAR_UP_TO_2_00) <= 0;
LOG.info("FAR_UP_TO_2_00: " + isAccepted);
pl.getFarDetails().setPermissableFar(FAR_UP_TO_2_00.doubleValue());
expectedResult = "<= 2.00";
} else if (plotArea.compareTo(PLOT_AREA_100_150_SQM) <= 0) {
isAccepted = far.compareTo(FAR_UP_TO_1_90) <= 0;
LOG.info("FAR_UP_TO_1_90: " + isAccepted);
pl.getFarDetails().setPermissableFar(FAR_UP_TO_1_90.doubleValue());
expectedResult = "<= 1.90";
} else if (plotArea.compareTo(PLOT_AREA_150_200_SQM) <= 0) {
isAccepted = far.compareTo(FAR_UP_TO_1_75) <= 0;
LOG.info("FAR_UP_TO_1_75: " + isAccepted);
pl.getFarDetails().setPermissableFar(FAR_UP_TO_1_75.doubleValue());
expectedResult = "<= 1.75";
} else if (plotArea.compareTo(PLOT_AREA_200_300_SQM) <= 0) {
isAccepted = far.compareTo(FAR_UP_TO_1_65) <= 0;
LOG.info("FAR_UP_TO_1_65: " + isAccepted);
pl.getFarDetails().setPermissableFar(FAR_UP_TO_1_65.doubleValue());
expectedResult = "<= 1.65";
} else if (plotArea.compareTo(PLOT_AREA_300_500_SQM) <= 0) {
isAccepted = far.compareTo(FAR_UP_TO_1_50) <= 0;
LOG.info("FAR_UP_TO_1_50: " + isAccepted);
pl.getFarDetails().setPermissableFar(FAR_UP_TO_1_50.doubleValue());
expectedResult = "<= 1.50";
} else if (plotArea.compareTo(PLOT_AREA_500_1000_SQM) <= 0) {
isAccepted = far.compareTo(FAR_UP_TO_1_50) <= 0;
LOG.info("FAR_UP_TO_1_50 2nd: " + isAccepted);
pl.getFarDetails().setPermissableFar(FAR_UP_TO_1_50.doubleValue());
expectedResult = "<= 1.50";
} else {
isAccepted = far.compareTo(FAR_UP_TO_1_25) <= 0;
LOG.info("FAR_UP_TO_1_25: " + isAccepted);
pl.getFarDetails().setPermissableFar(FAR_UP_TO_1_25.doubleValue());
expectedResult = "<= 1.25";
}
}
// if (typeOfArea.equalsIgnoreCase(NEW)) {
//
// if (plotArea.compareTo(BigDecimal.ZERO) < 0) {
// errors.put("Plot Area Error:", "Plot area cannot be less than 0.");
// pl.addErrors(errors);
// } else if (plotArea.compareTo(PLOT_AREA_UP_TO_100_SQM) <= 0) {
// isAccepted = far.compareTo(FAR_UP_TO_2_00) <= 0;
// LOG.info("FAR_UP_TO_2_00: " + isAccepted);
// pl.getFarDetails().setPermissableFar(FAR_UP_TO_2_00.doubleValue());
// expectedResult = "<= 2.00";
// } else if (plotArea.compareTo(PLOT_AREA_100_150_SQM) <= 0) {
// isAccepted = far.compareTo(FAR_UP_TO_1_90) <= 0;
// LOG.info("FAR_UP_TO_1_90: " + isAccepted);
// pl.getFarDetails().setPermissableFar(FAR_UP_TO_1_90.doubleValue());
// expectedResult = "<= 1.90";
// } else if (plotArea.compareTo(PLOT_AREA_150_200_SQM) <= 0) {
// isAccepted = far.compareTo(FAR_UP_TO_1_75) <= 0;
// LOG.info("FAR_UP_TO_1_75: " + isAccepted);
// pl.getFarDetails().setPermissableFar(FAR_UP_TO_1_75.doubleValue());
// expectedResult = "<= 1.75";
// } else if (plotArea.compareTo(PLOT_AREA_200_300_SQM) <= 0) {
// isAccepted = far.compareTo(FAR_UP_TO_1_65) <= 0;
// LOG.info("FAR_UP_TO_1_65: " + isAccepted);
// pl.getFarDetails().setPermissableFar(FAR_UP_TO_1_65.doubleValue());
// expectedResult = "<= 1.65";
// } else if (plotArea.compareTo(PLOT_AREA_300_500_SQM) <= 0) {
// isAccepted = far.compareTo(FAR_UP_TO_1_50) <= 0;
// LOG.info("FAR_UP_TO_1_50: " + isAccepted);
// pl.getFarDetails().setPermissableFar(FAR_UP_TO_1_50.doubleValue());
// expectedResult = "<= 1.50";
// } else if (plotArea.compareTo(PLOT_AREA_500_1000_SQM) <= 0) {
// isAccepted = far.compareTo(FAR_UP_TO_1_50) <= 0;
// LOG.info("FAR_UP_TO_1_50 2nd: " + isAccepted);
// pl.getFarDetails().setPermissableFar(FAR_UP_TO_1_50.doubleValue());
// expectedResult = "<= 1.50";
// } else {
// isAccepted = far.compareTo(FAR_UP_TO_1_25) <= 0;
// LOG.info("FAR_UP_TO_1_25: " + isAccepted);
// pl.getFarDetails().setPermissableFar(FAR_UP_TO_1_25.doubleValue());
// expectedResult = "<= 1.25";
// }
// }
// End Rule updated by Bimal on 14 March 2024

// Old rules commented by Bimal on 14 March 2024
Original file line number Diff line number Diff line change
@@ -149,17 +149,17 @@ public Plan process(Plan plan) {
}
}

if (block.getBuilding().getFloors().size() > 1
&& !stairAbsent.isEmpty()) {
if (
!stairAbsent.isEmpty()) {
for (String error : stairAbsent) {
errors.put("General Stair " + error,
"General stair not defined in " + error);
plan.addErrors(errors);
}
}

if (block.getBuilding().getFloors().size() > 1
&& generalStairCount == 0) {
if (
generalStairCount == 0) {
errors.put("General Stair not defined in blk " + block.getNumber(),
"General Stair not defined in block " + block.getNumber()
+ ", it is mandatory for building with floors more than one.");
@@ -346,12 +346,14 @@ private BigDecimal getRequiredWidth(Block block, OccupancyTypeHelper mostRestric
} else if (mostRestrictiveOccupancyType != null && mostRestrictiveOccupancyType.getType() != null
&& DxfFileConstants.A_AF_GH.equalsIgnoreCase(mostRestrictiveOccupancyType.getType().getCode())) {
return BigDecimal.valueOf(0.75);
} else if (mostRestrictiveOccupancyType != null && mostRestrictiveOccupancyType.getType() != null
&& DxfFileConstants.A.equalsIgnoreCase(mostRestrictiveOccupancyType.getType().getCode())
&& block.getBuilding().getBuildingHeight().compareTo(BigDecimal.valueOf(10)) <= 0
&& block.getBuilding().getFloorsAboveGround().compareTo(BigDecimal.valueOf(3)) <= 0) {
return BigDecimal.ONE;
} else if (mostRestrictiveOccupancyType != null && mostRestrictiveOccupancyType.getType() != null
}
//else if (mostRestrictiveOccupancyType != null && mostRestrictiveOccupancyType.getType() != null
// && DxfFileConstants.A.equalsIgnoreCase(mostRestrictiveOccupancyType.getType().getCode())
// && block.getBuilding().getBuildingHeight().compareTo(BigDecimal.valueOf(10)) <= 0
// && block.getBuilding().getFloorsAboveGround().compareTo(BigDecimal.valueOf(3)) <= 0) {
// return BigDecimal.ONE;
// }
else if (mostRestrictiveOccupancyType != null && mostRestrictiveOccupancyType.getType() != null
&& DxfFileConstants.A.equalsIgnoreCase(mostRestrictiveOccupancyType.getType().getCode())) {
return BigDecimal.valueOf(0.76);
} else if (mostRestrictiveOccupancyType != null && mostRestrictiveOccupancyType.getType() != null
@@ -369,7 +371,7 @@ private BigDecimal getRequiredLandingWidth(Block block, OccupancyTypeHelper most

if (mostRestrictiveOccupancyType != null && mostRestrictiveOccupancyType.getType() != null
&& DxfFileConstants.A.equalsIgnoreCase(mostRestrictiveOccupancyType.getType().getCode())) {
return BigDecimal.valueOf(1);
return BigDecimal.valueOf(0.76);
}
else {
return BigDecimal.valueOf(1.5);

0 comments on commit 94a7db0

Please sign in to comment.