Simple Radiology Unit Model with Scheduled Entity Arrivals

274 views
Skip to first unread message

Jürgen Strohhecker

unread,
Dec 15, 2020, 12:52:03 PM12/15/20
to Jaamsim Users Discussion Group

Hello,
I am new to Jaamsim and struggle with changing over from Arena. I want to model a radiology unit with 11 patients arriving according to a schedule, getting serviced if the radiology unit is empty and otherwise sent to a waiting room. Service times are not drawn from a distribution. Instead they should be taken from a list or input file.

I have tried two approaches for the scheduled arrivals:
First, using a TimeSeries object to control InterArrivalTimes that change over time. But it does not work as expected.
Second, using an EventSchedule object. Unfortunately, the example model EventSchedule Example.cfg does open with an error so that I cannot learn from it how to set up this object.

I would be grateful for any hints or sample models.

Thank you very much.

Jürgen

Harry King

unread,
Dec 16, 2020, 11:57:55 PM12/16/20
to Jaamsim Users Discussion Group
Jurgen,

The EventSchedule example has been corrected and is now available for download along with the other examples.

Regarding your model for the radiology unit, the EventSchedule object is the right one to use if you want to model a series of specific arrival times. For example, if you want to model a historical data set for patient arrivals. On the other hand, if you want to model random arrivals with an  average arrival rate that varies over each day or day of week, then you should use the NonStatExponentialDist and TimeSeries objects. The User Manual includes an example of how to use these objects to create random arrivals.

Since you want to read both the arrival time and service time for each patient from a file, it might be best to use the FileToMatrix object to read in the data and set the InterArrivalTime input to the EntityGenerator to an expression that calculates the inter-arrival time from the Value output for the FileToMatrix object. The NumberGenerated output for the EntityGenerator can be used to determine the desired row in matrix returned by the Value output. An EventSchedule object would not be needed with this approach, but you will need to write some fairly complex expressions. The examples in the Getting Started section of the User Manual will provide a good introduction.

Harry

Jürgen Strohhecker

unread,
Dec 18, 2020, 11:26:47 AM12/18/20
to Jaamsim Users Discussion Group
Harry,

Thank you very much. With your help (and the corrected example models), I have accomplished to model the simple processing system using the EventSchedule and the FileToVector Object.  All works as expected, and I am getting more and more used to JaamSim. Nevertheless, I came across a couple of questions that I could not answer from reading the guide.
Instead of using the FileToVector object, is it possible to define an array as a global variable? If yes, where? Would the ExpressionEntity object the adequate way? If yes, can you define multiple variables there?

Harry King

unread,
Dec 23, 2020, 12:40:29 PM12/23/20
to Jaamsim Users Discussion Group
Jurgen,

There are no global variables in JaamSim. However, since any object can reference the outputs of every object in the model, there is no need for global variables. If necessary, you can always create a DisplayEntity for the purpose of holding the 'global' variables as attributes or custom outputs.

Regarding the ExpressionEntity, it's Value output can only return a single numerical result. However, you can return the values for any number of expressions using the CustomOutputList feature that is available for any JaamSim object. Each custom output is similar to an ExpressionEntity except that it can return any type of outputs such as an entity or an array of values.

Harry

Jürgen Strohhecker

unread,
Dec 30, 2020, 12:17:09 PM12/30/20
to Jaamsim Users Discussion Group
Harry,
Great. Understood. Thanks for all this help.
I managed to read the arrival times from a file. The file has entries like this:
'2020-01-01 07:35:00'
'2020-01-01 07:45:00'
'2020-01-01 08:10:00'
'2020-01-01 09:30:00'
The FileToVector object seems to convert these values automatically into:
Value

{5.0[min], 15.0[min], 40.0[min], 120.0[min]}
I thought that the EventSchedule object would accept this as an input to its TimeList property. But this is not the case. Am I doing anything wrong? (I managed to calculate interarrival times from the FileToVector input, as you suggested earlier.)
Thanks
Jürgen

Harry King

unread,
Jan 7, 2021, 1:45:38 PM1/7/21
to Jaamsim Users Discussion Group
Jurgen,

The EventSchedule object cannot help you in this case because its TimeList input does not accept an expression. In any case, it is easier to use the FileToVector's Value output directly in the InterArrivalTime input to EntityGenerator. Use the following expression for this input:

'[FileToVector1].Value(this.NumberGenerated + 1) - this.SimTime'

Eventually, you will want to add more data for each arrival to your input file. In this case, you should use the FileToMatrix object and modify the above expression appropriately. The example given in the 'Getting Started' section of the User Manual should give you some ideas on how to organise your data.

Harry
Reply all
Reply to author
Forward
0 new messages