?? form1.frm
字號:
VERSION 5.00
Begin VB.Form Form1
Caption = "0-1規劃 分支定界法"
ClientHeight = 5115
ClientLeft = 7005
ClientTop = 7095
ClientWidth = 7935
BeginProperty Font
Name = "楷體_GB2312"
Size = 12
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
LinkTopic = "Form1"
Picture = "Form1.frx":0000
ScaleHeight = 5115
ScaleWidth = 7935
StartUpPosition = 2 '屏幕中心
Begin VB.CommandButton Command2
Caption = "求解"
BeginProperty Font
Name = "楷體_GB2312"
Size = 10.5
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 360
TabIndex = 9
Top = 3960
Visible = 0 'False
Width = 855
End
Begin VB.TextBox Text5
BeginProperty Font
Name = "MS Sans Serif"
Size = 8.25
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Index = 0
Left = 1920
TabIndex = 8
Top = 2160
Visible = 0 'False
Width = 495
End
Begin VB.TextBox Text3
BeginProperty Font
Name = "MS Sans Serif"
Size = 8.25
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Index = 0
Left = 1920
TabIndex = 6
Top = 1320
Visible = 0 'False
Width = 495
End
Begin VB.TextBox Text2
BeginProperty Font
Name = "MS Sans Serif"
Size = 8.25
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 4800
TabIndex = 4
Top = 720
Width = 855
End
Begin VB.CommandButton Command1
Caption = "輸入問題"
BeginProperty Font
Name = "楷體_GB2312"
Size = 10.5
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 6120
TabIndex = 2
Top = 720
Width = 1095
End
Begin VB.TextBox Text1
BeginProperty Font
Name = "MS Sans Serif"
Size = 8.25
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 1800
TabIndex = 1
Top = 720
Width = 855
End
Begin VB.Label Label4
BackStyle = 0 'Transparent
Caption = "說明:程序僅適用于0-1規劃標準型,非標準模型需要轉換 "
Height = 375
Left = 360
TabIndex = 10
Top = 240
Width = 7095
End
Begin VB.Label Label5
Alignment = 2 'Center
BackStyle = 0 'Transparent
Caption = "輸入約束條件(不等式約束均為<=,各變量取值均為0或1)"
BeginProperty Font
Name = "楷體_GB2312"
Size = 10.5
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 1140
Left = 240
TabIndex = 7
Top = 2160
Visible = 0 'False
Width = 1530
End
Begin VB.Label Label3
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "輸入價值系數"
BeginProperty Font
Name = "楷體_GB2312"
Size = 10.5
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 210
Left = 360
TabIndex = 5
Top = 1320
Visible = 0 'False
Width = 1350
End
Begin VB.Label Label2
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "不等式約束個數"
BeginProperty Font
Name = "楷體_GB2312"
Size = 10.5
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 210
Left = 3000
TabIndex = 3
Top = 720
Width = 1575
End
Begin VB.Label Label1
Alignment = 2 'Center
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "變量個數"
BeginProperty Font
Name = "楷體_GB2312"
Size = 10.5
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 210
Left = 360
TabIndex = 0
Top = 720
Width = 900
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Option Base 1
Private Sub Command1_Click()
Dim i As Integer, j As Integer, k As Integer
n = Text1.Text
m = Text2.Text
Label3.Visible = True
For j = 1 To (n + 1)
Load Text3(j)
Text3(j).Visible = True
Text3(j).Top = 1320
Text3(j).Left = Text3(0).Left + (j - 1) * (Text3(0).Width + 200)
Next j
Label5.Visible = True
For i = 1 To m
For j = 1 To (n + 1)
k = (i - 1) * (n + 1) + j
Load Text5(k)
Text5(k).Visible = True
Text5(k).Top = Text5(0).Top + (i - 1) * (Text5(0).Height + 200)
Text5(k).Left = Text5(0).Left + (j - 1) * (Text5(0).Width + 200)
Next j
Next i
Command2.Visible = True
Command2.Top = Text5(k).Top + Text5(0).Height + 500
Command2.Left = 1 / 2 * (Form1.Width - Command2.Width)
End Sub
Private Sub Command2_Click()
Dim i As Integer, j As Integer, s() As Single, z As Single, k As Integer, flag As Boolean
flag = False
z = Text3(n + 1).Text
max = -10000
ReDim A(m, n)
ReDim C(n)
ReDim B(m)
ReDim s(m)
ReDim x(n)
For j = 1 To n
C(j) = Text3(j).Text
Next j
For i = 1 To m
For j = 1 To (n + 1)
k = (i - 1) * (n + 1) + j
If j = n + 1 Then
B(i) = Text5(k).Text
If B(i) < 0 Then flag = True
Else
A(i, j) = Text5(k).Text
End If
Next j
Next i
If flag Then
Branch_Bound1 1, s(), z
Branch_Bound0 1, s(), z
Else
result_num = 1
ReDim result(n, result_num)
End If
Load Form2
Form2.Show
End Sub
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -