Elevator bank entry/exit time

tomi_kosunen
Not applicable
0 Views
8 Replies
Message 1 of 9

Elevator bank entry/exit time

tomi_kosunen
Not applicable

[ FlexSim 21.2.0 ]

Hi. How can I set "traveler based" entry/exit time for elevator bank.?

The FlexScript code has only current as parameter, not the traveler.

0 Likes
Accepted solutions (1)
1 View
8 Replies
Replies (8)
Message 2 of 9

joerg_vogel
Not applicable

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.

0 Likes
Message 3 of 9

tomi_kosunen
Not applicable

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);

0 Likes
Message 4 of 9

joerg_vogel
Not applicable

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

0 Likes
Message 5 of 9

tomi_kosunen
Not applicable
Elevator is a TaskExecuter but ElevatorBank is not. It is Elevator in People class. Travellers are not subnodes of ElevatorBank (like they are for Elevator). I'm quite sure the travelers are somewhere under ElevatorBank tree but I cannot find them.
0 Likes
Message 6 of 9

moehlmann_fe
New Member
New Member

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:

https://docs.flexsim.com/en/21.2/Reference/PropertiesPanels/PeoplePanels/ElevatorBank/ElevatorBank.h...

You can suggest this as an idea in the forum though. Seems like this would be a useful functionality to add.

Message 7 of 9

tomi_kosunen
Not applicable

Thanks @Felix Möhlmann . activeTravelers was actually what I was looking for. I think I can modify the entry time calculation so that if recognizes the traveler.

Entry/Exit time should be calculated from the slowest traveler as he/she determines the elevator car filling/emptying. Yes, it would be nice to have the traveler based entry/exit time ready.

0 Likes
Message 8 of 9

lars_jacobsenNG49R
Advocate
Advocate

As Felix have said, you have to use process flow to get an event for each person entering the elevator. I have not been able to find any documentation of the various events you can listen to, but "OnTravelerArrival" works. However, it doesn't wait for each traveller to enter before firing the next event, so it is still a problem to set the correct EntryTime. In the attached mode I listen to entries and set to entry time. I hope you can use it for inspiration.

1631019268490.png

elebank-question2.fsm

0 Likes
Message 9 of 9

lars_jacobsenNG49R
Advocate
Advocate
Accepted solution

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.

1631256539890.png

1631256484967.png


elebank-question2.fsm

0 Likes

Type a product name