Home > Mateda2.0 > repairing > SetInBounds_repairing.m

# SetInBounds_repairing

## PURPOSE

SetInBounds_repairing: For a problem with continuous representation

## SYNOPSIS

function[NewPop] = SetInBounds_repairing(Pop,RangeValues,repairing_params)

## DESCRIPTION

     SetInBounds_repairing:   For a problem with continuous representation
                              Modify the solutions to the minimum (respectivel maximum) bounds
                              if variables are under (respectively over) the variables ranges
     INPUTS
     Pop: Population
     RangeValues: Range of values for each of the variables
     repairing_params: Not use for this function
     OUTPUTS
     NewPop: New repaired population

     Last version 8/26/2008. Roberto Santana (roberto.santana@ehu.es)

## CROSS-REFERENCE INFORMATION

This function calls:

This function is called by:

## SOURCE CODE

    0001 function[NewPop] =  SetInBounds_repairing(Pop,RangeValues,repairing_params)
    0002 % SetInBounds_repairing:   For a problem with continuous representation
    0003 %                          Modify the solutions to the minimum (respectivel maximum) bounds
    0004 %                          if variables are under (respectively over) the variables ranges
    0005 % INPUTS
    0006 % Pop: Population
    0007 % RangeValues: Range of values for each of the variables
    0008 % repairing_params: Not use for this function
    0009 % OUTPUTS
    0010 % NewPop: New repaired population
    0011 %
    0012 % Last version 8/26/2008. Roberto Santana (roberto.santana@ehu.es)
    0013
    0014 NumbVar = size(Pop,2);
    0015 NewPop = Pop;
    0016    for i=1:NumbVar,
    0017           under_val = find(Pop(:,i)<RangeValues(1,i));
    0018           NewPop(under_val,i) = RangeValues(1,i);
    0019           over_val = find(Pop(:,i)>RangeValues(2,i));
    0020           NewPop(over_val,i) = RangeValues(2,i);
    0021    end