IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

MATLAB Discussion :

comment implementer cet algorithme d'optimisation


Sujet :

MATLAB

  1. #1
    Futur Membre du Club
    Homme Profil pro
    Inscrit en
    Mai 2012
    Messages
    18
    Détails du profil
    Informations personnelles :
    Sexe : Homme

    Informations forums :
    Inscription : Mai 2012
    Messages : 18
    Points : 5
    Points
    5
    Par défaut comment implementer cet algorithme d'optimisation
    salut, je veux optimiser une fonction à l'aide de cet algorithme :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    Step 1 (Initial solution)
    Find an initial solution using a basic local search algorithm as
    proposed in [2].
    Step 2 (Tabu Search)
    Repeat Steps 2.1 to 2.2 for Number Iterations iterations
    2.1 (Explore the neighborhood)
    2.1.1 Determine the best move while taking into
    consideration the tabu moves and the aspiration
    criteria. For each move x → x, we find the
    solution by solving GPU(x). The cost of the
    solution is the total cost of the network.
    2.1.2 Determine the number of iterations (according
    to a uniform distribution) for which the chosen
    site is tabu.
    2.2 (TS best solution update)
    If the cost of the current solution is less than the cost of
    the best solution found so far, update this best solution.
    Step 3 (Multi-start)
    3.1 (Update the solution)
    If the cost of the current solution is less than the cost of
    the best solution found so far, update this best solution.
    3.2 (Stop condition)
    If the number of start is smaller than the maximum
    allowed number of starts go to step 2. Otherwise, return
    the best cost found so far.
    Fig. 2. Tabu search algorithm
    merci de m'aider.

  2. #2
    Expert confirmé
    Avatar de duf42
    Homme Profil pro
    Formateur en informatique
    Inscrit en
    Novembre 2007
    Messages
    3 111
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 40
    Localisation : France

    Informations professionnelles :
    Activité : Formateur en informatique
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Novembre 2007
    Messages : 3 111
    Points : 4 661
    Points
    4 661
    Par défaut
    Bonjour,

    Pourrais-tu préciser ta question et nous montrer ce que tu as commencé à coder?

    Duf
    Simulink & Embedded Coder

    Au boulot : Windows 7 , MATLAB r2016b
    A la maison : ArchLinux mais pas MATLAB

  3. #3
    Futur Membre du Club
    Homme Profil pro
    Inscrit en
    Mai 2012
    Messages
    18
    Détails du profil
    Informations personnelles :
    Sexe : Homme

    Informations forums :
    Inscription : Mai 2012
    Messages : 18
    Points : 5
    Points
    5
    Par défaut
    Bonsoir, j'ai essayé d’implémenter ce code :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    clear all
    clc
    % Initialiser le réseau de simulation
    eNodeB=10;% nombre des eNodeB
    SGM=3;% nombre des commutateurs
    c=[12,10,6,12,7,8,10,12,6,6;8,8,10,6,12,6,12,10,6,12;8,6,3,6,6,3,6,6,3,9;12,10,6,12,7,8,10,12,6,6];
    h=[2,3,5,8,1,2,3,5,4,3;2,6,1,8,9,5,4,8,2,1;7,5,2,6,7,1,3,7,2,9;2,3,5,8,1,2,3,5,4,3;2,6,1,8,9,5,4,8,2,1;7,5,2,6,7,1,3,7,2,9;2,3,5,8,1,2,3,5,4,3;2,6,1,8,9,5,4,8,2,1;7,5,2,6,7,1,3,7,2,9;3,10,1,16,3,10,14,7,9,8;2,3,5,8,1,2,3,5,4,3;2,3,5,8,1,2,3,5,4,3];
    % Initialiser le nombre d'itérations :
    it_max=100;
    it=1;
    tic
    % génération du solution initiale
    S1=randi(SGM,1,eNodeB);
    n=length(S1);
    % Initialiser la liste de Taboue
    tL=zeros(1,n);
    % initialisé la meilleur solution
    SB=S1;
    % calculer le cout de la solution initiale
    F=soleval(SB,SGM,eNodeB,c,h);
    % initialisé le meilleur cout
    FB=F;
    %recherche de taboue
    while(it<=it_max)
        % Explorer le voisinage
        best_cost=inf;
        for j=1:n
            if(tL(j)==0)
                SV=perm1(SB,j);
                FV=soleval1(SV,SGM,eNodeB,c,h);
     
                % si le cout de la solution courante <cout de meilleur solution
                % choisir le meilleur mouvement selon le cout
     
                if FV< best_cost
                    best_cost =FV;
                    Bmv=j;
                end
            end
        end
        % mettre à jour la meilleur solution par la meilleur solution voisine
        SB=perm1(SB,Bmv);
        % mettre à jours la liste de Taboue
        tL=tL-(tL>0);
        % determiner le nombre des itérations pour lesquelle le mouvement
        % choisit est tabou(valeur choisit aléatoirement en 5 et 9)
     
        tL(Bmv)=7;
     
     
        % si le cout de la solution courante <cout de meilleur solution
        % mettre à jour la meilleur solution
     
        if(best_cost<=FB)
            FB=best_cost;
            SB=SV;
        end
        it=it+1;
        it
        plot(G)
        disp(G);
        disp(SB);
    end
    mais ,à l'affichage, aucune modification n'est apporté sur la fonction à optimiser.

Discussions similaires

  1. Comment faire cet algorithme ?
    Par manatalenta dans le forum Algorithmes et structures de données
    Réponses: 6
    Dernier message: 03/12/2014, 19h56
  2. Comment calculer la vitesses de convergence d'un algorithme d'optimisation?
    Par MaybeStrong dans le forum Traitement d'images
    Réponses: 1
    Dernier message: 05/09/2013, 21h50
  3. Réponses: 61
    Dernier message: 01/08/2008, 22h56
  4. [2.0] Comment implémenter un projet de ressources ?
    Par Louis-Guillaume Morand dans le forum Framework .NET
    Réponses: 5
    Dernier message: 01/07/2005, 16h57
  5. [VB.Net] Comment implémenter une fonction BitWise ?
    Par graphicsxp dans le forum VB.NET
    Réponses: 6
    Dernier message: 20/04/2005, 15h52

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo