Certainly! Adding a third multi-objective optimization method to your comparison can provide deeper insights into the performance and suitability of different algorithms for your Smart Building Comfort and Energy Consumption problem.
For this demonstration, let's add the Multi-Objective Particle Swarm Optimization (MOPSO) algorithm as the third method to compare against MOEMA and NSGA-II.
Overview of Steps:
-
Implement or Obtain MOPSO Functionality:
- Option 1: Use a third-party MOPSO implementation available on MATLAB File Exchange or other sources.
- Option 2: Implement a basic version of MOPSO directly within your script.
-
Integrate MOPSO into Your Script:
- Set up parameters specific to MOPSO.
- Run the optimization.
- Capture the Pareto front and execution time.
-
Update Comparison Sections:
- Modify plots to include MOPSO results.
- Update metrics to include MOPSO.
- Adjust tables and charts to present the additional data.
-
Determine the Best Method Among MOEMA, NSGA-II, and MOPSO.
For the sake of completeness and ease of integration, I'll provide a simple implementation of MOPSO within your existing script. However, for more sophisticated applications or better performance, I recommend using a well-tested MOPSO implementation from the MATLAB File Exchange or relevant toolboxes.
Step-by-Step Integration:
1. Implementing a Basic MOPSO Function
Below is a basic implementation of MOPSO. This function maintains a swarm of particles, updates their velocities and positions based on personal and global bests, and maintains an external archive of non-dominated solutions.
% ---------- MOPSO Optimization Function ----------
function [paretoFront, paretoSet, MOPSO_Time] = run_MOPSO(NPop, max_iterations, lb, ub, dim, FITNESSFCN)
% RUN_MOPSO Implements a basic Multi-Objective Particle Swarm Optimization (MOPSO)
%
% Inputs:
% NPop - Population size (number of particles)
% max_iterations - Number of iterations
% lb, ub - Lower and upper bounds
% dim - Number of decision variables
% FITNESSFCN - Multi-objective fitness function handle
%
% Outputs:
% paretoFront - Obtained Pareto front (objective values)
% paretoSet - Decision vectors corresponding to Pareto front
% MOPSO_Time - Execution time
% Initialize timer
tic;
% Particle structure
particles.Position = rand(NPop, dim) .* (ub - lb) + lb;
particles.Velocity = zeros(NPop, dim);
particles.Pbest.Position = particles.Position;
particles.Pbest.Objective = FITNESSFCN(particles.Position);
% Initialize archive
archive = [];
archive.obj = [];
archive.pop = [];
% Initialize external archive with non-dominated solutions
for i = 1:NPop
archive = update_archive_MOPSO(archive, particles.Pbest.Position(i, :), particles.Pbest.Objective(i, :));
end
% Parameters
w = 0.4; % Inertia weight
c1 = 1.5; % Cognitive coefficient
c2 = 2.0; % Social coefficient
% Begin iterations
for iter = 1:max_iterations
% Update velocities and positions
for i = 1:NPop
% Select a random archive member as global best
if ~isempty(archive.pop)
gBestIdx = randi(size(archive.pop,1));
gBest = archive.pop(gBestIdx, :);
else
gBest = particles.Pbest.Position(i, :);
end
% Update velocity
particles.Velocity(i, :) = w * particles.Velocity(i, :) ...
+ c1 * rand(1, dim) .* (particles.Pbest.Position(i, :) - particles.Position(i, :)) ...
+ c2 * rand(1, dim) .* (gBest - particles.Position(i, :));
% Update position
particles.Position(i, :) = particles.Position(i, :) + particles.Velocity(i, :);
% Enforce bounds
particles.Position(i, :) = max(min(particles.Position(i, :), ub), lb);
% Evaluate fitness
current_obj = FITNESSFCN(particles.Position(i, :));
% Update personal best
if dominates(current_obj, particles.Pbest.Objective(i, :))
particles.Pbest.Position(i, :) = particles.Position(i, :);
particles.Pbest.Objective(i, :) = current_obj;
elseif ~dominates(particles.Pbest.Objective(i, :), current_obj)
% If neither dominates, randomly decide to update
if rand() < 0.5
particles.Pbest.Position(i, :) = particles.Position(i, :);
particles.Pbest.Objective(i, :) = current_obj;
end
end
% Update archive
archive = update_archive_MOPSO(archive, particles.Position(i, :), current_obj);
end
% Display progress every 50 iterations
if mod(iter, 50) == 0 || iter == 1 || iter == max_iterations
disp(['MOPSO Iteration #', num2str(iter), ' completed. Archive size: ', num2str(size(archive.pop,1))]);
end
end
% Final Pareto front and set
paretoFront = archive.obj;
paretoSet = archive.pop;
% Record execution time
MOPSO_Time = toc;
end
% ---------- Archive Update Function for MOPSO ----------
function archive = update_archive_MOPSO(archive, new_pop, new_obj)
% UPDATE_ARCHIVE_MOPSO Adds new solutions to the archive while maintaining Pareto optimality
%
% Inputs:
% archive - Current archive structure with fields 'pop' and 'obj'
% new_pop - New population member (decision vector)
% new_obj - New population member's objectives
%
% Output:
% archive - Updated archive structure
if isempty(archive.pop)
archive.pop = new_pop;
archive.obj = new_obj;
return;
end
dominated = false;
to_remove = [];
for i = 1:size(archive.pop,1)
if dominates(new_obj, archive.obj(i, :))
to_remove = [to_remove, i];
elseif dominates(archive.obj(i, :), new_obj)
dominated = true;
break;
end
end
if ~dominated
% Remove dominated solutions
if ~isempty(to_remove)
archive.pop(to_remove, :) = [];
archive.obj(to_remove, :) = [];
end
% Add new solution
archive.pop = [archive.pop; new_pop];
archive.obj = [archive.obj; new_obj];
end
end
% ---------- Dominates Function (Same as in MOEMA) ----------
function result = dominates(obj1, obj2)
% DOMINATES Checks if obj1 dominates obj2
result = all(obj1 <= obj2) && any(obj1 < obj2);
end
Note: The above MOPSO implementation is a basic version intended for educational purposes. For enhanced performance, consider integrating a more robust MOPSO implementation from reputable sources or MATLAB toolboxes.
2. Integrate MOPSO into Your Main Script
Now, we'll modify your main script to include MOPSO alongside MOEMA and NSGA-II.
Here's how you can incorporate the MOPSO method:
% ------------------ Compare_MOEMA_NSGAII_SmartBuilding.m ------------------
% Comprehensive script to compare MOEMA, NSGA-II, and MOPSO optimizations for
% Smart Building Comfort (Temperature, Lux, IAQ) and Energy Consumption
%% ------------------ Initialization ------------------
clc;
clear;
close all;
%% ------------------ Data Initialization ------------------
% [Your existing data initialization code here...]
% (Omitted for brevity; same as in your provided script)
%% ------------------ Define Fitness Function ------------------
% [Your existing fitness function definition here...]
% (Same as in your script)
%% ------------------ Optimization Parameters Setup ------------------
% [Your existing optimization parameters setup here...]
% (Same as in your script)
%% ------------------ MOEMA Optimization ------------------
% [Your existing MOEMA optimization code here...]
% (Same as in your script)
%% ------------------ NSGA-II Optimization Using gamultiobj ------------------
% [Your existing NSGA-II optimization code here...]
% (Same as in your script)
%% ------------------ MOPSO Optimization ------------------
% Parameters for MOPSO
population_size_MOPSO = 500; % Number of particles
max_iterations_MOPSO = 500; % Number of iterations
% Run MOPSO
disp('Starting MOPSO Optimization...');
[MOPSO_ParetoFront, MOPSO_ParetoSet, MOPSO_Time] = run_MOPSO(population_size_MOPSO, max_iterations_MOPSO, lb, ub, dim, fitness_fcn);
disp('MOPSO Optimization Completed.');
%% ------------------ Compare Pareto Fronts ------------------
% Plotting all three Pareto fronts together for comparison
figure;
hold on;
% Plot MOEMA Pareto Front
plot(paretoFront_MOEMA(:,1), paretoFront_MOEMA(:,2), 'ro', 'MarkerSize',6, 'DisplayName', 'MOEMA');
% Plot NSGA-II Pareto Front
plot(paretoFront_NSGAII(:,1), paretoFront_NSGAII(:,2), 'b+', 'MarkerSize',6, 'DisplayName', 'NSGA-II');
% Plot MOPSO Pareto Front
plot(MOPSO_ParetoFront(:,1), MOPSO_ParetoFront(:,2), 'gs', 'MarkerSize',6, 'DisplayName', 'MOPSO');
xlabel('-Average Comfort Index');
ylabel('Average Energy Consumption');
title('Pareto Front Comparison: MOEMA vs. NSGA-II vs. MOPSO');
legend('Location', 'best');
grid on;
set(gca, 'FontSize', 12);
hold off;
%% ------------------ Compare Temp, Lux, and IAQ ------------------
% [Your existing comparison code for MOEMA and NSGA-II...]
% (Omitted for brevity; same as in your script)
% --- Optimized solution extraction for MOPSO ---
% Select Pareto solutions with minimum energy consumption for MOPSO
[minEC_MOPSO, minEC_idx_MOPSO] = min(MOPSO_ParetoFront(:,2));
optimized_solution_MOPSO = MOPSO_ParetoSet(minEC_idx_MOPSO, :); % 1x144 vector
% Extract optimized settings for each period
optimized_settings_MOPSO = reshape(optimized_solution_MOPSO, 3, 48)'; % 48x3 matrix: [T, L, IAQ]
% Optimized settings
optimized_temp_MOPSO = optimized_settings_MOPSO(:,1);
optimized_lux_MOPSO = optimized_settings_MOPSO(:,2);
optimized_IAQ_MOPSO = optimized_settings_MOPSO(:,3);
% ------------- Temperature Comparison -------------
figure;
plot(time, original_temp, 'k-', 'LineWidth',1.5); hold on;
plot(time, optimized_temp_MOEMA, 'r--', 'LineWidth',1.5);
plot(time, optimized_temp_NSGAII, 'b-.', 'LineWidth',1.5);
plot(time, optimized_temp_MOPSO, 'gs:', 'LineWidth',1.5);
yline(desired_temp, 'm:', 'LineWidth',1.5);
xlabel('Time Instance');
ylabel('Temperature (°C)');
title('Temperature Before and After Optimization');
legend('Original', 'MOEMA Optimized', 'NSGA-II Optimized', 'MOPSO Optimized', 'Desired', 'Location', 'best');
grid on;
set(gcf, 'Position', [100, 100, 900, 450]); % Adjusted window size
hold off;
% ------------- Light Level Comparison -------------
figure;
plot(time, original_lux, 'k-', 'LineWidth',1.5); hold on;
plot(time, optimized_lux_MOEMA, 'r--', 'LineWidth',1.5);
plot(time, optimized_lux_NSGAII, 'b-.', 'LineWidth',1.5);
plot(time, optimized_lux_MOPSO, 'gs:', 'LineWidth',1.5);
yline(desired_lux, 'm:', 'LineWidth',1.5);
xlabel('Time Instance');
ylabel('Light Level (lux)');
title('Light Level Before and After Optimization');
legend('Original', 'MOEMA Optimized', 'NSGA-II Optimized', 'MOPSO Optimized', 'Desired', 'Location', 'best');
grid on;
set(gcf, 'Position', [200, 200, 900, 450]); % Adjusted window size
hold off;
% ------------- IAQ Comparison -------------
figure;
plot(time, original_IAQ, 'k-', 'LineWidth',1.5); hold on;
plot(time, optimized_IAQ_MOEMA, 'r--', 'LineWidth',1.5);
plot(time, optimized_IAQ_NSGAII, 'b-.', 'LineWidth',1.5);
plot(time, optimized_IAQ_MOPSO, 'gs:', 'LineWidth',1.5);
yline(desired_IAQ, 'm:', 'LineWidth',1.5);
xlabel('Time Instance');
ylabel('IAQ');
title('Indoor Air Quality (IAQ) Before and After Optimization');
legend('Original', 'MOEMA Optimized', 'NSGA-II Optimized', 'MOPSO Optimized', 'Desired', 'Location', 'best');
grid on;
set(gcf, 'Position', [300, 300, 900, 450]); % Adjusted window size
hold off;
%% ------------------ Compare Metrics ------------------
% Metrics for MOPSO
num_pareto_MOPSO = size(MOPSO_ParetoFront, 1);
min_CI_idx_MOPSO = min(MOPSO_ParetoFront(:,1)); % Since it's -CI_avg
min_EC_MOPSO = min(MOPSO_ParetoFront(:,2));
% [Your existing metrics for MOEMA and NSGA-II...]
% (Omitted for brevity; same as in your script)
% --- Additional Metrics for MOPSO ---
% Display Metrics
fprintf('\n--- Optimization Metrics Comparison ---\n');
fprintf('MOEMA:\n');
fprintf('Number of Pareto Front Solutions: %d\n', num_pareto_MOEMA);
fprintf('Maximum Average Comfort Index: %.4f\n', -min_CI_MOEMA);
fprintf('Minimum Average Energy Consumption: %.4f\n', min_EC_MOEMA);
fprintf('Execution Time: %.2f seconds\n', MOEMA_Time);
fprintf('\nNSGA-II:\n');
fprintf('Number of Pareto Front Solutions: %d\n', num_pareto_NSGAII);
fprintf('Maximum Average Comfort Index: %.4f\n', -min_CI_NSGAII);
fprintf('Minimum Average Energy Consumption: %.4f\n', min_EC_NSGAII);
fprintf('Execution Time: %.2f seconds\n', NSGAII_Time);
fprintf('\nMOPSO:\n');
fprintf('Number of Pareto Front Solutions: %d\n', num_pareto_MOPSO);
fprintf('Maximum Average Comfort Index: %.4f\n', -min_CI_MOPSO);
fprintf('Minimum Average Energy Consumption: %.4f\n', min_EC_MOPSO);
fprintf('Execution Time: %.2f seconds\n', MOPSO_Time);
%% ------------------ Calculate Original Metrics ------------------
% [Your existing original metrics calculation...]
% (Same as in your script)
%% ------------------ Create Comparison Table ------------------
% Define the row names as a column vector
Rows = {'Original'; 'MOEMA Optimized'; 'NSGA-II Optimized'; 'MOPSO Optimized'};
% Define the metrics
Avg_Comfort_Index = [original_CI_avg; max_CI_MOEMA; max_CI_NSGAII; -min_CI_MOPSO];
Avg_Electricity_Consumption = [original_EC_avg; min_EC_MOEMA; min_EC_NSGAII; min_EC_MOPSO];
Optimization_Time = [NaN; MOEMA_Time; NSGAII_Time; MOPSO_Time]; % No transpose
% Calculate Improvements
Improvement_CI_MOEMA = ((max_CI_MOEMA - original_CI_avg) / original_CI_avg) * 100;
Improvement_CI_NSGAII = ((max_CI_NSGAII - original_CI_avg) / original_CI_avg) * 100;
Improvement_CI_MOPSO = ((-min_CI_MOPSO - original_CI_avg) / original_CI_avg) * 100;
Improvement_EC_MOEMA = ((original_EC_avg - min_EC_MOEMA) / original_EC_avg) * 100;
Improvement_EC_NSGAII = ((original_EC_avg - min_EC_NSGAII) / original_EC_avg) * 100;
Improvement_EC_MOPSO = ((original_EC_avg - min_EC_MOPSO) / original_EC_avg) * 100;
% Handle potential infinite or NaN improvements
Improvement_CI_MOEMA = finiteness_handling(Improvement_CI_MOEMA);
Improvement_CI_NSGAII = finiteness_handling(Improvement_CI_NSGAII);
Improvement_CI_MOPSO = finiteness_handling(Improvement_CI_MOPSO);
Improvement_EC_MOEMA = finiteness_handling(Improvement_EC_MOEMA);
Improvement_EC_NSGAII = finiteness_handling(Improvement_EC_NSGAII);
Improvement_EC_MOPSO = finiteness_handling(Improvement_EC_MOPSO);
% Define Improvement vectors as column vectors
Improvement_Comfort_Index = [NaN; Improvement_CI_MOEMA; Improvement_CI_NSGAII; Improvement_CI_MOPSO];
Improvement_Electricity_Consumption = [NaN; Improvement_EC_MOEMA; Improvement_EC_NSGAII; Improvement_EC_MOPSO];
% Create the table ensuring all variables have the same number of rows
Comparison_Table = table(Rows, Avg_Comfort_Index, Improvement_Comfort_Index, ...
Avg_Electricity_Consumption, Improvement_Electricity_Consumption, Optimization_Time, ...
'VariableNames', {'Scenario', 'Average_Comfort_Index', 'CI_Improvement_Percentage', ...
'Average_Electricity_Consumption', 'EC_Improvement_Percentage', 'Optimization_Time_sec'});
% Display the table
disp('--- Comfort Index and Electricity Consumption Comparison ---');
disp(Comparison_Table);
%% ------------------ Additional Comparisons ------------------
% ------------- Bar Chart Comparison -------------
figure('Position', [400, 400, 1200, 550]);
% Subplot for Average Comfort Index
subplot(1,3,1);
bar(Avg_Comfort_Index, 'FaceColor', [0.2 0.6 0.5]);
set(gca, 'XTickLabel', Rows, 'FontSize', 12);
ylabel('Average Comfort Index');
title('Comparison of Average Comfort Index');
grid on;
% Subplot for Average Electricity Consumption
subplot(1,3,2);
bar(Avg_Electricity_Consumption, 'FaceColor', [0.8 0.3 0.3]);
set(gca, 'XTickLabel', Rows, 'FontSize', 12);
ylabel('Average Electricity Consumption');
title('Comparison of Average Electricity Consumption');
grid on;
% Subplot for Optimization Time
subplot(1,3,3);
bar(Optimization_Time(2:end), 'FaceColor', [0.4 0.4 0.7]);
set(gca, 'XTickLabel', Rows(2:end), 'FontSize', 12);
ylabel('Execution Time (sec)');
title('Optimization Time Comparison');
grid on;
sgtitle('Optimization Results Comparison');
% ------------- Pie Chart for Improvement Percentage -------------
figure('Position', [600, 100, 1000, 700]);
% Comfort Index Improvement
subplot(3,2,1);
if all(isfinite([Improvement_CI_MOEMA, Improvement_CI_NSGAII, Improvement_CI_MOPSO]))
pie([Improvement_CI_MOEMA, Improvement_CI_NSGAII, Improvement_CI_MOPSO], {'MOEMA', 'NSGA-II', 'MOPSO'});
title('Avg Comfort Index Improvement (%)');
else
disp('Non-finite values detected in Comfort Index improvements. Pie chart not generated for this metric.');
end
% Electricity Consumption Improvement
subplot(3,2,2);
if all(isfinite([Improvement_EC_MOEMA, Improvement_EC_NSGAII, Improvement_EC_MOPSO]))
pie([Improvement_EC_MOEMA, Improvement_EC_NSGAII, Improvement_EC_MOPSO], {'MOEMA', 'NSGA-II', 'MOPSO'});
title('Avg Electricity Consumption Improvement (%)');
else
disp('Non-finite values detected in Electricity Consumption improvements. Pie chart not generated for this metric.');
end
% Pareto Fronts Scatter Plot
subplot(3,1,3);
hold on;
% Scatter plot with EC vs CI for MOEMA
scatter(paretoFront_MOEMA(:,2), -paretoFront_MOEMA(:,1), 50, 'ro', 'filled', 'DisplayName', 'MOEMA');
% Scatter plot with EC vs CI for NSGA-II
scatter(paretoFront_NSGAII(:,2), -paretoFront_NSGAII(:,1), 50, 'b+', 'DisplayName', 'NSGA-II');
% Scatter plot with EC vs CI for MOPSO
scatter(MOPSO_ParetoFront(:,2), -MOPSO_ParetoFront(:,1), 50, 'gs', 'DisplayName', 'MOPSO');
xlabel('Average Energy Consumption');
ylabel('Average Comfort Index');
title('Pareto Fronts: MOEMA vs. NSGA-II vs. MOPSO');
legend('Location', 'best');
grid on;
set(gca, 'FontSize', 12);
hold off;
sgtitle('Additional Optimization Comparisons');
%% ------------------ Determine Best Method ------------------
% Criteria for Best Method:
% - Higher Comfort Index Improvement
% - Greater Electricity Consumption Reduction
% - Shorter Optimization Time
% Initialize scores
MOEMA_Score = 0;
NSGAII_Score = 0;
MOPSO_Score = 0;
% Assign scores based on improvements
% For Comfort Index
[~, max_CI_values, ~] = max([Improvement_CI_MOEMA, Improvement_CI_NSGAII, Improvement_CI_MOPSO]);
[~, best_CI_idx] = max([Improvement_CI_MOEMA, Improvement_CI_NSGAII, Improvement_CI_MOPSO]);
MOEMA_Score = MOEMA_Score + (best_CI_idx == 1);
NSGAII_Score = NSGAII_Score + (best_CI_idx == 2);
MOPSO_Score = MOPSO_Score + (best_CI_idx == 3);
% For Electricity Consumption
[~, max_EC_values, ~] = max([Improvement_EC_MOEMA, Improvement_EC_NSGAII, Improvement_EC_MOPSO]);
[~, best_EC_idx] = max([Improvement_EC_MOEMA, Improvement_EC_NSGAII, Improvement_EC_MOPSO]);
MOEMA_Score = MOEMA_Score + (best_EC_idx == 1);
NSGAII_Score = NSGAII_Score + (best_EC_idx == 2);
MOPSO_Score = MOPSO_Score + (best_EC_idx == 3);
% For Optimization Time (prefer shorter time)
[min_time, best_time_idx] = min([MOEMA_Time, NSGAII_Time, MOPSO_Time]);
if best_time_idx == 1
MOEMA_Score = MOEMA_Score + 1;
elseif best_time_idx == 2
NSGAII_Score = NSGAII_Score + 1;
elseif best_time_idx == 3
MOPSO_Score = MOPSO_Score + 1;
end
% Determine the best method based on scores
scores = [MOEMA_Score, NSGAII_Score, MOPSO_Score];
methods = {'MOEMA', 'NSGA-II', 'MOPSO'};
[max_score, best_method_idx] = max(scores);
if sum(scores == max_score) > 1
best_method = 'Multiple methods perform equally well';
else
best_method = methods{best_method_idx};
end
fprintf('\n--- Best Optimization Method ---\n');
fprintf('MOEMA Score: %d\n', MOEMA_Score);
fprintf('NSGA-II Score: %d\n', NSGAII_Score);
fprintf('MOPSO Score: %d\n', MOPSO_Score);
fprintf('Best Method: %s\n', best_method);
%% ------------------ Helper Function ------------------
% ---------- Finite Handling Function ----------
function val = finiteness_handling(val)
% FINITENESS_HANDLING Replaces non-finite values with 0
if ~isfinite(val)
val = 0;
end
end
3. Explanation of Additions
-
MOPSO Function (run_MOPSO):
- Implements a basic MOPSO algorithm.
- Initializes particles with random positions within bounds.
- Updates velocities and positions based on personal and global bests.
- Maintains an external archive of non-dominated solutions.
- Captures execution time, Pareto front, and Pareto set.
-
Integration into Main Script:
- Parameters: Defined
population_size_MOPSO and max_iterations_MOPSO.
- Execution: Calls
run_MOPSO to perform optimization.
- Plotting: Updates existing plots to include MOPSO results.
- Metrics: Extracts and displays metrics for MOPSO similar to MOEMA and NSGA-II.
- Comparison Table: Extends the comparison table to include MOPSO.
- Additional Comparisons: Updates bar charts and pie charts to incorporate MOPSO.
- Best Method Determination: Extends scoring to include MOPSO and determines the best method based on multiple criteria.
-
Helper Function (finiteness_handling):
- Ensures that any non-finite improvement percentages are handled gracefully by setting them to
0.
4. Potential Enhancements
-
MOPSO Implementation:
- The provided MOPSO is a basic implementation. For improved performance, consider integrating mechanisms like:
- Diversity Maintenance: Techniques to maintain diversity within the swarm.
- Leader Selection Methods: More sophisticated methods for selecting global bests from the archive.
- Constraint Handling: If your problem has constraints, implement constraint-handling techniques.
-
Visualization:
- Enhance plots with different colors, markers, or interactivity for better visualization.
-
Performance Tuning:
- Adjust MOPSO parameters (
w, c1, c2, etc.) to better suit your problem's landscape.
-
Use of MATLAB Toolboxes:
- Consider using MATLAB’s Global Optimization Toolbox or other specialized toolboxes which might offer optimized implementations of MOPSO or other algorithms, ensuring better performance and robustness.
5. Final Notes
-
Execution Time: The execution time for MOPSO is included in the comparison. Depending on the complexity of the problem and the implementation's efficiency, MOPSO might be faster or slower than MOEMA and NSGA-II.
-
Pareto Front Quality: The quality of the Pareto fronts can be subjective. Consider using quantitative metrics like Hypervolume, Spread, or Generational Distance for a more objective comparison.
-
Reproducibility: For reproducible results, set the random seed at the beginning of your script using rng (e.g., rng(1)).
By following the above steps, you can effectively integrate MOPSO into your existing script and compare its performance against MOEMA and NSGA-II in optimizing Smart Building Comfort and Energy Consumption.