Home » Source Code » C++/Matbal code for Multiobjective NSGA-II algorithm » objective_description_function.html

objective_description_function.html ( File view )

  • By moeah 2014-04-18
  • View(s):30
  • Download(s):1
  • Point(s): 1
			<html xmlns:mwsh="http://www.mathworks.com/namespace/mcode/v1/syntaxhighlight.dtd">
      <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.
      <title>function [number_of_objectives, number_of_decision_variables, min_range_of_decesion_variable, max_range_of_decesion_variable]
         = objective_description_function()
      <meta name="generator" content="MATLAB 7.0">
      <meta name="date" content="2006-03-16">
      <meta name="m-file" content="objective_description_function"><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" );


      <h1>function [number_of_objectives, number_of_decision_variables, min_range_of_decesion_variable, max_range_of_decesion_variable]
         = objective_description_function()
      <p>This function is used to completely describe the objective functions and the range for the decision variable space etc. The
         user is prompted for inputing the number of objectives, numebr of decision variables, the maximum and minimum range for each
         decision variable and finally the function waits for the user to modify the evaluate_objective function to suit their need.
      </p><pre class="codeinput">g = sprintf(<span class="string">'Input the number of objective: '</span>);
<span class="comment">% Obtain the number of objective function</span>
number_of_objectives = input(g);
g = sprintf(<span class="string">'\nInput the number of decision variables: '</span>);
<span class="comment">% Obtain the number of decision variables</span>
number_of_decision_variables = input(g);
<span class="keyword">for</span> i = 1 : number_of_decision_variables
    g = sprintf(<span class="string">'\nInput the minimum value for decision variable %d : '</span>, i);
    <span class="comment">% Obtain the minimum possible value for each decision variable</span>
    min_range_of_decesion_variable(i) = input(g);
    g = sprintf(<span class="string">'\nInput the maximum value for decision variable %d : '</span>, i);
    <span class="comment">% Obtain the maximum possible value for each decision variable</span>
    max_range_of_decesion_variable(i) = input(g);
<span class="keyword">end</span>
g = sprintf(<span class="string">'\n Now edit the function named "evaluate_objective" appropriately to match your needs.\n Make sure that the number of objective functions and decision variables match your numerical input. \n Make each objective function as a corresponding array element. \n After editing do not forget to save. \n Press "c" and enter to continue... '</span>);
<span class="comment">% Prompt the user to edit the evaluate_objective function and wait until</span>
<span class="comment">% 'c' is pressed.</span>
x = input(g, <span class="string">'s'</span>);
<span class="keyword">if</span> isempty(x)
    x = <span class="string">'x'</span>;
<span class="keyword">end</span>
<span class="keyword">while</span> x ~= <span class="string">'c'</span>
    x = input(g, <span class="string">'s'</span>);
    <span class="keyword">if</span> isempty(x)
        x = <span class="string">'x'<
(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

objective_description_function.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: support@codeforge.com


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