Spaces:
Sleeping
Sleeping
import gradio as gr | |
def cmda_redevelopment_calculator(uds, num_owners, guideline_value, construction_cost, current_area): | |
# Calculations | |
normal_fsi_area = 2.0 * uds | |
premium_fsi_area = 2.8 * uds | |
extra_area = 0.8 * uds # This is the part that needs premium FSI | |
# Premium FSI charges | |
premium_fsi_charge = 0.4 * guideline_value * extra_area | |
# Total construction cost (for full 2.8x UDS build) | |
total_construction_cost = premium_fsi_area * construction_cost | |
# Area per owner (equal split) | |
area_per_owner = premium_fsi_area / num_owners | |
uds_per_owner = uds / num_owners | |
current_area_per_owner = current_area / num_owners | |
# Benefit per owner | |
area_gain_per_owner = area_per_owner - current_area_per_owner | |
return { | |
"Normal FSI Buildable Area (2.0 x UDS)": f"{normal_fsi_area:.2f} sq.ft", | |
"Max Buildable Area with Premium FSI (2.8 x UDS)": f"{premium_fsi_area:.2f} sq.ft", | |
"Extra Area via Premium FSI (0.8 x UDS)": f"{extra_area:.2f} sq.ft", | |
"Premium FSI Charges": f"₹ {premium_fsi_charge:,.2f}", | |
"Total Construction Cost (at 2.8 x UDS)": f"₹ {total_construction_cost:,.2f}", | |
"Built-up Area per Owner": f"{area_per_owner:.2f} sq.ft", | |
"Current Area per Owner": f"{current_area_per_owner:.2f} sq.ft", | |
"Net Area Gain per Owner": f"{area_gain_per_owner:.2f} sq.ft" | |
} | |
# Gradio interface | |
inputs = [ | |
gr.Number(label="Current UDS (in sq.ft)", value=450), | |
gr.Number(label="Number of Owners", value=4), | |
gr.Number(label="Guideline Value (₹/sq.ft)", value=5000), | |
gr.Number(label="Construction Cost (₹/sq.ft)", value=3500), | |
gr.Number(label="Current Total Area (in sq.ft)", value=1800) | |
] | |
outputs = gr.JSON(label="CMDA Redevelopment Report") | |
app = gr.Interface( | |
fn=cmda_redevelopment_calculator, | |
inputs=inputs, | |
outputs=outputs, | |
title="CMDA Redevelopment Calculator (Equal Share Model)", | |
description="This calculator estimates redevelopment potential based on UDS, FSI rules, and premium FSI charges. Assumes equal area distribution among owners." | |
) | |
if __name__ == "__main__": | |
app.launch() | |