admin管理员组文章数量:1134246
It is Electric bus scheduling problem that have vehicle flow constraints and charging constraints. I have use Genetic Algorithm solver in Matlab for solving the electric bus scheduling problem (MILP), but it is not taking the charging constraints and generating the result without these constraints, how to deal with this problem? here x_1 used for bus if leave to the depot and z used if charger used and q used amount of charge after trip i.
% Objective: Minimize the number of buses used Busschedulling_A.Objective = sum(x_1)*1000+ sum(z)*100;
constraint like
for j = 1:numTrips Busschedulling_A.Constraints.(['coverTrip_1_' num2str(j)]) = x_1(j) + sum(x(:, j)) == 1; end
for i = 1:numel(Source_values) for j = 1:numel(Destination_values)
sum_term = 0;
for n = 1:18
for p = 1:1
exampleKey_3 = sprintf('%s,%s', Destination_values{i}, Source_values{j});
dist_3 = Dist_M(exampleKey_3);
sum_term = sum_term + q(i, n, p) * (c_charging(n) * 1.55);
end
end
% Define constraint
Busschedulling_A.Constraints.(['energy_A_i' num2str(i) '_j' num2str(j)]) = E(j) <= E(i) - dist_3 + sum_term ;
end
end
% 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);
本文标签: electric bus scheduling with Genetic Algorithm Solver in MatlabStack Overflow
版权声明:本文标题:electric bus scheduling with Genetic Algorithm Solver in Matlab - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1736757932a1951387.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论