TProcura
Biblioteca em C++ para testes paramétricos de algoritmos, e coleção de algoritmos de procura e otimização
Loading...
Searching...
No Matches
teste.cpp
Go to the documentation of this file.
1// ProcuraEngine.cpp : Defines the entry point for the console application.
2//
3
4#include <stdio.h>
5#include <locale>
6
7#include "../TProcuraMelhorativa.h"
8#include "OitoDamas.h"
9#include "Particao.h"
10#include "ProblemaArtificial.h"
11
12int main(int argc, char* argv[])
13{
14 std::locale::global(std::locale(""));
15
16#ifndef MPI_ATIVO
17 printf("\n\
18Teste TProcuraMelhorativa\nProblema:\n\
19 1 - 8 Damas\n\
20 2 - 8 Damas Inteira\n\
21 3 - 8 Damas Permutacao\n\
22 4 - Partição\n\
23 5 - Partição Binária\n\
24 6 - Artificial\n\
25Opção: ");
26 int caso = TProcura::NovoValor("");
27#else
28 // não utilizar o stdin em programas MPI
29 if (argc < 2) {
30 printf("Utilizar o primeiro argumento para identificar o problema:\n\
31Teste TProcuraMelhorativa\nProblema:\n\
32 1 - 8 Damas\n\
33 2 - 8 Damas Inteira\n\
34 3 - 8 Damas Permutacao\n\
35 4 - Partição\n\
36 5 - Partição Binária\n\
37 6 - Artificia");
38 return 1;
39 }
40 int caso = atoi(argv[1]);
41 argc--;
42 argv++;
43#endif
44
45
46 switch (caso) {
47 case 1: COitoDamas().main(argc, argv, "8 Damas"); break;
48 case 2: COitoDamasCI().main(argc, argv, "8 Damas Inteira"); break;
49 case 3: COitoDamasCP().main(argc, argv, "8 Damas Permutação"); break;
50 case 4: CParticao().main(argc, argv, "Partição"); break;
51 case 5: CParticaoCB().main(argc, argv, "Partição Binária"); break;
52 case 6: CProblemaArtificial().main(argc, argv, "Artificial"); break;
53 default: printf("Problema não implementado.");
54 }
55
56}
int main(int argc, char *argv[])
Definition teste.cpp:11
Representa um estado do problema das 8 damas.
Definition OitoDamas.h:15
Representa um estado do problema da partição.
Definition Particao.h:13
Representa um estado num problema artificial.
static int NovoValor(const char *prompt)
virtual void main(int argc, char *argv[], const char *nome)
Inicializa a interação com o utilizador.
Definition TProcura.cpp:804