How to return an additional parameter that is not part of the population nor the objective in ga MATLAB?
    3 visualizzazioni (ultimi 30 giorni)
  
       Mostra commenti meno recenti
    
I'm looking for a way to retun an additional variable (risk) with my objective (ecnomic_value) paramter for each population (weights) in GA MATLAB. I know how rto eturn the populations (weights) and their scores(ecnomic_value)  but I do not know how to return the additional variable (risk). My output function as below. Anyone can help please?
 % the output function
 function [state,options,optchanged] = gaoutfunction(options,state,flag)
    persistent state_record 
    if isempty(state_record)
      state_record = struct('Population', {}, 'Best', {}, 'Score', {});
    end
    if nargin == 0
      state = state_record;
      options = [];
      optchanged = [];
    else
      state_record(end+1) = struct('Population', state.Population, 'Best', state.Best', 'Score', state.Score);
      optchanged = false;
    end
 end 
0 Commenti
Risposte (0)
Vedere anche
Categorie
				Scopri di più su R Language in Help Center e File Exchange
			
	Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
