Access a property of a next entity on a link

General Simio discussions. THIS IS *NOT* A GOOD PLACE FOR SUPPORT QUESTIONS.
To limit spam this and all Public Forums have very limited ability to attach files. We recommend that support issues and more technical topics be initiated inside one of the Simio Insider (SI) forums below where you can attach your model and see example solutions. See above Welcome forum to join Simio Insiders.
Post Reply
sutthi
Posts: 2
Joined: Wed Dec 28, 2016 8:19 am

Access a property of a next entity on a link

Post by sutthi » Wed Dec 28, 2016 11:34 pm

I want to access a property of a next entity on a link.

For example, in Simbit "Checking Next Entity Ahead On Link", I want a speed of the next entity behind the current entity on a link. I refer to the behind entity and try to access other properties e.g. "NextEntityBehindOnLink.DesiredSpeed". However, it does not work.

How should i do to solve this problem?

dsturrock
Simio Team Member
Posts: 1455
Joined: Thu Mar 13, 2008 12:35 pm
Location: Sewickley, PA USA
Contact:

Re: Access a property of a next entity on a link

Post by dsturrock » Thu Dec 29, 2016 12:16 am

I think the problem was not in the actual expression you used, but HOW you were using it. If you use that expression when there is no following entity it will give an error. But I added this expression to that floor label in that same SimBit and it worked fine because I don't evaluate it when it is invalid.
and followed by {NextEntityBehindOnLink} at speed {Math.If(NextEntityBehindOnLink==Nothing,0,NextEntityBehindOnLink.DesiredSpeed)}
Dave Sturrock
VP Operations, Simio LLC

sutthi
Posts: 2
Joined: Wed Dec 28, 2016 8:19 am

Re: Access a property of a next entity on a link

Post by sutthi » Thu Dec 29, 2016 1:04 am

Thank you so much. That is clear, insight the problem.

Post Reply