Problem in applying Genetic algorithm solver in matlab while solving the electric bus scheduling problem
I am using a Genetic Algorithm (GA) solver in MATLAB to solve the electric bus scheduling problem. The objective function is designed to minimize the cost of electric buses and chargers while incorporating vehicle flow and charging constraints. However, when I apply the solver, it seems to ignore the charging constraints. It only outputs the number of electric buses along with their schedules, without assigning any buses to chargers. The output for chargers consistently shows a value of zero. When I tested the same dataset using CPLEX, it successfully assigned electric buses to chargers. How can I resolve this issue?
% Solver options
options = optimoptions(‘ga’, …
‘Display’, ‘iter’, … % Display iteration details
‘PlotFcn’, ‘gaplotbestf’, … % Plot GA progress
‘MaxTime’, 5000, … % Maximum runtime in seconds
‘PopulationSize’, 100, … % GA population size
‘CrossoverFraction’, 0.8); % Fraction for crossover
% Solve the optimization problem
[sol, fval, exitflag, output] = solve(Busschedulling_A, ‘Solver’, ‘ga’, ‘Options’, options);I am using a Genetic Algorithm (GA) solver in MATLAB to solve the electric bus scheduling problem. The objective function is designed to minimize the cost of electric buses and chargers while incorporating vehicle flow and charging constraints. However, when I apply the solver, it seems to ignore the charging constraints. It only outputs the number of electric buses along with their schedules, without assigning any buses to chargers. The output for chargers consistently shows a value of zero. When I tested the same dataset using CPLEX, it successfully assigned electric buses to chargers. How can I resolve this issue?
% Solver options
options = optimoptions(‘ga’, …
‘Display’, ‘iter’, … % Display iteration details
‘PlotFcn’, ‘gaplotbestf’, … % Plot GA progress
‘MaxTime’, 5000, … % Maximum runtime in seconds
‘PopulationSize’, 100, … % GA population size
‘CrossoverFraction’, 0.8); % Fraction for crossover
% Solve the optimization problem
[sol, fval, exitflag, output] = solve(Busschedulling_A, ‘Solver’, ‘ga’, ‘Options’, options); I am using a Genetic Algorithm (GA) solver in MATLAB to solve the electric bus scheduling problem. The objective function is designed to minimize the cost of electric buses and chargers while incorporating vehicle flow and charging constraints. However, when I apply the solver, it seems to ignore the charging constraints. It only outputs the number of electric buses along with their schedules, without assigning any buses to chargers. The output for chargers consistently shows a value of zero. When I tested the same dataset using CPLEX, it successfully assigned electric buses to chargers. How can I resolve this issue?
% Solver options
options = optimoptions(‘ga’, …
‘Display’, ‘iter’, … % Display iteration details
‘PlotFcn’, ‘gaplotbestf’, … % Plot GA progress
‘MaxTime’, 5000, … % Maximum runtime in seconds
‘PopulationSize’, 100, … % GA population size
‘CrossoverFraction’, 0.8); % Fraction for crossover
% Solve the optimization problem
[sol, fval, exitflag, output] = solve(Busschedulling_A, ‘Solver’, ‘ga’, ‘Options’, options); genetic algorithm, matlab, optimization, programming MATLAB Answers — New Questions