Spaces:
Sleeping
Sleeping
rickyt
commited on
Commit
Β·
c1fd2f4
1
Parent(s):
ec53212
code changes - fuel per month
Browse files
app.py
CHANGED
|
@@ -26,11 +26,13 @@ def simulate(
|
|
| 26 |
# Calculations
|
| 27 |
production_per_day = unit_count * cycle_per_day * unit_payload
|
| 28 |
fuel_per_day = unit_count * cycle_per_day * fuel_rate
|
|
|
|
| 29 |
|
| 30 |
return (
|
| 31 |
f"{fuel_rate:,.2f}",
|
| 32 |
f"{production_per_day:,.2f}",
|
| 33 |
f"{fuel_per_day:,.2f}"
|
|
|
|
| 34 |
)
|
| 35 |
|
| 36 |
# Interface
|
|
@@ -63,7 +65,7 @@ with gr.Blocks() as interface:
|
|
| 63 |
output1 = gr.Textbox(label="π Predicted Fuel Rate per Cycle (L)")
|
| 64 |
output2 = gr.Textbox(label="π¦ Production Per Day (Ton)")
|
| 65 |
output3 = gr.Textbox(label="β½ Fuel Consumption Per Day (L)")
|
| 66 |
-
|
| 67 |
|
| 68 |
submit_btn.click(
|
| 69 |
simulate,
|
|
@@ -72,7 +74,7 @@ with gr.Blocks() as interface:
|
|
| 72 |
empty_stop, loading_stop, loaded_stop,
|
| 73 |
unit_count, cycle_per_day, unit_payload
|
| 74 |
],
|
| 75 |
-
outputs=[output1, output2, output3]
|
| 76 |
)
|
| 77 |
|
| 78 |
interface.launch()
|
|
|
|
| 26 |
# Calculations
|
| 27 |
production_per_day = unit_count * cycle_per_day * unit_payload
|
| 28 |
fuel_per_day = unit_count * cycle_per_day * fuel_rate
|
| 29 |
+
fuel_per_month = 30 * fuel_per_day
|
| 30 |
|
| 31 |
return (
|
| 32 |
f"{fuel_rate:,.2f}",
|
| 33 |
f"{production_per_day:,.2f}",
|
| 34 |
f"{fuel_per_day:,.2f}"
|
| 35 |
+
f"{fuel_per_month:,.2f}"
|
| 36 |
)
|
| 37 |
|
| 38 |
# Interface
|
|
|
|
| 65 |
output1 = gr.Textbox(label="π Predicted Fuel Rate per Cycle (L)")
|
| 66 |
output2 = gr.Textbox(label="π¦ Production Per Day (Ton)")
|
| 67 |
output3 = gr.Textbox(label="β½ Fuel Consumption Per Day (L)")
|
| 68 |
+
output4 = gr.Textbox(label="β½ Fuel Consumption Per Month (L)")
|
| 69 |
|
| 70 |
submit_btn.click(
|
| 71 |
simulate,
|
|
|
|
| 74 |
empty_stop, loading_stop, loaded_stop,
|
| 75 |
unit_count, cycle_per_day, unit_payload
|
| 76 |
],
|
| 77 |
+
outputs=[output1, output2, output3, output4]
|
| 78 |
)
|
| 79 |
|
| 80 |
interface.launch()
|