Skip to content

Commit

Permalink
Renamed parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
JoeBell committed Mar 5, 2025
1 parent f261895 commit f92334b
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions ShipGen/Generate.py
Original file line number Diff line number Diff line change
Expand Up @@ -205,15 +205,15 @@ def check_feasibility(x_samples:np.ndarray):
valid_idx.append(i)
return valid_idx

def generate_hulls(final_count:int,
reject_count:int|None = None,
def generate_hulls(find_best:int,
out_of:int|None = None,
characteristics:ShipCharacteristics|None = None,
reject_ratio:float = 9) -> list[mesh.Mesh]:
out_of_ratio:int = 10) -> list[mesh.Mesh]:
if characteristics is None:
Ship = np.array([333, 42.624, 11.28, 29.064, 97561,16])
else: Ship = characteristics.as_array()
if reject_count is None: num_samples = int(final_count * (reject_ratio + 1))
else: num_samples = final_count + reject_count
if out_of is None: num_samples = find_best * out_of_ratio
else: num_samples = out_of

LOA:float = Ship[0] #in meters
BoL:float = Ship[1]/LOA #beam to length ratio
Expand All @@ -238,7 +238,7 @@ def generate_hulls(final_count:int,

idxs = np.argsort(Rt_guidance[valid_idx].flatten())
meshs:list[mesh.Mesh] = []
for i in tqdm(range(0,final_count)):
for i in tqdm(range(0,find_best)):
Hull = HP(x_samples[valid_idx[idxs[i]]])
#make the .stl file of the hull:
try:
Expand Down

0 comments on commit f92334b

Please sign in to comment.