Home > Mateda2.0 > repairing > Trigom_repairing.m

# Trigom_repairing

## PURPOSE

[NewPop] = Trigomn_repairing(Pop,RangeValues,repairing_params)

## SYNOPSIS

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

## DESCRIPTION

     [NewPop] =  Trigomn_repairing(Pop,RangeValues,repairing_params)
     Trigon_repairing:   For a problem with continuous representation
     where solutions are in [0,2pi], modifies the unfeasible solutions to
     be in this interval

     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:

- Greedy_search_OffHP [NewPop,NumbEvals] = Greedy_search_OffHP(k,Pop,FunVal,local_opt_params)
- local_search_OffHP [NewPop,NumbEvals] = local_search_OffHP(k,Pop,FunVal,local_opt_params)

## SOURCE CODE

    0001 function[NewPop] =  Trigom_repairing(Pop,RangeValues,repairing_params)
    0002 % [NewPop] =  Trigomn_repairing(Pop,RangeValues,repairing_params)
    0003 % Trigon_repairing:   For a problem with continuous representation
    0004 % where solutions are in [0,2pi], modifies the unfeasible solutions to
    0005 % be in this interval
    0006 %
    0007 % INPUTS
    0008 % Pop: Population
    0009 % RangeValues: Range of values for each of the variables
    0010 % repairing_params: Not use for this function
    0011 % OUTPUTS
    0012 % NewPop: New repaired population
    0013 %
    0014 % Last version 8/26/2008. Roberto Santana (roberto.santana@ehu.es)
    0015
    0016 NumbVar = size(Pop,2);
    0017 NewPop = Pop;
    0018    for i=1:NumbVar,
    0019           under_val = find(Pop(:,i)<RangeValues(1,i));
    0020           n_under = size(under_val,1);
    0021           NewPop(under_val,i) = rem(Pop(under_val,i),2*pi)+2*pi;
    0022           over_val = find(Pop(:,i)>RangeValues(2,i));
    0023           n_over = size(over_val,1);
    0024           NewPop(over_val,i) = rem(Pop(over_val,i),2*pi);
    0025    end