0

I'm simulating a train system and want to measure the time a passenger spends from entering the system to boarding. Entering the system happens on a higher, boarding on a lower level of the model. The problem is that the TimeMeasureEnd block doesn't see the TimeMeasureStart blocks on a different level. Does anyone have experience with this problem or an idea for a solution?

Edit: I call set_startObjects(TimeMeasureStart[]) in an event occuring once at the creation of the agent in the lower level and set either the start blocks of the one or the other parent, depending on what the parent is. The data is being collected in all child agents separately and displayed in separate histograms in each child agent. How can I accumulate all of them in one single histogram to display in main which is two layers above the child agent where the data is being collected?

see attached image about layer problem

mate00
  • 2,727
  • 5
  • 26
  • 34
Snuffduff
  • 11
  • 5

1 Answers1

1

you can always define the 'TimeMeasureStart' block dynamically in your 'TimeMeasureEnd' block. Just switch the entry mode for defining it to "static value" as below:

enter image description here

Now you can call on any 'TimeMeasureStart' object anywhere in the model, similar to below where it sits in 'Main': enter image description here

Benjamin
  • 10,603
  • 3
  • 16
  • 28
  • It is generally a good idea to always check which options you have with any characteristic by clicking on that little switch icon. Sometimes, you can also load stuff easily from your database... – Benjamin Nov 16 '18 at 10:10
  • That was helpful, but another problem arose. The agent the end block is in, can have two different "parent" agents (two types of train stations). I want to measure the time from both of these. The problem is, that, when compiling, it always throws an exception for the other parent, of which the reference is obviously not there. I've tried setting the start block dynamically, depending on wheather the parent is one or the other station type, but I can't seem to find the proper attribute or method for setting the start block manually in the end block. Maybe you have an idea? – Snuffduff Nov 21 '18 at 11:37
  • After digging through the documentation for ages I found out that the method in question is called set_startObjects(TimeMeasureStart[]). I call this in an event occuring once and depending on what the parent is. The data is being collected in all child agents and displayed in separate histograms. How can I accumulate all of them in one single histogram to display in main? – Snuffduff Nov 21 '18 at 12:32
  • Hi SnuffDuff, can you actually turn this into a new issue here and describe from scratch (with screenshots...) your new problem? A little hard to understand ;-) – Benjamin Nov 21 '18 at 12:56
  • I will do so next time I have access to the model, as we only have a limited amount of licences at my university. – Snuffduff Nov 21 '18 at 13:21
  • again, not sure if this helps but it sounds like you need to check for the specific agent type using something like "if (agent instanceOf MyAgentType1) {..." This checks what parent class your agent has – Benjamin Nov 21 '18 at 14:32
  • Hey Benjamin, i have updated my question to maybe better explain the new problem. I hope it is clearer now. – Snuffduff Nov 27 '18 at 11:57