initialize_variables.html ( File view )

  • By moeah 2014-04-18
  • View(s):30
  • Download(s):1
  • Point(s): 1
			<html xmlns:mwsh="">
      <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
This HTML is auto-generated from an M-file.
To make changes, update the M-file and republish this document.
      <meta name="generator" content="MATLAB 7.0">
      <meta name="date" content="2006-03-16">
      <meta name="m-file" content="initialize_variables"><style>
body {

  background-color: white;

h1 {

  color: #990000; 
  font-size: x-large;

h2 {

  color: #990000;
  font-size: medium;

p.footer {

  text-align: right;
  font-size: xx-small;
  font-weight: lighter;
  font-style: italic;
  color: gray;


pre.codeinput {

  margin-left: 30px;


span.keyword {
color: #0000FF
span.comment {
color: #228B22
span.string {
color: #A020F0
span.untermstring {
color: #B20000
span.syscmd {
color: #B28C00

pre.showbuttons {

  margin-left: 30px;
  border: solid black 2px;
  padding: 4px;
  background: #EBEFF3;


pre.codeoutput {

  color: gray;
  font-style: italic;

pre.error {

  color: red;


/* Make the text shrink to fit narrow windows, but not stretch too far in 
wide windows.  On Gecko-based browsers, the shrink-to-fit doesn't work. */ 
p,h1,h2,div {

  /* for MATLAB's browser */
  width: 600px;
  /* for Mozilla, but the "width" tag overrides it anyway */
  max-width: 600px;
  /* for IE */
  width:expression(document.body.clientWidth > 620 ? "600px": "auto" );


            <li><a href="#1">function f = initialize_variables(N, M, V, min_tange, max_range)</a></li>
            <li><a href="#2">Initialize each chromosome</a></li>
      <h2>function f = initialize_variables(N, M, V, min_tange, max_range)<a name="1"></a></h2>
      <p>This function initializes the chromosomes. Each chromosome has the following at this stage       * set of decision variables
               * objective function values
      <p>where, N - Population size M - Number of objective functions V - Number of decision variables min_range - A vector of decimal
         values which indicate the minimum value for each decision variable. max_range - Vector of maximum possible values for decision
      </p><pre class="codeinput">min = min_range;
max = max_range;

<span class="comment">% K is the total number of array elements. For ease of computation decision</span>
<span class="comment">% variables and objective functions are concatenated to form a single</span>
<span class="comment">% array. For crossover and mutation only the decision variables are used</span>
<span class="comment">% while for selection, only the objective variable are utilized.</span>

K = M + V;
</pre><h2>Initialize each chromosome<a name="2"></a></h2>
      <p>For each chromosome perform the following (N is the population size)</p><pre class="codeinput"><span class="keyword">for</span> i = 1 : N
    <span class="comment">% Initialize the decision variables based on the minimum and maximum</span>
    <span class="comment">% possible values. V is the number of decision variable. A random</span>
    <span class="comment">% number is picked between the minimum and maximum possible values for</span>
    <span class="comment">% the each decision variable.</span>
    <span class="keyword">for</span> j = 1 : V
        f(i,j) = min(j) + (max(j) - min(j))*rand(1);
    <span class="keyword">end</span>
    <span class="comment">% For ease of computation and handling data the chromosome also has the</span>
    <span class="comment">% vlaue of the objective function concatenated at the end. The elements</span>
    <span class="comment">% V + 1 to K has the objective function valued.</span>
    <span class="comment">% The function evaluate_objective takes one chromosome at a time,</span>
    <span class="comment">% infact only the decision variables are passed to the function along</span>
    <span class="comment">% with information about the number of objective functions which are</span>
    <span class="comment">% processed and returns the value for the objective functions. These</span>
    <span class="comment">% values are now stored at the end of the chromosome itself.</span>
    f(i,V + 1: 
(Please download the complete source code to view)
Expand> <Close

Want complete source code? Download it here

Point(s): 1

0 lines left, continue to read
Sponsored links

File list

Tips: You can preview the content of files by clicking file names^_^
Name Size Date
01.96 kB
01.96 kB
tournament_selection.html10.01 kB2006-03-16|16:37
replace_chromosome.html7.98 kB2006-03-16|16:38
objective_description_function.html6.25 kB2006-03-16|16:31
nsga_2.html20.78 kB2006-03-16|16:29
non_domination_sort_mod.html18.88 kB2006-03-16|16:35
initialize_variables.html6.42 kB2006-03-16|16:30
genetic_operator.html14.78 kB2006-03-16|16:30
evaluate_objective.html7.08 kB2006-03-16|16:28
NSGA131.01 kB2006-03-19|20:24
evaluate_objective.m2.16 kB2006-03-16|16:28
genetic_operator.m6.93 kB2009-07-16|10:08
initialize_variables.m3.34 kB2009-07-16|10:09
non_domination_sort_mod.m8.30 kB2009-07-16|10:09
nsga_2.m9.30 kB2009-07-16|10:09
objective_description_function.m3.52 kB2009-07-16|10:09
replace_chromosome.m4.02 kB2009-07-16|10:09
tournament_selection.m4.91 kB2009-07-16|10:09
license.txt1.31 kB2009-07-19|16:16
Sponsored links

initialize_variables.html (153.84 kB)

Need 1 point
Your Point(s)

Your Point isn't enough.

Get point immediately by PayPal

More(Debit card / Credit card / PayPal Credit / Online Banking)

Submit your source codes. Get more point


Don't have an account? Register now
Need any help?
Mail to:


CodeForge Chinese Version
CodeForge English Version

Where are you going?

^_^"Oops ...

Sorry!This guy is mysterious, its blog hasn't been opened, try another, please!

Warm tip!

CodeForge to FavoriteFavorite by Ctrl+D