Assigning Unique Attributes Based On List

365 views
Skip to first unread message

Jordan Wyatt

unread,
Oct 2, 2017, 1:55:33 PM10/2/17
to Jaamsim Users Discussion Group
Hi Community,

This might seem like a silly question, but I am still getting used to this environment. I have an excel document with 400 unique entities, each with:
  • Entity creation time
  • Entity service time (different for each entity, but not random)
  • Entity end time
  • Entity destination ID (which specific EntityDelay it must go to)
I am assuming that I would want to create attributes for each entity labeled (for example) GateServTime, and GateID. My question is how would I best assign those to each entity (of which there will be 400+ per simulation run). I would trigger entity creation using EventSchedule. However, I am not sure how to assign attributes from a list. 

Something along the lines of, say, this is entity 40 coming into the Assign block, I want to assign GateServTime(40) and GateID(40) to it.

Suggestions?

Regards,

Jordan

Harry King

unread,
Oct 2, 2017, 8:34:21 PM10/2/17
to Jaamsim Users Discussion Group
Jordan,

Add an entity number attribute to your prototype SimEntity. Next, place an Assign object after your EntityGenerator that assigns the entity number attribute using the EntityGenerator's output 'NumberGenerated'.

Export your data from Excel as a tab-delimited text file and read it into JaamSim using a FileToMatrix object. Your can now index into the 'Value' output for the FileToMatrix using the entity number attribute. For example, the entity service time for an entity is '[FileToMatrix1].Value(this.obj.num)(2)', where num is the entity number attribute.

The post entitled 'Simulating CallCentre several questions' gives an example of a similar model.

Harry

Jordan Wyatt

unread,
Oct 3, 2017, 4:28:49 PM10/3/17
to Jaamsim Users Discussion Group
Roger Harry. Thank you!

- Jordan
Reply all
Reply to author
Forward
0 new messages