⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 form1.frm

📁 模拟蜜蜂采蜜的具有人工生命特性的VB程序 可以作为学习人工生命的一个不错的入门
💻 FRM
📖 第 1 页 / 共 3 页
字号:
VERSION 5.00
Object = "{6B7E6392-850A-101B-AFC0-4210102A8DA7}#1.3#0"; "COMCTL32.OCX"
Begin VB.Form Form1 
   AutoRedraw      =   -1  'True
   BackColor       =   &H00C0C0C0&
   Caption         =   "bee"
   ClientHeight    =   5565
   ClientLeft      =   2940
   ClientTop       =   885
   ClientWidth     =   5985
   LinkTopic       =   "Form1"
   ScaleHeight     =   6134.813
   ScaleMode       =   0  'User
   ScaleWidth      =   5985
   Begin VB.CommandButton ComC 
      Caption         =   "图形表示"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   14.25
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   495
      Left            =   2880
      TabIndex        =   11
      Top             =   4560
      Width           =   1575
   End
   Begin VB.Frame Frame1 
      Caption         =   "详细数据"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   10.5
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   3735
      Left            =   1200
      TabIndex        =   9
      Top             =   840
      Width           =   4575
      Begin VB.TextBox txtinfo 
         Height          =   3255
         Left            =   120
         Locked          =   -1  'True
         MultiLine       =   -1  'True
         ScrollBars      =   2  'Vertical
         TabIndex        =   10
         Text            =   "Form1.frx":0000
         Top             =   360
         Width           =   4335
      End
   End
   Begin VB.PictureBox PicG 
      AutoRedraw      =   -1  'True
      BackColor       =   &H00FFFFFF&
      DrawWidth       =   2
      Height          =   495
      Left            =   5400
      ScaleHeight     =   435
      ScaleWidth      =   195
      TabIndex        =   8
      Top             =   120
      Visible         =   0   'False
      Width           =   255
   End
   Begin VB.CommandButton ComS 
      Caption         =   "开始"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   14.25
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   495
      Left            =   960
      TabIndex        =   2
      Top             =   4560
      Width           =   1215
   End
   Begin VB.Timer Timer1 
      Enabled         =   0   'False
      Interval        =   100
      Left            =   0
      Top             =   240
   End
   Begin ComctlLib.StatusBar Stat1 
      Align           =   2  'Align Bottom
      Height          =   390
      Left            =   0
      TabIndex        =   1
      Top             =   5175
      Width           =   5985
      _ExtentX        =   10557
      _ExtentY        =   688
      SimpleText      =   "no"
      _Version        =   327682
      BeginProperty Panels {0713E89E-850A-101B-AFC0-4210102A8DA7} 
         NumPanels       =   3
         BeginProperty Panel1 {0713E89F-850A-101B-AFC0-4210102A8DA7} 
            Text            =   "waiting..."
            TextSave        =   "waiting..."
            Key             =   ""
            Object.Tag             =   ""
         EndProperty
         BeginProperty Panel2 {0713E89F-850A-101B-AFC0-4210102A8DA7} 
            Object.Width           =   15769
            MinWidth        =   15769
            TextSave        =   ""
            Key             =   ""
            Object.Tag             =   ""
         EndProperty
         BeginProperty Panel3 {0713E89F-850A-101B-AFC0-4210102A8DA7} 
            Object.Width           =   16828
            MinWidth        =   16828
            Key             =   ""
            Object.Tag             =   ""
         EndProperty
      EndProperty
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "宋体"
         Size            =   9.75
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
   End
   Begin VB.Label Label2 
      Caption         =   "区域大小: 7500X7500"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   12
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   495
      Index           =   4
      Left            =   120
      TabIndex        =   7
      Top             =   720
      Width           =   1215
   End
   Begin VB.Label Label2 
      Caption         =   "花朵数:  200"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   12
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   495
      Index           =   3
      Left            =   120
      TabIndex        =   6
      Top             =   3840
      Width           =   1215
   End
   Begin VB.Label Label2 
      Caption         =   "花粉数:20000"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   12
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   495
      Index           =   2
      Left            =   120
      TabIndex        =   5
      Top             =   3000
      Width           =   1215
   End
   Begin VB.Label Label2 
      Caption         =   "蜜蜂数:   400"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   12
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   495
      Index           =   1
      Left            =   120
      TabIndex        =   4
      Top             =   2160
      Width           =   1215
   End
   Begin VB.Label Label2 
      Caption         =   "蜂巢数:5"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   12
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   255
      Index           =   0
      Left            =   120
      TabIndex        =   3
      Top             =   1560
      Width           =   1335
   End
   Begin VB.Label Label1 
      Alignment       =   2  'Center
      BackColor       =   &H00FFFFFF&
      Caption         =   "第2天"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   15
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   375
      Left            =   360
      TabIndex        =   0
      Top             =   120
      Width           =   4815
   End
   Begin VB.Menu mnuF 
      Caption         =   "文件(&F)"
      Begin VB.Menu mnuSP 
         Caption         =   "开始(暂停)"
         Shortcut        =   ^{F1}
      End
      Begin VB.Menu mun1 
         Caption         =   "-"
      End
      Begin VB.Menu mnuS 
         Caption         =   "速度(&S)"
      End
      Begin VB.Menu mnuR 
         Caption         =   "初始化(&R)"
      End
      Begin VB.Menu mnuC 
         Caption         =   "切换(&C)"
      End
      Begin VB.Menu mnu2 
         Caption         =   "-"
      End
      Begin VB.Menu mnuE 
         Caption         =   "退出(&E)"
      End
   End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False

Private Sub ComC_Click()
Static flag As Boolean
'Debug.Print flag
If flag Then
PicG.Visible = False
ComC.Caption = "图形表示"
ComC.Top = 5025
ComS.Top = 5024
ComC.Left = 3000
ComS.Left = 1000
Form1.Height = 6250
Form1.Width = 6100
Frame1.Visible = True
Else
PicG.Visible = True
ComC.Caption = "详细数据"
ComC.Left = 7700
ComC.Top = 5000
ComS.Top = 2000
ComS.Left = 7700
Form1.Height = 8700
Form1.Width = 9400
Frame1.Visible = False
End If
flag = Not flag
'Debug.Print PicG.Height
End Sub

Private Sub ComS_Click()
Static flag As Boolean

If flag Then
ComS.Caption = "开始"
Timer1.Enabled = False
flag = False
Stat1.Panels(1) = "Pause"
Else
ComS.Caption = "暂停"
Timer1.Enabled = True
Timer1.Interval = TimeInl
flag = True
Stat1.Panels(1) = "Running..."
End If
'Debug.Print Timer1.Interval
End Sub

Private Sub Form_Load()
Hsum = 5
Bsum = 400
Fsum = 150
Tsum = 2
AvyRate = 50
TimeInl = 100
Rsum = 0
UpRate = 7500
LowRate = 3000
iLowRate = 250
FormIn.Show 1
With Ntime
.d = 0: .h = 0: .m = 0

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -