Hi. How can I set "traveler based" entry/exit time for elevator bank.?
The FlexScript code has only current as parameter, not the traveler.
Hi. How can I set "traveler based" entry/exit time for elevator bank.?
The FlexScript code has only current as parameter, not the traveler.
If you print current.name
into an output console from a trigger, what name do you see?
EDIT: “current”, “traveler” or “ts” are just names. More important is, how they are declared. “current” is most often a reference to the owner of an object trigger. This means if you see ”current” in an elevator trigger or function it is pointing to the elevator. In a network node you get a reference to the involved taskexecuter as “traveler”. “current” is pointing to the network node. In process flow “current” points to the process flow and if the process flow is an instance of an object, then “current” references to this object. I suggest you explore what a declared pointer references to. It is better to know, than to assume what a source code does. There are different approaches to read source code variables values while a model runs. But you should know what a variable value is while a code is executed. print(current.name)
is one method to get those values. I prefer this method, because it was once the only way to understand a code. And I stick with it. There are better methods like debugging console, but it is your choice, how to achieve knowledge over your code.
Using Event-triggered Source and listning for for "OnTravelerArrival" combined with setvarnum could be useful. There is still some issues concerning detecting when an elevator is full and the operator have to wait for the next elevator car. I hope it can give you some inspiration.
Thanks @Joerg Vogel , I understand that . current points to the Elevator (Bank) object. I tried to find the traveler from the ElevatorBank/Elevator (car) tree and couldn't find it. Do you know if there is a way to get pointer to the traveler or find the traveler from the tree?
I also noticed that current points to the current elevatorbank object. If I want to get statistics from the elevator car (elevator bank contains for example 2 cars), I have to put ElevatorBank elebank = current.as(ElevatorBank);
Elevator is a taskexecuter. Then any objects on or in him is a subnode. If you need his content, you get it by current.subnodes.length
If you need the statistical value then you have to cast a treenode direct into an object current.as(object).stats.content.value
The travelers can be found as subnodes of the following node in the tree:
treenode Travelers = <ElevatorBankObject>.find(">stats/activeTravelers");
This includes all TaskExecuters that are currently entering or exiting an elevator, inside (one of) the elevator(s) or waiting in front. Maybe you can use the "OnAStarElevatorEntry" and "OnAStarElevatorBankArrival" events (on the TaskExecuters, weirdly only in event triggered sources in process flow) to set labels to distinguish between them.
Also note, that the "Entry/Exit Time" is only evaluated once per exit/entry cycle. So you would have to use the average value for all TaskExecuters that are involved, if there are multiple ones waiting to enter/exit. Assigning individual times is currently not possible to my knowledge.
See also the section on the Entry/Exit-algorithm in the documentation:
You can suggest this as an idea in the forum though. Seems like this would be a useful functionality to add.
14 People are following this question.
FlexSim can help you understand and improve any system or process. Transform your existing data into accurate predictions.
FlexSim is a fully 3D simulation software environment. FlexSim can be used to simulate any process in any industry.
FlexSim®, FlexSim Healthcare™, Problem Solved.®, the FlexSim logo, the FlexSim X-mark, and the FlexSim Healthcare logo with stylized Caduceus mark are trademarks of FlexSim Software Products, Inc. All rights reserved.
Privacy | Do not sell or share my personal information | Cookie preferences | Report noncompliance | Terms of use | Legal | © Autodesk Inc. All rights reserved