provas datas: – p1 : 18/09/2014 – p2: 18/11/2014 – exame : 09/12/2014
TRANSCRIPT
![Page 1: Provas Datas: – P1 : 18/09/2014 – P2: 18/11/2014 – Exame : 09/12/2014](https://reader036.vdocuments.pub/reader036/viewer/2022062319/552fc181497959413d8f33c7/html5/thumbnails/1.jpg)
Provas
• Datas:– P1 : 18/09/2014– P2: 18/11/2014– Exame : 09/12/2014
![Page 2: Provas Datas: – P1 : 18/09/2014 – P2: 18/11/2014 – Exame : 09/12/2014](https://reader036.vdocuments.pub/reader036/viewer/2022062319/552fc181497959413d8f33c7/html5/thumbnails/2.jpg)
LIDANDO COM RESTRIÇOES
![Page 3: Provas Datas: – P1 : 18/09/2014 – P2: 18/11/2014 – Exame : 09/12/2014](https://reader036.vdocuments.pub/reader036/viewer/2022062319/552fc181497959413d8f33c7/html5/thumbnails/3.jpg)
Manipulando Restrições
• Mantendo a população factível usando representação e operadores específicos.– Por exemplo, os operadores para o problema do
caixeiro viajante.• Funções de Penalização• Métodos de Reparação.
![Page 4: Provas Datas: – P1 : 18/09/2014 – P2: 18/11/2014 – Exame : 09/12/2014](https://reader036.vdocuments.pub/reader036/viewer/2022062319/552fc181497959413d8f33c7/html5/thumbnails/4.jpg)
Método da Penalização
• Problema geral de programação não linear.
O método da penalização converte um problema com restrições em um problema sem restrições.
![Page 5: Provas Datas: – P1 : 18/09/2014 – P2: 18/11/2014 – Exame : 09/12/2014](https://reader036.vdocuments.pub/reader036/viewer/2022062319/552fc181497959413d8f33c7/html5/thumbnails/5.jpg)
função de penalização
• Uma função de penalização define o quão a solução x viola a restrição j. (i.e., o quão distante o cromossomo infactível está da região factível).
![Page 6: Provas Datas: – P1 : 18/09/2014 – P2: 18/11/2014 – Exame : 09/12/2014](https://reader036.vdocuments.pub/reader036/viewer/2022062319/552fc181497959413d8f33c7/html5/thumbnails/6.jpg)
Criando as funções de penalização
![Page 7: Provas Datas: – P1 : 18/09/2014 – P2: 18/11/2014 – Exame : 09/12/2014](https://reader036.vdocuments.pub/reader036/viewer/2022062319/552fc181497959413d8f33c7/html5/thumbnails/7.jpg)
Método da Penalização
• Agora o problema não possui restrições:
Onde ri são constantes denominadas fatores da penalização.
![Page 8: Provas Datas: – P1 : 18/09/2014 – P2: 18/11/2014 – Exame : 09/12/2014](https://reader036.vdocuments.pub/reader036/viewer/2022062319/552fc181497959413d8f33c7/html5/thumbnails/8.jpg)
Exemplos
• Problema original
Problema transformado
![Page 9: Provas Datas: – P1 : 18/09/2014 – P2: 18/11/2014 – Exame : 09/12/2014](https://reader036.vdocuments.pub/reader036/viewer/2022062319/552fc181497959413d8f33c7/html5/thumbnails/9.jpg)
Métodos de Reparação
• Usa métodos que transformam uma solução infactível em uma factível (i.e., “repara a solução”);
• Em geral, a solução “reparada” é próxima da solução factível.
![Page 10: Provas Datas: – P1 : 18/09/2014 – P2: 18/11/2014 – Exame : 09/12/2014](https://reader036.vdocuments.pub/reader036/viewer/2022062319/552fc181497959413d8f33c7/html5/thumbnails/10.jpg)
Exemplo:
• No problema da mochila, algumas soluções podem ultrapassar a capacidade da mochila.
• Reparação: retire objetos da mochila até a solução tornar-se factível.
![Page 11: Provas Datas: – P1 : 18/09/2014 – P2: 18/11/2014 – Exame : 09/12/2014](https://reader036.vdocuments.pub/reader036/viewer/2022062319/552fc181497959413d8f33c7/html5/thumbnails/11.jpg)
![Page 12: Provas Datas: – P1 : 18/09/2014 – P2: 18/11/2014 – Exame : 09/12/2014](https://reader036.vdocuments.pub/reader036/viewer/2022062319/552fc181497959413d8f33c7/html5/thumbnails/12.jpg)
Representação do PCV
• As cidades são representadas diretamente no cromossomo.
![Page 13: Provas Datas: – P1 : 18/09/2014 – P2: 18/11/2014 – Exame : 09/12/2014](https://reader036.vdocuments.pub/reader036/viewer/2022062319/552fc181497959413d8f33c7/html5/thumbnails/13.jpg)
Mutação 1
![Page 14: Provas Datas: – P1 : 18/09/2014 – P2: 18/11/2014 – Exame : 09/12/2014](https://reader036.vdocuments.pub/reader036/viewer/2022062319/552fc181497959413d8f33c7/html5/thumbnails/14.jpg)
Mutação 2
![Page 15: Provas Datas: – P1 : 18/09/2014 – P2: 18/11/2014 – Exame : 09/12/2014](https://reader036.vdocuments.pub/reader036/viewer/2022062319/552fc181497959413d8f33c7/html5/thumbnails/15.jpg)
Mutação 3
![Page 16: Provas Datas: – P1 : 18/09/2014 – P2: 18/11/2014 – Exame : 09/12/2014](https://reader036.vdocuments.pub/reader036/viewer/2022062319/552fc181497959413d8f33c7/html5/thumbnails/16.jpg)
Mutação 4
• Escolher e misturar
![Page 17: Provas Datas: – P1 : 18/09/2014 – P2: 18/11/2014 – Exame : 09/12/2014](https://reader036.vdocuments.pub/reader036/viewer/2022062319/552fc181497959413d8f33c7/html5/thumbnails/17.jpg)
Crossover
![Page 18: Provas Datas: – P1 : 18/09/2014 – P2: 18/11/2014 – Exame : 09/12/2014](https://reader036.vdocuments.pub/reader036/viewer/2022062319/552fc181497959413d8f33c7/html5/thumbnails/18.jpg)
Order 1
Colocar 1,4,9,3,78,9,1,2,3
![Page 19: Provas Datas: – P1 : 18/09/2014 – P2: 18/11/2014 – Exame : 09/12/2014](https://reader036.vdocuments.pub/reader036/viewer/2022062319/552fc181497959413d8f33c7/html5/thumbnails/19.jpg)
Order-Based Crossover (OBX)
• Elementos são selecionadas aleatoriamente. É imposta uma ordem nos elementos selecionadas do pai1 igual a ordem dos respectivos elementos em pai2.
![Page 20: Provas Datas: – P1 : 18/09/2014 – P2: 18/11/2014 – Exame : 09/12/2014](https://reader036.vdocuments.pub/reader036/viewer/2022062319/552fc181497959413d8f33c7/html5/thumbnails/20.jpg)
Position-Based Crossover (PBX)
• Elementos são selecionadas aleatoriamente e a posição dos elementos selecionadas no pai2 é imposto ao pai1.
![Page 21: Provas Datas: – P1 : 18/09/2014 – P2: 18/11/2014 – Exame : 09/12/2014](https://reader036.vdocuments.pub/reader036/viewer/2022062319/552fc181497959413d8f33c7/html5/thumbnails/21.jpg)
PMXRealiza trocas no sentido de pai1 para pai2 e depois no sentido inverso, isto é, de pai2 para pai1, para evitar cromossomos inválidos.
![Page 22: Provas Datas: – P1 : 18/09/2014 – P2: 18/11/2014 – Exame : 09/12/2014](https://reader036.vdocuments.pub/reader036/viewer/2022062319/552fc181497959413d8f33c7/html5/thumbnails/22.jpg)
Vetores de Valores Reais
• Mapear para codificação binaria• Usar cruzamento e mutação especiais
![Page 23: Provas Datas: – P1 : 18/09/2014 – P2: 18/11/2014 – Exame : 09/12/2014](https://reader036.vdocuments.pub/reader036/viewer/2022062319/552fc181497959413d8f33c7/html5/thumbnails/23.jpg)
![Page 24: Provas Datas: – P1 : 18/09/2014 – P2: 18/11/2014 – Exame : 09/12/2014](https://reader036.vdocuments.pub/reader036/viewer/2022062319/552fc181497959413d8f33c7/html5/thumbnails/24.jpg)
![Page 25: Provas Datas: – P1 : 18/09/2014 – P2: 18/11/2014 – Exame : 09/12/2014](https://reader036.vdocuments.pub/reader036/viewer/2022062319/552fc181497959413d8f33c7/html5/thumbnails/25.jpg)
![Page 26: Provas Datas: – P1 : 18/09/2014 – P2: 18/11/2014 – Exame : 09/12/2014](https://reader036.vdocuments.pub/reader036/viewer/2022062319/552fc181497959413d8f33c7/html5/thumbnails/26.jpg)
![Page 27: Provas Datas: – P1 : 18/09/2014 – P2: 18/11/2014 – Exame : 09/12/2014](https://reader036.vdocuments.pub/reader036/viewer/2022062319/552fc181497959413d8f33c7/html5/thumbnails/27.jpg)
![Page 28: Provas Datas: – P1 : 18/09/2014 – P2: 18/11/2014 – Exame : 09/12/2014](https://reader036.vdocuments.pub/reader036/viewer/2022062319/552fc181497959413d8f33c7/html5/thumbnails/28.jpg)
![Page 29: Provas Datas: – P1 : 18/09/2014 – P2: 18/11/2014 – Exame : 09/12/2014](https://reader036.vdocuments.pub/reader036/viewer/2022062319/552fc181497959413d8f33c7/html5/thumbnails/29.jpg)
![Page 30: Provas Datas: – P1 : 18/09/2014 – P2: 18/11/2014 – Exame : 09/12/2014](https://reader036.vdocuments.pub/reader036/viewer/2022062319/552fc181497959413d8f33c7/html5/thumbnails/30.jpg)
![Page 31: Provas Datas: – P1 : 18/09/2014 – P2: 18/11/2014 – Exame : 09/12/2014](https://reader036.vdocuments.pub/reader036/viewer/2022062319/552fc181497959413d8f33c7/html5/thumbnails/31.jpg)
![Page 32: Provas Datas: – P1 : 18/09/2014 – P2: 18/11/2014 – Exame : 09/12/2014](https://reader036.vdocuments.pub/reader036/viewer/2022062319/552fc181497959413d8f33c7/html5/thumbnails/32.jpg)
![Page 33: Provas Datas: – P1 : 18/09/2014 – P2: 18/11/2014 – Exame : 09/12/2014](https://reader036.vdocuments.pub/reader036/viewer/2022062319/552fc181497959413d8f33c7/html5/thumbnails/33.jpg)
![Page 34: Provas Datas: – P1 : 18/09/2014 – P2: 18/11/2014 – Exame : 09/12/2014](https://reader036.vdocuments.pub/reader036/viewer/2022062319/552fc181497959413d8f33c7/html5/thumbnails/34.jpg)
![Page 35: Provas Datas: – P1 : 18/09/2014 – P2: 18/11/2014 – Exame : 09/12/2014](https://reader036.vdocuments.pub/reader036/viewer/2022062319/552fc181497959413d8f33c7/html5/thumbnails/35.jpg)
Open Source code
• http://www.cs.rit.edu/~jmg/courses/ga/20103/tools.html
C++JavaPython
![Page 36: Provas Datas: – P1 : 18/09/2014 – P2: 18/11/2014 – Exame : 09/12/2014](https://reader036.vdocuments.pub/reader036/viewer/2022062319/552fc181497959413d8f33c7/html5/thumbnails/36.jpg)
Relatório
• Problema da mochila, 10, 50, 100 (arquivo b, w, c=sum(w)/2)
• Tamanho da população ? • Taxa de Mutação Ótima?• Taxa de Cruzamento ?• Como escala o tempo • Tomar decisões em base a 10 rodadas
![Page 37: Provas Datas: – P1 : 18/09/2014 – P2: 18/11/2014 – Exame : 09/12/2014](https://reader036.vdocuments.pub/reader036/viewer/2022062319/552fc181497959413d8f33c7/html5/thumbnails/37.jpg)