Commit 8f76b421 authored by Maxime POULAIN's avatar Maxime POULAIN
Browse files

add documentation

parent 512cb4b3
......@@ -64,9 +64,9 @@ void test10Seq(void) {
int main() {
srand(100145);
//test10Seq();
testPerf();
//testPerf();
//MainForm form;
//form.ShowDialog();
MainForm form;
form.ShowDialog();
return 0;
}
\ No newline at end of file
......@@ -7,9 +7,48 @@
class bierwirthManager {
public:
/// <summary>
/// Gnre un vecteur de Bierwirth
/// </summary>
/// <param name="n">Nombre de pices</param>
/// <param name="m">Nombre de machine</param>
/// <returns>Vecteur</returns>
static bierwirth_t generateVector(int n, int m);
/// <summary>
/// Permute 2 lments dans un vecteur de Bierwirth
/// </summary>
/// <param name="vectorIn">Vecteur input</param>
/// <param name="vectorOut">Vecteur output</param>
/// <param name="i">Piece 1</param>
/// <param name="j">Rang 1</param>
/// <param name="n">Pice 2</param>
/// <param name="m">Rang 2</param>
static void permutation(bierwirth_t& vectorIn, bierwirth_t& vectorOut, pr_t i, pr_t j, int n, int m);
/// <summary>
/// Convertie un couple pice/rang en index
/// </summary>
/// <param name="vector">Vecteur</param>
/// <param name="i">couple</param>
/// <param name="n">Nombre de pices</param>
/// <param name="m">Nombre de machines</param>
/// <returns>Index</returns>
static int prToIndex(bierwirth_t& vector, pr_t i, int n, int m);
/// <summary>
/// Test si un vecteur est valid
/// </summary>
/// <param name="v">Vecteur</param>
/// <param name="nbPiece">Nombre pices</param>
/// <returns></returns>
static bool isVectorValid(bierwirth_t& v, int nbPiece);
/// <summary>
/// Test si deux vecteurs sont gaux
/// </summary>
/// <param name="v1">Vecteur 1</param>
/// <param name="v2">Vecteur 2</param>
/// <returns></returns>
static bool areVectorsEquals(bierwirth_t& v1, bierwirth_t& v2);
};
......@@ -6,7 +6,17 @@
class gestionGraph {
public:
/// <summary>
/// Lit un fichier dans un graphe
/// </summary>
/// <param name="nom_fichier">Nom du fichier</param>
/// <returns></returns>
static graph_t lecture_fichier(std::string nom_fichier);
/// <summary>
/// Affiche un graphe
/// </summary>
/// <param name="graphe"></param>
static void affiche_taches(graph_t graphe);
};
......
......@@ -139,26 +139,6 @@ void solution::affiche_solution(solution_t sol)
}
void solution::vecteur_valide(bierwirth_t& v, int nb_machines, int nb_pieces)
{
int tab[SOLUTION_MAX_SIZE];
for (int i = 0; i < nb_pieces; i++)
{
tab[i] = 0;
}
for (int i = 0; i < nb_machines * nb_pieces; i++)
{
tab[(v[i])] += 1;
}
for (int i = 0; i < nb_pieces; i++)
{
cout << "piece : " << i << tab[i] << endl;
}
}
solution_t solution::genNeighbour(bierwirth_t& v, int size, int n, int m)
{
solution_t new_solution;
......
......@@ -12,12 +12,55 @@ class solution
{
public:
/// <summary>
/// Recherche locale
/// </summary>
/// <param name="v">Vecteur de bierwirth</param>
/// <param name="graph">Graphe</param>
/// <param name="maxIteration">Nombre d'itration maximum</param>
/// <returns>Solution optimise</returns>
static solution_t rechercheLocale(bierwirth_t& v, graph_t& graph, int maxIteration);
/// <summary>
/// value un vecteur de Bierwirth sur un graphe
/// </summary>
/// <param name="v">Vecteur</param>
/// <param name="graphe">Graphe</param>
/// <returns>Solution</returns>
static solution_t evaluer(bierwirth_t& v, graph_t& graphe);
/// <summary>
/// Affiche une solution
/// </summary>
/// <param name="sol">Solution</param>
static void affiche_solution(solution_t sol);
/// <summary>
/// GRASP
/// </summary>
/// <param name="sol">Sokution out</param>
/// <param name="graphe">Graphe</param>
static void grasp(solution_t* sol, graph_t& graphe);
static void vecteur_valide(bierwirth_t& v, int nb_machines, int nb_pieces);
/// <summary>
/// Gnre les voisins pour GRASP
/// </summary>
/// <param name="v">Vecteur</param>
/// <param name="size">Taille</param>
/// <param name="n">Nombre pice</param>
/// <param name="m">Nombre machine</param>
/// <returns></returns>
static solution_t genNeighbour(bierwirth_t& v, int size, int n, int m);
/// <summary>
/// Test le hash du vecteur
/// </summary>
/// <param name="sol">Solution</param>
/// <param name="hash">Tableau de hash</param>
/// <param name="size">Taille du tableau de hash</param>
/// <returns></returns>
static int sameH(solution_t sol, int* hash, int size);
......
......@@ -8,8 +8,25 @@ using namespace std;
static class utils
{
public:
/// <summary>
/// Gnre un random
/// </summary>
/// <param name="a">Min</param>
/// <param name="b">Max</param>
/// <returns></returns>
static int random(int a, int b);
/// <summary>
/// Affiche un vecteur
/// </summary>
/// <param name="v">Vecteur</param>
static void print(std::vector<int> v);
/// <summary>
/// Affiche deux vecteurs
/// </summary>
/// <param name="v1">Vecteur 1</param>
/// <param name="v2">Vecteur 2</param>
static void print2(std::vector<int> v1, std::vector<int> v2);
};
 Entry.cpp
C:\Users\poula\Downloads\oad-tp2\Code\View\utils.h(15,2): warning C4091: 'static ': ignored on left of 'utils' when no variable is declared
C:\Users\poula\Downloads\oad-tp2\Code\View\utils.h(32,2): warning C4091: 'static ': ignored on left of 'utils' when no variable is declared
MainForm.cpp
C:\Users\poula\Downloads\oad-tp2\Code\View\utils.h(32,2): warning C4091: 'static ': ignored on left of 'utils' when no variable is declared
bierwirthManager.cpp
C:\Users\poula\Downloads\oad-tp2\Code\View\utils.h(32,2): warning C4091: 'static ': ignored on left of 'utils' when no variable is declared
gestion_graphe.cpp
solution.cpp
utils.cpp
C:\Users\poula\Downloads\oad-tp2\Code\View\utils.h(32,2): warning C4091: 'static ': ignored on left of 'utils' when no variable is declared
Generating Code...
C:\Users\poula\Downloads\oad-tp2\Code\View\bierwirthManager.cpp(67): warning C4715: 'bierwirthManager::prToIndex': not all control paths return a value
bierwirthManager.obj : MSIL module encountered; incremental linking is disabled for MSIL; performing full link
View.vcxproj -> C:\Users\poula\Downloads\oad-tp2\Code\x64\Debug\View.exe
No preview for this file type
No preview for this file type
No preview for this file type
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment