-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0bd6432
commit 2b5c5e3
Showing
1 changed file
with
23 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import cvxpy as cp | ||
import numpy as np | ||
#goals: add a parameter that places the columns away from other columns and away from building edges. | ||
#way to encode the floor shapes: use a numpy boolean grid. | ||
#steps: optimization phase 1 will be determinimng number of columns needed and carbon offset quantities | ||
#optimization phase 2 will be placing the columns in the building. | ||
|
||
inputs=["# of floors", ["dimensions of floor n"]] | ||
floor_count=inputs[0] | ||
dimensions=inputs[1] | ||
columns_per_floor=[1,2,3] | ||
columns_pos=[] | ||
cp.Variable(3, integer=True) | ||
constraints=[] | ||
for i in range(floor_count): | ||
columns_pos.append([]) | ||
for j in columns_per_floor[i]: | ||
x = cp.Variable(1,integer=True) | ||
y = cp.Variable(1,integer=True) | ||
columns_pos[i].append((x,y)) | ||
#constraints to verify that the column connects to both the current floor and the floor it's supporting. | ||
constraints.append(dimensions[i][y][x]==1) | ||
constraints.append(dimensions[i+1][y][x]==1) |