Search therough a Queue and insert an entity in the right place

emsadoon

Registered User.
Local time
Today, 04:21
Joined
Jun 6, 2013
Messages
83
Hi,

I am trying to write a VBA code in Arena Simulation Software. In this model, I am trying to put a new arrived entity into the right place in the Queue. When an entity arrives, I want the VBA code reads its attributes ( priority number), then search through the queue, and finally insert the entity into the right place (correct index).

I wrote a few lines for inserting an entity into the queue, but it lacks the searching part and inserting into the right place. Here is what I have :

Code:
Option Explicit
Dim m As Model
Dim s As SIMAN
Dim que_num As Long
 
Private Sub VBA_Block_1_Fire()
Set m = ThisDocument.Model
Set s = m.SIMAN
 
que_num = s.SymbolNumber("Process 1.Queue")
s.EntityCreate
 
s.EntityInsertIntoQueueByRank s.ActiveEntity, que_num
 
End Sub

I greatly appreciate if you can help me with that.
 
Last edited:

Users who are viewing this thread

Back
Top Bottom