Skip to content

Commit

Permalink
update test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
LiamSwayne committed Nov 27, 2023
1 parent 06450c8 commit da726a1
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/run_program.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,13 @@ jobs:
git config --global user.name "GitHub Actions"
- name: Execute python script first case
run: python linear_program.py 3 4 10 1
run: python linear_program.py 3 20 25 1

- name: Execute python script second case
run: python linear_program.py 5 2 3 2
run: python linear_program.py 5 15 40 2

- name: Execute python script third case
run: python linear_program.py 1 10 10 3
run: python linear_program.py 1 40 20 3

- name: Check for changes
id: git-check
Expand Down
10 changes: 5 additions & 5 deletions linear_program.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,9 @@ 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 twice the load amount
# 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-1)*(subflooringTileWeight+floorWeight)*xLength*yLength)

# nonnegativity
constraints.append(aluminumColumns >= 0)
constraints.append(steelColumns >= 0)
Expand All @@ -96,9 +96,9 @@ def calculate(floors=1, xLength=1, yLength=1):
calculate(floors, xLength, yLength)
else:
print("Invalid command-line arguments. Follow this format: python script.py floors xLength yLength")
randomFloors = random.randint(1, 10)
randomXLength = random.randint(1, 10)
randomYLength = random.randint(1, 10)
randomFloors = random.randint(10, 50)
randomXLength = random.randint(10, 50)
randomYLength = random.randint(10, 50)
print("Running randomized values: floors=" + str(randomFloors) + " xLength=" + str(randomXLength) + " yLength=" + str(randomYLength))
calculate(randomFloors, randomXLength, randomYLength)

Expand Down

0 comments on commit da726a1

Please sign in to comment.