question

Fiorenzo A avatar image
0 Likes"
Fiorenzo A asked Phil BoBo edited

AStar Divider: Recognize Divider in Rule Code

Hi,

In a model I create a table where on the rows I find model dividers and on the columns the operators. I would like to use a divider rule that points to the table cell instead of the operator label. In the rule code, however, I can only recognize the traveler and not the affected barrier. Is there a way to retrieve the information of which barrier is using that rule in that code?


Thank you in advance for the help.

FlexSim 20.0.8
flexsim 20.0.8dividersrule
1618480166040.png (139.7 KiB)
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

1 Answer

·
Jason Lightfoot avatar image
1 Like"
Jason Lightfoot answered Phil BoBo edited

I don't think this is possible - I'll add it to dev list.

· 5
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

Matthew Gillespie avatar image Matthew Gillespie ♦♦ commented ·

@Fiorenzo A But you can add different conditions to each barrier and get similar behavior.

1 Like 1 ·
Jason Lightfoot avatar image Jason Lightfoot ♦ Matthew Gillespie ♦♦ commented ·

Why would it be central then and not an attribute of the barrier?

1 Like 1 ·
Phil BoBo avatar image Phil BoBo ♦♦ Jason Lightfoot ♦ commented ·

Because they can be shared by multiple barriers. That doesn't stop you from adding one rule per barrier.

0 Likes 0 ·
Jason Lightfoot avatar image Jason Lightfoot ♦ Phil BoBo ♦♦ commented ·

If they're shared you're likely to want a barrier reference.

0 Likes 0 ·
Phil BoBo avatar image Phil BoBo ♦♦ Jason Lightfoot ♦ commented ·

The rules are evaluated once at the start of a travel path for a given traveler. The results of the rule evaluation are cached and used for every barrier that follows that rule. They are not evaluated for each barrier. Doing so would break the path caching mechanism that A* uses to significantly improve performance.

Changing the rules to be evaluated for every single barrier in order to be able to pass the barrier to the condition would require a large restructuring of how the system works. It also would greatly hinder the performance of a system that is already the main performance bottleneck in models that use it.

We discussed this issue as a dev group and decided to not change how the rules are evaluated. We're not going to pass the barriers into the rules. If you want to have a different rule for each barrier, then you need to add a rule for each barrier.

0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.