In the below code, i am randomly generating 'raw_actions' for 1000 samples, in this process are computed in pause and play mode due to large samples, in this generation i encountered that the generated samples are very narrowed with in the 'low=env.bounds_low, high=env.bounds_high' ranges, but the bounds are very wider in range. how can i overcome the narrow generated samples from the random generated samples. i need complete all the possible values for the variables with in the low and high ranges for 1000 samples, an additional information, in this existing computation the generated raw actions are discard and new raw actions are generate if the process loop of 'adjust_raw_actions_value' exceeds the max_iterations. so how can we able to generate pre samples with in the range. and how can it be synchronize with the save and load progress. provide me the updated code with very good optimistic silution for my existing problem.
the values of the bounds of the generating raw_actions are corresponding to the variables ['L1', 'L3', 'L5', 'L6', 'L7', 'W1', 'W3', 'W5', 'W6', 'W7', 'Ib', 'Cc', 'Vc'] which is given below for your understanding the ranges of each variables.
bounds_low = np.array([0.18e-6, 0.18e-6, 0.18e-6, 0.18e-6, 0.18e-6, 0.5e-6, 0.5e-6, 0.5e-6, 0.5e-6, 0.5e-6, 15e-6, 0.1e-12, 0.8])
bounds_high = np.array([0.181e-6, 0.181e-6, 0.181e-6, 0.181e-6, 0.181e-6, 50e-6, 50e-6, 50e-6, 50e-6, 50e-6, 30e-6, 10e-12, 1.4])

def save_progress(dataset, current_sample, filename='progress.pkl'):
    """Save intermediate state to disk."""
    with open(filename, 'wb') as f:
        pickle.dump((dataset, current_sample), f)

def load_progress(filename='progress.pkl'):
    """Load intermediate state from disk."""
    if os.path.exists(filename):
        with open(filename, 'rb') as f:
            return pickle.load(f)
    return [], 0

def pre_training_dataset_generation(env, total_samples=1000, progress_filename='progress.pkl'):
    """Generate pre-training dataset with manual tuning data"""
    env.connect_to_simulator()  # Ensure simulator is connected before dataset generation

    dataset, start_sample = load_progress(progress_filename)

    # Initialize or append CSV file
    csv_file_mode = 'a' if start_sample > 0 else 'w'
    with open('transistor_data.csv', mode=csv_file_mode, newline='') as csvfile:
        fieldnames = ['L1', 'L3', 'L5', 'L6', 'L7', 'W1', 'W3', 'W5', 'W6', 'W7',
                      'Ib', 'Cc', 'Vc', 'M1', 'M2', 'M3', 'M4', 'M5', 'M8', 'M6', 
                      'M7', 'Area', 'PowerDissipation', 'SlewRate', 'Gain', 'Bandwidth3dB', 
                      'UnityGainFreq', 'PhaseMargin']
        writer = csv.DictWriter(csvfile, fieldnames=fieldnames)
        if start_sample == 0:  # Write header only if starting fresh
            writer.writeheader()

        for sample_idx in range(start_sample, total_samples):  # Create 1000 samples starting from the last completed
            sample_found = False

            while not sample_found:
                raw_actions = np.random.uniform(low=env.bounds_low, high=env.bounds_high)  # Random initial actions
                iteration = 0
                
                while iteration < env.max_iterations:
                    transistor_regions, saturation_condition, performance_metrics = env.simulator.run_simulation(raw_actions)

                    # Write results directly to CSV
                    writer.writerow({
                        'L1': raw_actions[0], 'L3': raw_actions[1], 'L5': raw_actions[2], 'L6': raw_actions[3], 'L7': raw_actions[4],
                        'W1': raw_actions[5], 'W3': raw_actions[6], 'W5': raw_actions[7], 'W6': raw_actions[8], 'W7': raw_actions[9],
                        'Ib': raw_actions[10], 'Cc': raw_actions[11], 'Vc': raw_actions[12],
                        'M1': transistor_regions.get('M1', None), 'M2': transistor_regions.get('M2', None), 'M3': transistor_regions.get('M3', None),
                        'M4': transistor_regions.get('M4', None), 'M5': transistor_regions.get('M5', None), 'M8': transistor_regions.get('M8', None),
                        'M6': transistor_regions.get('M6', None), 'M7': transistor_regions.get('M7', None),
                        'Area': performance_metrics.get('Area', None), 'PowerDissipation': performance_metrics.get('PowerDissipation', None),
                        'SlewRate': performance_metrics.get('SlewRate', None), 'Gain': performance_metrics.get('Gain', None),
                        'Bandwidth3dB': performance_metrics.get('Bandwidth3dB', None), 'UnityGainFreq': performance_metrics.get('UnityGainFreq', None),
                        'PhaseMargin': performance_metrics.get('PhaseMargin', None)
                    })

                    if all(region == 2 for region in transistor_regions.values()): 
                        node_features_tensor, edge_feature_tensor, edge_index = netlist_to_graph(env.netlist_content, raw_actions, transistor_regions)
                        state = (torch.tensor(node_features_tensor, dtype=torch.float32), torch.tensor(edge_feature_tensor, dtype=torch.float32), torch.tensor(edge_index, dtype=torch.long))
                        actions = torch.tensor(raw_actions, dtype=torch.float32)
                        dataset.append((state, actions))
                        sample_found = True
                        break

                    # Try adjusting raw actions and continue iterations
                    raw_actions = env.adjust_raw_actions_value(raw_actions, transistor_regions)
                    print("transistor_regions", transistor_regions)
                    print("iteration count", iteration)
                    
                    iteration += 1

            save_progress(dataset, sample_idx, progress_filename)

    env.disconnect_from_simulator()  # Optionally disconnect after dataset generation
    
    return dataset

total_samples=1000
progress_filename='progress.pkl'
dataset = pre_training_dataset_generation(env, total_samples, progress_filename)