Académique Documents
Professionnel Documents
Culture Documents
METODO SIMPLEX
Y DUAL SIMPLEX
LENGUAJE VB.NET
MENU:
Como podemos ver el método nos perite extraer el método dual pero no nos permite modificarlo ya que
el método dual es un resultado de las variables y restricciones del primal.
EJEMPLO FUNCIONAMIENTO:
‘MENU
Public Class MENUPRINCIPAL
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
If TextBox1.Text = "2" And TextBox2.Text = "2" Then
FORM2X2.Show()
Me.Hide()
End If
If TextBox1.Text = "2" And TextBox2.Text = "3" Then
form2x3.Show()
Me.Hide()
End If
If TextBox1.Text = "3" And TextBox2.Text = "3" Then
form3X3.SHOW()
Me.Hide()
End If
End Sub
End Class
End Sub
End Sub
End Sub
AA.Text = H.Text
BB.Text = B.Text
CC.Text = M.Text
DD.Text = D.Text
EE.Text = EEE.Text
FF.Text = I.Text
HH.Text = A.Text
II.Text = F.Text
JJ.Text = J.Text
KK.Text = K.Text
MM.Text = C.Text
NN.Text = N.Text
OO.Text = O.Text
PP.Text = P.Text
QQ.Text = Q.Text
End Sub
Private Sub Label26_Click(sender As Object, e As EventArgs)
End Sub
End Sub
End Sub
'INICIAMOS CRAMMER
Dim DS As Double
Dim DY As Double
Dim DX As Double
A2.Text = x
B2.Text = y1
A3.Text = x2
B3.Text = y
A4.Text = x
B4.Text = y2
A5.Text = x
B5.Text = y
A6.Text = x3
B6.Text = y3
'SACAR EL VALOR DE Z
ZV1 = ((AV * x1) + (CV * y))
ZV2 = ((AV * x) + (CV * y1))
ZV3 = ((AV * x2) + (CV * y))
ZV4 = ((AV * x) + (CV * y2))
ZV5 = ((AV * x) + (CV * y))
ZV6 = ((AV * x3) + (CV * y3))
Z1.Text = ZV1
Z2.Text = ZV2
Z3.Text = ZV3
Z4.Text = ZV4
Z5.Text = ZV5
Z6.Text = ZV6
matriz(1, 0) = B1.Text
matriz(1, 1) = B2.Text
matriz(1, 2) = B3.Text
matriz(1, 3) = B4.Text
matriz(1, 4) = B5.Text
matriz(1, 5) = B6.Text
End If
End If
End If
'SEGUNDA RESTRICCION
If (L.Text = ">=") Then
End If
End If
End If
Next
''bien
Else
MsgBox("VALIDA TUS SIGNOS")
End If
End Sub
Private Sub Button4_Click(sender As Object, e As EventArgs) Handles Button4.Click 'BOTON
PARA RESOLVER DUAL
'TEXTBOX YA EN VARIABLES
Dim AAV As Double = AA.Text
Dim CCV As Double = CC.Text
Dim DDV As Double = DD.Text
Dim FFV As Double = FF.Text
Dim HHV As Double = HH.Text
Dim IIV As Double = II.Text
Dim KKV As Double = KK.Text
Dim MMV As Double = MM.Text
Dim QQV As Double = QQ.Text
AA2.Text = xx
BB2.Text = yy1
AA3.Text = xx2
BB3.Text = yy
AA4.Text = xx
BB4.Text = yy2
AA5.Text = xx
BB5.Text = yy
AA6.Text = xx3
BB6.Text = yy3
'LLENAR ZDUAL
ZZV1 = ((AAV * xx1) + (CCV * yy))
ZZV2 = ((AAV * xx) + (CCV * yy1))
ZZV3 = ((AAV * xx2) + (CCV * yy))
ZZV4 = ((AAV * xx) + (CCV * yy2))
ZZV5 = ((AAV * xx) + (CCV * yy))
ZZV6 = ((AAV * xx3) + (CCV * yy3))
ZZ1.Text = ZZV1
ZZ2.Text = ZZV2
ZZ3.Text = ZZV3
ZZ4.Text = ZZV4
ZZ5.Text = ZZV5
ZZ6.Text = ZZV6
'CALCULAR LOS PUNTOS OPTIMOS
'primera funcion
Dim matrizz(1, 5)
matrizz(0, 0) = AA1.Text
matrizz(0, 1) = AA2.Text
matrizz(0, 2) = AA3.Text
matrizz(0, 3) = AA4.Text
matrizz(0, 4) = AA5.Text
matrizz(0, 5) = AA6.Text
matrizz(1, 0) = BB1.Text
matrizz(1, 1) = BB2.Text
matrizz(1, 2) = BB3.Text
matrizz(1, 3) = BB4.Text
matrizz(1, 4) = BB5.Text
matrizz(1, 5) = BB6.Text
End If
End If
End If
'SEGUNDA RESTRICCION
If (LL.Text = ">=") Then
End If
End If
End If
Next
''bien
End Sub
Private Sub LIMPIAR()
maxmin2.Clear()
A.Clear()
B.Clear()
C.Clear()
D.Clear()
EEE.Clear()
F.Clear()
G.Clear()
H.Clear()
I.Clear()
J.Clear()
K.Clear()
L.Clear()
M.Clear()
N.Clear()
O.Clear()
P.Clear()
Q.Clear()
AA.Clear()
BB.Clear()
CC.Clear()
DD.Clear()
EE.Clear()
FF.Clear()
GG.Clear()
HH.Clear()
II.Clear()
JJ.Clear()
KK.Clear()
LL.Clear()
MM.Clear()
NN.Clear()
OO.Clear()
PP.Clear()
QQ.Clear()
A1.Clear()
A2.Clear()
A3.Clear()
A4.Clear()
A5.Clear()
A6.Clear()
B1.Clear()
B2.Clear()
B3.Clear()
B4.Clear()
B5.Clear()
B6.Clear()
AA1.Clear()
AA2.Clear()
AA3.Clear()
AA4.Clear()
AA5.Clear()
AA6.Clear()
BB1.Clear()
BB2.Clear()
BB3.Clear()
BB4.Clear()
BB5.Clear()
BB6.Clear()
AA4.BackColor = Color.White
BB4.BackColor = Color.White
ZZ4.BackColor = Color.White
AA3.BackColor = Color.White
BB3.BackColor = Color.White
ZZ3.BackColor = Color.White
AA2.BackColor = Color.White
BB2.BackColor = Color.White
ZZ2.BackColor = Color.White
AA1.BackColor = Color.White
BB1.BackColor = Color.White
ZZ1.BackColor = Color.White
A1.BackColor = Color.White
B1.BackColor = Color.White
Z1.BackColor = Color.White
A2.BackColor = Color.White
B2.BackColor = Color.White
Z2.BackColor = Color.White
A3.BackColor = Color.White
B3.BackColor = Color.White
Z3.BackColor = Color.White
A4.BackColor = Color.White
B4.BackColor = Color.White
Z4.BackColor = Color.White
A5.BackColor = Color.White
B5.BackColor = Color.White
Z5.BackColor = Color.White
A6.BackColor = Color.White
B6.BackColor = Color.White
Z6.BackColor = Color.White
AA5.BackColor = Color.White
BB5.BackColor = Color.White
ZZ5.BackColor = Color.White
AA6.BackColor = Color.White
BB6.BackColor = Color.White
ZZ6.BackColor = Color.White
End Sub
End Sub
End Sub
End Class
End Sub
AA.Text = H.Text
BB.Text = B.Text
CC.Text = M.Text
RR.Text = B.Text
SS.Text = V.Text
DD.Text = D.Text
EE.Text = EEE.Text
FF.Text = I.Text
GG.Text = EEE.Text
TT.Text = R.Text
HH.Text = A.Text
II.Text = F.Text
JJ.Text = J.Text
KK.Text = K.Text
LL.Text = S.Text
UU.Text = T.Text
MM.Text = C.Text
NN.Text = N.Text
OO.Text = O.Text
VV.Text = "U"
QQ.Text = Q.Text
End Sub
End Sub
End Class