Advertisement
jsbsan

MainMochila

May 23rd, 2014
6,763
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
GAMBAS 0.77 KB | None | 0 0
  1. ' Gambas module file
  2.  
  3. Public Sub main()
  4.  
  5.   Dim pm As New ProblemaMochila(20, "mayor_valor")
  6.   Dim pm1 As New ProblemaMochila(20, "menos_peso")
  7.   Dim pm2 As New ProblemaMochila(20, "coeficiente_valor/peso")
  8.  
  9.   Print "......................................."
  10.   Print "Estrategia: " & "mayor_valor"
  11.   pm.resolverProblema()
  12.   pm.mostrarMochila()
  13.   Print "......................................."
  14.   Print "Estrategia: " & "menos_peso"
  15.   pm1.resolverProblema()
  16.   pm1.mostrarMochila()
  17.   Print "......................................."
  18.   Print "Estrategia: " & "coeficiente_valor/peso"
  19.   pm2.resolverProblema()
  20.   pm2.mostrarMochila()
  21.   Print "......................................."
  22.   Print "Algoritmo Backtracking"
  23.   pm.resolverProblemaBT(0)
  24.   pm.mostrarMochila()
  25.  
  26. End
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement