GA optimization within constraints
조회 수: 1 (최근 30일)
이전 댓글 표시
Hi there,
I am trying to use GA for my first time, so I am a bit confused.
I have seen some simple example where you define a function with x(1), x(2) etc. and then you call it to find the minimum.
However, my problem is a bit complex and I am confused how to use GA. Here is a brief summary of my problem
A) First of all I have these input parameters (within limits):
Battery_size=[5 50];
Battery_number=[5 40];
Battery_cost=[100 500];
B) I have already created a script file that uses the values from the aforementioned inputs and giving results.
C) The fitness function seems to be something calculated in the script for the given inputs:
Profit=(Battery_size*Battery_cost)-(Benefits*365*10); %calculated in the script
Average_resilience %calculated in the script
Carbon_emissions_reduction % calculated in the script
FitFnc=Profit+Average-resilience+Carbon_emissions_reduction;
So I would like to maximize the FitFnC
The question is:
A) Where do I put the input parameters , from where the algorithm will draw values?
B) The command which call GA, will be used inside the code after the parameters of FitFnc are calculated?
I hope the question is clear,
thanks in advance
Nikolas
댓글 수: 0
채택된 답변
Abhisek Pradhan
2019년 10월 16일
Maximization can be achieved by multiplying the desired function with -1 and then using the minimization approach using Genetic Algorithm.
As Genetic algorithm takes function handles for the fitness function and constraint function. so create function handles for both the functions as inputs to the algorithm.
The following link illustrates constrained minimization using the Genetic algorithm.
댓글 수: 0
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Genetic Algorithm에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!