Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
AidenSwayne committed Nov 27, 2023
2 parents 203725d + c3dd580 commit b52e7da
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
18 changes: 9 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,46 +10,46 @@ The test cases below are auto-generated by GitHub Actions every time a commit is
```python
Parameters given: 3 floor, 20 meter x length, 25 meter y length.

Cost of materials and offsets (measured in USD): $106155.9
Cost of materials and offsets (measured in USD): $100506.85

Columns (measured in quantity):
Aluminum columns needed: 0
Steel columns needed: 350
Steel columns needed: 263

Carbon offsets (measured in acres):
Oak tree acres: 0.0
Slash pine acres: 0.9490254579945798
Slash pine acres: 0.9323896747967478
```
<!-- END TEST CASE -->

<!-- TEST CASE 2 -->
```python
Parameters given: 5 floor, 15 meter x length, 40 meter y length.

Cost of materials and offsets (measured in USD): $212311.79
Cost of materials and offsets (measured in USD): $200948.77

Columns (measured in quantity):
Aluminum columns needed: 0
Steel columns needed: 700
Steel columns needed: 525

Carbon offsets (measured in acres):
Oak tree acres: 0.0
Slash pine acres: 1.8980509159891596
Slash pine acres: 1.86458813369467
```
<!-- END TEST CASE -->

<!-- TEST CASE 3 -->
```python
Parameters given: 1 floor, 40 meter x length, 20 meter y length.

Cost of materials and offsets (measured in USD): $56638.12
Cost of materials and offsets (measured in USD): $53586.34

Columns (measured in quantity):
Aluminum columns needed: 0
Steel columns needed: 187
Steel columns needed: 140

Carbon offsets (measured in acres):
Oak tree acres: 0.0
Slash pine acres: 0.5062106495633845
Slash pine acres: 0.4972235023185787
```
<!-- END TEST CASE -->
6 changes: 3 additions & 3 deletions linear_program.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,8 @@ def calculate(floors=1, xLength=1, yLength=1):
# 21000 pounds has been converted to metric tons
# steel column support figure from https://www.homedepot.com/p/Tiger-Brand-8-ft-to-8-ft-4-in-Adjustable-Steel-Building-Support-Column-3-in-O-D-3A-8084/202086528#:~:text=maximum%20extension%20(lb.)-,11200%20lb,-Maximum%20load%20at
# 11200 pounds has been converted to metric tons
# we want to be able to support at least two times the load amount
constraints.append(cp.sum(aluminumColumns)*9.5254398 + cp.sum(steelColumns)*5.0802345 >= 2*floors*(subflooringTileWeight+floorWeight)*xLength*yLength)
# we want to be able to support at least 1.5 times the load amount
constraints.append(cp.sum(aluminumColumns)*9.5254398 + cp.sum(steelColumns)*5.0802345 >= 1.5*floors*(subflooringTileWeight+floorWeight)*xLength*yLength)

# nonnegativity
constraints.append(aluminumColumns >= 0)
Expand All @@ -88,7 +88,7 @@ def calculate(floors=1, xLength=1, yLength=1):
problem.solve(verbose = True)

logs.append("Parameters given: " + str(floors) + " floor, " + str(xLength) + " meter x length, " + str(yLength) + " meter y length.")
logs.append("\nCost of materials and offsets (measured in USD): $" + str(round(cost.value, 2)))
logs.append("\nCost of materials and offsets (measured in USD): $" + "{:.2f}".format(round(cost.value, 2)))
logs.append("\nColumns (measured in quantity):")
logs.append("Aluminum columns needed: "+str(sumMatrix(aluminumColumns.value)))
logs.append("Steel columns needed: "+str(sumMatrix(steelColumns.value)))
Expand Down

0 comments on commit b52e7da

Please sign in to comment.