Skip to content
Extraits de code Groupes Projets
Sélectionner une révision Git
  • 63930b94d24052b46c11059bf5936f01d4451756
  • master par défaut protégée
  • devel
  • v5.2.6
  • v5.2.5
5 résultats

Action.pm

Blame
    • ElTata's avatar
      63930b94
      minor update · 63930b94
      ElTata a rédigé
      - reduced TTL after action is set to 0 if lower than 0
      - stolen players are notified
      - new command ACTIONS, do all available actions
      - actions messages now colorize the status of the action, and the
        changed TTL
      - fixed chclass for classes with ' ' in their name
      63930b94
      Historique
      minor update
      ElTata a rédigé
      - reduced TTL after action is set to 0 if lower than 0
      - stolen players are notified
      - new command ACTIONS, do all available actions
      - actions messages now colorize the status of the action, and the
        changed TTL
      - fixed chclass for classes with ' ' in their name
    indicator.cpp 1,50 Kio
    #include "indicator.h"
    
    /**
     * Returns the associated espsilon-indicator. In the complete algorithm, we only
     * need to take as arguments an only vector, but we still use here A and B as
     * sets of vectors. Furthermore, instead of calling in every
     * epsilon_indicator the method coco_evaluate, we better save every f(x) and
     * enter as parameters of the function the two vectors f(x1) and f(x2) we want
     * to compare.
     * @param fa: image of the first vector to compare by f
     * @param fb: image of the second vector to compare by f
     * @returns: the espsilon-indicator
     */
    double espsilon_indicator(double [][] a, double [][] b, int dim_obj = a[0], int dim_a = 1, int dim_b = 1) {
          int  i, j, k;
          double  eps = 0.0, eps_j = 0.0, eps_k=0.0, eps_temp;
    
          /* Here we search for the value of
           * I (A, B) =
           *   min{eps} (∀x2 ∈ B ∃x1 ∈ A : fi(x1) − eps ≤ fi(x2) for i ∈ {1,...,n}).
           * eps is between 0 and the dimension of the vectors
           *
           */
          for (i = 0; i < dim_a; i++) {
            for (j = 0; j < dim_b; j++) {
              for (k = 0; k < dim_obj; k++) {
                eps_temp = b[j][k] - a[i][k];
                if (k == 0)
                  eps_k = eps_temp;
                else if (eps_k < eps_temp)
                  eps_k = eps_temp;
              }
              if (j == 0)
                eps_j = eps_k;
              else if (eps_j > eps_k)
                eps_j = eps_k;
            }
            if (i == 0)
              eps = eps_j;
            else if (eps < eps_j)
              eps = eps_j;
          }
          return eps;
        }
    }