GA optimization within constraints

4 ビュー (過去 30 日間)
Nikolas Spiliopoulos
Nikolas Spiliopoulos 2019 年 10 月 9 日
回答済み: Abhisek Pradhan 2019 年 10 月 16 日
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

採用された回答

Abhisek Pradhan
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 件)

カテゴリ

Help Center および File ExchangeGenetic Algorithm についてさらに検索

タグ

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by