From f92334b9b3cd23881f7d9c189d1a1f3348321bda Mon Sep 17 00:00:00 2001 From: JoeBell Date: Tue, 4 Mar 2025 19:39:31 -0500 Subject: [PATCH] Renamed parameters --- ShipGen/Generate.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/ShipGen/Generate.py b/ShipGen/Generate.py index 096112e..e491b30 100644 --- a/ShipGen/Generate.py +++ b/ShipGen/Generate.py @@ -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 @@ -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: