修改生成数据方式和网络训练方式

This commit is contained in:
2024-04-06 13:44:05 +08:00
parent bae7e4e2c3
commit 6fa1f53f69
8 changed files with 194 additions and 96 deletions

View File

@ -173,7 +173,7 @@ def timer_wrapper(func):
start_time = time.time()
result = func(*args, **kwargs)
print("function {} running time : {} s".format(func.__name__, time.time() - start_time))
print(f"function {func.__name__} running time : {time.time() - start_time:.3f} s")
return result
return measure_time

View File

@ -66,7 +66,6 @@ def feeder_allocate(component_data, pcb_data, feeder_data, figure=False):
nozzle_assigned_counter = optimal_nozzle_assignment(component_data, pcb_data)
head_assign_indexes = list(range(max_head_index))
nozzle_pattern, optimal_nozzle_pattern, optimal_nozzle_points = [], None, 0
# nozzle_pattern = ['CN220', 'CN065','CN065','CN065','CN065','CN220']
# 先排序
nozzle_pattern_list = []

View File

@ -294,8 +294,6 @@ def convert_individual_2_result(component_data, component_point_pos, designated_
@timer_wrapper
def optimizer_hybrid_genetic(pcb_data, component_data, hinter=True):
random.seed(0)
np.random.seed(0)
nozzle_assigned_counter = optimal_nozzle_assignment(component_data, pcb_data)
# nozzle assignment result:

View File

@ -80,7 +80,7 @@ def base_optimizer(machine_index, pcb_data, component_data, feeder_data=None, me
if hinter:
optimization_assign_result(component_data, pcb_data, component_result, cycle_result, feeder_slot_result,
nozzle_hinter=True, component_hinter=False, feeder_hinter=True)
nozzle_hinter=True, component_hinter=True, feeder_hinter=True)
print('----- Placement machine ' + str(machine_index) + ' ----- ')
print('-Cycle counter: {}'.format(info.cycle_counter))